<!--
// ----------------------------------------
// @ open popup window
// ----------------------------------------	
function Openwin(loc,wid,he,scr,res){
	LeftPosition = (screen.width) ? (screen.width-wid)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-he)/2 : 0;
	window.open(loc,'newwin', 'top='+TopPosition + ',left='+LeftPosition + ',width='+wid + ',height='+he + ',scrollbars='+scr + ',resizable='+res+ ',toolbar=no').focus();
}

// ----------------------------------------
// @ ÀÌ¹ÌÁö 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;
}	

function showPictureNS(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;";
  wbody += "  var ydiff=oImg.height;";
  wbody += "  window.resizeTo(xdiff,ydiff);";
  wbody += "  window.moveTo(300,200);";	  
  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();	   	  
  
  return;
}

// ----------------------------------------
// @ 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) {	
	document.cookie = name + "=; expires=" + (new Date()).toGMTString() + ";";
}
//-->