	//左右走	var zuoyouNo = 0;	var runZuoYouInterval = 5000;	var zuoYouRunFlag = setInterval('autoRunZuoYou()', runZuoYouInterval);	function autoRunZuoYou()	{		zuoyouNo++;		if( zuoyouNo == $("#zuoyou>div").size() ) zuoyouNo = 0;		$('#zuoyou>div').hide().eq(zuoyouNo).show("quick");	}	function startAutoRunZuoYou(){		clearInterval(zuoYouRunFlag);		zuoYouRunFlag = setInterval('autoRunZuoYou()', runZuoYouInterval);	}	function stopAutoRunZuoYou(){		clearInterval(zuoYouRunFlag);	}	//最好的商品的js	var currentBestGoodsNo = 0;	var bestGoodsNum = 3;	var runBestGoodsInterval = 5000;	var bestGoodsRunFlag = setInterval('autoRunBestGoods()', runBestGoodsInterval);	function autoRunBestGoods()	{		currentBestGoodsNo++;		if( currentBestGoodsNo == bestGoodsNum ) currentBestGoodsNo = 0;		$('.hotgoodsul').hide().eq(currentBestGoodsNo).show();		$('#shuzi_hot>a').removeClass('hover').eq(currentBestGoodsNo).addClass('hover');	}	function startAutoRunBestGoods(){		clearInterval(bestGoodsRunFlag);		bestGoodsRunFlag = setInterval('autoRunBestGoods()', runBestGoodsInterval);	}	function stopAutoRunBestGoods(){		clearInterval(bestGoodsRunFlag);	}		//最新的商品的js	var currentNewGoodsNo = 0;	var newGoodsNum = 3;	var runNewGoodsInterval = 5000;	var newGoodsRunFlag = setInterval('autoRunNewGoods()', runNewGoodsInterval);	function autoRunNewGoods()	{		currentNewGoodsNo++;		if( currentNewGoodsNo == newGoodsNum ) currentNewGoodsNo = 0;		$('.newgoodsul').hide().eq(currentNewGoodsNo).show();		$('#shuzi_new>a').removeClass('hover').eq(currentNewGoodsNo).addClass('hover');	}	function startAutoRunNewGoods(){		clearInterval(newGoodsRunFlag);		newGoodsRunFlag = setInterval('autoRunNewGoods()', runNewGoodsInterval);	}	function stopAutoRunNewGoods(){		clearInterval(newGoodsRunFlag);	}		//品牌商品的js	var currentBrandNo = 0;	var BrandNum = 6;	var runBrandInterval = 5000;	var brandRunFlag = setInterval('autoRunBrand()', runBrandInterval);	function autoRunBrand()	{		currentBrandNo++;		if( currentBrandNo == BrandNum ) currentBrandNo = 0;		$('.brandarea-logo>span').removeClass('visited').eq(currentBrandNo).addClass('visited');		$('.brandarea-more>div').hide().eq(currentBrandNo).show();		$('.brandarea-pic>a').hide().eq(currentBrandNo).show();	}	function startAutoRunBrand(){		clearInterval(brandRunFlag);		brandRunFlag = setInterval('autoRunBrand()', runBrandInterval);	}	function stopAutoRunBrand(){		clearInterval(brandRunFlag);	}	$(document).ready(function(){	setTimeout(function(){		$("#haMarks").hide("fast");		$("#haControl>img").attr("src","http://s.happimg.com/images/btn/btn_happimarks1.gif");		$("#haControl>img").attr("title","展开");	}, 30000);			var visited_time; //菜单选择的时候使用		//最好的商品右侧的js	$('.newstp>p').each(function(i){		$(this).mouseover(function(){			$('.newstp>p').find('a:even').removeClass("visited");			$('.newstp>p').find('a:odd').hide();			$(this).find('a:odd').show();			$(this).find('a:even').addClass("visited");		});	});	//最好的商品的js	$('#shuzi_hot>a').each(function(i){		$(this).mouseover(function(){			$('#shuzi_hot>a').removeClass('hover').eq(i).addClass('hover');			$('.hotgoodsul').hide().eq(i).show();			stopAutoRunBestGoods();		}).mouseout(startAutoRunBestGoods);	});	//最新的商品的js	$('#shuzi_new>a').each(function(i){		$(this).mouseover(function(){			$('#shuzi_new>a').removeClass('hover').eq(i).addClass('hover');			$('.newgoodsul').hide().eq(i).show();			stopAutoRunNewGoods();		}).mouseout(startAutoRunNewGoods);	});		//品牌的js	$('.brandarea-logo>span').each(function(i){		$(this).mouseover(function(){			$('.brandarea-logo>span').removeClass('visited').eq(i).addClass('visited');			$('.brandarea-more>div').hide().eq(i).show();			$('.brandarea-pic>a').hide().eq(i).show();			stopAutoRunBrand();		}).mouseout(startAutoRunBrand);	});		//左右商品	$('#zuo').click( function () {		clearInterval(zuoYouRunFlag);		zuoyouNo--;		if(zuoyouNo == -1 ){			zuoyouNo = $("#zuoyou>div").size() - 1;		}		$('#zuoyou>div').hide().eq(zuoyouNo).show("fast");		zuoYouRunFlag = setInterval('autoRunZuoYou()', runZuoYouInterval);	});	$('#you').click( function () {		clearInterval(zuoYouRunFlag);				zuoyouNo++;		if(zuoyouNo == $("#zuoyou>div").size() ){			zuoyouNo = 0;		}		$('#zuoyou>div').hide().eq(zuoyouNo).show("fast");		zuoYouRunFlag = setInterval('autoRunZuoYou()', runZuoYouInterval);	});		//左侧菜单	$('#webmenu li').bind("mouseenter",function(){		$(this).children('ul').stop(true,true).show('quick');		var parentClass = $(this).parent('ul').attr("class");		if( parentClass == 'third-menu' || parentClass == 'second-menu' || parentClass == 'second-menuno' ){			clearTimeout(visited_time);			if( ! $(this).parent('ul').parent('li').hasClass("visited") ){				$(this).parent('ul').parent('li').addClass("visited");}		}	});	$('#webmenu li').bind("mouseleave",function(){		$(this).children('ul').stop(true,true).hide('quick');		var parentClass = $(this).parent('ul').attr("class");		if( parentClass == 'third-menu' || parentClass == 'second-menu' || parentClass == 'second-menuno' ){			if( $(this).parent('ul').parent('li').hasClass("visited") ){				var self = this;				visited_time = setTimeout(function(){					$(self).parent('ul').parent('li').removeClass("visited");				}, 100);			}		}	});		/* //加载节目表	$.post("/cron/indexTvProgram.html",{},function(data){		$(".tvarea").html(data);		$(".jCarouselLite0").jCarouselLite({			visible: 5,circular:true,defwidth: 120,defheight: 220,btnNext: "#next0",btnPrev: "#prev0"		});		$(".jCarouselLite1").jCarouselLite({			visible: 5,circular:true,defwidth: 120,defheight: 220,btnNext: "#next1",btnPrev: "#prev1"		});		$(".jCarouselLite2").jCarouselLite({			visible: 5,circular:true,defwidth: 120,defheight: 220,btnNext: "#next2",btnPrev: "#prev2"		});		$(".jCarouselLite3").jCarouselLite({			visible: 5,circular:true,defwidth: 120,defheight: 220,btnNext: "#next3",btnPrev: "#prev3"		});				$('.changeTvarea').each(function(i){			$(this).bind('mouseover',function(){				$('.changeTvarea').removeClass("today").eq(i).addClass('today');				$('.tvarea-content').hide().eq(i).show();			});		});		//加载完之后，显示“今日”的tag		$(".tvarea-content").eq(2).show();	}); */		//消息条	var xiaoxiInterval = { interval: 7000, fadeInTime: 300, fadeOutTime: 200 };	var xiaoxiCount = $(".notice>span").size();	var xiaoxiCurrent = 0;	var xiaoxiIntervalID = null;	var xiaoxiStop = function() { window.clearInterval(xiaoxiIntervalID); };	var xiaoxiRun = function(opts) {		if (opts) {			xiaoxiCurrent = opts.current || 0;		} else {			xiaoxiCurrent = (xiaoxiCurrent >= (xiaoxiCount - 1)) ? 0 : (++xiaoxiCurrent);		};		$(".notice>span").filter(":visible").fadeOut(xiaoxiInterval.fadeOutTime, function() {			$(".notice>span").eq(xiaoxiCurrent).fadeIn(xiaoxiInterval.fadeInTime);		});	}; //endof xiaoxiRun	var xiaoxiGo = function() {		xiaoxiStop();		xiaoxiIntervalID = window.setInterval(function() { xiaoxiRun(); }, xiaoxiInterval.interval);	};	xiaoxiGo();	$('#noticeZuo').mouseover( function () {		$(this).removeClass("noticebtnl1").addClass("noticebtnl2");	}).mouseout( function () {		$(this).removeClass("noticebtnl2").addClass("noticebtnl1");	});	$('#noticeYou').mouseover( function () {		$(this).removeClass("noticebtnr1").addClass("noticebtnr2");	}).mouseout( function () {		$(this).removeClass("noticebtnr2").addClass("noticebtnr1");	});	$('#noticeZuo').click( function () {		clearInterval(xiaoxiIntervalID);		xiaoxiCurrent = (xiaoxiCurrent <= 0) ? (xiaoxiCount-1) : (--xiaoxiCurrent);		$(".notice>span").filter(":visible").fadeOut(xiaoxiInterval.fadeOutTime, function() {			$(".notice>span").eq(xiaoxiCurrent).fadeIn(xiaoxiInterval.fadeInTime);		});		xiaoxiGo();	});	$('#noticeYou').click( function () {		clearInterval(xiaoxiIntervalID);		xiaoxiCurrent = (xiaoxiCurrent >= (xiaoxiCount - 1)) ? 0 : (++xiaoxiCurrent);		$(".notice>span").filter(":visible").fadeOut(xiaoxiInterval.fadeOutTime, function() {			$(".notice>span").eq(xiaoxiCurrent).fadeIn(xiaoxiInterval.fadeInTime);		});		xiaoxiGo();	});		var isEmail = function(email) { var reg = /^([a-z0-9+_]|\-|\.|\-)+@([\w|\-]+\.)+[a-z]{2,4}$/i; return reg.test(email); }	//email订购	$('#bookEmail').click( function () {		var myemail = $('#myemail').val();		if( isEmail(myemail) ){		}		else alert('输入错误，请您核实下您输入的邮箱。');	});			//狗狗消息	var gouInterval = { interval: 7000, fadeInTime: 300, fadeOutTime: 200 };	var gouCount = $(".a1text").size();	var gouCurrent = 0;	var gouIntervalID = null;	var gouStop = function() { window.clearInterval(gouIntervalID); };	var gouRun = function(opts) {		if (opts) {			gouCurrent = opts.current || 0;		} else {			gouCurrent = (gouCurrent >= (gouCount - 1)) ? 0 : (++gouCurrent);		};		$(".a1text").filter(":visible").fadeOut(gouInterval.fadeOutTime, function() {			$(".a1text").eq(gouCurrent).fadeIn(gouInterval.fadeInTime);		});	}; //endof gouRun	var gouGo = function() {		gouStop();		gouIntervalID = window.setInterval(function() { gouRun(); }, gouInterval.interval);	};	gouGo();		//小喇叭消息	var labaInterval = { interval: 6000, fadeInTime: 300, fadeOutTime: 200 };	var labaCount = $(".a3notice").size();	var labaCurrent = 0;	var labaIntervalID = null;	var labaStop = function() { window.clearInterval(labaIntervalID); };	var labaRun = function(opts) {		if (opts) {			labaCurrent = opts.current || 0;		} else {			labaCurrent = (labaCurrent >= (labaCount - 1)) ? 0 : (++labaCurrent);		};		$(".a3notice").filter(":visible").fadeOut(labaInterval.fadeOutTime, function() {			$(".a3notice").eq(labaCurrent).fadeIn(labaInterval.fadeInTime);		});	}; //endof labaRun	var labaGo = function() {		labaStop();		labaIntervalID = window.setInterval(function() { labaRun(); }, labaInterval.interval);	};	labaGo();		//大眼睛部分代码	var defaultOpts = { interval: 5000, fadeInTime: 300, fadeOutTime: 200 };    //Iterate over the current set of matched elements	var _titles = $("ul.slide-txt li");	var _titles_bg = $("ul.op li");	var _bodies = $("ul.slide-pic li");	var _count = _titles.length;	var _current = 0;	var _intervalID = null;	var stop = function() { window.clearInterval(_intervalID); };	var slide = function(opts) {		if (opts) {			_current = opts.current || 0;		} else {			_current = (_current >= (_count - 1)) ? 0 : (++_current);		};		_bodies.filter(":visible").fadeOut(defaultOpts.fadeOutTime, function() {			_bodies.eq(_current).fadeIn(defaultOpts.fadeInTime);			_bodies.removeClass("cur").eq(_current).addClass("cur");		});		_titles.removeClass("cur").eq(_current).addClass("cur");		_titles_bg.removeClass("cur").eq(_current).addClass("cur");	}; //endof slide	var go = function() {		stop();		_intervalID = window.setInterval(function() { slide(); }, defaultOpts.interval);	}; //endof go	var itemMouseOver = function(target, items) {		stop();		var i = $.inArray(target, items);		slide({ current: i });	}; //endof itemMouseOver	_titles.hover(function() { if($(this).attr('class')!='cur'){itemMouseOver(this, _titles); }else{stop();}}, go);	//_titles_bg.hover(function() { itemMouseOver(this, _titles_bg); }, go);	_bodies.hover(stop, go);	//trigger the slidebox	go();}); 
