
//图片按比例缩放
function DrawImage(ImgD,iwidth,iheight,txt){
    //参数(图片,允许的宽度,允许的高度)
    var image=new Image();
    image.src=ImgD.src;
    if(image.width>0 && image.height>0){

    if(image.width/image.height>= iwidth/iheight){
        if(image.width>iwidth){  
        ImgD.width=iwidth;
        ImgD.height=(image.height*iwidth)/image.width;
        }else{
        ImgD.width=image.width;  
        ImgD.height=image.height;
        }
       // ImgD.alt=image.width+"×"+image.height;
	   ImgD.title=txt;
        }
    else{
        if(image.height>iheight){  
        ImgD.height=iheight;
        ImgD.width=(image.width*iheight)/image.height;        
        }else{
        ImgD.width=image.width;  
        ImgD.height=image.height;
        }
        //ImgD.alt=image.width+"×"+image.height;
		ImgD.title=txt;
        }
    }
} 

function swrappic( xb,curr,a, b) { 
   var number=1;
  for(var i=a;i<=parseInt(b);i++){
    document.getElementById("img_"+i).style.display = "none"; 
	document.getElementById("picno" + i).src = "images/ljyt/number_0"+ number +".gif";
	number+=1;
  }
  document.getElementById("img_"+curr).style.display = "block"; 
  document.getElementById("picno" + curr).src = "images/ljyt/number_0"+ xb +"0.gif";
}

//
//for(var i=1;i<=10000;i++){
//	showgallery(i);
//}
//



//----------------


//----------------
function showgallery(num){
	$(function() {
		$('#gallery'+num+' a').lightBox({
		overlayBgColor: '#000',                                    //背景颜色
		overlayOpacity: 0.6,                                       //透明度
		imageLoading:  'images/ljyt/loading.gif',        //加载图片
		imageBtnClose: 'images/ljyt/close.gif',          //关闭图片
		imageBtnPrev:  'images/ljyt/prev.gif',           //上一张
	    imageBtnNext:  'images/ljyt/next.gif',           //下一张
		containerResizeSpeed: 350,                                 //相框
		txtImage: "",
		txtOf: '/'
		});
	});
}


