$(document).ready(function(){
	var count
	$(".header_thi .here").mouseover(function(){
		if($(".header_thi .pop2").css("display")!="block"){
			count=setTimeout(function(){
				$(".header_thi .pop1").css("text-decoration","underline");
				$(".header_thi .pop1").css("display","block");
				$(".header_thi .pop2").css("display","block");
			},0);
		}

		if($(".header_thi .pop4").css("display")=="block"){
			$(".header_thi .pop3").css("display","none");
			$(".header_thi .pop4").css("display","none");
		}
	});
	
	$(".header_thi .here").mouseout(function(){
		if($(".header_thi .pop2").css("display")!="block"){
			clearTimeout(count);
		}
	})

	$(".header_thi .pop2").mouseover(function(){
		$(".header_thi .pop1").css("display","block");
		$(".header_thi .pop2").css("display","block");
	});
	$(".header_thi .pop1").mouseout(function(){
		clearTimeout(count);
		$(".header_thi .pop1").css("display","none");
		$(".header_thi .pop2").css("display","none");
		$(".header_thi .pop1").css("text-decoration","none");
	});
	
	$("ol.pop2").mouseout(function(){
		$(".header_thi .pop1").css("display","none");
		$(".header_thi .pop2").css("display","none");
	});

	$(".header_thi .there").mouseover(function(){
		if($(".header_thi .pop4").css("display")!="block"){
		count=setTimeout(function(){
		$(".header_thi .pop3").css("text-decoration","none");
		$(".header_thi .pop3").css("display","block");
		$(".header_thi .pop4").css("display","block");
		},0);
	}
		if($(".header_thi .pop2").css("display")=="block"){
			$(".header_thi .pop1").css("display","none");
			$(".header_thi .pop2").css("display","none");
		}
	});
	
	$(".header_thi .there").mouseout(function(){
		if($(".header_thi .pop4").css("display")!="block"){
		clearTimeout(count);
		}
	})

	$(".header_thi .pop4").mouseover(function(){
		$(".header_thi .pop3").css("display","block");
		$(".header_thi .pop4").css("display","block");
	});
	$(".header_thi .pop3").mouseout(function(){
		clearTimeout(count);
		$(".header_thi .pop3").css("display","none");
		$(".header_thi .pop4").css("display","none");
		$(".header_thi .pop3").css("text-decoration","none");
	});
	
	$("ol.pop4").mouseout(function(){
		$(".header_thi .pop3").css("display","none");
		$(".header_thi .pop4").css("display","none");
	});
    

	
	$(".my_sell").mouseover(function(){
		$(this).addClass("hover");
		$(".menu_sell").css("display","block");
		$(".menu_sell .pop2").css("display","block");
		$(".blue_col").css("background-color","#ffffff");
	}).mouseout(
	function(){
		$(this).removeClass("hover");
		$(".menu_sell").css("display","none");
		$(".menu_sell .pop2").css("display","none");
		$(".blue_col").css("background-color","transparent");
	}
	)
	
		$(".help").mouseover(function(){
		$(this).addClass("hover");
		$(".menu_help").css("display","block");
		$(".menu_help .pop4").css("display","block");
		$(".help_a").css("background-color","#ffffff");
	}).mouseout(
	function(){
		$(this).removeClass("hover");
		$(".menu_help").css("display","none");
		$(".menu_help .pop4").css("display","none");
		$(".help_a").css("background-color","transparent");
	}
	)
/**	$(".wym").mouseover(function(){
		$(".text2 .pop1").css("display","block");
		$(".text2 .pop2").css("display","block");
		$(".text2 .pop3").css("display","none");
		$(".text2 .pop4").css("display","none");
	});
	$(".text2 .pop1").mouseout(function(){
		$(".text2 .pop1").css("display","none");
		$(".text2 .pop2").css("display","none");
	});
	$(".text2 .pop2").mouseover(function(){
		$(".text2 .pop1").css("display","block");
		$(".text2 .pop2").css("display","block");
	}).mouseout(function(){
		$(".text2 .pop1").css("display","none");
		$(".text2 .pop2").css("display","none");
	});
	
	$(".help").mouseover(function(){
		$(".text2 .pop3").css("display","block");
		$(".text2 .pop4").css("display","block");
		$(".text2 .pop1").css("display","none");
		$(".text2 .pop2").css("display","none");
	});
	$(".text2 .pop3").mouseout(function(){
		$(".text2 .pop3").css("display","none");
		$(".text2 .pop4").css("display","none");
	});
	$(".text2 .pop4").mouseover(function(){
		$(".text2 .pop3").css("display","block");
		$(".text2 .pop4").css("display","block");
	}).mouseout(function(){
		$(".text2 .pop3").css("display","none");
		$(".text2 .pop4").css("display","none");
	});
	**/
	



$(".searchTest").click( function () { 
  $(this).val("");
}); 
$(".searchTest").blur( function () { 
   if($(this).val()==""){
    $(this).val("请输入商品名称(英文)");
   }
}); 
$(".hotSearch .btnLow em").click( function () { 
	var searchTest=$(".searchTest").val();
	if(searchTest!="" && searchTest!="请输入商品名称(英文)"){
	window.open("http://www.ebay.cn/research/?q="+searchTest);
}
}); 


//今日帖数
 if($('#bbsnum').length > 0){
    $.ajax({
     type: "GET",
     url: "/announce_ajax.php?action=alltoday",
     success: function(msg){
     $('#bbsnum').html("今日贴数："+msg);
      }
});
 }
  


//外贸大学时间
var timestr=$('#timestr').text();
//year=2010#month=07#date=14#hour=14#minite=00
timestrarr = timestr.split("#");
var now=new Date();
var year = timestrarr[0];
var month = timestrarr[1]-1;
var date = timestrarr[2];
var hour = timestrarr[3];
var minite = timestrarr[4];
	var newYear = new Date(year, month, date, hour, minite);
    var   diffmin   =   parseInt((newYear.valueOf() - now.valueOf())/(1000*60),10);//时间差；分钟数
    var newYear = new Date(year, month, date, hour, minite);
    //alert(diffmin);
    if(diffmin>=36*60){
     $(".timeBtn").html('课程未开始...').css("color","#aca899"); 
    }
   	if(diffmin<36*60 && diffmin>2*60){
     $(".timeBtn").countdown({until: newYear, format: 'HMS', layout:'距离开课时间 {h<}{hnn}:{h>}{mnn}:{snn}'}); 
	}  
	if(diffmin<=2*60 && diffmin>=0){
	  $(".timeBtn").html('进入课堂');
	}  
	if(diffmin<0 && diffmin>=-60){
	  $(".timeBtn").html('课程进行中');
	} 
	if(diffmin<=-60){
	  $(".timeBtn").html('课程已结束');
	} 
	if(diffmin<=2*60){
    $('.timeBtn').click(function(){
     window.open (timestrarr[5]) ;
     })
	}


});

