
	
/******************************************************首页广告效果************************************************************/
$(function(){
     var len  = $(".slider > li").length-1;
	 var index = 0;
	 var adTimer;

	 //滑入 停止动画，滑出开始动画.
	 $('.ad').hover(function(){
			 clearInterval(adTimer);
		 },function(){
			 adTimer = setInterval(function(){
			    showImg(index)
				index++;
				if(index==len){index=0;}
			  } , 4000);
	 }).trigger("mouseleave");
})
// 通过控制top ，来显示不同的幻灯片
function showImg(index){
        var adHeight = $(".content_right .slider li").height()+3;
		$(".slider").stop(true,false).animate({bottom : -adHeight*index},1000);
		$(".num li").removeClass("on")
			.eq(index).addClass("on");
}
	
/***************************************************************flash模版js*******************************************************/

$(function(){
     var len  = $(".nume > li").length;
	 var index = 0;
	 var adTimer;
	 $(".nume li").mouseover(function(){
		index  =   $(".nume li").index(this);
		showImge(index);
	 }).eq(0).mouseover();	
	 //滑入 停止动画，滑出开始动画.
	 $('.ade').hover(function(){
			 clearInterval(adTimer);
		 },function(){
			 adTimer = setInterval(function(){
			    showImge(index)
				index++;
				if(index==len){index=0;}
			  } , 4000);
	 }).trigger("mouseleave");
})
// 通过控制top ，来显示不同的幻灯片
function showImge(index){
        var adHeight = $(".content_righte .ade").height();
		$(".slidere").stop(true,false).animate({bottom : -adHeight*index},1000);
		$(".nume li").removeClass("on")
			.eq(index).addClass("on");
}



/**********************************************************************v新品展示js***********************************************************/
$(function(){
     var len  =Math.ceil($(".sliderx > li").length/8);
	 var index = 0;
	 var adTimer;
	 //滑入 停止动画，滑出开始动画.
	 $('.adx').hover(function(){
			 clearInterval(adTimer);
		 },function(){
			 adTimer = setInterval(function(){
			    showImgx(index)
				index++;
				if(index==len){index=0;}
			  } , 8000);
	 }).trigger("mouseleave");
})
// 通过控制top ，来显示不同的幻灯片
function showImgx(index){
	

 var adHeight = $(".content_rightx .adx li").height()+5;
		$(".sliderx").stop(true,false).animate({top : -adHeight*index},1000);
		$(".num li").removeClass("on")
			.eq(index).addClass("on");


}



/****************************************************显示缩略图***************************************************************/ 
  function DrawImage(ImgD,width_s,height_s){ 
  /*var width_s=139; 
  var height_s=104; 
  */ 
  var image=new Image(); 
  image.src=ImgD.src; 
  ImgD.alt="陶乐坊 买卖二手";
  
  if(image.width>0 && image.height>0){ 
  flag=true; 
  if(image.width/image.height>=width_s/height_s){ 
  if(image.width>width_s){ 
  ImgD.width=width_s; 
  ImgD.height=(image.height*width_s)/image.width; 
  }else{ 
  ImgD.width=image.width; 
  ImgD.height=image.height;
  ImgD.alt="陶乐坊 买卖二手";
  } 
  } 
  else{ 
  if(image.height>height_s){ 
  ImgD.height=height_s; 
  ImgD.width=(image.width*height_s)/image.height; 
  }else{ 
  ImgD.width=image.width; 
  ImgD.height=image.height; 
  ImgD.alt="陶乐坊 买卖二手";
  } 
  } 
  } 
  /*else{ 
  ImgD.src=""; 
  ImgD.alt="" 
  }*/ 
  } 
  
  
  
  
  
  
  function ResizeImage(imageDest, W, H)
{
//显示框宽度W,高度H
var image = new Image();
image.src = imageDest.src;
if(image.width>0 && image.height>0)
{
    //比较纵横比
    if(image.width/image.height >= W/H)//相对显示框：宽>高
    {
     if(image.width > W) //宽度大于显示框宽度W，应压缩高度
     {
               imageDest.width = W;
               imageDest.height = (image.height*W)/image.width;   
              }
     else //宽度少于或等于显示框宽度W，图片完全显示
     {
               imageDest.width = image.width;       
               imageDest.height = image.height;   
              }
    }
    else//同理
    {
     if(image.height > H)
     {
               imageDest.height = H;
               imageDest.width = (image.width*H)/image.height;
              }
     else
     {
               imageDest.width = image.width;
               imageDest.height = image.height;
              }
    }
}
}

 /****************************************************imagelazyload***************************************************************/ 

