// JavaScript Document
$(function () {
		//左侧产品菜单 
		//带导航图标及按钮
	$('#change_1 .a_bigImg img').soChange({
		changeTime:4000//自定义切换时间为4000ms
	});
	
	//切换对象为其他，这里为包含图片和标题的层
	$('#change_32 div.changeDivb').soChange({//对象指向层，层内包含图片及标题
		thumbObj:'#change_32 .ul_change_a2b span',
		thumbNowClass:'on'//自定义导航对象当前class为on
	});
	
	$('#change_33 .a_bigImg img').soChange({//对象指向层，层内包含图片及标题
		thumbObj:'#change_33 .ul_change_a2bc span',
		thumbNowClass:'on'//自定义导航对象当前class为on
	});
	
	newsmore();
	/*产品浏览模式*/
	$("#model_icon").click(function(){
						//$(".contro_icon").hide();
						//$(".contro_images").show();
						//$("#marquee5").css({"z-index":"11111"});
						
						$(".footer_info_t1").removeClass("actice_model");
						$(this).addClass("actice_model");
						opacity_ico();
						
						var ccss = $("#marquee4 ul li a").length;
						
							for(i=0;i < ccss;i++){
  		
  		$("#marquee4 ul li a img").eq(i).attr("src",$("#marquee4 ul li a img").eq(i).attr("iconp"));
		}
		$("#marquee4 ul li a").css("opacity","0");
		$("#marquee4 ul li a").fadeTo(1000,1);
						//$("#marquee4").stop(true).animate( { opacity:0}, 500);
						 //$("#marquee5").stop(true).animate( { opacity:1}, 500);
						 });
	
	$("#model_images").click(function(){
									//$(".contro_images").hide();
						//$(".contro_icon").show();
						// $("#marquee5").stop(true).animate( { opacity:0}, 500);
						// $("#marquee4").stop(true).animate( { opacity:1}, 500);
						$(".footer_info_t1").removeClass("actice_model");
						$(this).addClass("actice_model");
						opacity_ico();
						var ccss = $("#marquee4 ul li a").length;
						for(i=0;i < ccss;i++){
  		
  		$("#marquee4 ul li a img").eq(i).attr("src",$("#marquee4 ul li a img").eq(i).attr("imagep"));
		
		}
		$("#marquee4 ul li a").css("opacity","0");
		$("#marquee4 ul li a").fadeTo(1000,1);
		
						 });
	//判断是否显示左右拉动
	var lld = $("#marquee4 ul li").length;
	
	if(lld < 2 ){
	$(".go_l2 , .go_r2").hide();	
		
		}
	
	$(".cont_btn").click(function(){$('html,body').animate({scrollTop: '0px'}, 1000);return false;});
	
	opacity_ico();
	
	
	
	$(".p_cap div").hover(
  function () {
   $(".hoverp a",this).stop(true).animate( { opacity:1}, 500);
  },
  function () {
	   $(".hoverp a",this).stop(true).animate( {  opacity:0}, 500);
  }
	); 
	
	
	
	
	
	 $(".clis_hover").css({opacity:0});
	
	$(".clis_link").hover(
  function () {
   $(".clis_hover").stop(true).animate( { opacity:1}, 500);
   $(".clis_link").stop(true).animate( { opacity:0}, 500);
  },
  function () {
	  $(".clis_hover").stop(true).animate( { opacity:0}, 500);
   $(".clis_link").stop(true).animate( { opacity:1}, 500);
  }
	); 
	
	
	/*底部信息*/
	
	$(".footer_info_t1").hover(
  function () {
   $(this).stop(true).animate( { opacity:1}, 300);
  },
  function () {
	  
	  if(!$(this).hasClass("actice_model")){
	   $(this).stop(true).animate( {  opacity:0.5}, 300);
	   }
  }
	); 
	
	//搜索
	var isip = "你需要什么？";
	$(".i_sear_iput").val(isip);
	$(".i_sear_iput").focus(function(){         // 地址框获得鼠标焦点
			var txt_value =  $(this).val();   // 得到当前文本框的值
			if(txt_value==isip){ 
			$(this).css({color:"#636363"});
                $(this).val("");              // 如果符合条件，则清空文本框内容
			} 
	 });
	  $(".i_sear_iput").blur(function(){		  // 地址框失去鼠标焦点
	  	    var txt_value =  $(this).val();   // 得到当前文本框的值
			if(txt_value==""){
				$(this).css({color:"#d4d4d4"});
                $(this).val(isip);// 如果符合条件，则设置内容
			} 
	  })
	  
	  /*防伪查询*/
	  var isipa = "请在此填入防伪码";//product_pi  产品防伪查询
	  var isipb = "请在此输入授权码";//brand_pi 品牌授权查询
	  var isipc = "请在此输入授权码";//local_pi  网点授权查询
	  
	  //type1
	  
	  var isipa_s="patent";
	  var isipb_s="brand";
	  var isipc_s="eshop";
	  
	  //初始化
	  
	  
	$(".da_inpus").val(isipb);
	
	$(".da_inpus").focus(function(){         // 地址框获得鼠标焦点
			var txt_value =  $(this).val();   // 得到当前文本框的值
			if(txt_value==isipa){ 
			$(this).css({color:"#000"});
                $(this).val("");              // 如果符合条件，则清空文本框内容
			} 
			if(txt_value==isipb){ 
			$(this).css({color:"#000"});
                $(this).val("");              // 如果符合条件，则清空文本框内容
			} 
			if(txt_value==isipc){ 
			$(this).css({color:"#000"});
                $(this).val("");              // 如果符合条件，则清空文本框内容
			} 
			
	 });
	
	
	  $(".da_inpus").blur(function(){		  // 地址框失去鼠标焦点
	  	    var txt_value =  $(this).val();   // 得到当前文本框的值
			if(txt_value==""){
				$(this).css({color:"#d4d4d4"});
				
				if($(".da_inpus").attr("type1")==isipa_s){
                $(this).val(isipa);// 如果符合条件，则设置内容
				}
				if($(".da_inpus").attr("type1")==isipb_s){
                $(this).val(isipb);// 如果符合条件，则设置内容
				}
				if($(".da_inpus").attr("type1")==isipc_s){
                $(this).val(isipc);// 如果符合条件，则设置内容
				}
			} 
	  })
	  	$(".bg_dag_de").css({ "opacity": "0.3"});
		

		
	//防伪弹出窗口
	desi_dab();
	$(window).resize(function(){
		scroll_deda();
	});
	
	
	$(".f_ico_a").click(
				function () {
					$(".bg_dag_de").fadeIn(200);
					$(".bg_dag_dei").show();
					desi_dab();//窗口定位
					
					
	});	
	
	$(".da_sel_da").hover(function () {
   
  },
  function () {
	  
	  $(this).hide();
  }
	); 
	
	$(".da_sel_dap").click(
				function () {
					$(".da_sel_da").hide();
					$(".da_sel_da",this).show();
					$(".da_sclose").show();	
				});	
	
					$(".product_pi").click(
				function () {
					var p_pi= $(this).attr("title");
					$(".da_sel_dap span").text(p_pi);
					$(".da_inpus").val(isipa);
					$(".da_inpus").attr("type1",isipa_s);
					$(".de_title_hl").text("产品防伪授权查询");
					
				});	
	
				$(".brand_pi").click(
				function () {
					var b_pi= $(this).attr("title");
					$(".da_sel_dap span").text(b_pi);
					$(".da_inpus").val(isipb);
					$(".da_inpus").attr("type1",isipb_s);
					$(".de_title_hl").text("品牌授权查询");
				});	
				
				$(".local_pi").click(
				function () {
					var l_pi= $(this).attr("title");
					$(".da_sel_dap span").text(l_pi);
					$(".da_inpus").val(isipc);
					$(".da_inpus").attr("type1",isipc_s);
					$(".de_title_hl").text("网店授权查询");
				});	
				
				
				$(".sb_da_btn").click(
				function () {
					$(".dag_cons").hide();
					$(".t_pi_c").show();
				});
				
	
	$(".pitem_cam ul li").hover(
  function () {
   $(".pitem_cam_2nd",this).slideDown(500);
  },
  function () {
	$(".pitem_cam_2nd",this).slideUp(500);
  }
	); 
	
	
	$(".clients_logo ul li").hover(
  function () {
   $(".hovc_logo",this).stop(true).animate( {  opacity:0}, 500);
  },
  function () {
	 $(".hovc_logo",this).stop(true).animate( {  opacity:1}, 500);
  }
	); 
	
	
		
});


function opacity_ico(){
		
	
	$(".hoverp a").css({opacity:0});
	$(".footer_info_t1").css({opacity:0.5});
	$(".actice_model").css({opacity:1});
	
	}


function desi_dab(){
	
	//窗口背景高度
	 $(".close_da").click(function(){
		$(".dag_cons").hide();
		$(".t_pi_c").show();
		$(".da_sel_da").hide();
		$(".bg_dag_de").fadeOut(200);
		$(".bg_dag_dei").slideUp(300).show();
    });
	
	
	//弹出窗口高度
	var item_h = $(".bg_dag_dei").height();
	var item_w = $(".bg_dag_dei").width();
	
	var os_w = $(window).width();
	var os_h = $(window).height();
	var os_ha = $("body").height();

	$(".bg_dag_de").height(os_ha);
	
	if($("body").height()<725){
		$(".bg_dag_de").height(os_h);
		}
	
	$(".bg_dag_de").width(os_w);
	
	//窗口位置
	var wb_w = (os_w - item_w)/2;  
	var wb_h = (os_h - item_h)/2;
	
	var sch = $(window).scrollTop();
	var slh = $(window).scrollLeft();
	
	 $(".bg_dag_dei").css({ "left": wb_w + slh , "top": wb_h + sch});
			
}

function scroll_deda(){
	
	//窗口背景高度
	//弹出窗口高度
	var item_h = $(".bg_dag_dei").height();
	var item_w = $(".bg_dag_dei").width();
	
	var os_w = $(window).width();
	var os_h = $(window).height();
	
	var os_ha = $("body").height();
	
	//窗口位置
	var wb_w = (os_w - item_w)/2;  
	var wb_h = (os_h - item_h)/2;  
	
	$(".bg_dag_de").height(os_ha);
	
	$(".bg_dag_de").width(os_w);

	 $(".bg_dag_dei").css({ "left": wb_w , "top": wb_h});
		
}

function newsmore(){
	
	var vt_work_item = $(".news_list dt").length;
	
	if(vt_work_item < 2 ){
		$(".show_n_list").hide();
		}
	
	for (i = 2; i < vt_work_item; i++)
		{
   		$(".news_list dt").eq(i).hide();
		$(".news_list dd").eq(i).hide();
	}
	$(".show_ntext").click(
								  function () {
									
					for (i = 2; i < vt_work_item; i++)
		{
   		$(".news_list dt").eq(i).slideDown(1000);
		$(".news_list dd").eq(i).slideDown(1000);
			
		}
					$(".show_ntext").hide();
					$(".show_ntexth").show();
  	});
  $(".show_ntexth").click(function () {
	  for (i = 2; i < vt_work_item; i++)
		{
   		$(".news_list dt").eq(i).slideUp(1000);
		$(".news_list dd").eq(i).slideUp(1000);
		
		//alert(i);
		}
		
		$(".show_ntexth").hide();
	$(".show_ntext").show();
	$('html,body').animate({scrollTop: '0px'}, 1000);return false;
  });
	}


/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright © 2008 George McGinley Smith
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
*/

// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	},
	easeInCubic: function (x, t, b, c, d) {
		return c*(t/=d)*t*t + b;
	},
	easeOutCubic: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t + 1) + b;
	},
	easeInOutCubic: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t + b;
		return c/2*((t-=2)*t*t + 2) + b;
	},
	easeInQuart: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t + b;
	},
	easeOutQuart: function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	},
	easeInOutQuart: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
		return -c/2 * ((t-=2)*t*t*t - 2) + b;
	},
	easeInQuint: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t*t + b;
	},
	easeOutQuint: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t*t*t + 1) + b;
	},
	easeInOutQuint: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
	},
	easeInSine: function (x, t, b, c, d) {
		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
	},
	easeOutSine: function (x, t, b, c, d) {
		return c * Math.sin(t/d * (Math.PI/2)) + b;
	},
	easeInOutSine: function (x, t, b, c, d) {
		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
	},
	easeInExpo: function (x, t, b, c, d) {
		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
	},
	easeOutExpo: function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	},
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},
	easeInCirc: function (x, t, b, c, d) {
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
	},
	easeOutCirc: function (x, t, b, c, d) {
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
	},
	easeInOutCirc: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
	},
	easeInElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	},
	easeOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	},
	easeInOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
	},
	easeInBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*(t/=d)*t*((s+1)*t - s) + b;
	},
	easeOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
	},
	easeInOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158; 
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	},
	easeInBounce: function (x, t, b, c, d) {
		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
	},
	easeOutBounce: function (x, t, b, c, d) {
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	},
	easeInOutBounce: function (x, t, b, c, d) {
		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
	}
});

/*
 *
 * TERMS OF USE - EASING EQUATIONS
 * 
 * Open source under the BSD License. 
 * 
 * Copyright © 2001 Robert Penner
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
 */
