function startSearch(){
 document.getElementById("search").focus();
}
$(document).ready(function() {
        if ($.browser.msie && $.browser.version <= 6.0) {
            $(".globalNav li").hover(
                 function() {
                     $(this).children("ul").attr("style", "display: block");
                 },
                  function() {
                      $(this).children("ul").attr("style", "");
                  })
        }
    });    

function setTab(name,num,n){
	for(i=1;i<=n;i++){
		var menu=document.getElementById(name+i);
		var con=document.getElementById(name+"_"+"con"+i);
		menu.className=i==num?"now":"";
  		con.style.display=i==num?"block":"none"; 
	}
}

function doPrint() { 
	bdhtml=window.document.body.innerHTML; 
	sprnstr="<!--startprint-->"; 
	eprnstr="<!--endprint-->"; 
	prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17); 
	prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr)); 
	window.document.body.innerHTML=prnhtml; 
	window.print(); 
}


// JavaScript Document
jQuery.fn.loadthumb = function(options) {
	options = $.extend({
		 src : ""
	},options);
	var _self = this;
	_self.hide();
	var img = new Image();
	$(img).load(function(){
		_self.attr("src", options.src);
		_self.fadeIn("slow");
	}).attr("src", options.src);  
	return _self;
}

$(document).ready(function(){
	 var len  = $(".num > li").length;
	 var index = 0;
	 var adTimer;
	 $(".num li").mouseover(function(){
		index  =   $(".num li").index(this);
		showImg(index);
	 }).eq(0).mouseover();	

	 $('.featured').hover(function(){
			 clearInterval(adTimer);
		 },function(){
			 adTimer = setInterval(function(){
			    index++;
				if(index==len){index=0;}
				showImg(index);				
			  } , 6000);
	 }).trigger("mouseleave");
});
function showImg(index){
		var href = ["http://www.clotus.com.cn/newsinfo.asp?id=214",
		"http://www.clotus.com.cn/newsinfo.asp?id=263",
		"http://www.clotus.com.cn/knowledge_info.asp?id=268",
		"http://www.clotus.com.cn/productinfo.asp?id=91",
		"http://www.clotus.com.cn/productinfo.asp?id=94",
		"http://www.clotus.com.cn/productinfo.asp?id=97"];

		var src = ["http://www.clotus.com.cn/templates/BlueFactory/clotus09.jpg",
			"http://www.clotus.com.cn/templates/BlueFactory/clotus21.jpg",
		    "http://www.clotus.com.cn/templates/BlueFactory/banner-focus01.jpg",
			"http://www.clotus.com.cn/templates/BlueFactory/banner-focus02.jpg",
			"http://www.clotus.com.cn/templates/BlueFactory/banner-focus04.jpg",
			"http://www.clotus.com.cn/templates/BlueFactory/clotus22.jpg"
			];

		$(".featured a").attr("href",href[index]);
		$(".featured img").loadthumb({src:  src[index] });
		$(".num li").removeClass("on")
		.eq(index).addClass("on");
}



