<!--
// ----------------------------------------
// @ return div object
// ----------------------------------------				
function getObject(objectID) {
	if (document.getElementById && document.getElementById(objectID)) {
		return document.getElementById(objectID)
	} else if (document.all && document.all(objectID)) {		// IE4
		return document.all(objectID);
	} else if (document.layers && document.layers[objectID]) {		//NS4
		return document.layers[objectID];
	} else {
		return false;
	}
}

// ----------------------------------------
// @ check if checkbox is checked
// ----------------------------------------	
function checkboxChk(field){
				
	var ischeck = false;

	if (field != undefined) {
		if (field.length == undefined) {
			if (field.checked) ischeck=true;	
		}else {				
			for (j=0; j<field.length; j++) {
				if (field[j].checked) {
					ischeck=true;										
					break;
				}
			}
		}	
	}
	return ischeck;
}
// ----------------------------------------
// @ return count of checked
// ----------------------------------------	
function checkedCount(field){
				
	var chkcount = 0;

	if (field != undefined) {
		if (field.length == undefined) {
			if (field.checked) chkcount=1;	
		}else {				
			for (j=0; j<field.length; j++) {
				if (field[j].checked) {
					chkcount = chkcount + 1;
				}
			}
		}	
	}
	return chkcount;
}

// ----------------------------------------
// @ select all
// ----------------------------------------	
	function selectAll(field){		
		if (field != undefined) {
			if (field.length == undefined) {
				field.checked=true;	
			}	else {				
				for (j=0; j<field.length; j++)
					field[j].checked=true;									
			}	
		}		
	}	
// ----------------------------------------
// @ deselect all
// ----------------------------------------	
	function deSelectAll(field) {
		if (field != undefined) {
			if (field.length == undefined) {
				field.checked=false;	
			}
			else {
			 	for (j=0; j<field.length; j++)
					field[j].checked=false;				
			}				
  	} 
	}
	
// ----------------------------------------
// @ ÀÌ¹ÌÁö URLÀ» ÀÔ·ÂÇÏ°í ¹öÆ°À» Å¬¸¯ÇÏ¸é,
// ÀÌ¹ÌÁö »çÀÌÁî¿¡ ¸Â°Ô »õÃ¢À» ¶ç¿ì°í (ÀÌ¹ÌÁö ·ÎµùÀÌ ³¡³ª¸é »õÃ¢ »çÀÌÁî°¡ ÀÚµ¿ Á¶Àý)
// ÇØ´ç »õ Ã¢¿¡¼­ ±×¸²À» Å¬¸¯ÇÏ¸é »õ Ã¢ÀÌ ÀÚµ¿À¸·Î ´ÝÈü´Ï´Ù.
// ----------------------------------------	
function showPicture(src, windowName) {
  var imgObj = new Image();
  imgObj.src = src;	  
  var wopt = "scrollbars=no,status=no,resizable=no";
  wopt += ",width=" + imgObj.width;
  wopt += ",height=" + imgObj.height;
  var wbody = "<head><title>"+windowName+"</title>";
  wbody += "<script language='javascript'>";
  wbody += "function finalResize(){";
  wbody += "  var oBody=document.body;";
  wbody += "  var oImg=document.images[0];";	  	  
  wbody += "  var xdiff=oImg.width-oBody.clientWidth;";
  wbody += "  var ydiff=oImg.height-oBody.clientHeight;";	  
  wbody += "  window.resizeBy(xdiff,ydiff);";
  wbody += "}";
  wbody += "</"+"script>";
  wbody += "</head>";
  wbody += "<body onLoad='finalResize()' style='margin:0'>";
  wbody += "<a href='javascript:window.close()'><img src='" + src + "' border=0></a>";
  wbody += "</body>";
  winResult = window.open("about:blank","",wopt);
  winResult.document.open("text/html", "replace");
  winResult.document.write(wbody);
  winResult.document.close();	  
  
  var li_a_width  = window.screen.availWidth;  
  	var li_a_height = window.screen.availHeight; 
  	var li_width    = winResult.document.body.clientWidth; 
  	var li_height   = winResult.document.body.clientHeight;   	
  	
  	winResult.moveTo((li_a_width - li_width)/2,(li_a_height - li_height)/2);
  	
  return;
}	

// ----------------------------------------
// @ °´Ã¼¸¦ disabled ? true : false
// ----------------------------------------
function chkDisabled(name, mode)
{
	var stylesheet = {
		BgColorT:BgColor="#D0D0D0",
		BgColorF:BgColor="#FFFFFF"
	};

	name.disabled = mode;  

	if(mode == true) {		
		name.value = "";
		name.style.background = stylesheet.BgColorT; 
	} else {
		name.style.background = stylesheet.BgColorF;
	}	

	return;
}

function trim(str) {	
	temp = str.replace(/(^\s*)|(\s*$)/g, "");
	return temp;
}	

// ----------------------------------------
// @ cookie setting
// ----------------------------------------				
function SetCookie (name, value) {	
	var argv = SetCookie.arguments;  
	var argc = SetCookie.arguments.length;  
	var expires = (argc > 2) ? argv[2] : null;  
	var path = (argc > 3) ? argv[3] : null;  
	var domain = (argc > 4) ? argv[4] : null;  
	var secure = (argc > 5) ? argv[5] : false;  
	document.cookie = name + "=" + escape (value) + 
	((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
	((path == null) ? "" : ("; path=" + path)) +  
	((domain == null) ? "" : ("; domain=" + domain)) +    
	((secure == true) ? "; secure" : "");	
}

// ----------------------------------------
// @ get cookie
// ----------------------------------------				
function getCookieVal(offset) {
	var endstr = document.cookie.indexOf(";",offset);
	if (endstr == -1)
	endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie(name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;

	while ( i< clen ) {
		var j = i + alen;
		if (document.cookie.substring(i,j) == arg)
		return getCookieVal(j);
		i = document.cookie.indexOf(" ",i) + 1;
		if (i==0) break;
	}
	return null;
}
function deleteCookie(name) {	
	var argv = deleteCookie.arguments;  
	var argc = deleteCookie.arguments.length;  

	var path = (argc > 1) ? argv[1] : null;  
	
	document.cookie = name + "=; expires=" + (new Date()).toGMTString() + 			
	((path == null) ? "" : ("; path=" + path));
}
//-->