//------->°øÅë »çÇ×
function f_spcl_chk(obj, lbl)
{
with(Math) {

   var nLength = obj.value.length;

   for (i = 0; i < nLength; i++)
   {
	    if (((obj.value.charCodeAt(i) >=  0) && (obj.value.charCodeAt(i) <  48)) ||
	        ((obj.value.charCodeAt(i) >  57) && (obj.value.charCodeAt(i) <  65)) ||
            ((obj.value.charCodeAt(i) >  90) && (obj.value.charCodeAt(i) <  97)) ||
            ((obj.value.charCodeAt(i) > 122) && (obj.value.charCodeAt(i) < 128)))
        {
		    alert(lbl + '°ø¹éÀÌ³ª Æ¯¼ö¹®ÀÚ°¡ µé¾î°¥ ¼ö ¾ø½À´Ï´Ù');
    		obj.focus(); 
	    	return true;   
        }
    }
   return false;
 }
}
<!-------------------------------°ø¹éÀº Çã¿ëÇÑ´Ù.--------------------------------------------->
function f_spclbar_chk(obj, lbl)
{
with(Math) {

   var nLength = obj.value.length;

   for (i = 0; i < nLength; i++)
   {
		if (((obj.value.charCodeAt(i) >=  0) && (obj.value.charCodeAt(i) <  32)) ||
			((obj.value.charCodeAt(i) >=  33) && (obj.value.charCodeAt(i) <  40)) ||
			((obj.value.charCodeAt(i) >=  42) && (obj.value.charCodeAt(i) <  48)) ||
	        ((obj.value.charCodeAt(i) >  57) && (obj.value.charCodeAt(i) <  65)) ||
            ((obj.value.charCodeAt(i) >  90) && (obj.value.charCodeAt(i) <  97)) ||
            ((obj.value.charCodeAt(i) > 122) && (obj.value.charCodeAt(i) < 128)))
        {
		    alert(lbl + ' Æ¯¼ö¹®ÀÚ°¡ µé¾î°¥ ¼ö ¾ø½À´Ï´Ù');
    		obj.focus(); 
	    	return true;   
        }
    }
   return false;
 }
}

<!---------------------------------------------------------------------------->
function f_nul_chk(obj,lbl)
	{
		if( obj.value.replace(/^\s+|\s+$/g,"") == '' )
		{
			alert(lbl + ' ÀÔ·Â ÇÏ½Ê½Ã¿À.');
			obj.focus(); 
			return true;   
		}
		return false; 
	}

function f_eng_nul_chk(obj,lbl)
	{
		if( obj.value.replace(/^\s+|\s+$/g,"") == '' )
		{
			alert('Please enter your ' + lbl);
			obj.focus(); 
			return true;   
		}
		return false; 
	}

function f_nul_chk_nofocus(obj,lbl)
	{
		if( obj.value.replace(/^\s+|\s+$/g,"") == '' )
		{
			alert(lbl + ' ÀÔ·Â ÇÏ½Ê½Ã¿À.');
			//obj.focus(); 
			return true;   
		}
		return false; 
	}
<!---------------------------------------------------------------------------->
function f_com_chk(obj,lbl)
	{
		if( obj.value == '' )
		{
			alert(lbl + ' ¼±ÅÃ ÇÏ¼¼¿ä.');
			obj.focus(); 
			return true;   
		}
		return false; 
	}

function f_eng_com_chk(obj,lbl)
	{
		if( obj.value.replace(/^\s+|\s+$/g,"") == '' )
		{
			alert('Please select your ' + lbl);
			obj.focus(); 
			return true;   
		}
		return false; 
	}
<!---------------------------------------------------------------------------->
function f_hid_nul(obj,lbl)
	{
		if( obj.value == '' )
		{
			alert(lbl + ' ¼±ÅÃ ÇÏ½Ê½Ã¿À.');
			return true;   
		}
		return false; 
	}
	
<!---------------------------------------------------------------------------->	
function f_nul_id(obj,lbl)
	{
		if( obj.value == '' )
		{
			alert(lbl + ' Áßº¹È®ÀÎÀ» ÇÏ¼¼¿ä!!.');
			
			return true;   
		}
		return false; 
	}

function f_eng_nul_id(obj,lbl)
	{
		if( obj.value == '' )
		{
			alert('Please check if the' + lbl + 'is duplicated');
			
			return true;   
		}
		return false; 
	}
<!---------------------------------------------------------------------------->
function f_nul_id2(obj,lbl)
	{
		if( obj.value == 'No' )
		{
			alert(lbl + ' Áßº¹È®ÀÎÀ» ÇÏ¼¼¿ä!!.');
			
			return true;   
		}
		return false; 
	}

<!---------------------------------------------------------------------------->
/**
	* Ã¼Å©¹Ú½º ÇÑ°³ÀÌ»ó ¼±ÅÃ ¿©ºÎ È®ÀÎ
	* @param obj Ã½Å©¹Ú½º °´Ã¼
	* @param lbl °æ°í¸Þ¼¼Áö
	*/
function f_chk_chk(obj)
{
	var checkCount = 0;

	if (obj == undefined) 
	{
		alert("Ã¼Å©¹Ú½º °´Ã¼¸¦ Ã£À» ¼ö ¾ø½À´Ï´Ù.");
		return 0;
	}
	
	if (obj.length == undefined) // °°Àº ÀÌ¸§ÀÇ Ã¼Å©¹Ú½º°¡ 1°³ÀÏ °æ¿ì
	{
		if (obj.checked == true)
			checkCount++;
	}
	else	// °°Àº ÀÌ¸§ÀÇ Ã¼Å©¹Ú½º°¡ 2°³ ÀÌ»óÀÏ °æ¿ì
	{
		for (var i=0; i<obj.length; i++)
		{
			if (obj[i].checked == true)
				checkCount++;
		}
	}
	
	return checkCount;
}
<!---------------------------------------------------------------------------->
function f_len_chk(obj, lbl, num)
{
	if( obj.value.length < num)
	{
		alert(lbl + ' '  + num + '¹®ÀÚ ÀÌ»ó ÀÔ·ÂÇÏ½Ê½Ã¿À.');
		obj.focus(); 
		return true;   
	}
	return false; 
}

function f_eng_len_chk(obj, lbl, num)
{
	if( obj.value.length < num)
	{
		alert('Out of rand your ' + lbl + '');
		obj.focus(); 
		return true;   
	}
	return false; 
}
<!---------------------------------------------------------------------------->
// ¼ýÀÚ ¿©ºÎ Ã¼Å©
function f_is_int(obj,lbl)
{
		var nLen = obj.value.length; 
		for( i = 0 ; i < nLen ; i++)
		{
			temp = obj.value.substring(i,i+1);
			if( temp < '0' || temp > '9' )
			{
				
				alert( lbl + ' ¼ýÀÚ¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù.' );
				obj.focus();
				return true;
				
			}     
		}
		return false;
}
<!---------------------------------------------------------------------------->

function f_is_num(obj, lbl)
	{
		var nLen = obj.value.length; 
		for( i = 0 ; i < nLen ; i++)
		{
			temp = obj.value.substring(i,i+1);
			if( temp < '0' || temp > '9' )
			{
				if ( temp != '.' )
				{
					alert( lbl + ' ¼ýÀÚ¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù.' );
					obj.focus();
					return true;
				}
			}     
		}
		return false;
	}
<!---------------------------------------------------------------------------->
//¼ýÀÚÃ¼Å©////////////////////////////////////////////////////
function ChkNum(x){ 
    var x;
    var anum=/(^\d+$)|(^\d+\.\d+$)/ 
    if (anum.test(x)) 
        return true;
    else{ 
        return false;
    } 
}
	
<!---------------------------------------------------------------------------->
// ÁÖ¹Îµî·Ï¹øÈ£ Ã¼Å©
function f_peop_no_chk(s) {
	if( s.charAt(6) == 1 || s.charAt(6) == 2 )
	{
		if( s.charAt(12) == 
			(( 11 - ((s.charAt(0)*2+s.charAt(1)*3+s.charAt(2)*4
						+s.charAt(3)*5+s.charAt(4)*6+s.charAt(5)*7
						+s.charAt(6)*8+s.charAt(7)*9+s.charAt(8)*2
						+s.charAt(9)*3+s.charAt(10)*4+s.charAt(11)*5)
						% 11)))%10)
			return true; 
	} 
	return false; 
}
<!---------------------------------------------------------------------------->
function        chk_vend(obj1, obj2, obj3, lbl)
{
                var strNumb = obj1.value+obj2.value+obj3.value;
        if        (strNumb.length != 10)
        {
                alert(lbl + '°¡ Àß¸øµÇ¾ú½À´Ï´Ù.');
                obj1.focus();
                return true;
        }
        
        sumMod        =        0;
        sumMod        +=        parseInt(strNumb.substring(0,1));
        sumMod        +=        parseInt(strNumb.substring(1,2)) * 3 % 10;
        sumMod        +=        parseInt(strNumb.substring(2,3)) * 7 % 10;

        sumMod        +=        parseInt(strNumb.substring(3,4)) * 1 % 10;
        sumMod        +=        parseInt(strNumb.substring(4,5)) * 3 % 10;
	
	sumMod        +=        parseInt(strNumb.substring(5,6)) * 7 % 10;
        sumMod        +=        parseInt(strNumb.substring(6,7)) * 1 % 10;
        sumMod        +=        parseInt(strNumb.substring(7,8)) * 3 % 10;
        sumMod        +=        Math.floor(parseInt(strNumb.substring(8,9)) * 5 / 10);
        sumMod        +=        parseInt(strNumb.substring(8,9)) * 5 % 10;
        sumMod        +=        parseInt(strNumb.substring(9,10));

        if (sumMod % 10  !=  0)
        {
                alert(lbl + '°¡ Àß¸øµÇ¾ú½À´Ï´Ù.');
                obj1.focus();
                return true;
        }
        return false;
}

<!---------------------------------------------------------------------------->
function f_byte_chk(obj, nByte, lbl)
{
	
	var objVal =  obj.value;

	with(Math) {

		var nLength = objVal.length;

		var nCnt = 0;
		var nHan, nTemp;

		
		// ÇÑ±Û ¹®ÀÚ¼ö °è»ê(¹ö¸²)
		nHan  = nByte / 2;
		nTemp = round(nHan);

		if   (nHan != nTemp)
		nHan = nTemp - 1;

		for (i = 0; i < nLength; i++)
		{

			sTemp = escape(objVal.substring(i, i+1));

			
			if(sTemp.substring(1,2) == "u" )
				nCnt += 2;
			else
				nCnt += 1;
		}

		if  (nCnt > nByte) 
		{
			alert(lbl + ' ÇÑ±Û ' + nHan + ' ÀÚ, ¿µ¹® ' + nByte + ' ÀÚ ÀÌ³»·Î ÀÔ·ÂÇÏ½Ê½Ã¿À. ');
			obj.focus(); 
			return true;   
		} 
		return false;
	}
}


function f_eng_byte_chk(obj, nByte, lbl)
{
	
	var objVal =  obj.value;

	with(Math) {

		var nLength = objVal.length;

		var nCnt = 0;
		var nHan, nTemp;

		
		// ÇÑ±Û ¹®ÀÚ¼ö °è»ê(¹ö¸²)
		nHan  = nByte / 2;
		nTemp = round(nHan);

		if   (nHan != nTemp)
		nHan = nTemp - 1;

		for (i = 0; i < nLength; i++)
		{

			sTemp = escape(objVal.substring(i, i+1));

			
			if(sTemp.substring(1,2) == "u" )
				nCnt += 2;
			else
				nCnt += 1;
		}

		if  (nCnt > nByte) 
		{
			alert('Please enter your ' + lbl + ' within ' + nByte + ' words in English.');
			obj.focus(); 
			return true;   
		} 
		return false;
	}
}
<!---------------------------------------------------------------------------->

function f_content_chk(str)
{
	var copy;
	//str=str.replace(/</g,"&lt;");
	//str=str.replace(/>/g,"&gt;");
	//str=str.replace(/\"/g,"&quot;");
	//str=str.replace("'","&#39;");
	//str=str.replace("$","&#36;");
	//str=str.replace("?","&#63;");
	//str=str.replace("%","&#37;");

	//copy=str;
	return copy;
}
<!---------------------------------------------------------------------------->
function con_byte_chk(obj, nByte, lbl)
{
with(Math) {

   var nLength = obj.value.length;
   var nCnt = 0;
   var nHan, nTemp;

// ÇÑ±Û ¹®ÀÚ¼ö °è»ê(¹ö¸²)
   nHan  = nByte / 2;
   nTemp = round(nHan);

   if   (nHan != nTemp)
        nHan = nTemp - 1;

   for (i = 0; i < nLength; i++)
	{
      sTemp = escape(obj.value.substring(i, i+1));
	   if(sTemp.substring(1,2) == "u" )
	      nCnt += 2;
	   else
	      nCnt += 1;
   }
   if  (nCnt > nByte) {
		alert(lbl + ' ÇÑ±Û ' + nHan + ' ÀÚ, ¿µ¹® ' + nByte + ' ÀÚ ÀÌ³»·Î ÀÔ·ÂÇÏ½Ê½Ã¿À. ');
		//obj.focus(); 
		return true;   
   }    
   return false;
 }
}   
<!---------------------------------------------------------------------------->

function f_is_email(s) 
{
	var sChk = '';
	var nCnt = 0;
	var nLen = s.length; 
	var regDoNot = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; 
    var regMust = /^[a-zA-Z0-9\-\.\_]+\@[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3})$/;
	
	if (s.length < 7)		
	{
		return false;
	}
	else
	{
		for( i = 0 ; i < nLen ; i++)
		{
			temp = s.substring(i,i+1);   			
			if ((temp == '@' && i < 2) || (temp == '.' && i < 4))
			{
				return false;	
			}
			else 
			{
				if ( temp == '@' || temp == '.') sChk = sChk + temp;
			}
		}			
		if( sChk.substring(0,2) == '@.' ) 
		{
			if (!regDoNot.test(s) && regMust.test(s))
				return true;
			else
				return false;
		}
		else
			return false;
	}		
}

<!---------------------------------------------------------------------------->
function f_is_hanch(obj, lbl){
	var valid = "abcdefghijklmnopqrstuvwxyz0123456789" // À¯È¿ÇÑ °ª
	var ok = "yes";
	var temp;
	if( obj.value != '' ){
		for (var i=0; i<obj.value.length; i++) {
			temp = "" + obj.value.substring(i, i+1);
			if (valid.indexOf(temp) == "-1") ok = "no";
			}
			if (ok == "no") {
				alert( lbl + ' ¿µ¼Ò¹®ÀÚ¿Í ¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù ');
				obj.focus();
				return true;
			}
			
			return false;
	}
}

function f_eng_is_hanch(obj, lbl){
	var valid = "abcdefghijklmnopqrstuvwxyz0123456789" // À¯È¿ÇÑ °ª
	var ok = "yes";
	var temp;
	if( obj.value != '' ){
		for (var i=0; i<obj.value.length; i++) {
			temp = "" + obj.value.substring(i, i+1);
			if (valid.indexOf(temp) == "-1") ok = "no";
			}
			if (ok == "no") {
				alert( lbl + ' Please enter only lower case letters and figures ');
				obj.focus();
				return true;
			}
			
			return false;
	}
}

<!---------------------------------------------------------------------------->
<!---------------------------------------------------------------------------->
function f_is_hanch2(obj, lbl){
	var valid = "ABCDEFGHIJKLMNOPQRSTUWXYZ0123456789" // À¯È¿ÇÑ °ª
	var ok = "yes";
	var temp;
	if( obj.value != '' ){
		for (var i=0; i<obj.value.length; i++) {
			temp = "" + obj.value.substring(i, i+1);
			if (valid.indexOf(temp) == "-1") ok = "no";
			}
			if (ok == "no") {
				alert( lbl + ' ¿µ´ë¹®ÀÚ¿Í ¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù ');
				obj.focus();
				return true;
			}
			
			return false;
	}
}

<!---------------------------------------------------------------------------->
function f_is_inval(obj, lbl){
	var invalid = " "; // ºóÄ­À» ¹æÁöÇÏ±â À§ÇØ " " ¾È¿¡ °ø¹éÀ» ³Ö¾ú½À´Ï´Ù. 		
	if(obj.value.indexOf(invalid) > -1){
			alert( lbl + 'ºóÄ­Àº ÀÔ·Â ÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.');
			obj.focus();
			return true;
	}
	
		//return false;
	
}

<!-------------------------------------------------------------------------------->
//ÆÄÀÏ ¾÷·Îµå
function ShowProgress(f)
{
	strAppVersion = navigator.appVersion;
	if (f.files(0).value != "" || f.files(1).value != "") {
		if (strAppVersion.indexOf('MSIE') != -1 && strAppVersion.substr(strAppVersion.indexOf('MSIE')+5,1) > 4) {
			winstyle = "dialogWidth=385px; dialogHeight:150px; center:yes";
			window.showModelessDialog("http://sradmin.silknara.net/Progress/show_progress.asp?nav=ie", null, winstyle);
		}
		else {
			winpos = "left=" + ((window.screen.width-380)/2) + ",top=" + ((window.screen.height-110)/2);
			winstyle="width=380,height=110,status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no,copyhistory=no," + winpos;
			window.open("http://sradmin.silknara.net/Progress/show_progress.asp?nav=ns",null,winstyle);
		}
	}
}

<!-------------------------------------------------------------------------------->
//¸¶¿ì½º Ä¿¼­
function on_mouse(f){
	f.style.cursor='hand'
}

<!-------------------------------------------------------------------------------->
function out_mouse(f){
	f.style.cursor='default'
}

<!-------------------------------------------------------------------------------->
//°ø¹éÃ¼Å©
function jTrim(str) 
{
	var strValue = new String(str)
	return strValue.replace(/(^ +)|( +$)/g,'')
}

<!--------------------------------------------------------->
function cmpnyListToggle(cmd)
	{
		var obj = document.getElementById("PopbrandLayer");

		if(cmd=='VH')
		{
			if(obj.style.visibility=='hidden')
			{
				obj.style.display='block';
				obj.style.visibility='visible';
			}
			else
			{
				obj.style.display='none';
				obj.style.visibility='hidden';
			}
		}

		else if(cmd=='H')
		{
			obj.style.visibility='hidden';
			obj.style.display='none';
		}
	}

<!--------------------------------------------------------->
function fnc_brand(f){
	document.all.PopbrandFrame.src='/shop/iframe/brand_list.asp?big_cate=' + f.big_cate.value;
}

<!-------------------------------------------------------------------------------->
function SetScrollPos_Sample(tagDIV)
{
	var positionTop = 0;
	if (tagDIV != null)
	{
		positionTop = parseInt(tagDIV.scrollTop, 10);
		document.getElementById("SAMPLE_TABLE").style.top = positionTop;
	}
}

<!-------------------------------------------------------------------------------->
function showSelects(bVisible) {
	// only IE actually do something in here
	var selects = [];
	if (document.all)
		selects = document.all.tags("SELECT");
	var l = selects.length;
	for	(var i = 0; i < l; i++)
		selects[i].runtimeStyle.visibility = bVisible ? "" : "hidden";	
}


function isAlNum(ch){return ("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(ch)==-1)?false:true;}


removeTags=function(str,myTags){
	var tags=['!--','!doctype','isindex','script','blockquote','style','input','plaintext','body','colgroup','fieldset','frameset','multicol','noframes','noscript','optgroup','textarea','basefont','acronym','address','caption','comment','listing','marquee','noembed','nolayer','bgsound','applet','button','center','iframe','ilayer','legend','nextid','object','option','select','server','spacer','strike','strong','keygen','blink','embed','label','layer','small','table','tbody','tfoot','thead','title','param','frame','abbr','area','cite','code','font','form','head','html','menu','nobr','ruby','samp','span','base','link','meta','bdo','big','del','dfn','dir','div','ins','kbd','map','pre','sub','sup','var','xmp','img','col','wbr','br','dd','dl','dt','em','h1','h2','h3','h4','h5','h6','li','ol','rb','rp','rt','td','th','tr','tt','ul','hr','a','b','i','p','q','s','u'];

	if(myTags){
		for(var i=0;i<myTags.length;i++){
			for(var j=0;j<tags.length;j++){
				if(myTags[i]==tags[j]){
					tags.splice(j,1);
					break;
				}
			}
		}
	}

	for(var i=0;i<tags.length;i++){
		str=removeTags.remove(str,tags[i]);
	}
	return str.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&#8260;/g,"\/");
};

removeTags.remove=function(str,tag){
	var op,tp,cp,lt,gt,copy;op=0,lt="&lt;",gt="&gt;";
	str=str.replace(/</g,"&lt;");
	str=str.replace(/>/g,"&gt;");
	str=str.replace(/\//g,"&#8260;");
	copy=str;
	str=str.toLowerCase();
	while((op=str.indexOf(lt+tag,op))!=-1){
		tp=str.substring(op+lt.length+tag.length,op+lt.length+tag.length+1)
		if(isAlNum(tp)) {op=op+lt.length+tag.length+1;continue;}
		if((cp=str.indexOf(lt+"&#8260;"+tag+gt,op))==-1){
			tp=str.indexOf(gt,op);
			str=str.substring(0,op)+str.substring(tp+4,str.length);
			copy=copy.substring(0,op)+copy.substring(tp+4,copy.length);
		}else{
			if((tag=="script")||(tag=="style")||(tag=="object")){
				tp=str.indexOf(gt,op);
				str=str.substring(0,op)+str.substring(cp+tag.length+9+6,str.length);
				copy=copy.substring(0,op)+copy.substring(cp+tag.length+9+6,copy.length);
			}else{
				tp=str.indexOf(gt,op);
				str=str.substring(0,op)+
					str.substring(tp+4,cp)+
					str.substring(cp+tag.length+9+6,str.length);
				copy=copy.substring(0,op)+
					copy.substring(tp+4,cp)+
					copy.substring(cp+tag.length+9+6,copy.length);				
			}
		}
	}
	return copy;
};

<!-------------------------------------------------------------------------------->
//ÇÃ·¡½¬ ¹®ÀÚÈ­
function JS_viewObj(objhtml) 
{ 
    document.write(objhtml); 
} 

<!-------------------------------------------------------------------------------->
function CheckStrLen(maxlen,param){
      var temp;
      var msglen;
      msglen = maxlen*2;
      var value= param.value;
      
      l =  param.value.length; 
      tmpstr = "" ;
      
      if (l == 0) {
            value = maxlen*2;
      }else{
            for(k=0;k<l;k++){
                  temp =value.charAt(k);
                  if (escape(temp).length > 4)
                        msglen -= 2;
                  else
                        msglen--;                  
                  if(msglen < 0){
                        alert("ÃÑ ¿µ¹® "+(maxlen*2)+"ÀÚ ÇÑ±Û " + maxlen + "ÀÚ ±îÁö º¸³»½Ç¼ö ÀÖ½À´Ï´Ù.");
                        param.value= tmpstr;
                        break;
                  }else{
                        tmpstr += temp;
                  }
            }
      }
}   

/* * * * * * * * * ** * * * * * * * * *
  SKT visual call general JAVA SCRIPT
* * * * * * * * * * * * * * * * * * * */

// Flash code
  function embed(myWidth,myHight,myFile) {
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+myWidth+'" height="'+myHight+'">');
  document.write('<param name="movie" value="'+myFile+'">');
  document.write('<param name="wmode" value="transparent">');
//document.write('<param name="quality" value="high">');
  document.write('<param name="menu" value="false">');
  document.write('<embed src="'+myFile+'" width="'+myWidth+'" height="'+myHight+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" menu="false"></embed></object>');
}

/*****************************************************************************/




/**
 * Calendar Util Constructor
 * ´Þ·Â Ãâ·Â ¹× ³¯Â¥ ÃßÃâ¿¡ »ç¿ëµÈ´Ù
 */
function CalendarUtil()
{
    this.objName       = null;
    this.calendarLayer = null;

    // ÇöÀç Ä¶¸°´õÀÇ »çÀÌÁî
    // µðÀÚÀÎÀ» º¯°æÇÒ½Ã °°ÀÌ ´Ã·ÁÁÙ°Í!!!!!!!!!!!!
    this.calendarWidth = 177;
    this.calendarHeight = 187;

    // ÇöÀç ÀÌµ¿ÇÏ°í ÀÖ´Â ÀÏ
    this.year  = null;
    this.month = null;
    this.day   = null;

    // Ã³À½ ¼±ÅÃÇÑ ÀÏ
    this.selectYear  = null;
    this.selectMonth = null;
    this.selectDay   = null;

    this.printCalendar        = printCalendar;
    this.printCalendarBase    = printCalendarBase;
    this.getCalendarTemplete  = getCalendarTemplete;
    this.printCalendarContent = printCalendarContent;
    this.goMonth              = goMonth;
    this.setValue             = setValue;
    this.closeCalendar        = closeCalendar;

    // ¿ùº° ¸¶Áö¸· ÀÏ
    this.lastDay     = new Array();
    this.lastDay[1]  = 31;
    this.lastDay[2]  = 29;
    this.lastDay[3]  = 31;
    this.lastDay[4]  = 30;
    this.lastDay[5]  = 31;
    this.lastDay[6]  = 31;
    this.lastDay[7]  = 30;
    this.lastDay[8]  = 31;
    this.lastDay[9]  = 30;
    this.lastDay[10] = 31;
    this.lastDay[11] = 30;
    this.lastDay[12] = 31;
}


/**
 * ´Þ·Â ·¹ÀÌ¾î¸¦ Ãâ·ÂÇÑ´Ù
 */
function printCalendarBase()
{
    if(this.calendarLayer != null) return;

    var tag = document.createElement("DIV");
    var div = document.body.appendChild(tag);

    div.style.position = "absolute";
    div.style.diplay   = "none";
    div.style.zIndex = 9;

    this.calendarLayer = div;
}


/**
 * ´Þ·Â ÅÛÇÃ¸´À» µ¹·ÁÁØ´Ù
 */
function getCalendarTemplete()
{
    var strHTML  = '';
    strHTML += '<TABLE BORDER="0" CELLPADDING="1" CELLSPACING="1"><TR><TD BGCOLOR="#C3C3C3">';
    strHTML += '<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" BGCOLOR="#FFFFFF">';
    strHTML += '<TR>';
    strHTML += '    <TD ALIGN=CENTER></TD>';
    strHTML += '    <TD ALIGN=CENTER><A HREF="JavaScript:calendarUtil.goMonth(-1);" ONFOCUS="this.blur();" STYLE="font-family:µ¸¿ò; font-size:6pt; color:#6B6B6B; text-decoration:none;">¢¸</A></TD>';
    strHTML += '    <TD ALIGN=CENTER COLSPAN="3" HEIGHT="25"><FONT STYLE="font-family:Tahoma; font-size:13pt; color:#000000;">__CALENDAR_YEAR__</FONT><FONT STYLE="font-family:Tahoma; font-size:13pt; color:#AE0000;">__CALENDAR_MONTH__</FONT></TD>';
    strHTML += '    <TD ALIGN=CENTER><A HREF="JavaScript:calendarUtil.goMonth(1);" ONFOCUS="this.blur();" STYLE="font-family:µ¸¿ò; font-size:6pt; color:#6B6B6B; text-decoration:none;">¢º</A></TD>';
    strHTML += '    <TD ALIGN=CENTER></TD>';
    strHTML += '</TR>';
    strHTML += '<TR HEIGHT="20">';

	strHTML += '    <TD ALIGN="CENTER" WIDTH="25" STYLE="font-family:µ¸¿ò; font-size:8pt; color:#AE0000;">ÀÏ</TD>';
	strHTML += '    <TD ALIGN="CENTER" WIDTH="25" STYLE="font-family:µ¸¿ò; font-size:8pt; color:#000000;">¿ù</TD>';
	strHTML += '    <TD ALIGN="CENTER" WIDTH="25" STYLE="font-family:µ¸¿ò; font-size:8pt; color:#000000;">È­</TD>';
	strHTML += '    <TD ALIGN="CENTER" WIDTH="25" STYLE="font-family:µ¸¿ò; font-size:8pt; color:#000000;">¼ö</TD>';
	strHTML += '    <TD ALIGN="CENTER" WIDTH="25" STYLE="font-family:µ¸¿ò; font-size:8pt; color:#000000;">¸ñ</TD>';
	strHTML += '    <TD ALIGN="CENTER" WIDTH="25" STYLE="font-family:µ¸¿ò; font-size:8pt; color:#000000;">±Ý</TD>';
	strHTML += '    <TD ALIGN="CENTER" WIDTH="25" STYLE="font-family:µ¸¿ò; font-size:8pt; color:#000000;">Åä</TD>';

    
	strHTML += '</TR>';
    strHTML += '__CALENDAR_CONTENT__';
    strHTML += '<TR HEIGHT="20"><TD COLSPAN="7" ALIGN="RIGHT"><A HREF="JavaScript:calendarUtil.closeCalendar();" STYLE="font-family:µ¸¿ò; font-size:8pt; color:#BFBFBF; font-weight:bold; text-decoration:none;">Ã¢´Ý±â</A>&nbsp;</TD></TR>';
    strHTML += '</TABLE>';
    strHTML += '</TD></TR></TABLE>';

    return strHTML;
}

function f_chkeck_Chk(obj, ind)
{
	if(typeof(obj.length) != "undefined")
	{
		for(i = 0, k = obj.length; i < k; i++)
		{
			if(ind != i)
			{
				eval("obj[" +  i + "].checked" +  " = 0");
			}
		}
	}
}
/**
 * ´Þ·ÂÀ» Ãâ·ÂÇÑ´Ù
 *
 * @param    objName °ªÀ» »Ñ·ÁÁÙ Object
 */
function printCalendar(obj, eventHandler, bEtc)
{
    if(bEtc == null) bEtc = false;

    //if(obj == null || eventHandler == null) return;
    if(obj == null) return;

    if(this.objName != null)
    {
        alert("ÀÌ¹Ì ¿­·ÁÀÖ´Â ´Þ·ÂÀÌ ÀÖ½À´Ï´Ù");
        return;
    }

    var nowDate = null;

    this.objName = obj;
    this.printCalendarBase(); 

    var posX = document.body.scrollLeft + eventHandler.clientX;
    var posY = document.body.scrollTop + eventHandler.clientY;

    // ±âÅ¸ ¼³Á¤À¸·Î, ¹«Á¶°Ç À§ÂÊÀ¸·Î ³ª¿À°Ô ÇÒ¶§
    if(bEtc)
    {
        posX = document.body.scrollLeft + eventHandler.clientX - this.calendarWidth;
        posY = document.body.scrollTop + eventHandler.clientY - this.calendarHeight;
    }
    else
    {
        //if(posX + this.calendarWidth >= window.document.body.offsetWidth)
        if(eventHandler.clientX + this.calendarWidth >= window.document.body.offsetWidth)
            posX = document.body.scrollLeft + window.document.body.offsetWidth - this.calendarWidth - 10;
        //if(posY + this.calendarHeight >= window.document.body.offsetHeight)
        if(eventHandler.clientY + this.calendarHeight >= window.document.body.offsetHeight)
            posY = document.body.scrollTop + window.document.body.offsetHeight - this.calendarHeight - 10;
    }

    this.calendarLayer.style.left = posX + "px";
    this.calendarLayer.style.top = posY + "px";
    this.calendarLayer.style.filter = "alpha(opacity=80)";

    // Object ¿¡ °ªÀÌ ÀÖÀ» °æ¿ì
    if(this.objName != null && this.objName.value != "")
    {
        var tmpDate  = this.objName.value;

        var strYear  = tmpDate.substr(0, 4);
        var strMonth = tmpDate.substr(4, 2);
        var strDay   = tmpDate.substr(6, 2);

        var nowDate = new Date(strYear, strMonth - 1 , strDay);
    }
    // °ªÀÌ ¾øÀ» °æ¿ì
    else
    {
        var nowDate = new Date();
    }

    //this.year   = nowDate.getYear();
    this.year   = nowDate.getFullYear();
    this.month  = nowDate.getMonth();
    this.day    = nowDate.getDate();

    this.selectYear  = this.year;
    this.selectMonth = this.month;
    this.selectDay   = this.day;

    this.printCalendarContent();
}


/**
 * ´Þ·ÂÀ» ´Ý´Â´Ù
 */
function closeCalendar()
{
    this.calendarLayer.style.display = "none";
    this.objName = null;
}


/**
 * ÇØ´çÇÏ´Â ¿ù·Î ÀÌµ¿ÇÑ´Ù
 *
 * @param    flag ¿ù¿¡ ´õÇØÁú °ª
 */
function goMonth(flag)
{
    var date = new Date(this.year, this.month + flag, 1);
    //this.year = date.getYear();
    this.year = date.getFullYear();
    this.month = date.getMonth();

    this.printCalendarContent();
}


/**
 * °´Ã¼¿¡ °ªÀ» ¼¼ÆÃÇÑ´Ù
 *
 * @param    dayNum ³¯Â¥
 */
function setValue(dayNum)
{
    var strMonth = null;
    var strDay   = null;

    strMonth = (this.month + 1 < 10) ? "0" + (this.month + 1) : (this.month + 1);
    strDay   = (dayNum < 10) ? "0" + dayNum : dayNum;

    this.objName.value = this.year + "" + strMonth + "" + strDay;
    this.calendarLayer.style.display = "none";

    this.objName = null;
}


/**
 * ´Þ·Â ³»¿ëÀ» Ãâ·ÂÇÑ´Ù
 */
function printCalendarContent()
{
    var strHTML     = '';
    var contentHTML = '';
    var firstOfDate = null;
    var firstOfDay  = null;
    var strMonth    = (this.month + 1 < 10) ? "0" + (this.month + 1) : (this.month + 1);
    var numDay      = 1;
    var rowCounter  = 0;

    // Ã¹ÀÏÀÇ ¿äÀÏÀ» ±¸ÇÑ´Ù
    firstOfDate = new Date(this.year, this.month, 1);
    firstOfDay  = firstOfDate.getDay();
    rowCounter = Math.ceil((this.lastDay[this.month + 1] + firstOfDay ) / 7);

    for(i = 0; i < rowCounter; i++)
    {
        contentHTML += '<TR HEIGHT="20">';
        for(j = 0; j < 7; j++)
        {
            // °ø¹éÀÏ
            if((i == 0 && j < firstOfDay) || numDay > this.lastDay[this.month + 1])
            {
                contentHTML += '<TD></TD>'
            }
            // ÈÞÀÏ
            else if(j == 0) 
            {
                if(this.month == this.selectMonth && this.selectDay == numDay) 
                    contentHTML += '<TD ALIGN="CENTER"><A HREF="JavaScript:calendarUtil.setValue(' + numDay + ');" STYLE="font-family:µ¸¿ò; font-size:8pt; color:#FF3306; font-weight:bold; text-decoration:none;">' + numDay + '</A></TD>';
                else 
                    contentHTML += '<TD ALIGN="CENTER"><A HREF="JavaScript:calendarUtil.setValue(' + numDay + ');" STYLE="font-family:µ¸¿ò; font-size:8pt; color:#FF8306; text-decoration:none;">' + numDay + '</A></TD>';
                numDay ++;
            }
            // ÆòÀÏ
            else
            {
                if(this.month == this.selectMonth && this.selectDay == numDay) 
                    contentHTML += '<TD ALIGN="CENTER"><A HREF="JavaScript:calendarUtil.setValue(' + numDay + ');" STYLE="font-family:µ¸¿ò; font-size:8pt; color:#000000; font-weight:bold; text-decoration:none;">' + numDay + '</A></TD>';
                else 
                    contentHTML += '<TD ALIGN="CENTER"><A HREF="JavaScript:calendarUtil.setValue(' + numDay + ');" STYLE="font-family:µ¸¿ò; font-size:8pt; color:#BFBFBF; text-decoration:none;">' + numDay + '</A></TD>';
                numDay ++;
            }
        }
        contentHTML += '</TR>';
    }
    
    strHTML = this.getCalendarTemplete();
    strHTML = strHTML.replace("__CALENDAR_YEAR__", this.year);
    strHTML = strHTML.replace("__CALENDAR_MONTH__", strMonth);
    strHTML = strHTML.replace("__CALENDAR_CONTENT__", contentHTML);
    
    this.calendarLayer.innerHTML = strHTML;
    this.calendarLayer.style.display = "inline";
}


//¿ÀºêÁ§Æ® °ü·Ã ½ºÅ¬¸³´Ï´Ù.
function addMFObject(divid, width, height, sound, speed, smf, id)
{
 var myObjectElement = document.createElement('<object classid="clsid:D711C9FC-B37A-49C3-8229-2F5F3641D6DB" codebase="http://activex.digitalaria.com/MFActiveX.cab#version=4,9,20,4" width="' + width + '" height="' + height + '" id="' + id +'"></object>');

  var myParamElement1 = document.createElement('<param name=movie value="/data/callspaceObject/common/preview.dmf">');
  var myParamElement2 = document.createElement('<param name=sound value="' + sound + '">');  
  var myParamElement3 = document.createElement('<param name=loop value=1>');
  var myParamElement4 = document.createElement('<param name=speed value=' + speed + '>');
  var myParamElement5 = document.createElement('<param name=smf value=' + smf + '>');

  myObjectElement.appendChild(myParamElement1);
  myObjectElement.appendChild(myParamElement2);
  myObjectElement.appendChild(myParamElement3);
  myObjectElement.appendChild(myParamElement4);
  myObjectElement.appendChild(myParamElement5);


  document.getElementById(divid).appendChild(myObjectElement);
}

//
function addSFObject(spaceObject) 
{
 document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="240" height="142" id="client" align="middle">');
 document.write('<param name="allowScriptAccess" value="sameDomain" />');
 document.write('<param name="movie" value="' + spaceObject +'" />');
 document.write('<param name="quality" value="high" />');
 document.write('<param name="bgcolor" value="#ffffff" />');
 document.write('<embed src="/swf/spaceObject/preview.swf" quality="high" bgcolor="#ffffff" width="240" height="142" name="client" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
 document.write('</object>');			
}

function addSFObject2(spaceObject, myWidth, myHight) 
{
 document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+myWidth+'" height="'+myHight+'" id="client" align="middle">');
 document.write('<param name="allowScriptAccess" value="sameDomain" />');
 document.write('<param name="movie" value="' + spaceObject +'" />');
 document.write('<param name="quality" value="high" />');
 document.write('<param name="bgcolor" value="#ffffff" />');
 document.write('<embed src="/swf/spaceObject/preview.swf" quality="high" bgcolor="#ffffff" width="'+myWidth+'" height="'+myHight+'" name="client" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
 document.write('</object>');			
}


function longAfterPopup(code)
{
	var winl = (screen.width - 400)  / 2; 
	var wint = (screen.height - 240) / 2;
 
    win = window.open("/jsp/popup/loginPop.jsp?code=" + code,"loginPop","width=400,height=240, left=" + winl + ", top=" + wint + ",scrollbars=no, resizable=no"); 
    win.focus();
}


function hdembed1(object, objWidth, objHight)
{
	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="100%" height="100%" id="main" align="middle">');	
	document.write('<param name="allowScriptAccess" value="sameDomain" />');	
	document.write('<param name="movie" value="'+ object +'"?memId=test&memName=DDD&Rpath=/flash/&" />');	

	document.write('<param name="quality" value="high" />');	
	document.write('<param name="bgcolor" value="#031b3e" />');	

	document.write('<embed src="/flash/main.swf?memId=test&memName=DDD&Rpath=/flash/&"');	 

	document.write('quality="high" bgcolor="#031b3e" width="' + objWidth + '" height="' + objWidth + '" name="main" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');	
	document.write('</object>');	
	
}

function hdembed(object, TobjWidth, TobjHight, memId, memName)
{
	var objWidth="100%";
	var objHight="100%";
	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="' + objWidth + '" height="' + objWidth + '" id="main" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');

	document.write('<param name="movie" value="'+ object +'?memId='+ memId + '&memName=' + memName + '&Rpath=/flash/&" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="bgcolor" value="#031b3e" />');
	document.write('<embed src="'+ object +'?memId='+ memId + '&memName=' + memName + '&Rpath=/flash/&" quality="high" bgcolor="#031b3e" width="' + objWidth + '" height="' + objWidth + '" name="main" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}
/*****************************************************************************/
//ÇØ´ç select °´Ã¼ Clear
function objClear(objcls)
{
	if (objcls.type == "select-one")
	{
		var lens = objcls.length
		for(var k=0;k<lens;k++)
		{
			objcls.options[0] = null;
		}
	}
	else
	{
		objcls.value = "";
	}
	return;
}

//ÇØ´ç select °´Ã¼ disabled = true
function objDisabled(obj)
{
	obj.disabled = true;
	return;

}

//ÇØ´ç select °´Ã¼ disabled = false
function objEnabled(obj)
{
	obj.disabled = false;
	return;
}

// ajax
function getXMLHttpRequest()
{
	if(window.ActiveXObject)	// IE ÀÏ°æ¿ì
	{
		try
		{
			return new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try
			{
				return new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e1)
			{
				return null;
			}
		}
	}
	else if(window.XMLHttpRequest)	// ±×¹ÛÀÇ ºê¶ó¿ìÀú
	{
		return new XMLHttpRequest();
	}
	else
	{
		return null;
	}
}

var httpRequest = null;

// ajax Àü¼Û ¸ðµâ
// url : Àü¼ÛÇÒ url, params : ÆÄ¶ó¹ÌÅÍ Á¤º¸, callback : ÄÝ¹éÇÔ¼ö¸í, method : GET , POST
function sendRequest(url, params, callback, method)
{
	httpRequest = getXMLHttpRequest();
	var httpMethod = method ? method : 'GET';
	if(httpMethod != 'GET' && httpMethod != 'POST')
	{
		httpMethod = 'GET';
	}
	var httpParams = (params == null || params == "")? null : params;
	var httpUrl = url;
	if(httpMethod == 'GET' && httpParams != null)
	{
		httpUrl = httpUrl + "?" + httpParams;
	}
	httpRequest.open(httpMethod, httpUrl, true);
	httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	httpRequest.onreadystatechange = callback;
	httpRequest.send(httpMethod == 'POST' ? httpParams : null);
}


/****************************************************************************************/
/**
 * ÇÊµå¸¦ Å×½ºÆ® ÇÑ´Ù
 *
 * @param     str   °ª
 * @param     type  Ã¼Å©ÇÒ Å¸ÀÔ
 * @return    true, false
 */
function checkField(str, type)
{
    if(str == null || str == "" || type == null || isNaN(type)) return false;
    
    switch(type)
    {
        /** ÇÑ±Û ÀÌ¸§ */
        case 1 :
            if(!str.match(/^[¤¡-ÆR]{3,5}$/g)) return false;
            break;
        /** ¿µ¹® ÀÌ¸§ */
        case 2 :
            if(!str.match(/^[^a-zA-Z0-9 ]{3,5}$/g)) return false;
            break;
        /** ÇÑÀÚ ÀÌ¸§ */
        case 3 :
            if(!str.match(/^[a-zA-Z ]{3,15}$/g)) return false;
            break;    
        /** »ý³â¿ùÀÏ (YYYYMMDD) */
        case 4 :
            if(!str.match(/^[0-9]{8}$/g)) return false;
            break;
        /** ¿ìÆí¹øÈ£ (XXX-XXX) */
        case 5 :
            if(!str.match(/^[0-9]{3}-[0-9]{3}$/g)) return false;
            break;
        /** ÁÖ¼Ò */
        case 5 :
            if(!str.match(/^[0-9¤¡-ÆR ]{2,}$/g)) return false;
            break;
        /** ÀüÈ­¹øÈ£ (XXX-XXXX-XXXX) */
        case 6 :
            if(!str.match(/^[0-9]{2,3}-[0-9]{3,4}-[0-9]{3,4}$/g)) return false;
            break;
        /** ÈÞ´ëÆù¹øÈ£ (XXX-XXXX-XXXX) */
        case 7 :
            if(!str.match(/^(010|011|016|017|018|019)-[0-9]{3,4}-[0-9]{3,4}$/g)) return false;
            break;
        /** ÆÐ½º¿öµå (4ÀÚ¸®ÀÌ»ó) */
        case 8 :
            if(!str.match(/^.{4}$/g)) return false;
            break;
        /** ÁÖ¹Î¹øÈ£ */
        case 9 :
            if(!str.match(/^[0-9]{6}-[0-9]{7}$/g)) return false;
            break;
        /** ¸ÞÀÏÁÖ¼Ò (aaa@bbb.com) */
        case 10 :
            if(!str.match(/^(\S+)@(\S+)\.(\S+)/g)) return false;
            break;
		/** ÇÑ±Û or ¿µ¹®¸¸ ÀÔ·Â */
        case 11 :
            if(!str.match(/^[a-zA-Z¤¡-ÆR]+$/g)) return false;
            break;
		/** ¿µ¾î ¶Ç´Â ¿µ¾î/¼ýÀÚ Á¶ÇÕ 4~16ÀÚ¸®  */
        case 12 :
            if(str.match(/^[0-9]{1,}$/g))			return false;
			else if(!str.match(/^[a-zA-Z0-9]+$/g))	return false;
			else if(!str.match(/^.{4,16}$/g))		return false;
            break;
        /** Default */
        default :
            return false;
            break;
    }
    return true;
}

/****************************************************************************************/

/**
 * KERI ¾ÆÀÌµð Àû¿ë±ÔÄ¢¿¡ ¸Â´ÂÁö °Ë»çÇÑ´Ù.
 * (3ÀÚ¸® ÀÌ»óÀÇ ¿µ¹®/¼ýÀÚ·Î ±¸¼º)
 */
function checkKeriId(input) {
	var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
	
	if (input.length < 3) {
		alert("¾ÆÀÌµð´Â 3ÀÚ¸® ÀÌ»óÀÇ ¿µ¹®/¼ýÀÚ·Î ±¸¼ºµÇ¾î¾ß ÇÕ´Ï´Ù.");
		return false;
	} else if (isAlphaNumOnly(input) == false) {
		alert("¾ÆÀÌµð´Â ¿µ¹®/¼ýÀÚ¸¸ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.");
		return false;
	} else if (containsAlphabet(input) == false) {
		alert("¾ÆÀÌµð¿¡ ¿µ¹®ÀÚ°¡ Æ÷ÇÔµÇ¾î ÀÖÁö ¾Ê½À´Ï´Ù.");
		return false;
	} else if (containsNumber(input) == false) {
		alert("¾ÆÀÌµð¿¡ ¼ýÀÚ°¡ Æ÷ÇÔµÇ¾î ÀÖÁö ¾Ê½À´Ï´Ù.");
		return false;
	}

	return true;
}

/**
 * KERI ¾ÆÀÌµð Àû¿ë±ÔÄ¢¿¡ ¸Â´ÂÁö °Ë»çÇÑ´Ù.
 * (4~16ÀÚ¸® ¿µ¹®/¼ýÀÚ·Î ±¸¼º
 */
function checkKeriPwd(input) {
	var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
	
	if (input.length < 3) {
		alert("ºñ¹Ð¹øÈ£´Â 3ÀÚ¸® ÀÌ»óÀÇ ¿µ¹®/¼ýÀÚ·Î ±¸¼ºµÇ¾î¾ß ÇÕ´Ï´Ù.");
		return false;
	} else if (isAlphaNumOnly(input) == false) {
		alert("ºñ¹Ð¹øÈ£´Â ¿µ¹®/¼ýÀÚ¸¸ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.");
		return false;
	} else if (containsAlphabet(input) == false) {
		alert("ºñ¹Ð¹øÈ£¿¡ ¿µ¹®ÀÚ°¡ Æ÷ÇÔµÇ¾î ÀÖÁö ¾Ê½À´Ï´Ù.");
		return false;
	} else if (containsNumber(input) == false) {
		alert("ºñ¹Ð¹øÈ£¿¡ ¼ýÀÚ°¡ Æ÷ÇÔµÇ¾î ÀÖÁö ¾Ê½À´Ï´Ù.");
		return false;
	}

	return true;
}

/**
 * ÀÔ·Â°ª¿¡ Æ¯Á¤ ¹®ÀÚ°¡ ÀÔ·ÂµÇ¾îÀÖ´ÂÁö Ã¼Å©
 * Æ¯Á¤ ¹®ÀÚ¸¸ Çã¿ëÇÏ·Á ÇÒ ¶§ »ç¿ë
 * ex) if (!containsChars(form.blood,"ABO")) {
 *		 alert("Ç÷¾×Çü ÇÊµå¿¡´Â A,B,O°¡ Æ÷ÇÔµÇ¾î ÀÖ¾î¾ß ÇÕ´Ï´Ù.");
 *	 }
 */
function containsChars(input,chars) {
	for (var inx = 0; inx < input.length; inx++) {
	   if (chars.indexOf(input.charAt(inx)) > -1)
		   return true;
	}
	return false;
}

/**
 * ÀÔ·ÂµÈ ¹®ÀÚ¿­¿¡ ¾ËÆÄºªÀÌ Æ÷ÇÔµÇ¾î ÀÖ´ÂÁö °Ë»ç
 */
function containsAlphabet(input)
{
	var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
	return containsChars(input, chars);
}

/**
 * ÀÔ·ÂµÈ ¹®ÀÚ¿­¿¡ ¼ýÀÚ°¡ Æ÷ÇÔµÇ¾î ÀÖ´ÂÁö °Ë»ç
 */
function containsNumber(input)
{
	var chars = "0123456789";
	return containsChars(input, chars);
}

/**
 * ÀÔ·Â°ªÀÌ Æ¯Á¤ ¹®ÀÚ(chars)¸¸À¸·Î µÇ¾îÀÖ´ÂÁö Ã¼Å©
 * Æ¯Á¤ ¹®ÀÚ¸¸ Çã¿ëÇÏ·Á ÇÒ ¶§ »ç¿ë
 * ex) if (!containsCharsOnly(form.blood,"ABO")) {
 *		 alert("Ç÷¾×Çü ÇÊµå¿¡´Â A,B,O ¹®ÀÚ¸¸ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.");
 *	 }
 */
function containsCharsOnly(input,chars) {
	for (var inx = 0; inx < input.length; inx++) {
	   if (chars.indexOf(input.charAt(inx)) == -1)
		   return false;
	}
	return true;
}

/**
 * ÀÔ·Â°ªÀÌ ¾ËÆÄºªÀÎÁö Ã¼Å©
 */

function isAlphabetOnly(input) {
	var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
	return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ªÀÌ ¾ËÆÄºª ´ë¹®ÀÚÀÎÁö Ã¼Å©
 */
function isUpperCaseOnly(input) {
	var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ªÀÌ ¾ËÆÄºª ¼Ò¹®ÀÚÀÎÁö Ã¼Å©
 */
function isLowerCaseOnly(input) {
	var chars = "abcdefghijklmnopqrstuvwxyz";
	return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ª¿¡ ¼ýÀÚ¸¸ ÀÖ´ÂÁö Ã¼Å©
 */
function isNumberOnly(input) {
	var chars = "0123456789";
	return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ªÀÌ ¾ËÆÄºª,¼ýÀÚ·Î µÇ¾îÀÖ´ÂÁö Ã¼Å©
 */
function isAlphaNumOnly(input) {
	var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
	return containsCharsOnly(input,chars);
}

function isDateString(input) {
	var re=new RegExp("[1-2][0-9][0-9][0-9]0[0-9]|1[0-2][0-2][0-9]|3[0-1]");
	return re.test(input);
}


//ÄíÅ°°ª Ã¼Å©
function getCookie(eventName) 
{ 
    var flag = document.cookie.indexOf(eventName + '='); 

    if (flag != -1) 
    {  
        flag    += eventName.length + 1;
        end =  document.cookie.indexOf(';', flag);

        if (end == -1) 
            end = document.cookie.length;
        
        return unescape(document.cookie.substring(flag, end));
    } 
}

//´ÙÀ½ Ä¿¼­·Î ÀÌµ¿ÀÌ µÇ°Ô 
function f_is_next(maxLen, obj, nextobj) 
{ 
	
    if(obj.value.length >= maxLen)
	{
		nextobj.focus();
	}
}

//³¯ÀÚ¸¦ Ã¼Å©¸¦ ÇÑ´Ù.
function useFormatDate(oldString, newSeperator)
{
	var rExp = new RegExp("[.|/|\\\\|-]", "gi");
	var newString=oldString.replace(rExp, newSeperator);

	rExp = new RegExp("/+", "gi");
	newString = newString.replace(rExp, newSeperator);

	rExp = new RegExp("\\s", "gi");
	newString = newString.replace(rExp, "");
	return newString;
}
 
function IsDate(strDate) 
{
	var errNum = 0;
	
	strDate = useFormatDate(strDate, '-');

	var arrDate = strDate.split('-');

	if (arrDate.length < 3) 
	{
		alert('Á¤ÇØÁø ³¯Â¥ Çü½ÄÀÌ ¾Æ´Õ´Ï´Ù. ');
		return false;
	} 
	else 
	{

		var y = arrDate[0];
		var m = arrDate[1];
		var d = arrDate[2];

		if (d.length == 1)  d = '0' + d
		if (m.length == 1) m = '0' + m
		if (y.length == 2) 
		{
			if (y > 49) 
			{
				y = '19' + y
			} 
			else 
			{
				y = '20' + y
			} 
		} 

		if (d.length != 2 || m.length != 2 || y.length != 4) 
		{
			return false;
		}

		//check the values
		if (isNaN(d) || d<0 || d.indexOf(',')!=-1 || d.indexOf('.')!=-1 || d.indexOf('-')!=-1)
		{
		errNum = 1;
		}
		if (isNaN(m) || m<0 || m.indexOf(',')!=-1 || m.indexOf('.')!=-1 || m.indexOf('-')!=-1)
		{
			errNum = 1;
		}
		if (isNaN(y) || y<0 || y.indexOf(',')!=-1 || y.indexOf('.')!=-1 || y.indexOf('-')!=-1){
			errNum = 1;
		}
		if (m<1 || m>12){
			errNum = 1;
		}
		if (d<1 || d>31){
			errNum = 1;
		}
		if (y<1900 || y>2079)
		{
			errNum = 1;
		}
		//check months with 30 days
		if (m==4 || m==6 || m==9 || m==11)
		{
			if (d==31)
			{
				errNum=1;
			}
		}
		// february, leap year
		if (m==2)
		{
			// feb
			var feb=parseInt(y/4)
			if (isNaN(feb))
			{
				errNum=1;
			}

			if (d>29)
			{
				errNum=1;
			}
			if (d==29 && ((y/4)!=parseInt(y/4)))
			{
				errNum=1;
			}
		}
		if (errNum != 0)
		{
			return false;
		}
	}
	return true;
}

