<!--
/***********************************
¼³¸í : Æû¿¡¼­ °ø¹é Ã¼Å©ÇØ¼­ °ø¹éÀÌ¸é ¸Þ¼¼Áö º¸¿©Áö°í ÇØ´ç Æû°ª¿¡ Æ÷Ä¿½º
¿¹) checkSpace(frm,strMsg) checkSpace(Æû.ÀÌ¸§, ¸Þ¼¼Áö)
¸®ÅÏ) °ø¹éÀÌ¸é false °ø¹éÀÌ ¾Æ´Ï¸é true
 ****************************************/
function checkSpace(frm,strMsg){
	var str = frm.value
	if (str.search(/\S/)<0){			//\S °ø¹éÀÌ ¾Æ´Ñ ¹®ÀÚ¸¦ Ã£´Â´Ù.
		alert (strMsg);
		frm.value = "";
		frm.focus();
		return false;
	}
	var temp=str.replace(' ','');
	if (temp.length == 0){
		alert (strMsg);
		frm.value = "";
		frm.focus();
		return false;
	}
	return true;
}

	/************************************************************
	¼³¸í : ÁÖ¹Î¹øÈ£ Ã¼Å© ÇÔ¼ö
	¿¹)checkJumin(ÁÖ¹Î¹øÈ£)
	°ªÀÌ Àß¸øµÈ°Ô ÀÖ´Ù¸é false
	°ªÀÌ ¿Ã¹Ù¸£´Ù¸é true
	************************************************************/
	function checkJumin(it){
		IDtot = 0;
		IDAdd = "234567892345";

		for(i=0; i<12; i++) IDtot = IDtot + parseInt(it.substring(i, i+1)) * parseInt(IDAdd.substring(i, i+1));
		IDtot = 11 - (IDtot%11);
		if (IDtot == 10) IDtot = 0;
		else if (IDtot == 11) IDtot = 1;

		if(parseInt(it.substring(12, 13)) != IDtot) return false;
		else return true;
	}
	
	/************************************************************
	¼³¸í : ÀÔ·ÂÇÑ emailÀÌ ¿µ¹®ÀÚ¿Í @°ªÀÌ Á¤È®ÀÌ µé¾î°¡ ÀÖ´ÂÁö 
	¿¹) checkEmail("test@test.co.kr")
	°á°ú) true
	¸®ÅÏ : ÀÌ¸ÞÀÏÀÌ ¸Â´Ù¸é  True , Æ²¸®´Ù¸é false
	************************************************************/
	function checkEmail(email){
		var str='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';
		var flag=0;
		var comma=0;
		for(i=0; i<email.length; i++) {
			for(j=0; j<str.length; j++) {
				if(email.charAt(i)==str.charAt(j)){
					break;
				}
			}
			if(j==str.length) {
				if(email.charAt(i)=='@'){
					flag++;
				}else if(email.charAt(i)=='.'){
					comma++;
				}else{
					return false;
				}
			}
		}
		if(flag!=1){
			return false;
		}else if((comma<1)||(comma>3)){
			return false;
		}else{
			return true;
		}
	}
		
/************************************************************
¼³¸í : »õÃ¢ ¶ç¿ö¼­ Æ÷Ä¿½º ÁÖ±â
¿¹)windowOpen('ÁÖ¼Ò','À©µµ¿ìÀÌ¸§',°¡·Î,¼¼·Î,'±âÅ¸ ¼³Á¤')
,scrollbars=yes ,personalbar=no ,resizable=no ,directories=no ,status=no ,menubar=no
************************************************************/
function windowOpen(pUrl,pName,pW,pH,val){
	var winWidth  = window.screen.width;    //ÇØ»óµµ°¡·Î
	var winHeight  = window.screen.height;     //ÇØ»óµµ¼¼·Î
	
	// XPÀÎ °æ¿ì height 29 Ãß°¡
	//if( window.navigator.userAgent.indexOf("SV1") != -1 ) {
	//	pH += 29;
	//}
	
	var pLeft,pTop;
	pLeft = parseInt((winWidth-pW)/2);
	pTop = parseInt((winHeight-pH)/2);
	
	var newWin=window.open(pUrl,pName,"width="+pW+",height="+pH+",left="+pLeft+",top="+pTop+" "+ val );
	newWin.focus(); 
}



	//ÀÌ¹ÌÁö¸í Ã¼Å©
	function checkImg(obj)
	{
		if(obj.value!=""){		//°ªÀÌ ÀÖ´Ù¸é ÀÌ¹ÌÁö¸í Ã¼Å©
			if (!checkFileName(obj)){
				return false;
			}else{	
				return true;
			}
		}else{	//°ªÀÌ ¾ø´Ù¸é Ã¼Å© ¾ÈÇÑ´Ù.
			return true;
		}		
	}
	
	//ÆÄÀÏ¸í Ã¼Å© ÇÑ±Û ¿Ã¹Ù¸£´Ù¸é true Àß¸ø µÇ¾ú´Ù¸é false
	function checkFileName(el) {
		var _regExp=/\\\w+\.(gif|jpg)/ig;
		var _filter = el.value.match(_regExp);
		var _fileName = null;

		if (_filter == null){
			_fileName = el.value.toUpperCase();
			if (_fileName.indexOf("JPG") == -1 || _fileName.indexOf("GIF") == -1){
				alert("ÆÄÀÏ¸íÀ» [¿µ¹®][¼ýÀÚ]·Î¸¸ ÀÛ¼ºÇØÁÖ½Ã°í,\n\nÀÌ¹ÌÁö Çü½ÄÀº [JPG] ÀÌ°Å³ª [GIF] ÀÌ¾î¾ß ÇÕ´Ï´Ù.");
			}else{
				alert("[ÆÄÀÏ¸í]À» [¿µ¹®][¼ýÀÚ]·Î¸¸ ÀÛ¼ºÇØ ÁÖ½Ê½Ã¿ä.\n\n"
					+"(¿¹) È«±æµ¿_0.gif (X), hong_gil_dong.gif(O)"
				);
			}
			return false;
		}
		return true;
	}

	
	//ÀÌ¹ÌÁö È®´ëº¸±â
	//popImgWin(ÀÌ¹ÌÁö ÁÖ¼Ò)
	function popImgWin(imgSrc){

		var viewSrc;
		var src1,src2;
		if( imgSrc.lastIndexOf("/")>-1 ){
			src1 = imgSrc.substring(0, imgSrc.lastIndexOf("/")+1 );
			src2 = imgSrc.slice(imgSrc.lastIndexOf("/")+1);
		}else{
			src1 = "";
			src2 = imgSrc;
		}
		
		viewSrc = src1+escape(src2);
		
		var strhtml = "";
		
		var w = 100;
		var h = 100;
		
		var pattern = /\.(swf|asx)$/ig;//È®ÀåÀÚ ÇÃ·¡½Ã ÆÐÅÏ
		var imgPattern = /\.(jpg|gif)$/ig;//ÀÌ¹ÌÁö È®ÀåÀÚ ÆÐÅÏ
	
		//¸¸¾à ÇÃ·¡½Ã ÆÄÀÏ ÀÌ¶ó¸é
		if( pattern.test( imgSrc ) ){
			w = 400;
			h = 400;

			strhtml +="<html><head><title>È®´ëº¸±â</title><style>body{margin:0;}</style>";
			strhtml +="</head><body>";
			strhtml +="<table width='100%' height='100%' cellspacing='0' cellpadding='0'><tr>";
			strhtml +="<td align='center' valign='center'>";
			strhtml +="<embed src='"+viewSrc+"' width='100%'>";
			strhtml +="</td></tr></table></body></html>";
			
		}else if( imgPattern.test( imgSrc ) ){
		
			strhtml +="<html><head><title>ÀÌ¹ÌÁöÈ®´ëº¸±â</title><style>body{margin:0;}</style>";
			strhtml +="<s"+"cript language=\"JavaScript\">";
			strhtml +="function win_resize(){";
			strhtml +="var imgWidth  = parseInt(document.content_img.offsetWidth);";
			strhtml +="var imgHeight = parseInt(document.content_img.offsetHeight);";
			strhtml +="var winWidth  = window.screen.width;";
			strhtml +="var winHeight  = window.screen.height;";
			strhtml +="var reWidth,reHeight;";
			strhtml +="if(imgWidth>winWidth-100){";
			strhtml +="reWidth  = winWidth-100;";
			strhtml +="}else{";
			strhtml +="reWidth = imgWidth+30;";
			strhtml +="}";
			strhtml +="if(imgHeight>winHeight-100){";
			strhtml +="reHeight = winHeight-100;";
			strhtml +="}else{";
			strhtml +="reHeight = imgHeight+35;";
			//strhtml +="if(window.navigator.userAgent.indexOf(\"SV1\") != -1)reHeight+=29;";
			strhtml +="}";
			strhtml +="window.resizeTo(reWidth,reHeight);";
			strhtml +="window.moveTo(parseInt((winWidth-reWidth)/2),parseInt((winHeight-reHeight)/2));";
			strhtml +="window.focus();";
			strhtml +="}";
			strhtml +="</s"+"cript>";
			strhtml +="</head><body onload='win_resize()'>";
			strhtml +="<table width='100%' height='100%' cellspacing='0' cellpadding='0'><tr>";
			strhtml +="<td align='center' valign='center'>";
			strhtml +="<img src='"+viewSrc+"' name='content_img' id='content_img' border=0 onclick='window.close();' style='cursor:hand;'>";
			strhtml +="</td></tr></table></body></html>";
		}else{
			location.href = "/etc/down.aspx?sfname="+viewSrc+"&ofname="+src2;
			return;
		}
		
		var imageWin = window.open('', "imageWin", "width="+ w +", height="+ h +", top=100,left=100,scrollbars=1,resizable=1,toolbar=0,menubar=0,location=0,directories=0,status=0"); 
		imageWin.document.open(); 
		imageWin.document.write(strhtml);
		imageWin.document.close();
		imageWin.focus();
	}




/***********************************************************
ÇÔ¼ö¸í			:newXMLHttpRequest()
Ã³¸®³»¿ë		:¿äÃ»°´Ã¼¸¦ »ý¼ºÈÄ ¹ÝÈ¯
***********************************************************/
// function from http://www-128.ibm.com/developerworks/kr/library/j-ajax1/index.html
function newXMLHttpRequest() {
	var xmlreq = false;
	if (window.XMLHttpRequest) {
		// Create XMLHttpRequest object in non-Microsoft browsers
		xmlreq = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		// Create XMLHttpRequest via MS ActiveX
		try {
			// Try to create XMLHttpRequest in later versions
			// of Internet Explorer
			xmlreq = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e1) {
			// Failed to create required ActiveXObject
			try {
				// Try version supported by older versions
				// of Internet Explorer
				xmlreq = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e2) {
				// Unable to create an XMLHttpRequest with ActiveX
			}
		}
	}
	return xmlreq;
}


	// »ç¿ë¿¹) onkeypress='Numberchk()'
	// ¼ýÀÚ¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ°Ô ÇÑ´Ù.
	function Numberchk(){
		if ((event.keyCode<48)||(event.keyCode>57)){
			alert("¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù.");
			event.returnValue=false;
		}
	}

	/************************************************************
	  ÇÔ¼ö : checkHangul(hangul)
	  ¸ñÀû : ÀÔ·ÂÇÑ °ªÀÌ ÇÑ±ÛÀÎÁö ¾Æ´ÑÁö¸¦ ÆÇµ¶
	  ¹æ¹ý : hangul (ÇÑ±Û)
	          ¿¹) checkEmail("È«±æµ¿")
	        °á°ú) true
	  ¸®ÅÏ : Âü (True) , °ÅÁþ (false)
	************************************************************/
	function checkHangul(hangul)
	{
		for(i=0;i<hangul.length; i++) {
			if((hangul.charAt(i) < '°¡')||(hangul.charAt(i) > 'Èþ'))
				return false;
		}	
		return true;
	}
	
	/************************************************************
	¼³¸í : Ã¼Å© ¹Ú½º, ¶óµð¿À ¹öÆ° ¼±ÅÃ Ã¼Å©
	¿¹)checkRadio(Æû.ÀÌ¸§)
	°á°ú) Ã¼Å© ÇÑ°Ô ÀÖ´Ù¸é true Ã¼Å©ÇÑ°Ô ¾ø´Ù¸é false
	************************************************************/
	function checkRadio(InputName){
		if(InputName){
			if(!InputName.length) {
				if(InputName.checked) {
					return true;
				}
			} else {
				for(i=0;i<InputName.length;i++) {
					if(InputName[i].checked) {
						return true;
					}
				}
			}
		}
		return false;
	}

//³¯Â¥°ª Ã¼Å© ¿¹) 2006-04-05 ÀÌ·± Çü½Ä 
//¸Â´Ù¸é true Æ²¸®¸é false
function checkDateStr(str) 
{
	var pattern = /^[0-9]{4}\-[0-9]{2}\-[0-9]{2}$/;
	if (!pattern.test(str)) return(false);
	else return(true);
}

//¼ýÀÚ Ã¼Å© 
//¼ýÀÚ ¸Â´Ù¸é true Æ²¸®¸é false
function check_isnumber(str) 
{
	var pattern = /^[0-9]+$/;
	return(pattern.test(str));
}


//ÀÌ¹ÌÁö ÀÚµ¿ ¸®»çÀÌÁî Ã³¸®
var arrObjImg = new Array(); //ÀÌ¹ÌÁö°´Ã¼ ´ãÀ» ¹è¿­

function set_onload_resize(img,resizeWidth){
	var imgLen = arrObjImg.length;
	arrObjImg[imgLen] = new imgClass(img, resizeWidth);
	resize_img(imgLen);
}

function imgClass(img,resizeWidth){
	this.img = img;
	this.resizeWidth = resizeWidth;
}

function resize_img(idx){
	var objImg = arrObjImg[idx].img;
	var resizeWidth = arrObjImg[idx].resizeWidth;
	if(objImg){
		if(objImg.complete == false){//ÀÌ¹ÌÁö°¡ ·Îµå µÇÁö ¾Ê¾Ò´Ù¸é
			setTimeout("resize_img("+idx+")",100);
		}else{
			if(objImg.width>resizeWidth){
				objImg.height = parseInt((resizeWidth * objImg.height) / objImg.width);
				objImg.width = resizeWidth;
				objImg.onclick=function(){window.open(objImg.src);}
			}
		}
			
	}
}

/*
javascript·Î ±¸ÇöÇÑ Request
´ë¼Ò¹®ÀÚ ±¸ºÐ¾øÀÌ
ÇØ´ç°ªÀÌ ¾øÀ»¶§ "" °ø¹é ¸®ÅÏ
*/
function Request(valuename){
	var rtnval = "";
	var nowAddress = unescape(location.href);
	var parameters = (nowAddress.slice(nowAddress.indexOf("?")+1,nowAddress.length)).split("&");
    
	for(var i = 0 ; i < parameters.length ; i++){
		var varName = parameters[i].split("=")[0];
		if(varName.toUpperCase() == valuename.toUpperCase())
		{
			rtnval = parameters[i].split("=")[1];
			break;
		}
	}
	return rtnval;
}

//¾²±â document.write 
function dw(str){
	document.write(str); 
}


//ÀÍ½ºÇÃ·Î·¯ ÆÐÄ¡¿¡ µû¸¥ ÇÃ·¡½Ã ½ºÅ©¸³·Î write Ã³¸®
//(ÇÃ·¡½ÃÁÖ¼Ò,³ÐÀÌ,³ôÀÌ,³Ñ°Ü¹ÞÀº°ª,¾ÆÀÌµð,ÀÌ¸§,¹è°æ»ö)
function flashWrite(fSrc,sWidth,sHeight,fVars,fId,fName,fBgcolor){
	
	var strFlash;
	var HTTP = location.protocol;
	
	strFlash ='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="'+HTTP+'//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"';
	strFlash += ' id="'+fId+'" name="'+fName+'"';
	strFlash += ' width="'+sWidth+'" height="'+sHeight+'">';  
	strFlash += '<param name=flashVars value="'+fVars+'">';        
	strFlash += '<param name="movie" value="'+fSrc+'">';
	strFlash += '<param name="wmode" value="transparent">';
	strFlash += '<param name=bgcolor value="'+fBgcolor+'">';   
	strFlash += '<param name="quality" value="high">';
	strFlash += '<param name="menu" value="false">';
	strFlash += '<embed src="'+fSrc+'" quality="high" swLiveConnect=true pluginspage="'+HTTP+'//www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"';
	strFlash += ' id="'+fId+'" name="'+fName+'"';	
	strFlash += ' width="'+sWidth+'" height="'+sHeight+'">';
	strFlash += '</embed></object>';
	
	document.write(strFlash);
}


//-->