<!-- Begin to hide script contents from old browsers.
var appVersionLower = navigator.appVersion.toLowerCase();
var iePos = appVersionLower.indexOf('msie');
if( iePos != -1 ) {
    versionMinor = parseFloat( appVersionLower.substring(iePos+5, appVersionLower.indexOf(';',iePos)) );
    versionMajor = parseInt( versionMinor );
} else {
	versionMajor = parseInt( navigator.appVersion );
	versionMinor = parseFloat( navigator.appVersion );
}
var NS   = (navigator.appName == "Netscape") ? (true) : (false);
var NS4  = (NS && (versionMajor >= 4)) ? (true) : (false);
var IE   = (navigator.appName == "Microsoft Internet Explorer") ? (true) : (false);
var IE4  = (IE && (versionMajor >= 4)) ? (true) : (false);
var IE5  = (document.all && document.getElementById) ? true : false;
var IE55 = (IE && versionMinor >= 5.5);
var MAC  = navigator.appVersion.indexOf("Macintosh") != -1;

function ap_setenvchr( keynm, value )
{
    eval( keynm + " = \"" + value + "\";" );
}

function ap_setenvnum( keynm, value )
{
    eval( keynm + " = " + value + ";" );
}

function ap_getenv( keynm ) 
{
	if( eval(keynm) )
		return eval(keynm);
	return "";
}

function ap_addelement(objarray, obj) 
{
	var size = objarray.length;
	objarray[size] = obj;
}

function ap_removeelement(objarray, obj) 
{
	var size = objarray.length;
	var i, j;
	for( i = 0; i < size; i++ ) {
		if( objarray[i] == obj ) {
			delete objarray[i];
			break;
		}
	}
	if( i == size )
		return false;
	for( j = i; j < size-1; j++ )
		objarray[j] = objarray[j+1];
	objarray.length = size-1;
	return true;
}

function ap_point( x, y )
{
	this.a_x = x;
	this.a_y = y;
}
	
function ap_queue(qnm, qmax) 
{
	this.Q_name = qnm;
	this.Q_head = 0;
	this.Q_tail = 0;
	this.Q_size = 0;
	this.Q_max = qmax + 1;
	this.Q_content = new Array(qmax + 1);
}

function ap_enqueue( que, obj ) 
{
	var Target = ((que.Q_tail + 1) % que.Q_max);
	
	if (que.Q_head == Target) {
		return false;
	} else {
		delete que.Q_content[Target];
		que.Q_content[Target] = obj;
		que.Q_tail = Target;
		que.Q_size++;
		return true;
	}
}

function ap_enqueue_rounded( que, obj ) 
{
	var Target = ((que.Q_tail + 1) % que.Q_max);
	
	if (que.Q_head == Target) {
		Target = ((que.Q_head + 1) % que.Q_max);
		
		delete que.Q_content[Target];
		que.Q_head = Target;
		que.Q_size--;
	}

	Target = ((que.Q_tail + 1) % que.Q_max);
	delete que.Q_content[Target];
	que.Q_content[Target] = obj;
	que.Q_tail = Target;
	que.Q_size++;
	return true;
}

function ap_dequeue( que ) 
{
	if (que.Q_tail == que.Q_head) {
		return null;
	}
	else {
		var Target = ((que.Q_head + 1) % que.Q_max);
		var obj;

		obj = que.Q_content[Target];
		que.Q_head = Target;
		que.Q_size--;
		return obj;
	}
}

function ap_peekqueue(que, idx) 
{
	var TempIdx = 0;
	
	if(!idx || idx > que.Q_size)
		TempIdx = 0;
	else
		TempIdx = idx;
		
	if (que.Q_tail == que.Q_head) 
		return null;
	else 
		return que.Q_content[((que.Q_head + 1 + idx) % que.Q_max)];
}

function ap_getqueuesize( que ) 
{
	return que.Q_size;
}

function ap_debugqueue( que ) 
{
	for( var each_property in que ) {
		alert(each_property + "=" + que[each_property]);
	}
}

function ap_getlyr( lyrnm ) 
{
    var obj = null;
	if( NS4 ) obj = document.layers[lyrnm];
	else if( IE4 ) obj = document.all[lyrnm].style;
	return( obj );
}

function ap_movelyr( lyrnm, xpos, ypos ) 
{
	var x = Number( xpos );
	var y = Number( ypos );
	if( isNaN(x) ) x = 0;
	if( isNaN(y) ) y = 0;
	var obj = ap_getlyr( lyrnm );
	if( NS4 ) {
	    obj.left = x; 
	    obj.top = y; 
	} else if( IE4 ) {
	    obj.pixelLeft = x;
	    obj.pixelTop  = y;
	}
}

function ap_showlyr( lyrnm, enable ) 
{
	var obj = ap_getlyr( lyrnm );
    if( enable ) {
        if( NS4 ) 
            obj.visibility = "show"; 
        else if( IE4 ) 
            obj.visibility = "visible"; 
    } else {
        if( NS4 ) 
            obj.visibility = "hide"; 
        else if( IE4 ) 
            obj.visibility = "hidden"; 
    }
}

function ap_getlyrw( lyrnm ) 
{
    var w = 0;
    if( NS4 ) {
	    w = document.layers[lyrnm].clip.width;
	} else if( IE4 ) {
	    w = document.all[lyrnm].scrollWidth;
	}
	return( w );
}

function ap_getlyrh( lyrnm ) 
{
    var h = 0;
    if( NS4 ) {
	    h = document.layers[lyrnm].clip.height;
	} else if( IE4 ) {
	    h = document.all[lyrnm].scrollHeight;
	}
	return( h );
}

function ap_keeplyrinwindow( lyrnm ) 
{
    var obj = ap_getlyr( lyrnm );
	var objw = ap_getlyrw( lyrnm );
	var objh = ap_getlyrh( lyrnm );

	scrbarwidth = 20;
	bscrbarwidth = scrbarwidth;
	rscrbarwidth = scrbarwidth;
	if( NS4 ) {
		winright = (window.pageXOffset + window.innerWidth) - rscrbarwidth;
		rightpos = obj.left + objw;
		if( rightpos > winright ) {
			dif = rightpos - winright;
			obj.left -= dif;
		}
		winbot = (window.pageYOffset + window.innerHeight) - bscrbarwidth ;
		botpos = obj.top + objh;
		if( botpos > winbot ) {
			dif = botpos - winbot;
			obj.top -= dif;
		}
		winleft = window.pageXOffset;
		leftpos = obj.left;
		if( leftpos < winleft )
			obj.left = 5;
	} else {
    	winright = (window.document.body.scrollLeft + window.document.body.clientWidth) - rscrbarwidth;
		rightpos = obj.pixelLeft + objw;
		if( rightpos > winright ) {
			dif = rightpos - winright;
			obj.pixelLeft -= dif;
		}
		winbot = (window.document.body.scrollTop + window.document.body.clientHeight) - bscrbarwidth;
		botpos = obj.pixelTop + objh;
		if( botpos > winbot ) {
			dif = botpos - winbot;
			obj.pixelTop -= dif;
		}
		winleft = window.document.body.scrollLeft;
		leftpos = obj.pixelLeft;
		if( leftpos < winleft )
			obj.pixelLeft = 5;
	}
}

function ap_setlyrz( lyrnm, zindex ) {
	if( IE4 ) {
	    document.all[lyrnm].style.zIndex = zindex;
	}
}

function ap_setlyrtag( lyrnm, tags )
{
	if( IE4 ) {
		if( IE5 ) { //innerHTML for IE5 over only
		    document.all[lyrnm].innerHTML = tags;
		}
	} else if( NS4 ) {
		document.layers[lyrnm].document.write(tags);
		document.layers[lyrnm].document.close();
	}
}

function ap_addlyrtag( lyrnm, tags )
{
	if( IE4 ) {
		document.all[lyrnm].innerHTML += tags;
	} else if( NS4 ) {
		document.layers[lyrnm].document.write(tags);
		document.layers[lyrnm].document.close();
	}
}

function ap_clrlyrtag( lyrnm )
{
	if( IE4 ) {
		document.all[lyrnm].innerHTML = "";
	} else if( NS ) {
		document.layers[lyrnm].document.open();
		document.layers[lyrnm].document.close();
	}
}

function ap_settbltag( tblnm, rowidx, cellidx, tags ) 
{
	if( !IE4 ) return;

	var obj = document.all[tblnm];
	if( isNaN(rowidx) || isNaN(cellidx) ) return;
	if( rowidx < 0 || cellidx < 0 ) return;
	if( obj.rows.length <= rowidx ) return;
	if( obj.rows(rowidx).cells.length <= cellidx ) return;

	obj.rows(rowidx).cells(cellidx).innerHTML = tags;
}

function ap_addtbltag( tblnm, rowidx, cellidx, tags ) 
{
	if( !IE4 ) return;

	var obj = document.all[tblnm];
	if( isNaN(rowidx) || isNaN(cellidx) ) return;
    if( rowidx < 0 || cellidx < 0 ) return;
	if( obj.rows.length <= rowidx ) return;
	if( obj.rows(rowidx).cells.length <= cellidx ) return;

	obj.rows(rowidx).cells(cellidx).innerHTML += tags;
}

function ap_getwinx( winobj ) 
{
	var x = winobj.screenLeft;
	if( winobj != self )
	    x -= 4; //4 is the width of the left bar
	return( x );
}

function ap_getwiny( winobj ) 
{
	var y = winobj.screenTop;
	if( winobj != self ) 
	    y -= 23; //23 is the height of the window title
	return( y );
}

function ap_getwinw( winobj ) 
{
	var w;
    if( NS ) {
    	w = winobj.innerWidth;
    } else {
    	w = winobj.document.body.clientWidth;
    	if( winobj != self )
    	    w += 12; 
    }
    return( w );
}

function ap_getwinh( winobj ) 
{
	var h;
    if( NS ) { 
    	h = winobj.innerHeight;
    } else {
    	h = winobj.document.body.clientHeight;
    	if( winobj != self )
    	    h += (23 + 8);
    }
    return( h );
}

function ap_movewincenter( winobj ) 
{
    var thisw = ap_getwinw( winobj );
    var thish = ap_getwinh( winobj );
	var left = (window.screen.availWidth - thisw) / 2;
	var top = (window.screen.availHeight - thish) / 2;
	if( left < 0 ) left = 0;
	if( top < 0 ) top = 0;
	winobj.moveTo( left, top );
	return( true );
}

function ap_adjustwinh( basewin, adjusttagnm, preferredh, resizable, scrollable, status ) 
{
    basewin.focus();
    if( !IE4 ) 
        return;
    if( !eval("document.images." + adjusttagnm) ) 
        return;
    w = ap_getwinw( basewin );
    h = ap_getwinh( basewin );
    y = eval( "document.images." + adjusttagnm + ".offsetTop" );
    if( h == y ) 
        return;
    neww = w + 10;
    if( resizable == true ) neww += (16+2);
    if( scrollable == true ) neww += (16);
    if( status == true ) neww += 0;
    newh = y + 61;
    if( resizable == true ) newh += 2;
    if( scrollable == true ) newh += 0;
    if( status == true ) newh += 0;
    if( newh >= window.screen.availHeight )
        newh = Math.min( newh, h );
    if( preferredh > 0 ) newh = Math.min( preferredh, newh );
    self.window.resizeTo( neww, newh );
}

function ap_adjustwinh_ml( basewin, adjusttagnm, preferredh, resizable, scrollable, status, plusy ) 
{
    basewin.focus();
    if( !IE4 ) 
        return;
    if( !eval("document.images." + adjusttagnm) ) 
        return;
    w = ap_getwinw( basewin );
    h = ap_getwinh( basewin );
    y = eval( "document.images." + adjusttagnm + ".offsetTop" );
    if( h == y ) 
        return;
    neww = w + 10;
    if( resizable == true ) neww += (16+2);
    if( scrollable == true ) neww += (16);
    if( status == true ) neww += 0;
    newh = y + plusy;
    if( resizable == true ) newh += 2;
    if( scrollable == true ) newh += 0;
    if( status == true ) newh += 0;
    if( newh >= window.screen.availHeight )
        newh = Math.min( newh, h );
    if( preferredh > 0 ) newh = Math.min( preferredh, newh );
    self.window.resizeTo( neww, newh );
}

function ap_getwinparam( winw, winh, adjust, resizable, scrollable, status ) 
{
    var left, top;
    switch( adjust ) {
	case 1: //top left aligned
		left = top = 0;
		break;
	case 2: //top right aligned
		left = window.screen.availWidth - winw;
		top = 0;
		break;
	case 3: //centered
		left = (window.screen.availWidth - winw) / 2;
		top = (window.screen.availHeight - winh) / 2;
		break;
	case 4: //bottom left aligned
		left = 0;
		top = window.screen.availHeight - winh;
		break;
	case 5: //bottom right aligned
		left = window.screen.availWidth - winw - 8;
		top = window.screen.availHeight - winh;
		break;
    }
    var option = "";
    if( adjust > 0 ) option = "left=" + left + ",top=" + top;
    option = option + ",width=" + winw + ",height=" + winh;
    if( (!resizable) || (resizable == false) ) 
        option += ",resizable=no";
    else 
        option += ",resizable=yes";
    if( (!scrollable) || (scrollable == false) ) 
        option += ",scrollbars=no";
    else
        option += ",scrollbars=yes";
    if( (!status) || (status == false) ) 
        option += ",status=no";
    else
        option += ",status=yes";
    param = "toolbar=no," + option + ",directories=no,menubar=no";
    return( param );
}

function ap_openwin( winurl, winnm, winw, winh, adjust, resizable, scrollable, status ) 
{
	var param = ap_getwinparam( winw, winh, adjust, resizable, scrollable, status );
    newwin = window.open( winurl, winnm, param );
    return( newwin );
}

function ap_openwinright( basewin, winurl, winnm, winw, winh, resizable, scrollable, status )
{
    var thisx = ap_getwinx( basewin );
    var thisy = ap_getwiny( basewin );
    var thisw = ap_getwinw( basewin );
    var thish = ap_getwinh( basewin );
    var left = thisx + thisw;
    if( left >= window.screen.availWidth )
        left = window.screen.availWidth - winw;
    var top = thisy;
    if( top < 0 ) top = 0;

    var option = "";
    option = "left=" + left + ",top=" + top;
    option = option + ",width=" + winw + ",height=" + winh;
    if( (!resizable) || (resizable == false) ) 
        option += ",resizable=no";
    else 
        option += ",resizable=yes";
    if( (!scrollable) || (scrollable == false) ) 
        option += ",scrollbars=no";
    else
        option += ",scrollbars=yes";
    if( (!status) || (status == false) ) 
        option += ",status=no";
    else
        option += ",status=yes";
    param = "toolbar=no," + option + ",directories=no,menubar=no";
    newwin = window.open( winurl, winnm, param );
    return( newwin );
}


function ap_isframe( frmidx, frmnm ) 
{
	var frm = self.parent;
	if( (typeof(frm) == "object") && // Á¸ÀçÇÏ°í...
		(typeof(frm.name) == "string") && // Á¢±Ù±ÇÇÑÀÌ ÀÖ°í...
		(frm.frames.length >= 2) &&
		(typeof(frm.frames[frmidx]) == "object") && // Á¸ÀçÇÏ°í...
		(typeof(frm.frames[frmidx].name) == "string" ) && // Á¢±Ù±ÇÇÑÀÌ ÀÖ°í...
		(frm.frames[frmidx].name == frmnm) ) // ÀÌ¸§±îÁö ¸ÂÀ¸¸é...
		return true;
	return false;
}


function static_hookframe(url, target) {
	return window.open(url, target, "width=330,height=225,top=1,left=1,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=no,toolbar=no,location=no");
}

function ap_findframebyhook( frmnm )
{
	var cur = self;
	var frmobj = null;
	var Ukey = getArrCookie("u", "userkey");
	
	// ÀÌ ºÎºÐÀ» ¼öÁ¤ÇØ¾ß ÇÑ´Ù. ÇÏµå ÄÚµùµÈ ÁÖ¼Ò...
	//frmobj = static_hookframe("http://chat.entica.com/sh/fishhook.asp", Ukey);
	frmobj = static_hookframe("http://www.entica.com/session/sh/fishhook.asp", Ukey);

	// ¿ÀÇÁ³Ê°¡ ¼¿ÇÁ¶ó¸é »õ·Î ¿­¸°°ÍÀÌ¹Ç·Î ½ÇÆÐ!
	if (frmobj.opener == self ) 
		return null;

			
  	// ±×·¸Áö ¾Ê´Ù¸é ¿ì¸®°¡ ¿øÇÏ´Â ÀÌ¸§°ú ÀÌ¿ôÀÎ°¡¸¦ °Ë»ç
	if (eval("typeof frmobj.parent." + frmnm + "== 'object'" )) 
		if (eval("typeof frmobj.parent." + frmnm + ".name == 'string'" )) 
			return eval("frmobj.parent." + frmnm);
				
	return null;
}


function ap_findframe( frmnm )
{
	var cur = self;
	var frmobj = null;
	do {
		frmobj = static_findframefrom( cur, frmnm );
		if( frmobj != null ) 
			break;
		if( cur.top.opener == null )
		    break;
		if( (typeof(cur.top.opener.name) == "unknown") ||
		    (typeof(cur.top.opener.name) == "undefined") )
		    break;
		cur = cur.top.opener;
	} while( (cur != null) && (typeof(cur) != "unknown") && (typeof(cur) != "undefined") )
	if (frmobj == null)
		return ap_findframebyhook( frmnm )
	else
		return frmobj;
}


function static_findframefrom( from, frmnm ) 
{
	var i, cur = from;
	if( (typeof(cur.name) != "unknown") &&
	    (typeof(cur.name) != "undefined") && 
	    (cur.name == frmnm) )
		return cur;
	while( (typeof(cur) != "unknown") && (typeof(cur) != "undefined") ) {
		for( i = 0; i < cur.frames.length; i++ ) {
			if( (typeof(cur.frames[i].name) != "unknown") && 
			    (typeof(cur.frames[i].name) != "undefined") && 
			    (cur.frames[i].name == frmnm) )
    			return cur.frames[i];
	    }
		if( cur == from.top )
			return null;
		cur = cur.parent;
	}
	return null;
}

function ap_definequerystring( tmpargv ) 
{
	var argv = tmpargv;
	var argkey, argval, defined = "";
	while( argv.indexOf('=') != -1 ) {
		argkey = argv.substring( 0, argv.indexOf('=') );
		argv = argv.substring( argv.indexOf('=')+1 );
		if( argv.indexOf('&') != -1 ) {
			argval = unescape( argv.substring(0, argv.indexOf('&')) );
			argv = argv.substring( argv.indexOf('&')+1 );
		} else {
			argval = unescape( argv );
		}
		if( isNaN(argval) )
			argval = "'" + argval + "'";
		else
			argval = Number(argval);
		defined += ("var " + argkey + "=" + argval + ";");
	}
	return defined;
}

function ap_querystring( argv, keynm ) 
{
	var tmp;
    if( argv == null ) return( "" );
	argv = argv.substr( argv.indexOf('?')+1 );
	if( argv.indexOf( '=' ) == -1 )
		return "";
	if( argv.indexOf(keynm) == -1 )
		return "";
	tmp = argv.substr( argv.indexOf(keynm) + keynm.length + 1 );
	if( tmp.indexOf('&') == -1 )
		return unescape(tmp);
	tmp = tmp.substr(0, tmp.indexOf('&'));
	return unescape(tmp);
}

function ap_random( len ) 
{
	var tmp, dt = new Date();
	if( len == null ) len = 10;
	tmp = (dt.getHours()+1) * (dt.getSeconds()+1) * Math.random() * Math.random() * 1000000000000;
	dt = null;
	tmp = tmp + "dummy";
	tmp = tmp.substring(0, tmp.indexOf("."));
	tmp = tmp.substring(0, len);
	return tmp;
}

function ap_escape( str ) 
{
	var dec = escape( str );
	var idx, chr, ret = "";
	if( NS ) return dec;
	for( idx = 0; idx < dec.length; idx ++ ) {
		if( dec.charAt( idx ) == '%' && dec.charAt( idx + 1) != 'u' )
			ret = ret + "%u00";
		else
			ret = ret + dec.charAt(idx);
	}
	return ret;
}

function ap_strlen( thisvalue, specialset ) 
{
    var byte1count = 0, byte2count = 0;
    for( var i = 0; i < thisvalue.length; i++ ) {
        thischar = thisvalue.charAt( i );
        if( ((thischar >= '0') && (thischar <= '9')) ||
            ((thischar >= 'A') && (thischar <= 'Z')) ||
            ((thischar >= 'a') && (thischar <= 'z')) ||
            ((thischar == '-') || (thischar == '_')) )
            byte1count++;
        else if( thischar == '(' || thischar == ')' ) {
        	byte1count++;
        }
        else if( specialset != null && specialset.indexOf(thischar) != -1 )
            byte1count++;
        else
            byte2count++;
    }
    return( byte1count + byte2count * 2 );
}

function ap_nicklen( nickid ) 
{
	var nbytes = 0;
	var bytestr = "" + nickid, escapedchr = "";
	for( var i = 0; i < bytestr.length; i++ ) {
		escapedchr = escape( bytestr.charAt(i) );
		nbytes++;
		if( escapedchr.length > 4 ) {
			nbytes++;
		}
	}
	return nbytes;
}

function static_isnothing( ctrl ) 
{
    var thisvalue = ctrl.value;
    if( thisvalue.length == 0 ) {
        alert( "°ªÀÌ ¹Ýµå½Ã ÀÖ¾î¾ß ÇÏ´Â Ç×¸ñÀÌ ºñ¾î ÀÖ½À´Ï´Ù." );
        ctrl.focus();
        return( true ); 
    }
    spacecount = 0;
    for( var i = 0; i < thisvalue.length; i++ ) {
        thischar = thisvalue.charAt( i );
        if( thischar == ' ' ) spacecount++;
    }
    if( spacecount == thisvalue.length ) {
	    alert( "°ªÀÌ ¹Ýµå½Ã ÀÖ¾î¾ß ÇÏ´Â Ç×¸ñÀÌ ºñ¾î ÀÖ½À´Ï´Ù." );
        ctrl.focus();
	    return( true ); 
	}
	return( false );
}

function static_isnumeric( ctrl ) 
{
    var charDetected = 0, markDetected = 0, dotCount = 0;
    var numeric = ctrl.value;
    if( numeric == null || numeric == "" || numeric.length == 0 ) {
        return( false );
    }
    for( var i = 0; i < numeric.length; i++ ) {
      thischar = numeric.charAt( i );
      if( !((thischar >= '0') && (thischar <= '9')) ) {
        return( false );
        }
    } //end of for
    return( true );
}

function ap_validtext( ctrl, minimum, maximum, incspecial ) 
{
    var thisvalue = ctrl.value;
    var exactcount = 0;
    var specialswithspace = " `~!@#$%^&*()_+|\\=-[]{};':\",./<>?";
	if( (minimum > -1) && (static_isnothing(ctrl)) ) 
	    return( false );
    if( incspecial == false ) {
	    for( var i = 0; i < thisvalue.length; i++ ) {
	        thischar = thisvalue.charAt( i );
	        if( specialswithspace.indexOf(thischar) != -1 ) {
		        alert( "Æ¯¼öÇÑ ¹®ÀÚ´Â Çã¿ëµÇÁö ¾Ê½À´Ï´Ù." );
		        ctrl.focus();
		        return( false ); 
	            }
	    }
	}
    exactcount = ap_strlen( ctrl.value, specialswithspace );
    if( (minimum > -1) && (exactcount < minimum) ) {
        alert( "º» Ç×¸ñÀº ÃÖ¼Ò (" + minimum + ")ÀÚ ÀÌ»óÀÌ¾î¾ß ÇÕ´Ï´Ù. ÇöÀç (" + exactcount + ")ÀÚ ÀÔ´Ï´Ù." );
        ctrl.focus();
        return( false );
    }
    if( (maximum > -1) && (exactcount > maximum) ) {
        alert( "º» Ç×¸ñÀº ÃÖ´ë (" + maximum + ")ÀÚ ÀÌÇÏÀÌ¾î¾ß ÇÕ´Ï´Ù. ÇöÀç (" + exactcount + ")ÀÚ ÀÔ´Ï´Ù." );
        ctrl.focus();
        return( false );
    }
    return( true );
}

function ap_strstr( ctrl, minimum, maximum, incspecial, fmtstr ) 
{
	if( !ap_validtext( ctrl, minimum, maximum, incspecial ) ) return( false );
    var thisvalue = ctrl.value;
    index = thisvalue.indexOf( fmtstr );
    if( index < 0 ) {
        alert( "º» Ç×¸ñ¿¡´Â ¹Ýµå½Ã (" + fmtstr + ") °¡ Æ÷ÇÔµÇ¾î¾ß ÇÕ´Ï´Ù." );
        ctrl.focus();
        return( false );
    }
    return( true );
}

function ap_validkey( ctrl, minimum, maximum ) 
{
    var thisvalue = ctrl.value;
    var exactcount = 0;
    var unacceptablekeys = " `~!@#$%^&*()+|\\=[]{};':\",./<>?";
	if( (minimum > -1) && (static_isnothing(ctrl)) ) 
	    return( false );
    for( var i = 0; i < thisvalue.length; i++ ) {
        thischar = thisvalue.charAt( i );
        if( unacceptablekeys.indexOf(thischar) != -1 ) {
	        alert( "Æ¯¼öÇÑ ¹®ÀÚ´Â Çã¿ëµÇÁö ¾Ê½À´Ï´Ù." );
	        ctrl.focus();
	        return( false ); 
            }
    }
    exactcount = ap_strlen( ctrl.value, unacceptablekeys );
    if( (minimum > -1) && (exactcount < minimum) ) {
        alert( "º» Ç×¸ñÀº ÃÖ¼Ò (" + minimum + ")ÀÚ ÀÌ»óÀÌ¾î¾ß ÇÕ´Ï´Ù. ÇöÀç (" + exactcount + ")ÀÚ ÀÔ´Ï´Ù." );
        ctrl.focus();
        return( false );
    }
    if( (maximum > -1) && (exactcount > maximum) ) {
        alert( "º» Ç×¸ñÀº ÃÖ´ë (" + maximum + ")ÀÚ ÀÌÇÏÀÌ¾î¾ß ÇÕ´Ï´Ù. ÇöÀç (" + exactcount + ")ÀÚ ÀÔ´Ï´Ù." );
        ctrl.focus();
        return( false );
    }
    return( true );
}

function ap_validnum( focusctrl, ctrl, minimum, maximum ) 
{
    var numeric = ctrl.value;
    if( static_isnumeric( ctrl ) == false ) {
        alert( "°ªÀÌ ºñ¾î ÀÖ°Å³ª ¼ýÀÚ°¡ ¾Æ´Õ´Ï´Ù." );
        focusctrl.focus();
        return( false );
    }
    var quantity = parseInt( numeric, 10 );
    if( (minimum > -1) && (quantity < minimum) ) {
        alert( "º» Ç×¸ñÀº ÃÖ¼Ò (" + minimum + ") ÀÌ»óÀÌ¾î¾ß ÇÕ´Ï´Ù." );
        focusctrl.focus();
        return( false );
    }
    if( (maximum > -1) && (quantity > maximum) ) {
        alert( "º» Ç×¸ñÀº ÃÖ´ë (" + maximum + ") ÀÌÇÏÀÌ¾î¾ß ÇÕ´Ï´Ù." );
        focusctrl.focus();
        return( false );
    }
    return( true );
}

function ap_getpositivenum( ctrl )
{
    if( static_isnumeric( ctrl ) == false )
        return( -1 );
    return parseInt( numeric, 10 );
}

function ap_checkall( form, ctrl ) 
{
	var i, ncontrols = 0;
    for( i = 0; i < ctrl.length; i++ ) {
        thisone = ctrl[i];
        if( !thisone.disabled ) 
            thisone.checked = true;
        ncontrols++;
    }
    if( ncontrols == 0 ) { //if there is nothing checked, we should check through the form
		for( i = 0; i < form.length; i++ ) {
			if( (form[i].type == "checkbox") && (!form[i].disabled) )
				form[i].checked = true;
		}
	}
	return( false );
}

function ap_uncheckall( form, ctrl ) 
{
	var i, ncontrols = 0;
    for( i = 0; i < ctrl.length; i++ ) {
        thisone = ctrl[i];
        if( !thisone.disabled ) 
            thisone.checked = false;
        ncontrols++;
    }
    if( ncontrols == 0 ) { //if there is nothing checked, we should check through the form
		for( i = 0; i < form.length; i++ ) {
			if( (form[i].type == "checkbox") && (!form[i].disabled) )
				form[i].checked = false;
		}
	}
	return( false );
}

function ap_reverseall( form, ctrl ) 
{
	var i, ncontrols = 0;
    for( i = 0; i < ctrl.length; i++ ) {
        thisone = ctrl[i];
        if( !thisone.disabled ) {
	        if( thisone.checked ) thisone.checked = false;
	        else thisone.checked = true;
	    }
	    ncontrols++;
    }
    if( ncontrols == 0 ) { //if there is nothing checked, we should check through the form
		for( i = 0; i < form.length; i++ ) {
			if( (form[i].type == "checkbox") && (!form[i].disabled) )
				form[i].checked = !form[i].checked;
		}
	}
	return( false );
}

function ap_disablechecked( form, ctrl ) 
{
	var i, ncontrols = 0;
    for( i = 0; i < ctrl.length; i++ ) {
        thisone = ctrl[i];
        if( (thisone.checked) && (!thisone.disabled) )
	        thisone.disabled = true;
	    ncontrols++;
    }
    if( ncontrols == 0 ) { //if there is nothing checked, we should check through the form
		for( i = 0; i < form.length; i++ ) {
			if( (form[i].type == "checkbox") && (form[i].checked == true) && (!form[i].disabled) )
				form[i].disabled = true;
		}
	}
	return( true );
}

function ap_getcheckedcount( form, ctrl ) 
{
    var i, ncontrols = 0, checkedcount = 0;
    for( i = 0; i < ctrl.length; i++ ) {
        thisone = ctrl[i];
        if( (thisone.checked) && (!thisone.disabled) ) 
            checkedcount++;
        ncontrols++;
    }
    if( ncontrols == 0 ) { //if there is nothing checked, we should check through the form
		for( i = 0; i < form.length; i++ ) {
			if( (form[i].type == "checkbox") && (form[i].checked == true) && (!form[i].disabled) )
				checkedcount++;
		}
	}
    return( checkedcount );
}

function ap_somethingchecked( form, ctrl ) 
{
	if( ap_getcheckedcount(form, ctrl) == 0 ) {
        alert( "¼±ÅÃµÈ Ç×¸ñÀÌ ¾ø½À´Ï´Ù. Ç×¸ñÀ» ÇÏ³ª ¶Ç´Â ÇÏ³ª ÀÌ»ó ¼±ÅÃÇÏ½Å µÚ ´Ù½Ã ½ÃµµÇÏ½Ã±â ¹Ù¶ø´Ï´Ù." );
        return( false );
    }
    return( true );
}

function ap_getoptionvalue( ctrl ) 
{
    if( !ctrl.options )
        return( ctrl.value );
    for( var i = 0; i < ctrl.options.length; i++ ) {
        thisset = ctrl.options[i];
        if( thisset.selected ) {
            return( thisset.value );
        }
    }
    return( "" );
}

function ap_getradiobuttonvalue( ctrl ) 
{
    for( i = 0; i < ctrl.length; i++ ) {
        thisone = ctrl[i];
        if( thisone.checked ) 
            return( thisone.value );
    }
    return( "" );
}

function ap_getcheckboxarray( form, ctrl ) 
{
    var targets = new Array();
    var i, ncontrols = 0, checkedcount = 0;
    for( i = 0; i < ctrl.length; i++ ) {
        thisone = ctrl[i];
        if( (thisone.checked) && (!thisone.disabled) ) {
            targets[checkedcount] = thisone.value;
            checkedcount++;
        }
        ncontrols++;
    }
    if( ncontrols == 0 ) { //if there is nothing checked, we should check through the form
		for( i = 0; i < form.length; i++ ) {
			if( (form[i].type == "checkbox") && (form[i].checked == true) && (!form[i].disabled) )
                targets[checkedcount] = form[i].value;
				checkedcount++;
		}
	} 
	return( targets );
}

function ap_getcheckboxnumber( form, ctrl ) 
{
    var i, ncontrols = 0, intval = 0;
    for( i = 0; i < ctrl.length; i++ ) {
        thisone = ctrl[i];
        if( (thisone.checked) && (!thisone.disabled) ) 
            intval += (parseInt(thisone.value, 10));
        ncontrols++;
    }
    if( ncontrols == 0 ) { //if there is nothing checked, we should check through the form
		for( i = 0; i < form.length; i++ ) {
			if( (form[i].type == "checkbox") && (form[i].checked == true) && (!form[i].disabled) )
				intval += (parseInt(form[i].value, 10));
		}
	}
    return( intval );
}
		
function ap_filenmpreview( ctrl, imgpath )
{
	if( !IE ) return;
	
	formbutton = eval(ctrl);
	
	previewfile = formbutton.value.toLowerCase();
	var available = (previewfile.indexOf(".gif") != -1) ? (true) : (false);
	if( !available ) available = (previewfile.indexOf(".jpg") != -1) ? (true) : (false);
	if( !available ) available = (previewfile.indexOf(".png") != -1) ? (true) : (false);
	if( formbutton.value != "" && available ) {
		var localurl = 'file:///' + formbutton.value;
		document.images.preview.src = localurl;
	} else {
		document.images.preview.src = imgpath;
	}
	var fnnm = "ap_filenmpreview(formbutton,'" + imgpath + "')";
	setTimeout( fnnm, 1000 );
}

function ap_getrealbytescount( src ) 
{
    var rawlen, reallen, pos, nASCII;
    rawlen = src.length;
    reallen = 0;
    for( pos = 0; pos < rawlen; pos++ ) {
        nASCII = src.charCodeAt( pos );
        if( nASCII > 0 && nASCII < 255 )
            reallen += 1; 
        else
            reallen += 2; 
    }
    return reallen;
}

function ap_checkctrlbytes( areactl, maxbytes ) 
{
	var nbytes = ap_getrealbytescount(areactl.value);
	if( (maxbytes > -1) && (nbytes > maxbytes) ) return false;
	return true;
}

function ap_showctrlbytes( areactl, showctl, maxbytes ) 
{
	var nbytes = ap_getrealbytescount(areactl.value);
	if( (maxbytes > -1) && (nbytes > maxbytes) ) return false;
	showctl.value = "" + nbytes;
	return true;
}

function ap_validobj( obj ) 
{
    if( (typeof(obj) == "unknown") || (typeof(obj) == "undefined") )
        return false;
    return( true );
}

function ap_validfrmobj( frmnm, objnm ) 
{
	var frm = eval( frmnm );
	if( (typeof(frm) != "object") )
        return false;
	if( typeof(frm.name) != "string" ) //access forbidden
        return false;
    if( objnm == null ) 
        return true;
    var obj = eval( frmnm + "." + objnm );
    if( (typeof(obj) == "unknown") || (typeof(obj) == "undefined") ) {
        return false;
    }
	return true;
}

function ap_addfavorite( bookurl, markname ) 
{
	if( !IE ) {
		alert( "ºÏ¸¶Å© ±â´ÉÀº Internet Explorer¿¡¼­¸¸ Áö¿øµË´Ï´Ù. ÁË¼ÛÇÕ´Ï´Ù.\r\n" + 
		       "Sorry, Add Bookmark is available only in Microsoft Internet Explorer browser!" );
		return( false );
	}
	window.external.AddFavorite( bookurl, markname );
	return( true );
}

function ap_rebuildpage( nexturl, actionurl ) 
{
	with( document ) {
	write( "</HEAD><BODY>" );
	write( "<FORM NAME=redirform METHOD=POST ACTION='" + actionurl + "'>" );
	write( "<INPUT TYPE=HIDDEN NAME=nxt VALUE='" + nexturl + "'" );
	write( "></FORM>" );
	write( "<SCR" + "IPT LANGUAGE=JavaScript>document.redirform.submit();</SCR" + "IPT>" );
	write( "</BODY></HTML>" );
	}
	document.close();
}

function openinfo(){
	window.open('http://www.enppy.com/Anappletree/anappletree.asp', 'anappletree', 'width=840,height=820,left=100,top=50,scrollbars');
}

function ap_copyright_New(){
	var out = "";
		out += ("<img src=\"http://md.enppy.com/nimgs/mainNew/foot.gif\" style=\"margin-top:30px;border:0px;\" usemap=\"#mapFooter\" onfocus=\"this.blur();\">");
		out += ("<map id=\"mapFooter\" name=\"mapFooter\">");
		out += ("	<area shape=\"rect\" coords=\"67,16,123,28\" href=\"javascript:openinfo()\" onfocus=\"this.blur();\" />");
		out += ("	<area shape=\"rect\" coords=\"125,16,214,28\" href=\"mailto:marketing@enppy.com\" onfocus=\"this.blur();\" />");
		out += ("	<area shape=\"rect\" coords=\"222,15,284,29\" href=\"http://www.enppy.com/share/provision.asp\" onfocus=\"this.blur();\" />");
		out += ("	<area shape=\"rect\" coords=\"293,15,396,28\" href=\"http://www.enppy.com/share/privacy.asp\" onfocus=\"this.blur();\" />");
		out += ("	<area shape=\"rect\" coords=\"406,16,488,29\" href=\"http://www.enppy.com/share/juveniles.asp\" onfocus=\"this.blur();\" />");
		out += ("	<area shape=\"rect\" coords=\"497,15,568,29\" href=\"http://www.enppy.com/share/cash_policy.asp\" onfocus=\"this.blur();\" />");
		out += ("	<area shape=\"rect\" coords=\"578,15,672,29\" href=\"http://www.enppy.com/cpreport/index.asp\" onfocus=\"this.blur();\" />");
		out += ("	<area shape=\"rect\" coords=\"684,14,731,29\" href=\"mailto:recruit@oneappletree.co.kr\" onfocus=\"this.blur();\" />");
		out += ("	<area shape=\"rect\" coords=\"743,15,894,30\" href=\"http://www.enppy.com/helpdesk\" onfocus=\"this.blur();\" />");
		out += ("	<area shape=\"rect\" coords=\"828,45,890,110\" href=\"http://www.enppy.com/share/DNAFiltering.asp\" onfocus=\"this.blur();\" />");
		out += ("	<area shape=\"rect\" coords=\"526,90,666,105\" href=\"mailto:webmaster@enppy.com\" onfocus=\"this.blur();\" />");
		out += ("</map>");
		document.writeln( out );
}

function ap_copyright(width) 
{
	var length = "";
	var loc = window.location.href;
	var objDate = new Date();
	var strYear = objDate.getYear();	
	if (loc.indexOf("enppy.com") > 0 ){
		var intChk = loc.indexOf("//my.enppy.com") + loc.indexOf("//mall.enppy.com");
		if (intChk > 0){
			length = "960";
		}else{
			length = "960";
		}
		if ( width != null ) length = width ;

		var out = "";
		out += ("<CENTER>");
		out += ("<table width=\"" + length + "\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
		out += ("<tr><td height=\"20\">&nbsp;</td></tr>");
		out += ("<tr><td class=\"line-gray01\">&nbsp;</td></tr>");
		out += ("<tr><td height=\"20\" align=\"center\" class=\"ctl-gray02\">| ");
		out += ("<a href=\"javascript:openinfo()\">È¸»ç¼Ò°³</a> | ");
		out += ("<a href=\"mailto:marketing@enppy.com\">Á¦ÈÞ ¹× ±¤°í¹®ÀÇ</a> | ");
		out += ("<a href=\"http://www.enppy.com/share/provision.asp\" target=\"_blank\">¼­ºñ½º ¾à°ü</a> | ");
		out += ("<a href=\"http://www.enppy.com/share/privacy.asp\" target=\"_blank\"><strong>°³ÀÎÁ¤º¸ Ãë±Þ¹æÄ§</strong></a> | ");
		out += ("<a href=\"http://www.enppy.com/share/juveniles.asp\" target=\"_blank\">Ã»¼Ò³â º¸È£Á¤Ã¥</a> | ");
		out += ("<a href=\"http://www.enppy.com/share/cash_policy.asp\" target=\"_blank\">¿£ÇÇ Ä³½¬Á¤Ã¥</a> | ");
		out += ("<a href=\"http://www.enppy.com/cpreport/index.asp\">±Ç¸®Ä§ÇØ ½Å°í¼¾ÅÍ </a> | ");
		out += ("<a href=\"http://www.enppy.com/helpdesk\">°í°´¼¾ÅÍ</a> | ");
		out += ("<a href=\"mailto:recruit@oneappletree.co.kr\" target=\"_blank\">Ã¤¿ëÁ¤º¸</a> |</td></tr>");
		out += ("<tr><td class=\"line-gray01\">&nbsp;</td></tr>");
		out += ("<tr><td class=\"hspc10px\">&nbsp;</td></tr>");
		out += ("<tr><td align=\"center\" valign=\"top\">");
		out += ("	<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
		out += ("	<tr><td width=\"160\" rowspan=\"4\" valign=\"top\"><img src=\"http://md.enppy.com/nimgs/common/logoappletree.jpg\" width=\"160\" border=\"0\" /></td>");
		out += ("	<td width=\"20\" rowspan=\"4\" valign=\"bottom\"><img src=\"http://md.enppy.com/nimgs/common/ico_dot_gray02.gif\" width=\"1\" height=\"65\" /></td>");
		out += ("	<td width=\"480\" align=\"left\"><span style=\"font-color:#2A2A2A;font-size:11px;\">Copyright (C) 2008 - 2009 <strong>OneAppleTree.co.kr</strong> co., Ltd. All rights reserved.</span></td><td rowspan=\"4\" valign=\"top\"><a href=\"http://www.enppy.com/share/dnafiltering.asp\"><img src=\"http://md.enppy.com/nimgs/common/dna.gif\" width=\"46\" height=\"46\" border=\"0\" /></a></td></tr>");
		out += ("	<tr><td  width=\"480\" height=\"9\" align=\"left\"><span style=\"font-color:#2A2A2A;font-size:11px;\">¼ÒÀçÁö:&nbsp;¼­¿ï½Ã °­³²±¸ »ï¼ºµ¿ 114-14 ±ÝÅ¹Å¸¿ö 7Ãþ &nbsp;(ÁÖ)»ç°ú³ª¹«ÇÑ±×·ç&nbsp;|&nbsp;´ëÇ¥ÀÌ»ç:&nbsp;ÀÎÇö½Ç </span></td></tr>");
		out += ("	<tr><td  width=\"480\" height=\"9\" align=\"left\"><span style=\"font-color:#2A2A2A;font-size:11px;\">»ç¾÷ÀÚµî·Ï¹øÈ£:&nbsp;120-87-26697&nbsp;|&nbsp;´ëÇ¥ÀüÈ­:&nbsp;02-562-4044&nbsp;|&nbsp;ÀüÀÚ¿ìÆí:&nbsp;<a href='mailto:webmaster@enppy.com'><span style='text-decoration:none;color:#515151'>webmaster@enppy.com</span></a></span></td></tr>");
		out += ("	<tr><td align=\"left\">&nbsp;</td></tr>");
		out += ("	</table>");
		out += ("</td></tr>");
		out += ("</table>");
		document.writeln( out );
	}else{
		var out = "";
		out += ("<CENTER>");
		out += ("<table width=\"" + length + "\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
		out += ("<tr><td height=\"20\">&nbsp;</td></tr>");
		out += ("<tr><td class=\"line-gray01\">&nbsp;</td></tr>");
		out += ("<tr><td height=\"20\" align=\"center\" class=\"ctl-gray02\">| ");
		out += ("<a href=\"javascript:openinfo()\">È¸»ç¼Ò°³</a> | ");
		out += ("<a href=\"mailto:marketing@enppy.com\">Á¦ÈÞ ¹× ±¤°í¹®ÀÇ</a> | ");
		out += ("<a href=\"http://www.enppy.com/share/provision.asp\" target=\"_blank\">¼­ºñ½º ¾à°ü</a> | ");
		out += ("<a href=\"http://www.enppy.com/share/privacy.asp\" target=\"_blank\"><strong>°³ÀÎÁ¤º¸ Ãë±Þ¹æÄ§</strong></a> | ");
		out += ("<a href=\"http://www.enppy.com/share/juveniles.asp\" target=\"_blank\">Ã»¼Ò³â º¸È£Á¤Ã¥</a> | ");
		out += ("<a href=\"http://www.enppy.com/share/cash_policy.asp\" target=\"_blank\">¿£ÇÇ Ä³½¬Á¤Ã¥</a> | ");
		out += ("<a href=\"http://www.enppy.com/cpreport/index.asp\">±Ç¸®Ä§ÇØ ½Å°í¼¾ÅÍ </a> | ");
		out += ("<a href=\"http://www.enppy.com/helpdesk\">°í°´¼¾ÅÍ</a> | ");
		out += ("<a href=\"mailto:recruit@oneappletree.co.kr\" target=\"_blank\">Ã¤¿ëÁ¤º¸</a> |</td></tr>");
		out += ("<tr><td class=\"line-gray01\">&nbsp;</td></tr>");
		out += ("<tr><td class=\"hspc10px\">&nbsp;</td></tr>");
		out += ("<tr><td align=\"center\" valign=\"top\">");
		out += ("	<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
		out += ("	<tr><td width=\"160\" rowspan=\"4\" valign=\"top\"><img src=\"http://md.enppy.com/nimgs/common/logoappletree.jpg\" width=\"160\" border=\"0\" /></td>");
		out += ("	<td width=\"20\" rowspan=\"4\" valign=\"bottom\"><img src=\"http://md.enppy.com/nimgs/common/ico_dot_gray02.gif\" width=\"1\" height=\"65\" /></td>");
		out += ("	<td width=\"480\" align=\"left\"><span style=\"font-color:#2A2A2A;font-size:11px;\">Copyright (C) 2008 - 2009 <strong>AnAppleTree</strong> co., Ltd. All rights reserved.</span></td><td rowspan=\"4\" valign=\"top\"><a href=\"http://www.enppy.com/share/dnafiltering.asp\"><img src=\"http://md.enppy.com/nimgs/common/dna.gif\" width=\"46\" height=\"46\" border=\"0\" /></a></td></tr>");
		out += ("	<tr><td  width=\"480\" height=\"9\" align=\"left\"><span style=\"font-color:#2A2A2A;font-size:11px;\">¼ÒÀçÁö:&nbsp;¼­¿ï½Ã °­³²±¸ »ï¼ºµ¿ 114-14 ±ÝÅ¹Å¸¿ö 7Ãþ &nbsp;(ÁÖ)»ç°ú³ª¹«ÇÑ±×·ç&nbsp;|&nbsp;´ëÇ¥ÀÌ»ç:&nbsp;ÀÎÇö½Ç </span></td></tr>");
		out += ("	<tr><td  width=\"480\" height=\"9\" align=\"left\"><span style=\"font-color:#2A2A2A;font-size:11px;\">»ç¾÷ÀÚµî·Ï¹øÈ£:&nbsp;120-87-26697&nbsp;|&nbsp;´ëÇ¥ÀüÈ­:&nbsp;02-562-4044</span></td></tr>");
		out += ("	<tr><td align=\"left\">&nbsp;</td></tr>");
		out += ("	</table>");
		out += ("</td></tr>");
		out += ("</table>");
		document.writeln( out );
	}

}

function ap_dialogtitle( tit, fcolor, bcolor ) 
{
    var out = "";
	out += ("<TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=0>\n");
	out += ("<TR>\n");
	out += ("<TD WIDTH=100% HEIGHT=32 BGCOLOR=#"+bcolor+">&nbsp;&nbsp;&nbsp;<IMG SRC='http://sd2.entica.com:8080/z/i/ui/new/dot_top.gif' WIDTH=13 HEIGHT=9>\n");
	out += ("<FONT COLOR=#"+fcolor+"><B>"+tit+"</B></FONT></TD>\n");
	out += ("</TR>\n");
	out += ("<TR><TD BGCOLOR=#EBECEC HEIGHT=3 WIDTH=100%></TD></TR>\n");	
	out += ("</TABLE>\n");	
    document.writeln( out );
}

function ap_dialogclose( closeaction ) 
{
    var out = "";
	out += ("<TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=0>\n");
	out += ("<TR CLASS=wd1b1><TD><IMG WIDTH=1 HEIGHT=1 BORDER=0 SRC=http://md1.entica.com/zpublic/x.gif></TD></TR>\n");
	out += ("<TR CLASS=wd1b2><TD><IMG WIDTH=1 HEIGHT=1 BORDER=0 SRC=http://md1.entica.com/zpublic/x.gif></TD></TR>\n");
	out += ("<TR CLASS=wd1b3><TD><IMG WIDTH=1 HEIGHT=1 BORDER=0 SRC=http://md1.entica.com/zpublic/x.gif></TD></TR>\n");
	out += ("</TABLE>\n");
	
	out += ("<TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=0>\n");
	out += ("<TR CLASS=wd1bc>\n");
	out += ("<TD><IMG WIDTH=4 HEIGHT=28 BORDER=0 SRC=http://md1.entica.com/zpublic/x.gif></TD>\n");
	out += ("<TD WIDTH=100% ALIGN=CENTER>\n");
	out += ("<A HREF=# ONCLICK=\"" + closeaction + "\">\n");
	out += ("<IMG WIDTH=65 HEIGHT=21 BORDER=0 SRC=http://sd2.entica.com:8080/z/i/ui/btn/close.gif></A></TD></TR>\n");
	out += ("</TABLE>\n");
    document.writeln( out );
}

function ap_dialogcancel( cancelaction ) 
{
    var out = "";
	out += ("<TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=0>\n");
	out += ("<TR CLASS=wd1b1><TD><IMG WIDTH=1 HEIGHT=1 BORDER=0 SRC=http://md1.entica.com/zpublic/x.gif></TD></TR>\n");
	out += ("<TR CLASS=wd1b2><TD><IMG WIDTH=1 HEIGHT=1 BORDER=0 SRC=http://md1.entica.com/zpublic/x.gif></TD></TR>\n");
	out += ("<TR CLASS=wd1b3><TD><IMG WIDTH=1 HEIGHT=1 BORDER=0 SRC=http://md1.entica.com/zpublic/x.gif></TD></TR>\n");
	out += ("</TABLE>\n");
	
	out += ("<TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=0>\n");
	out += ("<TR CLASS=wd1bc>\n");
	out += ("<TD><IMG WIDTH=4 HEIGHT=28 BORDER=0 SRC=http://md1.entica.com/zpublic/x.gif></TD>\n");
	out += ("<TD WIDTH=100% ALIGN=CENTER>\n");
	out += ("<A HREF=# ONCLICK=\"" + cancelaction + "\">\n");
	out += ("<IMG WIDTH=65 HEIGHT=21 BORDER=0 SRC=http://sd2.entica.com:8080/z/i/ui/btn/cancel.gif></A></TD></TR>\n");
	out += ("</TABLE>\n");
    document.writeln( out );
}

function ap_dialogalert( okaction ) 
{
    var out = "";
	out += ("<TABLE WIDTH=100% HEIGHT=40 BGCOLOR=#F3F3F3 BORDER=0 CELLSPACING=0 CELLPADDING=3 ALIGN=CENTER>\n");
	out += ("<TR ALIGN=CENTER><TD>\n");
	out += ("<A HREF=# ONCLICK=\"" + okaction + "\">\n");	
	out += ("<IMG SRC=http://sd2.entica.com:8080/z/i/ui/new/ok.gif WIDTH=70 HEIGHT=19 BORDER=0></A></TD>\n");
	out += ("</TR>\n");
	out += ("</TABLE>\n");				    
    document.writeln( out );
}

function ap_dialogconfirm( msg, okaction, cancelaction ) 
{
    var out = "";
	out += ("<TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=0>\n");
	out += ("<TR>\n");
	out += ("<TD WIDTH=380 BGCOLOR=#F3F3F3 HEIGHT=103 VALIGN=TOP>\n");

	if (msg != "") {
		out += ("<TABLE WIDTH=342 BORDER=0 CELLSPACING=0 CELLPADDING=8 ALIGN=CENTER>\n");
		out += ("<TR>\n");
		out += ("<TD ALIGN=CENTER HEIGHT=60><B><FONT COLOR=#333333>"+msg+"</FONT></B></TD>\n");
		out += ("</TR>\n");
		out += ("</TABLE>\n");
	}
	out += ("<TABLE WIDTH=179 BORDER=0 CELLSPACING=0 CELLPADDING=3 ALIGN=CENTER>\n");
	out += ("<TR ALIGN=CENTER>\n");
	out += ("<TD WIDTH=85><A HREF=# ONCLICK=\"" + okaction + "\">\n");
	out += ("<IMG SRC=http://sd2.entica.com:8080/z/i/ui/new/yes.gif WIDTH=76 HEIGHT=19 BORDER=0></A></TD>\n");
	out += ("<TD WIDTH=94><A HREF=# ONCLICK=\"" + cancelaction + "\">\n");
	out += ("<IMG SRC=http://sd2.entica.com:8080/z/i/ui/new/no.gif WIDTH=76 HEIGHT=19 BORDER></A></TD>\n");
	out += ("</TR>\n");
	out += ("</TABLE>\n");
	out += ("</TD>\n");
	out += ("</TR>\n");
	out += ("<TABLE>\n");
    document.writeln( out );
}

function ap_dialoginvite( okaction, cancelaction ) 
{
    var out = "";
	out += ("<TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=0>\n");
	out += ("<TR CLASS=wd1b1><TD><IMG WIDTH=1 HEIGHT=1 BORDER=0 SRC=http://md1.entica.com/zpublic/x.gif></TD></TR>\n");
	out += ("<TR CLASS=wd1b2><TD><IMG WIDTH=1 HEIGHT=1 BORDER=0 SRC=http://md1.entica.com/zpublic/x.gif></TD></TR>\n");
	out += ("<TR CLASS=wd1b3><TD><IMG WIDTH=1 HEIGHT=1 BORDER=0 SRC=http://md1.entica.com/zpublic/x.gif></TD></TR>\n");
	out += ("</TABLE>\n");
	
	out += ("<TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=0>\n");
	out += ("<TR CLASS=wd1bc>\n");
	out += ("<TD><IMG WIDTH=4 HEIGHT=28 BORDER=0 SRC=http://md1.entica.com/zpublic/x.gif></TD>\n");
	out += ("<TD WIDTH=100% ALIGN=CENTER>\n");
	out += ("<TABLE BORDER=0>\n");
	out += ("<TR><TD><A HREF=# ONCLICK=\"" + okaction + "\">\n");
	out += ("	<IMG WIDTH=65 HEIGHT=21 BORDER=0 SRC=http://sd2.entica.com:8080/z/i/ui/btn/ack.gif></A></TD>\n");
	out += ("	<TD>&nbsp;&nbsp;</TD>\n");
	out += ("	<TD><A HREF=# ONCLICK=\"" + cancelaction + "\">\n");
	out += ("	<IMG WIDTH=65 HEIGHT=21 BORDER=0 SRC=http://sd2.entica.com:8080/z/i/ui/btn/nck.gif></A></TD></TR>\n");
	out += ("</TABLE>\n");
	
	out += ("</TD></TR>\n");
	out += ("</TABLE>\n");
    document.writeln( out );
}

function ap_chktag( formname ) {
	var thisvalue = formname.value;
	var tagcount = 0;
	var thischar;

	for( var i = 0; i < thisvalue.length; i++ ) {
        thischar = thisvalue.charAt( i );
        if( thischar == '<' || thischar == '>') tagcount++;
    }
    if( tagcount > 0 ) {
	    alert( "º» ³»¿ë¿¡´Â ÅÂ±×¸¦ »ç¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù." );
        formname.focus();
	    return( false ); 
	}
	return( true );
}

function openwin( winurl, winname, winwidth, winheight, adjust, resizable ) {
    var width  = winwidth;
    var height = winheight;
    var left, top;
    switch( adjust ) {
	case 1: //top left aligned
		left = top = 0;
		break;
	case 2: //top right aligned
		left = window.screen.availWidth - width;
		top = 0;
		break;
	case 3: //centered
		left = (window.screen.availWidth - width) / 2;
		top = (window.screen.availHeight - height) / 2;
		break;
	case 4: //bottom left aligned
		left = 0;
		top = window.screen.availHeight - height;
		break;
	case 5: //bottom right aligned
		left = window.screen.availWidth - width - 8;
		top = window.screen.availHeight - height;
		break;
    }
    var dynamic = "";
    if( adjust > 0 ) dynamic = "left=" + left + ",top=" + top;
    dynamic = dynamic + ",width=" + width + ",height=" + height;
    if( resizable ) dynamic = dynamic + ",resizable=yes";
    else dynamic = dynamic + ",resizable=no";
    window.open( winurl, winname, "toolbar=no," + dynamic + ",directories=no,status=no,scrollbars=no,menubar=no");
}

function openallwin( winurl, winname, winwidth, winheight, adjust, resizable, status, scrollbars, menubar) {
    var width  = winwidth;
    var height = winheight;
    var left, top;
    switch( adjust ) {
	case 1: //top left aligned
		left = top = 0;
		break;
	case 2: //top right aligned
		left = window.screen.availWidth - width;
		top = 0;
		break;
	case 3: //centered
		left = (window.screen.availWidth - width) / 2;
		top = (window.screen.availHeight - height) / 2;
		break;
	case 4: //bottom left aligned
		left = 0;
		top = window.screen.availHeight - height;
		break;
	case 5: //bottom right aligned
		left = window.screen.availWidth - width - 8;
		top = window.screen.availHeight - height;
		break;
    }
    var dynamic = "";
	var isstatus = "";
	var isscrollbars = "";
	var ismenubar = "";
    if( adjust > 0 ) dynamic = "left=" + left + ",top=" + top;
    dynamic = dynamic + ",width=" + width + ",height=" + height;
    if( resizable ) dynamic = dynamic + ",resizable=yes";
    else dynamic = dynamic + ",resizable=no";
    if( status ) isstatus = isstatus + ",status=yes";
    else isstatus = isstatus + ",status=no";
    /*
    if( scrollbars ) isscrollbars = isscrollbars + ",scrollbars=yes";
    else isscrollbars = isscrollbars + ",scrollbars=no";
	*/
	isscrollbars = isscrollbars + ",scrollbars=yes";
    if( menubar ) ismenubar = ismenubar + ",menubar=yes";
    else ismenubar = ismenubar + ",menubar=no";
    window.open( winurl, winname, "toolbar=no," + dynamic + ",directories=no," + isstatus + "," + isscrollbars + "," + ismenubar + "");
}

function openargwin( winurl, argname, argvalue, winname, winwidth, winheight, adjust, resizable ) {
    var width  = winwidth;
    var height = winheight;
    var left, top;
    switch( adjust ) {
	case 1: //top left aligned
		left = top = 0;
		break;
	case 2: //top right aligned
		left = window.screen.availWidth - width;
		top = 0;
		break;
	case 3: //centered
		left = (window.screen.availWidth - width) / 2;
		top = (window.screen.availHeight - height) / 2;
		break;
	case 4: //bottom left aligned
		left = 0;
		top = window.screen.availHeight - height;
		break;
	case 5: //bottom right aligned
		left = window.screen.availWidth - width - 8;
		top = window.screen.availHeight - height;
		break;
    }
    var dynamic = "";
    if( adjust > 0 ) dynamic = "left=" + left + ",top=" + top;
    dynamic = dynamic + ",width=" + width + ",height=" + height;
    if( resizable ) dynamic = dynamic + ",resizable=yes";
    else dynamic = dynamic + ",resizable=no";
    winurl = winurl + "?" + argname + "=" + escape(argvalue);
    window.open( winurl, winname, "toolbar=no," + dynamic + ",directories=no,status=no,scrollbars=no,menubar=no");
}

function searchCookie(cookie, what, delimeter) {
	var Found = false;
	var i = 0;

	what = what + "=";
	while(i <= cookie.length && !Found) {
		if(cookie.substr(i, what.length) == what) Found = true;
		i++;
	}

	if(Found == true) { 
		var start = i + what.length - 1;
		var end = cookie.indexOf(delimeter, start);
		if(end < start) end = cookie.length;
		return cookie.substring(start, end);
	}
	return "";
}

function getCookieVal(what){
	return searchCookie(document.cookie, what, ";");
}

function getArrCookie(first, second){
	var arrCookie = searchCookie(document.cookie, first, ";");
	return searchCookie(arrCookie, second, "&");
}

function setExpiredaysCookie( name, value, expiredays){ 
	var todayDate = new Date(); 
	todayDate.setDate( todayDate.getDate() + expiredays ); 
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
} 

function setExpiredateCookie( name, value, expiredate){ 
	var todayDate = new Date( expiredate ); 
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
} 

function setCookie( name, value){ 
	document.cookie = name + "=" + escape( value ) + "; path=/;"
}

function isNothing( formName ) {
    var thisvalue = formName.value;
    if( thisvalue.length == 0 ) {
        alert( "º» ³»¿ë¿¡´Â ¹Ýµå½Ã °ªÀ» ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.\r\nPlease enter valid value into this field" );
        formName.focus();
        return( true ); 
    }
    spacecount = 0;
    for( var i = 0; i < thisvalue.length; i++ ) {
        thischar = thisvalue.charAt( i );
        if( thischar == ' ' ) spacecount++;
    }
    if( spacecount == thisvalue.length ) {
	    alert( "º» ³»¿ë¿¡´Â ¹Ýµå½Ã °ªÀ» ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.\r\nAll blank characters are assumed Nothing, Please reenter!" );
        formName.focus();
	    return( true ); 
	}
	return( false );
}

function isNumeric( formName ) {
    var charDetected = 0, markDetected = 0, dotCount = 0;
    var numeric = formName.value;
    if( numeric == null || numeric == "" || numeric.length == 0 ) {
        return( false );
    }
    for( var i = 0; i < numeric.length; i++ ) {
      thischar = numeric.charAt( i );
      if( !((thischar >= '0') && (thischar <= '9')) ) {
        return( false );
        }
    } //end of for
    return( true );
}

function isValidNumeric( formName, minimum, maximum ) {
    var numeric = formName.value;
    if( isNumeric( formName ) == false ) {
        alert( "º» ³»¿ë¿¡´Â ¹Ýµå½Ã ¼öÄ¡·Î µÈ °ªÀ» ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.\r\nNothing or Non-Numeric entered, Please enter some numeric value" );
        return( false );
    }
    var quantity = parseInt( numeric, 10 );
    if( minimum == -1 || maximum == -1 ) //range not defined
        return( true );
    if( (quantity < minimum) || (quantity > maximum) ) {
        alert( "º» °ªÀº ÃÖ¼Ò (" + minimum + ") ºÎÅÍ ÃÖ´ë (" + maximum + ") ±îÁö °¡´ÉÇÕ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
        return( false );
    }
    return( true );
}

function getExactCount( formName ) {
    var thisvalue = formName.value;
    var byte1count = 0, byte2count = 0;
    var specialset = " `~!@#$%^&*()_+|\\=-[]{};':\",./<>?";
    for( var i = 0; i < thisvalue.length; i++ ) {
        thischar = thisvalue.charAt( i );
        if( ((thischar >= '0') && (thischar <= '9')) ||
            ((thischar >= 'A') && (thischar <= 'Z')) ||
            ((thischar >= 'a') && (thischar <= 'z')) ||
            ((thischar == '-') || (thischar == '_')) )
            byte1count++;
        else if( thischar == '(' || thischar == ')' ) {
        	byte1count++;
        	//byte1count++;
        }
        else if( specialset.indexOf(thischar) != -1 )
            byte1count++;
        else
            byte2count++;
    }
    return( byte1count + byte2count * 2 );
}

function isValidID( formName, minimum, maximum ) {
    var thisvalue = formName.value;
    if( thisvalue.length == 0 ) {
        alert( "º» ³»¿ëÀº À¯È¿ÇÑ °ªÀÌ ¹Ýµå½Ã ÀÖ¾î¾ß ÇÕ´Ï´Ù.\r\nPlease enter valid value into this field" );
        formName.focus();
        return( false ); 
    }
    var exactcount = 0;
    var specialset = " `~!@#$%^&*()_+|\\=-[]{};':\",./<>?";
    for( var i = 0; i < thisvalue.length; i++ ) {
        thischar = thisvalue.charAt( i );
        if( specialset.indexOf(thischar) != -1 ) {
	        alert( "º» ³»¿ë¿¡´Â Æ¯¼öÇÑ ¹®ÀÚ¸¦ »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.\r\nSpecial character is NOT available, Enter another one!" );
	        formName.focus();
	        return( false ); 
            }
    }
    exactcount = getExactCount( formName );
    if( minimum == -1 || maximum == -1 ) //range not defined
        return( true );
    if( (exactcount < minimum) || (exactcount > maximum) ) {
        alert( "ÃÖ¼Ò(" + minimum + ") ¿¡¼­ ÃÖ´ë(" + maximum + ") ÀÚ ÀÌ³»ÀÇ °ªÀ¸·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù. ÇÑ±Û ¶Ç´Â Æ¯¼ö¹®ÀÚ´Â ÇÏ³ª´ç 2ÀÚ·Î ÀÎ½ÄµË´Ï´Ù." +
        	   "\r\nValue must be in a range (" + minimum + ") to (" + maximum + ") in length, Please reenter!" );
        return( false );
    }
    return( true );
}

function isValidBlob( formName, maxlength ) { 
	var exactcount = getExactCount( formName );
    if( exactcount > maxlength ) { 
        alert( "³»¿ëÀÌ ³Ê¹« Å©¹Ç·Î " + (exactcount-maxlength) + "ÀÚ ÀÌ»óÀ» ÁÙÀÌ½Å ÈÄ ´Ù½Ã ½ÃµµÇÏ½Ê½Ã¿À.\r\n" + 
         "Please shorten the description by " + (exactcount-maxlength) + " characters." );
        formName.focus();
        return( false ); 
    } else {
        return( true ); 
    }
}

function selectAll( form, buttonset ) {
	var singlecheck = 0;
    for( i = 0; i < buttonset.length; i++ ) {
        thisset = buttonset[i];
        thisset.checked = true;
        singlecheck++;
    }
    if( singlecheck == 0 ) { //if there is nothing checked, we should check through the form
		for( i = 0; i < form.length; i++ ) {
			if( form[i].type == "checkbox" )
				form[i].checked = true;
		}
	}
}

function deselectAll( form, buttonset ) {
	var singlecheck = 0;
    for( i = 0; i < buttonset.length; i++ ) {
        thisset = buttonset[i];
        thisset.checked = false;
        singlecheck++;
    }
    if( singlecheck == 0 ) { //if there is nothing checked, we should check through the form
		for( i = 0; i < form.length; i++ ) {
			if( form[i].type == "checkbox" )
				form[i].checked = false;
		}
	}
}

function reverseAll( form, buttonset ) {
	var singlecheck = 0;
    for( i = 0; i < buttonset.length; i++ ) {
        thisset = buttonset[i];
        if( thisset.checked ) thisset.checked = false;
        else thisset.checked = true;
        singlecheck++;
    }
    if( singlecheck == 0 ) { //if there is nothing checked, we should check through the form
		for( i = 0; i < form.length; i++ ) {
			if( form[i].type == "checkbox" )
				form[i].checked = !form[i].checked;
		}
	}
}

function getCheckedCount( form, buttonset ) {
    var checkedcount = 0, singlecheck = 0;
    for( i = 0; i < buttonset.length; i++ ) {
        thisset = buttonset[i];
        if( thisset.checked ) checkedcount++;
        singlecheck++;
    }
    if( singlecheck == 0 ) { //if there is nothing checked, we should check through the form
		for( i = 0; i < form.length; i++ ) {
			if( form[i].type == "checkbox" && form[i].checked == true )
				checkedcount++;
		}
	}
    return( checkedcount );
}

function getToggledString( buttonset ) {
    checkValue = "";
    for( i = 0; i < buttonset.length; i++ ) {
        thisSet = buttonset[i];
        if( thisSet.checked ) checkValue = thisSet.value;
    }
    return( checkValue );
}

function setToggledString( buttonset, button ) {
    toggledString = getToggledString(buttonset);
    button.value = "" + toggledString;
}

function trimBlanks(str) {
	var idx = 0;

	// ÁÂÃø °ø¹é Á¦°Å
	while( str.charAt(idx) == " " ){
		idx = idx + 1;
	}
	str = str.substring(idx, str.length);

	// ¿ìÃø °ø¹é Á¦°Å
	idx = str.length - 1;
	while( str.charAt(idx) == " " ){
		idx = idx - 1;
	}

	return str.substring(0, idx+1);
}

function makeNormButton(text, target, url, width, height, normalColor, brightColor, darkColor, textColor){
	var xImage = "http://md1.entica.com/zpublic/x.gif";
	var xImageTag = "<IMG WIDTH=1 HEIGHT=1 SRC=" + xImage + ">";
	var link = "";
	
	if(!width || width == 0) widthTag = "";
	else widthTag = "WIDTH=" + width + " ";
	
	if(!height || height == 0) heightTag = "";
	else heightTag = "<IMG WIDTH=1 HEIGHT=" + height + " SRC=" + xImage + ">";

	if(!normalColor || normalColor == "") normalColor = "#CDCDCD";
	if(!brightColor || brightColor == "") brightColor = "#EEEEEE";
	if(!darkColor || darkColor == "") darkColor = "#999999";
	
	var normcolorTag = " BGCOLOR=" + normalColor + " ";
	var brtcolorTag = " BGCOLOR=" + brightColor + " ";
	var darkcolorTag = " BGCOLOR=" + darkColor + " ";
	
	if (url.indexOf('javascript:') != -1) link = url;
	else link = "'javascript:window.open( \"" + url + "\",\"" + target + "\");'";

	if (!textColor || textColor == "") var textTag = "";
	else var textTag = "<FONT COLOR=" + textColor + ">";

	with(document){
	writeln ("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 OnClick=" + link + " OnMouseOver=\"this.style.cursor='hand'\">");
	writeln ("<TR><TD COLSPAN=2>" + xImageTag + "</TD>");
	writeln ("    <TD BGCOLOR=#000000>" + xImageTag + "</TD>");
	writeln ("    <TD COLSPAN=2>" + xImageTag + "</TD></TR>");
	writeln ("<TR><TD>" + xImageTag + "</TD>");
	writeln ("    <TD BGCOLOR=#000000>" + xImageTag + "</TD>");
	writeln ("    <TD " + widthTag + brtcolorTag + ">" + xImageTag + "</TD>");
	writeln ("    <TD BGCOLOR=#000000>" + xImageTag + "</TD>");
	writeln ("    <TD>" + xImageTag + "</TD></TR>");
	writeln ("<TR><TD BGCOLOR=#000000>" + xImageTag + "</TD>");
	writeln ("    <TD" + brtcolorTag + ">" + xImageTag + "</TD>");
	writeln ("    <TD" + normcolorTag + " ALIGN=CENTER><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>");
	writeln ("    <TR><TD>" + heightTag + "</TD>");
	writeln ("        <TD>" + textTag + text + "</TD></TR>");
	writeln ("    </TABLE></TD>");
	writeln ("    <TD" + darkcolorTag + ">" + xImageTag + "</TD>");
	writeln ("    <TD BGCOLOR=#000000>" + xImageTag + "</TD></TR>")
	writeln ("<TR><TD>" + xImageTag + "</TD>");
	writeln ("    <TD BGCOLOR=#000000>" + xImageTag + "</TD>");
	writeln ("    <TD" + darkcolorTag + ">" + xImageTag + "</TD>");
	writeln ("    <TD BGCOLOR=#000000>" + xImageTag + "</TD>");
	writeln ("    <TD>" + xImageTag + "</TD></TR>");
	writeln ("<TR><TD COLSPAN=2>" + xImageTag + "</TD>");
	writeln ("    <TD BGCOLOR=#000000>" + xImageTag + "</TD>");
	writeln ("    <TD COLSPAN=2>" + xImageTag + "</TD></TR>");
	writeln ("</TABLE>");
	}
}

//by jolly for compitable avatar
function cvtToNoAcc(avtstr) {
	
	var TempAry = avtstr.split("_");
	var Tempavtfmt = "";
	
	for (var T=0; T < 4; T++)
		Tempavtfmt += TempAry[T] + "_";
		
	Tempavtfmt += "000_000_000_000_" + TempAry[TempAry.length - 1];
	TempAry = null;
	return Tempavtfmt;

}

// by jolly for ad banner (2002.11.20)
function MakeAdCode(spc, width, height) {
	var AdCodeStrHead = '<SCRIPT LANGUAGE=JavaScript TYPE="text/javascript" SRC="http://ad.entica.com/cgi-bin/script?acc=12CDEFG233&spc=';
	var AdCodeStrTail = '"></SCRIPT>';
	var AdUserInfoStr = '';
	var Found = false;
	var i = 0;
	var cookie = document.cookie;
	var what = 'ad=';

	AdCodeStrHead = AdCodeStrHead + spc + '&width=' + width + '&height=' + height;

	while(i <= cookie.length && !Found) {
		if(cookie.substr(i, what.length) == what) Found = true;
		i++;
	}

	if(Found == true) { 
		var start = i + what.length - 1;
		var end = cookie.indexOf(';', start);
		if(end < start) end = cookie.length;
		AdUserInfoStr = unescape(cookie.substring(start, end));
	}

	var cdomain = "";
	cdomain = document.location.href.substring(7,document.location.href.indexOf('.'));
	switch( cdomain ) {
		case "www": AdUserInfoStr += "&ex2=1"; break;
		case "club": AdUserInfoStr += "&ex2=2"; break;
		case "chat": AdUserInfoStr += "&ex2=4"; break;
		case "game": AdUserInfoStr += "&ex2=8"; break;
		case "mall": AdUserInfoStr += "&ex2=16"; break;
		case "plaza": AdUserInfoStr += "&ex2=32"; break;
		case "my": AdUserInfoStr += "&ex2=64"; break;
		case "ma": AdUserInfoStr += "&ex2=128"; break;
	}

	document.write(AdCodeStrHead + AdUserInfoStr +AdCodeStrTail);
}
// This stops the javascript from hiding -->
