
function change_hpno_recom(){
	var newwin;
	var openurl = "http://stock.daum.net/invest/paxnet2/ipclub2008/POP/regHpno.php";
	newwin = window.open( openurl, '', 'toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=no, resizable=0, width=520, height=196' );
}

function del_my_hpno_recom( hpno ) {
  if(confirm( "µî·ÏµÈ ÇÚµåÆù ¹øÈ£¿Í ´Ü¹® Á¤º¸¸¦ »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?" ) == false) {
  	return;
  }

  var cLeft=screen.width/2 - 240;
  var cTop=screen.height/2 - 100;
  url = "http://stock.daum.net/invest/paxnet2/ipclub2008/POP/delHpno.php";  //?hpno=" + hpno;
  newwin = window.open( url, 'DelMyHpnoWin', 'left='+cLeft+',top='+cTop+',width=270,height=186,scrollbars=0,resizable=0,status=0');
  newwin.focus();
}

function popup_high_ip_list_recom(){
	var newwin;
    var cLeft=screen.width/2 - 240;
    var cTop=screen.height/2 - 400;
	var openurl = "http://stock.finance.daum.net/trading/expertclub/paxnet/POP/popIPList.cgi";

	newwin = window.open(openurl,'', 'left='+cLeft+',top='+cTop+',width=700,height=600,scrollbars=0,resizable=0,status=0');
}

function popup_home_ip_list_recom(){
	var newwin;
    var cLeft=screen.width/2 - 240;
    var cTop=screen.height/2 - 400;
	var openurl = "http://stock.finance.daum.net/trading/expertclub/paxnet/POP/ClubIPList.cgi";
 
	newwin = window.open(openurl,'', 'left='+cLeft+',top='+cTop+',width=640,height=700,scrollbars=0,resizable=0,status=0');
}
/*
function go_sms_search_recom() {
  var cLeft=screen.width/2 - 250;
  var cTop=screen.height/2 - 250;

  url="http://stock.finance.daum.net/trading/expertclub/paxnet/POP/search.cgi";

  newwin = window.open( url, 'SMS_SEARCH_WIN', 'left='+cLeft+', top='+cTop+', width=520,height=427, scrollbars=0, resizable=0, status=0');

  newwin.focus();
}
*/
function high_del_hpno_recom( hpno, ipno ){
	var newwin;
	var openurl = "http://stock.daum.net/invest/paxnet2/ipclub2008/POP/del_sms.php?ipno=" + ipno;
	newwin = window.open( openurl, '', 'toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=no, resizable=1, width=270, height=186' );
}


function searchJongmok( form ){

	var check_flag = 0;
	if(form.content.value.length == 0){
		alert('Á¾¸ñÄÚµå³ª Á¾¸ñ¸íÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä.');
		form.content.focus();
		return false;
	}
        for( i = 0; i < form.content.value.length; i++ ) {
                if( form.content.value.charAt(i) < '0' || form.content.value.charAt(i) > '9' ) {
			check_flag = 1;
		}
        }

	if( check_flag == 0 ) {
		form.flag.value = 1;
	}
	else {
		form.flag.value = 2;
//		form.content.value =  escape(form.content.value)
	}
	return true;
} 

function go_sms_search_recom() {
  var cLeft=screen.width/2 - 250;
  var cTop=screen.height/2 - 250;

  url="http://stock.finance.daum.net/trading/expertclub/paxnet/POP/jmSearch.cgi";

  newwin = window.open( url, 'SMS_SEARCH_WIN', 'left='+cLeft+', top='+cTop+', width=520,height=427, scrollbars=0, resizable=0, status=0');

  newwin.focus();
}

function checkSearchForm(form) {

  form.query.value = trim(form.query.value);
  if (form.query.value == "") {
    alert ("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
    form.query.focus();
    return false;
  }

  if (form.type.selectedIndex==0) {
    if (check_num(form.query.value)) {
      if (form.query.value.length != 5 && form.query.value.length !=6 ) {
        alert("Á¾¸ñÄÚµå ÀÔ·ÂÀÌ Àß¸øµÇ¾ú½À´Ï´Ù.");
        form.query.focus();
        return false;
      }
      form.qtype.value = "2";
      return true;
    }
    else {
      form.qtype.value = "1";
      return true;
    }
  }
  else {
      form.qtype.value = "3";
      return true;
  }
}

function checkSearchFormFooter(form) {

  form.qContent.value = trim(form.qContent.value);
  if (form.qContent.value == "") {
    alert ("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
    form.qContent.focus();
    return false;
  }

  if (form.qType.value == "0") {
        alert("°Ë»öÁ¶°ÇÀ» ¼±ÅÃÇÏ¿© ÁÖ½Ê½Ã¿ä.");
        form.qType.focus();
        return false;
  }
//  form.qContent.value = urlEncode(form.qContent.value);
 return true;
 
}
function checkSearchFormFooter2(beginPage,qType,qContent) {

	form = document.schForm;
  	document.getElementById("qContent").value = qContent;
	document.getElementById("qType").value = qType;
	document.getElementById("curPageNo").value = beginPage;
	document.schForm.submit();

/*
  if (form.qContent.value == "") {
    alert ("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
    form.qContent.focus();
    return false;
  }
  if (form.qType.value == "0") {
        alert("°Ë»öÁ¶°ÇÀ» ¼±ÅÃÇÏ¿© ÁÖ½Ê½Ã¿ä.");
        form.qType.focus();
        return false;
  }
*/
//  form.qContent.value = urlEncode(form.qContent.value);
 return true;
 
}

function ltrim(str) {
	var i;
	var ch;
	var retStr = '';

	if (str.length == 0)
		return str;
	for (i=0;i<str.length;i++) {
		ch = str.charAt(i);
		if (retStr.length == 0 && (ch == ' ' || ch == '\r' || ch == '\n')) 
			continue;
		retStr += ch;
	}
	return retStr;
}

function rtrim(str) {
	var i;
	var ch;
	var retStr = '';
	
	if (str.length == 0)
		return str;
	for (i=str.length-1;i>=0;i--) {
		ch = str.charAt(i);
		if (ch != ' ' && ch != '\r' && ch != '\n') {
			break;
		}
	}
	retStr = str.substring(0, i+1);

	return retStr;
  }

function trim(str) {
	var retStr;

	retStr = ltrim(str);
	retStr = rtrim(retStr);

	return retStr;
}

function check_num(chs) {
	for(i=0; i< chs.length; i++) {
		if(chs.charAt(i) < '0' || chs.charAt(i) > '9' ) 
			return false;
	}
	return true;
}

function go_sms_add_recom (scode,sname,ipno,ipname) {
    self.location.href = "http://stock.daum.net/invest/paxnet2/ipclub2008/POP/reg_sms.php?scode=" + scode + "&ipno="+ipno;
//  self.location.href = "http://stock.finance.daum.net/trading/expertclub/paxnet/POP/pax_sms_add.cgi?scode=" + scode + "&sname=" + escape(sname) + "&ipno=" + ipno + "&ipname=" + escape(ipname) ;
}

function go_sms_add_recom_pop (scode,sname,ipno,ipname) {
	var newwin;
	var cLeft=screen.width/2 - 240;
	var cTop=screen.height/2 - 200;

	var openurl = "http://stock.daum.net/invest/paxnet2/ipclub2008/POP/reg_sms.php?scode=" + scode + "&ipno=" + ipno + "&sname=" + escape(sname) +  "&ipname=" + escape(ipname) ;

	newwin = window.open( openurl, '','left='+cLeft+',top='+cTop+',width=520,height=280,scrollbars=0,resizable=0,status=0');

}

function go_sms_del_recom( hpno, ipno, scode ) {
  if(confirm("¼±ÅÃÇÑ Àü¹®°¡¸¦ ÇØÁöÇÏ½Ã°Ú½À´Ï±î?") == false) {
  	return;
  }

  var cLeft=screen.width/2 - 240;
  var cTop=screen.height/2 - 100;

  url = "http://stock.daum.net/invest/paxnet2/ipclub2008/POP/del_sms.php?scode=" + scode + "&ipno=" + ipno + "&hpno="+hpno;

  newwin = window.open(url, 'SMS_ADD_WIN', 'left='+cLeft+',top='+cTop+',width=270,height=186,scrollbars=0,resizable=0,status=0');
  newwin.focus();
}

function reg_sms_recom( ipno, ipname ){
	var newwin;
	var cLeft=screen.width/2 - 240;
    var cTop=screen.height/2 - 200;
	
//	var openurl = "http://stock.finance.daum.net/trading/expertclub/paxnet/POP/addMyRecomSms.cgi?ipno=" + ipno + "&ipname=" + escape(ipname);
	var openurl = "http://stock.daum.net/invest/paxnet2/ipclub2008/POP/reg_sms.php?ipno="+ipno;
	newwin = window.open( openurl, '','left='+cLeft+',top='+cTop+',width=520,height=280,scrollbars=0,resizable=0,status=0');
}	

function reg_sms_recom_iframe( ipno, ipname ){
	var newwin;
	var cLeft=screen.width/2 - 240;
    var cTop=screen.height/2 - 200;
	
	var openurl = "http://stock.finance.daum.net/trading/expertclub/paxnet/POP/addMyRecomSms.cgi?ipno=" + ipno + "&ipname=" + escape(ipname)+"&iframe_check=1";
	newwin = window.open( openurl, '','left='+cLeft+',top='+cTop+',width=520,height=280,scrollbars=0,resizable=0,status=0');
}	

function paxIPPlayer( ipno ) {
	var	cLeft = screen.width / 2 - 200;
	var	cTop = screen.height / 2 - 300;

	url="http://bnb.moneta.co.kr/bbs/bnb/pax_ipSample.html?AnalNum="+ipno;
	newwin = window.open( url, 'Paxnet_Player', 'left='+cLeft+', top='+cTop+', width=300, height=167, scrollbars=0, resizable=0, status=0' );
	newwin.focus();
}


function paxJongmokSamplePlayer( scode, ipno ) {
	var	cLeft = screen.width / 2 - 200;
	var	cTop = screen.height / 2 - 300;

	url="http://bnb.moneta.co.kr/cgi-bin/paxmoneta/jongmokIPClub/paxJongmokSamplePlayer.cgi?scode=" + scode + "&ipno=" + ipno;

	newwin = window.open( url, 'PaxMoneta_JongmokSmsSample_Player', 'left='+cLeft+', top='+cTop+', width=300, height=145, scrollbars=0, resizable=0, status=0' );
	newwin.focus();
}

function paxPlayer( unqno ) {
	var	cLeft = screen.width / 2 - 200;
	var	cTop = screen.height / 2 - 300;

	url="http://bnb.moneta.co.kr/ipclub/REC/player.php?unqno="+unqno;
	newwin = window.open( url, 'Paxnet_Player', 'left='+cLeft+', top='+cTop+', width=300, height=167, scrollbars=0, resizable=0, status=0' );
	newwin.focus();
}


function regSmsPopup( scode, sname, ipno, ipname, rank )
{
        var     cLeft = screen.width / 2 - 200;
        var     cTop = screen.height / 2 - 300;

        url = "http://stock.daum.net/invest/paxnet2/ipclub2008/POP/regSmsPopup.php?scode="+scode + "&ipno=" + ipno +"&rank=" + rank+"&sname=" + urlEncode(sname) +  "&ipname=" + urlEncode(ipname);

        newwin = window.open( url, 'REGSMSPOPUP','left='+cLeft+', top='+cTop+', width=410, height=280, scrollbars=0, resizable=0, status=0' );
}

function urlEncode(strVal)
{
	var newStrVal = "";

	for( i =0 ; i < strVal.length; i++)
	{
		if(strVal.charAt(i) == '&')
			newStrVal = newStrVal + "%26";
		else
			newStrVal = newStrVal + strVal.charAt(i)+"";
	}
	return newStrVal;
}
function opener_url(parmUrl)
{
	if( parmUrl == "reload")
	{
		opener.top.location.reload();
		self.close();
	}else{
		opener.top.location.href=url;
		self.close();
	}
}

