/************************************************************
¼³¸í : Ã¼Å© ¹Ú½º, ¶óµð¿À ¹öÆ° ¼±ÅÃ Ã¼Å©
¿¹)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;
}


/***************************************************************
¼³¸í : Æû°ªÀÇ È®ÀÎÇÏ´Â ½ºÅ©¸³Æ®
¿¹)Tcheck(Æû¹ë·ù, 'Á¦¾à¹®±¸', Á¦¾àÁ¶°Ç, ÃÖ¼Ò´ÜÀ§, ÃÖ´ë´ÜÀ§)
°á°ú) °ªÀÌ Àß¸øµÈ°Ô ÀÖ´Ù¸é false, °ªÀÌ ¿Ã¹Ù¸£´Ù¸é true
****************************************************************/
function Tcheck(target, cmt, astr, lmin, lmax){
		var i;
		var t = target.value;
		if (t.length < lmin || t.length > lmax) {
			if (lmin == lmax) alert(cmt + '´Â ' + lmin + ' ÀÚ ÀÌ¾î¾ß ÇÕ´Ï´Ù');
				 else alert(cmt + '´Â ' + lmin + ' ~ ' + lmax + ' ÀÚ ÀÌ³»·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù');
			target.focus();
			return true;
		}
		if (astr.length > 1) {
			for (i=0; i < t.length; i++){
				if(astr.indexOf(t.substring(i,i+1))<0) {
					alert(cmt + '¿¡ Çã¿ëÇÒ ¼ö ¾ø´Â ¹®ÀÚ°¡ ÀÔ·ÂµÇ¾ú½À´Ï´Ù');
					target.focus();
					return true;
				}
			}
		}
		return false;
	}


	//function LoginCheck(){
	
	//	alert('·Î±×ÀÎÀÌ ÇÊ¿äÇÕ´Ï´Ù.\n·Î±×ÀÎ ÆäÀÌÁö·Î ÀÌµ¿ÇÏ½Ã°Ú½À´Ï±î?');
	//	location.href='/join/login.html?rurl=' + encodeURIComponent(document.location);

	//}

	function LoginGo(){
	
		location.href='http://login.elle.co.kr/ELLE/login.html?rurl=' + encodeURIComponent(document.location);

	}


	
/***************************************************************
¼³¸í : ÀÌ¸ÞÀÏÁÖ¼Ò Ã¼Å©·ÎÁ÷
¿¹)email_chk(ÆûÀÌ¸§.¹ë·ù)
°á°ú) Àß¸øµÈ°á°ú´Â false¸®ÅÏ ¿Ã¹Ù¸¥°ªÀº true¸®ÅÏ
****************************************************************/
//ÀÌ¸ÞÀÏ È®ÀÎÀ» À§ÇÑ º¯¼ö
function email_chk(email){
	var t = email.value;
	var ValidFlag = false;
	var atCount = 0;
	var SpecialFlag;
	var atLoop;
	var atChr;
	var BadFlag;
	var tAry1;
	var UserName;
	var DomainName;

	if ( t.length > 0 && t.indexOf("@") > 0 && t.indexOf(".") > 0 ) {
		atCount = 0;
		SpecialFlag = false;

		for( atLoop=1; atLoop<=t.length; atLoop++ ) {
			atChr = t.substring( atLoop, atLoop+1 );
			if ( atChr == "@" ) atCount = atCount + 1;

			if ( (atChr >= 32) && (atChr <= 44) ) SpecialFlag = true;
			if ( (atChr == 47) || (atChr == 96) || (atChr >= 123) ) SpecialFlag = true;
			if ( (atChr >= 58) && (atChr <= 63) ) SpecialFlag = true;
			if ( (atChr >= 91) && (atChr <= 94) ) SpecialFlag = true;
		}

		if ( ( atCount == 1 ) && (SpecialFlag == false ) ) {
			BadFlag = false;
			tAry1 = t.split("@");
			UserName = tAry1[0];
			DomainName = tAry1[1];
			if ( (UserName.length <= 0 ) || (DomainName.length <= 0 ) ) BadFlag = true;
			if ( DomainName.substring( 1, 2 ) == "." ) BadFlag = true;
			if ( DomainName.substring( DomainName.length-1, DomainName.length) == "." ) BadFlag = true;
			ValidFlag = true;
		}
	}
	if ( BadFlag == true ) ValidFlag = false;
	return ValidFlag;
}

/***************************************************************
¼³¸í : ¼ýÀÚ¸¸ ³Ö¾î¾ß µÈ´Ù
****************************************************************/
function onlyNumber(){
	if((event.keyCode<48)||(event.keyCode>57)) {
		alert("À¯È¿ÇÏÁö ¾Ê´Â ¹®ÀÚÀÔ´Ï´Ù\n¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù");
		event.returnValue=false;
	}
}


/***************************************************************
¼³¸í : ¸ÞÀÎ¿¡¼­ ºÒ·¯¿À´Â ¿¤¸£TV Ã³¸®½ºÅ©¸³Æ®(ÇÃ·¡½¬¿¡¼­ ºÒ·¯¿Â´Ù)
****************************************************************/
function open_pop( url , width , height){
    window.open(url,'popup', 'width='+width+', height='+height+',left=0,top=0,toolbar=no, location=no, directories=no, status=no, menubar=no, resizable=no, scrollbars=no, copyhistory=no');
 }

