function reSizeImgWheel(o)
{
	var zoom=parseInt(o.style.zoom, 10)||100;
	zoom+=event.wheelDelta/12;
	if (zoom>0) {
		o.style.zoom=zoom+'%';
	}
	return false;
}

var arr_attimg = new Array();
function SetAttimgcount(imgid) 
{
	arr_attimg.push(imgid);
}

function ReSetAttimgsize(mxw,mxh) 
{
	for(i=0; i<arr_attimg.length; i++) 
	{
		alert(arr_attimg[i]);
		ReSetImgSize(mxw,mxh,arr_attimg[i]);
	}
}

//  ¹®¼­³» id = img_in_content ÀÎ ÀÌ¹ÌÁö Å©±â Á¶Àý
function ReSetImgSize(mxw,mxh,imgid) {
		mxw = mxw?mxw:550;
		mxh = mxh?mxh:400;
		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;
		imgs = eval("document.all."+imgid);
		}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];
				}
				*/
				img_properties = GetMaxWH(img_properties[0],img_properties[1],maxwidth,maxheight);
			}
			height = img_properties[1];
			width = img_properties[0];
			if(height == 0 && width == 0) 
			{
				ReSetImgSize(mxw,mxh,imgs[i].id);
			}
			try{
			imgs[i].style.width = width;
			imgs[i].style.height = height;
			imgs[i].style.cursor="hand";
			imgs[i].onClick ="window.open("+imgs[i].src+")";
			}catch(e){
				return false;
			}
		}
}

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;
}
