
	function autoBlur(){ 
		if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") 
		document.body.focus(); 
	} 
	document.onfocusin=autoBlur;  
	
	function tmt_winLaunch(theURL,winName,targetName,features) { 
eval(winName+"=window.open('"+theURL+"','"+targetName+"','"+features+"')")
}

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;
}

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];}}
}

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_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];}
}
//mungk
function MM_showHideLayers() { //v3.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; 
                    } 
} 


// ?????? ?????? ???????? ???? 
var isDOM = (document.getElementById ? true : false);
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
var isNS = navigator.appName == "Netscape";

function getRef(id) {
	if (isDOM) return document.getElementById(id);
	if (isIE4) return document.all[id];
	if (isNS4) return document.layers[id];
}

function getSty(id) {
	x = getRef(id);
	return (isNS4 ? getRef(id) : getRef(id).style);
}

var scrollerHeight = 88;
var puaseBetweenImages = 3000;
var imageIdx = 0;

function moveRightEdge() {
	var yMenuFrom, yMenuTo, yOffset, timeoutNextCheck;

	if (isNS4) {
		yMenuFrom   = divMenu.top;
		yMenuTo     = windows.pageYOffset + 430;   // ???? ????
	} else if (isDOM) {
		yMenuFrom   = parseInt (divMenu.style.top, 10);
		yMenuTo     = (isNS ? window.pageYOffset : document.body.scrollTop) + 430; // ???? ????
	}
	timeoutNextCheck = 500;

	if (yMenuFrom != yMenuTo) {
		yOffset = Math.ceil(Math.abs(yMenuTo - yMenuFrom) / 20);
		if (yMenuTo < yMenuFrom)
			yOffset = -yOffset;
		if (isNS4)
			divMenu.top += yOffset;
		else if (isDOM)
			divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;
			timeoutNextCheck = 10;
	}
	setTimeout ("moveRightEdge()", timeoutNextCheck);
}


function checkEmail(it)
{
	var atpos = 0 ;
	var validFieldValue = it.value ;
	if (validFieldValue.indexOf("@", 0) < 2 || validFieldValue.indexOf(".", 0) < 2 || validFieldValue.length < 5 ) {
		return true;
	}
	return false;
}
/**
	µÎ ÅØ½ºÆ® ÆûÀÇ °ªÀÌ °°Àº°¡?
	»ç¿ë¹ý : if ( VC_SameText(f.M_PWD, f.M_PWD2) ) { return; }
 */
 
var VC_SameText = function(obj1, obj2) 
{
	if ( obj1.value == obj2.value ) {
		return true;
	} else {
		return false;
	}
}

// ?????? ?????? ?????? ??????
function popupWindow(mypage, myname, w, h, theFeats)  // Centering a window
{
	var winl = (screen.width - w) / 2; 
	var wint = (screen.height - h) / 2; 
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+','+theFeats;
	win = window.open(mypage, myname, winprops);
	if (parseInt(navigator.appVersion) >= 4) {
		win.window.focus();
	}
}

function autoFocus(src, dst) {
	if (src.getAttribute&&src.value.length==src.getAttribute("maxlength"))
		dst.focus();
}

// ?????? ????????
function showImage( name )
{
	theFeats =   "location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,width=100, height=100,left=0,top=0";
	window.open('/comm/image_viewer.jsp?src='+name, "imageviewer", theFeats);
}    

// ???????? ???????? ????
function GetLength(str)
{
	var temp;
	var mycount;
	mycount = 0;
	len = str.length;
	
	for(k = 0;k < len; k++)
	{
		temp = str.charAt(k);
		
		//???????? escape?? ???? ?? ?????? ?????? 4???? ???? ?????????? 2?? ??????. 
		if(escape(temp).length > 4)
			mycount += 2;
		else
			mycount++;
	}
	return mycount;
}

// ???????? ????
function isEmpty( data )
{
   for ( var i = 0 ; i < data.length ; i++ )
   {
      if ( data.substring( i, i+1 ) != " " )
         return false;
   }
   return true;
}

// radio???? ????????
function findSelected( data )
{   	
   for ( var i = 0 ; i < data.length ; i++ )
   {
      if ( data[i].checked == true )
         return true;     
   }
   return false;
}
function CheckJumin( jumin1, jumin2 )
{
   var jumin = jumin1 + jumin2;

   j1 = jumin.substring(0,1) * 1;
   j2 = jumin.substring(1,2) * 1;
   j3 = jumin.substring(2,3) * 1;
   j4 = jumin.substring(3,4) * 1;
   j5 = jumin.substring(4,5) * 1;
   j6 = jumin.substring(5,6) * 1;
   j7 = jumin.substring(6,7) * 1;
   j8 = jumin.substring(7,8) * 1;
   j9 = jumin.substring(8,9) * 1;
   j10 = jumin.substring(9,10) * 1;
   j11 = jumin.substring(10,11) * 1;
   j12 = jumin.substring(11,12) * 1;
   j13 = jumin.substring(12,13) * 1;

   tot = (j1 * 2) + (j2 * 3) + (j3 * 4) + (j4 * 5) + (j5 * 6) + (j6 * 7) + (j7 * 8) + (j8 * 9) + (j9 * 2) + (j10 * 3) + (j11 * 4) + (j12 * 5);
   tot_end = (tot % 11) + j13

   if ( !( tot_end == 1 || tot_end == 11) )
   {
       return false;
   }
   else
   {
       return true;
   }
}

// ???????? ????
function isHangul(testValue)
{
    var testValue2=testValue.toLowerCase();

    for(i=0;i<testValue2.length;i++)
    {
        if( (testValue2.charCodeAt(i)>=33 && testValue2.charCodeAt(i)<=64) ||
         (testValue2.charCodeAt(i)>=91 && testValue2.charCodeAt(i)<=126) )
        {
            return false;
        }
    }
    return true;
}

/********************************************
 *  ???????? byte ?????? ????????.
 *******************************************/
function cal_byte(aquery)
{
       var tmpStr;
       var temp=0;
       var onechar;
       var tcount;
       tcount = 0;

       tmpStr = new String(aquery);
       temp = tmpStr.length;

       for (k=0;k<temp;k++)
       {
            onechar = tmpStr.charAt(k);

            if (escape(onechar).length > 4) {
                 tcount += 2;
            }
            else if (onechar!='\r') {
                 tcount++;
            }
       }

       return tcount;
}

// ?????????? ???????? ?????????? ????
function countStr(all_str, cnt_str)
{
	var ncount = 0;
	
	for (nIndex = 0; nIndex < all_str.length; nIndex++){
		if (all_str.charAt(nIndex) == cnt_str){
			ncount = ncount + 1;			
		}
	}
	
	return ncount;
}

var sp_char = " !@#$%^&*()+|/;:,.?`~{}[]"; 	 
var alpha = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
var digit ='1234567890';
var under = '_';
var gamma = 'abcdefghijklmnopqrstuvwxyz';
	
// ?????? ???????? ????
function isIdStr(id)
{	
	var astr = gamma + digit;
	
	for(i=0; i<id.length; i++)
	{
		if(astr.indexOf(id.substring(i, i+1)) < 0)
		{	
			return false;
		}//if
	}//for
	
	return true;
}

// ???????? ????
function isAlphabet(testValue)
{
	for(i=0; i<testValue.length; i++)
	{
		if(alpha.indexOf(testValue.substring(i, i+1)) < 0)
		{	
			return false;
		}//if	
	}	
	
	return true;
}

// ?????????? ????
function isNumber(testValue)
{
	for(i=0; i<testValue.length; i++)
	{
		if(digit.indexOf(testValue.substring(i, i+1)) < 0)
		{	
			return false;
		}//if	
	}	
	
    return true;
}

// ????/?????????? ????
function isNumberAlphabet(testValue)
{
	var astr = alpha + digit + under;
	
	for(i=0; i<testValue.length; i++)
	{
		if(astr.indexOf(testValue.substring(i, i+1)) < 0)
		{	
			return false;
		}//if	
	}	
	
    return true;
}


//???????? ????
function chkSpecialChar(testValue)
{
	for(i=0; i<testValue.length; i++)
	{
		if(sp_char.indexOf(testValue.substring(i, i+1)) >= 0)
		{	
			return true;
		}//if	
	}	
	
    return false;
}

//?????? ??????~
function selectEmail(form){
	if(form['email3'].value == "select" || form['email3'].value == "")
		{
		form['email2'].value = "";
		form['email2'].readOnly = false;
		form['email2'].style.background = "white";
		}else{
			form['email2'].value = form['email3'].value;
			form['email2'].readOnly = true;
			form['email2'].style.background = "#CFF5F0";
		}
}

//???????? ????
function isTelExchangeNum(number) {
     localNum = new Array("02","031","032","033","041","042","043","051","052","053","054","055","061","062","063","064","012","015","011","016","017","018","019","0502")

     for (i=0; i<localNum.length; i++)  // ???? ?? ???? ?????? ???????? ?????? ????
     {
        if (number == localNum[i]){
			return true;
		}
	 }

	 return false;
}


function getCookie( name ){
        var nameOfCookie = name + "=";
        var x = 0;
        while ( x <= document.cookie.length )
        {
                var y = (x+nameOfCookie.length);
                if ( document.cookie.substring( x, y ) == nameOfCookie ) {
                        if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
                                endOfCookie = document.cookie.length;
                        return unescape( document.cookie.substring( y, endOfCookie ) );
                }
                x = document.cookie.indexOf( " ", x ) + 1;
                if ( x == 0 )
                        break;
        }
        return "";
}

	// ?????? ???? ????
	var NUM = "0123456789";	
	var SALPHA = "abcdefghijklmnopqrstuvwxyz";
	var ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"+SALPHA;
	var EMAIL = "!#$%&*+-./=?@^_`{|}"+NUM+ALPHA;
	var PASSWORD = "!@.#,$%^*&_-" + ALPHA + NUM;
	var ERRORMSG = "";
	
	function CheckType(s,spc) {
		var i;
		for(i=0; i<s.length; i++) {
			if (spc.indexOf( s.substring(i, i+1)) < 0) {
				return false;
			}
		}	
		return true;
	}
	
	function CheckType(s,spc) {
		var i;
		for(i=0; i<s.length; i++) {
			if (spc.indexOf( s.substring(i, i+1)) < 0) {
				return false;
			}
		}
		
		return true;
	}
	
	
	function CheckEmail (sEmail) {
		if (!CheckType(sEmail, EMAIL)) {
			ERRORMSG = "???????? ?????? ?????? ????????.";
			return false;
		}
		
		if ( sEmail == "" ) {
			return true;
		}
	
		var a = sEmail.indexOf('@');
		var d1 = sEmail.indexOf('.@');
		var d2 = sEmail.indexOf('@.');
		if ( a <=0 || a == sEmail.length -1 || d1 >= 0 || d2 >= 0) {
			ERRORMSG = "???????? aaa@bbb.ccc ???? ?????? ?????????? ??????.";
			return false;
		}
		
		if(sEmail.indexOf(".", 0) == -1 ){
		
			ERRORMSG = "???????? aaa@bbb.ccc ???? ?????? ?????????? ??????.";
			return false;
		}
		
		if(sEmail.indexOf("@", 0) > 36 ){
		
			ERRORMSG = "???????? ???? ??????.";
			return false;
		}
		return true;
	}
	// ?????? ???? ??


function popup(path,w,h){
	if(getCookie(path) != "done"){
	       pop=window.open('/popup/'+path+'.htm', path, 'left=0, top=0, width='+w+' height='+h+', scrollbars=no');
	       pop.focus();	      
	}
}

function popuppos(path,w,h,left,top){
	if(getCookie(path) != "done"){
	       pop=window.open('/popup/'+path+'.htm', path, 'left='+left+', top='+top+', width='+w+' height='+h+', scrollbars=no');
	       pop.focus();	      
	}
}

function popupScroll(path,w,h){
	if(getCookie(path) != "done"){
	       pop=window.open('/popup/'+path+'.htm', path, 'left=0, top=0, width='+w+' height='+h+', scrollbars=no resizable=no');
	       pop.focus();	      
	}
}

	//?????? 
	function Show(divid) {divid.filters.blendTrans.apply();divid.style.visibility = "visible";divid.filters.blendTrans.play();}
	function Hide(divid) {divid.filters.blendTrans.apply();divid.style.visibility = "hidden";divid.filters.blendTrans.play(); } 
	function Hide1(divid) {
		divid.filters.blendTrans.apply();
		divid.style.visibility = "hidden";
		divid.filters.blendTrans.play();
		if(!pop.closed){
			pop.focus();
		}
	} 
	
	function layerView(path,layername){
		if(getCookie(path) != "done") {
			void(Show(layername));
		}
	}

function sms_phone(){
	var iMyWidth;
	var iMyHeight;
	iMyWidth = (window.screen.width/2) - (155 + 10); 
	iMyHeight = (window.screen.height/2) - (180 + 50);
	window.open('/exhaust/sms/sms_phone.jsp',"sms_phone","width=211, height=480, menubar=no, status=no, left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",scrollbars=no");		
}

	function comma(x) {
		var txtNumber = '' + x;

		var rxSplit = new RegExp('([0-9])([0-9][0-9][0-9][,.])');
		var arrNumber = txtNumber.split('.');
		arrNumber[0] += '.';
		do {
		arrNumber[0] = arrNumber[0].replace(rxSplit, '$1,$2');
		} while (rxSplit.test(arrNumber[0]));
		if (arrNumber.length > 1) {
		return arrNumber.join('');
		}
		else {
		return arrNumber[0].split('.')[0];
		}
	}


	
	
function diplayFlash(_objPath_, _width_, _height_)
	{
		var _object_ = "";
		
		_object_= '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + _width_ + '" height="' + _height_ + '">';
		_object_ += '<param name="movie" value="'+_objPath_+'">';
		_object_ += '<param name="quality" value="high">';
		_object_ += '<param name="wmode" value="transparent">';
		_object_ += '<embed src="'+_objPath_+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + _width_ + '" height="' + _height_ + '"></embed>';
		_object_ += '</object>';
		
		document.write(_object_);			
	}	

function diplayFlash_world(_objPath_, _width_, _height_)
	{
		var _object_ = "";
		
		_object_= '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + _width_ + '" height="' + _height_ + '">';
		_object_ += '<param name="movie" value="'+_objPath_+'">';
		_object_ += '<param name="quality" value="high">';		
		_object_ += '<embed src="'+_objPath_+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + _width_ + '" height="' + _height_ + '"></embed>';
		_object_ += '</object>';
		
		document.write(_object_);			
	}		
	
function go_charge(){
	window.open("/filling/lulucash/lulucash/cash_charge.jsp", "win1", "width=500, height=600");
}