$(function() {
			var $li = $("div.categories ul.ul>li");
			$li.each(function(i) {
						$("div.categories ul.ul>li>div").each(function() {
									$(this).bind("mouseover", function() {
												$(this).addClass("ab");
											});
									$(this).bind("mouseout", function() {
												$(this).removeClass("ab");
											});
								});
					});
			setTimeout(function() {
						$("#xsph>li").each(function() {
							$(this).bind("mouseover", function() {
								$(this).addClass("tt").siblings()
										.removeClass("tt");
							});
						});
						$("#spcx > li").each(function() {
							$(this).bind("mouseover", function() {
								$(this).addClass("t").siblings()
										.removeClass("t");
							});
						});
						$("#flsp > li").each(function() {
							$(this).bind("mouseover", function() {
								$(this).addClass("t").siblings()
										.removeClass("t");
							});
						});
					}, 100);

		});
/* 特约店铺 */
$(function() {
			var page = 1; // 版面数；
			var i = 3; // 一版显示3个元素

			var $fa = $("div.tydp_1"); // 视频展示区 父元素
			var $ol = $("#ol_1"); // 视频展示区

			// ie6修复
			var isIE6 = !window.XMLHttpRequest;
			if (isIE6) {
				var height = $fa.height() + 10;
			} else {
				var height = $fa.height();
			}
			var len = $ol.find("li.ol").length; // li的个数

			$("#a1").bind("click", function(event) {

						// 判断展示区是否正在处于动画
						if (!$ol.is(":animated")) {
							// 已经到最后一个版面，如果在向后，必须跳转到第一个版面
							if (page == 1) {
								$ol.animate({
											top : "-=" + height * (len - 1)
										}, "slow"); // 改变top值，跳转到第一个版面
								page = len;
							} else {
								// 通过改变top值，达到每次换一个版面
								$ol.animate({
											top : "+=" + height
										}, "slow")
								page--;

							}
						}
						event.preventDefault();
					})

			$("#a2").bind("click", function(event) {
						// 判断展示区是否正在处于动画
						if (!$ol.is(":animated")) {
							// 已经到最后一个版面，如果在向后，必须跳转到第一个版面
							if (page == len) {
								$ol.animate({
											top : "-=" + height * (len - 1)
										}, "slow"); // 改变top值，跳转到第一个版面
								page = len;
							} else {
								// 通过改变top值，达到每次换一个版面
								$ol.animate({
											top : "+=" + height
										}, "slow")
								page--;

							}
						}
						event.preventDefault();
					})

			var scrollTimer = setInterval(function() {
						scrollNews($fa);
					}, 3000)

			$("div.tydp").hover(function() {
						clearInterval(scrollTimer)
					}, function() {
						scrollTimer = setInterval(function() {
									scrollNews($fa)
								}, 3000)
					})

			// 自动切换方法scrollNews()
			function scrollNews(obj) {
				var $self = obj.find("ol");
				$self.animate({
							"top" : -height + "px"
						}, 600, function() {
							$self.css({
										top : 0
									}).find("li:first").appendTo($self); // appendTo
							// 直接移动元素
					});
			}

		})
		
		
/*移除分类样式*/
function gocategory(category_code){
		var $li = $("div.categories ul.ul>li");
		$li.each(function (i) {
			$("div.categories ul.ul>li>div").each(function () {
				$(this).removeClass("ab");
			});
		});
		window.location.href=webpath+'/category/'+category_code+'.html';
}
/*移除分类样式*/
function gobrand(brand_id){
		var $li = $("div.categories ul.ul>li");
		$li.each(function (i) {
			$("div.categories ul.ul>li>div").each(function () {
				$(this).removeClass("ab");
			});
		});
		window.location.href=webpath+'/brand/'+brand_id+'.html';
}
