﻿// JavaScript Document
var menuTimer;
$(function(){
	
	//主站首页中间轮转图
	$('.zksoChange .imgList img').soChange({
		thumbObj:'.imgIndex li span', 
		thumbNowClass:'on', 
		changeTime:4000
	});
 
	$(".mall_Lmenu").mouseleave(function(){
		if(menuTimer){clearTimeout(menuTimer)}
	   menuTimer=setTimeout(function(){$(".hoverShow:visible").css({"display":"none"})},500);
	 });
	 $(".postionR").mouseenter(function(){
		 if(menuTimer){clearTimeout(menuTimer)}
	 });
	 $(".postionR").mouseleave(function(){
		 menuTimer=setTimeout(function(){$(".hoverShow:visible").css({"display":"none"})},500);
	 });
	 
	 
	 
	 
   $(".zkLI li").bind("mouseenter",function(){
    	$(this).parent().find("li.hoverThis").removeClass("hoverThis");
		$(this).addClass("hoverThis");									
	})
   $(".zkLI li.hoverThis").removeClass("hoverThis"); 

	 $(".zkLI").each(function(){
	      $(this).find("li:first").addClass("hoverThis"); 
	 });
	 
	 	//Tabs
	 $('.zksc_con').soChange({
		thumbObj:'.zksc_index li',//导航对象指向标题h3
		slideTime:0,
		thumbOverEvent:false,
		autoChange:false
	});	//Tabs
	
			 	//Tabs 主站搜索
	 $('.tabso_main li').soChange({
		thumbObj:'.tabso_index li',//导航对象指向标题h3
		slideTime:0,
		thumbNowClass:'on', 
		thumbOverEvent:false,
		autoChange:false
	});	//Tabs
	  
// 搜索栏
$(".tabso_main").find("input[type=text]").each(function(i){
       $(this).data("val",$(this).val());
       $(this).bind("focus",function(){
           if($(this).val()==$(this).data("val"))
           {
               $(this).val("");
               $(this).css({"color":"#222"});
           }
       });
       $(this).bind("blur",function(){
           if($(this).val()=="")
           {
             $(this).css({"color":"#CCC"});
             $(this).val($(this).data("val"));
             
           }
       });
});


$(".tabso_main").find("form").bind("submit",function(){
    $(this).find("input[type=text]").each(function(){
          if($(this).data("val")==$(this).val())
          { 
             $(this).val("");
          }
    })
})



 // 搜索栏
	 
   $("a[target='_blank']").each(function(){
	   var src=$(this).attr("href");
	   if(src=="#"||src=="#;")
	   {
	      $(this).attr({"target":""});
	   }
	});
});


function hsShow(id)
{
	$(".hoverShow:visible").css({"display":"none"});
	if(menuTimer){clearTimeout(menuTimer)}
	$(".HS_"+id).css({"display":"block"});
}
 
//回到顶部
    $(function(){ 
        var floatHtml="<div id='fixed' style='display:none; position:fixed; right:10px; bottom:100px; background: url(/images/go-top.png) no-repeat right top; width:22px; height:63px;'><a href='#' style='display:block; width:100%; height:100%; outline:0px; text-decoration:none;'>&nbsp;</a></div>";
          
        if($.browser.msie&&$.browser.version=="6.0" ){
            floatHtml="<div id='fixed' style='display:none;position:absolute; right:27px; bottom:100px; background: url(/images/go-top.png) no-repeat right top; width:22px; height:63px;'><a href='#' style='display:block; width:100%; height:100%; outline:0px; text-decoration:none;'>&nbsp;</a></div>";
            
        }  

         $("body").append(floatHtml);  
         
          if($.browser.msie&&$.browser.version=="6.0" ){ //IE6 下
             $(window).bind("scroll",function(){ 
                    if($(document).scrollTop()>300){
                        $("#fixed").css({"display":""}); 
                        $("#fixed").css({"top":$(document).scrollTop()+$(window).height()-$("#fixed").outerHeight()-100});
                    }else
                    {
                        $("#fixed").css({"display":"none"});
                    }   
             }); 
          }else{
                $(window).bind("scroll",function(){ 
                    if($(document).scrollTop()>300){
                        $("#fixed").css({"display":""});  
                    }else
                    {
                        $("#fixed").css({"display":"none"});
                    }   
               });
          }
         
    });
