function Fid(id){
	return document.getElementById(id);
}
//产品滚动
var tpl_auto=2000; //值越大速度越慢
var tpl_speed=195;
var tpl_unit_auto=10;	//在移动一列时的速度
var tpl_unit_speed=60;	//在移动一列时的步长
var tmp_unit_speed;
var tpl_Mar_slow;
var tpl_Mar;
var tpl_dd;
var tpl_dd1;
var tpl_dd2;
function tpl_fun(){
	if(tpl_dd2.offsetWidth-tpl_dd.scrollLeft<=0){
		tpl_dd.scrollLeft-=tpl_dd1.offsetWidth;
	}else{
		tpl_Mar_slow=setInterval(tpl_moveslow,tpl_unit_auto);
		tmp_unit_speed=0;
	}
}
function tpl_moveslow(){
	if(tpl_speed-tmp_unit_speed>=tpl_unit_speed){
		tpl_dd.scrollLeft=tpl_dd.scrollLeft+tpl_unit_speed;
		tmp_unit_speed+=tpl_unit_speed;
	}else if(tpl_speed-tmp_unit_speed<tpl_unit_speed && tpl_speed-tmp_unit_speed>0){
		var tmp_zero_speed=tpl_speed-tmp_unit_speed;
		tpl_dd.scrollLeft=tpl_dd.scrollLeft+tmp_zero_speed;
		tmp_unit_speed+=tmp_zero_speed;
	}
	if(tpl_speed-tmp_unit_speed==0)
		clearInterval(tpl_Mar_slow);
}
function products_scroll(){
	tpl_dd=Fid("products_main");
	tpl_dd1=Fid("list1");
	tpl_dd2=Fid("list2");
	tpl_dd2.innerHTML=tpl_dd1.innerHTML;
	tpl_Mar=setInterval(tpl_fun,tpl_auto); //设置定时器
}

//输出flash
function outputflash(){
	document.write('<object type="application/x-shockwave-flash" data="images/bcastr4.swf?xml=js/bcastr.xml" width="960" height="287">');
	document.write('<param name="movie" value="images/bcastr4.swf?xml=js/bcastr.xml" />');
	document.write('<param name="menu" value="false" />');
	document.write('<param name="wmode" value="Opaque" />');
	document.write('</object>');
}

//400滚屏
document.write('<div id="divMenu" style="z-index:1;position:absolute;right:25px;top:150px;width:140px;">');
document.write('<img src="images/400.gif" /><img src="images/400_2.gif" /><img src="images/400_3.gif" />');
document.write('</div>');

var onlineService = ( document.compatMode.toLowerCase()=="css1compat" ) ? document.documentElement : document.body;
var boxService = document.getElementById("divMenu").style;
function ServiceR() {
	boxService.top = ( onlineService.scrollTop + onlineService.clientHeight - 260 ) + "px";
	boxService.left = ( onlineService.scrollLeft + onlineService.clientWidth - 144 ) + "px";
}
setInterval(ServiceR,98);

//日期时间
function showtime(){
	var charday = new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六");
	Today = new Date(); 
	var NowYear = Today.getFullYear();
	var NowMonth = Today.getMonth()+1;
	var NowDate = Today.getDate();
	var NowDay = Today.getDay();
	document.write(NowYear+"年"+NowMonth+"月"+NowDate+"日"+"&nbsp;"+charday[NowDay]);
}

function fiveys(cname){
	for(i=1;i<=5;i++){
		Fid("five0"+i+"_b").className="five_b2";
	}
	Fid(cname+"_b").className="five_b";
	for(i=1;i<=5;i++){
		Fid("five0"+i+"_c").className="five_c2";
	}
	Fid(cname+"_c").className="five_c";
}

function gotopage(url){
	index1=selectpages.selectedIndex;
	valuepage=selectpages.options[index1].value;
	if(url.indexOf("?")==-1){
		url=url+"?curpage="+valuepage;
	}else
		url=url+"&curpage="+valuepage;
	window.location=url;
}

