
function $(objID) {return document.getElementById(objID)};
function $$(node){return document.getElementsByTagName(node)};
function addEvent(obj,type,fn){ 
	if (obj.attachEvent){ 
		obj['e'+type+fn] = fn; 
		obj[type+fn] = function(){obj['e'+type+fn]( window.event );} 
		obj.attachEvent('on'+type,obj[type+fn]); 
	}else{
		obj.addEventListener(type,fn,false); 
	}
} 
	function Alert(alert_width,alert_height,div_title,div_content){
    this.ok= function(){
		if ($("Discoloration_id"))document.body.removeChild($("Discoloration_id"));
		if ($("alert_div"))document.body.removeChild($("alert_div"));
		//document.body.oncontextmenu = function(){return true;}
		for (i=0;i<$$("select").length;i++){$$("select")[i].style.visibility="visible";}
	}
    this.ok();
	if (typeof(alert_width)=="undefined")return false;
	with(document.documentElement){
		var Discoloration_id = document.createElement("DIV");
		Discoloration_id.id = "Discoloration_id";
		Discoloration_id.style.position = "absolute";
		addEvent(Discoloration_id,"click",ok)
		Discoloration_id.style.left ="0px";
		Discoloration_id.style.top ="0px";
		if(scrollWidth>clientWidth)Discoloration_id.style.width=scrollWidth+"px";
		else Discoloration_id.style.width=clientWidth+"px";
		if(scrollHeight>clientHeight)Discoloration_id.style.height=scrollHeight+"px";
		else Discoloration_id.style.height=clientHeight+"px";
		Discoloration_id.style.background = "#E7F5FF";
		Discoloration_id.style.zIndex = "10000";
		Discoloration_id.style.filter = "alpha(opacity=50)";
		Discoloration_id.style.opacity = 0.5;
		document.body.appendChild(Discoloration_id);
		var alert_div = document.createElement("DIV");
		alert_div.id="alert_div";
		alert_div.style.position = "absolute";
		/*var intwh=20;
		this.setwidth=function(){
			var ii=parseInt(alert_div.style.width.replace("px",""))
			if(isNaN(ii)==true)ii=0;
			if(ii<alert_width.replace("px","")){
				ii+=intwh;
				alert_div.style.width=ii+"px";
			}else{
				clearInterval(ttw);
			}
		}
		var ttw=setInterval(this.setwidth,5);
		*/
		alert_div.style.width=alert_width;
		alert_div.style.height=alert_height;
		alert_div.style.zIndex = "10001";
		alert_div.style.left =document.documentElement.scrollLeft+clientWidth/2-alert_width.replace(/px/g,"")/2+"px";
		alert_div.style.top =document.documentElement.scrollTop+clientHeight/2-alert_height.replace(/px/g,"")/2+"px";	
		var strHtml="";
		strHtml="<div onclick=\"ok()\" style=\"margin:0px;padding:0px;border:1px solid #A2D2F0;background:#FFF;width:100%;height:110% !important;height:100%;\">\n";
		//strHtml+="<div style=\"padding:1px;height:25px !important;height:28px;line-height:25px;background:#E8F6FF;color:##0042FF;font-weight:bold;\"><span style=\"float:left;padding-left:20px;\">"+div_title+"</span><span style=\"float:right;cursor:pointer;margin-right:10px;padding-top:5px;\"><img src=\"images/logout.gif\" onclick=\"ok()\" style=\"vertical-align:middle;\" alt=\"¹Ø±Õ´°¿Ú\"/></span></div>\n";
		strHtml+="<div style=\"clear:both;padding:8px;text-align:center;\" >"+div_content+"</div>";
		strHtml+="</div>\n";
		alert_div.innerHTML = strHtml;
		document.body.appendChild(alert_div);
		for (i=0;i<$$("select").length;i++){$$("select")[i].style.visibility="hidden";}
		//oncontextmenu = function(){return false;}
	}
}


function changeImg(img){
if ( img.width/img.height>200/150)
{
	img.width=200
}
else
{
	img.height=150
}
}