var numofsforms, numkeys, n=0, m, l4="",daybstr2='',
zx,numuserkeys=0,stockdatau=[],searchdu=[],typeofdata="",
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 ",hpstk="Stocks priced $12+ ",hpstk2="Long 12+ ",
lpstk2sht="Short Under $12 ",hpstk2sht="Short 12+ ",
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. ",
i, j, k, start, end, target, tolook, datazstr="", dataz="", first,configstr,
zstr="",zstrhead="",checkstr,menustr,menuarray,curitems,menulen,evalstr="",
selectnum, currentset, selectnum, searchstr, prestr, addspace, tempout, selstart, arraylen,
tmparray, cmlen, cursearchstr, temparray,typeofsearch="searchd",
therealnum = [0,2,1,26,9,6,8,7,5,10,11,12,13,15,17,14,16,27,18,20,3,22,24,19,21,4,23,25],
alltrue,mapnum,allmap,doand,addaor,toomanysorts,sorttemp,
oarry = [], onum=0, testnum=0, curnum=0, charnum=0, lastnum=0, tempcode=0 ,tempcode2=0,
sortby=0,sc666fullprestr="",foundold=0,sc666fullpreary,
trendcodeform = ['0: ALL','1: Sideways trend','2: Downtrend turned sideways, possible bottom','3: Unsustainable uptrend, may turn sideways','4: Uptrend turned sideways, may continue or pullback','5: Obsolete, see number 9,2','6: Obsolete, see number 4','7: Uptrend with recent pullback','8: Sideways trend near lower support','9: Mild uptrend','a: Sideways trend near upper resistance','b: Uptrend','c: Unsustainable downtrend, may turn sideways','d: Downtrend','Custom:'],
pricecodeform = ['0: ALL','1: 0-5','2: 5-12','3: 12-25','4: 25-40','5: 40-70','6: > 70','Custom:'],
volcodeform = ['0: ALL','1: 0-100K','2: 100K-300K','3: 300K-600K','4: 600K-1M','5: > 1Mil','Custom:'],
ratedcodeform = ['0: ALL','1: Hold','2: Mild Outperform, 65% bullish','3: Mild Underperform, 65% bearish','4: Outperform, 85% bullish','5: Underperform, 85% bearish','6: Strong Outperform, 90% bullish','7: Strong Underperform, 90% bearish','8: Very Strong Outperform, 95% bullish','9: Very Strong Underperform, 95% bearish','Custom:'],
sortbycodeform = ['0: None','1: Price','2: 6 mo Typical Volume','3: Typical Rallies/Pullbacks','4: Upside Target 1 Profit','5: Upside Target 1 Profit/loss','6: Downside Target 1 Profit','7: Downside Target 1 Profit/loss','8: Breakout Profit','9: Breakdown Profit','a: Overall Rated','b: Upside Target Potential','c: Downside Target Potential','d: Resistance/Support Type','e: Breakout Type','f: Breakdown Type'],
showst=0,showend=6,cleanfrom=0,idx=0,z=0,endnum=0,
customcode = ['0: None (User Preset list)','1: -open-','2: -open-','3: -open-','4: -open-','5: -open-','6: -open-','7: -open-','8: -open-','9: -open-','10: -open-','11: -open-','12: -open-','13: -open-','14: -open-','15: -open-','16: -open-','17: -open-','18: -open-','19: -open-','20: -open-','21: -open-','22: -open-','23: -open-','24: -open-','25: -open-'],
scprecode = ["0: None (PreScreener list)",
"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. Uptrending momentum stocks at/just above support.",
"5: "+hpstk2+"d. Unsustainable intermediate downtrend.",
"6: "+hpstk2+"e. Intermediate downtrend turned sideways.",
"7: "+hpstk2+"f. Oversold/extreme oversold (4-6 weeks), bottoms.",
"8: "+hpstk2+"g. Short term (1-2 week) extreme pullbacks, possible bottoms.",
"9: "+hpstk2+"At/just above double+ support, good support strength.",
"10: "+hpstk2+"Top Breakout Watches, All types.",
"11: "+hpstk2+"a. Top Breakout Watches, Continuation.",
"12: "+hpstk2+"b. Top Breakout Watches, True.",
"13: "+hpstk2+"c. FlatTop Breakout Watches.",
"14: "+hpstk2+"Bottom Breakout Watches.",
"15: "+hpstk2+"Top Breakout Confirmations, All types.",
"16: "+hpstk2+"a. FlatTop Breakout Confirmations.",
"17: "+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. Uptrending momentum stocks at/just above support.",
"22: "+lpstk2+"d. Unsustainable intermediate downtrend.",
"23: "+lpstk2+"e. Intermediate downtrend turned sideways.",
"24: "+lpstk2+"f. Oversold/extreme oversold (4-6 weeks), bottoms.",
"25: "+lpstk2+"g. Short term (1-2 week) extreme pullbacks, possible bottoms.",
"26: "+lpstk2+"At/just above double+ support, good support strength.",
"27: "+lpstk2+"Top Breakout Watches, All types.",
"28: "+lpstk2+"a. Top Breakout Watches, Continuation.",
"29: "+lpstk2+"b. Top Breakout Watches, True.",
"30: "+lpstk2+"c. FlatTop Breakout Watches.",
"31: "+lpstk2+"Bottom Breakout Watches.",
"32: "+lpstk2+"Top Breakout Confirmations, All types.",
"33: "+lpstk2+"a. FlatTop Breakout Confirmations.",
"34: "+lpstk2+"Bottom Breakout Confirmations.",
"35: "+hpstk2sht+"All stock patterns at/just below resistance.",
"36: "+hpstk2sht+"a. Intermediate uptrend turned sideways.",
"37: "+hpstk2sht+"b. Unsustainable intermediate uptrend.",
"38: "+hpstk2sht+"c. Overbought/extreme overbought (4-6 weeks), tops.",
"39: "+hpstk2sht+"d. Short term (1-2 week) extreme rally, possible tops.",
"40: "+hpstk2sht+"At/just below double+ resistance, good resistance strength.",
"41: "+hpstk2sht+"Top Breakdown Watches.",
"42: "+hpstk2sht+"Bottom Breakdown Watches, All types.",
"43: "+hpstk2sht+"a. Bottom Breakdown Watches, Continuation.",
"44: "+hpstk2sht+"b. Bottom Breakdown Watches, True.",
"45: "+hpstk2sht+"c. FlatBottom Breakdown Watches.",
"46: "+hpstk2sht+"Top Breakdown Confirmations.",
"47: "+hpstk2sht+"Bottom Breakdown Confirmations, All types.",
"48: "+hpstk2sht+"a. FlatBottom Breakdown Confirmations.",
"49: "+lpstk2sht+"All stock patterns at/just below resistance.",
"50: "+lpstk2sht+"a. Intermediate uptrend turned sideways.",
"51: "+lpstk2sht+"b. Unsustainable intermediate uptrend.",
"52: "+lpstk2sht+"c. Overbought/extreme overbought (4-6 weeks), tops.",
"53: "+lpstk2sht+"d. Short term (1-2 week) extreme rally, possible tops.",
"54: "+lpstk2sht+"At/just below double+ resistance, good resistance strength.",
"55: "+lpstk2sht+"Top Breakdown Watches.",
"56: "+lpstk2sht+"Bottom Breakdown Watches, All types.",
"57: "+lpstk2sht+"a. Bottom Breakdown Watches, Continuation.",
"58: "+lpstk2sht+"b. Bottom Breakdown Watches, True.",
"59: "+lpstk2sht+"c. FlatBottom Breakdown Watches.",
"60: "+lpstk2sht+"Top Breakdown Confirmations.",
"61: "+lpstk2sht+"Bottom Breakdown Confirmations, All Types",
"62: "+lpstk2sht+"a. FlatBottom Breakdown Confirmations."],
scprestr = ['',
',3456,,345,00!0!!_1!00000,13ac,00,124,00,12,,345,00,34,,456,00000004',
',3456,,345,00!0!!_2!00,24,00,13ac,00,124,00,12,,345,00,34,,456,00000004',
',3456,,345,00!0!!_3!,49b,0,12,,12345,0,13ac,00,124,00,12,,345,00,34,,456,00000004',
',3456,,345,00!0!!_4!,479b,,1234568,,12346,00,13ac,00,124,00,12,,345,00,34,,456,00000004',
',3456,,345,00!0!!_5!c0000,13ac,00,124,00,12,,345,00,34,,456,00000004',
',3456,,345,00!0!!_6!20000,13ac,00,124,00,12,,345,00,34,,456,00000004',
',3456,,345,00!0!!_7!0,79,,57,00,13ac,00,124,00,12,,345,00,34,,456,00000004',
',3456,,345,00!0!!_8!00070,13ac,00,124,00,12,,345,00,34,,456,00000004',
',3456,,345,00!0!!_9!00,1234,,1234,0,13ac,,345,,456,,124,00,12,,345,00,34,,456,00000004',
',3456,,345,00!0!!_10!,1349ab,,12468,,124,00000000,12,,2345,000,23456,20000008',
',3456,,345,00!0!!_11!,1349ab,,12468,,124,00020000,12,,2345,000,23456,20000008',
',3456,,345,00!0!!_12!,1349ab,,12468,,124,000,345,0000,12,,2345,000,23456,20000008',
',3456,,345,00!0!!_13!,1349ab,,12468,100000000,12,,2345,000,23456,20000008',
',3456,,345,00!0!!_14!,12789cd,,13579,000000000,12,,2345,000,23456,20000008', 
',3456,,345,00!0!!_15!,1349ab,,12468,,124,00000000,12,,2345,000,23456,40000008',
',3456,,345,00!0!!_16!,1349ab,,12468,100000000,12,,2345,000,23456,40000008',
',3456,,345,00!0!!_17!,12789cd,,13579,000000000,12,,2345,000,23456,40000008',
',12,,345,00!0!!_18!00000,13ac,00,124,00,12,,345,00,34,,456,00000004',
',12,,345,00!0!!_19!00,24,00,13ac,00,124,00,12,,345,00,34,,456,00000004',
',12,,345,00!0!!_20!,49b,0,12,,12345,0,13ac,00,124,00,12,,345,00,34,,456,00000004',
',12,,345,00!0!!_21!,479b,,1234568,,12346,00,13ac,00,124,00,12,,345,00,34,,456,00000004',
',12,,345,00!0!!_22!c0000,13ac,00,124,00,12,,345,00,34,,456,00000004',
',12,,345,00!0!!_23!20000,13ac,00,124,00,12,,345,00,34,,456,00000004',
',12,,345,00!0!!_24!0,79,,57,00,13ac,00,124,00,12,,345,00,34,,456,00000004',
',12,,345,00!0!!_25!00070,13ac,00,124,00,12,,345,00,34,,456,00000004',
',12,,345,00!0!!_26!00,1234,,1234,0,13ac,,345,,456,,124,00,12,,345,00,34,,456,00000004',
',12,,345,00!0!!_27!,1349ab,,12468,,124,00000000,12,,2345,000,23456,20000008',
',12,,345,00!0!!_28!,1349ab,,12468,,124,00020000,12,,2345,000,23456,20000008',
',12,,345,00!0!!_29!,1349ab,,12468,,124,000,345,0000,12,,2345,000,23456,20000008',
',12,,345,00!0!!_30!,1349ab,,12468,100000000,12,,2345,000,23456,20000008',
',12,,345,00!0!!_31!,12789cd,,13579,000000000,12,,2345,000,23456,20000008', 
',12,,345,00!0!!_32!,1349ab,,12468,,124,00000000,12,,2345,000,23456,40000008',
',12,,345,00!0!!_33!,1349ab,,12468,100000000,12,,2345,000,23456,40000008',
',12,,345,00!0!!_34!,12789cd,,13579,000000000,12,,2345,000,23456,40000008',
',3456,,345,00!0!!_35!00000,57ad,00,135,00,13,,345,000,123,000,34,,456,006', 
',3456,,345,00!0!!_36!40000,57ad,00,135,00,13,,345,0000000,34,,456,006',
',3456,,345,00!0!!_37!30000,57ad,00,135,00,13,,345,0000000,34,,456,006',
',3456,,345,00!0!!_38!0,68,,46,00,57ad,00,135,00,13,,345,0000000,34,,456,006',
',3456,,345,00!0!!_39!00060,57ad,00,135,00,13,,345,0000000,34,,456,006',
',3456,,345,00!0!!_40!00000,57ad,,345,,456,,135,00,13,,345,000,123,000,34,,456,006', 
',3456,,345,00!0!!_41!,1347ab,,12468,000000000,13,,2345,00000000,23456,209',
',3456,,345,00!0!!_42!,128cd,,3579,000000000,13,,2345,00000000,23456,209',
',3456,,345,00!0!!_43!,128cd,,3579,000020000,13,,2345,00000000,23456,209',
',3456,,345,00!0!!_44!,128cd,,3579,0000,345,0000,13,,2345,00000000,23456,209',
',3456,,345,00!0!!_45!,128cd,,3579,100000000,13,,2345,00000000,23456,209',
',3456,,345,00!0!!_46!,1347ab,,12468,000000000,13,,2345,00000000,23456,409',
',3456,,345,00!0!!_47!,128cd,,3579,000000000,13,,2345,00000000,23456,409',
',3456,,345,00!0!!_48!,128cd,,3579,100000000,13,,2345,00000000,23456,409',
',12,,345,00!0!!_49!00000,57ad,00,135,00,13,,345,000,123,000,34,,456,006', 
',12,,345,00!0!!_50!40000,57ad,00,135,00,13,,345,0000000,34,,456,006',
',12,,345,00!0!!_51!30000,57ad,00,135,00,13,,345,0000000,34,,456,006',
',12,,345,00!0!!_52!0,68,,46,00,57ad,00,135,00,13,,345,0000000,34,,456,006',
',12,,345,00!0!!_53!00060,57ad,00,135,00,13,,345,0000000,34,,456,006',
',12,,345,00!0!!_54!00000,57ad,,345,,456,,135,00,13,,345,000,123,000,34,,456,006', 
',12,,345,00!0!!_55!,1347ab,,12468,000000000,13,,2345,00000000,23456,209',
',12,,345,00!0!!_56!,128cd,,3579,000000000,13,,2345,00000000,23456,209',
',12,,345,00!0!!_57!,128cd,,3579,000020000,13,,2345,00000000,23456,209',
',12,,345,00!0!!_58!,128cd,,3579,0000,345,0000,13,,2345,00000000,23456,209',
',12,,345,00!0!!_59!,128cd,,3579,100000000,13,,2345,00000000,23456,209',
',12,,345,00!0!!_60!,1347ab,,12468,000000000,13,,2345,00000000,23456,409',
',12,,345,00!0!!_61!,128cd,,3579,000000000,13,,2345,00000000,23456,409',
',12,,345,00!0!!_62!,128cd,,3579,100000000,13,,2345,00000000,23456,409'
],
listcode = ['ALL Stocks','','','','','','','','','**ALL User Lists'],
lprofitrcodeform = ['0: ALL','1: 0-1:1 dismal','2: 1-2:1 poor','3: 2-2.5:1 fair','4: 2.5-3.8:1 good','5: 3.8-5:1 excellent','6: > 5:1 excellent','Custom:'],
boughtcodeform = ['0: ALL','1: Neutral','2: Neutral+','3: Neutral-','4: Near Overbought','5: Near Oversold','6: Overbought','7: Oversold','8: Extreme Overbought','9: Extreme Oversold','Custom:'],
trend1codeform = ['0: ALL','1: Sideways/flat','2: Up','3: Down','4: Strong Up','5: Strong Down','6: Excessive Up','7: Excessive Down','Custom:'],
dircodeform = ['0: ALL','1: Flat','2: Up','3: Down','4: Strong Up','5: Strong Down','6: Excessive Up','7: Excessive Down','Custom:'],
changecodeform = ['0: ALL','1: Flat','2: Up','3: Down','4: Strong Up','5: Strong Down','6: Excessive Up','7: Excessive Down','Custom:'],
rescodeform = ['0: ALL','1: At support','2: Possible support','3: Above support','4: Just below support','5: At resistance','6: Possible resistance','7: Below resistance','8: Just above resistance','9: Not at resistance/support','a: At resistance/support(type unknown)','b: Possible resistance/support(type unknown)','c: Above support/resistance(type unknown)','d: Below resistance/support(type unknown)','Custom:'],
restypecodeform = ['0: ALL','1: N/A','2: Single','3: Double','4: Triple','5: Triple+','Custom:'],
resstrcodeform = ['0: ALL','1: N/A','2: Weak','3: Mild','4: Good','5: Strong','6: Very Strong','Custom:'],
bullcodeform = ['0: ALL','1: Neutral','2: Mild Bullish','3: Mild Bearish','4: Strong Bullish','5: Strong Bearish','Custom:'],
mfdircodeform = ['0: ALL','1: Neutral','2: Bullish','3: Bearish','Custom:'],
mf3dircodeform = ['0: ALL','1: Neutral','2: Accum','3: Distr','Custom:'],
mfdaycodeform = ['0: ALL','1: Light','2: Mild','3: Good','4: Strong','5: Extreme','Custom:'],
profitcodeform = ['0: ALL','1: 0-5%','2: 5-9%','3: 9-16%','4: 16-25%','5: > 25%','Custom:'],
tarpotcodeform = ['0: ALL','1: Poor','2: Fair','3: Good','4: Excellent','Custom:'],
breakoutcodeform = ['0: ALL','1: None','2: Watch','3: Possible','4: Confirmed','Custom:'],
optionablecode = ['ALL','No','Yes'], initsearchstr="", latestsearchstr="",
allowselectchange=1,
sortcode={'0':0,'1':0,'2':2,'3':27,'4':18,'5':3,'6':19,'7':4,'8':24,'9':25,'a':1,'b':20,'c':21,'d':11,'e':22,'f':23};

/* no output array, put all vars on one var */
function setuserlist(){ 
  var k, kt, sf4id=getid('sf4');
  typeofsearch="searchd";
  typeofdata="stockdata";
  if(sf4id.selectedIndex>0){
    typeofsearch="searchdu";
    typeofdata="stockdatau";
    if (sf4id.selectedIndex<=8){ 
      dataz=getlistCookie(cvnum(sf4id.selectedIndex));
      if (dataz.length>0) tempstr=dataz.split(",");
      else tempstr="";
    }
    else{
      first=1; 
      for (k=1;k<=8;k++){
        dataz=getlistCookie(cvnum(k));
        if (dataz!=""){
          if (first){
            datazstr=dataz; first=0;
          }else 
            datazstr+=','+dataz;
        }
      } 
      if (datazstr.length>0) tempstr=datazstr.split(",");
      else tempstr="";
    }
    numuserkeys=tempstr.length; 
    var target,i,j,start,end,tolook;
    if (numuserkeys>0){
      var searchdl=searchd.split(","),stockdatal=stockdata.split(","),numkeys=searchdl.length;
    }
    for (i=0;i<numuserkeys;i++){
      stockdatau[i]=tempstr[i]; 
      searchdu[i]='0000000000000000000000000000';
      j=-1; start=0; end=numkeys-1; tolook=stockdatau[i];
      while (j<0){ 
        target=mr((end+start)/2);
        if ((target!=end)&&(target!=start)){
          if (tolook<stockdatal[target]) end=target; 
          else if (tolook>stockdatal[target]) start=target;
            else if (tolook==stockdatal[target]) j=target;
        }else{ 
          if (tolook==stockdatal[start]) j=start; 
          else if (tolook == stockdatal[end]) j=end; 
            else j=15000;
        }
      }
      if (j!=15000) searchdu[i]=searchdl[j];
    }
  }
}

function getconfigstr(){
  var i,ss=getsearchstr(1,1).split(",");
  for (i=0;i<ss.length;i++) 
    if ((i!=0)&&(i%5)==0) ss[i]=' '+ss[i];
  configstr="#"+ss.join(",")+"#";
  listwin=window.open('','listwin',smallwinstr); listwin.document.open(); listwin.document.clear();
  listwin.document.write('<HTML><HEAD><TITLE>Get Search String</TITLE><link rel="stylesheet" type="text/css" href="http://www.stockconsultant.com/all5.css"></HEAD><BODY BGCOLOR="#F9F0DF">'+
  '<div style="padding:6px"><span class=zoo>Get Search String</span><BR><BR><kbd> &nbsp; &nbsp; - To copy a search string (including #..#), hold down left mouse button and highlight the string below then point to highlighted text and click right mouse button "Copy" or "Ctrl-C".</kbd><br><br>'+
  '<form style="margin:0px"><TEXTAREA class="kbd" WRAP=VIRTUAL NAME="inputstuff" COLS=40 ROWS=6>'+configstr+'</TEXTAREA></form><br><br><a HREF="javascript:window.close();"><font face="verdana" color="#0000ee">Close Window</font></a></div></BODY></HTML>');
  listwin.focus();
  listwin.document.close();
}

function setconfigstr(){
  listwin=window.open('','listwin',smallwinstr); listwin.document.open(); listwin.document.clear();
  listwin.document.write('<HTML><HEAD><TITLE>Set Search String</TITLE><link rel="stylesheet" type="text/css" href="http://www.stockconsultant.com/all5.css"><BODY BGCOLOR="#F9F0DF"><form style="margin:0px" name="winform" onSubmit="return false" METHOD="get">'+
  '<div style="padding:6px"><span class=zoo>Set Search String</span><BR><BR><kbd> &nbsp; &nbsp; - To paste a search string below (including #..#),<br>click right mouse button "Paste" or "Ctrl-V".</kbd><br><br><TEXTAREA class="kbd" WRAP=VIRTUAL NAME="inputstuff" COLS=40 ROWS=6></TEXTAREA>'+
  '<br><br><INPUT '+buttonst+' TYPE="button" NAME="button" VALUE="SET" onClick="javascript:opener.setsearchstr(this.form.inputstuff.value,1);javascript:window.close();"> &nbsp; &nbsp; <INPUT '+buttonst+' TYPE="button" NAME="button" VALUE="CANCEL" onClick="javascript:window.close()"></form></div></BODY></HTML>');
  listwin.focus();
  listwin.document.close();
}

function setuserpreset(num,name){
  listwin=window.open('','listwin',smallwinstr); listwin.document.open();listwin.document.clear();
  listwin.document.write('<HTML><head><TITLE>Set User Preset Search</TITLE><link rel="stylesheet" type="text/css" href="http://www.stockconsultant.com/all5.css"></head><BODY BGCOLOR="#F9F0DF"><form style="margin:0px" name="winform" onSubmit="return false" METHOD="get">'+
  '<div style="padding:6px"><br><span class=zoo>Enter a name for user preset search #'+num+'</span><br>(30 characters max)<br><br><input class="kbd" type=text maxlength=30 size=35 name="inputstuff" value="'+name+'">'+
  '<br><br><INPUT '+buttonst+' TYPE="button" NAME="button" VALUE="SET" onClick="javascript:opener.handlepreset('+num+',this.form.inputstuff.value);javascript:window.close();"> &nbsp; &nbsp; <INPUT '+buttonst+' TYPE="button" NAME="button" VALUE="CANCEL" onClick="javascript:window.close()"></form></div></BODY></HTML>');
  listwin.focus();
  listwin.document.close();
}


function showprescreeninfo(){
  var tempnum=getid('scpre').selectedIndex; 
  if (tempnum<1){ 
    window.alert("Select a PreScreener Search to the left, then click for Info");
    return;
  }else
    window.open('searchinfo2.html','listwin',smallwinstr).focus();
}

var selnameglob,menunameglob;
function checkformtype(selname,menuname){
  selnameglob=selname; menunameglob=menuname;
  menustr=getid(selname).options[getid(selname).selectedIndex].text;
  getid('sf5').selectedIndex=0; /* reset presets on form change */
  getid('scpre').selectedIndex=0;
  menuarray=menustr.split(":");
  if ((menuarray[0]=="CM") || (menuarray[0]=="Custom")){ 
    curitems=menuarray[1].split(","); 
    if (curitems==null) curitems="";
    menulen=getid(selname).options.length;
    menulen--;
    window.open('http://www.stockconsultant.com/consultnow/searchoptions3.html','listwin',smallwinstr).focus();
  } 
  changeactivecfg(1);
}

function makeprestrandset(){
  var i,http;
  sc666fullprestr="~"; 
  for(i=1;i<=24;i++) 
    sc666fullprestr+=sc666fullpreary[i]+"~"; 
  sc666fullprestr+=sc666fullpreary[i]; 
  getsetCookie(0,'sc666fullpre',sc666fullprestr); 
  getsetCookie(0,'sc666savedsearch',getsearchstr(1,0));
  var rannum=Math.round(Math.random(1)*1000), username=getsetCookie(1,'username',''),locationhref=window.location.href;
  if (locationhref.indexOf("#")>=0){
    locationhref=locationhref.split("#");
    locationhref=locationhref[0];
  }
  if ((sample==0)&&(checkifpres(username)!=0)&&(username.length>2)&&(username.indexOf('@')>0)){
    cleanCookie(1);
    username=username.split(",");
    document.body.style.cursor = 'wait';
    if (window.XMLHttpRequest) http = new XMLHttpRequest();
    else http = new ActiveXObject("Microsoft.XMLHTTP");  
    /*if (msbrowser) http = new ActiveXObject("Microsoft.XMLHTTP");
    else http = new XMLHttpRequest();*/
    http.open("GET","save_cookies.cgi?"+username[0]+"~none", false);
    http.send(null);
    document.body.style.cursor = 'auto';
    if (http.responseText=="1") {http.close; window.location.href=locationhref+'&'+rannum;}
    else window.location.href='http://www.stockconsultant.com/login.html?loginerror';
  }else
    window.location.reload(false);
}

function usescpre(){ 
  if (getid('scpre').selectedIndex>0)
    setsearchstr(scprestr[getid('scpre').selectedIndex],0);
  else 
    setsearchstr('0000!0!!0!0000000000000000000000000',0);
  setsearchactiveconfig();
}

function setpreset(){
  selectnum=getid('setpre').selectedIndex;
  if (selectnum>0){
    currentset=getid('sf5').options[selectnum].text.split(":");
    setuserpreset(selectnum,currentset[1]);
    getid('setpre').selectedIndex=0;
  }  
}

function handlepreset(selectnum,cc){
  var rstr="",i,j,scpreid=getid('scpre');
  scpreid.selectedIndex=0;
  if (cc.substr(0,1)==" ") cc=cc.substr(1,cc.length-1);    
    for (j=0;j<cc.length;j++){
      i=cc.charCodeAt(j);
      if ( ((i>=48)&&(i<=57))
         ||((i>=65)&&(i<=90)) 
         ||((i>=97)&&(i<=122)) 
         ||(i==44) || (i==45) 
         ||(i==32) ) rstr+=cc.substr(j,1); 
      else if (i==47) rstr+="-";
      else rstr+=" ";
    }
    cc=rstr;
    if (cc.length>30) cc=cc.substr(0,30);
    scpreid.options[selectnum].text=selectnum+": "+cc;
    getid('sf5').options[selectnum].text=selectnum+": "+cc;
    getid('sf5').selectedIndex=selectnum;
    changeactivecfg(1);
    sc666fullpreary[selectnum]=cc+":"+getsearchstr(1,0);
    makeprestrandset();
    scpreid.selectedIndex=0;
}

function usecustompre(){
  selectnum=getid('sf5').selectedIndex;
  if (selectnum>0){
    tmpstr=sc666fullpreary[selectnum];
    if (tmpstr.length>0){
      searchstr=tmpstr.split(":");
      setsearchstr(searchstr[1],0);
    }
  }else
    setsearchstr('0000!0!!0!0000000000000000000000000',0);
  getid('scpre').selectedIndex=0;
  setsearchactiveconfig();
}

function setsearchactiveconfig(){
  var j=0;
  if (getid('sf5').selectedIndex>0){
    j=16+getid('sf5').selectedIndex;
    activeconfig=activelist[1].charAt(j);
  }
  else if (getid('scpre').selectedIndex>0){
    j=getid('scpre').selectedIndex;
    activeconfig=preset_conf.charAt(j);
  } 
  else activeconfig=activelist[1].charAt(j);
  getid('cfg').selectedIndex=activeconfig;
}

function setpresetnames(){
// why??  if (typeof(document.consultinput.sf5)!='object') return;
  var i,j,tmpstr,sf5id=getid('sf5'),setpreid=getid('setpre');
  foundold=0; sc666fullprestr="";
  sc666fullprestr=getsetCookie(1,'sc666fullpre','');
  if (checkifpres(sc666fullprestr)==0){
    sc666fullprestr="~"; 
    for(i=1;i<=24;i++) sc666fullprestr+="~"; 
    getsetCookie(0,'sc666fullpre',sc666fullprestr);
  }
  sc666fullpreary=sc666fullprestr.split("~");
  j=sc666fullpreary.length;
  if (j>sf5id.options.length)
    j=sf5id.options.length;
  for (i=1;i<j;i++)
    if (sc666fullpreary[i].length>0){
      searchstr=sc666fullpreary[i].split(":");
      sf5id.options[i].text=i+': '+searchstr[0];
      if (searchstr[0].length>30)
        prestr=searchstr[0].substr(0,30);
      else 
        prestr=searchstr[0];
      setpreid.options[i].text=i+': '+prestr;
    }
//  if (document.consultinput.scpre.selectedIndex==0){
    tmpstr=getsetCookie(1,'sc666savedsearch','');
    if (checkifpres(tmpstr)==0) tmpstr="";
    if (tmpstr.length>0) setsearchstr(tmpstr,0);
//  }
  initsearchstr=getsearchstr(1,0);
}

function writeoptions(menucode,selname,heading,spaceit,useit){
  var i, arraylen,tempstr="", tempout='',addspace="",selstart='<select   ';
  if (spaceit>0) addspace=" &nbsp; ";
  if ((menucode=="customcode")||(menucode=="scprecode")) selstart+='style="font:normal 14px arial;"';
  selstart+=' id="'+selname+'"value="'+selname+'"onfocus="if(((this.length-1)==this.selectedIndex)&&('+useit+')&&(allowselectchange==1))this.selectedIndex=0;else allowselectchange=1;"onchange="';
  if (menucode=="customcode") selstart+='usecustompre()"> ';
    else if (menucode=="scprecode") selstart+='usescpre()"> ';
      else 
        selstart+='checkformtype(\''+selname+'\',\''+heading+'\')">';
  eval("arraylen="+menucode+".length;");
  for (i=0;i<arraylen;i++){
    eval("tempstr="+menucode+"["+i+"];");
    tempout+='<option>'+tempstr;
  }
  if ((menucode=="customcode")||(menucode=="scprecode")) 
    heading='<span class=st5>'+heading+'</span>';
  if (heading=='Sort by') 
    heading='<span class=st5><b>Sort by</b></span>';
  return(addspace+heading+'&nbsp;'+selstart+tempout+'</select>');
}

function setqualstr(qstr){
  var qstr=qstr.split("~"),i,sfid;
  for (i=0;i<10;i++){
    sfid=getid('sf'+(20+i));
    if (qstr[i]=="0") sfid.selectedIndex=0;
    else {
      sfid.options[sfid.length-1].text='CM:'+qstr[i]; 
      sfid.selectedIndex=sfid.length-1;
    }
  }
  getid('sf30').selectedIndex=qstr[10];
}

function setsearchstr(searchstr,ignore){ 
  var specstr,i,rstr="",j,cc;
  for (j=0;j<searchstr.length;j++){
    cc=searchstr.charCodeAt(j);
    if ( ((cc>=97)&&(cc<=122))
         || ((cc>=48)&&(cc<=57))
         || (cc==33) || (cc==44) || (cc==95) 
        ) rstr+=searchstr.substr(j,1); 
    else rstr+="";
  }
  searchstr=rstr;
  /* test length */
  curnum=0; 
  for (i=0;i<searchstr.length;i++){
    if (curnum==3){}
    else if (searchstr.substr(i,1)=="!") {i++; while (searchstr.substr(i,1)!="!"){i++; if (i>=searchstr.length) break;}}
    else if (searchstr.substr(i,1)==",") {i++; while (searchstr.substr(i,1)!=","){i++; if (i>=searchstr.length) break;}}
    else {}
    curnum++;   
  }
  if(curnum!=31){
    window.alert("Incorrect SearchStr Length or Format!");return;
  }
  curnum=0;
  for (i=0;i<searchstr.length;i++) {
    if (curnum==3) getid('sf3').selectedIndex=searchstr.substr(i,1);
    else if (searchstr.substr(i,1)=="!") 
      { 
        specstr=""; i++; while (searchstr.substr(i,1)!="!"){ specstr+=searchstr.substr(i,1); i++; if (i>=searchstr.length) break; }
        if ((curnum==5) && (specstr.substr(0,1)=="_")){
          if (ignore==0) { specstr=specstr.substr(1,specstr.length-1);
            getid('scpre').selectedIndex=parseInt(specstr);
          } else getid('scpre').selectedIndex=0;
          getid('sf'+curnum).selectedIndex=0;
        } else if (curnum==5) { 
            getid('scpre').selectedIndex=0;
            getid('sf'+curnum).selectedIndex=parseInt(specstr);
        }
        else getid('sf'+curnum).selectedIndex=parseInt(specstr);
      }
    else if (searchstr.substr(i,1)==",") { 
          specstr=""; i++; while (searchstr.substr(i,1)!=","){ specstr+=searchstr.substr(i,1)+','; i++; if (i>=searchstr.length) break;}
          specstr='CM:'+specstr.substr(0,specstr.length-1);
          var sfid=getid('sf'+curnum);
          sfid.options[sfid.length-1].text=specstr; sfid.selectedIndex=sfid.length-1;
      }
    else{ 
      specstr=searchstr.substr(i,1); found=0;
      menulen=getid('sf'+curnum).length;
      if (curnum==30) menulen++;
      var sfid=getid('sf'+curnum);
      for (j=1;j<(menulen-1);j++) 
        if (specstr==sfid.options[j].text.substr(0,1)) found=j;
      sfid.selectedIndex=found;
    }
    curnum++;   
   }
}

function getsearchstr(fullstr,special){
  var cursearchstr="";
  for (i=0;i<numofsforms;i++){
    if (i==3) cursearchstr+=getid('sf3').selectedIndex;
    else if (((i==4)||(i==5))&&(fullstr)){
      if ((getid('scpre').selectedIndex>0)&&(i==5)){
        cursearchstr+='!_'+getid('scpre').selectedIndex+'!';
      }else{
        if (special==0) cursearchstr+='!'+getid('sf'+i).selectedIndex+'!';
        else cursearchstr+='!0!';
      }
    }
    else if ( (i!=4) && (i!=5) && ((i!=30) || ((i==30) && (fullstr))) ){
      tempstr=getid('sf'+i).options[getid('sf'+i).selectedIndex].text;
      temparray=tempstr.split(':');
      if ((temparray[1]==null)||(temparray[0]=='Custom'))
        cursearchstr+="0";
      else if(temparray[0]=='CM'){
        temparray=temparray[1].split(',');
        if(temparray[0]==null)
          cursearchstr+="0";
        else{
          cursearchstr+=',';
          for (j=0;j<temparray.length;j++)
            cursearchstr+=temparray[j];
          cursearchstr+=',';
        }
      }
      else 
        cursearchstr+=temparray[0];
    }
  } // for 
  return(cursearchstr);
}

function srow(color){
  if (color>'') color="BGCOLOR="+color; 
  return('<tr><td '+color+'>');
}

function compprofitr1a(a,b){
  if (searchd[a].substr(tempcode,1)==searchd[b].substr(tempcode,1))
    return(0);  
  return ((searchd[a].substr(tempcode,1)>searchd[b].substr(tempcode,1))?-1:1); 
}

function compprofitru1a(a,b){
  if (searchdu[a].substr(tempcode,1)==searchdu[b].substr(tempcode,1))
    return(0);  
  return ((searchdu[a].substr(tempcode,1)>searchdu[b].substr(tempcode,1))?-1:1); 
}

function searchfor(){
  if (((getselected(0,0))!="")&&(!window.confirm("Stocks still selected, Continue anyway?")))
  return;
  var typeofs,i,samplenumsearch=0;
  onum=0; showst=0; idx=0; showend=6; oarry.length=0;
  window.status='SEARCHING.... PLEASE WAIT!';
  latestsearchstr=getsearchstr(1,0);
  if (initsearchstr!=latestsearchstr)
    getsetCookie(0,'sc666savedsearch',latestsearchstr);
  setuserlist();
  var cursearchstr=getsearchstr(0,0),alltrue=1,curnum=0,allmap=1,doand=0,addaor=0,mapnum=0;
  if (typeofsearch!="searchdu") typeofs="searchdl";
  else typeofs="searchdu";
  if (typeofs=="searchdu") var evalstr="var i,numuk=numuserkeys;for(i=0;i<numuk;i++){if(";
    else var evalstr='var searchdl=searchd.split(","),i,numk=searchdl.length;for(i=0;i<numk;i++){if(';
  for (i=0;i<cursearchstr.length;i++){
    doand=1; mapnum=therealnum[curnum];
    if (mapnum>=0){
      if (cursearchstr.substr(i,1)=='0') doand=0;
      else if (cursearchstr.substr(i,1)==','){
        i++; addaor=1; evalstr+="(";
        while (cursearchstr.substr(i,1)!=','){
          evalstr+="("+typeofs+"[i].substr("+mapnum+",1)=='"+cursearchstr.substr(i,1)+"')";
          if (cursearchstr.substr(i+1,1)!=',')  evalstr+="||";
          i++;
        }
        evalstr+=")";
      }else{
        evalstr+="("+typeofs+"[i].substr("+mapnum+",1)=='"+cursearchstr.substr(i,1)+"')"; 
        if (i==(cursearchstr.length-1)) addaor=1; 
      }
    }else
      doand=0;
    if ((i!=(cursearchstr.length-1))&&(doand)){ 
      evalstr+="&&";
      addaor=0;
    }
  curnum++;
  } // for
  if (addaor) evalstr+="&&(1)";
  else evalstr+="(1)";
  evalstr+="){oarry[onum]=i;onum++;}}";
  eval(evalstr);
  if (sample==1) samplenumsearch=onum;
  if((sample==1)&&(onum>3)){onum=3;oarry.length=3;}
  toomanysorts=true;
  var sf30id=getid('sf30');
  if (sf30id.selectedIndex>0) { 
    if(onum>1400) toomanysorts=confirm("There are "+onum+" results, sorting may take time");
    if (toomanysorts!=false){
      sorttemp=sf30id.options[sf30id.selectedIndex].text.split(":");
      sorttemp=sorttemp[0];
      evalstr="var tempcode="+sortcode[sorttemp]+";";
      if (typeofs=="searchdl") 
        evalstr+="function compprofitr1a(a,b){if(searchdl[a].substr(tempcode,1)==searchdl[b].substr(tempcode,1))return(0); return((searchdl[a].substr(tempcode,1)>searchdl[b].substr(tempcode,1))? -1 : 1); };oarry.sort(compprofitr1a);";else  evalstr+="function compprofitru1a(a,b){if(searchdu[a].substr(tempcode,1)==searchdu[b].substr(tempcode,1)){return(0);};return((searchdu[a].substr(tempcode,1)>searchdu[b].substr(tempcode,1))?-1:1);};oarry.sort(compprofitru1a);";  
      eval(evalstr);
    }else 
      sf30id.selectedIndex=0;
  }
  if (toomanysorts!=false){
    window.status='SEARCH DONE!';
    extot=stotal=onum; sfrom=0; 
    if (sample==1) extot=samplenumsearch;
    if (onum>numstocks) stoo=numstocks; 
    else stoo=onum;
    var tmpz='',pg=onum; 
    if (pg>200) pg=200;
    if (typeofs=="searchdu"){
      for (i=0; i<pg; i++) tmpz+=stockdatau[oarry[i]]+',';
    }else{
      var stockdatal=stockdata.split(",");
      for (i=0;i<pg;i++) 
        tmpz+=stockdatal[oarry[i]]+','; 
    }
    if (pg>0) tmpz=tmpz.substr(0,tmpz.length-1);
    if (initsearchstr!=latestsearchstr) consult(tmpz,0,0,2,1); 
    else consult(tmpz,0,0,2,0); 
  }
}

function daysbcall2(){
  if (initsearchstr!=getsearchstr(1,0)) 
    getsetCookie(0,'sc666savedsearch',getsearchstr(1,0));
  dbak=getid('daysb2').selectedIndex; 
  consult("**NONE",0,0,0,0); 
}

function writeentryforms(){
  var outstr='<table border=0 cellspacing=6 cellpadding=0 width='+(standwidthout-22)+'>',
  divsp='<div style="position:relative;top:0px;left:0px;height:6px;"><!-- --></div>',
  n,k,sortit,l3=[],i=0;
  for (k=1;k<=8;k++){
    n=cvnum(k); 
    sortit=mystocks2[n].split("|"); 
    listcode[k]=sortit[0];
  }
  
    l3[i++]=divsp+'<div style="background:#d8efff;border:1px solid #bbbbbb;padding:3px;margin:3px;"><table BORDER=0 CELLSPACING=4 CELLPADDING=0 width='+(standwidthout-18)+'><tr><td nowrap><table BORDER=0 CELLSPACING=0 CELLPADDING=0 width=100%><tr><td><span class=st5>'+writeoptions('customcode',"sf5","Recall User Preset",0,0)+'</span></td><td align=right><a class=sm3b HREF="javascript:setsearchstr(\'0000!0!!0!0000000000000000000000000\',0)"><b>Reset Search</b></a>&nbsp; </td></tr></table></td></tr>';
    l3[i++]='<tr><td nowrap><span class=st5>'+writeoptions('scprecode',"scpre","Recall PreScreen",0,0)+'</span>&nbsp; &#8594;<a onmouseover="isl=1;"onmouseout="isl=0;"href="javascript:showprescreeninfo();"><font face="verdana" color="#0000ff">Info</font></a></td></tr>';
    l3[i++]='<tr><td nowrap><hr width=85% size=1 noshade style="color:#999999;" align=center><table BORDER=0 CELLSPACING=0 CELLPADDING=0 width=100%><tr><td><span class=st5><b>Set Search</b> as User Preset <select style="font:normal 14px arial;" id="setpre" onChange="setpreset()"><option>0: None__________________________ <option>1:<option>2:<option>3:<option>4:<option>5:<option>6:<option>7:<option>8:<option>9:<option>10:<option>11:<option>12:<option>13:<option>14:<option>15:<option>16:<option>17:<option>18:<option>19:<option>20:<option>21:<option>22:<option>23:<option>24:<option>25:</SELECT></span></td><td align=right><span class=z4><b>SearchString:</b> </span><a class=sm3b onmouseover="isl=1;"onmouseout="isl=0;"href="javascript:getconfigstr();">Get</a> &nbsp;<a class=sm3b onmouseover="isl=1;"onmouseout="isl=0;"href="javascript:setconfigstr();">Set</a>&nbsp; </td></tr></table></td></tr>';
    l3[i++]='</table></div>';
    l3[i++]='<div class=sff><span class=headb>OVERALL</span>'+writeoptions('pricecodeform','sf0','Price',1,1)+writeoptions('volcodeform','sf1','Typ Volume',1,1)+writeoptions('ratedcodeform',"sf2","Overall Summary",1,1)+'</div>';
    l3[i++]='<div class=se7>'+outstr+'<span class=headb>POSITIONING</span>'+writeoptions('changecodeform',"sf10","1 Day Change",1,1)+writeoptions('dircodeform',"sf9","Short Term Direction",1,1)+'</td></tr><tr><td>'+writeoptions('boughtcodeform',"sf7","Overbought/sold",0,1)+writeoptions('trend1codeform',"sf8","1 Month Trend",1,1)+'</td></tr><tr><td>'+writeoptions('trendcodeform',"sf6","Intermediate Trend",0,1)+'</td></tr><tr><td>'+writeoptions('rescodeform',"sf11","Res/support",0,1)+writeoptions('restypecodeform',"sf12","Res/sup Type",1,1)+writeoptions('resstrcodeform',"sf13","Res/sup Strength",1,1)+'</td></tr></table></div>';
    l3[i++]='<div class=sff>'+outstr+'<span class=headb>TIMING</span>'+writeoptions('bullcodeform',"sf14","3 Day Chart Alert",1,1)+writeoptions('mf3dircodeform',"sf15","Accum/Distr",1,1)+writeoptions('mfdaycodeform',"sf16","Accum/Distr Strength",1,1)+'</td></tr><tr><td>'+writeoptions('mfdircodeform',"sf17","1 Day Money Flow",0,1)+writeoptions('mfdaycodeform',"sf18","MF Strength",1,1)+writeoptions('profitcodeform',"sf19","Typical Rallies/Pullbacks",1,1)+'</td></tr></table></div>';
    l3[i++]='<div style="background:#d8efff;border:1px solid #bbbbbb;padding:3px;margin:3px;"><table BORDER=0 CELLSPACING=4 CELLPADDING=0 width='+(standwidthout-18)+'><tr><td nowrap><span class=st5><b>Set high trade quality for:</b> &nbsp; <a style="color:#0000ff;text-decoration:underline;cursor:pointer;" onclick="javascript:setqualstr(\'3,4,5~3,4~4,5,6~0~0~0~0~0~0~0~4\');window.alert(\'Updated!\')">Upside</a> &nbsp;&nbsp; <a style="color:#0000ff;text-decoration:underline;cursor:pointer;" onclick="javascript:setqualstr(\'0~0~0~0~0~3,4,5~3,4~4,5,6~0~0~6\');window.alert(\'Updated!\')">Downside</a> &nbsp;&nbsp; <a style="color:#0000ff;text-decoration:underline;cursor:pointer;" onclick="javascript:setqualstr(\'0~0~3,4,5,6~2,3,4~3,4,5~0~0~0~0~0~8\');window.alert(\'Updated!\')">Breakout</a> &nbsp;&nbsp; <a style="color:#0000ff;text-decoration:underline;cursor:pointer;" onclick="javascript:setqualstr(\'0~0~0~0~0~0~0~3,4,5,6~2,3,4~3,4,5~9\');window.alert(\'Updated!\')">Breakdown</a></span> &nbsp; <span class=st5>trades.</span></td></tr>';
    l3[i++]='</table></div>';    
    l3[i++]='<div class=se7>'+outstr+'<span class=headb>UPSIDE TRADE</span>'+writeoptions('profitcodeform',"sf20","Target 1 Profit",1,1)+writeoptions('lprofitrcodeform',"sf22","Profit/Loss",1,1)+writeoptions('tarpotcodeform',"sf21","Target 1 Potential",1,1)+'</td></tr><tr><td>'+writeoptions('breakoutcodeform',"sf23","Breakout",0,1)+writeoptions('profitcodeform',"sf24","Breakout Profit",1,1)+'</td></tr></table></div>';
    l3[i++]='<div class=sff>'+outstr+'<span class=headb>DOWNSIDE TRADE</span>'+writeoptions('profitcodeform',"sf25","Target 1 Profit",1,1)+writeoptions('lprofitrcodeform',"sf27","Profit/Loss",1,1)+writeoptions('tarpotcodeform',"sf26","Target 1 Potential",1,1)+'</td></tr><tr><td>'+writeoptions('breakoutcodeform',"sf28","Breakdown",0,1)+writeoptions('profitcodeform',"sf29","Breakdown Profit",1,1)+'</td></tr></table></div>';
    l3[i++]='<div style="background:#d8efff;border:1px solid #bbbbbb;padding:3px;padding-left:0px;margin-left:3px;margin-right:3px;"><table border=0 cellspacing=2 cellpadding=0 width='+(standwidthout-18)+'><tr><td nowrap>'+writeoptions('sortbycodeform','sf30','Sort by',1,0)+' &nbsp; &nbsp; '+writeoptions('optionablecode',"sf3","Options",1,0)+' &nbsp; &nbsp; '+writeoptions('listcode',"sf4","Use List",0,0)+'</td><td nowrap align=right><a href="../help/stocksearchtool.html" target="_blank"><b>SearchTool Help</b></a> &nbsp; </td></tr></table></div>'+divsp+'</div>';
  document.write(l3.join(""));
}
doneloading3=1;

