// JavaScript Document
$(document).ready(function(){
/*	$("#LeButton li").bind("mouseover",function(){
		$(this).siblings().removeClass();
		$(this).addClass("thison");
		$("#LeContent li").siblings().removeClass();
		$("#LeContent li").eq($(this).index()).addClass("thison");
	});*/
	
	$(".MarqueeText").YlMarquee({
        textMode:true,
        width: 580,
		step: 1
		
    });
	
	$("#Diamond_Company").YlMarquee({
        visible:10,
        vertical: true,
        textMode: true,
        step: 1
    });
	
	$("#res_scroll").YlMarquee({
        visible:12,
        vertical: true,
        textMode: true,
        step: 1
    });
	
	new switchContent("#LeButton","#LeContent","thison");
	new switchContent("#sw_001","#sw_co_001","thison");
	new switchContent("#sw_002","#sw_co_002","thison");
	new switchContent("#sw_003","#sw_co_003","thison");
	new switchContent("#sw_004","#sw_co_004","thison");
	new switchContent("#sw_005","#sw_co_005","thison");
	new switchContent("#sw_006","#sw_co_006","thison");
	new switchContent("#bcpBut","#bcpContent","bcpShow");
	new switchContent("#bcoBut","#bcoContent","bcoShow");
	new switchContents("#ts_top_button","#ts_left_button","#ts_right_content","thison");
	new switchContents("#wk_top_button","#wk_left_button","#wk_right_content","thison");
	new switchContent("#YhButton","#YhContent","yhshow");
	setInterval("GetTime()",1000);
	
	

});


function GetTime()
{
  var mon,day,now,hour,min,ampm,time,str,tz,end,beg,sec;                
  day=new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六");               
  now=new Date(); 
  hour = now.getHours();
  min = now.getMinutes(); 
  sec = now.getSeconds();
  if(hour<10)
  {
	 hour="0"+hour;
  }            
  if(min<10)
  {
		min="0"+min;
  } 
  if(sec<10)
  {
	 sec="0"+sec;
  }
  $(".MarqueeTextRight").html("<nobr>"+now.getFullYear()+"年"+(now.getMonth()+1)+"月"+now.getDate()+"日 "+day[now.getDay()]+" "+hour+":"+min+":"+sec+"</nobr>");
}

function goSearch(keyword){
//	$(".SearchBox> :form :text").attr({"value":keword})
	$(".SearchBox>form").find("input[name='q']").attr({value:keyword});
	$(".SearchBox>form").submit();
	return false;
}
//http://www.baochunsteel.com/search/?q=%BF%F3%CA%AF&type=all

function switchChat(){

	if (baochunchat.autoScroll==true)
	{
		baochunchat.autoScroll=false;
		$(".steel_res_top_left").css("background","url(/images/chatbg_2.jpg)");
	}
	else
	{
		baochunchat.autoScroll=true;
		$(".steel_res_top_left").css("background","url(/images/chatbg.jpg)");
		
	}
}
