var isXp = navigator.userAgent.indexOf('windows NT 5.1') > 0;
var isIE70 = navigator.userAgent.indexOf('MSIE 7.0') > 0;

var lnk1  = "/advclub/index.jsp";
var lnk2  = "http://www.thinkpool.com/customer/user/join.jsp";
var lnk3  = "http://www.thinkpool.com";
var lnk4  = "/advclub/service.jsp";
var lnk5  = "/advclub/join.jsp";
var lnk6  = "/advclub/tradeList.jsp";
var lnk7  = "/advclub/pdsView.jsp";
var lnk8  = "/advclub/";
var lnk9  = "";
  
 function fnGoPage(menu) { 
 	alert("test");
 	/* 	
 	alert(menu);

	if(menu.length == 1)
	{
		document.location.href = menu[0];
	}
	else if(menu.length == 2)
	{
		window.open(menu[0], menu[1]);
	}
	*/
 }
 
function admCourseRequest() {
	window.open('/advclub/admCourse_request.jsp','admCourse_request','width=360,height=405,resizable=no,scrollbars=auto,top=100,left=100');
	return;
} 

function advClubAcc(preAccNum) {
	window.open('/advclub/settle/settle_mem.jsp?preAcc='+preAccNum,'advclubacc','width=360,height=405,resizable=no,scrollbars=auto,top=100,left=100');
	return;
} 
 
function Login2() {

   var layer_str = '';
   nexturl = top.location.href

   if (nexturl.indexOf('prelog.jsp') != -1) {
   	nexturl = top.login.nexturl.value;
   }

   while (nexturl.indexOf('&') != -1) {
 	nexturl = nexturl.replace('&','%26');
   }

   try {

   	var popflag = window.name;
   	var hd;
   	var wd;
   	var istop = 'N';

   	if (popflag != '') {

   		try {

   			if (document.top_login.istop.value == 'Y')
   				istop = 'Y';

   		} catch (eee) {
   		}
   		
   		if (istop == 'N') {
   			
	   		try {
	   			hd = document.body.clientHeight;
	   			wd = document.body.clientWidth;
	   		
	   		} catch (ee) {
	   			document.write("<body>");
	   			hd = document.body.clientHeight;
	   			wd = document.body.clientWidth;
	   		}
	   			   		
	   		wd += 10;
	   		if (isIE70)
	   			hd += 79;
	   		else if (isXp)
	   			hd += 58;
	   		else
	   			hd += 29;
	   			
	   		window.resizeTo(700,650);
	   		layer_str = "&layer=2&height=" + hd + "&width=" + wd;
	   		
   		}

	}

   } catch (e) {}


   top.location.href = "/advclub/login/prelog.jsp?nexturl=" + nexturl + layer_str;
 }	
   
  
 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 = "/advclub/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("/advclub/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 Logout2() {

   nexturl = document.location.href
   while (nexturl.indexOf('&') != -1) {
 	nexturl = nexturl.replace('&','%26');
   }
   document.location.replace("/advclub/login/box/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="swliveconnect" value="true">';
	html += '<param name="allowScriptAccess" value="always" >';
	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 OnlyNumber(){
	if((event.keyCode<48)||(event.keyCode>57))
	event.returnValue=false;
}

function fnDoneKey() {
	if ((event.keyCode > 112 && event.keyCode < 124) || event.ctrlKey) {
		event.keyCode = 38;
		event.returnValue=false;
	}
}

function goUrl(combo) {

	if (combo.value != "")
		location.href = combo.value;

}

function accInvestConsultEvent() 
{
	window.open("http://www.thinkpool.com/advclub/settle/settle_mem_event.jsp","accInvestConsultEvent","width=410,height=440,resizable=no,scrollbars=no");
}