jQuery(document).ready(function ($) {


var id=$(".signal2").data("id");
  
$.ajax({
		url: '/ad.php',
		type: 'post',
		dataType: 'html',
		data: { id:id},
		success: function(b) {
					
 	$(".signal2").prepend(b)  		
		
		},
		error: function() {},
	})



	})

function loadImg()
{
	Echo.init({
		offset: 0,	 //离可视区域多少像素的图片可以被加载
	　　 throttle: 0 //图片延时多少毫秒加载
	}); 
}

function gundong()
{
	try
	{		
		if(demoHeight && demoWidth)
		{
			$(function(){ 
				$('.slider').css("width",demoWidth);
				$('.slider').css("height",demoHeight);	
				$('.slider li').css("width","18.8rem");
				$('.slider li').css("height",demoHeight);		
				$('.slider img').css("width",demoWidth);
				$('.slider img').css("height",demoHeight);	
			}); 			
			$(".slider").YuxiSlider({
				control:$('.control'), //绑定控制按钮
				during:4000, //间隔4秒自动滑动
				speed:800, //移动速度0.8秒
				mousewheel:true, //是否开启鼠标滚轮控制
				direkey:true //是否开启左右箭头方向控制
			});	
		}
	}catch(e){}
}

function qh(cur,all,biao)
{
	for (var ii=1;ii<=all;ii++)
	{
		if($$(biao+"_"+ii))
		{
			$$(biao+"_"+ii).className=($$(biao+"_"+ii).getAttribute('class')+"").replace(" cur","");
			$$(biao+""+ii).className=($$(biao+""+ii).getAttribute('class')+"").replace(" no_show","")+" no_show";
		}
	}
	if($$(biao+"_"+cur))
	{
		$$(biao+"_"+cur).className=($$(biao+"_"+cur).getAttribute('class')+"").replace(" cur","")+" cur";
		$$(biao+""+cur).className=($$(biao+""+cur).getAttribute('class')+"").replace(" no_show","");
	}
	if($$("titleV"))
	{
		$$("titleV").innerHTML=$$(biao+"_"+cur).innerHTML;
	}
}

function load_Nav()
{
	var A=['zuqiu','lanqiu','dianjing'];
	var B=['shijiebei','yingchao','ouguan','nba','xijia','zhongchao','yijia','dejia','fajia','cba','ouzhoubei','dianjing'];	
	var C=['zuqiu','zuqiu','zuqiu','lanqiu','zuqiu','zuqiu','zuqiu','zuqiu','zuqiu','lanqiu','zuqiu','dianjing'];		
	var url=window.location.href+"";
	    url=url.toLowerCase();
	for(var ii=0;ii<A.length;ii++)
	{
		if(url.split(A[ii]).length>1)
		{
			$(".header ul li."+A[ii]+"").addClass('active').siblings().removeClass('active');
		}
	}
	for(var ii=0;ii<B.length;ii++)
	{
		if(url.split(B[ii]).length>1)
		{
			$(".sub_nav a."+B[ii]+"").addClass('cur').siblings().removeClass('cur');
			$(".header ul li."+C[ii]+"").addClass('active').siblings().removeClass('active');
		}
	}	
}

$(function(){ 

	loadImg();
	gundong();
	load_Nav();
	
}); 

function ShowMore(n)
{
	for (var ii=1;ii<=10;ii++)
	{
		if(document.getElementById('bifenLanmu'+ii))
		{
			document.getElementById('bifenLanmu'+ii).className='bifenLanmu no_show';
		}
	}
	document.getElementById('bifenLanmu'+n).className='bifenLanmu';
	document.getElementById('bifenLanmu'+n).onclick=function (){this.className='bifenLanmu no_show';}
}
function ShowMoreNav(n)
{
	if(n)
	{
		$('.MoreNav').addClass('no_show');		
	}
	else
	{
		$('.MoreNav').removeClass('no_show');		
	}
}

