﻿	
	var globalCount = 0;

        function MM_showHideLayers() { //v9.0
          var i,p,v,obj,args=MM_showHideLayers.arguments;
          for (i=0; i<(args.length-2); i+=3) 
          with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
            if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
            obj.visibility=v; }
        }

    function jsCheckEmpty(formitem, message)
    {
        //if(!jsSubmitCountCheck()) return false

        var targetObj = eval("document.aspnetForm." + formitem);

        if(targetObj.value == "")
        {	
        	alert(message);
        	if(typeof(targetObj) == "undefined")
        	{
        		return false;
        	}
        	else
        	{	
        		try
        		{
					targetObj.focus();
				}
				catch(e)
				{
				}	
            }
	        return false;
        }
        else
        {
	        if (targetObj.value.split(" ").join("") == "")
	        {
    	        alert(message);
        		if(typeof(targetObj) == "undefined")
        		{
        			return false;
        		}
        		else
        		{	
        			try
        			{
						targetObj.focus();
					}
					catch(e)
					{
					}	
				}
				return false;
	        }
	        else
	        {
	        	if(targetObj.value.replace("nbsp;", "").replace("<p>", "").replace("</p>", "").replace("<br />", "") == "")
	            {
        	        alert(message);
        			if(typeof(targetObj) == "undefined")
        			{
        				return false;
        			}
        			else
        			{	
        				try
        				{
							targetObj.focus();
						}
						catch(e)
						{
						}	
					}
					return false;
	            }

		        return true;
	        }
        }        
    }     
    
    function jsCheckKor(formitem, message)
    {
        //if(!jsSubmitCountCheck()) return false

        var targetObj = eval("document.aspnetForm." + formitem);

		if (Korean_Character(targetObj.value) == false )
		{                       
				alert(message);
        		if(typeof(targetObj) == "undefined")
        		{
        			return false;
        		}
        		else
        		{	
        			try
        			{
						targetObj.focus();
					}
					catch(e)
					{
					}	
				}
				return false;
		}  
		return true;      
    }    
    
    function jsCheckLength(formitem, message)
    {
        //if(!jsSubmitCountCheck()) return false

        var targetObj = eval("document.aspnetForm." + formitem);

		if ( getByteLen(targetObj.value) < 4 || getByteLen(targetObj.value) > 20)
		{                       
        	if(typeof(targetObj) == "undefined")
        	{
        		return false;
        	}
        	else
        	{	
        		try
        		{
        		    alert(message);
					targetObj.focus();
				}
				catch(e)
				{
				}	
            }
	        return false;
		}            
		return true;
    }
    
    function jsCheckSecretKeyLength(formitem, message)
    {
        var targetObj = eval("document.aspnetForm." + formitem);
        var objLength = getByteLen(targetObj.value);
        var objValue = targetObj.value;
		if ( objLength < 6 || objLength > 6)
		{                       
        	if(typeof(targetObj) == "undefined")
        	{
        		return false;
        	}
        	else
        	{	
        		try
        		{
        		    alert(message);
					targetObj.focus();
				}
				catch(e)
				{
				}	
            }
	        return false;
		}            
		return true;
    }        

	function changeMonth(mon)
	{

		objectF = document.aspnetForm;
	    
		var lastDays = [0,31,29,31,30,31,30,31,31,30,31,30,31];
		var len = objectF.IDay.length;
	    
		for(i=0 ; i < len ;i++)
		{
			objectF.IDay.options[0] = null;
		} 

		for(i=0 ; i < lastDays[mon] ;)
		{
			objectF.IDay.options[i] = new Option(++i);
		}     
	}

	//Common Email Character Check
	function isEmail(s)
	{
	  return s.search(/^\s*[\w\~\-\.]+\@[\w\~\-]+(\.[\w\~\-]+)+\s*$/g)>=0;
	}

	//korean check
	function Korean_Character(Input_String)
	{
			for(i=0; i<=Input_String.length-1; i++)
			{
				   if (((Input_String.charCodeAt(i) >= 4052) && (Input_String.charCodeAt(i) <= 4601)) || ((Input_String.charCodeAt(i) >= 12593) && (Input_String.charCodeAt(i) <= 12686)) || ((Input_String.charCodeAt(i) >= 44032) && (Input_String.charCodeAt(i) <= 55203)))
				   {
						   return false;
				   }
			}
			if(Special_Character(Input_String) == true)
			{
				return false;
			}
	}
		
	function isRestricted(str)
	{
	  var chkStr = str.toLowerCase();
	  var restrictedWords = ["cafe","bay","berry","nexberry","rakion","cafeadmin","cafemanager","wolf","gunbound","admin","softnyx","fuck","suck","magicpunk","gm","master"];
	  for(i = 0 ; i < restrictedWords.length ; i++ )
	  {
		if(chkStr.indexOf(restrictedWords[i]) != -1)
		{
		   return restrictedWords[i];
		}
	  }
	  
	  return "";
	} 

	//이미지 포멧명 검사
	function isIMGRestricted(str)
	{
	  var chkStr = str.toLowerCase();
	  var restrictedWords = [".zip", ".asp",".php",".aspx",". js", ".ascx", ".bmp", ".gif", ".jsp", ".sql"];
	  for(i = 0 ; i < restrictedWords.length ; i++ )
	  {
		if(chkStr.indexOf(restrictedWords[i]) != -1)
		{
		   return restrictedWords[i];
		}
	  }
	  
	  return "";
	} 
	
	function isAscii(str)
	{
	  var charCode,retVal;
	  retVal = false; 
	  for(i=0 ; i < str.length ; i++)
	  {
		charCode = str.charCodeAt(i);
		if ( (charCode > 47 && charCode < 58) || ( charCode > 64 && charCode < 91 ) || ( charCode > 96 && charCode < 123 ))    
		{
		  retVal =  retVal || false  ;
		}
		else
		{
		  retVal =  retVal || true  ;
		}    
		if (charCode == 32)    
		{
		  retVal =  retVal || true  ;
		}  
	  }  
	  return retVal;
	}	
	
	function getByteLen(str)	
	{ 
	   var len = 0; 
	   if ( str == null ) return 0; 
	   for(var i=0;i<str.length;i++){ 
		  var c = escape(str.charAt(i)); 
		  if ( c.length == 1 ) len ++; 
		  else if ( c.indexOf("%u") != -1 ) len += 2; 
		  else if ( c.indexOf("%") != -1 ) len += c.length/3; 
	   } 
	   return len; 
	}	
	
	
	//Special Character Check
	function Special_Character(Check_String)		
	{
		schar= new Array('%',"'","<",">");
		for (i=0; i<Check_String.length; i++)
		{
			for (j=0; j<schar.length; j++)
			{
				if (schar[j] == Check_String.charAt(i))
				{
		    		return true;
				}
	   		}
		}
	}
	
//Check Numberic 
function NumbericCheck(Check_String)
{
	var varj = Check_String.length;
	var vari = 0;
	schar= new Array('1','2','3','4','5','6','7','8','9','0');
	for (i=0; i<Check_String.length; i++)
	{
		for (j=0; j<schar.length; j++)
		{
			if (schar[j] == Check_String.charAt(i))
			{
				vari = vari + 1
			}
		}
	}
	if (vari == varj)
	{
		return true
	}
	else
	{
		return false;
	}
}

//숫자 or 콤마 "," 만 입력 가능 하게
//char : string
//proFlag : 0:숫자만, 1:콤마까지
function CharNumberCheck(chkChar, proFlag) {
    val = chkChar.value;
    new_val = '';
    for(i=0;i<val.length;i++) {
        char1 = val.substring(i,i+1);
        
        //숫자만 체크                
        if (proFlag == 0)
        {
            if (char1 < '0' || char1 > '9') {
                    chkChar.value = new_val;
                    return;
            } else {
                    new_val = new_val + char1;
            }
        }
        //콤마 까지 체크
        else if (proFlag == 1)
        {
            if (char1 < '0' || char1 > '9') {
                if(char1 == '.')
                {
                    new_val = new_val + char1;
                }
                else
                {
                    chkChar.value = new_val;
                    return;
                    }
            } else {
                    new_val = new_val + char1;
            }
        }                
    }
}

//HTML Tag Block
function CharTagCheck(chkChar) {
    val = chkChar.value;
    new_val = '';
    for(i=0;i<val.length;i++) {
        char1 = val.substring(i,i+1);
        if (char1 == '<' || char1 == '>') {
                chkChar.value = new_val;
                return;
        } else {
                new_val = new_val + char1;
        }
    }
}

	function getObject(objectId) { 
	// checkW3C DOM, then MSIE 4, then NN 4. 
	// 
	if(document.getElementById && document.getElementById(objectId)) { 
	return document.getElementById(objectId); 
	} 
	else if (document.all && document.all(objectId)) { 
	return document.all(objectId); 
	} 
	else if (document.layers && document.layers[objectId]) { 
	return document.layers[objectId]; 
	} else { 
	return false; 
	} 
	} 

	
	function fnReportPopup(pagename){
		var winopen = window.open(pagename, 'ReportPop', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=500,height=310,left=0,top=0');
		winopen.focus();
	}
	
	function jsEnterShift(butClientID) 
	{
		var keyValue = event.keyCode;
		var targetObj = eval("document.aspnetForm." + butClientID);
		
		if (keyValue =='13') 
		{

		}            
	}
	
function wordBreak(obj) { 
 	tmpArr = obj.innerHTML.split('')
 	var resultStr = "";
 	var chk = false;
 	
 	for (i = 0; i < tmpArr.length; i++)
 	{ 		

 		if (tmpArr[i] == ">")
 			chk = false;
 			 		
 		if ((tmpArr[i] == "<"))
			chk = true;
		
		if (chk)
			resultStr += tmpArr[i];
		else 		
			resultStr += tmpArr[i] + ('&#8203;');
 	}
 	
 	obj.innerHTML = resultStr;
}	

    function jsSubmitCountCheck()
    {
        if(globalCount ==0)
            return true;
       else
            return false;
    }
    
//	function fnPurchase(idseq, ibuyQty, typemsg, price,userberry,notenought,confrimmsg)
//	{
//		if(jsSubmitCountCheck()) 
//		{
//		    objectF = "document.aspnetForm."; 
//		    var qty = eval(objectF + ibuyQty).value;
//	        var sellprice = parseInt(price) * parseInt(qty);
//	        var userprice = parseInt(userberry);
//		        		    
//		    if(qty == "" || sellprice == 0 || userberry == 0)
//		    {
//		        alert(typemsg);
//                return false;
//		    }
//		    else
//		    {   
//		        if(sellprice > userprice)
//		        {
//		            var notenoughtberry = notenought.replace(/@1/, userberry);
//		            notenoughtberry = notenoughtberry.replace(/@2/, sellprice);
//		            notenoughtberry = notenoughtberry.replace(/@3/, userberry - sellprice);
//		            alert(notenoughtberry);
//		            return false;
//		        }    
//		        else
//		        {
//		            var confirmMessage = confrimmsg.replace(/@1/, userberry+"\r\n");
//		            confirmMessage = confirmMessage.replace(/@2/, sellprice+"\r\n");
//		            confirmMessage = confirmMessage.replace(/@3/, (userberry - sellprice)+"\r\n\r\n");
//		            if(confirm(confirmMessage))
//		            {
//		                globalCount = globalCount + 1;
//                        location.href='/Epin/Epin_Redemption.aspx?idcode=' + idseq+'&idcode1='+ibuyQty;
//                        return true;
//                    }
//                    else
//                    {
//                        return false;
//                    }    
//                }
//            }        
//		}
//	}
	
	
		//term
	function CheckRegisterTerm(formname, item1, item2, msgOPT)
	{
		if(!jsSubmitCountCheck()) return false
		
		var targetObj = "document." + formname;
        if (!eval(targetObj+ "." + item1).checked || !eval(targetObj + "." + item2).checked)
        {
            alert(msgOPT);
            if (!eval(targetObj+ "." + item1).checked)
				eval(targetObj+ "." + item1).focus();
			else 	
				eval(targetObj+ "." + item2).focus();
            return false;
        } 
        else
        {
            globalCount = globalCount + 1;        
            return true;
        }
	}

    function jsSubmitCountCheck()
    {
        if(globalCount ==0)
            return true;
       else
            return false;
    }
    

	//register user
	//msgArray
	//[0]:InsertID, [1]:check id length [2]:SpecialCharacter [3]:InsertName [4]:InsertPassword [5]:NotmatchPass [6]:insert address 
	//[7]:InsertEmail [8]:IncorrectEmail [9]:InvalidBirthday [10]:AgreeTerm [11]:EnterVerifyCode [12]:NotmatchEmail [13]:insert tel
	//[18] EpinTypeSecretKey,[19] EpinInvalidSecretKey
	function registration(var_processflag, control, msg)
	{
		if(!jsSubmitCountCheck()) return false
		
		var controlArray = control.split(",");
		var msgArray = msg.split("&&,");
				
		//flag = 1 enterance
		if (var_processflag == 1)
		{
			objectF = "document.aspnetForm."; 
	        //id
	        if(!jsCheckEmpty(controlArray[0], msgArray[0])) return false;
			if(!jsCheckKor(controlArray[0], msgArray[2])) return false;
	        if(!jsCheckLength(controlArray[0], msgArray[1])) return false;

			//check duplicated
			if(eval(objectF + controlArray[16]).value == "0")
			{
				alert(msgArray[16]);
				return false;
			}
				       
	        //date y/m/d
			if(eval(objectF + controlArray[1]).value == "0" || eval(objectF + controlArray[2]).value == "0" || eval(objectF + controlArray[3]).value == "0")
			{
				alert(msgArray[9]);
				return false;
			}
			//first name
	        if(!jsCheckEmpty(controlArray[4], msgArray[3])) return false;
			if(!jsCheckKor(controlArray[4], msgArray[2])) return false;

			//last name
	        if(!jsCheckEmpty(controlArray[5], msgArray[3])) return false;
			if(!jsCheckKor(controlArray[5], msgArray[2])) return false;
			
			//password
	        if(!jsCheckEmpty(controlArray[6], msgArray[4])) return false;
			if(!jsCheckLength(controlArray[6], msgArray[1])) return false;
			
			//re password
	        if(!jsCheckEmpty(controlArray[7], msgArray[4])) return false;
	        if(!jsCheckLength(controlArray[7], msgArray[1])) return false;

			 if (eval(objectF + controlArray[6]).value != eval(objectF + controlArray[7]).value)
			 {
				alert(msgArray[5]);
				eval(objectF + controlArray[6]).value = "";
				eval(objectF + controlArray[7]).value = ""; 
				eval(objectF + controlArray[6]).focus(); 
				return false;              
			 }

			//address
	        if(!jsCheckEmpty(controlArray[8], msgArray[6])) return false;
			if(!jsCheckKor(controlArray[8], msgArray[2])) return false;
			
			//tel
	        if(!jsCheckEmpty(controlArray[9], msgArray[13])) return false;
			if(!jsCheckKor(controlArray[9], msgArray[2])) return false;
									
			//email
	        if(!jsCheckEmpty(controlArray[10], msgArray[7])) return false;
			if(!jsCheckKor(controlArray[10], msgArray[2])) return false;

			//re email
	        if(!jsCheckEmpty(controlArray[11], msgArray[7])) return false;
			if(!jsCheckKor(controlArray[11], msgArray[2])) return false;
								
			if (!isEmail(eval(objectF + controlArray[10]).value))
			{
				alert(msgArray[8]); 
				eval(objectF + controlArray[10]).value="";
				eval(objectF + controlArray[10]).focus();
				return false;		
			}  

  		     if (!isEmail(eval(objectF + controlArray[11]).value))
			{
				alert(msgArray[8]); 
				eval(objectF + controlArray[11]).value="";
				eval(objectF + controlArray[11]).focus();
				return false;		
			}  
			   
			 if (eval(objectF + controlArray[10]).value != eval(objectF + controlArray[11]).value)
			 {
				alert(msgArray[12]);
				eval(objectF + controlArray[10]).value = "";
				eval(objectF + controlArray[11]).value = ""; 
				eval(objectF + controlArray[10]).focus(); 
				return false;              
			 }          

	        //check duplicated
			if(eval(objectF + controlArray[17]).value == "0")
			{
				alert(msgArray[17]);
				return false;
			}
			
			//check time zone
			if(eval(objectF + controlArray[15]).value == "A")
			{
				alert(msgArray[14]);
				return false;
			}
			
			//secretkey
	        if(!jsCheckEmpty(controlArray[18], msgArray[18])) return false;
	        if(!jsCheckEmpty(controlArray[19], msgArray[18])) return false;
			if(!jsCheckSecretKeyLength(controlArray[18], msgArray[1])) return false;
			if(!jsCheckSecretKeyLength(controlArray[19], msgArray[1])) return false;
            
         
			 if (eval(objectF + controlArray[18]).value != eval(objectF + controlArray[19]).value)
			 {
				alert(msgArray[19]);
				eval(objectF + controlArray[18]).value = "";
				eval(objectF + controlArray[19]).value = ""; 
				//eval(objectF + controlArray[18]).focus(); 
				return false;              
			 }  
			 						
			//check code
			if(!jsCheckEmpty(controlArray[14], msgArray[11])) return false;
			
								
			if(confirm(msgArray[15]))
			{
				globalCount = globalCount + 1;
				return true;
			}
			else
				return false;
		}	   
	} 

	//id check
	function Id_Check(formitem, msg)
	{
		if(!jsSubmitCountCheck()) return false
	
		objectF = eval("document.aspnetForm." + formitem); 
		var msgArray = msg.split("&&,");
		
        //id
        if(!jsCheckEmpty(formitem, msgArray[0])) return false;
		if(!jsCheckKor(formitem, msgArray[2])) return false;
        if(!jsCheckLength(formitem, msgArray[1])) return false;
	        		
		var retVal = isRestricted(objectF.value);
		if ( retVal != "" )
		{
			alert(msgArray[2]);				
			objectF.focus();
			return false;
		}    			
	    		
		if(isAscii(objectF.value))
		{ 
			alert(msgArray[2]);
			objectF.focus();
			return false;
		} 

		return true;
	}

	//email check
	function Email_Check(formitem, msg)
	{
		if(!jsSubmitCountCheck()) return false
		
		objectF = eval("document.aspnetForm." + formitem); 
		var msgArray = msg.split("&&,");
		
        if(!jsCheckEmpty(formitem, msgArray[7])) return false;
		if(!jsCheckKor(formitem, msgArray[2])) return false;

	  if (!isEmail(objectF.value))
		{
			alert(msgArray[7]); 
			objectF.value="";
			objectF.focus();
			return false;		
		}  
		return true;
	}
	

	//email check
	function Email_Modify_Check(formitem, msg)
	{
		if(!jsSubmitCountCheck()) return false
		
		objectF = eval("document.aspnetForm." + formitem); 
		var msgArray = msg.split("&&,");
		
        if(!jsCheckEmpty(formitem, msgArray[3])) return false;
		if(!jsCheckKor(formitem, msgArray[10])) return false;

	  if (!isEmail(objectF.value))
		{
			alert(msgArray[4]); 
			objectF.value="";
			objectF.focus();
			return false;		
		}  
		return true;
	}	    

	function updateMember(var_processflag, control, msg)
	{
		if(!jsSubmitCountCheck()) return false
		
		var controlArray = control.split(",");
		var msgArray = msg.split("&&,");
				
		//flag = 1 enterance
		if (var_processflag == 1)
		{
		    objectF = "document.aspnetForm."; 
		    
		    // msgArray		    
            // [0] MessageUI.GetValue("InsertName") + "&&", MessageUI.GetValue("InsertPassword") + "&&", MessageUI.GetValue("NotmatchPass") + "&&",
            // [3] MessageUI.GetValue("InsertEmail") + "&&", MessageUI.GetValue("IncorrectEmail") + "&&", MessageUI.GetValue("NotmatchEmail") + "&&",
            // [6] MessageUI.GetValue("InvalidBirthday") + "&&", MessageUI.GetValue("TypeTel") + "&&", MessageUI.GetValue("SelectTimeZone") + "&&",
            // [9] MessageUI.GetValue("Emailduplicate") + "&&", MessageUI.GetValue("SpecialCharacter") + "&&", MessageUI.GetValue("InsertAddress") + "&&",
            // [12] MessageUI.GetValue("CommonConfirmModify"),MessageUI.GetValue("CheckStringLenght"));
            
            // controlArray
            //[0] IFirstName.ClientID, ILastName.ClientID, IEmail.ClientID, IEmail1.ClientID,
            //[4] IMonth.ClientID, IDay.ClientID, IYear.ClientID, 
            //[7] IAddress.ClientID, ITel.ClientID, ITimeZone.ClientID, ichk1.ClientID, oldEmail.ClientID, 
            //[12] SecretText.ClientID
		    
		    // FirstName
		    if(!jsCheckEmpty(controlArray[0], msgArray[0])) return false;
		    if(!jsCheckKor(controlArray[0], msgArray[10])) return false;
		    
		    // LastName
		    if(!jsCheckEmpty(controlArray[1], msgArray[0])) return false;
		    if(!jsCheckKor(controlArray[1], msgArray[10])) return false;		    
		    
            eval(objectF + controlArray[2]).value = eval(objectF + controlArray[2]).value.split(" ").join("");
            eval(objectF + controlArray[3]).value = eval(objectF + controlArray[3]).value.split(" ").join("");
            
            
            if(eval(objectF + controlArray[2]).value != eval(objectF + controlArray[11]).value)
            {
		        // Email
		        if (!jsCheckEmpty(controlArray[2], msgArray[3])) return false;
		        if(!jsCheckKor(controlArray[2], msgArray[10])) return false;
    		    
		        //re email
		        if (!jsCheckEmpty(controlArray[3], msgArray[3])) return false;
                if(!jsCheckKor(controlArray[3], msgArray[10])) return false;

			    if (!isEmail(eval(objectF + controlArray[2]).value))
			    {
				    alert(msgArray[4]); 
				    eval(objectF + controlArray[2]).value="";
				    eval(objectF + controlArray[2]).focus();
				    return false;		
			    }  

			    if (!isEmail(eval(objectF + controlArray[3]).value))
			    {
				    alert(msgArray[4]); 
				    eval(objectF + controlArray[3]).value="";
				    eval(objectF + controlArray[3]).focus();
				    return false;		
			    }  
    								    
		        if (eval(objectF + controlArray[2]).value != eval(objectF + controlArray[3]).value)
		        {
		            alert(msgArray[5]);
		            return false;
		        }
    		                
                if (eval(objectF + controlArray[10]).value == "0")
                {
                    alert(msgArray[9]);
                    return false;
                }
            }
            
            //date y/m/d
			if(eval(objectF + controlArray[4]).value == "0" || eval(objectF + controlArray[5]).value == "0" || eval(objectF + controlArray[6]).value == "0")
			{
				alert(msgArray[6]);
				return false;
			}
			
			// Address			
			if (!jsCheckEmpty(controlArray[7], msgArray[11])) return false;
			
			// Phone
			if (!jsCheckEmpty(controlArray[8], msgArray[7])) return false;
			
			// ITimeZone
			if (!jsCheckEmpty(controlArray[9], msgArray[8])) return false;

			//secretkey			
			if(eval(objectF + controlArray[12]).value != "")
            {
	            if(!jsCheckEmpty(controlArray[12], msgArray[15])) return false;
	            if(!jsCheckEmpty(controlArray[13], msgArray[15])) return false;
			    if(!jsCheckSecretKeyLength(controlArray[12], msgArray[13])) return false;
			    if(!jsCheckSecretKeyLength(controlArray[13], msgArray[13])) return false;

			     if (eval(objectF + controlArray[12]).value != eval(objectF + controlArray[13]).value)
			     {
				    alert(msgArray[14]);
				    eval(objectF + controlArray[12]).value = "";
				    eval(objectF + controlArray[13]).value = ""; 
				    //eval(objectF + controlArray[12]).focus(); 
				    return false;              
			     }  
            }
            			 			
            if(confirm(msgArray[12]))
			{
				globalCount = globalCount + 1;
				return true;
			}
			else
				return false;			
            
		}
	}	 
    
    
    	function fnChargePop(hostname){
		var openPop = window.open('http://'+hostname+'/Charge/Default.aspx', 'ChargePop', 'toolbar=no,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=734,height=480,left=0,top=0');
		openPop.focus();
		//location.href = "http://"+hostname+"/Charge/Default.aspx";
	}
	
		//list hide, view
	var curFaqNo = '0'
	function fnFaqLayer(argu){
		if (curFaqNo == argu) {
			getObject(['divList' + argu]).style.display = 'none';
			curFaqNo = '0';
		} else if (curFaqNo != '0') {
			getObject(['divList' + curFaqNo]).style.display = 'none';
			getObject(['divList' + argu]).style.display = 'block';
			curFaqNo = argu;
		} else {
			getObject(['divList' + argu]).style.display = 'block';
			curFaqNo = argu;
		}
	}
	
		//use check box
	var selected = false;
	function fnCheckboxSelAll() {
		cnt = document.forms[0].elements.length;
		for(i=0; i < cnt; i++) {
			if(document.forms[0].item(i).type == 'checkbox') 
			{ 
				document.forms[0].item(i).checked = !selected; 
			} 
		} 
		selected = !selected;
	}
	
		//쪽지 삭제
	function jsDeleteMemo(msg)
	{
		if(!jsSubmitCountCheck()) return false
		
		if(confirm(msg))
		{
			globalCount = globalCount + 1;
			return true;
		}
		else
			return false;	
	}
	
	//keep message
	function jsKeepMemo()
	{
		if(!jsSubmitCountCheck()) return false
		
		globalCount = globalCount + 1;
		return true;
	}
	
		//use qna entrans
	//msgArray
	//[0]:카테고리를 선택 하세요, [1]:SpecialCharacter [2]:전화번호를 입력 하세요 
	//[3]:TypeSubject [4]:TypeContent [5]: 입력 하신 내용으로 등록 하시겠습니까?
	function fnQnAregistration(control, msg)
	{
		if(!jsSubmitCountCheck()) return false
		
		var controlArray = control.split(",");
		var msgArray = msg.split("&&,");
				
		objectF = "document.aspnetForm."; 
		
		//category
		if(eval(objectF + controlArray[0]).value == "10" || eval(objectF + controlArray[0]).value == "")
		{
			alert(msgArray[0]);
			return false;
		} 
		
		//tel
		if(!jsCheckEmpty(controlArray[1], msgArray[2])) return false;
		if(!jsCheckKor(controlArray[1], msgArray[1])) return false;
		
		//title	
		if(!jsCheckEmpty(controlArray[2], msgArray[3])) return false;
		if(!jsCheckKor(controlArray[2], msgArray[1])) return false;

		//content
        if(!jsCheckEmpty(controlArray[3], msgArray[4])) return false;
		if(!jsCheckKor(controlArray[3], msgArray[1])) return false;

		if(confirm(msgArray[5]))
		{
			globalCount = globalCount + 1;
			return true;
		}
		else
			return false;
	} 
	
		//Use Qna
	var optValue;
	function fnQnAOPT(formitem, processFlag)
	{
		if(processFlag == 1)
		{
			objectF = eval("document.aspnetForm." + formitem); 
			if(objectF.value == "IR5" && objectF.checked)
				optValue = "5";
			else if(objectF.value == "IR4" && objectF.checked)
				optValue = "4";
			else if(objectF.value == "IR3" && objectF.checked)
				optValue = "3";
			else if(objectF.value == "IR2" && objectF.checked)
				optValue = "2";
			else if(objectF.value == "IR1" && objectF.checked)
				optValue = "1";
			return true	
		}
		else
		{
			cnt = document.forms[0].elements.length;
			for(i=0; i < cnt; i++) {
				if(document.forms[0].item(i).type == 'radio') 
				{ 
					if(document.forms[0].item(i).checked)
					{
						document.forms[0].item(i).checked = false;
					}	
				} 
			} 
			optValue = "";
			return true
		}
		
	}
	
		
	function fnQnAUpdatePoint(seq, msg, conmsg)
	{
		if(!jsSubmitCountCheck()) return false
		
		if(optValue != "" && optValue != undefined)
		{
			if(confirm(conmsg))
			{
				globalCount = globalCount + 1;
				location.href ='qna.aspx?opt=' + optValue + '&nowseq='+seq;	
				return true;
			}
			else
			{
				fnQnAOPT('',2);
				return false;
			}
		}
		else
		{
			fnQnAOPT('',2);
			alert(msg);
			return false;
		}		
	}
	
		//use confirm
	function fnConfirmCommon(enought, okmsg)
	{
		if(!jsSubmitCountCheck()) return false
		
		var checkboxCount = 0;
		cnt = document.forms[0].elements.length;
		for(i=0; i < cnt; i++) {
			if(document.forms[0].item(i).type == 'checkbox') 
			{ 
				if(document.forms[0].item(i).checked == true)
				{
					checkboxCount ++;
				}	
			} 
		} 
		
		if(checkboxCount==0)
		{
			alert(enought);
			return false;
		}		
		else
		{
			if(confirm(okmsg))
			{
				globalCount = globalCount + 1;
				return true;
			}
			else
				return false;		
		}		
	}
	
	
	
	//쪽지 삭제
	function jsDeleteMemo(msg)
	{
		if(!jsSubmitCountCheck()) return false
		
		if(confirm(msg))
		{
			globalCount = globalCount + 1;
			return true;
		}
		else
			return false;	
	}
	
	//keep message
	function jsKeepMemo()
	{
		if(!jsSubmitCountCheck()) return false
		
		globalCount = globalCount + 1;
		return true;
	}	
	
	//id,pwd check
    //MessageUI.GetValue("InsertID") + "&&", MessageUI.GetValue("InsertPassword") + "&&", 
    //MessageUI.GetValue("SpecialCharacter") + "&&", MessageUI.GetValue("CheckStringLenght") + "&&");	
	function jsCheckLogin(control, msg)
	{
		if(!jsSubmitCountCheck()) return false
	
		var msgArray = msg.split("&&,");
		var controlArray = control.split(",");
		
        //id
        if(!jsCheckEmpty(controlArray[0], msgArray[0])) return false;
		if(!jsCheckKor(controlArray[0], msgArray[2])) return false;
        if(!jsCheckLength(controlArray[0], msgArray[3])) return false;

        //pwd
        if(!jsCheckEmpty(controlArray[1], msgArray[1])) return false;
        if(!jsCheckLength(controlArray[1], msgArray[3])) return false;
        	        		
        globalCount = globalCount + 1;
		return true;
	}
	
	
	
	function jsPurchase(control, msg)
	{
		if(jsSubmitCountCheck()) 
		{
		    MM_showHideLayers('purchaseMask','','show');
		    
			var msgArray = msg.split("&&,");
		    var controlArray = control.split(",");
		
		    objectF = "document.aspnetForm."; 
		    var curBerry = controlArray[1];
	        var buyBerry = controlArray[2];
	        var totalCount = controlArray[0];

	         if(!jsCheckEmpty(controlArray[3], msgArray[2])) 
	         {
	            MM_showHideLayers('purchaseMask','','hide');
	            return false;
	         }
	         
	        if(totalCount == 0)
	        {
	            alert(msgArray[0]);
	            MM_showHideLayers('purchaseMask','','hide');
	            return false;
	        }    
	        else
	        {
	            if(parseInt(buyBerry) > parseInt(curBerry))
	            {
	                alert(msgArray[1]);
	                MM_showHideLayers('purchaseMask','','hide');
	                return false;
	            }    
	            else
	            {
	                if(confirm(msgArray[3]))
	                {
	                    globalCount = globalCount + 1;
                        return true;
                    }
                    else
                    {
                        MM_showHideLayers('purchaseMask','','hide');
                        return false;
                    }    
                }
            }                
		}
	}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}