function showMovie(src, autostart, left, top, width, height){
document.write("<EMBED style=LEFT: "+left+"px; TOP: "+top+"px; WIDTH: "+width+"px; HEIGHT: "+height+"px src="+src+" type=application/x-mplayer2 width="+width+" height="+height+" autostart="+autostart+" SHOWSTATUSBAR=true></EMBED>");
}

var domainString  = document.domain
var isGOLFSKY = "";
if(domainString.indexOf("golfsky.com")>-1){
   isGOLFSKY = "1";
}

function flashViewWT(fileName, w, h){
	FlashViewTmp = "\
							<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+fileName+"' align='middle' />\
							<param name='allowScriptAccess' value='always' />\
							<param name='movie' value='"+fileName+"' />\
							<param name='FlashVars' value='flashVars' />\
							<param name='loop' value='false' />\
							<param name='menu' value='true' />\
							<param name='quality' value='high' />\
							<param name='wmode' value='transparent' />\
							<param name='scale' value='noscale' />\
							<param name='bgcolor' value='#FFFFFF' />\
							<embed src='"+fileName+"' FlashVars='flashVars'  quality='best' bgcolor='#FFFFFF' width='"+w+"' height='"+h+"' name='"+fileName+"' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />\
							</object>";

	return FlashViewTmp;
}


function showFlash(SwfSource, BannerTag, fWidth, fHeight){

if(navigator.appName.indexOf("Microsoft")!=-1)
	{

	if(BannerTag.length < 2) {
		if(BannerTag == "A"){	  
			document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'")
			document.write("codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='"+fWidth+"' height='"+fHeight+"' id=ucc_top' align='middle'>");
			document.write("<param name='allowScriptAccess' value='sameDomain'>");
			document.write("<param name='movie' value='"+SwfSource+"'>");
			document.write("<param name='quality' value='high'><param name='wmode' value='transparent'>");
			document.write("<param name='bgcolor' value='#000000'>");
			document.write("<embed src='"+SwfSource+"' quality='high' wmode='transparent' bgcolor='#000000' width='"+fWidth+"' height='"+fHeight+"' name='ucc_top' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash'"); 
			document.write("pluginspage='http://www.macromedia.com/go/getflashplayer'></object>");
		}else if(BannerTag =="U"){
			document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+fWidth+"' height='"+fHeight+"' ' id='player2' align='middle'>");
			document.write("<param name='allowScriptAccess' value='always' />");
			document.write("<param name='allowFullScreen' value='true'>");
			document.write("<param name='FlashVars' value='golf="+isGOLFSKY+"'>");
			document.write("<param name='movie' value='http://ucc.golfsky.com/player.asp?key="+SwfSource+"&autoPlay=0&xml=http://ucc.golfsky.com/xml.asp'/><param name='quality' value='high' /><param name='bgcolor' value='#000000' /><embed src='player.asp' quality='high' bgcolor='#000000' width='"+fWidth+"' height='"+fHeight+"'  name='player2' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
			document.write("</object>")
		}else if(BannerTag =="Z"){ 
			document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+fWidth+"' height='"+fHeight+"' ' id='player2' align='middle'>");
			document.write("<param name='allowScriptAccess' value='always' />");
			document.write("<param name='allowFullScreen' value='true'>");
			document.write("<param name='FlashVars' value='golf="+isGOLFSKY+"'>");
			document.write("<param name='movie' value='http://ucc.golfsky.com/player.asp?key="+SwfSource+"&autoPlay=0&xml=http://ucc.golfsky.com/xml.asp&zoom=1'/><param name='quality' value='high' /><param name='bgcolor' value='#000000' /><embed src='player.asp' quality='high' bgcolor='#000000' width='"+fWidth+"' height='"+fHeight+"'  name='player2' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
			document.write("</object>")
		}else{
			document.write("<OBJECT ID='OBJECT3' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' ");
			document.write("codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' ");
			document.write("WIDTH='"+ fWidth +"' HEIGHT='"+ fHeight +"' VIEWASTEXT>");
			document.write("<PARAM NAME=movie VALUE='"+ SwfSource +"'>");
			document.write("<PARAM NAME=menu VALUE='false'>");
			document.write("<PARAM NAME=quality VALUE='high'>");
			document.write("<PARAM NAME=bgcolor VALUE='#FFFFFF'>");
			document.write("<PARAM NAME=wmode VALUE='transparent'>");
			document.write("<param name='allowScriptAccess' value='always'>");
			document.write("<EMBED src='"+ SwfSource +"'");
			document.write(" menu=false quality=high bgcolor=#FFFFFF WIDTH="+ fWidth +" HEIGHT="+ fHeight);
			document.write(" TYPE='application/x-shockwave-flash'");
			document.write(" PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'");
			document.write(" name='OBJECT3' allowScriptAccess='always' swLiveConnect=true>");
			document.write("</EMBED></OBJECT><img src='/global/?"+BannerTag+"' border=0 width=0 height=0>");
//			document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0' width='"+fWidth+"' height='"+fHeight+"' id=OBJECT1>");
//			document.write("<param name=movie value='"+SwfSource+"'>");
//			document.write("<param name='quality' value='high'>");
//			document.write("<embed src='"+SwfSource+"' quality=high pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+fWidth+"' height='"+fHeight+"'></embed></object><img src='/global/?"+BannerTag+"' border=0 width=0 height=0>");	  
		}
	}else{
		document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+fWidth+"' height='"+fHeight+"' id=OBJECT1>");
		document.write("<param name=movie value='"+SwfSource+"'>");
		document.write("<param name='quality' value='high'>");
		document.write("<param name='wmode' value='transparent'>");
		document.write("<embed src='"+SwfSource+"' quality=high pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+fWidth+"' height='"+fHeight+"'></embed>");
		document.write("</object><img src='/global/?"+BannerTag+"' border=0 width=0 height=0>");	  
	}

    }
	else
    {

 document.write("<embed src='http://ucc.golfsky.com/player.asp?key="+SwfSource+"&autoPlay=0&xml=http://ucc.golfsky.com/xml.asp' quality=high pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+fWidth+"' height='"+fHeight+"' name='OBJECT1' allowScriptAccess='always' swLiveConnect=true wmode='transparent' menu='false' scale='noscale' salign='LT'></embed>");
/*	
var strFlashValue = "" +
"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='"+fWidth+"' height='"+fHeight+"' name='OBJECT1' align='top'> " +
"<param name='allowScriptAccess' value='always' /> " +
"<param name='movie' value='http://ucc.golfsky.com/player.asp?key="+SwfSource+"&autoPlay=0&xml=http://ucc.golfsky.com/xml.asp' /> " +
"<param name='quality' value='high' /> " +
"<param name='wmode' value='transparent' /> " +
"<embed src='http://ucc.golfsky.com/player.asp?key="+SwfSource+"&autoPlay=0&xml=http://ucc.golfsky.com/xml.asp' quality='high' bgcolor='#ffffff' width='"+fWidth+"' height='"+fHeight+"' name='OBJECT1' align='top' wmode='transparent' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /> " +
"</object> " ;

document.write (strFlashValue);
*/
	
	}

}


function addNumbers(num1) {
        return (num1);
    }

/*//window.name	=	"golfskymain";*/
function getCurrentURL(num1) {
	var nowAddress = unescape(location.href);
	var parameters = new Array();

	parameters = (nowAddress.slice(nowAddress.indexOf("//")+2,nowAddress.length)).split("/");
	if (parameters[1] = "booking") {
		return(1);
	} else if (parameters[1] = "greenfee") {
		return(2);
	} else if (parameters[1] = "lesson") {
		return(3);
	} else if (parameters[1] = "premium") {
		return(4);
	} else if (parameters[1] = "platinum") {
		return(5);
	} else if (parameters[1] = "membership") {
		return(6);
	}
}

// Ä³¸¯ÅÍ ?? °Ë? 'H'-ÇÑ±Û, 'E'-¿µ?, 'N'-¼ýÀÚ, 'Z'-±â? 
function getCharType(pValue){ 
var bHan = false; 
var bAlp = false; 
var bNum = false; 
var bEtc = false; 

var retStr=""; 

if(isEmpty(pValue)){ 
  return ""; 
} 

for(var idx=0; idx < pValue.length; idx++){ 
  if (isAlpha(pValue[idx])) { 
   bAlp = true; 
  } 
  else if (isNum(pValue[idx])) { 
   bNum = true; 
  } 
  else if (isHangul(pValue[idx])) { 
   bHan = true; 
  } 
  else { 
   bEtc = true; 
  } 
   
  if (bHan) retStr = retStr + "H"; 
  if (bAlp) retStr = retStr + "E"; 
  if (bNum) retStr = retStr + "N"; 
  if (bEtc) retStr = retStr + "Z"; 
} 

return retStr; 
}  


// ºí·Î±× ¹Ù·Î?±â °ü? 
//	function UserBlogWin1(url) {
//		var width_ = 980;
//		var height_ = 630;
//		var left_ = screen.width;
//		var top_ = screen.height;
//		left_ = left_/2 - (width_/2);
//		top_ = top_/2 - (height_/2);
//		window.open("http://blog.golfsky.com/"+url,'Blgw1','height='+height_+',width='+width_+',status=0,scrollbars=0,resizable=0,left='+left_+',top='+top_+'');
//	}



//?Ã¢ ?? ?? 
function uf_newWin( url, winName, sizeW, sizeH) 
{ 
var nLeft  = screen.width/2 - sizeW/2 ; 
var nTop  = screen.height/2 - sizeH/2 ; 

opt = ",toolbar=no,menubar=no,location=no,scrollbars=yes,status=no"; 
window.open(url, winName, "left=" + nLeft + ",top=" +  nTop + ",width=" + sizeW + ",height=" + sizeH  + opt ); 

} 

//?Ã¢ ?? ?? 
function newWindows( url, winName, sizeW, sizeH, scrollbars) { 
	var nLeft  = screen.width/2 - sizeW/2 ; 
	var nTop  = screen.height/2 - sizeH/2 ; 

	opt = ",toolbar=no,menubar=no,location=no,scrollbars="+ scrollbars +",status=no"; 
	window.open(url, winName, "left=" + nLeft + ",top=" +  nTop + ",width=" + sizeW + ",height=" + sizeH  + opt ); 
} 

//?Ã¢ ??Áî ??  
function uf_reSize ( sizeW, sizeH) 
{ 
window.resizeTo( sizeW, sizeH ); 

} 

//¿É?? ??°æ¿ì 

function selDataChange(form) { 
  var DataIndex=form.url.selectedIndex; 
  if (form.url.options[DataIndex].value != null) { 
       location=form.url.options[DataIndex].value; 
  } 
} 

function selDataChange2(form) { 
  var DataIndex=form.url2.selectedIndex; 
  if (form.url2.options[DataIndex].value != null) { 
       location=form.url2.options[DataIndex].value; 
  } 
} 

/** 
* ???? NULLÀÎÁö Ã¼? 
*/ 
function isNull(input) { 
    if (input.value == null || input.value == "") { 
        return true; 
    } 
    return false; 
} 

/** 
* ???¿¡ ?Æä?? ?¿ÜÀÇ ÀÇ¹Ì?? ?? ??Áö Ã¼? 
* ex) if (isEmpty(form.keyword)) { 
*         alert("°Ë???? ???¼¼?."); 
*     } 
*/ 
function isEmpty(input) { 
    if (input.value == null || input.value.replace(/ /gi,"") == "") { 
        return true; 
    } 
    return false; 
} 

/** 
* ???¿¡ Æ¯? ?ÀÚ(chars)? ??Áö Ã¼? 
* Æ¯? ?ÀÚ¸¦ ???Áö ¾Ê?·Á ÇÒ ? ?? 
* ex) if (containsChars(form.name,"!,*&^%$#@~;")) { 
*         alert("?? ??¿¡? Æ¯? ?ÀÚ¸¦ ??ÇÒ ? ?½À?´Ù."); 
*     } 
*/ 
function containsChars(input,chars) { 
    for (var inx = 0; inx < input.value.length; inx++) { 
       if (chars.indexOf(input.value.charAt(inx)) != -1) 
           return true; 
    } 
    return false; 
} 

/** 
* ???? Æ¯? ?ÀÚ(chars)¸¸?·Î µÇ???Áö Ã¼? 
* Æ¯? ?ÀÚ¸¸ ???·Á ÇÒ ? ?? 
* ex) if (!containsCharsOnly(form.blood,"ABO")) { 
*         alert("?¾×Çü ??¿¡? A,B,O ?ÀÚ¸¸ ??ÇÒ ? ?½À?´Ù."); 
*     } 
*/ 
function containsCharsOnly(input,chars) { 
    for (var inx = 0; inx < input.value.length; inx++) { 
       if (chars.indexOf(input.value.charAt(inx)) == -1) 
           return false; 
    } 
    return true; 
} 
function isStartWith(input,chars) { 
    for (var inx = 0; inx < chars.length; inx++) { 
       if (chars.indexOf(input.value.charAt(0)) == -1) 
           return false; 
    } 
    return true; 
} 
/** 
* ???? ¾Ë?ºªÀÎÁö Ã¼? 
* ¾Æ? isAlphabet() ºÎÅÍ isNumComma()?ÁöÀÇ ?¼Ò?? 
* ÀÚÁÖ ??? °æ¿ì¿¡? var chars º¯?¸¦  
* global º¯?·Î ¼±¾ð?? ????? ÇÑ´Ù. 
* ex) var uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 
*     var lowercase = "abcdefghijklmnopqrstuvwxyz";  
*     var number    = "0123456789"; 
*     function isAlphaNum(input) { 
*         var chars = uppercase + lowercase + number; 
*         return containsCharsOnly(input,chars); 
*     } 
*/ 
function isAlphabet(input) { 
    var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz "; 
    return containsCharsOnly(input,chars); 
} 

/** 
* ???? ¾Ë?ºª ´ë?ÀÚÀÎÁö Ã¼? 
*/ 
function isUpperCase(input) { 
    var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ "; 
    return containsCharsOnly(input,chars); 
} 

/** 
* ???? ¾Ë?ºª ¼Ò?ÀÚÀÎÁö Ã¼? 
*/ 
function isLowerCase(input) { 
    var chars = "abcdefghijklmnopqrstuvwxyz "; 
    return containsCharsOnly(input,chars); 
} 

/** 
* ???¿¡ ¼ýÀÚ¸¸ ??Áö Ã¼? 
*/ 
function isNumber(input) { 
    var chars = "0123456789"; 
    return containsCharsOnly(input,chars); 
} 

/** 
* ???? ¾Ë?ºª,¼ýÀÚ·Î µÇ???Áö Ã¼? 
*/ 
function isAlphaNum(input) { 
    var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 "; 
    return containsCharsOnly(input,chars); 
} 

function isBigAlphaNum(input) { 
    var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 "; 
    return containsCharsOnly(input,chars); 
} 
/** 
* ???? ¼ýÀÚ,´ë?(-)·Î µÇ???Áö Ã¼? 
*/ 
function isNumDash(input) { 
    var chars = "-0123456789"; 
    return containsCharsOnly(input,chars); 
} 

/** 
* ???? ¼ýÀÚ,ÄÞ¸¶(,)·Î µÇ???Áö Ã¼? 
*/ 
function isNumComma(input) { 
    var chars = ",0123456789"; 
    return containsCharsOnly(input,chars); 
} 

function fnc_onlyNumber() {	//¹®ÀÚÀÔ·ÂÁ¦ÇÑ ÇÔ¼ö(¼ýÀÚ¸¸ÀÔ·Â°¡´É)
	var key = event.keyCode;
	if (key == 32 || key == 8 || key == 9 || key == 46 || key == 37 || key == 39 || key == 13 || key == 109 || key == 107 || key == 189 || key == 187){
		return;
	} else {
		if (key < 48){
			event.returnValue = false;
		} else if(key > 57){
			if(key > 95 & key < 107){
				return;
			}else{
				event.returnValue = false;
			}
		}
	}
}


/** 
* ???? ??ÀÚ? ?ÀÇÇÑ Æ÷¸Ë Çü?ÀÎÁö Ã¼? 
* ÀÚ¼¼ÇÑ format Çü?? ÀÚ¹Ù????ÀÇ 'regular expression'? Âü? 
*/ 
function isValidFormat(input,format) { 
    if (input.value.search(format) != -1) { 
        return true; //?¹Ù¸¥ Æ÷¸Ë Çü? 
    } 
    return false; 
} 

/** 
* ???? ??ÀÏ Çü?ÀÎÁö Ã¼? 
* ex) if (!isValidEmail(form.email)) { 
*         alert("?¹Ù¸¥ ??ÀÏ ÁÖ¼Ò? ¾Æ??´Ù."); 
*     } 
*/ 
function isValidEmail(input) { 
//    var format = /^(\S+)@(\S+)\.([A-Za-z]+)$/; 
    var format = /^((\w|[\-\.])+)@((\w|[\-\.])+)\.([A-Za-z]+)$/; 
    return isValidFormat(input,format); 
} 

/** 
* ???? ?È­?? Çü?(¼ýÀÚ-¼ýÀÚ-¼ýÀÚ)ÀÎÁö Ã¼? 
*/ 
function isValidPhone(input) { 
    var format = /^(\d+)-(\d+)-(\d+)$/; 
    return isValidFormat(input,format); 
} 

/** 
* ???ÀÇ ¹Ù?? ±æ?¸¦ ¸®ÅÏ 
* ex) if (getByteLength(form.title) > 100) { 
*         alert("Á¦¸ñ? ÇÑ±Û 50ÀÚ(¿µ? 100ÀÚ) ?»ó ??ÇÒ ? ?½À?´Ù."); 
*     } 
*/ 
function getByteLength(input) { 
    var byteLength = 0; 
    for (var inx = 0; inx < input.value.length; inx++) { 
        var oneChar = escape(input.value.charAt(inx)); 
        if ( oneChar.length == 1 ) { 
            byteLength ++; 
        } else if (oneChar.indexOf("%u") != -1) { 
            byteLength += 2; 
        } else if (oneChar.indexOf("%") != -1) { 
            byteLength += oneChar.length/3; 
        } 
    } 
    return byteLength; 
} 

/** 
* ???¿¡? ÄÞ¸¶¸¦ ?¾Ø´Ù. 
*/ 
function removeComma(input) { 
    return input.value.replace(/,/gi,""); 
} 

/** 
* ¼±ÅÃµÈ ¶ó???Æ°? ??Áö Ã¼? 
*/ 
function hasCheckedRadio(input) { 
    if (input.length > 1) { 
        for (var inx = 0; inx < input.length; inx++) { 
            if (input[inx].checked) return true; 
        } 
    } else { 
        if (input.checked) return true; 
    } 
    return false; 
} 

/** 
* ¼±ÅÃµÈ Ã¼?¹Ú?? ??Áö Ã¼? 
*/ 
function hasCheckedBox(input) { 
    return hasCheckedRadio(input); 
} 


/** 
* ¼±ÅÃµÈ Ã¼?¹Ú??  ¸î°³ÀÎÁö  ±× °³?¸¦ ?È¯ 
*/ 
function hasMultiCheckedRadio(input) { 
var kkkk = 0; 
    if (input.length > 1) { 
        for (var inx = 0; inx < input.length; inx++) { 
            if (input[inx].checked) { 
   kkkk++; 
   } 
        } 
    } else { 
   if (input.checked) kkkk=1; 
} 
    return kkkk; 
} 

/** 
* ??ÇÑ(Á¸Àç??) ?(êÅ)ÀÎÁö Ã¼? 
*/ 
function isValidMonth(mm) { 
    var m = parseInt(mm,10); 
    return (m >= 1 && m <= 12); 
} 

/** 
* ??ÇÑ(Á¸Àç??) ÀÏ(ìí)ÀÎÁö Ã¼? 
*/ 
function isValidDay(yyyy, mm, dd) { 
    var m = parseInt(mm,10) - 1; 
    var d = parseInt(dd,10); 

    var end = new Array(31,28,31,30,31,30,31,31,30,31,30,31); 
    if ((yyyy % 4 == 0 && yyyy % 100 != 0) || yyyy % 400 == 0) { 
        end[1] = 29; 
    } 

    return (d >= 1 && d <= end[m]); 
} 

/** 
* ??ÇÑ(Á¸Àç??) ?(•r)ÀÎÁö Ã¼? 
*/ 
function isValidHour(hh) { 
    var h = parseInt(hh,10); 
    return (h >= 1 && h <= 24); 
} 

/** 
* ??ÇÑ(Á¸Àç??) ºÐ(·Ö)ÀÎÁö Ã¼? 
*/ 
function isValidMin(mi) { 
    var m = parseInt(mi,10); 
    return (m >= 1 && m <= 60); 
} 

/** 
* Time Çü?ÀÎÁö Ã¼?(´À½¼ÇÑ Ã¼?) 
*/ 
function isValidTimeFormat(time) { 
    return (!isNaN(time) && time.length == 12); 
} 

/** 
* ????(Á¸Àç??) Time ÀÎÁö Ã¼? 
* ex) var time = form.time.value; //'200102310000' 
*     if (!isValidTime(time)) { 
*         alert("?¹Ù¸¥ ³¯?? ¾Æ??´Ù."); 
*     } 
*/ 
function isValidTime(time) { 
    var year  = time.substring(0,4); 
    var month = time.substring(4,6); 
    var day   = time.substring(6,8); 
    var hour  = time.substring(8,10); 
    var min   = time.substring(10,12); 

    if (parseInt(year,10) >= 1900  && isValidMonth(month) && 
        isValidDay(year,month,day) && isValidHour(hour)   && 
        isValidMin(min)) { 
        return true; 
    } 
    return false; 
} 

/** 
* Time ??¸µ? ÀÚ¹Ù???? Date °´Ã¼·Î º¯È¯ 
* parameter time: Time Çü?ÀÇ String 
*/ 
function toTimeObject(time) { //parseTime(time) 
    var year  = time.substr(0,4); 
    var month = time.substr(4,2) - 1; // 1?=0,12?=11 
    var day   = time.substr(6,2); 
    var hour  = time.substr(8,2); 
    var min   = time.substr(10,2); 

    return new Date(year,month,day,hour,min); 
} 

/** 
* ÀÚ¹Ù???? Date °´Ã¼¸¦ Time ??¸µ?·Î º¯È¯ 
* parameter date: JavaScript Date Object 
*/ 
function toTimeString(date) { //formatTime(date) 
    var year  = date.getFullYear(); 
    var month = date.getMonth() + 1; // 1?=0,12?=11?¹Ç·Î 1 ?? 
    var day   = date.getDate(); 
    var hour  = date.getHours(); 
    var min   = date.getMinutes(); 

    if (("" + month).length == 1) { month = "0" + month; } 
    if (("" + day).length   == 1) { day   = "0" + day;   } 
    if (("" + hour).length  == 1) { hour  = "0" + hour;  } 
    if (("" + min).length   == 1) { min   = "0" + min;   } 

    return ("" + year + month + day + hour + min) 
} 

/** 
* Time? ?Àç?°¢ ??(¹Ì?)ÀÎÁö Ã¼? 
*/ 
function isFutureTime(time) { 
    return (toTimeObject(time) > new Date()); 
} 

/** 
* Time? ?Àç?°¢ ??(°ú°Å)ÀÎÁö Ã¼? 
*/ 
function isPastTime(time) { 
    return (toTimeObject(time) < new Date()); 
} 

/** 
* ÁÖ?Áø Time °ú y³â m? dÀÏ h? ??³ª? Time? ¸®ÅÏ 
* ex) var time = form.time.value; //'20000101000' 
*     alert(shiftTime(time,0,0,-100,0)); 
*     => 2000/01/01 00:00 ?·ÎºÎÅÍ 100ÀÏ ? Time 
*/ 
function shiftTime(time,y,m,d,h) { //moveTime(time,y,m,d,h) 
    var date = toTimeObject(time); 

    date.setFullYear(date.getFullYear() + y); //y³â? ?? 
    date.setMonth(date.getMonth() + m);       //m?? ?? 
    date.setDate(date.getDate() + d);         //dÀÏ? ?? 
    date.setHours(date.getHours() + h);       //h?¸¦ ?? 

    return toTimeString(date); 
} 

/** 
* µÎ Time? ¸î °³? ??³ª?Áö ?? 
* time1? time2?´Ù ??(¹Ì??) minus(-) 
*/ 
function getMonthInterval(time1,time2) { //measureMonthInterval(time1,time2) 
    var date1 = toTimeObject(time1); 
    var date2 = toTimeObject(time2); 

    var years  = date2.getFullYear() - date1.getFullYear(); 
    var months = date2.getMonth() - date1.getMonth(); 
    var days   = date2.getDate() - date1.getDate(); 

    return (years * 12 + months + (days >= 0 ? 0 : -1) ); 
} 

/** 
* µÎ Time? ¸çÄ¥ ??³ª?Áö ?? 
* time1? time2?´Ù ??(¹Ì??) minus(-) 
*/ 
function getDayInterval(time1,time2) { 
    var date1 = toTimeObject(time1); 
    var date2 = toTimeObject(time2); 
    var day   = 1000 * 3600 * 24; //24?°£ 

    return parseInt((date2 - date1) / day, 10); 
} 

/** 
* µÎ Time? ¸î ?°£ ??³ª?Áö ?? 
* time1? time2?´Ù ??(¹Ì??) minus(-) 
*/ 
function getHourInterval(time1,time2) { 
    var date1 = toTimeObject(time1); 
    var date2 = toTimeObject(time2); 
    var hour  = 1000 * 3600; //1?°£ 

    return parseInt((date2 - date1) / hour, 10); 
} 

/** 
* ?Àç ?°¢? Time Çü??·Î ¸®ÅÏ 
*/ 
function getCurrentTime() { 
    return toTimeString(new Date()); 
} 

/** 
* ?Àç ?°¢°ú y³â m? dÀÏ h? ??³ª? Time? ¸®ÅÏ 
*/ 
function getRelativeTime(y,m,d,h) { 

    return shiftTime(getCurrentTime(),y,m,d,h); 
} 

/** 
* ?Àç Ò´? YYYYÇü??·Î ¸®ÅÏ 
*/ 
function getYear() { 

    return getCurrentTime().substr(0,4); 
} 

/** 
* ?Àç êÅ? MMÇü??·Î ¸®ÅÏ 
*/ 
function getMonth() { 

    return getCurrentTime().substr(4,2); 
} 

/** 
* ?Àç ìí? DDÇü??·Î ¸®ÅÏ 
*/ 
function getDay() { 

    return getCurrentTime().substr(6,2); 
} 

/** 
* ?Àç •r¸¦ HHÇü??·Î ¸®ÅÏ 
*/ 
function getHour() { 

    return getCurrentTime().substr(8,2); 
} 

/** 
* ?´Ã? ¹«½¼ ?ÀÏ?¾ß? 
* ex) alert('?´Ã? ' + getDayOfWeek() + '?ÀÏ??´Ù.'); 
*/ 
function getDayOfWeek() { 
    var now = new Date(); 

    var day = now.getDay(); //ÀÏ?ÀÏ=0,??ÀÏ=1,...,Åä?ÀÏ=6 
    var week = new Array('ÀÏ','?','È­','?','¸ñ','±Ý','Åä'); 

    return week[day]; 
} 


/** 
* Æ¯?³¯?ÀÇ ?ÀÏ? ?ÇÑ´Ù. 
*/ 
function getDayOfWeek(time) { 
    var now = toTimeObject(time); 

    var day = now.getDay(); //ÀÏ?ÀÏ=0,??ÀÏ=1,...,Åä?ÀÏ=6 
    var week = new Array('ÀÏ','?','È­','?','¸ñ','±Ý','Åä'); 

    return week[day]; 
} 



/** 
*   ?ÀÚ?ÀÇ ?¸¥ÂÊ ?¿¡? ºÎÅÍ Áö?µÈ °³?¸¸Å­ÀÇ ?ÀÚµé? ¸®ÅÏÇÑ´Ù. 
*/ 

function substrInverse(str, num) 
{ 
var len; 

len = str.length; 

return str.substr(len - num, num); 
} 

/** 
*  ?ÀÚ?·ÎÀÇ Æ¯?À§Ä¡·ÎºÎÅÍ Áö?µÈ °³?ÀÇ ?ÀÚµé? ¸®ÅÏÇÑ´Ù. 
*/ 
function substrMid(str, idx, num) 
{ 
return str.substr( idx-1, num); 
} 


/** 
* Cookie¼³??±â 
*/ 

function setCookie(name, value, expire) { 
          document.cookie = name + "=" + escape(value) 
          + ( (expire) ? "; expires=" + expire.toGMTString() : "") 
} 

/** 
* Cookie ??±â 
*/ 


function getCookie(uName) { 

var flag = document.cookie.indexOf(uName+'='); 
if (flag != -1) {  
  flag += uName.length + 1 
  end = document.cookie.indexOf(';', flag)  

  if (end == -1) end = document.cookie.length 
  return unescape(document.cookie.substring(flag, end)) 
} 
}  

    function Half2Full(HalfVal) 
{ 
         var arg; 
         arg = myHalf2Full(HalfVal); 
  return arg; 
} 

function myHalf2Full(HalfVal) 
{ 
   var FullChar = [ 
                "¡¡", "£¡","£¢","££","£¤","£¥","£¦","£§","£¨",     //33~ 
         "£©","£ª","£«","£¬","£­","£®","£¯","£°","£±","£²",      //41~ 
         "£³","£´","£µ","£¶","£·","£¸","£¹","£º","£»","£¼",      //51~ 
         "£½","£¾","£¿","£À","£Á","£Â","£Ã","£Ä","£Å","£Æ",      //61~ 
         "£Ç","£È","£É","£Ê","£Ë","£Ì","£Í","£Î","£Ï","£Ð",      //71~ 
         "£Ñ","£Ò","£Ó","£Ô","£Õ","£Ö","£×","£Ø","£Ù","£Ú",      //81~ 
         "£Û","£Ü","£Ý","£Þ","£ß","£à","£Á","£Â","£Ã","£Ä",      //91~ 
         "£Å","£Æ","£Ç","£È","£É","£Ê","£Ë","£Ì","£Í","£Î",      //101~ 
         "£Ï","£Ð","£Ñ","£Ò","£Ó","£Ô","£Õ","£Ö","£×","£Ø",      //111~ 
         "£Ù","£Ú","£û","£ü","£ý","¢¦"                         //121~ 
         ]; 
  var stFinal = ""; 
         var ascii; 
         for( i = 0; i < HalfVal.length; i++) 
         { 
                 ascii = HalfVal.charCodeAt(i); 
                 if( (31 < ascii && ascii < 128)) 
                 { 
                   stFinal += FullChar[ascii-32]; 
                 } 
                 else 
                 { 
                   stFinal += HalfVal.charAt(i); 
                 } 
         } 
         return stFinal; 
} 
function frmMoney(input){ 
input.value = putComma(input); 
} 
function unFrmMoney(input){ 
input.value = replace(input.value,",",""); 
} 
function frmDate(input){ 
if(input.value=="") return  
input.value = input.value.substring(0,4) + "-" + input.value.substring(4,6) + "-" + input.value.substring(6,8); 
} 
function unFrmDate(input){ 
input.value = replace(input.value,"-",""); 
} 
function frmTime(input){ 
input.value = input.value.substring(0,2) + ":" + input.value.substring(2,4) + ":" + input.value.substring(4,6); 
} 
function unFrmTime(input){ 
input.value = replace(input.value,":",""); 
} 
function frmAcct(input){ 
input.value = input.value.substring(0,3) + "-" + input.value.substring(3,9) + "-" + input.value.substring(9,14); 
} 
function unFrmAcct(input){ 
input.value = replace(input.value,"-",""); 
} 

function setSelect(input,str) { 
for(i=0;i<input.options.length;i++){ 
  if(input.options[i].value == str) 
   input.options[i].selected=true; 
} 
} 
// ¿ÜÈ¯¿¡? Æ¯? ÅëÈ­ÀÏ? ¼Ò?Á¡?? ±Ý¾×?¾Ö±â  
function Curr(str1, str2){ 
obj1 = eval("frm."+str1+".value") 
obj2 = eval("frm."+str2+".style") 
if(obj1=="JPY"||obj1=="ITL"||obj1=="BEF"||obj1=="KRW"){ 
  obj2.display = "none" 
}else{ 
  obj2.display = "" 
} 
} 
function Curr2(str1, str2, str3){ 
obj1 = eval("frm."+str1+".value") 
obj2 = eval("frm."+str2+".style") 
obj3 = eval("frm."+str3+".style") 
if(obj1=="JPY"||obj1=="ITL"||obj1=="BEF"||obj1=="KRW"){ 
  obj2.display = "none" 
  obj3.display = "none" 
}else{ 
  obj2.display = "" 
  obj3.display = "" 
} 
} 

   //////////////////////////////////////////////////////////////// 
   // ??ÅÍ ?¼ÛÇü? °ü? 
   //////////////////////////////////////////////////////////////// 
    
    // get ??ÀÇ ?¶ó¹ÌÅÍ¸¦ ÇØ´çÆû¿¡ input hidden °´Ã¼·Î ?¼ºÇÑ´Ù. 
    function get2post(frm,sSearch){  
     if (sSearch.length > 0) { 
      
      var asKeyValues = sSearch.split('&'); 
      var asKeyValue  = ''; 
          
      for (var i = 0; i < asKeyValues.length; i++) { 
        
       asKeyValue = asKeyValues[i].split('='); 
       var e = document.createElement("input"); 
       e.setAttribute("type","hidden"); 
       e.setAttribute("name",asKeyValue[0]); 
       e.setAttribute("value",asKeyValue[1]); 
       e.setAttribute("_temp","true"); 
        
    //   alert("[" + e.name +"]:[" + e.value +"]"); 
        
       frm.appendChild(e); 
      } 
      }  
    //  alert("form °´Ã¼ ??" + frm.elements.length); 
    }    
     
    // get2post·Î ?¼ºÇÑ ÀÓ? °´Ã¼¸¦ ??ÇÑ´Ù.   
    function removeTempAttribute(frm){  
     var idx=0; 
     while (idx<frm.elements.length) { 
      var obj = frm.elements[idx]; 
       
      if( obj.getAttribute("_temp") != null && obj.getAttribute("_temp") == "true"){ 
       frm.removeChild(obj); 
       continue; 
      } 
      idx++; 
     } 
    }    
     
     

   //////////////////////////////////////////////////////////////// 
   // checkbox °ü? 
   //////////////////////////////////////////////////////////////// 
    
    // check ÇÑ °³?¸¦ ¸®ÅÏÇÑ´Ù. 
    function getCheckedCount( aElem ) { 
      
     var elem = document.all; 
     var cnt = 0; 
      
     for ( var i=0; i<document.all.length; i++ ) { 
      if ( ( elem[i].type == "checkbox" ) && ( elem[i].checked ) && ( elem[i].name == aElem ) ) cnt = cnt + 1; 
     } 
      
     return cnt; 
    } 
     
     
    // Áö?ÇÑ ??? ?Áø ¸ð? checkbox¸¦ check ÇÑ´Ù. 
    function checkAll( aElem ) { 
      
     var elem = document.all; 
     var cnt = 0; 
      
     for ( var i=0; i<document.all.length; i++ ) { 
      if ( ( elem[i].type == "checkbox" ) && ( elem[i].name == aElem ) ) elem[i].checked = true; 
     } 
    } 
     
     
    // Áö?ÇÑ ??? ?Áø ¸ð? checkboxÀÇ checked ?? ?? ÇÑ´Ù.  
    function invertCheck( aElem ) { 
      
     var elem = document.all; 
     var cnt = 0; 
      
     for ( var i=0; i<document.all.length; i++ ) { 
      if ( ( elem[i].type == "checkbox" ) && ( elem[i].name == aElem ) ) { 
       if ( elem[i].checked ) { 
        elem[i].checked = false; 
       } 
       else{ 
        elem[i].checked = true; 
       } 
      } 
     } 
    }    
     

     


     


     
   //////////////////////////////// 
   // UTIL ?? 
   //////////////////////////////// 
    
    var isDivEvent = false; 
     
    function hideOneNav(){ 
     if (!isDivEvent) { 
      window.account.style.visibility='hidden'; 
     } 
     else{ 
      isDivEvent = false; 
     } 
    } 
     
     
    function showOneNav(obj){ 
     isDivEvent = true; 
     window.account.style.left = getLeftPos(obj); 
     window.account.style.top = getTopPos(obj) + obj.offsetHeight - 8; 
     window.account.style.visibility='visible'; 
     return false; 
    } 
     
    function getLeftPos(obj){ 
     var parentObj = null; 
     var clientObj = obj; 
     var left = obj.offsetLeft + document.body.clientLeft; 
      
     while((parentObj=clientObj.offsetParent) != null){ 
      left = left + parentObj.offsetLeft; 
      clientObj = parentObj; 
     } 
      
     return left; 
    } 
     
    function getTopPos(obj){ 
     var parentObj = null; 
     var clientObj = obj; 
     var top = obj.offsetTop + document.body.clientTop; 
      
     while((parentObj=clientObj.offsetParent) != null){ 
      top = top + parentObj.offsetTop; 
      clientObj = parentObj; 
     } 
      
     return top; 
    } 

    /** 
    *  ?ÀÚ?¿¡ ?? Æ¯??ÀÚÆÐÅÏ? ´Ù¸¥ ?ÀÚÆÐÅÏ?·Î ¹Ù²Ù? ??. 
    */ 
     
    function replace(targetStr, searchStr, replaceStr) 
    { 
     var len, i, tmpstr; 
     
     len = targetStr.length; 
     tmpstr = ""; 
     
     for ( i = 0 ; i < len ; i++ ) { 
      if ( targetStr.charAt(i) != searchStr ) { 
       tmpstr = tmpstr + targetStr.charAt(i); 
      } 
      else { 
       tmpstr = tmpstr + replaceStr; 
      } 
     } 
     return tmpstr; 
    } 
    
    /** 
    *  ?ÀÚ?¿¡? ?¿ì °ø?Á¦°Å 
    */ 
     
    function trim(str) 
    { 
     return replace(str," ",""); 
    } 

    /** 
    * ÄÞ¸¶¼³?. 
    */ 
     
    function putComma(input) {  
     var num = input; 
      
     if (num < 0) {  
      num *= -1;  
      var minus = true 
     }else{ 
      var minus = false 
     } 
      
     var dotPos = (num+"").split(".") 
     var dotU = dotPos[0] 
     var dotD = dotPos[1] 
     var commaFlag = dotU.length%3 
     
     if(commaFlag) { 
      var out = dotU.substring(0, commaFlag)  
      if (dotU.length > 3) out += "," 
     } 
     else var out = "" 
     
     for (var i=commaFlag; i < dotU.length; i+=3) { 
      out += dotU.substring(i, i+3)  
      if( i < dotU.length-3) out += "," 
     } 
     
     if(minus) out = "-" + out 
     if(dotD) return out + "." + dotD 
     else return out  
    } 

    
    //?ÀÇ ? ÀÏÀÚ ¾ò±â 
    function getEndDate(datestr){ 
      
     //³ÎÀÎÁö?  
     if(isEmpty(datestr)){ 
      return null; 
     }  
      
     //¼ýÀÚÀÎÁö? 
     if(!isNum(datestr)){ 
      return null; 
     } 
       
     //±æ?? 8ÀÚ¸®? 
     if(datestr.length != 6){ 
      return null; 
     } 
      
     var yy = Number(datestr.substring(0,4)); 
     var mm = Number(datestr.substring(4,6)); 
      
     //À±³â °Ë? 
     var boundDay = ""; 
    
     if(mm != 2){ 
      var mon=new Array(31,28,31,30,31,30,31,31,30,31,30,31); 
      boundDay = mon[mm-1]; 
     } 
     else{ 
      if (yy%4 == 0 && yy%100 != 0 || yy%400 == 0){ 
       boundDay = 29; 
      } 
      else{ 
       boundDay = 28; 
      } 
     } 
      
     return boundDay;   
    } 
    
    // Left ºóÀÚ¸® ¸¸Å­ padStr ? ?ÀÎ´Ù. 
    function lpad(src, len, padStr){ 
     var retStr = ""; 
     var padCnt = Number(len) - String(src).length; 
     for(var i=0;i<padCnt;i++) retStr += String(padStr); 
     return retStr+src; 
    } 
    
    // Right ºóÀÚ¸® ¸¸Å­ padStr ? ?ÀÎ´Ù. 
    function rpad(src, len, padStr){ 
     var retStr = ""; 
     var padCnt = Number(len) - String(src).length; 
     for(var i=0;i<padCnt;i++) retStr += String(padStr); 
     return src+retStr; 
    } 
    
    
    // ?È­?? ??°Ë? 
    function isValidDDDPhoneNum(dddphonenum) 
    { 
     
     // ³ÎÀÎ?? 
     if (isEmpty(dddphonenum)) { 
      return null; 
     } 
      
        
     if ( dddphonenum != "02" && dddphonenum != "031" && dddphonenum != "032" && dddphonenum != "033" && dddphonenum != "041" && 
          dddphonenum != "042" && dddphonenum != "043" && dddphonenum != "051" && dddphonenum != "052" && dddphonenum != "053" && 
          dddphonenum != "054" && dddphonenum != "055" && dddphonenum != "061" && dddphonenum != "062" && dddphonenum != "063" && 
          dddphonenum != "064" && dddphonenum != "011" && dddphonenum != "016" && dddphonenum != "017" && dddphonenum != "018" && dddphonenum != "019" ) 
     { 
       
      ERR_MSG = "Àß?µÈ ?È­?? ????´Ù."; 
      return false; 
     } 
      
     return true; 
      
    } 
    
    
    // ´ë?ÀÚº¯È¯ 
    function toUpperCase(str){  
      
     if(isEmpty(str)) return str; 
     return str.toUpperCase(); 
    } 
    
     
    // ¼ýÀÚ°Ë? 
    function isNum(str){  
      
     if(isEmpty(str)) return false; 
      
     for(var idx=0;idx < str.length;idx++){ 
      if(str.charAt(idx) < '0' || str.charAt(idx) > '9'){ 
       return false; 
      } 
     } 
     return true; 
    } 
    
    
    // ¿µ?ÀÚ°Ë? 
    function isAlpha(str){ 
      
     if(isEmpty(str)) return false; 
      
     for(var idx=0;idx < str.length;idx++){ 
      if(!((str.charAt(idx) >='a' && str <= 'z') || (str.charAt(idx) >= 'A' && str <= 'Z'))){ 
       return false; 
      } 
     } 
     return true; 
    } 
    
    
    // ÇÑ±Û°Ë? 
    function isHangul(str){ 
      
     if(isEmpty(str)) return false; 
      
     for(var idx=0;idx < str.length;idx++){ 
          var c = escape(str.charAt(idx)); 
          if ( c.indexOf("%u") == -1 ) { 
       return false; 
      } 
     } 
     return true;   
    }  
    
     
    // ½ÇÁ¦±æ? ?È¯( ÇÑ±Û 2byte °è»ê )  
    function getByteLength(s){ 
      
       var len = 0; 
       if ( s == null ) return 0; 
       for(var i=0;i<s.length;i++){ 
          var c = escape(s.charAt(i)); 
          if ( c.length == 1 ) len ++; 
          else if ( c.indexOf("%u") != -1 ) len += 2; 
          else if ( c.indexOf("%") != -1 ) len += c.length/3; 
       } 
       return len; 
    } 
     
     
    // ºó?ÀÎÁö ¸®ÅÏÇÑ´Ù. 
    function isEmpty(pValue){ 
      
     if( (pValue == "") || (pValue == null) ){ 
      return true; 
     } 
     return false; 
    } 
     
     

    
    //°Ë?³¯? ??±â°£  
    function getBoundDate1(yy,mm,dd,stdDate) 
    { 
     var today = new Date(); 
     today.setYear(stdDate.substring(0,4)); 
     today.setMonth(stdDate.substring(4,6)-1); 
     today.setDate(stdDate.substring(6,8)); 
     today.setHours(today.getHours()); 
     today.setMinutes(today.getMinutes()); 
     today.setSeconds(today.getSeconds()); 
      
     yy = Number(yy); 
     mm = Number(mm); 
     dd = Number(dd); 
      
     var date = new Date(); 
      
     var DAY = 24 * 60 * 60 * 1000; 
      
     if ( yy != 0 ){ 
      date.setTime(today.getTime() + DAY * 365 * yy); 
     } 
    
     if ( mm != 0 ){ 
      date.setTime(today.getTime() + DAY * 30 * mm); 
     } 
      
     if ( dd != 0 ){ 
      date.setTime(today.getTime() + DAY * dd); 
     } 
      
     return lpad(new String(date.getYear()),4,'0') + lpad(new String(date.getMonth() + 1),2,'0') + lpad(new String(date.getDate()),2,'0');     
    }    



    function getBoundDate(yy, mm, dd) { 
     yy = Number(yy); 
     mm = Number(mm); 
     dd = Number(dd); 
      
     var date = new Date(); 
      
     var DAY = 24 * 60 * 60 * 1000; 

      
     if ( yy != 0 ){ 
      date.setTime(datToday.getTime() + DAY * 365 * yy); 
     } 
    
     if ( mm != 0 ){ 
      date.setTime(datToday.getTime() + DAY * 30 * mm); 
     } 
      
     if ( dd != 0 ){ 
      date.setTime(datToday.getTime() + DAY * dd); 
     } 
      
     return lpad(new String(date.getYear()),4,'0') + lpad(new String(date.getMonth() + 1),2,'0') + lpad(new String(date.getDate()),2,'0'); 
    }    
      
    
    //°Ë?³¯? Ã¼?  
    function isVaildTerm(obj,yy,mm,dd) 
    { 
     var datestr = obj.value; 
      
      
     //³ÎÀÎÁö?  
     if(isEmpty(datestr)){ 
      return null; 
     } 
      
     // ³¯? Æ÷¸ËÁ¦°Å 
     obj_removeformat(obj); 
      
     //8ÀÚ¸®ÀÎÁö? 
     if (getByteLength(datestr) != 8) { 
      alert("³¯?? '-'¸¦ Á¦¿ÜÇÑ 8ÀÚ¸® ¼ýÀÚ·Î ??????."); 
      return false; 
       
     } 
    
      
      
     // yy,mm,dd,fromto? ?? °æ¿ì 
     if (yy == null) yy = 0; 
     if (mm == null) mm = 0; 
     if (dd == null) dd = 0; 
      
     // °Ë?³¯? ??±â°£ ?Á®?±â 
     var boundDate = getBoundDate(yy,mm,dd); 
      
     if (yy < 0  || mm < 0  || dd < 0) { 
      if ( boundDate > datestr) { 
       alert("???Áö ¾Ê? °Ë?³¯???´Ù.\n??ÇÑ ³¯??" + boundDate.substring(0,4) + "³â " + boundDate.substring(4,6) + "? " + boundDate.substring(6) + "ÀÏºÎÅÍ ??´Ù."); 
       obj.select(); 
       return false; 
      } 
     } else { 
      if ( boundDate < datestr) { 
       alert("???Áö ¾Ê? °Ë?³¯???´Ù.\n??ÇÑ ³¯??" + boundDate.substring(0,4) + "³â " + boundDate.substring(4,6) + "? " + boundDate.substring(6) + "ÀÏ?Áö ??´Ù."); 
       obj.select(); 
       return false; 
      }     
     } 
       
    
     return true; 
     
    } 
    
    
    
    //?´Ã³¯? 
    function getToDay() 
    { 
    
        var date = datToday; 
    
        var year  = date.getFullYear(); 
        var month = date.getMonth() + 1; // 1?=0,12?=11?¹Ç·Î 1 ?? 
        var day   = date.getDate(); 
     
        if (("" + month).length == 1) { month = "0" + month; } 
        if (("" + day).length   == 1) { day   = "0" + day;   } 
          
        return ("" + year + month + day) 
     
    } 
     
    function selectComboBox(targt, optValue) 
    { 
     last = targt.length; 
     for(var i=0; i<last; i++){ 
      if(targt.options[i].value == optValue){ 
       targt.selectedIndex = i; 
       targt.options[i].selected; 
      } 
     } 
    } 
     
     
    function isExistsComboBoxValue(targt, optValue) 
    { 
     last = targt.length; 
     for(var i=0; i<last; i++){ 
      if(targt.options[i].value == optValue){ 
       return true; 
      } 
     } 
     return false; 
    } 

     
      
/* 
* ?È­?? 
* ¾Õ¿¡ '0'? Ã¤¿î´Ù 
*/ 

function fill_zero(obj, is4){ 
var temp=""; 

if(obj.value == null || obj.value.length < 1 ) { 
  return false; 
} 

if (is4 == 'Y' ) { 
  return true; 
} else { 
  if(obj.value.length != 4 ) { 
   for(i=0;i<(4-obj.value.length);i++){ 
    temp +="0"; 
   } 
   obj.value = temp+obj.value; 
  }else{ 
   obj.value = obj.value; 
  }  

  return true; 
} 
} 

//¼ýÀÚ¿¡ ¼¼ÀÚ¸®¼ö¸¶´Ù ÄÄ¸¶¸¦ ÂïÀº ÇüÅÂ·Î º¯È¯
function number_format(numstr) {
  var numstr = String(numstr);
  var re0 = /(\d+)(\d{3})($|\..*)/;
  if (re0.test(numstr))
    return numstr.replace(
      re0,
      function(str,p1,p2,p3) { return number_format(p1) + "," + p2 + p3; }
    );
  else
    return numstr;
}

//ÄÁÅÙÃ÷ ³»¿ë ÀÌ¹ÌÁö °­Á¦ ¸®»çÀÌÂ¡ Ã³¸®
function resize_images(getContain, getWidth) {
	var MAX_IMG_WIDTH = getWidth;
	//var elements = eval("document.all."+getContain);
	var elements = eval("document.all");
	//alert(elements.length);

	for (i=0;i<elements.length;i++) {
		var p = elements[i].parentElement;
		if ((p != null) && (p.tagName == "DIV")) {
			if ((elements[i].tagName == "A") && (elements[i].href.indexOf("javascript:") < 0)){
				elements[i].target = "_blank";
			}
		}
 
		//alert(elements[i].tagName);
		if (elements[i].tagName == "IMG") {
			//alert("aaa");
			var width = elements[i].width;
			if (width > MAX_IMG_WIDTH) {
				elements[i].width = MAX_IMG_WIDTH;
				elements[i].border = 0;
				elements[i].outerHTML = "<a href=\"javascript:showPicture('" + elements[i].src + "')\">" + elements[i].outerHTML + "</a>";
			}
		}
	}
}

function resize_imagesWidth(imgObj, width) {
	var oldWidth = imgObj.width;
	var oldHeight = imgObj.height;
	if (oldWidth > width) {
		var newWidth = width;
		var newHeight = Math.round(oldHeight * newWidth / oldWidth);
		imgObj.wdith = newWidth;
		imgObj.height = newHeight;
	}
}

/***** Enter Key¸¦ Ä¡¸é ´ÙÀ½ ÅÇÀ¸·Î ÀÌµ¿ÇÏ´Â function
****** val : ÇöÀç input boxÀÇ name
*/
function moveEnter(val) {
	var frmNM = document.edit_frm;
	if (event.keyCode == 13) {
		for(var i = 0; i< frmNM.elements.length-1; i++) {
			if (frmNM.elements[i].name == val.name) {
				for(var j = i; j< frmNM.elements.length-1; j++) {
					if (frmNM.elements[j+1].type == "text") {
						frmNM.elements[j+1].focus();
						return;
					}
				}
			}
		}
	}
}

function originpopupview(src) { 
//what = document.frmPrc.txtQryimg1[""+id+""].value;
what = src;
var imgwin = window.open("",'WIN','scrollbars=no,status=no,toolbar=no,resizable=1,location=no,menu=no,width=10,height=10'); 
imgwin.focus(); 
imgwin.document.open(); 
imgwin.document.write("<html>\n"); 
imgwin.document.write("<head>\n"); 
imgwin.document.write("<title>**</title>\n"); 

imgwin.document.write("<sc"+"ript>\n"); 
imgwin.document.write("function resize() {\n"); 
imgwin.document.write("pic = document.il;\n"); 
imgwin.document.write("if (eval(pic).height) { var name = navigator.appName\n"); 
imgwin.document.write("  if (name == 'Microsoft Internet Explorer') { myHeight = eval(pic).height ; myWidth = eval(pic).width ;\n"); 
imgwin.document.write("  } else { myHeight = eval(pic).height + 9; myWidth = eval(pic).width; }\n"); 

imgwin.document.write("  var height = screen.height;\n"); 
imgwin.document.write("  var width = screen.width;\n"); 
 

  // °¡·Î, ¼¼·Î ÃÖ´ë »çÀÌÁî ¼³Á¤
imgwin.document.write("   var maxWidth = width*0.7 ; ");  // ¿øÇÏ´Â´ë·Î ¼³Á¤. ÇÈ¼¿·Î ÇÏ·Á¸é maxWidth = 100  ÀÌ·± ½ÄÀ¸·Î ÀÔ·Â
imgwin.document.write("   var maxHeight = height*0.7 ;  "); // ¿ø·¡ »çÀÌÁî * 0.5 = 50%
   // °¡·Î³ª ¼¼·ÎÀÇ ±æÀÌ°¡ ÃÖ´ë »çÀÌÁîº¸´Ù Å©¸é ½ÇÇà  
imgwin.document.write("   if(myWidth >= maxWidth || myHeight >= maxHeight){\n ");
   // °¡·Î°¡ ¼¼·Îº¸´Ù Å©¸é °¡·Î´Â ÃÖ´ë»çÀÌÁî·Î, ¼¼·Î´Â ºñÀ² ¸ÂÃç ¸®»çÀÌÁî
imgwin.document.write("      if(myWidth > myHeight){\n ");
imgwin.document.write("         resizeWidth = maxWidth; \n");
imgwin.document.write("         resizeHeight =(myHeight * resizeWidth) / myWidth; \n");
   // ¼¼·Î°¡ °¡·Îº¸´Ù Å©¸é ¼¼·Î´Â ÃÖ´ë»çÀÌÁî·Î, °¡·Î´Â ºñÀ² ¸ÂÃç ¸®»çÀÌÁî
imgwin.document.write("      }else{\n ");
imgwin.document.write("         resizeHeight = maxHeight;\n ");
imgwin.document.write("         resizeWidth = (myWidth * resizeHeight) / myHeight; \n");
imgwin.document.write("      }  \n");
   // ÃÖ´ë»çÀÌÁîº¸´Ù ÀÛÀ¸¸é ¿øº» ±×´ë·Î
imgwin.document.write("   }else{ \n");
imgwin.document.write("      resizeWidth = myWidth;\n ");
imgwin.document.write("      resizeHeight = myHeight;\n ");
imgwin.document.write("   } \n");
imgwin.document.write("  } \n");
imgwin.document.write("  var leftpos = width / 2 - myWidth / 2;\n"); 
imgwin.document.write("  var toppos = height / 2 - myHeight / 2; \n"); 
imgwin.document.write("  self.moveTo(leftpos, toppos);\n"); 
//imgwin.document.write("  self.resizeTo(resizeWidth, resizeHeight);\n"); 
imgwin.document.write("  self.resizeTo(resizeWidth, resizeHeight);\n"); 
imgwin.document.write("  pic.height = resizeHeight;\n"); 
imgwin.document.write("  pic.width =  resizeWidth;\n");

imgwin.document.write("};\n"); 
imgwin.document.write("</sc"+"ript>\n"); 

imgwin.document.write("</head>\n"); 
imgwin.document.write('<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF">\n'); 

imgwin.document.write("<img border=0 src='"+what+"' xwidth=10 xheight=9 name=il style=cursor:hand onclick='self.close()'  onload='resize();'>\n"); 
imgwin.document.write("</body>\n"); 
imgwin.document.close(); 

} 

 
function showPicture(src) {
	var imgObj = new Image();
	imgObj.src = src;
	var wopt = "scrollbars=yes,status=no,resizable=yes";
	wopt += ",width=" + imgObj.width;
	wopt += ",height=" + imgObj.height;
	var wbody = "<head><title>»çÁø º¸±â</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();
	return;
}


function resizeImgWidth(imgObj, width) {
	var oldWidth = imgObj.width;
	var oldHeight = imgObj.height;
	if (oldWidth > width) {
		var newWidth = width;
		var newHeight = Math.round(oldHeight * newWidth / oldWidth);
		imgObj.wdith = newWidth;
		imgObj.height = newHeight;
	}
}


//ºÎ¸ðÀ§Ä¡¿¡¼­ ÇÏÀ§ ÀÌ¹ÌÁö »çÀÌÁî ÄÁÆ®·Ñ..................................................START(@@)
function fixImgs(whichId, maxW) {
	var pix_tmp=document.getElementById(whichId);
	if (pix_tmp){
		var pix = pix_tmp.getElementsByTagName('img');
		for (i=0; i<pix.length; i++) {
			w=pix[i].width;
			h=pix[i].height;
			if (w > maxW) {
				f=1-((w - maxW) / w);
				pix[i].width=w * f;
				pix[i].height=h * f;
			}
		}
	}
}

// Multiple onload function created by: Simon Willison
// http://simonwillison.net/2004/May/26/addLoadEvent/
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        //oldonload();
      }
      func();
    }
  }
}

addLoadEvent(function() {
  fixImgs('ptr_content', 548);  // ('element ID', maximum width)
});
//ºÎ¸ðÀ§Ä¡¿¡¼­ ÇÏÀ§ ÀÌ¹ÌÁö »çÀÌÁî ÄÁÆ®·Ñ..................................................END(@@)


function CM_bwcheck(){
	this.agent = navigator.userAgent.toLowerCase();

	this.ie8 = (this.agent.indexOf("msie 8") > -1);
	this.ie7 = (this.agent.indexOf("msie 7") > -1 && !this.ie8);
	this.ie6 = (this.agent.indexOf("msie 6") > -1 && !this.ie7 && !this.ie8);
	this.ie = (this.ie6 || this.ie7 || this.ie8);

	this.ff3 = (this.agent.indexOf("firefox/3") > -1);
	this.ff2 = (this.agent.indexOf("firefox/2") > -1);
	this.ff = (this.ff2 || this.ff3);

	this.wk = (this.agent.indexOf("webkit") > -1);


	if(this.ie)
	{
		if(this.ie6) { this.verInfo = 6; }
		else if(this.ie7) { this.verInfo = 7; }
		else if(this.ie8) { this.verInfo = 8; }
	}

	if(this.ff)
	{
		if(this.ff2) { this.verInfo = 2; }
		else if(this.ff3) { this.verInfo = 3; }
	}

	this.bw = (this.ie || this.ff || this.wk);


	if(navigator.userLanguage)
	{
		this.language = navigator.userLanguage.toLowerCase();
	}
	else if (navigator.language)
	{
		this.language = navigator.language.toLowerCase();
	}
	else
	{
		this.language = null;
	}

	return this;
}

var C_browserCHK = new CM_bwcheck();


/*### ÀÛ¼ºÀÚ : Áö¿À´Ïµå Design Team(Á¤¿µ¼®) ###*/




/* ¸µÅ© */
function GO_URL(num){
	switch(num)
	{
		/*## ¸ÞÀÎ ##*/
		case 000000 : location.href="/index.html";break;
		/* END */
	}
}





/* ÇÃ·¡½¬ ºä */
function flashView(fileName, w, h){
	document.write("\
	<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+fileName+"' align='middle' />\
	<param name='allowScriptAccess' value='always' />\
	<param name='movie' value='"+fileName+"' />\
	<param name='FlashVars' value='flashVars' />\
	<param name='loop' value='false' />\
	<param name='menu' value='true' />\
	<param name='quality' value='high' />\
    <param name='wmode' value='transparent' />\
    <param name='scale' value='noscale' />\
	<param name='bgcolor' value='#FFFFFF' />\
	<embed src='"+fileName+"' FlashVars='flashVars'  quality='best' bgcolor='#FFFFFF' width='"+w+"' height='"+h+"' name='"+fileName+"' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />\
	</object>");
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//ÆË¾÷¶ç¿ì±â
function winOpen (doc, wname, top, left, width, height) {
  window.open(doc, wname, 'scrollbars=yes,resizable=no,top='+top+',left='+left+',width='+width+',height='+height);
}

/***
**** ¿ìÆí¹øÈ£ »b¾÷Ã¢ È£Ãâ ÇÔ¼ö
***/
function PostSearch(fn, zipcd1, zipcd2, addr1, addr2) {
	var width_ = 470;
	var height_ = 300;
	var left_ = screen.width;
	var top_ = screen.height;
	left_ = left_/2 - (width_/2);
	top_ = top_/2 - (height_/2);
	window.open("/global2/postsearch.asp?fn="+fn+"&zipcd1="+zipcd1+"&zipcd2="+zipcd2+"&addr1="+addr1+"&addr2="+addr2,"PostWin",'height='+height_+',width='+width_+',status=0,scrollbars=1,resizable=1,left='+left_+',top='+top_+'')
}


var TweetAndTrack = {};
TweetAndTrack.open = function(targ, url) {
var callback_name = url.replace(/\W/g, '');
BitlyClient.call('shorten', {
'longUrl': url,
'history': '1'
}, 'BitlyCB.' + callback_name);
return false;
};
 
TweetAndTrack.popResult = function(data) {
// Results are keyed by longUrl, so we need to grab the first one.
for (var r in data.results) {
return data.results[r];
 }
};
 
 
function tweetMe(msg, url) {
var textMessage = msg.replace(new RegExp("^(.{0," + 80 + "}\\b).*"), "$1");
var callback_name = url.replace(/\W/g, '');
BitlyCB[callback_name] = function(data) {
var result = TweetAndTrack.popResult(data);
var tweet_url = "http://twitter.com/home?status=" + encodeURIComponent(textMessage+ "... " + result.shortUrl );
window.open(tweet_url);
};
 
BitlyClient.call('shorten', {
'longUrl': url,
'history': '1'
}, 'BitlyCB.' + callback_name);
 
return false;
}


function me2day(msg, tag) {
var textMessage = msg.replace(new RegExp("^(.{0," + 500 + "}\\b).*"), "$1");
var me2day_url = "http://me2day.net/posts/new?new_post[body]=" + encodeURIComponent(textMessage) +"&new_post[tags]=" + encodeURIComponent(tag) ;
window.open(me2day_url);

}
