// JavaScript Document

$(document).ready(function(){
 $('.contact_way_page a:first').addClass('tabActive');
 $('.contact_way_list ul:first').css('display','block');
 autoroll();
 hookThumb();
});
var i=-1; //第i+1个tab开始
var offset = 500000; //轮换时间
var timer = null;
function autoroll(){
 n = $('.contact_way_page a').length-1;
 i++;
 if(i > n){
 i = 0;
 }
 slide(i);
    timer = window.setTimeout(autoroll, offset);
 }
function slide(i){
 $('.contact_way_page a').eq(i).addClass('tabActive').siblings().removeClass('tabActive');
 $('.contact_way_list ul').eq(i).fadeIn("slow").siblings('.contact_way_list ul').hide();
 }
function hookThumb(){    
 $('.contact_way_page a').click(
  function () {
    if (timer) {
                clearTimeout(timer);
    i = $(this).prevAll().length;
             slide(i); 
            }
  },
  function () {
            timer = window.setTimeout(autoroll, offset);  
            this.blur();            
            return false;
  }
); 
}









$(function(){
	//网站导航
	$(".web_nav").hover(function(){
		$(".website_nav").show();
		$(".web_nav").addClass("web_nav_hover");
		},
		function(){
			$(".website_nav").hide();
			$(".web_nav").removeClass("web_nav_hover");
			});
	$(".website_nav").hover(function(){
		$(this).show();
		$(".web_nav").addClass("web_nav_hover");
		},function(){$(this).hide();$(".web_nav").removeClass("web_nav_hover");});
		
	//顶部城市切换	
	$(".tab_t").hover(function(){
		$(".other_hover").show();
		$(".tab_t").addClass("tab_t_hover");
		},function(){$(".tab_t").removeClass("tab_t_hover");$(".other_hover").hide();});
	$(".other_hover").hover(function(){
		$(this).show();
		$(".tab_t").addClass("tab_t_hover");
		},function(){$(this).hide();$(".tab_t").removeClass("tab_t_hover");});
	
	
	//搜索下拉框	
		$(".search_txt").click(function(){
			$(".search_list").show();
			});
		$(".search_list a").click(function(){
			$(".search_txt input").attr("value",$(this).text());
			$(".search_list").hide();
			});
		$(".search_list a").hover(function(){
			$(this).addClass("hover");
		},function(){$(this).removeClass("hover");});
		
		$(".search_list").hover(function(){
			$(".search_list").show();
			},function(){$(".search_list").hide();});
			
		//附近经销商城市切换		
		$(".other_city2").hover(function(){
			$(".qh_city").show();
			$(".tab_t2").addClass("current2");
			},function(){$(".qh_city").hide(),$(".tab_t2").removeClass("current2");});
			
			
		$(".qh_city dl:last").css("border","none");
		$(".other_hover dl:last").css("border","none");
		
		//dialog弹出窗口
		/*$(".message_to").click(function(){
		  dialog("短信发送","iframe:message.html","332px","250px","iframe");
		});*/
		
//		$(".message_to a").click(function(){
//		  dialog("短信发送","iframe:message.html","332px","250px","iframe");
//		});
		
		$(".ress_t").click(function(){
		  dialog("订阅优惠信息","iframe:ress.html","332px","230px","iframe");
		});

		//经销商焦点图
			$(".big_hot_photo a").not(":first").hide();
			$(".thumb_photo>a").unbind("mouseover").bind("mouseover", function(){
				var index = $(".thumb_photo>a").index( $(this) );
				$(".big_hot_photo a").eq(index).siblings(".big_hot_photo a").hide().end().fadeIn(1);
		   });
		
		//处理面包屑导航
		$(".location a:first").css({"background":"none","padding-left":"0px"});  
		   
		//处理经销商 侧边栏车豪马自达企业员工 ---- 样式处理
		$(".l_colmn_employees li:odd").css("background","#fbfbfb");
		$(".l_colmn_employees li:last").css("border","none");
		
		
		//处理经销商报价表格样式
		$(".dealers_price tr:odd td").css("background","#fcfcfc");
		
		//附近经销商
		$(".near_dealers ul:first").css("border","none");
		
		
		//处理经销商模板优惠促销里的table样式
		//$(".dealers_content_table tr:even td").css("background","#ffffff");
		//$(".dealers_content_table tr:eq(1) td").css("border-top","1px solid #cecece");
		
		
		//幕帘伸缩广告调取
		//setTimeout("hideBanner();",3000);
		//setTimeout("showBanner();",4000);
		
		//经销商筛选（产品报价）
		
		
		
		//广告片
		/*$(".videoList li").hover(function(){
			$(this).find(".videoTitle").show();
			$(this).find("img").css("border","border:1px solid #cc0000");
			},function(){
				$(this).find(".videoTitle").hide();
				$(this).find("img").css("border","border:0px solid #cc0000");
				});
		$(".videoList li.current").hover(function(){
			$(this).find(".videoTitle").show();
			$(this).find("img").css("border","border:1px solid #cc0000");
			},function(){
				$(this).find(".videoTitle").show();
				$(this).find("img").css("border","border:1px solid #cc0000");
				});
		$(".videoList li").click(function(){
			$(".videoList li").removeClas("current");
			$(".videoList li").find(".videoTitle").hide();
			$(this).addClass("current");
			$(this).find(".videoTitle").show();
			});*/
				
				
	})

