//function confirmRedirect(msg, goURL)  
//function windowOpen(theURL,winName,features) 
//function openWindow(strURL,strName,intWidth,intHeight) 
//function openWindow1(strURL,strName,intWidth,intHeight) 
//function Svalue(obj,msg) 
//function Tvalue(obj,len,msg) 
//function Ivalue(obj,len,msg) 
//function Ivalue1(obj,len,msg) 
//function Ivalue2(obj,len,msg) 
//function Lvalue(obj,minlen,maxlen,msg) 
//function Fvalue(obj,msg) 
//function NumCheck(obj,len,msg) 
//function FloatCheck(obj,len,cmt) 
//function ValidDigit(obj,min,max,cmt) 
//function Tcheck(obj, oname, astr, lmin, lmax) 
//function Tcheck1(obj,oname,astr,lmin) 
//function isImage(url) 
//function isEmail(str) 
//function checkEmail(strValue) 
//function resizeImage(objImage,maxValue) 
//function resizeImageWidth(objImage,maxValue) 
//function deleteSpace(str)
//function checkPrivateRegnum(strValue1, strValue2) 
//function checkCompanyRegnum(strValue1, strValue2, strValue3) 
//function checkLength(c)
//function keyNext(obj1, obj2, ilen)
//showLayer('LayerCommon1','iframeCommon1','check1Form.jsp?aEvent=event1',388,353,0,0);
//moveLayer('LayerCommon1','iframeCommon1','check1Form.jsp?aEvent=event1',388,353,0,0);
//hideLayer('LayerCommon1','iframeCommon1');
//function setCookie( name, value, expiredays )
//function getCookie(name)

function confirmRe(msg, goURL) { 
  if(confirm(msg) == true) location.href = goURL;
}

function confirmRedirect(msg, goURL) { 
  if(confirm(msg) == true) location.href = goURL;
}

function windowOpen(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function openWindow(strURL,strName,intWidth,intHeight) {
	intX = (screen.width-intWidth)/2;
  intY = (screen.height-intHeight)/2;
	var strOption = "width="+intWidth+",height="+intHeight+",left="+intX+",top="+intY;
	var win = window.open(strURL,strName,strOption);
	win.focus();
}

function openWindow1(strURL,strName,intWidth,intHeight) {
	intX = (screen.width-intWidth)/2;
  intY = (screen.height-intHeight)/2;
	var strOption = "scrollbars=yes,resizable=yes,width="+intWidth+",height="+intHeight+",left="+intX+",top="+intY;
	var win = window.open(strURL,strName,strOption);
	win.focus();
}

function Svalue(obj,msg) {
	if ( obj.selectedIndex != 0 )	return false;
	alert (msg);
	obj.focus();
	return true;
}

function Tvalue(obj,len,msg) {
	if ( obj.value.length >= len )	return false;
	alert (msg + len + '±ÛÀÚ ÀÌ»ó ±âÀÔÇØ ÁÖ¼¼¿ä.' );
	obj.focus();
	return true;
}

function Ivalue(obj,len,msg) {
	if ( obj.value.length >= len )	return false;
	alert (msg);
	obj.focus();
	return true;
}

function Ivalue1(obj,len,msg) {
  var astr;
  astr = deleteSpace(obj.value);
	if ( astr.length >= len ) return false;
	alert (msg);
	obj.focus();
	return true;
}

function Ivalue2(obj,len,msg) {
  var str_value;
  str_value = deleteSpace(obj.value);
	if ( str_value.length >= len ) return false;
	alert (msg);
	return true;
}

function Lvalue(obj,minlen,maxlen,msg) {
	if ( obj.value.length <= maxlen && obj.value.length >= minlen )	return false;
	alert (msg);
	obj.focus();
	return true;
}

function Fvalue(obj,msg) {
	if ( obj.value.length > 0 )	return false;
	alert (msg);
	obj.focus();
	return true;
}

function NumCheck(obj,len,msg) {
	if ( obj.value.length <  len) {
		alert (msg + len + '±ÛÀÚ ÀÌ»ó ±âÀÔÇØ ÁÖ¼¼¿ä.' );
		obj.focus();
		return true;
	}
	if ( isNaN ( obj.value) ) {
		alert (msg + ' ¼ýÀÚ·Î ±âÀÔÇØ ÁÖ¼¼¿ä.' );
		obj.focus();
		return true;
	}
	return false;
}

function FloatCheck(obj,len,cmt) {
	var i;
	var t = obj.value;
	astr = "1234567890."
	if (t.length < len) {
		alert(cmt + '¸¦(À») ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.');
		obj.focus();
		return true;
	}
	if (t.length > 1) {
		for (i=0; i<t.length; i++)
			if(astr.indexOf(t.substring(i,i+1))<0) {
			alert(cmt + '¿¡ Çã¿ëÇÒ ¼ö ¾ø´Â ¹®ÀÚ°¡ ÀÔ·ÂµÇ¾ú½À´Ï´Ù.\n\''+astr+'\'¿¡ ÇØ´çÇÏ´Â ¹®ÀÚ·Î¸¸ ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.');
			obj.focus();
			return true;
			}
	}
	return false;
}                      

function ValidDigit(obj,min,max,cmt) {
	if (obj.value < min || obj.value > max) {
		alert(cmt+' '+max+'¿¡¼­ '+min+'±îÁöÀÇ ¼ýÀÚ ÀÌ¾î¾ß ÇÕ´Ï´Ù'+obj.value);
		obj.focus();
		return true;
	}
	return false;
}                       

function Tcheck(obj, oname, astr, lmin, lmax) {
	var i;
	if (obj.value.length < lmin || obj.value.length > lmax) {
		if (lmin == lmax) alert(oname + '(Àº)´Â ' + lmin + ' Byte ÀÌ¾î¾ß ÇÕ´Ï´Ù');
		else alert(oname + '´Â ' + lmin + ' ~ ' + lmax + ' ÀÚ ÀÌ³»·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù');
		obj.focus();
		return true;
	}
	if (astr.length > 1) {
		for (i=0; i<obj.value.length; i++)
			if(astr.indexOf(obj.value.substring(i,i+1))<0) {
			alert(oname + '¿¡ Çã¿ëÇÒ ¼ö ¾ø´Â ¹®ÀÚ°¡ ÀÔ·ÂµÇ¾ú½À´Ï´Ù.\n\''+astr+'\'¿¡ ÇØ´çÇÏ´Â ¹®ÀÚ·Î¸¸ ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.');
			obj.focus();
			return true;
			}
	}
	return false;
}                      

function Tcheck1(obj,oname,astr,lmin) {
	var i;
	if (obj.value.length < lmin ) {
		alert(oname + '´Â ' + lmin +' ÀÚ ÀÌ»ó ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù');
		obj.focus();
		return true;
	}
	if (astr.length > 1) {
		for (i=0; i<obj.value.length; i++)
			if(astr.indexOf(obj.value.substring(i,i+1))<0) {
			alert(oname + '¿¡ Çã¿ëÇÒ ¼ö ¾ø´Â ¹®ÀÚ°¡ ÀÔ·ÂµÇ¾ú½À´Ï´Ù.\n\''+astr+'\'¿¡ ÇØ´çÇÏ´Â ¹®ÀÚ·Î¸¸ ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.');
			obj.focus();
			return true;
			}
	}
	return false;
}                      

function isImage(url) {
	var ix = url.toLowerCase();
	if ((ix.indexOf('.jpg') != -1) || (ix.indexOf('.jpe') != -1) || (ix.indexOf('.jpeg') != -1) || (ix.indexOf('.gif') != -1)) return true;
	else return false; // can't determine further from filename!
}

function isEmail(str) {
  // regular expression Áö¿ø ¿©ºÎ Á¡°Ë
  var supported = 0;
  if (window.RegExp) {
    var tempStr = 'a';
    var tempReg = new RegExp(tempStr);
    if (tempReg.test(tempStr)) supported = 1;
  }
  if (!supported) 
    return (str.indexOf('.') > 2) && (str.indexOf('@') > 0);
  var r1 = new RegExp('(@.*@)|(\\.\\.)|(@\\.)|(^\\.)');
  var r2 = new RegExp('^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$');
  return (!r1.test(str) && r2.test(str));
}

function checkEmail(strValue) {
	if (strValue.length > 4) {
		var i;
		var strEmail = strValue;
		var strCheck1 = false;
		var strCheck2 = false;

		for(i=0; i<strEmail.length; i++) {
			if ((strEmail.substring(i,i+1) == "~") || (strEmail.substring(i,i+1) == ".") || 
				(strEmail.substring(i,i+1) == "_") || (strEmail.substring(i,i+1) == "-") ||
				((strEmail.substring(i,i+1) >= "0") && (strEmail.substring(i,i+1) <= "9")) ||
				((strEmail.substring(i,i+1) >= "@") && (strEmail.substring(i,i+1) <= "Z")) ||
				((strEmail.substring(i,i+1) >= "a") && (strEmail.substring(i,i+1) <= "z"))) {
					if (strEmail.substring(i,i+1) == ".")
						strCheck1 = true;
					if (strEmail.substring(i,i+1) == "@")
						strCheck2 = true;
			}
				else {
					return false; 
				}  
			}

		if ((strCheck1 == false) || (strCheck2 == false)) {
			return false;  
		} else {
		  return true;
		}

	} else {
		return false;
	}
}

function resizeImage(objImage,maxValue) {
  if (objImage != null && maxValue != null) {
    var imageWidth , imageHeight, tempHeight, tempWidth; 
    imageWidth = objImage.width;
    imageHeight = objImage.height;
    
    if (imageWidth < maxValue && imageHeight < maxValue){
      tempWidth = imageWidth;
      tempHeight = imageHeight;
    }else{
      if (imageWidth > imageHeight){
        tempWidth = maxValue ;
        tempHeight = (imageHeight * tempWidth)/imageWidth;
      }else if(imageWidth < imageHeight){
        tempHeight = maxValue;
        tempWidth = (imageWidth * tempHeight)/imageHeight;
      }else{
        tempWidth = maxValue;
        tempHeight = maxValue;
      }
    }
    objImage.width = tempWidth;
    objImage.height = tempHeight;
  } else {
    return;
  }
}
// ¿¹Á¦ <img name=imgContent2 src="images/ajak_event_13.gif" onload="javascript:resizeImage(document.imgContent2, 100);">

function resizeImageWidth(objImage,maxValue) {
  if (objImage != null && maxValue != null) {
    var imageWidth , imageHeight, tempHeight, tempWidth; 
    imageWidth = objImage.width;
    imageHeight = objImage.height;
    
    if (imageWidth > maxValue){
      tempWidth = maxValue ;
      tempHeight = (imageHeight * tempWidth)/imageWidth;
      objImage.width = tempWidth;
      objImage.height = tempHeight;
    }
  } else {
    return;
  }
}
// ¿¹Á¦ <img name=imgContent2 src="images/ajak_event_13.gif" onload="javascript:resizeImage(document.imgContent2, 100);">

function deleteSpace(str)
{
  var idx, len;
  while(true)
  {
    idx = str.indexOf(" ")
    if (idx == -1) break
    len = str.length
    str = str.substring(0, idx) + str.substring((idx+1),len)
  }

  return str;
}

function checkPrivateRegnum(strValue1, strValue2) {
  if(checkLength(strValue1) != 6) return false;
  if(checkLength(strValue2) != 7) return false;
  strValue = strValue1 + strValue2;
  for(i = 0; i < strValue.length; i++) {
    astr = strValue.substring(i, i + 1);
    if(!((astr >= "0") && (astr <= "9"))) {
      return false; 
      break;
    }
  }
  val = 0;
  for(i = 0; i <= 11; i++)
    val = val + ((i % 8 + 2) * parseInt(strValue.substring(i, i + 1)));
  val = 11 - (val % 11)
  val = val % 10
  if(val != strValue2.substring(6, 7)) {
    return false;
  }
  return true; 
}

function checkCompanyRegnum(strValue1, strValue2, strValue3) {
  if(checkLength(strValue1) != 3) return false;
  if(checkLength(strValue2) != 2) return false;
  if(checkLength(strValue3) != 5) return false;
  strValue = strValue1 + strValue2 + strValue3;
  for(i = 0; i < strValue.length; i++) {
    astr = strValue.substring(i, i + 1);
    if(!((astr >= "0") && (astr <= "9"))) {
      return false; 
      break;
    } 
  }
  sum = 0; 
  getlist = new Array(10); 
  chkvalue = new Array("1","3","7","1","3","7","1","3","5"); 
  for(var i=0; i<10; i++) { 
    getlist[i] = strValue.substring(i, i+1); 
  } 
  for(var i=0; i<9; i++) { 
    sum += getlist[i]*chkvalue[i]; 
  } 
  sum = sum + parseInt((getlist[8]*5)/10); 
  sidliy = sum % 10; 
  sidchk = 0; 
  if(sidliy != 0) { 
    sidchk = 10 - sidliy; 
  } else { 
    sidchk = 0; 
  } 
  if(sidchk != getlist[9]) { 
    return false; 
  } 
  return true; 
}

function checkLength(c) {
  rtn = 0;
  for(i = 0; i < c.length; i++) {
    t = escape(c.charAt(i)) ;
    if(t.length == 1) {
      rtn ++;    
    } else if(t.indexOf("%u") != -1) {
      rtn += 2;
    } else if(t.indexOf("%") != -1) {
      rtn += t.length / 3;
    }
  }
  return rtn;
}

function keyNext(obj1, obj2, ilen) {
  var str = obj1.value.length;
  if(str == ilen) {
    obj2.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 nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length )
	{
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie )
		{
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
				endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
		break;
	}
	return "";
}

////////////////// ·¹ÀÌ¾î°ü¸®¿ë //////////////////
function showLayer(layerName,frameName,goURL,layerWidth,layerHeight,xplus,yplus) {
  document.all[frameName].style.width = layerWidth;
  document.all[frameName].style.height = layerHeight;
  document.frames[frameName].location.href = goURL;
  var xMax = document.body.clientWidth;
  var yMax = document.body.clientHeight;
  var xOffset = (xMax-layerWidth)/2;
  var yOffset = (yMax-layerHeight)/2; 
  var divMenu = document.all[layerName].style;
  divMenu.width = layerWidth;
  divMenu.height = layerHeight;
  divMenu.top = yOffset + yplus;
  divMenu.left = xOffset + xplus;
  divMenu.display = "";
}
//showLayer('LayerCommon1','iframeCommon1','check1Form.jsp?aEvent=event1',388,353,0,0);

function moveLayer(layerName,frameName,goURL,layerWidth,layerHeight,xplus,yplus) {
  document.all[frameName].style.width = layerWidth;
  document.all[frameName].style.height = layerHeight;
  var xMax = document.body.clientWidth;
  var yMax = document.body.clientHeight;
  var xOffset = (xMax-layerWidth)/2;
  var yOffset = (yMax-layerHeight)/2; 
  var divMenu = document.all[layerName].style;
  divMenu.width = layerWidth;
  divMenu.height = layerHeight;
  divMenu.top = yOffset + yplus;
  divMenu.left = xOffset + xplus;
  divMenu.display = "";
}
//moveLayer('LayerCommon1','iframeCommon1','check1Form.jsp?aEvent=event1',388,353,0,0);

function hideLayer(layerName,frameName) {
  var divMenu = document.all[layerName].style;
  divMenu.display = "none";
  divMenu.top = 2500;
  divMenu.left = 2500;
  document.frames[frameName].location.href = "/common/blank.html";
}
//hideLayer('LayerCommon1','iframeCommon1');

document.write("<div id=\"LayerCommon1\" name=\"LayerCommon1\" style=\"display:none; position:absolute; width:500; height:300; left:1500; top:1000; z-index:10\">");
document.write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=#FFFFFF>");
document.write("<tr>");
document.write("<td align=\"center\" bgcolor=#000000>");
document.write("<iframe id=\"iframeCommon1\" name=\"iframeCommon1\" src=\"/common/blank.html\" WIDTH=500 HEIGHT=300 ");
document.write(" frameborder=0 border=0 scrolling=1></iframe></td>");
document.write("</tr>");
document.write("</table>");
document.write("</div>");

////////////////// ·¹ÀÌ¾î°ü¸®¿ë //////////////////




// Flash Activating Script
// 2005-12-05
// inome _at_ nhncorp.com
// Don't Edit Below! Never!

// s: source url
// d: flash id
// w: source width
// h: source height
// t: wmode ("" for none, transparent, opaque ...)
function mf(s,d,w,h,t){
        return "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width="+w+" height="+h+" id="+d+"><param name=wmode value="+t+" /><param name=movie value="+s+" /><param name=quality value=high /><embed src="+s+" quality=high wmode="+t+" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\" width="+w+" height="+h+"></embed></object>";
}

function mf1(s,d,w,h,t){
        return "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width="+w+" height="+h+" id="+d+"><param name=wmode value="+t+" /><param name=movie value="+s+" /><param name=quality value=high /><embed src="+s+" quality=high wmode="+t+" type=\"application/x-shockwave-flash\" pluginspage=\"https://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\" width="+w+" height="+h+"></embed></object>";
}

// write document contents
function dc_write(src){
        document.write(src);
}

// assign code innerHTML
function tg_setcode(target, code){
        target.innerHTML = code;
}
// Flash Activating Script

function check_pwd(obj1, id1, birth1, birth2, rnum1, msg1) {
  var val1 = obj1.value.toUpperCase();
  id1 = id1.toUpperCase();
  birth1 = birth1.toUpperCase();
  birth2 = birth2.toUpperCase();
  rnum1 = rnum1.toUpperCase();
  if (val1.length < 6 || val1.length > 12) {
    alert(msg1 + "Àº(´Â) 6ÀÚ ÀÌ»ó 12ÀÚ ÀÌÇÏ ÀÔ´Ï´Ù.");
    obj1.value = "";			
    obj1.focus();
    return true;
  }
	var checkbit0 = false;				
	// ºñ¹Ð¹øÈ£ ¼ýÀÚ Ã¼Å© ½ÃÀÛ
	for (i = 0 ; i< val1.length; i++) {
		if (val1.charAt(i) < '0' || val1.charAt(i) > '9' ) {				
			checkbit0 = true;				
		}
	}		
  if (checkbit0 == false) {
    alert(msg1 + "Àº(´Â) ¼ýÀÚ·Î¸¸ ±¸¼ºµÉ¼ö ¾ø½À´Ï´Ù.");
    obj1.value = "" ;
    obj1.focus();
    return true;
  }
  // ºñ¹Ð¹øÈ£ ¼ýÀÚ Ã¼Å© ³¡
  if ( id1 != "") {	
  	if ( val1.indexOf(id1) > -1 ) {
  		alert(msg1 + "¿¡ ¾ÆÀÌµð¸¦ »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.");
  		return true;
  	}		
  }
  if ( birth1 != "") {	
  	if ( val1.indexOf(birth1) > -1 ) {
  		alert(msg1 + "¿¡ »ý³â¿ùÀÏÀ» »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.");
  		return true;
  	}		
  }
  if ( birth2 != "") {	
  	if ( val1.indexOf(birth2) > -1 ) {
  		alert(msg1 + "¿¡ »ý³â¿ùÀÏÀ» »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.");
  		return true;
  	}		
  }
  if ( rnum1 != "") {	
  	if ( val1.indexOf(rnum1) > -1 ) {
  		alert(msg1 + "¿¡ ÁÖ¹Îµî·Ï¹øÈ£¸¦ »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.");
  		return true;
  	}		
  }
  // ºñ¹Ð¹øÈ£°¡ ¼ýÀÚ¿Í ¿µ¹®ÀÓÀ» Ã¼Å© ½ÃÀÛ
  for (i = 0; i < val1.length; i++) {
  	if (val1.charAt(i) >= '0' && val1.charAt(i) <= '9')
  		continue;
  	else if (val1.charAt(i) >= 'a' && val1.charAt(i) <= 'z')
  		continue;
  	else if (val1.charAt(i) >= 'A' && val1.charAt(i) <= 'Z')
  		continue;		
  	else {
  		alert(msg1 + "Àº(´Â) ¿µ¹®ÀÚ, ¼ýÀÚ¸¸ »ç¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.");
  		obj1.value = "" ;
  		obj1.focus();
  		return true;
  	}
  }// ºñ¹Ð¹øÈ£°¡ ¼ýÀÚ¿Í ¿µ¹®ÀÓÀ» Ã¼Å© ³¡
  // ºñ¹Ð¹øÈ£°¡ µ¿ÀÏÇÑ ¹®ÀÚ, ¼ýÀÚÀÎÁö È®ÀÎ
  var checkbit1 = 0;
  for (i = 0; i < val1.length-1; i++) {
  	if (val1.charAt(i) == val1.charAt(i+1))
  		checkbit1++;
  }
  if (checkbit1 > 4) {
    alert(msg1 + "Àº(´Â) µ¿ÀÏÇÑ ¹®ÀÚ È¤Àº ¼ýÀÚ·Î ±¸¼ºµÉ¼ö ¾ø½À´Ï´Ù.");
    obj1.value = "" ;
    obj1.focus();
    return true;
  }
  // ºñ¹Ð¹øÈ£°¡ µ¿ÀÏÇÑ ¹®ÀÚ, ¼ýÀÚÀÎÁö È®ÀÎ
  // ºñ¹Ð¹øÈ£°¡ ¿¬¼ÓµÈ ¹®ÀÚ, ¼ýÀÚÀÎÁö È®ÀÎ
  var checkbit1 = 0;
  for (i = 0; i < val1.length-1; i++) {
    var tmp1 = val1.charAt(i).charCodeAt() + 1;
  	if (tmp1 == val1.charAt(i+1).charCodeAt())
  		checkbit1++;
  }
  if (checkbit1 > 3) {
    alert(msg1 + "Àº(´Â)¿¬¼ÓµÈ ¹®ÀÚ È¤Àº ¼ýÀÚ·Î ±¸¼ºµÉ¼ö ¾ø½À´Ï´Ù.");
    obj1.value = "" ;
    obj1.focus();
    return true;
  }
  // ºñ¹Ð¹øÈ£°¡ ¿¬¼ÓµÈ ¹®ÀÚ, ¼ýÀÚÀÎÁö È®ÀÎ
  return false;
}		

