JQ = $;  //rename $ function
var __defaultImage="<?php bloginfo('stylesheet_directory'); ?>/images/00.jpg";
JQ(function(){
	//script for search
	if(JQ("#s").val()==''){
		JQ("#s").val("键入您要搜索的关键字");
		//alert(JQ("#s").val());
		JQ("#s").bind("focus",function(){
			JQ("#s").val("");
			});
	};
	JQ(".search-right a").bind("click",function(){
		JQ("#s").val(JQ.trim(JQ(this).text()));
		JQ("#searchform").submit();
	});
	//script for search end
	
	//案列的特效
	JQ(".reveal-img li").hover(
			function(){
				JQ(".reveal-img li").removeClass("first-list");
				JQ(".re-main li").hide();
				JQ(".re-main span").hide();
				JQ(".re-right span").hide();
				JQ(this).addClass("first-list");
				JQ("#img_"+JQ(this).attr("name")).show();
				JQ("#text_"+JQ(this).attr("name")).show();
				JQ("#content_"+JQ(this).attr("name")).show();
				},
			function(){
				} 
		);
	
	//produts in sitemap 
	JQ("#productCat li:first").addClass("major-select");
	JQ("#productCat-content ul:first").show();
	
	JQ("#productCat-img ul:first").show();
	JQ("#productCat li").hover(
			function(){
				JQ("#productCat li").removeClass("major-select");
				JQ(this).addClass("major-select");	
				JQ("#productCat-content ul").hide();
				JQ("#productCat-img ul").hide();
				JQ("ul."+JQ(this).attr("name")+"content").show();						
				},function(){
					}
			);
	JQ("#productCat-content li").hover(
			function(){
				JQ("#productCat-img li").hide();
				JQ("#productCat-img li."+JQ(this).attr("name")+"img").show();						
				},function(){
					}
			);	
	
}); 

JQ(document).ready(function(){
	//for the faq
						   JQ(".faq div:eq(2)").css("display","block");
						   JQ(".faq div:eq(1)").addClass("faq-title-01");
			JQ(".faq .faq-title").click(
								  function(){ 	
								  	 if (JQ(this).siblings(".center").get(0).style.display =="block")
									 {
		    				        JQ(this).removeClass("faq-title-01");
						             }
									 else
									 {
							  JQ(".faq .faq-title").removeClass("faq-title-01");
							  JQ(this).addClass("faq-title-01"); 
							   JQ(".faq div").siblings(".center:not(:animated)").slideUp("slow");
						 				 };
									  JQ(this).next("div").slideToggle("slow");	  
									  	});
			});


JQ(document).ready(function(){
	//设置class为reveal-list的宽度，值为其子元素的width的总和+padding+margin
	JQ("#marquee .reveal-list").width((JQ(".reveal-list").children("li").width()+14)*(JQ(".reveal-list").children("li").size()/2));	
	//设置产品详细页的图片
	JQ("#produtct-detail img").wrap("<a rel='lightbox' href='"+JQ("#produtct-detail img").attr("src")+"'></a>"); 	
	//限定图片的高度，使之适应相关比例
	JQ("#produtct-detail img").height("310px");
	JQ("#produtct-detail img").width("auto");
	//招商加盟
	JQ(".learue-list li").hover(
			function(){
				JQ(".learue-list li").removeClass("pick");
				JQ(this).addClass("pick");
				JQ("#learur-content p").hide();
				JQ("#content_"+JQ(this).attr("name")).show();
				},
			function(){
				} 
		);	
	//下拉菜单
	JQ(".children").wrap("<div class='nav-x'></div>"); 	
	//JQ(".children").before("<span class='left'></span>");
	//JQ(".children").after("<span class='right'></span>");					   
	JQ(".nav li").hover(
	function(){			
		JQ(this).children("div").show();
		JQ(this).children("div").children("ul").show();
		//var tmpWidth=JQ(this).children("div").children("ul").width();
		var tmpWidth=0;
		JQ(this).children("div").children("ul").children("li").each(function(){
			tmpWidth += JQ(this).outerWidth("true");
			});		
		if(tmpWidth<100){tmpWidth+=4};
		JQ(this).children("div").css("right",-(tmpWidth/2-50));
		JQ(this).children("div").width(tmpWidth+'px');
		},
	function(){
		JQ(this).children("div").hide();
		}
	)	
}
);


function play_flash(ur,w,h){
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+w+'" height="'+h+'"> ');
    document.write('<param name="movie" value="' + ur + '">');
    document.write('<param name="quality" value="high"> ');
    document.write('<param name="wmode" value="transparent"> ');
    document.write('<param name="menu" value="false"> ');
    document.write('<embed src="' + ur + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'"></embed> ');
    document.write('</object> ');
}
