﻿$(function(){
	//菜单效果
	$(".itemintro").hover(function(){
		$(this).attr("class", "itemintro sel");					   
	},function(){
		$(this).attr("class", "itemintro");		
	});
	
	$("ul.nav li").hover(function(){
		$(this).children(".item").css("color", "#999");		   
	},function(){
		$(this).children(".item").css("color", "");
	});
	
	//搜索框
	$("#SearchInput").focus(function(){
		if(this.value=="防伪码查询...")
		{
			this.value = "";	
		}
		$(this).attr("class", "text2");
	}).blur(function(){
		if(this.value=="")
		{
			this.value = "防伪码查询...";	
		}
		$(this).attr("class", "text");
	});
	
	//模拟滚动条
	  $('.scroll-pane').jScrollPane({ scrollbarWidth: 4});
	  $('#heroScroll').jScrollPane({scrollbarWidth: 4});
	  
	  $('.ScrollUd').bind(
		  'click',
		  function()
		  {
			  $('#right .scroll-pane')[0].scrollBy(parseInt($(this).attr('rel')));
			  return false;
		  }
	  );
	  
	  //大图淡出
	  $(".bg380 .innerWidth .right .bpic").attr("onload", function(){
		$(this).fadeIn(500);												  
	  });
	  
	  //禁用品牌列表点击
	  $(".innerWidth2 #left .scroll-pane a").click(function(){return false});
	  
	  //产品大图
	  $(".productList ul li .pimg .bimg").hide();	
	  $(".productList ul li .pimg").hover(function(){
		$(this).find(".bimg").stop(false, true).fadeIn(300);	
		$(this).css("zIndex", "100");
	  },function(){
		$(this).find(".bimg").hide();	
		$(this).css("zIndex", "50");									   
	  });
});



function imgTop(num)
{
	return -(num*100)+100
}

function imgLeft(num)
{
	return -(num*182)+178
}

function yearpix(yearNum) //计算出箭头在年份标志的top位置
{
	mathNum=Math.ceil((yearNum-1960)*4.1)
	if(mathNum<0)
	{
		return 0
	}
	else if(mathNum>246)
	{
		return 246
	}
	else
	{
		return mathNum
	}
}
