function lib_image(){
	return true;
}
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 ReSetImgSizePop(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;
		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 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;
		imgs = eval("document.all."+imgid);
		}catch(e){
            return false;
        }
        try{
            imgs.length;
        }catch(e){
            return false
        }
			


		
		if (!imgs.length)	{
			imgs = new Array(imgs);
		}
		
        img_tmp = new Image();
        
        img_tmp.src = imgs.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.id);
        }
        try{
        imgs.style.width = width;
        imgs.style.height = height;
        imgs.style.cursor="hand";
        }catch(e){
            return false;
        }
		
}

function GetMaxWH(iw,ih,maxw,maxh) {
	if(maxw > 0 && maxh >0) {
		if(iw>maxw||ih>maxh) {
			ih = (maxw*ih)/iw;
			iw = maxw;
			if(ih > maxh) {
				
				iw = (maxh*iw)/ih;
				ih = maxh;
			}
		}else {
			ih = ih;
			iw = iw;
		}
	}
	img_properties = new Array();
	img_properties[0] = Math.floor(iw);
	img_properties[1] = Math.floor(ih);
	return img_properties;
}
function getResizeContentImg(iw,ih,maxw){
	if (iw > maxw)
	{
		ih = Math.floor(ih*(maxw/iw));
		iw = maxw
	}
	return new Array(iw,ih)
}

function TransPNG(obj) {     
    var blankImg = "/modules/blank.gif";     
    var Src, Width, Height;     
    if ( !(typeof obj.style.filter == 'string' && obj.src.substr(obj.src.lastIndexOf(".")+1).toLowerCase() == 'png') ) 
        return;     
    Src = obj.src;     
    Width = obj.width;     
    Height = obj.height;     
    obj.src = blankImg;     
    obj.width = Width;     
    obj.height = Height;     
    obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+Src+"', sizingMethod='scale')"; 
}
