  var rn=Math.round(Math.random(1)*100000),ord = Math.random() * 10000000000000000,
  prews='resizable=1,toolbar=0,location=0,menubar=1,status=1,scrollbars=1,left=30,top=30,screenX=30,screenY=30,',
  ws='resizable=1,toolbar=1,location=1,menubar=1,status=1,scrollbars=1,';
  if (screen.width>810){
    prews+='width=550,height=750'; ws+='width=850,height=760';
  }
  else{
    prews+='width=550,height=550'; ws+='width=790,height=550';
  }  
  function wo(url,win,wsize){
    window.open(url,win,wsize).focus();
  }
  function openwin(name){
    wo(name,'parentWin',ws+',left=20,top=20,screenX=20,screenY=20');
  }  
  function prescreen(){
    wo('http://www.stockconsultant.com/consultnow/prescreened_2.cgi?'+rn,'prescreen',prews);
  }
  function stockstowatch(){
    wo('http://www.stockconsultant.com/consultnow/stockstowatch.htm?'+rn,'prescreen',prews);
  }
  function setCookieHome(name, value){
    var c = new Date(); c.setTime(c.getTime() + 15.552E9); /* 6 month cookie */ 
    document.cookie=name + "=" + escape(value) + "; expires=" + c.toGMTString() + "; path=\;"; 
  }

  function getCookie(name) {var re = new RegExp(name + "=([^;]+)"); var value = re.exec(document.cookie);  return (value != null) ? unescape(value[1]) : null;  }
  
  function checkifpres(tmpstr){
   if ((typeof(tmpstr)!='string')||(typeof(tmpstr)=='undefined')) 
     return(0); 
   else if ((tmpstr==null)||(tmpstr=='null')) 
     return(0); 
   else if (tmpstr=='undefined') return(0); 
   return(1);
 }

 function callforum(){ 
   var d=getCookie('loginck8753'),u="",ts,ld;
   if ((checkifpres(d))&&(d.length>3)&&(d.indexOf("~")>=0)) { 
     ld=d.split("~"); 
     if (ld.length==3) { ts=ld[1].split("@");
       if (ts.length==2) u="?userz="+escape(ts[0]+ld[2].substr(0,1)+ld[2].substr(ld[2].length-1,1));
     }
   }
   wo("http://www.stockconsultant.com/forums/netboard.cgi"+u,'parentWin',ws+',left=20,top=20,screenX=20,screenY=20');
 }
