	function $(id){
		return document.getElementById(id);
	}

	function PopUp(url, wName, width, height) {//È­¸éÀÇ Áß¾Ó
		var LeftPosition = (screen.width/2) - (width/2);
		var TopPosition = (screen.height/2) - (height/2);
		var win = window.open(url, wName, "left="+LeftPosition+",top="+TopPosition+",width="+width+",height="+height);

		if(win == null){
			alert("ÆË¾÷Â÷´ÜÀ» ÇØÁ¦ÇØÁÖ¼¼¿ä!");
		} else{
			win.focus();
		}
	}


	function SetCookie(name, value, expiredays){//ÄíÅ° ¼³Á¤
		var todayDate = new Date(); 
		todayDate.setDate( todayDate.getDate() + expiredays ); 
		document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";";
	} 


	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){
				var endstr = document.cookie.indexOf (";", j);
				if (endstr == -1) 
					endstr = document.cookie.length; 
				return unescape(document.cookie.substring(j, endstr));
			}
			i = document.cookie.indexOf(" ", i) + 1;
			if (i == 0) break;
		}
		return null;
	} 


	function DeleteCookie (name) {//ÄíÅ° »èÁ¦
		var exp = new Date(); 
		exp.setTime (exp.getTime() - 1); 
		var cval = GetCookie (name); 
		document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString(); 
	} 


	function CopyClipBoard(strObj){//Å¬¸³º¸µå·Î ÅØ½ºÆ® º¹»ç
		var ra;
		var tempObj;
		tempObj = eval("document."+strObj);
		tempObj.focus();
		tempObj.select();
		ra = tempObj.createTextRange()
		ra.execCommand("copy");
		alert('ÀÌ¹ÌÁöÀÇ °æ·Î°¡ Å¬¸³º¸µå¿¡ º¹»çµÇ¾ú½À´Ï´Ù. \n\n'
		+'º¹»çÇÏ½Ç °÷¿¡¼­ Ctrl + v ¶Ç´Â ¸¶¿ì½º ¿À¸¥ÂÊ ¹öÆ°À» ´­·¯ ºÙ¿©³Ö±â ÇÏ½Ã¸é µË´Ï´Ù.\n\n');
	}


	function FileExtCheck(obj, n) {//ÆÄÀÏ¸íÀÇ È®ÀåÀÚ¿Í Æ¯¼ö¹®ÀÚ °Ë»ç, ¸¶Ä§Ç¥ 2°³ ÀÌ»ó »ç¿ëµÇ¾ú´ÂÁö °Ë»ç
		var t = obj.value;
		var strFn;
		var strFn2;
		var re;
		var dotCnt = 0;
		
		if((t.lastIndexOf(".jpg")==-1) && (t.lastIndexOf(".gif")==-1) && (t.lastIndexOf(".JPG")==-1) && (t.lastIndexOf(".GIF")==-1)) {
			alert(n+"¹ø ÆÄÀÏ : ¾÷·ÎµåÇÒ ÆÄÀÏÀº JPG ¶Ç´ÂGIF¸¸ °¡´ÉÇÕ´Ï´Ù. ");
			return false;
		}
		
		//ÆÄÀÏ¸í¿¡ Æ¯¼ö¹®ÀÚ °Ë»ç
		strFn = t.substring(t.lastIndexOf("\\")+1, t.length);//È®ÀåÀÚ Æ÷ÇÔ ÆÄÀÏ¸í
		strFn2 = strFn.substring(0, strFn.indexOf("."));//È®ÀåÀÚ Á¦¿ÜÇÑ ÆÄÀÏ¸í
		
		re = /!|@|#|\$|%|\^|&|\*|\+|\?|\.|\,/;
		
		if(re.test(strFn2)){
			alert(n+"¹ø ÆÄÀÏ : ÆÄÀÏ¸í¿¡ Æ¯¼ö¹®ÀÚ¸¦ »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.");
			return false;
		}
		
		for(i=0; i<strFn.length; i++){
			if(strFn.substring(i,i+1)=="."){
				dotCnt++;
			}
		}
		if(dotCnt > 1){
			alert(n+'¹ø ÆÄÀÏ : ÆÄÀÏ¸í¿¡ ±¸ºÐÀÚ(ÆÄÀÏ¸í°ú È®ÀåÀÚ ±¸ºÐ) " . " ´Â 1°³ÀÌ»ó »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.');
			return false;
		}
		
		return true;
	}

	function FileExtCheck2(obj) {//ÆÄÀÏ¸íÀÇ È®ÀåÀÚ¿Í Æ¯¼ö¹®ÀÚ °Ë»ç, ¸¶Ä§Ç¥ 2°³ ÀÌ»ó »ç¿ëµÇ¾ú´ÂÁö °Ë»ç
		var t = obj.value;
		var strFn;
		var strFn2;
		var re;
		var dotCnt = 0;
		
		if((t.lastIndexOf(".jpg")==-1) && (t.lastIndexOf(".gif")==-1) && (t.lastIndexOf(".JPG")==-1) && (t.lastIndexOf(".GIF")==-1)) {
			alert("¾÷·ÎµåÇÒ ÆÄÀÏÀº JPG ¶Ç´ÂGIF¸¸ °¡´ÉÇÕ´Ï´Ù. ");
			return false;
		}
		
		//ÆÄÀÏ¸í¿¡ Æ¯¼ö¹®ÀÚ °Ë»ç
		strFn = t.substring(t.lastIndexOf("\\")+1, t.length);//È®ÀåÀÚ Æ÷ÇÔ ÆÄÀÏ¸í
		strFn2 = strFn.substring(0, strFn.indexOf("."));//È®ÀåÀÚ Á¦¿ÜÇÑ ÆÄÀÏ¸í
		
		re = /!|@|#|\$|%|\^|&|\*|\+|\?|\.|\,/;
		
		if(re.test(strFn2)){
			alert("ÆÄÀÏ¸í¿¡ Æ¯¼ö¹®ÀÚ¸¦ »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.");
			return false;
		}
		
		for(i=0; i<strFn.length; i++){
			if(strFn.substring(i,i+1)=="."){
				dotCnt++;
			}
		}
		if(dotCnt > 1){
			alert('ÆÄÀÏ¸í¿¡ ±¸ºÐÀÚ(ÆÄÀÏ¸í°ú È®ÀåÀÚ ±¸ºÐ) " . " ´Â 1°³ÀÌ»ó »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.');
			return false;
		}
		
		return true;
	}

	function CenterLayer(strObj){//º»¹® ·¹ÀÌ¾î¸¦ ºê¶ó¿ìÁ® Áß¾Ó¿¡ ¹èÄ¡
		var obj = eval("document.all."+strObj);
		var _x = (document.body.clientWidth-908)/2;
		var _y = (document.body.clientHeight+500)/2;
		obj.style.posLeft=_x;
		//document.layers["divCalendar"].style.posTop=_y;
	}


	//Ã·ºÎÆÄÀÏ ¾÷·Îµå
	function openUploader(sFormName, sElementName, sUploadPath){
		var sURL = "/pub/fileUpload.asp?frmName=" + sFormName + "&elem=" + sElementName + "&path=" + sUploadPath;

		PopUp(sURL, "fileUploader", 340, 200);
	}


	//ÀÌ¹ÌÁöÆÄÀÏ ¾÷·Îµå
	function openImageUploader(sFormName, sElementName, sUploadPath){
		var sURL = "/pub/imageUploader.asp?frmName=" + sFormName + "&elem=" + sElementName + "&path=" + sUploadPath;

		PopUp(sURL, "fileUploader", 340, 200);
	}

	// *************************************************************
	//		Ãß°¡ºÎºÐ
	// *************************************************************

	// ÀÌ¹ÌÁö »çÀÌÁî¿¡ ¸Â°Ô ÀÚµ¿À¸·Î Å©±âÁ¶ÀýµÇ´Â »õÃ¢¶ç¿ì±â
	function showPicture(src) {
	  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>»çÁø º¸±â</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 getFlashObject(flashSrc, objWidth, objHeight, etcParam) {
		var tag = "";
		var baseFlashDir="";
		flashSrc = baseFlashDir + flashSrc;

		if ( etcParam != "" || etcParam != null ) {
			if ( etcParam.substr(0, 1) == "?" )
				flashSrc += etcParam;
			else
				flashSrc += "?" + etcParam;
		}

		tag += "<object id=\"adqua\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ";
		tag += "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" ";
		tag += "width=\"" + objWidth + "\" height=\"" + objHeight + "\">";
		tag += "<param name=\"movie\" value=\"" + flashSrc + "\">";
		tag += "<param name=\"menu\" value=\"false\">";
		tag += "<param name=\"quality\" value=\"high\">";
		tag += "<embed name=\"adqua\" src=\"" + flashSrc + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" ";
		tag += "type=\"application/x-shockwave-flash\" width=\"" + objWidth + "\" height=\"" + objHeight + "\" ";
		tag += "wmode=\"transparent\"></embed>";
		tag += "</object>";
//		tag += "<param name=\"wmode\" value=\"transparent\">";
		document.write(tag);
	}


	// ÇÃ·¡½Ã Á¡¼±¾øÀÌ ¶ç¿ì±â(ÇÃ·¡½ÃÀÇ id/nameÁöÁ¤)..
	function getFlashObject(flashSrc, objWidth, objHeight, etcParam, flaName) {
		var tag = "";
		var baseFlashDir="";
		flashSrc = baseFlashDir + flashSrc;

		if ( etcParam != "" || etcParam != null ) {
			if ( etcParam.substr(0, 1) == "?" )
				flashSrc += etcParam;
			else
				flashSrc += "?" + etcParam;
		}

		tag += "<object id=\"" + flaName + "\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ";
		tag += "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" ";
		tag += "width=\"" + objWidth + "\" height=\"" + objHeight + "\">";
		tag += "<param name=\"movie\" value=\"" + flashSrc + "\">";
		tag += "<param name=\"menu\" value=\"false\">";
		tag += "<param name=\"quality\" value=\"high\">";
		tag += "<param name=\"wmode\" value=\"transparent\">";
		tag += "<embed name=\"" + flaName + "\" src=\"" + flashSrc + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" ";
		tag += "type=\"application/x-shockwave-flash\" width=\"" + objWidth + "\" height=\"" + objHeight + "\" ";
		tag += "wmode=\"transparent\"></embed>";
		tag += "</object>";

		document.write(tag);
	}

function swf(src,w,h){
	html = '';
	html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="param" width="'+w+'" height="'+h+'">';
	html += '<param name="movie" value="'+src+'">';
	html += '<param name="quality" value="high">';
	html += '<param name="bgcolor" value="#ffffff">';
	html += '<param name="wmode" value="transparent">';
	html += '<param name="menu" value="false">';
	html += '<param name="swliveconnect" value="true">';
	html += '<embed src="'+src+'" quality=high bgcolor="#ffffff" menu="false" width="'+w+'" height="'+h+'" swliveconnect="true" id="param" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"><\/embed>';
	html += '<\/object>';
	document.write(html);
}

	/*	F11, F5, ¼Ò½ºº¸±â ¸·±â.	*/

	if(window.Event)	// ³Ý½ºÄÉÀÌÇÁ¿¡¼­´Â ´ë¹®ÀÚ Event
		document.captureEvents(Event.MOUSEUP);

	function nocontextmenu(){		// IE
		event.cancelBubble = true;
		event.returnValue = false;
		return false;
	}

	function norightclick(e){		// Others..
		if(window.Event){
			if(e.which == 2 || e.which == 3)
				return false;
		} else{
			if(event.button == 2 || event.button == 3){
				event.cancelBubble = true;
				event.returnValue = false;
				return false;
			}
		}
	}

	function processKey(){
		if(event.ctrlKey == true && (event.keyCode == 78 || event.keyCode == 82) || (event.keyCode >= 112 && event.keyCode <= 123) || event.keyCode == 8){
			event.keyCode = 0;
			event.cancelBubble = true;
			event.returnValue = false;
		}
	}
	/*
	document.onkeydown = processKey;
	document.oncontextmenu = nocontextmenu;
	document.onmousedown = norightclick;
	document.onselectstart = new Function("return false");
	document.ondragstart = new Function("return false");
	*/



// Trim Function Implementation from JScavitto
String.prototype.LTrim=new Function("return this.replace(/^\\s+/,'')")
String.prototype.RTrim=new Function("return this.replace(/\\s+$/,'')")
String.prototype.Trim= new Function("return this.replace(/^\\s+|\\s+$/g,'')")	