var var_img_enuri_com;
	String.prototype.trim = function() {
      return this.replace(/(^\s*)|(\s*$)|($\s*)/g, "");
   };

   String.prototype.isid = function() {
      if (this.search(/[^A-Za-z0-9_-]/) == -1)
         return true;
      else 
         return false;
   };

   String.prototype.isalpha = function() {
      if (this.search(/[^A-Za-z]/) == -1)
         return true;
      else
         return false;
   };

   String.prototype.isnumber = function() {
      if (this.search(/[^0-9]/) == -1)
         return true;
      else
         return false;
   };

   String.prototype.isemail = function() {
      var flag, md, pd, i;
      var str;

      if ( (md = this.indexOf("@")) < 0 )
         return false;
      else if ( md == 0 )
         return false;
      else if (this.substring(0, md).search(/[^.A-Za-z0-9_-]/) != -1)
         return false;
      else if ( (pd = this.indexOf(".")) < 0 )
         return false;
      else if ( (pd + 1 )== this.length || (pd - 1) == md )
         return false;
      else if (this.substring(md+1, this.length).search(/[^.A-Za-z0-9_-]/) != -1)
         return false;
      else
         return true;
   };

   String.prototype.korlen = function() {
      var temp;
      var k = 0;
      var mycount = 0;
      
      for( k = 0 ; k < this.length ; k++ ){
         temp = this.charAt(k);
      
         if( escape(temp).length > 4 ) {
            mycount += 2; 
         }
         else mycount++;
      }

      return mycount;
   };

   String.prototype.isssn = function() {
      
      var first  = new Array(6);
      var second = new Array(7);
      var total = 0;
      var tmp = 0;
      var i;
      
      if ( this.length != 13 )
         return false;
      else {
         for ( i = 1 ; i < 7 ; i++ )
            first[i] = this.substring(i - 1, i);
      
         for ( i = 1 ; i < 8 ; i++ )
            second[i] = this.substring(6 + i - 1, i + 6);
      
         for ( i = 1 ; i < 7 ; i++ ) {
            if ( i < 3 )
               tmp = Number( second[i] ) * ( i + 7 );
            else if ( i >= 3 )
               tmp = Number( second[i] ) * ( ( i + 9 ) % 10 );
         
            total = total + Number( first[i] ) * ( i + 1 ) + tmp;
         }
      
         if ( Number( second[7] ) != ((11 - ( total % 11 ) ) % 10 ) ) 
            return false;
      }
      return true;
   };

	String.prototype.ByteLength = function() {
		var i,ch;
		var strLength = this.length;
		var count = 0;

		for(i=0;i<strLength;i++)
		{
			ch = escape(this.charAt(i));

			if(ch.length > 4)
				count += 2;
			else if(ch!='\r') 
				count++;
		}
		return count;
	};
/**
 * ¹®ÀÚ¿­À» Çü½ÄÈ­(3ÀÚ¸®¸¶´Ù ÄÞ¸¶ »ðÀÔ)µÈ ½ÄÀ¸·Î ¹ÝÈ¯ÇÕ´Ï´Ù.
 */
String.prototype.NumberFormat = function() {
	var str = this.replace(/,/g,"");
	var strLength = str.length;

	if (strLength<=3) return str;
	
    var strOutput = "";
    var mod = 3 - (strLength % 3);
	var i;

    for (i=0; i<strLength; i++) 
	{
		strOutput+=str.charAt(i); 
        if (i < strLength - 1) 
		{
			mod++; 
            if ((mod % 3) == 0) 
			{ 
				strOutput +=","; 
                mod = 0; 
			}
		} 
	} 
	return strOutput;
};

/**
 * 3ÀÚ¸®¼ö¸¶´Ù ","Ã³¸® »èÁ¦ wookki25 2005-09-21
 */
String.prototype.DeNumberFormat = function() {
	var str = this.replace(/,/g,"");
	return str;
};

String.prototype.isKorean = function() {
	Unicode = this.charCodeAt(0);
	if ( !(44032 <= Unicode && Unicode <= 55203) )
		return false;
	else
		return true;
};

String.prototype.isEnglish = function() {
	if (this.search(/[^A-Za-z]/) == -1)
	   return true;
	else
	   return false;
};

String.prototype.lenH = function() {
   var temp;
   var k = 0;
   var mycount = 0;
      
   for( k = 0 ; k < this.length ; k++ ){
      temp = this.charAt(k);
      
      if( escape(temp).length > 4 ) {
         mycount += 2; 
      }
      else mycount++;
   }

   return mycount;
};

/**
 *  ¹®ÀÚ¿­¿¡¼­ Byte Len¸¸Å­ ¹®ÀÚ¿­ Àß¶ó¿Â´Ù.
 *  ex) var s = MidH("´ëÇÑ¹Î±¹¸¸¼¼123ABS",0,10);
 */
function MidH(str, n, len){
	//n : ½ÃÀÛÁ¡;
	//len : ByteLength; 
	var ret="";
	var tmp = str.substring(n, str.length);
	var s="";
	var j=0;
	var i=0;
	if(tmp.length>0){
		for(i=0; i< tmp.length; i++){
			if(j <= len){
				s = tmp.substring(i,i+1);
				if(s.lenH()==2){
					j = j+2;
				}else{
					j++;
				}
				ret = ret + s;
			}else{
				break;
			}
		}
	}
	return ret;
}

/**
 *  ¹®ÀÚ¿­ÀÌ Á¸ÀçÇÏ´ÂÁö Ã¼Å©ÇÕ´Ï´Ù. (º¹¼ö °¡´É)
 *  ex) StrMultiExists(id,"sysadmin","admin"...);
 */
function StrMultiExists(str)
{
	var i;
	var argCount = arguments.length;
	if (argCount==0) return false;
	var regStr = "";

	for(i=1; i<argCount; i++) {
		regStr+="("+arguments[i].replace(/([\^\\\$\*\+\?\.])/g,"\\$1")+")|";
	}

	if (str.search(eval("/"+regStr.replace(/\|$/g,"")+"/g"))==-1) return false;
	else return true;
}

/**
 *  ¹®ÀÚ¿­À» Æ¯Á¤ ¹®ÀÚ¿­À» ³ª´² ¹è¿­ÇüÅÂÀÇ °ªÀ¸·Î ¹ÝÈ¯ÇÕ´Ï´Ù.
 */
function StringTokenizer(str,separator) {
	arrayOfStrings = str.split(separator);
	return arrayOfStrings;
}



/**
 * ¿Ã¹Ù¸¥ ¸ÞÀÏÇü½ÄÀÎÁö Ã¼Å©ÇÕ´Ï´Ù.
 */
function isValidEmail(str) {
	var re=new RegExp("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$","gi");
	if (str.match(re)) return true;
	else return false;
}

/**
 * ¿Ã¹Ù¸¥ È¨ÆäÀÌÁöÇü½ÄÀÎÁö Ã¼Å©ÇÕ´Ï´Ù.
 */
function isValidHomepage(str) {
	var re=new RegExp("^((ht|f)tp:\/\/)((([a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3}))|(([0-9]{1,3}\.){3}([0-9]{1,3})))((\/|\\?)[a-z0-9~#%&'_\+=:\?\.-]*)*)$","gi");
	if (str.match(re)) return true;
	else return false;
}

/**
 * ¿Ã¹Ù¸¥ ÁÖ¹Îµî·Ï¹øÈ£ÀÎÁö Ã¼Å©ÇÕ´Ï´Ù.
 */
function IsResidentRegistrationNumber(str1, str2) {
	if (isNull(str1)) return false;
	if (isNull(str2)) return false;

	var Sum = 0;
	var i, j;

	for (i=0, j=2 ; i<=5 ;i++,j++)
	{
		Sum += parseInt(str1.charAt(i)) * j;
	}

	for (i=0, j=8;i<=5;i++, j++)
	{
		Sum += parseInt(str2.charAt(i)) * j;
		if (j==9) j=1;
	}

	if ((Sum=11-(Sum%11))>9) Sum=Sum%10;

	if (parseInt(str2.charAt(6)) != Sum) return false;
	return true;
}

/**
 * ¾ËÆÄºª¸¸À¸·Î ±¸¼ºµÈ ¹®ÀÚ¿­ÀÎÁö Ã¼Å©ÇÕ´Ï´Ù.
 */
function isAlphabet(str) {
	if (str.search(/[^a-zA-Z]/g)==-1) return true;
	else return false;
}

/**
 * ÇÑ±Û·Î¸¸ ±¸¼ºµÈ ¹®ÀÚ¿­ÀÎÁö Ã¼Å©ÇÕ´Ï´Ù.
 */
function isKorean(str) {
	var strLength = str.length;
	var i;
	var Unicode;

	for (i=0;i<strLength;i++) {
		Unicode = str.charCodeAt(i);
		if ( !(44032 <= Unicode && Unicode <= 55203) ) return false;	
	}
	return true;
}

/**
 * ¼ýÀÚ¸¸À¸·Î ±¸¼ºµÈ ¹®ÀÚ¿­ÀÎÁö Ã¼Å©ÇÕ´Ï´Ù.
 */
function isDigit(str) {
	if (str.search(/[^0-9]/g)==-1) return true;
	else return false;
}

/**
 * ¹®ÀÚ¿­ÀÌ NULLÀÎÁö Ã¼Å©ÇÕ´Ï´Ù.
 */
function isNull(str) {
    if (str == null || str == "") return true;
    else return false;
}

/**
 * ¹®ÀÚ¿­¿¡ ÇÑÄ­ÀÌ»óÀÇ ½ºÆäÀÌ½º ÀÔ·ÂÀÌ ÀÖ´ÂÁö¸¦ Ã¼Å©ÇÕ´Ï´Ù.
 */
function isValidSpace(str) {
	if (str.search(/[\s]{2,}/g)!=-1) return false;
	else return true;
}

/**
 * ÆË¾÷Ã¢ÀÇ À§Ä¡°ªÀ» ¸¶Áö¸·¿¡ ¹Þ¾Æ¼­ Ã¢À» ¶ç¿ó´Ï´Ù.
 */
function Main_OpenWindow(OpenFile,name,nWidth,nHeight,ScrollYesNo,ResizeYesNo,TPosition,LPosition)
{
	var newWin = window.open(OpenFile,name,"width="+nWidth+",height="+nHeight+",toolbar=no,directories=no,status=no,scrollbars="+ ScrollYesNo +",resizable="+ ResizeYesNo +",menubar=no,Top="+ TPosition +",left="+ LPosition);
	newWin.focus();
}

function GotoSDU_Login(sURL)
{
	var k = window.open(sURL,'WinSDULogin','width=450 height=330');
		k.focus();	
}

function SetUpdate()
{
  window.status=""; 
}


function islogin(){
	var cName = "LSTATUS";
	var s = document.cookie.indexOf(cName +'=');
	if (s != -1){
		s += cName.length + 1;
		e = document.cookie.indexOf(';',s);
		if (e == -1){
			e = document.cookie.length
		}
		if( unescape(document.cookie.substring(s,e))=="Y"){
			return true;
		}else{
			return false;
		}
	}else{
		return false;
	}
}

function CmdSetLog(lognum, logcate, logmodelno, logshopcode){ //ÇØ´ç·Î±×¹øÈ£¿¡ ´ëÇÑ ·Î±×³²±â±â
 try{
	var cName = "LOGNUM";
	var cCate = "LOGCATE";
	var cModelno = "LOGMODELNO";
	var cShopcode = "LOGSHOPCODE";
	var ispos = false;
	if( typeof(lognum)=="number"){
		ispos =true;
	}else if(typeof(lognum)=="string"){
		if( lognum.isnumber()==true){
			ispos =true;
		}
	}
	if(typeof(logcate)=="undefined" || logcate.isnumber()!=true){
		logcate="";
	}

	if( typeof(logmodelno)=="number"){
		
	}else if(typeof(logmodelno)=="string"){
		if( logmodelno.isnumber()!=true){
			logmodelno=0;
		}
	}else{
		logmodelno=0;
	}

	if( typeof(logshopcode)=="number"){
		
	}else if(typeof(logshopcode)=="string"){
		if( logshopcode.isnumber()!=true){
			logshopcode=0;
		}
	}else{
		logshopcode=0;
	}

	if(ispos==true){
		document.cookie = (String)(String)(cName + "=" + lognum + "; path=/;");
		document.cookie = (String)(String)(cCate + "=" + logcate+ "; path=/;");
		document.cookie = (String)(String)(cModelno + "=" + logmodelno + "; path=/;");
		document.cookie = (String)(String)(cShopcode + "=" + logshopcode + "; path=/;");
	}else{
		alert("Á¤È®ÇÑ ·Î±×¹øÈ£¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿À");
	}
 }catch(e){
  window.status="";
 }
}


function OpenWindow(OpenFile,name,nWidth,nHeight,ScrollYesNo,ResizeYesNo)
	{
		var newWin = window.open(OpenFile,name,"width="+nWidth+",height="+nHeight+",toolbar=no,directories=no,status=no,scrollbars="+ ScrollYesNo +",resizable="+ ResizeYesNo +",menubar=no");
		newWin.focus();
	}
	function OpenWindowYes(OpenFile,winname,nWidth,nHeight)
	{
		var newWin = window.open(OpenFile,winname,"width="+nWidth+",height="+nHeight+",toolbar=no,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
		newWin.focus();
	}
	function OpenWindowNo(OpenFile,winname,nWidth,nHeight)
	{
		var newWin = window.open(OpenFile,winname,"width="+nWidth+",height="+nHeight+",toolbar=no,directories=no,status=no,scrollbars=no,resizable=no,menubar=no");
		newWin.focus();
	}
	function OpenWindowPosition(OpenFile,name,nWidth,nHeight,ScrollYesNo,ResizeYesNo,lleft,ttop)
	{
		window.open(OpenFile,name,"width="+nWidth+",height="+nHeight+",left="+lleft+",top="+ttop+",toolbar=no,directories=no,status=no,scrollbars="+ ScrollYesNo +",resizable="+ ResizeYesNo +",menubar=no");
	}
	
	
function js_replace(str, oldStr, newStr)
{
	for(var i=0;i<str.length;i++)
	{
		if(str.substring(i, i+oldStr.length) == oldStr)
		{
			str = str.substring(0, i) + newStr + str.substring(i+oldStr.length, str.length)
		}
	}
	
	return str;
}

function reActionGif()
{

	try
	{

		if (document.getElementById("knowbox7_img") != null)
		{	
    		if (typeof(document.getElementById("knowbox7_img")) != "undefined")
    		{
    			document.getElementById("knowbox7_img").background="url("+var_img_enuri_com+"/knowbox/btnGoKnowbox7.gif)";
    		}
    	}
	
		if (document.getElementById("re_img_2") != null)
		{	
    		if (typeof(document.getElementById("re_img_2")) != "undefined")
    		{
    			document.getElementById("re_img_2").src = var_img_enuri_com  + "/images/front/menu_051209/14.gif";	
    		}
    	}
		if (document.getElementById("re_img_3") != null)
		{
    		if (typeof(document.getElementById("re_img_3")) != "undefined")
    		{
    			document.getElementById("re_img_3").src = var_img_enuri_com  + "/images/button/button_best.gif";	
    		}
    	}
		if (document.getElementById("re_img_4") != null)
		{
    		if (typeof(document.getElementById("re_img_4")) != "undefined")
    		{
    			document.getElementById("re_img_4").src = var_img_enuri_com  + "/images/view/openexpect_small_200501.gif";	
    		}
    	}    
		if (document.frames("IFrameMyFavoriteList").document.getElementById("UpdateBtn") != null)
		{
    		if (typeof(document.frames("IFrameMyFavoriteList").document.getElementById("UpdateBtn")) != "undefined")
    		{
    			document.frames("IFrameMyFavoriteList").document.getElementById("UpdateBtn").src = var_img_enuri_com  + "/images/view/bt_myfavoritegolist.gif	";	
    		}
    	}        	
		if (document.getElementById("re_img_7") != null)
		{
    		if (typeof(document.getElementById("re_img_7")) != "undefined")
    		{
    			document.getElementById("re_img_7").src = var_img_enuri_com  + "/images/front/bt_term.gif";	
    		}
    	}        	
    		
    	
    }
    catch(e)
    {
    	
    }
   
		
}
function getAbsoluteLeft(objectId) {
	// Get an object left position from the upper left viewport corner
	// Tested with relative and nested objects
	o = document.getElementById(objectId);
	oLeft = o.offsetLeft;            // Get left position from the parent object
	while(o.offsetParent!=null) {   // Parse the parent hierarchy up to the document element
		oParent = o.offsetParent;   // Get parent object reference
		oLeft += oParent.offsetLeft; // Add parent left position
		o = oParent;
	}
	// Return left postion
	return oLeft;
}

function getAbsoluteTop(objectId) {
	// Get an object top position from the upper left viewport corner
	// Tested with relative and nested objects
	o = document.getElementById(objectId);
	oTop = o.offsetTop;            // Get top position from the parent object
	while(o.offsetParent!=null) { // Parse the parent hierarchy up to the document element
		oParent = o.offsetParent;  // Get parent object reference
		oTop += oParent.offsetTop; // Add parent top position
		o = oParent;
	}
	// Return top position
	return oTop;
}
function getFlashObjectHeight(objectId) {
	o = document.getElementById(objectId);
	oHeight = o.height;
	return oHeight;
}
function getFlashObjectWidth(objectId) {
	o = document.getElementById(objectId);
	oWidth = o.width;
	return oWidth;
}
