
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�ڸ����� �޸� ����)�� ��8�� ��ȯ�մϴ�.
 */
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�ڸ���� ","ó�� ��f 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;
};



/**
 *  ���ڿ��� x���ϴ��� üũ�մϴ�. (���� ����)
 *  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;
}

/**
 *  ���ڿ�; Ưd ���ڿ�; ���� �迭������ ��8�� ��ȯ�մϴ�.
 */
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;
}

/**
 * ���ĺ���8�� ������ ���ڿ����� üũ�մϴ�.
 */
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;
}

/**
 * ���ڸ�8�� ������ ���ڿ����� üũ�մϴ�.
 */
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("dȮ�� �α׹�ȣ�� �Է��Ͻʽÿ�");
	}
 }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;
}
function scrolling(objId,sec1,sec2,speed,height){ 
	  this.objId=objId; 
	  this.sec1=sec1; 
	  this.sec2=sec2; 
	  this.speed=speed; 
	  this.height=height; 
	  this.h=0; 
	  this.div=document.getElementById(this.objId); 
	  this.htmltxt=this.div.innerHTML; 
	  this.div.innerHTML=this.htmltxt+this.htmltxt; 
	  this.div.isover=false; 
	  this.div.onmouseover=function(){this.isover=true;} 
	  this.div.onmouseout=function(){this.isover=false;} 
	  var self=this; 
	  this.div.scrollTop=0; 
	  window.setTimeout(function(){self.play()},this.sec1); 
	} 
	scrolling.prototype={ 
	  play:function(){ 
	    var self=this; 
	    if(!this.div.isover){ 
	      this.div.scrollTop+=this.speed; 
	      if(this.div.scrollTop>this.div.scrollHeight/2){ 
	        this.div.scrollTop=0; 
	      }else{ 
	        this.h+=this.speed; 
	        if(this.h>=this.height){ 
	          if(this.h>this.height|| this.div.scrollTop%this.height !=0){ 
	            this.div.scrollTop-=this.h%this.height; 
	          } 
	          this.h=0; 
	          window.setTimeout(function(){self.play()},this.sec1); 
	          return; 
	        } 
	      } 
	    } 
	    window.setTimeout(function(){self.play()},this.sec2); 
	  }, 
	  prev:function(){ 
	    if(this.div.scrollTop == 0) 
	    this.div.scrollTop = this.div.scrollHeight/2; 
	    this.div.scrollTop -= this.height; 
	  }, 
	  next:function(){ 
	    if(this.div.scrollTop ==  this.div.scrollHeight/2) 
	    this.div.scrollTop =0; 
	    this.div.scrollTop += this.height; 
	  } 
	}; 
	
	

