var linedata, searchdata, tempstr="",tempstr2,i,j,description, dayname = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'), monthname = new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'),rannum=Math.round(Math.random(1)*100000),
fcolor='<font face="verdana" color="#0000ee">',cstr,numtoshow,found,screenwin,stks=new Array(),surl='http://www.stockconsultant.com/',
stylestr2='style="font: normal 13px arial,helvetica,sans-serif;"',stylestr3='style="font: normal 12px arial,helvetica,sans-serif;"',
buttonst='style="background-color: #C4DF9B; color: #000000; font: bold 12px verdana,arial,helvetica,sans-serif; cursor:pointer;"',
goodtq="Good long trade qualities: at/just above support, good+ neutral/bullish 1 day money flow, neutral/bullish 3 day chart, good+ upside P/L ratio and target 1 potential. ",
goodtqsht="Good short trade qualities: at/just below resistance, good+ neutral/bearish 1 day money flow, neutral/bearish 3 day chart, good+ downside P/L ratio and target 1 potential. ",
poorupl="Poor upside P/L ratio.",
lpstk="Stocks priced under $12 ",lpstk2="Long Under $12:&nbsp;",hpstk="Stocks priced $12+ ",hpstk2="Long 12+:&nbsp;",
lpstk2sht="Short Under $12:&nbsp;",hpstk2sht="Short 12+:&nbsp;",
sortedpstr=" Sorted by upside target 1 profit (%). The 6 month typical volume is 300k or more.",sortedbostr=" Sorted by breakout profit (%). The 6 month typical volume is 300k or more.",sortedbdstr=" Sorted by breakdown profit (%). The 6 month typical volume is 300k or more.",
sortedpstrsht=" Sorted by downside target 1 profit (%). The 6 month typical volume is 300k or more.",
breakmf=" Also with mild to strong+ neutral/bullish 1 day money flow and good breakout P/L ratio. ",
breakmfsht=" Also with mild to strong+ neutral/bearish 1 day money flow and good breakdown P/L ratio. ",
searchinfo=new Array('',
'An all stock patterns search for stocks priced $12+ that are at/just above support. '+goodtq+sortedpstr,   /* 1 */
hpstk+'with one month uptrend patterns. '+goodtq+sortedpstr,
hpstk+'with a 4 month intermediate uptrend trend/starting uptrend and 1 month flat/up trend. No excessive short term up/down direction. '+goodtq+sortedpstr,
'Uptrending momentum stocks priced $12+. '+goodtq+sortedpstr,
hpstk+'at/just above double or greater support with good+ support strength. No strong/extreme pulbacks or down month trends. '+goodtq+sortedpstr, /* 5 */
hpstk+'with an unsustainable 4 month intermediate downtrend. '+goodtq+sortedpstr, /* 6 */
hpstk+'with a 4 month intermediate downtrend turned sideways. '+goodtq+sortedpstr,
hpstk+'that are oversold/extreme oversold and also have a strong/extreme one month downtrend. Stocks are typically down for at least a month (4-6 weeks). '+goodtq+sortedpstr,
hpstk+'that have had a short term (1-2 week) extreme pullback with early signs of a possible bottom. '+goodtq+sortedpstr,
hpstk+'with a breakout watch from a top. All breakout types: continuation (from single resistance) and true (double+ resistance).'+breakmf+sortedbostr,
hpstk+'with a breakout watch from a top. Continuation type from single resistance.'+breakmf+sortedbostr,
hpstk+'with a breakout watch from a top. True type from double+ resistance.'+breakmf+sortedbostr,
hpstk+'with a breakout watch from a flat top (flat 1 month trend).'+breakmf+sortedbostr,
hpstk+'with a breakout watch near or at a bottom.'+breakmf+sortedbostr,  
hpstk+'with a breakout confirmation from a top.'+breakmf+sortedbostr,   /* 15 */
hpstk+'with a breakout confirmation from a flat top (flat 1 month trend).'+breakmf+sortedbostr,
hpstk+'with a breakout confirmation near or at a bottom.'+breakmf+sortedbostr,

'An all stock patterns search for stocks priced under $12 that are at/just above support. '+goodtq+sortedpstr,   
lpstk+'with one month uptrend patterns. '+goodtq+sortedpstr,
lpstk+'with a 4 month intermediate uptrend trend/starting uptrend and 1 month flat/up trend. No excessive short term up/down direction. '+goodtq+sortedpstr,
'Uptrending momentum stocks priced under $12. '+goodtq+sortedpstr,
lpstk+'at/just above double or greater support with good+ support strength. No strong/extreme pulbacks or down month trends. '+goodtq+sortedpstr, /* 20 */
lpstk+'with an unsustainable 4 month intermediate downtrend. '+goodtq+sortedpstr, /* 23 */
lpstk+'with a 4 month intermediate downtrend turned sideways. '+goodtq+sortedpstr,
lpstk+'that are oversold/extreme oversold and also have a strong/extreme one month downtrend. Stocks are typically trending down for at least a month (4-6 weeks). '+goodtq+sortedpstr,
lpstk+'that have had a short term (1-2 week) extreme pullback with early signs of a possible bottom. '+goodtq+sortedpstr,
lpstk+'with a breakout watch from a top. All breakout types: continuation (from single resistance) and true (double+ resistance).'+breakmf+sortedbostr,
lpstk+'with a breakout watch from a top. Continuation type from single resistance.'+breakmf+sortedbostr,
lpstk+'with a breakout watch from a top. True type from double+ resistance.'+breakmf+sortedbostr,
lpstk+'with a breakout watch from a flat top (flat 1 month trend).'+breakmf+sortedbostr,
lpstk+'with a breakout watch near or at a bottom.'+breakmf+sortedbostr,  /* 31 */
lpstk+'with a breakout confirmation from a top.'+breakmf+sortedbostr,
lpstk+'with a breakout confirmation from a flat top (flat 1 month trend).'+breakmf+sortedbostr,
lpstk+'with a breakout confirmation near or at a bottom.'+breakmf+sortedbostr,   /* 34 */

'An all stock patterns search for stocks priced $12+ that are at/just below resistance. '+goodtqsht+poorupl+sortedpstrsht, 
hpstk+'at/just below double or greater resistance with good+ resistance strength. '+goodtqsht+poorupl+sortedpstrsht, 
hpstk+'with a 4 month intermediate uptrend turned sideways. '+goodtqsht+sortedpstrsht,   /* 37 */
hpstk+'with an unsustainable 4 month intermediate uptrend. '+goodtqsht+sortedpstrsht,
hpstk+'that are overbought/extreme overbought and also have a strong/extreme one month uptrend. Stocks are typically trending up for at least a month (4-6 weeks). '+goodtqsht+sortedpstrsht,
hpstk+'that have had a short term (1-2 week) extreme rally with early signs of a possible top. '+goodtqsht+sortedpstrsht,  /* 40 */
hpstk+'with a breakdown watch near or at a top.'+breakmfsht+sortedbdstr,
hpstk+'with a breakdown watch from a bottom. All breakdown types: continuation (from single support) and true (double+ support).'+breakmfsht+sortedbdstr,
hpstk+'with a breakdown watch from a bottom. Continuation type from single support.'+breakmfsht+sortedbdstr,
hpstk+'with a breakdown watch from a bottom. True type from double+ support.'+breakmfsht+sortedbdstr,
hpstk+'with a breakdown watch from a flat bottom (flat 1 month trend).'+breakmfsht+sortedbdstr,
hpstk+'with a breakdown confirmation near or at a top.'+breakmfsht+sortedbdstr, /* 46 */
hpstk+'with a breakdown confirmation from a bottom.'+breakmfsht+sortedbdstr,
hpstk+'with a breakdown confirmation from a flat bottom (flat 1 month trend).'+breakmfsht+sortedbdstr,

'An all stock patterns search for stocks below $12 that are at/just below resistance. '+goodtqsht+poorupl+sortedpstrsht, 
lpstk+'at/just below double or greater resistance with good+ resistance strength. '+goodtqsht+poorupl+sortedpstrsht, /* 50 */
lpstk+'with a 4 month intermediate uptrend turned sideways. '+goodtqsht+sortedpstrsht,
lpstk+'with an unsustainable 4 month intermediate uptrend. '+goodtqsht+sortedpstrsht,
lpstk+'that are overbought/extreme overbought and also have a strong/extreme one month uptrend. Stocks are typically trending up for at least a month (4-6 weeks). '+goodtqsht+sortedpstrsht,
lpstk+'that have had a short term (1-2 week) extreme rally with early signs of a possible top. '+goodtqsht+sortedpstrsht,  /* 54 */
lpstk+'with a breakdown watch near or at a top.'+breakmfsht+sortedbdstr,
lpstk+'with a breakdown watch from a bottom. All breakdown types: continuation (from single support) and true (double+ support).'+breakmfsht+sortedbdstr,
lpstk+'with a breakdown watch from a bottom. Continuation type from single support.'+breakmfsht+sortedbdstr,
lpstk+'with a breakdown watch from a bottom. True type from double+ support.'+breakmfsht+sortedbdstr,
lpstk+'with a breakdown watch from a flat bottom (flat 1 month trend).'+breakmfsht+sortedbdstr, /* 59 */
lpstk+'with a breakdown confirmation near or at a top.'+breakmfsht+sortedbdstr,
lpstk+'with a breakdown confirmation from a bottom.'+breakmfsht+sortedbdstr,
lpstk+'with a breakdown confirmation from a flat bottom (flat 1 month trend).'+breakmfsht+sortedbdstr /* 62 */
),
sortbydata=new Array(0,2,2,2,2,2,2,2,2,2, /* 9 */
6,6,6,6,6,6,6,6, /* 17 */
2,2,2,2,2,2,2,2,2, /* 26 */
6,6,6,6,6,6,6,6, /* 34 */
4,4,4,4,4,4, /* 40 */
7,7,7,7,7,7,7,7, /* 48 */
4,4,4,4,4,4, /* 54 */
7,7,7,7,7,7,7,7 /* 62 */
),
displaydata=new Array('','0123','0123','0123','0123','0123','0123','0123','0123','0123',
'0162','0162','0162','0162','0162','0162','0162','0162',
'0123','0123','0123','0123','0123','0123','0123','0123','0123', /* 26 */
'0162','0162','0162','0162','0162','0162','0162','0162',  /* 34 */
'0145','0145','0145','0145','0145','0145',  /* 40 */
'0174','0174','0174','0174','0174','0174','0174','0174', /* 48 */
'0145','0145','0145','0145','0145','0145',  /* 54 */
'0174','0174','0174','0174','0174','0174','0174','0174'  /* 62 */
),
/*                                                                                        10                          14      */
fldname=new Array("Price","Typ Volume","T1 Profit Up","T1 P/L Ratio Up","S1 Profit Down","S1 P/L Ratio Down","Breakout Profit","Breakdown Profit","P/L Ratio Up","S1 Prof Dwn"),
/*                   0        1           2             3              4                5                 6                 7         */
descrip=new Array('~0-5~5-12~12-25~25-40~40-70~> 70','~0-100K~100K-300K~300K-600K~600K-1M~> 1Mil','~0-5%~5-9%~9-16%~16-25%~> 25%','~0-1:1 dismal~1-2:1 poor~2-2.5:1 fair~2.5-3.8:1 good~3.8-5:1 excellent~5:1 excellent','~0-5%~5-9%~9-16%~16-25%~> 25%','~0-1:1 dismal~1-2:1 poor~2-2.5:1 fair~2.5-3.8:1 good~3.8-5:1 excellent~5:1 excellent','~0-5%~5-9%~9-16%~16-25%~> 25%','~0-5%~5-9%~9-16%~16-25%~> 25%','~0-1:1 dismal~1-1.8:1 poor~1.8-2.2:1 fair~2.2-3.1:1 good~3.1-5:1 excellent~5:1 excellent','~0-1:1 dismal~1-1.8:1 poor~1.8-2.2:1 fair~2.2-3.1:1 good~3.1-5:1 excellent~5:1 excellent'),

searchtitle=new Array("Select a PreScreen",
"1: "+hpstk2+"All patterns at/just above support.",
"2: "+hpstk2+"a. Month uptrend at/just above support.",
"3: "+hpstk2+"b. Intermediate uptrend trend/starting uptrend.",
"4: "+hpstk2+"c. Uptrend momentum stocks at/just above support.",
"5: "+hpstk2+"At/just above double+ support, good support strength.",
"6: "+hpstk2+"Unsustainable intermediate downtrend.",
"7: "+hpstk2+"Intermediate downtrend turned sideways.",
"8: "+hpstk2+"Oversold/extreme oversold (4-6 weeks), bottoms.",
"9: "+hpstk2+"Short term (1-2 week) extreme pullbacks, possible bottoms.",
"10: <b>&bull; </b>"+hpstk2+"Top Breakout Watches, All types.",
"11: <b>&bull; </b>"+hpstk2+"a. Top Breakout Watches, Continuation.",
"12: <b>&bull; </b>"+hpstk2+"b. Top Breakout Watches, True.",
"13: <b>&bull; </b>"+hpstk2+"c. FlatTop Breakout Watches.",
"14: <b>&bull; </b>"+hpstk2+"Bottom Breakout Watches.",
"15: <b>&bull; </b>"+hpstk2+"Top Breakout Confirmations.",
"16: <b>&bull; </b>"+hpstk2+"a. FlatTop Breakout Confirmations.",
"17: <b>&bull; </b>"+hpstk2+"Bottom Breakout Confirmations.",

"18: "+lpstk2+"All patterns at/just above support.",
"19: "+lpstk2+"a. Month uptrend at/just above support.",
"20: "+lpstk2+"b. Intermediate uptrend trend/starting uptrend.",
"21: "+lpstk2+"c. Uptrend momentum stocks at/just above support.",
"22: "+lpstk2+"At/just above double+ support, good support strength.",
"23: "+lpstk2+"Unsustainable intermediate downtrend.",
"24: "+lpstk2+"Intermediate downtrend turned sideways.",
"25: "+lpstk2+"Oversold/extreme oversold (4-6 weeks), bottoms.",
"26: "+lpstk2+"Short term (1-2 week) extreme pullbacks, possible bottoms.",
"27: <b>&bull; </b>"+lpstk2+"Top Breakout Watches, All types.",
"28: <b>&bull; </b>"+lpstk2+"a. Top Breakout Watches, Continuation.",
"29: <b>&bull; </b>"+lpstk2+"b. Top Breakout Watches, True.",
"30: <b>&bull; </b>"+lpstk2+"c. FlatTop Breakout Watches.",
"31: <b>&bull; </b>"+lpstk2+"Bottom Breakout Watches.",
"32: <b>&bull; </b>"+lpstk2+"Top Breakout Confirmations.",
"33: <b>&bull; </b>"+lpstk2+"a. FlatTop Breakout Confirmations.",
"34: <b>&bull; </b>"+lpstk2+"Bottom Breakout Confirmations.",

"35: "+hpstk2sht+"All patterns at/just below resistance.",
"36: "+hpstk2sht+"At/just below double+ resistance, good resistance strength.",
"37: "+hpstk2sht+"a. Intermediate uptrend turned sideways.",
"38: "+hpstk2sht+"b. Unsustainable intermediate uptrend.",
"39: "+hpstk2sht+"c. Overbought/extreme overbought (4-6 weeks), tops.",
"40: "+hpstk2sht+"d. Short term (1-2 week) extreme rally, possible tops.",
"41: <b>&bull; </b>"+hpstk2sht+"Top Breakdown Watches.",
"42: <b>&bull; </b>"+hpstk2sht+"Bottom Breakdown Watches, All types.",
"43: <b>&bull; </b>"+hpstk2sht+"a. Bottom Breakdown Watches, Continuation.",
"44: <b>&bull; </b>"+hpstk2sht+"b. Bottom Breakdown Watches, True.",
"45: <b>&bull; </b>"+hpstk2sht+"c. FlatBottom Breakdown Watches.",
"46: <b>&bull; </b>"+hpstk2sht+"Top Breakdown Confirmations.",
"47: <b>&bull; </b>"+hpstk2sht+"Bottom Breakdown Confirmations.",
"48: <b>&bull; </b>"+hpstk2sht+"a. FlatBottom Breakdown Confirmations.",

"49: "+lpstk2sht+"All patterns at/just below resistance.",
"50: "+lpstk2sht+"At/just below double+ resistance, good resistance strength.",
"51: "+lpstk2sht+"a. Intermediate uptrend turned sideways.",
"52: "+lpstk2sht+"b. Unsustainable intermediate uptrend.",
"53: "+lpstk2sht+"c. Overbought/extreme overbought (4-6 weeks), tops.",
"54: "+lpstk2sht+"d. Short term (1-2 week) extreme rally, possible tops.",
"55: <b>&bull; </b>"+lpstk2sht+"Top Breakdown Watches.",
"56: <b>&bull; </b>"+lpstk2sht+"Bottom Breakdown Watches, All types.",
"57: <b>&bull; </b>"+lpstk2sht+"a. Bottom Breakdown Watches, Continuation.",
"58: <b>&bull; </b>"+lpstk2sht+"b. Bottom Breakdown Watches, True.",
"59: <b>&bull; </b>"+lpstk2sht+"c. FlatBottom Breakdown Watches.",
"60: <b>&bull; </b>"+lpstk2sht+"Top Breakdown Confirmations.",
"61: <b>&bull; </b>"+lpstk2sht+"Bottom Breakdown Confirmations.",
"62: <b>&bull; </b>"+lpstk2sht+"a. FlatBottom Breakdown Confirmations."
),
headstr='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><style>HTML, BODY {margin:3; padding:0;}TT{font: normal 11px arial,sans-serif,helvetica; }TD{font: normal 13px arial,sans-serif,helvetica;}.zoo{font: bold 15px verdana,arial,sans-serif,helvetica; color:#0000e7;}.z4{font: normal 13px verdana,arial,sans-serif,helvetica; color:#000000;}</style></head><body bgcolor="#F9F0DF" link="#0000FF"  vlink="#0000FF" text="#000000">',sortbynum, nmlimit, nmsort, wastot=0,counterstr="Memb";
if (tempstr3.indexOf("ID=381290")<0) counterstr="Free";
if (tempstr3.indexOf("affil=nasdaq")>=0){ counterstr+="_Naz"; setCookieHome('sc_affil','nasdaq');newwindow=1;}
function openwin(name){ var winsize='resizable=1,toolbar=1,location=1,menubar=1,status=1,scrollbars=1,';
  if (screen.width>810) winsize+='width=843,height=700,left=70,top=20,screenX=70,screenY=20';
  else winsize+='width=790,height=550,left=5,top=5,screenX=5,screenY=5';
  screenwin=window.open(name,'screenwin',winsize); screenwin.focus(); 
}

function checkifpres(ts){
  if ((typeof(ts)!='string')||(typeof(ts)=='undefined')||
     (ts==null)||(ts=='null')||(ts=='undefined')) return(0); 
  return(1); 
}

function getsetCookie(get,name,v){
  var t1,t2,tr,ns2,ns,i,j,cs1,cs2,ts,re;
  if (get){
    re = document.cookie.match ( '(^|;) ?' + name + '=([^;]*)(;|$)' );
    if (re) v=unescape(re[2]);
    else v=null;
  }
  if (v!=null) return(v);
  else return("");
}

var isuser=getsetCookie(1,'username','');
issample=!((checkifpres(isuser))&&(isuser.length>2)&&(isuser.indexOf('@')>0));

function callstk(num){ var rannum=Math.round(Math.random(1)*100000); if ((newwindow==1) || (!opener) || (opener.closed)) openwin(surl+"consultnow/"+progname+".cgi?symbol="+stks[num]); else opener.location.href=surl+"consultnow/"+progname+".cgi?symbol="+stks[num]; }
function screenit(num,num2) { var rannum=Math.round(Math.random(1)*100000); 
  if (num<0){ dbak=top.frames[0].document.sform.daysb.selectedIndex; top.location.href=surl+"consultnow/"+prescreenn+".cgi?fselect="+top.frames[0].document.sform.search.selectedIndex+"&neww="+newwindow+"&dbak="+dbak+"&sortby="+sortby; } // no rannum
  else { 
    if ((num2==0)&&(issample==1)){ window.alert("-- Custom sorting for members only --"); return;}
    fselect=top.frames[0].document.sform.search.selectedIndex; 
    if (num2==1) sortby=-1; else sortby=num; 
    if (fselect>0) {  top.frames[0].document.sform.daysb.blur(); writeoutput(); }
  } 
}

function setCookieHome(name, value) { var cooktime6mo = new Date(); cooktime6mo.setTime(cooktime6mo.getTime() + 15.552E9); /* 6 month cookie */ document.cookie=name + "=" + escape(value) + "; expires=" + cooktime6mo.toGMTString() + "; path=/;"; }
function signupwin() { if ((newwindow==1) || (!opener) || (opener.closed)) openwin(surl+"signup.html"); else opener.location.href=surl+"signup.html"; window.close(); }
function sortwithvol(a,b){ if (a.substr(sortbynum,1)==b.substr(sortbynum,1)) return (0);  return ((a.substr(sortbynum,1)>b.substr(sortbynum,1))? -1 : 1); };
function FindDay(day, month, year){if ((month==1) || (month==2)){month+=10;year--;} else month=month-2;  return (day + Math.floor(2.6*month - 0.2) - 38 + year + Math.floor(year/4) + Math.floor(19/4)) % 7; };
function dodatestuff(linedata0,linedata1){var finddayyear=0, daystr,monthstr,yearstr;
  if (linedata0.length>6){ daystr=Math.round(linedata0.substr(6,2)); monthstr = Math.round(linedata0.substr(4,2)); yearstr = Math.round(linedata0.substr(0,4)); if (yearstr>1999) finddayyear=yearstr-1928; else finddayyear=yearstr-1900; }
  else { daystr=Math.round(linedata0.substr(4,2)); monthstr = Math.round(linedata0.substr(2,2)); finddayyear = Math.round(linedata0.substr(0,2)); yearstr="19"+finddayyear; }
  var timestr, datestr = dayname[FindDay(daystr, monthstr, finddayyear)]+', '+daystr+' '+monthname[monthstr-1]+' '+yearstr, strz=linedata1.split(":"), hourz=0, minz=0, timez="pm"; 
  hourz=parseInt(strz[0]); minz=parseInt(strz[1]); minz=minz-3; if (minz<0){minz=minz+60; hourz=hourz-1;} if (hourz<12) timez="am"; else if (hourz>12) hourz=hourz-12;  if ((minz>=0) && (minz<=9)) minz="0"+minz; if ( ((hourz>=6) && (hourz<12) && timez=="pm") || ((hourz>=0) && (hourz<8) && timez=="am") || (daystr=="Saturday") || (daystr=="Sunday")  ) timestr="close";  else timestr=hourz+":"+minz+" "+timez+" EST";
  return(datestr+', '+timestr);
}
function writehead(){
  var l3=new Array(),n=0,i,tempstr="",tempstr2="",slen=searchtitle.length;
  l3[n]=headstr+'<table border=0 cellpadding=5 cellspacing=0><tr><td><form style="margin:0px" name="sform"><span class=zoo>StockConsultant PreScreen Search</span>  &nbsp; &nbsp;  &nbsp;  &nbsp; &nbsp;  &nbsp;  &nbsp; &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp; <font face="verdana"><a href="javascript:top.window.close()">Close Window</a></font>';n++;
  l3[n]='<table border=0 cellpadding=5 cellspacing=0><tr><td align=left height=40 valign=top> &nbsp;<tt>Updated every 30 mins starting at 10:30am EST</tt></td><td align=left valign=middle> &nbsp;';n++;
  l3[n]='<SELECT onFocus="this.focus()" name="daysb" '+stylestr3+' onChange="parent.screenit(-1,0)">';n++;
  for (i=0;i<26;i++) { if (i!=dbak) tempstr=''; else tempstr='selected="yes"'; l3[n]='<option '+tempstr+'>';n++;
    if (i==0) tempstr2='Current'; else if (i==1) tempstr2='1 day ago'; else tempstr2=i+' days ago';
    l3[n]=tempstr2+'</option>';n++;
  }
  l3[n]='</select></td></tr><tr><td colspan=2 nowrap><select onFocus="this.focus()" '+stylestr2+' name="search" onChange="parent.screenit(top.frames[0].document.sform.search.selectedIndex,1)">';n++;
  for (i=0;i<slen;i++){ if (i!=fselect) tempstr=''; else tempstr='selected="yes"'; l3[n]='<option '+tempstr+'>'+searchtitle[i]+'</option>';n++;}
  l3[n]='</select></td></tr></table></form></td></tr></table></body</html>';n++;
  top.frames[0].document.open(); 
  top.frames[0].document.clear();
  top.frames[0].document.write(l3.join(""));
  top.frames[0].document.close(); 
}
function pausecomp(millis) 
{
var date = new Date(),curDate = null;
do { curDate = new Date(); } while(curDate-date < millis);
} 

function writeoutput(){ 
var l3=new Array(),n=0,tempstr='',i,firsttime=0;
linedata=curdate.split("-");
l3[n]=headstr+'<table border=0 cellpadding=5 cellspacing=0><tr><td><table bgcolor="#33CC99" border=1 bordercolor="#33CC99" cellpadding=0 cellspacing=0><tr><td bgcolor="#FFFFFF"><table border=0 cellpadding=6 cellspacing=0><tr><td><font face="verdana"><b>Results</b>, ';n++;
if (sortby<0) sortbynum=sortbydata[fselect]; else sortbynum=sortby;
if (fselect<1) {
  if (issample==1) l3[n]=' &nbsp; Non-members version.'; else l3[n]=' &nbsp; Members version.'; 
  n++; l3[n]='</td></tr><tr><td>';n++;
  firsttime=1;
  l3[n]='<table border=0 cellpadding=7 cellspacing=0><tr><td><img border=0 src="../img/tbull.gif" WIDTH="12" HEIGHT="13" align="top"> Select a PreScreen above for a listing of up to 125 stocks</td></tr>';n++;
  if (issample==1) {l3[n]='<tr><td><img border=0 src="../img/tbull.gif" WIDTH="12" HEIGHT="13" align="top"> Non members receive 3 stocks per screen.<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="'+surl+'signup.html" target="_new"><b>Sign up</b></a> to view and sort the complete list!<br></td></tr>';n++;}
  l3[n]='<tr><td><img border=0 src="../img/tbull.gif" WIDTH="12" HEIGHT="13" align="top"> The PreScreen settings can be found and modified under SearchTool.</td></tr></table></td></tr></table></td></tr>';n++;
}
else {
l3[n]=dodatestuff(linedata[0],linedata[1])+' &#8594;<a href="javascript:parent.screenit(-1,0)">Refresh</a> &nbsp; &nbsp;  &nbsp; </font><tt><a href="javascript:window.print()">Print Page</a></tt></td></tr><tr><td>';n++;
var searchdata=prescreens.split("~"), tempstr2=searchtitle[fselect].split(": "),datanum,symlist="";
l3[n]='<b>'+fcolor+'Search:</font></b> '+tempstr2[1]+'<br><b>'+fcolor+'Sorted by:</font></b> <b>'+fldname[sortbynum]+'</b>&nbsp;<font color="#0000ee">(click on a field heading below to change sort order)</font><hr width=95%><b>'+fcolor+'Search Info:</font></b> <tt>'+searchinfo[fselect]+'<br></tt></td></tr></table></td></tr>';n++;
if (searchdata[fselect]!="") tempstr=searchdata[fselect].split(","); else { tempstr=""; wastot=0;}
l3[n]='<tr><td bgcolor="#bbbbbb"><table border=0 cellpadding=3 cellspacing=1 width=100%>';n++;
 if (tempstr.length>0) { 
  if (issample==1){wastot=tempstr.length; nmlimit=3;
    if (wastot>nmlimit) numtoshow=nmlimit; else numtoshow=wastot;
  } else {numtoshow=tempstr.length; wastot=numtoshow;}
  tempstr.sort(sortwithvol);
  if (numtoshow>125) numtoshow=125;
  for (i=0;i<numtoshow;i++) {
    if ((i%10)==0){
      l3[n]='<tr><td bgcolor="#3871BC"><font color="#FFFFFF">&nbsp;Symbol&nbsp;</font></td>';n++;
      for (j=0;j<displaydata[fselect].length;j++) {l3[n]='<td bgcolor="#3871BC" nowrap>&nbsp;<a href="javascript:parent.screenit('+displaydata[fselect].substr(j,1)+',0)"><font color="#FFFFFF">'+fldname[displaydata[fselect].substr(j,1)]+'</font></a>&nbsp;</td>';n++;}
      l3[n]='</tr>';n++;
    }
    if ( (((i+1) % 10)==3)||(((i+1) % 10)==6)||(((i+1) % 10)==9)) cstr='bgcolor="#eeeeee"'; else cstr='bgcolor="#ffffff"';
    stks[i]=tempstr[i].substr(8,tempstr[i].length-8);
    l3[n]='<tr '+cstr+'><td>'+(i+1)+'.&nbsp;<a href="javascript:parent.callstk('+i+')">'+stks[i]+'</a>&nbsp;</td>';n++;
    for (j=0;j<displaydata[fselect].length;j++) { 
/* not coded yet   if ((displaydata[fselect].substr(j,1)==6)||(displaydata[fselect].substr(j,1)==7))
         datanum=Math.floor(displaydata[fselect].substr(j,1))+2;
        else */ datanum=Math.floor(displaydata[fselect].substr(j,1));
        tempstr2=descrip[datanum].split("~");
        l3[n]='<td>&nbsp;'+tempstr2[tempstr[i].substr(displaydata[fselect].substr(j,1),1)]+'&nbsp;</td>';n++;
    }
    l3[n]='</tr>';n++;
  }  
 } else { l3[n]='<tr><td bgcolor="#FFFFFF"><br> &nbsp; <font face="verdana"><b>*** No stocks found for this screen at this time</b></font>  &nbsp; <br><br></td></tr>';n++;}
l3[n]='</table></td></tr>';n++;
if ((issample==0)&&(tempstr.length>0)){
  l3[n]='<tr><td bgcolor="#FFFFFF"><table border=0 cellpadding=5 cellspacing=0><tr><td nowrap><b>'+fcolor+'Symbol List:</font></b><br><tt> &nbsp; &nbsp; &nbsp; (copy-n-paste up to 70 symbols into one of 8 user lists and set to no sort to keep search order,<br>10 stocks listed per row)</tt></td></tr>';n++;
  l3[n]='<tr><td>'+fcolor+'Sorted by \"'+fldname[sortbynum]+'\" in groups of 70 symbols</font><br><hr width=425 size=2 noshade align=left>&nbsp;&nbsp;';n++;
  for (i=0;i<numtoshow;i++){ 
    if ((i==(numtoshow-1))||(i==69)) { l3[n]=stks[i]; n++;
      if (i==69){ l3[n]='&nbsp;&nbsp;<br><hr width=425 size=2 noshade align=left>&nbsp;&nbsp;';n++; }
    } else {l3[n]=stks[i]+","; n++; }
    if ((i==9)||(i==19)||(i==29)||(i==39)||(i==49)||(i==59)
       ||(i==79)||(i==89)||(i==99)||(i==109)||(i==119)||(i==129)) {l3[n]='<br>';n++;} 
  }
  l3[n]='&nbsp;&nbsp;<br><br></td></tr></table></td></tr>';n++;
}
if ((issample==1)&&(wastot>nmlimit)) {l3[n]='<tr><td bgcolor="#FFFFFF"><br>&nbsp;<span class="z4"><b>'+nmlimit+' out of '+wastot+'</b> stocks displayed<br><br>&nbsp; &nbsp; &nbsp; &nbsp; <a href="'+surl+'signup.html" target="_new"><b>Sign up</b></a> to view and sort the complete list!</span><br><br></td></tr>';n++;}
}
l3[n]='</table>';n++;
if (issample==1){ l3[n]='<br><table border=0 cellpadding=10 cellspacing=0 width=100%><tr><td height=5></td></tr><tr><td align=center nowrap><tr><td><a href="http://www.adtrader.com/ads/adlink.asp?POS=1&SN=1350&rn='+rannum+'" target="_blank"><img style="border:1px solid grey;" width=468 height=60 src="http://www.adtrader.com/ads/adserve.asp?POS=1&SN=1350&rn='+rannum+'"></a></td></tr></table><br>';n++;}
l3[n]='</td></tr></table></body></html><br>';n++;
top.frames[1].document.open(); 
top.frames[1].document.clear();
top.frames[1].document.write(l3.join(""));
if ((firsttime==1)&&(dbak==0)){
//<![CDATA[
top.frames[1].document.write('<scr'+'ipt language="javascript" src="http://www.stockconsultant.com/twatch/jslogger.php?ref='+( document["referrer"]==null?'':escape(document.referrer))+'&pg='+escape(window.location)+'&pagepre='+counterstr+'"></scr'+'ipt>');
//]]>
}
top.frames[1].document.close();
top.frames[1].focus();
}

