	
  
 function Login() {
  
   nexturl = document.location.href
    
   if (nexturl.indexOf('prelog.jsp') != -1) {
   	nexturl = document.login.nexturl.value;
   }
 
   while (nexturl.indexOf('&') != -1) {
 	nexturl = nexturl.replace('&','@@');
   }
 
   document.location.href = "/etrade/login/prelog.jsp?nexturl=" + nexturl;
 }

 
 function LoginPage() {
  
   nexturl = document.location.href
 
   if (nexturl.indexOf('prelog.jsp') != -1) {
   	nexturl = document.login.nexturl.value;
   }
 
   while (nexturl.indexOf('&') != -1) {
 	nexturl = nexturl.replace('&','@@');
   }
 
   document.location.replace("/etrade/login/prelog.jsp?nexturl=" + nexturl);
 }
 
 
 function Logout() {
 
   nexturl = document.location.href
   while (nexturl.indexOf('&') != -1) {
 	nexturl = nexturl.replace('&','@@');
   }
   document.location.replace("/login/logout.jsp?nexturl=" + nexturl);
 }
 
 
 function LogoutFrame() {
 
   nexturl = document.location.href
   while (nexturl.indexOf('&') != -1) {
 	nexturl = nexturl.replace('&','@@');
   }
   document.location.replace("/login/logout.jsp?nexturl=" + nexturl);
 }

function OpenPrint(url) {
   	window.open(url,"print",'width=650,height=550,resizable=yes,toolbar=yes, menubar=yes, scrollbars=yes,top=100,left=300');
   	return;
}

function bbsDel(p) {
   	
   	if (confirm('Á¤¸»·Î »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?')) {
   		
   		document.location.href = "pdsDel.jsp?"+p;
   			
   	}
   	
}

 function chkByte(obj,subject,bt) 
{
	var tmpStr;
	var temp=0;
	var onechar;
	var tcount;
	tcount = 0;
	
	str = obj.value;
	
	tmpStr = new String(str);
	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++;
		}
	}

	if(tcount>bt) {

		reserve = tcount-bt;
		alert("[" + subject + "]¶õÀº " + bt + "¹ÙÀÌÆ® ÀÌ»ó ÀÔ·ÂÇÒ¼ö ¾ø½À´Ï´Ù."); 
		cut_str(obj,subject,bt);
		obj.focus();
		return;
	}	
}



function swf(src, w, h)
{	
	html = '';
	html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="param" width="'+w+'" height="'+h+'">';
	html += '<param name="movie" value="'+src+'">';
	html += '<param name="quality" value="high">';
	html += '<param name="bgcolor" value="#FFFFFF">';
	html += '<param name="swliveconnect" value="true">';
	html += '<embed src="'+src+'" quality=high bgcolor="#FFFFFF" width="'+w+'" height="'+h+'" swliveconnect="true" id="param" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"><\/embed>';
	html += '<\/object>';
	document.write(html);
}

function OpenPublic(url,winname,width,height,resize,scroll) {
   	window.open(url,winname,"width=" + width + ",height=" + height + ",resizable=" + resize + ",scrollbars=" + scroll + "");
   	return;
}

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


function setCookie( name, value, expiredays )
{
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );

	if (expiredays == 0)
		document.cookie = name + "=" + escape( value ) + "; path=/;"
	else
		document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}


function OpenPopup(url,winname,top,left,width,height,resize,scroll) {
   	window.open(url,winname,"top=" + top + ",left=" + left + ",width=" + width + ",height=" + height + ",resizable=" + resize + ",scrollbars=" + scroll + "");
   	return;
}