﻿    function go_ProductDetail(GDCD, OptionCD, CATE)
    {
      self.location = "/PD/GDInfo.aspx?GDCD=" + GDCD + "&OptionCD=" + OptionCD + "&CATE=" + CATE;
    }

    function go_ProductDetail(GDCD, OptionCD)
    {
      self.location = "/PD/GDInfo.aspx?GDCD=" + GDCD + "&OptionCD=" + OptionCD;
    }

    function go_ProductDetail(GDCD)
    {
      self.location = "/PD/GDInfo.aspx?GDCD=" + GDCD + "&OptionCD=001";
    }
    // 이건 팝업에서 가는거임 팝업닫고 부모창 리디렉션
    function go_ProductDetail2(GDCD, OptionCD)
    {
	  self.close();
      opener.location = "/PD/GDInfo.aspx?GDCD=" + GDCD + "&OptionCD=" + OptionCD;
    }

    function OpenWindow(win,name,opt)
    {
      window.open (win,name,opt);
    }

    function OrderQtyAdd()
    {
      document.all.ctl00_Content_Center__OrderQty.value = Number(document.all.ctl00_Content_Center__OrderQty.value) + 1;
    }

    //상품검색
    function btnMainSearch_OnClick()
    {
	 if(document.all.ctl00_Top_link1__strSearch.value == '' && event.keyCode != 13)
      {
        alert("검색어를 입력하여 주십시오.");
        document.all.ctl00_Top_link1__strSearch.focus();
      }
      else
      {
        location.href = "/pd/gdsearch.aspx?strSearch=" + escape(document.all.ctl00_Top_link1__strSearch.value);
      }
    }
    
    //상품검색
    function btnKeyword_OnClick(m)
    {
	 location.href = "/pd/gdsearch.aspx?strSearch=" + escape(m);
    }

    //상품검색 엔터
//    function _strSearch_KeyPress()
//    {
//      if( event.keyCode == 13 )
//      {
//        if(document.all.ctl00_Top_link1__strSearch.value.length <= 1)
//        {
//          alert("검색어를 입력하여 주시기 바랍니다.");
//          document.all.ctl00_Top_link1__strSearch.focus();
//          return false;
//        }	
//        location.href = "/pd/gdsearch.aspx?strSearch=" + document.all.ctl00_Top_link1__strSearch.value;
//      }
//    }

    //TAB0102
    function showTab(_tab1, _tab2, selectTab)	{ 

      if( selectTab == "01" )
      {
        document.getElementById(_tab1).style.display = "block";
        document.getElementById(_tab2).style.display = "none";        
      }
      else{
	      document.getElementById(_tab1).style.display = "none";
        document.getElementById(_tab2).style.display = "block";
	     }
    } 


    //TAB0102
    function showTab4(_tab1, _tab2, _tab3, _tab4, selectTab)	{ 

      document.getElementById(_tab1).style.display = "none";
      document.getElementById(_tab2).style.display = "none";        
      document.getElementById(_tab3).style.display = "none";        
      document.getElementById(_tab4).style.display = "none";        
        
      switch(selectTab)
      {
        case "01":
          document.getElementById(_tab1).style.display = "block";
          break;
        case "02":
          document.getElementById(_tab2).style.display = "block";
          break;
        case "03":
          document.getElementById(_tab3).style.display = "block";
          break;
        case "04":
          document.getElementById(_tab4).style.display = "block";
          break;
      }
    } 


    //TABs
    function showTabS(_tabS, _ImageS, _UrlS, tabNM)
    { 
	    for( i=0; i<_tabS.length ; i++ )
	    {
		    if( _tabS[i] == tabNM )
		    {
			    document.getElementById(_tabS[i]).style.display = "block";
		    }
		    else
		    {
			    document.getElementById(_tabS[i]).style.display = "none";
			    document.all[_ImageS[i]].src = _UrlS[i];
		    }
	    }
    }

    //상품평
    function showDesc(_tr)	{ 

        if( document.getElementById(_tr).style.display == "none")
          document.getElementById(_tr).style.display = "block";
        else
          document.getElementById(_tr).style.display = "none";
    }    

	// 엔터 이벤트 처리
	function FormEnter()
	{
		if( event.keyCode == 13 && event.srcElement.nodeName != "TEXTAREA" )
		{
			return false;
		}
		return true;
	}
	
	
	function scrollLayer(p_obj_name, p_gap_point) 
    { 
        var start_point, end_point, timer; 

        var obj_layer   = document.getElementById(p_obj_name);  // 레이어 오브젝트

        start_point = parseInt(obj_layer.style.top, 10); 

        if ( start_point < p_gap_point )    start_point = p_gap_point;

        end_point   = document.body.scrollTop + p_gap_point; 
        limit_point = parseInt(window.document.body.scrollHeight) - parseInt(obj_layer.offsetHeight) -10; 

        if ( end_point > limit_point )  end_point = limit_point; 

        if ( start_point != end_point ) 
        { 
            scroll_amount = Math.ceil( Math.abs( end_point - start_point ) / 15 ); 
            obj_layer.style.top = parseInt(start_point, 10) + ( ( end_point < start_point ) ? -scroll_amount : scroll_amount ); 
        } 

        timer = window.setTimeout ("scrollLayer('" + p_obj_name + "', " + p_gap_point + ");", 1); 
    } 

    function setCookies (cookieName, cookieValue, expires, path, domain, secure) { 
        document.cookie = 
        escape(cookieName) + '=' + escape(cookieValue) 
        + (expires ? '; EXPIRES=' + expires.toGMTString() : '') 
        + (path ? '; PATH=' + path : '') 
        + (domain ? '; DOMAIN=' + domain : '') 
        + (secure ? '; SECURE' : ''); 
    } 

    // For Special Order.
    function PopCalendar(controlID)
    {
        var LocationX = (screen.width-268)/2;
        var LocationY = (screen.height-250)/2;
        window.open("../COMM/Pop_Calendar.aspx?AirDate='" + document.all._AirDateShot.value + "'&ControlName='"+controlID+"'","Calendar","width=230,height=225,toolbar=no,resizable=no,top="+LocationY+",scrollbars=no,status=no,left="+LocationX); 
        
    }

    function PopCalendar2(controlID)
    {        
        var LocationX = (screen.width-268)/2;
        var LocationY = (screen.height-250)/2;
        var LocationX2 = LocationX - 268;
        var LocationY2 = LocationY;
        
        var DepartPort = document.getElementById("ctl00_ContentPlaceHolder1__ReceiberGBCD");

//        if(DepartPort.selectedIndex == 0) {
//            alert('출발지역을 먼저 선택해 주세요');
//            DepartPort.selectedIndex = 0;           
//            return;
//        } else {
            if(DepartPort[DepartPort.selectedIndex].value == "12") {
                window.open("../comm/pop_calendar.aspx?Ev=1&AirDate='" + document.all.ctl00_ContentPlaceHolder1__AirportDateShot.value + "'&ControlName='"+controlID+"'","Calendar","width=340,height=350,toolbar=no,resizable=no,top="+LocationY+",scrollbars=no,status=no,left="+LocationX); 
                window.open("../comm/cheongju_guide.html", "cheongju_guide","titlebar=no,width=259,height=270,toolbar=no,resizable=no,top="+LocationY2+",scrollbars=no,status=no,left="+LocationX2,"");
            } else {
                window.open("../comm/pop_calendar.aspx?AirDate='" + document.all.ctl00_ContentPlaceHolder1__AirportDateShot.value + "'&ControlName='"+controlID+"'","Calendar","width=340,height=350,toolbar=no,resizable=no,top="+LocationY+",scrollbars=no,status=no,left="+LocationX); 
            }                
//        }
        
     
    }

    function PopCalendar3(controlID)
    {
        var LocationX = (screen.width-268)/2;
        var LocationY = (screen.height-250)/2;

        window.open("../comm/pop_calendar.aspx?AirDate='" + document.all.ctl00$ContentPlaceHolder1$_AirportDateShot.value + "'&ControlName='"+controlID+"'","Calendar","width=340,height=350,toolbar=no,resizable=no,top="+LocationY+",scrollbars=no,status=no,left="+LocationX); 
     
    }
    
    // For 왼쪽메뉴.
    function _PopCalendar(controlID)
    {
        var LocationX = (screen.width-268)/2;
        var LocationY = (screen.height-250)/2; 
        var LocationX2 = LocationX - 268;
        var LocationY2 = LocationY;
   
        var DepartPort = document.getElementById("ctl00_Left_control1__ReceiberGBCD");
//        if(DepartPort.selectedIndex == 0) {
//            alert('출발지역을 먼저 선택해 주세요');
//            DepartPort.selectedIndex = 0;           
//            return;
//        } else {
            if(DepartPort[DepartPort.selectedIndex].value == "12") {
                window.open("../COMM/Pop_Calendar.aspx?Ev=1&AirDate='" + document.all._AirDateShot.value + "'&ControlName='"+controlID+"'","Calendar","width=340,height=350,toolbar=no,resizable=no,top="+LocationY+",scrollbars=no,status=no,left="+LocationX); 
                window.open("../comm/cheongju_guide.html", "cheongju_guide","titlebar=no,width=259,height=270,toolbar=no,resizable=no,top="+LocationY2+",scrollbars=no,status=no,left="+LocationX2,"");
            } else {
                window.open("../COMM/Pop_Calendar.aspx?AirDate='" + document.all._AirDateShot.value + "'&ControlName='"+controlID+"'","Calendar","width=340,height=350,toolbar=no,resizable=no,top="+LocationY+",scrollbars=no,status=no,left="+LocationX); 
            }                
//        }
        
    }
    
    function chkBuyTime_OnClick(strNowDateTime)
    {
	// debugger
	if( document.all.ctl00$Left_control1$_ReceiberGBCD.value == "" )
      {
        alert("출국 장소를 입력하여 주십시오");
        return false;
      }
      
      if( document.all._AirDateShot.value == "" )
      {
        alert("출국 날짜를 입력하여 주십시오.");
        return false;       
      }
      
      if( document.all.ctl00$Left_control1$_SS.value == "" )
      {
        alert("출국 시간을 입력하여 주십시오");
        return false;
      }
      
      if( document.all.ctl00$Left_control1$_MM.value == "")
      {
        alert("출국 분을 입력하여 주십시오.");
        return false;
        
      }
           
      if(!BuyTimeCheck(document.all.ctl00$Left_control1$_ReceiberGBCD, document.all._AirDateShot.value, document.all.ctl00$Left_control1$_SS.value, document.all.ctl00$Left_control1$_MM.value, document.all._AirDate, true, strNowDateTime))
      {
          return false;
      }
                        
      //return 
    }
    
    function BuyTimeCheck(CheckAirPort, CheckAirDate, CheckAirHours, CheckAirMinutes, CheckAirDate2, IsSuccessMessage, strNowDateTime)
    {
        if(CheckAirDate == null || CheckAirDate == "")
	{
	    alert("주문정보에 문제가 있습니다.로그인을 다시해 주시기 바랍니다.");
            return false;
        }

        if(CheckAirDate == '')
        {
            alert("날짜를 입력하여 주시기 바랍니다.");
            //alert('주문정보에 문제가 있습니다.로그인을 다시해 주시기 바랍니다.');
    
            if(CheckAirDate2 != null || CheckAirDate2 != "")
                CheckAirDate2.focus();
                
            return false;
        }
        
        if(strNowDateTime == null || strNowDateTime == "")
	{
	    alert("주문정보에 문제가 있습니다.로그인을 다시해 주시기 바랍니다.");
            return false;
        }
        
        var strNow = strNowDateTime.split('-');
        
        var nowDate = new Date(Number(strNow[0]), Number(strNow[1]-1), Number(strNow[2]));
        
        nowDate.setHours(Number(strNow[3]));
        nowDate.setMinutes(Number(strNow[4]));
        nowDate.setSeconds(Number(strNow[5]));
        
        //Client Time Compare
        var nowDate2 = new Date();
        //alert(nowDate + "\n" + nowDate2);
        
        //출국시간(입력날짜)(2007-06-08)
        var InputDate = new Date(Number(CheckAirDate.substring(0,4)), Number(CheckAirDate.substring(5,7))-1, Number(CheckAirDate.substring(8,10)) );
        
        /*
        var avar = 0;
        avar = (Number(CheckAirDate.substring(5,7))*1-1);
        InputDate.setFullYear(Number(CheckAirDate.substring(0,4)));
        InputDate.setMonth(avar);
        InputDate.setDate(Number(CheckAirDate.substring(8,10)));
        */
        InputDate.setHours(Number(CheckAirHours));
        InputDate.setMinutes(Number(CheckAirMinutes));
        
        
        
       
        if( nowDate >= InputDate )
        {
            alert("출국날짜가 현재날짜 보다 이전입니다.");
            return false;
        }
        
        //온라인 판매 마감시간
        var OnlineDate = new Date(Number(CheckAirDate.substring(0,4)), Number(CheckAirDate.substring(5,7))-1, Number(CheckAirDate.substring(8,10)) );
        
        var retVal = false;
        
        switch(CheckAirPort.selectedIndex)
        {      
//            case 0:
//                alert("출발지역을 먼저 선택하여 주십시오!");
//                CheckAirPort.focus();
//                return;
//                break;  
                
            case 1://김포
                airport = "김포공항";
                if( InputDate.getHours() > -1 && InputDate.getHours() < 15) //입력날짜 오전 00시 부터 오후 15시 이전 출국(A)
                {
                                
                    OnlineDate.setDate( InputDate.getDate() - 1 ); //전날 오후 18시까지
                    OnlineDate.setHours(19);
                    OnlineDate.setMinutes(0);
                    
                }
                else if( InputDate.getHours() > 14 && InputDate.getHours() < 17) //입력날짜 오후 14시 부터 오후 17시 이전 출국(A)
                {
                    
                    OnlineDate.setDate( InputDate.getDate() ); //당일 오전 10시까지
                    OnlineDate.setHours(10);
                    OnlineDate.setMinutes(0);
                    
                }
                else if( InputDate.getHours() > 16 && InputDate.getHours() < 19 ) //입력날짜 오후 16시 부터 오후 19시 이전 출국(A)
                {
                    
                    OnlineDate.setDate( InputDate.getDate() ); // 당일 오후 12시까지
                    OnlineDate.setHours(12);
                    OnlineDate.setMinutes(0);
                    
                }
                else if( InputDate.getHours() > 18 && InputDate.getHours() < 24 ) //입력날짜 오후 18시 부터 오후 24시 이전 출국(A)
                {
                    
                    OnlineDate.setDate( InputDate.getDate() ); //당일 오후 14시까지
                    OnlineDate.setHours(14);
                    OnlineDate.setMinutes(0);
                    
                }
                
                break;
            case 2://인천        
                airport = "인천공항";
               if( InputDate.getHours() > -1 && InputDate.getHours() < 15) //입력날짜 오전 00시 부터 오후 15시 이전 출국(A)
                {
                    
                    OnlineDate.setDate( InputDate.getDate() - 1 ); //전날 오후 18시까지
                    OnlineDate.setHours(19);
                    OnlineDate.setMinutes(0);
                    
                }
                else if( InputDate.getHours() > 14 && InputDate.getHours() < 17) //입력날짜 오후 14시 부터 오후 17시 이전 출국(A)
                {
                    
                    OnlineDate.setDate( InputDate.getDate() ); //당일 오전 10시까지
                    OnlineDate.setHours(10);
                    OnlineDate.setMinutes(0);
                    
                }
                else if( InputDate.getHours() > 16 && InputDate.getHours() < 19 ) //입력날짜 오후 16시 부터 오후 19시 이전 출국(A)
                {
                    
                    OnlineDate.setDate( InputDate.getDate() ); // 당일 오후 12시까지
                    OnlineDate.setHours(12);
                    OnlineDate.setMinutes(0);
                    
                }
                else if( InputDate.getHours() > 18 && InputDate.getHours() < 24 ) //입력날짜 오후 18시 부터 오후 24시 이전 출국(A)
                {
                    
                    OnlineDate.setDate( InputDate.getDate() ); //당일 오후 14시까지
                    OnlineDate.setHours(14);
                    OnlineDate.setMinutes(0);
                    
                }
                break;
            case 3://김해
                airport = "김해공항";
                
//                if( InputDate.getHours()  < 19 ) //입력날짜 오후 16시 이전 출국(A)
//                {
//                    OnlineDate.setDate( InputDate.getDate() - 3 ); //3일 전날 오후 16시까지
//                    OnlineDate.setHours(19);
//                    OnlineDate.setMinutes(0);
//                    
//                }
//                else{ //16시 이후 출국
//                    
//                    OnlineDate.setDate( InputDate.getDate() - 2 ); //2일 전날 오전 10시까지
//                    OnlineDate.setHours(10);
//                    OnlineDate.setMinutes(0);
//                }

				// 출국일 금일, 1일전 오전 10시까지 주문 가능. 2010.01.12 by Joon.
                OnlineDate.setDate( InputDate.getDate() - 1 );
                OnlineDate.setHours(10);
                OnlineDate.setMinutes(0);
                break;
            case 4://부산국제부두
                airport = "부산국제부두";
//                if( InputDate.getHours()  < 19 ) //입력날짜 오후 16시 이전 출국(A)
//                {
//                    OnlineDate.setDate( InputDate.getDate() - 4 ); //4일 전날 오후 16시까지
//                    OnlineDate.setHours(19);
//                    OnlineDate.setMinutes(0);
//                    
//                }
//                else{ //16시 이후 출국
//                    
//                    OnlineDate.setDate( InputDate.getDate() - 3 ); //3일 전날 오전 10시까지
//                    OnlineDate.setHours(10);
//                    OnlineDate.setMinutes(0);
//                }

				// 출국일 금일, 1일전 오전 10시까지 주문 가능. 2010.01.12 by Joon.
                OnlineDate.setDate( InputDate.getDate() - 2 );
                OnlineDate.setHours(10);
                OnlineDate.setMinutes(0);
                break;
            case 5://청주
                airport = "청주공항";
                
                var isOK = false;
                var arrayPosibleDates = new Array(                    
                    new Date(2009, 7-1, 25),
                    new Date(2009, 7-1, 28),
                    new Date(2009, 7-1, 29),
                    new Date(2009, 7-1, 31),
                    new Date(2009, 8-1, 1),
                    new Date(2009, 8-1, 3),
                    new Date(2009, 8-1, 4),
                    new Date(2009, 8-1, 5),
                    new Date(2009, 8-1, 6),
                    new Date(2009, 8-1, 7),
                    new Date(2009, 8-1, 8),
                    new Date(2009, 8-1, 9),
                    new Date(2009, 8-1, 10), 
                    new Date(2009, 8-1, 12),
                    new Date(2009, 8-1, 13),
                    new Date(2009, 8-1, 15)
                );
                
                var i = 0;                
                for(i=0; i < arrayPosibleDates.length; i++) {
                    //alert(i + ". InputDate: " + InputDate.toDateString() + ", arrayPosibleDates: " + arrayPosibleDates[i].toDateString());
                    if(InputDate.toDateString() == arrayPosibleDates[i].toDateString()) {
                        isOK = true;
                        break;
                    }
                }                
                
                if(!isOK) {
                    alert('청주공항은 전세기편 해당운항날짜만 구매가능합니다.');
                    return false;
                }
                
                if(document.all.ctl00_ContentPlaceHolder1__DestinationCD.selectedIndex != 4) {
                    alert("청주공항의 경우, 도착장소는 '기타' 만 가능합니다.");
                    return false;
                }
                
                if(document.all.ctl00_ContentPlaceHolder1__DepartNM.value.toUpperCase().substring(0,2) != "7C" &&
                    document.all.ctl00_ContentPlaceHolder1__DepartNM.value.toUpperCase().substring(0,2) != "CZ" &&
                    document.all.ctl00_ContentPlaceHolder1__DepartNM.value.toUpperCase().substring(0,2) != "KE") {                    
                    alert("가능한 전세기 편명은 7C, CZ, KE 입니다.");
                    return false;
                }
                
                if( InputDate.getHours()  < 19 ) //입력날짜 오후 16시 이전 출국(A)
                {
                    OnlineDate.setDate( InputDate.getDate() - 3 ); //3일 전날 오후 16시까지
                    OnlineDate.setHours(18);
                    OnlineDate.setMinutes(0);
                    
                }
                else{ //16시 이후 출국
                    
                    OnlineDate.setDate( InputDate.getDate() - 2 ); //2일 전날 오전 10시까지
                    OnlineDate.setHours(10);
                    OnlineDate.setMinutes(0);
                }
                break;
        }
        
        
        retVal = ( nowDate <= OnlineDate )? true : false;
        
        if( retVal )
        {
            if( IsSuccessMessage )
                alert("주문이 가능합니다.\n"+airport+"은 "+(OnlineDate.getMonth()+1) +"월 "+OnlineDate.getDate()+"일 "+OnlineDate.getHours()+"시 까지 주문 가능합니다.");
        }
        else{
            //alert("주문가능시간이 아닙니다.\n고객센터를 참조 해주십시오.");            
            alert("주문가능 시간이 아닙니다.\n"+airport+"은 "+(OnlineDate.getMonth()+1) +"월 "+OnlineDate.getDate()+"일 "+OnlineDate.getHours()+"시 까지 주문 가능합니다.");
            
        }
                
        return retVal;
    }

    function Set_AddComma (Cost) {

 // Cost값이 0보다작으면(음수이면) Cost를 양수로변경하고 minus값도 변경
    if (Cost < 0) { Cost *= -1; var minus = true; }
    else var minus = false;


 // Cost값에서 소숫점위와 아래를 분리하여 dotU/dotD변수에저장
 // Cost가 숫자이기 때문에 문자로 변환하기 위해 (Cost + "") 에서 ""을 붙여줌
 // split함수사용예     
 // AF = abcdefg.split("c")
 // AF[0] =>ab
 // AF[1] =>defg
    var dotPos = (Cost + "").split (".");
 var dotU = dotPos [0];
    var dotD = dotPos [1];

    // dotU(소수점위)를 3으로나누어 그 나머지를 CommaFlag에저장
 // 돈에 콤마를 표시할때 3자리 단위로 표시하기때문에...
    var CommaFlag = dotU.length % 3;

    // 나머지가 있을경우 (예: 12345 또는 12345678 ...)
    if (CommaFlag) {
 // out에 dotU앞자리를 CommaFlag길이만큼 대입
     var out = dotU.substring (0, CommaFlag);
  // dotU의 길이가 3자리 초과이면 out문자끝에 콤마를 추가
     if (dotU.length > 3) out += ",";
    } 
 
 // 나머지가 없을경우(예: 123  또는 123456 ...)
 else var out = "";

    // dotU문자에서 CommaFlag만큼 이동한후 세글자 단위로 콤마를 찍음
    for (var i = CommaFlag; i < dotU.length; i += 3) {
     out += dotU.substring (i, i + 3);
     if (i < dotU.length - 3) out += ",";
    }

    // 음수일경우 out 변수값앞에 "-"를 추가
    if (minus) out = "-" + out;

 // 소숫점이하값이 있으면 out변수값에 소숫점을 추가하여 리턴
    if (dotD) return out + "." + dotD;
    else return out;
   }
   
 function Set_DelComma (Cost) {
    var retValue = "";

 // Cost변수에서 콤마 문자가 있을경우 콤마문자를 제거함
    for (i = 0; i < Cost.length; i++) {

     if (Cost.charAt (Cost.length - i -1) != ",") {
      retValue = Cost.charAt (Cost.length - i -1) + retValue;
     }
    }

    return retValue;
   }


//주민번호 체크
function JuminNoCheck(no1,no2)
{   
    var juminno1 = no1;
    var juminno2 = no2;
    var temp =
        juminno1.substring(0,1)*2 +
        juminno1.substring(1,2)*3 +
        juminno1.substring(2,3)*4 +
        juminno1.substring(3,4)*5 +
        juminno1.substring(4,5)*6 +
        juminno1.substring(5,6)*7 +
        juminno2.substring(0,1)*8 +
        juminno2.substring(1,2)*9 +
        juminno2.substring(2,3)*2 +
        juminno2.substring(3,4)*3 +
        juminno2.substring(4,5)*4 +
        juminno2.substring(5,6)*5;
        
    temp = ((11 - (temp%11))%10);
        
    if(juminno1.length != 6 && juminno2.length != 7)
        return false;    
        
    if( 0 == juminno2.substring(0,1)  || juminno2.substring(0,1) > 4 )
        return false; 
    
    if(temp != juminno2.substring(6,7))
    {        
        return false;
    }
    return true;
}

//이메일 체크
function email_chk(email)
{
//debugger
    var t = email;
    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 GF_checkAll(checkItem, m)
{
var frm = document.aspnetForm;
var el = frm.elements;

for(i=0;i<el.length;i++)
{
  if(el[i].type == 'checkbox' && el[i].name.indexOf(checkItem) != -1)
  {
    el[i].checked = (m.checked)? true : false;
  }
}
}
  
  
function number_format(data) 
{
    
    var tmp = '';
    var number = '';
    var cutlen = 3;
    var comma = ',';
    var i;
   
    len = data.length;
    mod = (len % cutlen);
    k = cutlen - mod;
    for (i=0; i<data.length; i++) 
    {
        number = number + data.charAt(i);
        
        if (i < data.length - 1) 
        {
            k++;
            if ((k % cutlen) == 0) 
            {
                number = number + comma;
                k = 0;
            }
        }
    }

    return number;
}

function myRound(num) {
	if(isNaN(num)) return;

	var tmpNum = String(parseInt(num));
	return tmpNum.substring(0, tmpNum.length - 1) + '0';
}

function MemNonCheck_href(nonYN, id, pHref)	
{
    if(nonYN == 'True')
    {
        alert('회원전용 메뉴입니다.');
    }
    else if(nonYN == 'False')
    {
        document.getElementById(id).href = pHref;
    }
}