
	function FuncString(chkfield){
			var checkOK = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
			var checkStr = chkfield;
			var allValid = true;
			var allNum = "";
			checkStr = checkStr.toUpperCase();
			for (i = 0;  i < checkStr.length;  i++)
			{
			  ch = checkStr.charAt(i);
			  for (j = 0;  j < checkOK.length;  j++)
				if (ch == checkOK.charAt(j))
					break;
			    	if (j == checkOK.length)
			    	{
			      		allValid = false;
			      		break;
			    	}
			}
		if (allValid == false) return false;
		if (allValid == true) return true;
	}

	
	function FuncEmailString(chkfield){
			var checkOK = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ@._-";
			var checkStr = chkfield;
			var allValid = true;
			var allNum = "";
			checkStr = checkStr.toUpperCase();
			for (i = 0;  i < checkStr.length;  i++)
			{
			  ch = checkStr.charAt(i);
			  for (j = 0;  j < checkOK.length;  j++)
				if (ch == checkOK.charAt(j))
					break;
			    	if (j == checkOK.length)
			    	{
			      		allValid = false;
			      		break;
			    	}
			}
		if (allValid == false) return false;
		if (allValid == true) return true;
	}


	
	function FuncEmailChk(p_obj,p_name){
		if(p_obj.value == ""){
			alert(p_name + " ºó¹®ÀÚ È¤Àº °ø¹éÀ» ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.");
			p_obj.focus();
			return false;
		
		}else{
			var str = p_obj.value;
			if (FuncEmailString(str)) {
				for(var i=0;i<str.length;i++){
					if (str.substring(i+1,i+2) =="@"){
						var str_1 = "y";
					}
		
					if (str_1 == "y" && str.substring(i,i+1) =='.'){
						return true;
					}
		
				}
				alert("ÀÌ¸ÞÀÏ Çü½Ä¿¡ ¸ÂÁö ¾Ê½À´Ï´Ù.");
				p_obj.focus();
				return false;
			
			
			}else{
				alert("ÀÌ¸ÞÀÏÀº ÇÑ±ÛÀ» ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.");
				return false;
			}

		}
		
	}


	
	function FuncCheckNumeric(p_obj,p_name){
		if(isNaN(p_obj.value)){
			alert(p_name + " ¼ýÀÚ¸¸ ÀÔ·Â°¡´É ÇÕ´Ï´Ù.");
			p_obj.value ="";
			p_obj.focus();
			return false;
		}
		return true;
	}

	
	function FuncCheckNumeric_1(p_obj,p_name){
		if(isNaN(p_obj.value)){
			alert(p_name + " ¼ýÀÚ¸¸ ÀÔ·Â°¡´É ÇÕ´Ï´Ù.");
			p_obj.value =1;
			p_obj.focus();
			return false;
		}
		return true;
	}
	
	
	function FuncNullchk(p_obj,p_name){
		var p_string = p_obj.value;
		
		var st_num, key_len;
		st_num = p_string.indexOf(" ");
		while (st_num != -1)
		{
			p_string = p_string.replace(" ", "");
			st_num  = p_string.indexOf(" ");
		}
		key_len = p_string.length;
		
		if (key_len < 1){
			alert(p_name + " ºó¹®ÀÚ È¤Àº °ø¹éÀ» ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.");
			p_obj.focus();
			return false;
		}
		return true;
	}
	
	/*
	//ºó¹®ÀÚ¿­ °Ë»ö ---------------------------------------------------
	function FuncNullchk(p_obj,p_name){
		var p_string = p_obj.value;
		if (p_string.length < 1){
			alert(p_name + " ºó¹®ÀÚ È¤Àº °ø¹éÀ» ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.");
			p_obj.focus();
			return false;
		}
		return true;
	}
	*/

	//ÀüÈ­¹øÈ£ Ã¼Å© ---------------------------------------------------
	function FuncTelCheck(p_obj,p_name){
		
			if(!FuncNullchk(eval(p_obj + "1"),p_name)){
				return false;
			}else{
				if(!FuncCheckNumeric(eval(p_obj + "1"),p_name)){
					return false;
				}
		
			}
		
			if(!FuncNullchk(eval(p_obj + "2"),p_name)){
				return false;
			}else{
				if(!FuncCheckNumeric(eval(p_obj + "2"),p_name)){
					return false;
				}
		
			}
		
			if(!FuncNullchk(eval(p_obj + "3"),p_name)){
				return false;
			}else{
				if(!FuncCheckNumeric(eval(p_obj + "3"),p_name)){
					return false;
				}
			}
			return true;
	}


	
	function funcColor(p_obj,p_num){
		if(p_num == "1"){
			p_obj.style.background = "#E1D1BD";
			
		}else{
			p_obj.style.background = "#F0E7DD";
		}
		
	}


	function FuncBigImage(p_mediumcd,p_ca,p_itemcd){
		showModalDialog('/include/popup/ViewImage.asp?mcd='+ p_mediumcd + '&ca=' + p_ca + '&itemcd=' + p_itemcd, window, 'resizable: no; help: no; status: no; scroll: no; ');
	}


	function Check_Num(tocheck) {
		var isnum = true;
		if (tocheck == null || tocheck == "") {
			isnum = false;
			return isnum;
		}
		
		for (var j = 0 ; j < tocheck.length; j++) {
	 		if (tocheck.substring(j, j + 1) != "0" &&
		    tocheck.substring(j, j + 1) != "1" &&
		    tocheck.substring(j, j + 1) != "2" &&
		    tocheck.substring(j, j + 1) != "3" &&
		    tocheck.substring(j, j + 1) != "4" &&
		    tocheck.substring(j, j + 1) != "5" &&
		    tocheck.substring(j, j + 1) != "6" &&
		    tocheck.substring(j, j + 1) != "7" &&
		    tocheck.substring(j, j + 1) != "8" &&
		    tocheck.substring(j, j + 1) != "9") {
				isnum = false;
			}
		}
		return isnum;
	}
	
	
	// ################## Script For Flash & ActiveX #########################
	
	// +++++++++++++  MakeFlashString(source,id,width,height,wmode) ++++++++
	// 
	// source: source url --> ÇÃ·¡½¬ ÆÄÀÏÀÇ °æ·Î
	// id: flash id 
	// width: source width
	// height: source height
	// wmode: wmode --> "none, transparent, opaque"
	// otherparam : Ãß°¡ ÆÄ¶ó¹ÌÅÍ "<param name='myParam' value='myValue' />
	// 
	// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	
	
	// +++++++++++++  MakeObjectString(classid, codebase, name, id, width,height, param) ++++++++
	// 
	// classid: classid --> ÇÃ·¡½¬ ÆÄÀÏÀÇ °æ·Î
	// codebase: cabÆÄÀÏ À§Ä¡ ¹× ¹öÀüÁ¤º¸ 
	// name :
	// id :
	// width: source width
	// height: source height
	// 
	// wmode: wmode --> "none, transparent, opaque"
	// param : Ãß°¡ ÆÄ¶ó¹ÌÅÍ "<param name='myParam' value='myValue' />
	// 
	// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	
	// Example 
	// DocumentWrite(MakeFlashString('image/ml_flash.swf','emb1','330','520','opaque'));
	// SetInnerHTML(document.all.mm, MakeFlashString('image/ml_flash.swf','emb1','330','520','opaque'));
	// @@ÁÖÀÇ »çÇ× 
	//  - »óÈ£ÀÛ¿ë ¾ø´Â ÄÁÅÙÃ÷´Â DocumentWrite, SetInnerHTML µÑ´Ù »ç¿ë °¡´É
	//  - »óÈ£ÀÛ¿ë ÀÖ´Â ÄÁÅÙÃ÷´Â SetInnerHTML¸¸ »ç¿ë °¡´É
	// #######################################################################
	
	
	function MakeFlashString(source,id,width,height,wmode, otherParam)
	{	
		return "<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="+width+" height="+height+" id="+id+"><param name=wmode value="+wmode+" /><param name=movie value="+source+" /><param name=quality value=high />"+otherParam+"<embed src="+source+" quality=high wmode="+wmode+" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\" width="+width+" height="+height+"></embed></object>";
	}
	
	function MakeObjectString(classid, codebase, name, id, width,height, param)
	{
		return "<object classid="+classid+" codebase="+codebase+" name="+name+" width="+width+" height="+height+" id="+id+"><param name=wmode value="+wmode+" />"+param+"</object>";
	}
	
	// innerHTML Type
	function SetInnerHTML(target, code)
	{ 
		target.innerHTML = code; 
	}
	
	// Direct Write Type
	function DocumentWrite(src)
	{
		document.write(src);
	}

	function MakeMovie(src,wth,hth)
	{
		strObj = '  <object id=\'MediaPlayer1\' name=\'MediaPlayer1\' width=' + wth + ' height=' + hth + ' classid=\'CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95\' codebase=\'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,05,0809\' standby=\'Loading Microsoft Windows Media Player components...\' type=\'application/x-oleobject\' VIEWASTEXT> ';
		strObj = strObj + '       <embed name=\'MediaPlayer1\' src=' + src + ' width=' + wth + ' height=' + hth + '></embed>    ';
		strObj = strObj + '       <param name=\'ShowDisplay\' value=\'False\'>   ';
		strObj = strObj + '  	   <param name=\'ShowControls\' value=\'False\'>    ';
		strObj = strObj + '        <param name=\'ShowTracker\' value=\'True\'>   ';
		strObj = strObj + '        <param name=\'FileName\' value=' + src +  '  ';
		strObj = strObj + '        <param name=\'AutoStart\'            value=\'1\'>   ';
		strObj = strObj + '        <param name=\'AutoSize\'             value=\'0\'>   ';
		strObj = strObj + '        <param name=\'AutoResize\'           value=\'0\'>   ';
		strObj = strObj + '        <param name=\'AnimationAtStart\'     value=\'0\'>   ';
		strObj = strObj + '        <param name=\'TransparentAtStart\'   value=\'0\'>   ';
		strObj = strObj + '        <param name=\'AutoRewind\'           value=\'1\'>   ';
		strObj = strObj + '        <param name=\'ShowDisplay\'          value=\'0\'>   ';
		strObj = strObj + '        <param name=\'ClickToPlay\'          value=\'1\'>   ';
		strObj = strObj + '        <param name=\'PlayCount\'            value=\'6\'>   ';
		strObj = strObj + '        <param name=\'EnableContextMenu\'    value=\'0\'>   ';
		strObj = strObj + '        <param name=\'ShowPositionControls\' value=\'0\'>  ';
		strObj = strObj + '        <param name=\'ShowStatusBar\'        value=\'0\'>  </object>  ';

		return strObj
	}

function openjoin(theURL) { //v2.0
 window.open(theURL, 'jus', 'width=450,height=400,left=0,top=0,location=no,toolbar=no,status=no,resizable=no,scrollbars=yes,menubar=no,directories=no'); 
}
