﻿//=============================================================================
// JSLibrary.js
// 입력값 체크용 자바 스크립트 및 함수 라이브러리 
//=============================================================================


//=============================================================================
// 함수명: ValidateData                                                        
// 설  명: validateForm에 의해 사용된다
// 작업일:                                                                     
// 작업자:                                                                     
//=============================================================================
function validateData(objValue, strValidateStr, strError) 
{
    var epos = strValidateStr.search("="); 
    var command  = ""; 
    var cmdvalue = ""; 
    
    if(epos >= 0) 
    { 
		command  = strValidateStr.substring(0,epos); 
		cmdvalue = strValidateStr.substr(epos+1); 
    } 
    else 
    { 
		command = strValidateStr;
    } 
    switch(command) 
    { 
		case "req": 
        case "required": 
		{
		   var tp = objValue.value.replace(/\s/g,'');
           if(eval(tp.length) == 0) 
           { 
              alert(strError);
              return false; 
           } 
           break;             
        }
        case "maxlen": 
        case "maxlength": 
        { 
             if(eval(objValue.value.length) >  eval(cmdvalue)) 
             { 
				alert(strError);
				return false; 
             }
             break; 
        }
        case "minlen": 
        case "minlength": 
        { 
             if(eval(objValue.value.length) <  eval(cmdvalue) && eval(objValue.value.length) != eval(0)) 
             { 
				alert(strError);
				return false;                 
             }
             break; 
        }        
        case "eng":
        case "english": 
        { 
              var charpos = objValue.value.search("[^A-Za-z]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
				alert(strError);
				return false; 
              } 
              break; 
        }
        case "engnum": 
        case "engnumeric": 
        { 
              var charpos = objValue.value.search("[^A-Za-z0-9]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                alert(strError);
                return false; 
              }
              break; 
        }
        case "engnumhyphen":
		{
              var charpos = objValue.value.search("[^A-Za-z0-9\-_]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                alert(strError);
                return false; 
              }
              break;
		} 
        case "num": 
        case "numeric": 
        { 
              var charpos = objValue.value.search("[^0-9\]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
				alert(strError);
				return false; 
              } 
              break;               
        }
        case "float": 
        { 
			if(objValue != undefined)
			{				
              var charpos = objValue.value.search("[^0-9\-.]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
				alert(strError);
				return false; 
              } 
            }  
            break;           
                
        }
        case "numhyphen": 
        { 
              var charpos = objValue.value.search("[^0-9\-_]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
				alert(strError);
				return false; 
              } 
              break;               
        }
        
        case "han" :
		case "hangul":
		{
              var charpos = objValue.value.search("[^가-힣]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                alert(strError);
                return false; 
              }
              break;
		}
		case "hannum" :
		case "hangulnumeric":
		{
              var charpos = objValue.value.search("[^ㄱ-ㅎ가-힣0-9]");
              alert(charpos);
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                alert(strError);
                objValue.select();
				objValue.focus();
                return false; 
              } 			
				break;
		}
		case "hanalpha" :
		case "hangulalphabetic":
		{
              var charpos = objValue.value.search("[^ㄱ-ㅎ가-힣A-Za-z]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                alert(strError);
                return false;
              } 			
				break;
		}
		case "hanengnum" :
		case "hangulenglishnumeric":
		{
              var charpos = objValue.value.search("[^ㄱ-ㅎ가-힣A-Za-z0-9]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                alert(strError);
                return false; 
              } 			
				break;
		}
        case "email": 
        { 
               if(!CheckEmail(objValue.value)) 
               { 
                 alert(strError);
                 return false; 
               } 
           break; 
        } 
        case "lt": 
        case "lessthan": 
        { 
            if(isNaN(objValue.value)) 
            { 
              return false; 
            }
            if(eval(objValue.value) >=  eval(cmdvalue)) 
            { 
              alert(strError);
              return false;                 
             }             
            break; 
        } 
        case "gt": 
        case "greaterthan": 
        { 
            if(isNaN(objValue.value)) 
            { 
              return false; 
            }
            if(eval(objValue.value) <=  eval(cmdvalue)) 
            { 
               alert(strError); 
               return false;                 
            }             
            break; 
        }        
        case "regexp": 
        { 
		 	if(objValue.value.length > 0)
			{
	            if(!objValue.value.match(cmdvalue)) 
	            { 
	              alert(strError);
	              return false;                   
	            } 
			}
           break; 
        } 
        case "dontselect": 
        { 
            if(objValue.selectedIndex == null) 
            { 
              return false;
            } 
            if(objValue.selectedIndex == eval(cmdvalue)) 
            { 
              alert(strError);
              return false;                                   
            } 
            break; 
        }
        case "dategreaterthan":
        {
			var startSplit = objValue.value.split("-");
			var endSplit;
			var startDate = new Date(startSplit[0], parseInt(startSplit[1])-1, startSplit[2]);
			var tempDate = new Date();
			var endDate;
			
			if(cmdvalue != "")
			{
				endSplit = document.all[cmdvalue].value.split("-");
				endDate = new Date(endSplit[0], parseInt(endSplit[1])-1, endSplit[2]);
			}
			else
			{
				endDate = new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate());
			}
			
			if(startDate <= endDate)
			{
				alert(strError);
				return false;
			}
			break;
        }
    }

    return true; 
}



//=============================================================================
// 함수명: validateForm
// 설  명: 컨트롤의 유효성을 검사 validateData()를 호출하여 검사한다.
// 작업일: 
// 작업자: 
//=============================================================================
function validateForm(arrObjDesc) 
{ 

	for(var i=0; i < arrObjDesc.length; i++) 
	{
		for(var j=0; j < arrObjDesc[i].length ;j++) 
		{
			var objForm = document.all[arrObjDesc[i][j][0]];
			
			if(validateData(objForm, arrObjDesc[i][j][1], arrObjDesc[i][j][2]) == false) 
			{
				objForm.focus();
				event.returnValue = false;
				return false;				 
			}
		} 
	}
	return true;
}

//=============================================================================
// 함수명: Popup 
// 설  명: PopUp 창 호출
// 작업일: 
// 작업자: 
//=============================================================================

function PopUp(intStyle, intWidth, intHeight, strUrl) {
   var intLeft = 0, intTop = 0;
   var winstyle;            

   //중앙정렬 (스크롤바 무, 상태표시줄 무)
   if (intStyle == 0) {      
      intLeft = screen.width/2-intWidth/2;
      intTop = screen.height/2-intHeight/2;
      
      return window.open(strUrl, null, 'menubar =0,resizable=0,scrollbars=0,status=no,titlebar=0,toolbar=no,width='+intWidth+',height='+intHeight+',left='+intLeft+',top='+intTop);      
   }    
   //showModelessDialog
   else if (intStyle == 1) {
      winstyle = "dialogWidth=" + intWidth + "px; dialogHeight=" + intHeight + "px; center:yes; status=no; help:no; ";      
      return window.showModelessDialog(strUrl, window, winstyle); 
   }
   //showModalDialog
   else if (intStyle == 2) {
      winstyle = "dialogWidth=" + intWidth + "px; dialogHeight=" + intHeight + "px; center:yes; status=no; help:no; ";      
      return window.showModalDialog(strUrl, window, winstyle); 
   }
   //excel
   else if (intStyle == 3) {      
      intLeft = screen.width/2-intWidth/2;
      intTop = screen.height/2-intHeight/2;
      
      return window.open(strUrl, null, 'menubar =1,resizable=1,scrollbars=0,status=no,titlebar=0,toolbar=no,width='+intWidth+',height='+intHeight+',left='+intLeft+',top='+intTop);      
   }
   //중앙정렬 (스크롤바 유, 상태표시줄 무)
   else if (intStyle == 4) {      
      intLeft = screen.width/2-intWidth/2;
      intTop = screen.height/2-intHeight/2;
      
      return window.open(strUrl, null, 'menubar =0,resizable=0,scrollbars=1,status=no,titlebar=0,toolbar=no,width='+intWidth+',height='+intHeight+',left='+intLeft+',top='+intTop);      
   }
   //좌측상단정렬 (스크롤바 무, 상태표시줄 무)
   else if (intStyle == 5) {      
      
      return window.open(strUrl, null, 'menubar =0,resizable=0,scrollbars=0,status=no,titlebar=0,toolbar=no,width='+intWidth+',height='+intHeight+',left='+intLeft+',top='+intTop);      
   }   
   //테스트용 (스크롤바 유, 상태표시줄 유)   
   else if (intStyle == 99) {      
      intLeft = screen.width/2-intWidth/2;
      intTop = screen.height/2-intHeight/2;
      
      return window.open(strUrl, null, 'menubar =0,resizable=0,scrollbars=1,status=yes,titlebar=0,toolbar=no,width='+intWidth+',height='+intHeight+',left='+intLeft+',top='+intTop);      
   }      
   
}  


//=============================================================================
// 함수명: EnterProcOnKeyDown
// 설  명: Enter Key Event를 Tab Key Event로 전환
// 작업일: 
// 작업자: 
//=============================================================================
function EnterProcOnKeyDown() { 
   if (event.keyCode == 13) {
      event.keyCode = 9;
   } 
}


//=============================================================================
// 함수명: MM_preloadImages
// 설  명: Mouse Over에 의한 이미지 전환
// 작업일: 
// 작업자: 
//=============================================================================
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];}}
}


//=============================================================================
// 함수명: MM_swapImgRestore
// 설  명: Mouse Over에 의한 이미지 전환
// 작업일: 
// 작업자: 
//=============================================================================
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;
}


//=============================================================================
// 함수명: MM_findObj
// 설  명: Mouse Over에 의한 이미지 전환
// 작업일: 
// 작업자: 
//=============================================================================
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;
}


//=============================================================================
// 함수명: MM_swapImage
// 설  명: Mouse Over에 의한 이미지 전환
// 작업일: 
// 작업자: 
//=============================================================================
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];}
}


//=============================================================================
// 함수명: CheckSumIdnNo
// 설  명: 주민번호 CheckSum 확인
// 작업일: 
// 작업자: 
//=============================================================================
function CheckSumIdnNo(pStrIdnNo){
	var tmp = 0 
	var pStrIdnNo1 = pStrIdnNo.substring(0,6);
	var pStrIdnNo2 = pStrIdnNo.substring(6,13);
	
	if (pStrIdnNo2.substring(0, 1) == 5 || pStrIdnNo2.substring(0, 1) == 6)
	{
		return true;  
	}
	else
	{
		for (i = 0; i <=5 ; i++) { 
			tmp = tmp + ((i%8+2) * parseInt(pStrIdnNo1.substring(i,i+1))) 
		}     
		
		for (i = 6; i <=11 ; i++) { 
			tmp = tmp + ((i%8+2) * parseInt(pStrIdnNo2.substring(i-6,i-5))) 
		}     
		
		tmp = 11 - (tmp %11) 
		tmp = tmp % 10 	
		
		if (tmp != pStrIdnNo2.substring(6,7)) { 
			return false;  
		}else{
			return true;  
		}
	}	
}


//=============================================================================
// 함수명: CheckIdnNo
// 설  명: 주민번호 확인
// 작업일: 
// 작업자: 
//=============================================================================
function CheckIdnNo(pStrIdnNoObj1, pStrIdnNoObj2, pStrIdnNo1, pStrIdnNo2) {

	var arrFormValidationIdnNo =
	[
		[
			[pStrIdnNoObj1, "req", "주민등록번호 앞자리를 입력하세요."],
			[pStrIdnNoObj1, "num", "주민등록번호 앞자리를 확인하세요."],
			[pStrIdnNoObj1, "maxlen=6", "주민등록번호 앞자리는 6자리 입니다."],
			[pStrIdnNoObj1, "minlen=6", "주민등록번호 앞자리는 6자리 입니다."],
			[pStrIdnNoObj2, "req", "주민등록번호 뒷자리를 입력하세요."],
			[pStrIdnNoObj2, "num", "주민등록번호 뒷자리를 확인하세요."],										
			[pStrIdnNoObj2, "maxlen=7", "주민등록번호 뒷자리는 7자리 입니다."],
			[pStrIdnNoObj2, "minlen=7", "주민등록번호 뒷자리는 7자리 입니다."]

		]
	];
	
	if (validateForm(arrFormValidationIdnNo) == false)
	{
		return false;
	}
	if (CheckSumIdnNo(pStrIdnNo1+pStrIdnNo2) == false)
	{
		alert("주민번호가 유효하지 않습니다.");
		return false;
	}
	return true;
}


//=============================================================================
// 함수명: ScrapFood
// 설  명: 메뉴 스크랩
// 작업일: 
// 작업자: 
//=============================================================================
function ScrapFood(pstrFoodCd) {                               
	var url;

	if ((pstrFoodCd != "")) {
		url = "../food/Food0000DetailPopupScrap.aspx?FOOD_CD=" + pstrFoodCd ;

		var temp;
		temp = PopUp(0, 350, 150, url);
		temp.focus();
	} 			   
}		


//=============================================================================
// 함수명: SendMailFood
// 설  명: 메뉴 메일
// 작업일: 
// 작업자: 
//=============================================================================
function SendMailFood(pstrFoodCd, pstrGb) {                               
	if ((pstrFoodCd != "")) {
		if (pstrGb == "0") {	
			url = "../food/Food0000DetailPopupSendMailL.aspx?FOOD_CD=" + pstrFoodCd ;
			intMode = 4;
			width = 796;
			height = 630;
		/* if (pstrGb == "1") { */
		} else {
			url = "../food/Food0000DetailPopupSendMailS.aspx?FOOD_CD=" + pstrFoodCd ;
			intMode = 1;
			width = 743;
			height = 537;
		}

		var temp;
		temp = PopUp(intMode, width, height, url);
		temp.focus();
	}
}

//=============================================================================
// 함수명: ViewMailFood
// 설  명: 메뉴 메일
// 작업일: 
// 작업자: 
//=============================================================================
function ViewMailFood(pstrMailNo, pstrGb) {                               
	if ((pstrMailNo != "")) {
		width = 705;
		height = 600;
		if (pstrGb == "0") {	
			url = "../food/Food0000DetailPopupViewMailL.aspx?MAIL_NO=" + pstrMailNo ;
			width = 796;
			height = 630;
		}
		if (pstrGb == "1") {	
			url = "../food/Food0000DetailPopupViewMailS.aspx?MAIL_NO=" + pstrMailNo ;
			width = 743;
			height = 537;
		}

		var temp;
		temp = PopUp(4, width, height, url);
		temp.focus();
	} 			   
}

//=============================================================================
// 함수명: PopupAgreement
// 설  명: 이용약관 Popup
// 작업일: 
// 작업자: 
//=============================================================================
function PopupAgreement() {

	var strAgreement;
	
	strAgreement = window.open("../common/PopupAgreement.aspx","popupApplTip","width=490,height=710,scrollbars=no,resizable=no,top=0,left=0");	        	
	strAgreement.focus();

}

//=============================================================================
// 함수명: PopupPersonal
// 설  명: 개인보호정책 Popup
// 작업일: 
// 작업자: 
//=============================================================================
function PopupPersonal() {

	var strPersonal;
	
	strPersonal = window.open("../common/PopupPersonal.aspx","popupApplTip","width=490,height=710,scrollbars=no,resizable=no,top=0,left=0");	        	
	strPersonal.focus();

}

//=============================================================================
// 함수명: PopupViewApplTip
// 설  명: 지원서작성요령 Popup
// 작업일: 
// 작업자: 
//=============================================================================
function PopupViewApplTip() {

	var strApplTip;
	
	strApplTip = window.open("","popupApplTip","width=604,height=407,scrollbars=no,resizable=no,top=0,left=0");	        
	strApplTip.document.write("<title>T.G.I. FRiDAY'S!</title><body leftmargin=0 topmargin=0><img src='../../image/company_4050_popup_010.gif' border=0 style=cursor:hand; onClick=self.close();></body>");		
	
	strApplTip.focus();

}


//=============================================================================
// 함수명: 
// 설  명: 레이어 작업
// 작업일: 
// 작업자: 
//=============================================================================
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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_showHideLayers() { //v6.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; }
    obj.visibility=v; }
}


//=============================================================================
// 함수명: PopupEvent
// 설  명: 이벤트, 공지 Popup
// 작업일: 
// 작업자: 
//=============================================================================
function PopupEvent(pstrUrl, pstrNm, pstrWindowType, pstrPublicYn) {
	var objWindow;	
	
	if (pstrPublicYn == "0")
	{
		if (document.all.txtLoginYn.value != "1")
		{
			alert("로그인을 하셔야 합니다.");
			return;						
		}
	}			
	
	objWindow = window.open(pstrUrl + "?CD=" + pstrNm, pstrNm, pstrWindowType);	        	
	objWindow.focus();
}


//=============================================================================
// 함수명: CheckEmail
// 설  명: 이메일 주소 검사
// 작업일: 
// 작업자: 
//=============================================================================
function CheckEmail(strValue) 
{ 
	var flag = false;
	emailEx1 = /^([\.\,\-A-Za-z0-9_]{1,20})(@{1})([\.\,\-A-Za-z0-9_]{1,20})(\.{1})([\.\,\-A-Za-z0-9_]{2,10})(\.{1}[\.\,\-A-Za-z]{2,10})?(\.{1}[\.\,\-A-Za-z]{2,10})?$/; 
	if (emailEx1.test(strValue)) 
	{
		flag = false; 
	}
	else 
	{
		flag = true;
	}
	return flag;
} 


//=============================================================================
// 함수명: Trim
// 설  명: 넘어온 문자열들중에 포함된 공백을 모두 없앤 문자열을 리턴
// 작업일: 
// 작업자: 
//=============================================================================
function Trim(strings)
{
    var retString = "";
    var c;
    var i;

    for(i=0;i<strings.length;i++) {
        c = strings.charAt(i);

        if(c != ' '){
           retString += c;
        }
    }
    return(retString);
}

//=============================================================================
// 함수명: ReplaceStr
// 설  명: 문자열 치환 Popup
// 작업일: 
// 작업자: 
//=============================================================================

function ReplaceStr(strOriginal, strFind, strChange)
{
  return strOriginal.split(strFind).join(strChange);
}


//=============================================================================
// 함수명: isDate
// 설  명: 날짜 유효성
// 작업일: 
// 작업자: 
//=============================================================================
function isDate(yyyy,mm,dd)
{

   if (yyyy.length != 4)
      return false;
   else {   
      yyyy=parseInt(yyyy,10);
      mm=parseInt(mm,10);
      dd=parseInt(dd,10);
      d = new Date(yyyy,mm-1,dd);
      if (d=="NaN") return false;
      
      if (yyyy == d.getFullYear()) {
		if (mm == d.getMonth()+1) {
			if (dd == d.getDate()) 
				return true;
			else
				return false;	
		}		
		return false;		
	  }			
      return false;
   }   
}


//=============================================================================
// 함수명: isDate_yyyy_m_d
// 설  명: yyyy-mm-dd 형태 유효성
// 작업일: 
// 작업자: 
//=============================================================================
/*
function isDate_yyyy_m_d(s)// yyyy-mm-dd 형태
{
   s=s.replace(/\s/g,""); // 공백제거
   
   var d = s.match(/\d+\-\d+\-\d+/g);
   
   if (d.toString().substring(2,12) !=s.toString()) {
      return false; // 1111-11-11 포맷이 아님
   }   
   var d = s.split(/\-/g);
   return isDate(d[0],d[1],d[2]);
}
//*/
function isDate_yyyy_m_d(s)// yyyy-mm-dd 형태
{
/*
   s=s.replace(/\s/g,""); // 공백제거
   if (s.match(/\d+\-\d+\-\d+/g)[0] != s) 
      return false; // 1111-11-11 포맷이 아님
   var d = s.split(/\-/g);
   return isDate(d[0],d[1],d[2]);
*/
   s=s.replace(/\s/g,""); // 공백제거

   if (s.match(/\d+\-\d+\-\d+/g) == null) {
       return false;
   }
   else
   {
      if (s.match(/\d+\-\d+\-\d+/g)[0] != s) {
         return false; // 1111-11-11 포맷이 아님
      }
      else {
         var d = s.split(/\-/g);
         return isDate(d[0],d[1],d[2]);
      }
   }
}


//=============================================================================
// 함수명: checkDate
// 설  명: yyyy-mm-dd 형태 날짜 유효성
// 작업일: 
// 작업자: 
//=============================================================================
function checkDate(s)
{
   var isD
   
   if (s.length!= 10) {
      return false; 
   }   
   else {
	isD=isDate_yyyy_m_d(s);
	   
	if (isD) 
		return true;
	else
	    return false;
   }	    
}


//=============================================================================
// 함수명: correctDate
// 설  명: yyyy-mm-dd 형태 날짜
// 작업일: 
// 작업자: 
//=============================================================================
function correctDate(s)// yyyy-mm-dd 형태
{
   s=s.replace(/\s/g,""); // 공백제거
   var d = s.split(/\-/g);
   if (d[1].length == 1)
      d[1] = "0" + d[1];
   if (d[2].length == 1)
      d[2] = "0" + d[2];  
   return d[0] + "-"  + d[1] + "-" + d[2];
}

//=============================================================================
// 함수명: PopupViewCompanyLink
// 설  명: 관계사링크 팝업
// 작업일: 
// 작업자: 
//=============================================================================
function PopupViewCompanyLink() {

	var strUrl;
	var temp;
					
	strUrl = "../common/PopupCompanyLink.aspx";
	temp = PopUp(0, 530, 422, strUrl);
	temp.focus();
	
}


//=============================================================================
// 함수명: GoHome
// 설  명: 홈페이지 초기화면으로 이동
// 작업일: 
// 작업자: 
//=============================================================================
function GoHome() {
	
	parent.location = "../../" ;
	
}

//=============================================================================
// 함수명: GoStart
// 설  명: 좌측메뉴의 초기화면으로 이동
// 작업일: 
// 작업자: 
//=============================================================================
function GoStart(pStrGroup, pStrNo) {
	
	var strUrl;
	
	// COMPANY : 회사소개
	if (pStrGroup == "COMPANY")
	{
		if  (pStrNo == "1")
			strUrl = "../company/Company1010.aspx" ;
		else if (pStrNo == "2")
			strUrl = "../company/Company2000.aspx" ;
		else if (pStrNo == "3")
			strUrl = "../company/Company3000.aspx" ;
		else if (pStrNo == "4")
			strUrl = "../company/Company4010.aspx" ;
	
	}
	
	// FOOD : 메뉴
	else if (pStrGroup == "FOOD")
	{
		if  (pStrNo == "1")
			strUrl = "../food/Food1000.aspx" ;
		else if (pStrNo == "2")
			strUrl = "../food/Food1000.aspx" ;
		else if (pStrNo == "3")
			strUrl = "../food/Food1000.aspx" ;
		
	}
	
	// STORE : 매장
	else if (pStrGroup == "STORE")
	{
		if  (pStrNo == "1")
			strUrl = "../store/Store1010.aspx" ;	
	}
	
	// MEMBERSHIP : 멤버쉽
	else if (pStrGroup == "MEMBERSHIP")
	{
		if  (pStrNo == "1")
			strUrl = "../membership/Membership1000.aspx" ;
		else if (pStrNo == "2")
			strUrl = "../need_login/Membership2010.aspx" ;
		else if (pStrNo == "3")
			strUrl = "../membership/Membership3010.aspx" ;
		else if (pStrNo == "4")
			strUrl = "../membership/Membership4010.aspx" ;	
		else if (pStrNo == "5")
			strUrl = "../membership/Membership5010.aspx" ;	
	}
	
	// EVENTS : 이벤트
	else if (pStrGroup == "EVENTS")
	{
		if  (pStrNo == "1")
			strUrl = "../events/Events1000.aspx" ;
		else if (pStrNo == "2")
			strUrl = "../events/Events2000.aspx" ;
		else if (pStrNo == "3")
			strUrl = "../events/Events3000.aspx" ;
		else if (pStrNo == "4")
			strUrl = "../events/Events4000.aspx" ;	
		else if (pStrNo == "5")
			strUrl = "../events/Events5010.aspx" ;	
		else if (pStrNo == "6")
			strUrl = "../customer/Customer4000.aspx" ;	
	
	}
	
	// CUSTOMER : 고객의소리
	else if (pStrGroup == "CUSTOMER")
	{
		if  (pStrNo == "1")
			strUrl = "../customer/Customer1000.aspx" ;
		else if (pStrNo == "2")
			strUrl = "../customer/Customer2000.aspx" ;
		else if (pStrNo == "3")
			strUrl = "../customer/Customer3000.aspx" ;
		else if (pStrNo == "4")
			strUrl = "../customer/Customer6000.aspx" ;			
	}
	
	// MONITOR : 객원마케터
	else if (pStrGroup == "MONITOR")
	{
		if  (pStrNo == "1")
			strUrl = "../monitor/Monitor1010.aspx" ;
		else if (pStrNo == "2")
			strUrl = "../monitor/Monitor1020.aspx" ;
		else if (pStrNo == "3")
			strUrl = "../monitor/Monitor1030.aspx" ;
		else if (pStrNo == "4")
			strUrl = "../monitor/Monitor1040.aspx" ;				
		else if (pStrNo == "5")
			strUrl = "../monitor/Monitor1050.aspx" ;				
		else if (pStrNo == "6")
			strUrl = "../need_login/Monitor2010.aspx" ;				
		else if (pStrNo == "7")
			strUrl = "../need_login/Monitor2020.aspx" ;				
		else if (pStrNo == "8")
			strUrl = "../need_login/Monitor3010.aspx" ;				
		else if (pStrNo == "9")
			strUrl = "../need_login/Monitor3020.aspx" ;				

	}	
	
	else if (pStrGroup == "COMMON")
	{
	
	
	}
	
	else 
	{
		strUrl = "about:blank";
	}	
	
	parent.location = strUrl ;
	
}

//=============================================================================
// 함수명: GoPage
// 설  명: Page 이동
// 작업일: 
// 작업자: 
//=============================================================================
function GoPage(pStrPageNm) {
	
	parent.location = pStrPageNm ;
	
}


//=============================================================================
// 함수명: cmbSubCompanyLink_Onchange
// 설  명: Sub Page 하단의 롯데 계열사 링크 
// 작업일: 
// 작업자: 
//=============================================================================

function cmbSubCompanyLink_Onchange() {	
	window.open(document.all.BottomCopyright1_cmbCompanyLink.value);
}			 						

//=============================================================================
// 함수명: CheckLogin
// 설  명: 로그인 체크
// 작업일: 
// 작업자: 
//=============================================================================
function CheckLogin() {
	if (document.all.txtLoginYn.value != "1")
	{
		alert("로그인을 하셔야 합니다.");
		return false;						
	}
	else
	{
		return true;
	}	
}


//=============================================================================
// 함수명: getCookie
// 설  명: 쿠키값을 가져오는 함수 
// 작업일: 
// 작업자: 
//=============================================================================
function getCookie(name) { 
   var from_idx = document.cookie.indexOf(name+'='); 
   
   if (from_idx != -1) { 
      from_idx += name.length + 1 ;
      to_idx = document.cookie.indexOf(';', from_idx) ;

      if (to_idx == -1) { 
            to_idx = document.cookie.length ;
      } 
            
      return unescape(document.cookie.substring(from_idx, to_idx));
   } 
} 


//=============================================================================
// 함수명: setCookie
// 설  명: 쿠키 생성 함수
// 작업일: 
// 작업자: 
//=============================================================================
function setCookie(name, value, expire) { 
    var expire_date = new Date(expire);
    document.cookie = name + "=" + escape(value) + "; path=/; expires=" + expire_date.toGMTString(); 
} 


//=============================================================================
// 함수명: clearCookie
// 설  명: 쿠키 소멸 함수
// 작업일: 
// 작업자: 
//=============================================================================
function clearCookie(name) { 
    var today = new Date(); 
    //어제 날짜를 쿠키 소멸 날짜로 설정한다. 
    var expire_date = new Date(today.getTime() - 60*60*24*1000); 
    document.cookie = name + "= " + "; path=/; expires=" + expire_date.toGMTString();        
} 


//=============================================================================
// 함수명: controlCookie
// 설  명: 체크 상태에 따라 쿠키 생성과 소멸을 제어하는 함수 
// 작업일: 
// 작업자: 
//=============================================================================
function controlCookie(elemnt, name) { 
        if (elemnt.checked) { 
            var today = new Date(); 
    		var expire_date = new Date(today.getTime() + 60*60*24*1000);
    		         
            //체크 박스를 선택했을 경우 쿠키 생성 함수 호출 
        	setCookie(name, "true", expire_date); 
        } 
        else { 
        	//체크 박스를 해제했을 경우 쿠키 소멸 함수 호출 
            clearCookie(name);
        }
}  


//=============================================================================
// 함수명: PopupViewPlaceStore
// 설  명: 점포소개 안내 팝업
// 작업일: 
// 작업자: 
//=============================================================================
function PopupViewPlaceStore() {

	var strUrl;
	var temp;
					
	strUrl = "../common/PopupPlaceStore.aspx";
	temp = PopUp(0, 641, 505, strUrl);
	temp.focus();
	
}

//=============================================================================
// 함수명: PopupViewFridaysCardForm
// 설  명: 프라이데이즈카드신청서 팝업
// 작업일: 
// 작업자: 
//=============================================================================

function PopupViewFridaysCardForm() {

	var strUrl;
	var temp;
					
	strUrl = "../common/PopupContract.aspx";
	temp = PopUp(0, 500, 710, strUrl);
	temp.focus();
	
}

//=============================================================================
// 함수명: setObjectScript
// 설  명: 오브젝트태그 스크립트 변환
// 작업일: 2006.02.22
// 작업자: 김형민
//=============================================================================


function setObjectScript(id){
	if(typeof(id) == 'string') id = document.getElementById(id);
	if(typeof(id) != 'object' || id.tagName.toUpperCase() != 'COMMENT') return;
	document.write(id.innerHTML);
	id.style.display = 'none';
	id.id = "";
}

function docWrite(html) {
	document.write(html);
}

//=============================================================================
// 함수명: scroll
// 설  명: 오른쪽 따라다니는 스크롤
// 작업일: 
// 작업자:
//=============================================================================


function scroll(){
    var a=document.body.scrollTop+40
    menu.style.top=a;
}




//=============================================================================
// 함수명: SetIframeHeight
// 설  명: Iframe 높이 설정
// 작업일: 
// 작업자: 
//=============================================================================
function SetIframeHeight() {
		
	parent.document.all.Iframe2.height = document.body.scrollHeight; 
	
}

function setPng24(obj) {
obj.width=obj.height=1;
obj.className=obj.className.replace(/\bpng24\b/i,""); 
obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\""+ obj.src +"\",sizingMethod=\"image\");"
obj.src ="/images/blank.png";
return "";
}

function autoBlur(){ 
  if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG"){
     document.body.focus(); 
  }
} 
document.onfocusin=autoBlur; 

