// JavaScript Document
function ScrollLeft()
{
	var speedp=35;  
	var demo2p=document.getElementById("demo2p");  
	var demo1p=document.getElementById("demo1p");
	var trsp=demo1p.getElementsByTagName("tr");
	if(trsp.length>=3)
	{
		demo2p.innerHTML=demo1p.innerHTML;
		var demop=document.getElementById("ttp");
		function Marqueep(){  
		if(demo2p.offsetWidth-demop.scrollLeft<=0)  
		demop.scrollLeft=0;  
		else{  
		demop.scrollLeft+=1;  
		}  
		}  
		var MyMarp=setInterval(Marqueep,speedp);  
		demop.onmouseover=function() {clearInterval(MyMarp)}  
		demop.onmouseout=function() {MyMarp=setInterval(Marqueep,speedp)} 
	}
}
function scrollTop()
{
	var _wrap=$('#marqueetop');
	var _interval=8000;
	var _moving;
	_wrap.hover(function(){
	clearInterval(_moving);
	},function(){
		_moving=setInterval(function(){
			//处理奇数时无结束</li>
			if($('#marqueetop .sjhl_active').length%2!=0)
			{
				$('#marqueetop').append('</li>');
			}
			var _field=_wrap.find('li:first');
			var _h=_field.height();
			_field.animate({marginTop:-_h+'px'},600,function(){
				_field.css('marginTop',0).appendTo(_wrap);
				})
			},_interval)
		}).trigger('mouseleave');
}
function mousehover()
{
	var nh=$("#newhover");
	nh.find("dt").each(function(i){
		$(this).find("li").each(function(i){
			$(this).hover(function(){
				nh.find("dl").css('display','none');
				nh.find("dl").eq(i).css('display','block');					   
			},function(){});							 
		});						
	});
}
function imghover()
{
	$("ul#producttype img").each(function(i){
		$(this).hover(function(){
			$(this).animate({opacity:0.6},{duration:500});					   
		},function(){
			$(this).animate({opacity:1},{duration:500});		
		});									  
	});	
}
function init()
{
	<!--
	var focus_width=950//图片宽
	var focus_height=340//图片高
	var text_height=0//设置显示文字标题高度,最佳为20（如果不显示标题值设为0即可）
	var swf_height = focus_height+text_height
	var pics='/images/04.jpg|/images/05.jpg|/images/06.jpg|/images/07.jpg'//图片路径及图片的数量
	var links=''
	var texts=''//图片文字标题   

		var listmy='<object ID="focus_flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">';
		listmy+='<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="images/adplay.swf"><param name="quality" value="high"><param name="bgcolor" value="#ffffff">';
		listmy+='<param name="menu" value="false"><param name=wmode value="opaque">';
		listmy+='<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">';
		listmy+='<embed ID="focus_flash" src="images/adplay.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#ffffff" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';listmy+='</object>'; 
		$('#mytop').html(listmy);
		//-->
}
$(document).ready(function(){
	try{init()}catch(e){}
	try{ScrollLeft()}catch(e){}	
	try{scrollTop()}catch(e){}
	try{mousehover()}catch(e){}
	try{imghover()}catch(e){}
});
