
//  ¹®¼­³» id = img_in_content ÀÎ ÀÌ¹ÌÁö Å©±â Á¶Àý
function ReSetImgSize(mxw,mxh,imgid) {

		mxw = mxw?mxw:400;
		mxh = mxh?mxh:300;
		var maxheight = mxh;
		var maxwidth = mxw;
		var img_properties = new Array();

        imgid = imgid?imgid:"img_in_content";	
/*        
		if (wb == 'ns4'){
			var imgs = document.layers(imgid);	
		} else if (wb == 'ie'){
			var imgs = document.getElementById(imgid);
		} else if (wb == 'ns6'){
			var imgs = document.layers(imgid);	
		}
*/	    
        
//        imgs = GetID(imgid);

	//	imgs = GetID("img_in_content");
        try{
		imgs = document.all.img_in_content;
        }catch(e){
            return false;
        }
        try{
            imgs.length;
        }catch(e){
            return false
        }


		
		if (!imgs.length)	{
			imgs = new Array(imgs);
		}
		for(i=0; i<imgs.length; i++) {
			img_tmp = new Image();
			
			img_tmp.src = imgs[i].src;
			
			if(maxwidth > 0 && maxheight >0) {
				img_properties[0] = img_tmp.width;
				img_properties[1] = img_tmp.height;
				
				if(img_properties[0]>maxwidth||img_properties[1]>maxheight) {
					height = (maxwidth*img_properties[1])/img_properties[0];
					width = maxwidth;
					if(height > maxheight) {
						width = (maxheight*img_properties[0])/img_properties[1];
						height = maxheight;
					}
				}else {
					height = img_properties[1];
					width = img_properties[0];
				}
			}else {
				height = img_properties[1];
				width = img_properties[0];
			}
			imgs[i].style.width = width;
			imgs[i].style.height = height;
			imgs[i].width = width;
			imgs[i].height = height;
			imgs[i].style.cursor="hand";
			imgs[i].onClick ="window.open("+imgs[i].src+")";

		}
}

function GetMaxWH(width,height,maxwidth,maxheight) {
	img_properties = new Array();
	img_properties[0] = width;
	img_properties[1] = height;
	if(maxwidth > 0 && maxheight >0) {
		if(img_properties[0]>maxwidth||img_properties[1]>maxheight) {
			height = (maxwidth*img_properties[1])/img_properties[0];
			width = maxwidth;
			if(height > maxheight) {
				width = (maxheight*img_properties[0])/img_properties[1];
				height = maxheight;
			}
		}else {
			height = img_properties[1];
			width = img_properties[0];
		}
	}else {
		height = img_properties[1];
		width = img_properties[0];
	}
	img_properties[0] = Math.floor(width);
	img_properties[1] = Math.floor(height);
	return img_properties;
}