//·Î±×ÀÎ ¹Ú½º
var c=false;
// Æ÷Ä¿½º°¡ ÀÎÇ² ¹Ú½º¾È¿¡ ÀÖÀ»¶§ ¹è°æÀÌ¹ÌÁö Áö¿ì±â
function ch (valueid) {
	if(valueid ==  'MemberId'){
		document.FrmLogin.MemberId.style.backgroundImage="";
	} else {
		document.FrmLogin.MemberPwd.style.backgroundImage="";
	}
	c=true;
}

// Æ÷Ä¿½º°¡ ÀÎÇ² ¹Ú½º¸¦ ¹þ¾î³µÀ»¶§ ¹è°æÀÌ¹ÌÁö »ì¸®±â (ÀÔ·Â°ªÀÌ ÀÖÀ¸¸é »ì¸®Áö ¾Ê±â)
function chout (valueid) {
	if(valueid ==  'MemberId') {
		if(!document.FrmLogin.MemberId.value) {
			document.FrmLogin.MemberId.style.backgroundImage="url('/images/2010Login_id.gif')"; // ¾ÆÀÌµð¿¡ ¾²ÀÏ ÀÌ¹ÌÁö°æ·Î
		}
	} else {
		if(!document.FrmLogin.MemberPwd.value) {
			document.FrmLogin.MemberPwd.style.backgroundImage="url('/images/2010Login_pwd.gif')"; //ÆÐ½º¿öµå ¾²ÀÏ ÀÌ¹ÌÁö°æ·Î
		}
	}
	c=true;
}

function check_keycode(e) {
	if (e.type == "keypress") var whichCode = e.keyCode;
	if (whichCode == 13) MLogin();
}

var Alpha = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
var Digit = '1234567890';
  
function MLogin() 
{   
  	var JLoginForm = document.FrmLogin; 
  	if (JLoginForm.MemberId.value.length < 4 || JLoginForm.MemberId.value.length > 10) 
  	{
     		alert("\n¾ÆÀÌµð¸¦ ¡º¿µ¹®/¼ýÀÚ/¹ØÁÙ(_)¡»À» Á¶ÇÕÇØ¼­ 4~10ÀÚ·Î ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
     		JLoginForm.MemberId.focus();
     		JLoginForm.MemberId.select();
     		return false;
  	}
  	if(JLoginForm.MemberPwd.value.length < 4 || JLoginForm.MemberPwd.value.length > 10) 
  	{
     		alert("\nºñ¹Ð¹øÈ£¸¦ ¡º¿µ¹®/¼ýÀÚ/¹ØÁÙ(_)¡»À» Á¶ÇÕÇØ¼­ 4~10ÀÚ·Î ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
     		JLoginForm.MemberPwd.focus();
     		JLoginForm.MemberPwd.select();
     		return false;
  	}
  	if (Fcheck(JLoginForm.MemberId, '¾ÆÀÌµð', Alpha + Digit + "_")) { return false; }   
  	if (Fcheck(JLoginForm.MemberPwd, 'ºñ¹Ð¹øÈ£', Alpha + Digit + "_")) { return false; }
  
  	return true;
}

function Fcheck(target, title, checkstring)
{
   	var i = 0;
   	var t = target.value;

   	for (i=0; i < t.length; i++)
      	{
      		if(checkstring.indexOf(t.substring(i,i+1)) < 0) 
      		{
         		alert(title + "¿¡ Çã¿ëÇÒ ¼ö ¾ø´Â ¹®ÀÚ ' " + t.substring(i,i+1) + " ' °¡ ÀÔ·ÂµÇ¾ú½À´Ï´Ù");
         		target.focus();
         		target.select();
         		return true;
      		} 
      		else 
      		{ 
      			return false;
      		}
   	}
   	return true;
}

function MoveMemberEdit(JMid) 
{
  	if (JMid == '') 
  	{
    		alert('·Î±×ÀÎ µÇÁö ¾Ê¾Ò½À´Ï´Ù.\n\n¸ÕÀú ·Î±×ÀÎÀ» ÇØÁÖ¼¼¿ä.');
    		return false;
  	} 
  	else 
  	{
    		window.location.href = '/member/MemberEdit.asp';
  	}
}

function JLogOut() 
{
  	if(confirm('·Î±×¾Æ¿ô ÇÏ½Ã°Ú½À´Ï±î.?')) 
  	{
    		window.location.href='/Members/Logout.asp'    
  	} 
  	else 
  	{
  	 	return false; 
  	}
}

function JWindowOpen_Scroll(JWinName,JOpenedFile,JWidth,JHeight) {   
	var x = (screen.width/2) - (JWidth/2); 
	var y = (screen.height/2) - (JHeight/2);
	var NewWin = window.open('', JWinName, 'toolbar=no,resizable=no,scrollbars=yes,status=0,width='+JWidth+',height='+JHeight+',left='+x+',top='+y);
	NewWin.location = JOpenedFile;
}

function onchange_HQ_Sup_location() {
	var f = document.frmLocation;
	//alert(f.Sel_HQ_Sup_Link.options[f.Sel_HQ_Sup_Link.selectedIndex].value);
	if (f.Sel_HQ_Sup_Link.options[f.Sel_HQ_Sup_Link.selectedIndex].value == ""){
		return;	
	}
	if (f.Sel_HQ_Sup_Link.options[f.Sel_HQ_Sup_Link.selectedIndex].value == "/korea4-h/support6.asp?HS_Code=jn"){
		var newWin = window.open("http://www.jn4h.kr","__jn4h__","");
	} else {
		window.location.href = f.Sel_HQ_Sup_Link.options[f.Sel_HQ_Sup_Link.selectedIndex].value;
	}
	
}

function onchange_location() {
	var f = document.frmLocation;
	window.location.href = f.Sel_4H_Link.options[f.Sel_4H_Link.selectedIndex].value;
}

function newinfo_openWindow(theURL,winName,features) 
{ //v2.0
  	window.open(theURL,winName,features);
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable) 
{ 
	toolbar_str = toolbar ? 'no' : 'no'; 
	menubar_str = menubar ? 'no' : 'no'; 
	statusbar_str = statusbar ? 'no' : 'no'; 
	scrollbar_str = scrollbar ? 'yes' : 'no'; 
	resizable_str = resizable ? 'no' : 'no'; 
	window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str); 
} 

function getCookie(name) { 
	var Found = false 
	var start, end 
	var i = 0 
 
	while(i <= document.cookie.length) { 
		start = i 
		end = start + name.length 
 
		if(document.cookie.substring(start, end) == name) { 
			Found = true 
			break 
		} 
		i++ 
	} 
 
	if(Found == true) { 
		start = end + 1 
		end = document.cookie.indexOf(";", start) 
		if(end < start) 
			end = document.cookie.length 
		return document.cookie.substring(start, end) 
	} 
	return "" 
} 
 
//function openPopup() { 
//	var noticeCookie=getCookie("2010NewYear_PopUp");  // ÄíÅ°³×ÀÓ ÁöÁ¤
//	if (noticeCookie != "no") 
//                window.open("/2010NewYear_Popup.htm","2010NewYear","width=615,height=650,toolbar=no,menubar=no,status=no,scrollbars=no,resizable=no"); 
//} 

function openPopup() { 
	var noticeCookie=getCookie("2010CloverNet_OrgReg_PopUp");  // ÄíÅ°³×ÀÓ ÁöÁ¤
	if (noticeCookie != "no") 
                window.open("/clover_info_Popup.htm","2010CloverNet_OrgReg","width=450,height=433,toolbar=no,menubar=no,status=no,scrollbars=no,resizable=no"); 
} 

function MM_preloadImages() { //v3.0
	var d=document; 
	if(d.images){ 
		if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; 
		for(i=0; i<a.length; i++)
			if (a[i].indexOf("#")!=0){ 
				d.MM_p[j]=new Image; 
				d.MM_p[j++].src=a[i];
			}
	}
}

function MM_swapImgRestore() { //v3.0
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
	var p,i,x;  
	if(!d) d=document; 
	if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; 
		n=n.substring(0,p);
	}
	if(!(x=d[n])&&d.all) x=d.all[n]; 
	for(i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); 
	return x;
}

function MM_swapImage() { //v3.0
	var i,j=0,x,a=MM_swapImage.arguments; 
	document.MM_sr=new Array; 
	for(i=0;i<(a.length-2);i+=3)
		if ((x=MM_findObj(a[i]))!=null){
			document.MM_sr[j++]=x; 
			if(!x.oSrc) x.oSrc=x.src; 
			x.src=a[i+2];
		}
}

function MM_showHideLayers() { //v3.0
	var i,p,v,obj,args=MM_showHideLayers.arguments;
	for(i=0; i<(args.length-2); i+=3) 
		if ((obj=MM_findObj(args[i]))!=null) { 
			v=args[i+2];
			//if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
			if (obj.style) { 
				obj=obj.style; 
				v=(v=='show')?'block':(v='hide')?'none':v; 
			}
			//obj.visibility=v; 
			obj.display=v; 
		}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}