// 팝업창 중앙에 정렬 시키는 함수.
function set_center(width,height,type)
{
	nWidth = width;
	nHeight = height;
	nLeft = (window.screen.width - nWidth ) / 2;
	nTop  = (window.screen.height- nHeight) / 2;
	sF = "";

	if(type=="1") sF += "toolbar=no,location=no,menubar=no,status=no,directories=no,resizable=no,scrollbars=no";
	else sF += "toolbar=no,location=no,menubar=no,status=no,directories=no,resizable=no,scrollbars=yes";

	sF += ",left=" + nLeft;
	sF += ",top=" + nTop;
	sF += ",width=" +  nWidth;
	sF += ",height=" + nHeight;

	return sF;
}

function set_center1(width,height,type)
{
	nWidth = width;
	nHeight = height;
	nLeft = (window.screen.width - nWidth ) / 2;
	nTop  = (window.screen.height- nHeight) / 2;
	sF = "";

	if(type=="1") sF += "toolbar=no,location=no,menubar=no,status=no,directories=no,resizable=yes,scrollbars=no";
	else sF += "toolbar=no,location=no,menubar=no,status=no,directories=no,resizable=yes,scrollbars=yes";

	sF += ",left=" + nLeft;
	sF += ",top=" + nTop;
	sF += ",width=" +  nWidth;
	sF += ",height=" + nHeight;

	return sF;
}

  /// 아이디 체크
  function check_ID(value){
    
    var comp="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";
    var len=value.length;
    for(i=0;i<len;i++) {
      if(comp.indexOf(value.substring(i,i+1))<0) {
        return false;
    	}
    }
  }

  /// 이름체크
  function check_Name(value){
    
    var comp="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    var len=value.length;
    for(i=0;i<len;i++) {
      if(comp.indexOf(value.substring(i,i+1))<0) {
        return false;
    	}
    }
  }

  function check_Tel(value){
    
    var comp="0123456789+-";
    var len=value.length;
    for(i=0;i<len;i++) {
      if(comp.indexOf(value.substring(i,i+1))<0) {
        return false;
    	}
    }
  }


	// 이메일 체크
	function email_chk(value)
	{
		alert(value);

		var t = 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
	}
