jQuery.noConflict();
    jQuery(document).ready(function($){ 
   									
   $("#nav7").click(function(){ // Compare Menu in Navigator

       $("#sub7").slideToggle("slow");
	});  
   
  /*   for(i=1;i<9;i++){
	   $("#temp_img"+i).click(function(){ // Compare Menu in Navigator   and Downloads Page      需要改成动态的
          $("#downloadsdetail"+i).slideToggle("slow");
       });
      
  }*/
  /* Product sub menu*/
  $("a.pro-open").click(function(){
			$(".pro-open").find("img").removeClass("margintop_53");
			$("div.technical").hide();					 
			num = $(this).attr("menu");
			$("#model"+num).show("slow");
			$("#sub_sub_"+num).addClass("margintop_53");
			$("#tech_notice").show();
			
	 });
  $("a.pro-close-bar").click(function(){
			num = $(this).attr("menu");
			$("#model"+num).hide("slow");
			$("#sub_sub_"+num).removeClass("margintop_53");
			$("#tech_notice").hide();
			
	 });
	 /*********/
	 $("#upload-img #brownser").click(function(){
		 $("#upload-img .file-input").click();//
	 });
  /** Contact Us***/
  $("#orderreport-form").submit(function(){
			
			if($("#message_type").val() == 'Please Select The Message Type...'){
				
				$("#message_type").css({"border":"1px solid #ff0000"});
				return false;
				
			} else {
				
				$("#message_type").css({"border":"none"});
				return true;
				
			}
										 
	  });

  
  $(".temp_img_open").click(function(){ // Compare Menu in Navigator   and Downloads Page      需要改成动态的
       $("#downloadsdetail" + $(this).attr("number")).show("slow");
	   $("#downloadsexpand" + $(this).attr("number")).removeClass("new-banner");
	   $("#downloadsexpand" + $(this).attr("number")).addClass("cars_closed");
	  
  });
  $(".temp_img_close").click(function(){ // Compare Menu in Navigator   and Downloads Page      需要改成动态的
       $("#downloadsdetail" + $(this).attr("number")).hide("slow");
	   $("#downloadsexpand" + $(this).attr("number")).addClass("new-banner");
	   $("#downloadsexpand" + $(this).attr("number")).removeClass("cars_closed");
  });
  $(".temp_img_open2").toggle(
		function(){ 				   
		   $("#downloadsdetailnew" + $(this).attr("number")).show("slow");
		   $("#downloadsexpandnew" + $(this).attr("number")).addClass("new-banner2");
		},
		function(){ 				   
		   $("#downloadsdetailnew" + $(this).attr("number")).hide("slow");
		   $("#downloadsexpandnew" + $(this).attr("number")).removeClass("new-banner2");
		}
  );

   $("#arrow_forward").click(function(){  //  Nav sub7
           alert("sdf");
  });
 $("#arrow_back").click(function(){  //  Nav sub7
              autoscroll();
  });
/*  for(i=1;i<6;i++){
	   $("#temp_img"+i+"_"+i).click(function(){ //  Downloads Page      需要改成动态的
          $("#downloadsdetail"+i).slideToggle("slow");
       });
  }*/
  
  $(".nav_s_li").mouseover(function(){  //  Nav sub7
                $(this).css({ background: "#d6e8ea" });
  });
   $(".nav_s_li").mouseout(function(){  //  Nav sub7
                $(this).css({ background: "#fff" });
  });
   
  $(".sub_sub_menu_a").mouseover(function(){  //  导航栏，sub_sub菜单hover效果
                $(this).css({ color: "#fff", padding:"0 0 0 30px", backgroundPosition: "0 -32px" });
  });
   $(".sub_sub_menu_a").mouseout(function(){  //  导航栏，sub_sub菜单hover效果
                $(this).css({ color: "#99BED1", padding:"0 0 0 20px", backgroundPosition: "0 0" });
  });
   

    function display_one(obj1,obj2){
	 $(obj1).delay(2000).fadeOut("slow");
	 $(obj2).delay(2000).fadeIn("slow");
	  setTimeout(function(){ display_two(obj1,obj2); },10000);
 }
 
 function display_two(obj1,obj2){
	 $(obj1).delay(2000).fadeIn("slow");
	 $(obj2).delay(2000).fadeOut("slow");
	  setTimeout(function(){ display_one(obj1,obj2); },10000);
	 
 }
  setTimeout(function(){ display_one("#super_lo","#ask_expert"); },10000);
  setTimeout(function(){ display_one("#new_tribute","#aftercare"); },10000);  
  
   /****用法**/
			$("#requestForm").submit(function(){							 
				bool1 = false					 
				bool1 = $(this).check();
				return bool1;
			});	
	/**扩展************/
        (function($){
        $.fn.extend({
        	check:function(){
        		var bool1_t = true;  
        		var bool11_t = true;  
        		var bool2_t = true;  
        		var bool3_t = true;       		
        		$(this).find('.required-entry').each(function(){
        			v = $(this).val();
        			if(v == 'Please select message type...' || v == 'Please select...' || v == 'Enter your email address'){
							$(this).addClass('input-failed');
							bool11_t = false;
						} else {
							if(v == '' || (v == null) || (v.length == 0) || /^\s+$/.test(v)){
								$(this).addClass('input-failed');
								bool1_t = false;
							   }else{
								$(this).removeClass('input-failed');
								bool1_t = true;
							   }
							   
					   }
        		});
        		$(this).find('.required-email').each(function(){
        			v = $(this).val();
						$(this).addClass('input-failed');
						check_email = /^([a-zA-Z\.0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(v);
						if(v == '' || (v == null) || (v.length == 0) || /^\s+$/.test(v) || !check_email ){
							$(this).addClass('input-failed');
							bool2_t = false;
						}else{
							$(this).removeClass('input-failed');
							bool2_t = true;
						}
					
        		});
        		$(this).find('.validate-telephone').each(function(){
        			v = $(this).val();
        			check_telephone = /^[\d\s]+$/.test(v);
        			if(v == '' || (v == null) || (v.length == 0) || /^\s+$/.test(v) || !check_telephone || v == 'What is your Driving Licenece Number?' || v == 'What is your Telephone Number?'){
        				$(this).addClass('input-failed');
        				bool3_t = false;
        			}else{
        				$(this).removeClass('input-failed');
						bool3_t = true;
        			}
        		});
        		
        		return bool1_t&&bool11_t&&bool2_t&&bool3_t;
        	},
			//中间定位
        	fixPop:function(w,h){
        		WLeft_f2   =   Math.ceil((winWidth   -   w)   /   2  );
    		    WTop_f2   =   Math.ceil((winHeight   -   h)   /   2   ); 
    			if(WTop_f2<0) WTop_f2=10;
    			$(this).css('left',WLeft_f2 + "px");
    			$(this).css('top',WTop_f2 + "px");
        	}
        })
    })(jQuery);
  

});
