// This file contains intellectual property and artistic creations 
// by Dennis Sandow and is copyright 2000-2010 by the author. 
// For use only on websites maintained by Dennis Sandow, or with
// specific permission.  Do not remove this notice.

var StreetCt=0;  
function oneLine(Ord,posnInColumn){
  mapvar=Strs[stno].split('|')[1]; mappix='picts/map'+mapvar+'.jpg';
  mapURL='map'+mapvar+'.htm';
  Hilite=Strs[stno].split('|')[2]; Fo1=''; Fo2='';
  if (Hilite == 'R' ) {Fo1 = '<font color=red><b>'; Fo2 = '</b></font>';};
  if (Hilite == 'G' ) {Fo1 = '<font color=green><b>'; Fo2 = '</b></font>';};
  if (Hilite == 'M' ) {Fo1 = '<font color=magenta><b>'; Fo2 = '</b></font>';};
  outL = '';
  if ( posnInColumn ) outL += '<br>';
  outL += '<a href="javascript:NewWd(\''+mapURL+'\',\'map'+mapvar+'\')" '+
    'onMouseout="window.status=window.defaultStatus; return true;" '+
    'onMouseover="window.status=\'View Map\'; return true;" '+
    '>'+Fo1+ Solid( Strs[stno].split('|')[0] ) +Fo2+'</a>';
  return outL
};
  
  alim=10;
  Strs = StreetList.sort(); 
  gatect=0; poict=0; st1ct=0; st2ct=0; st3ct=0;
  for (stno =0; stno < Strs.length; stno++) {
//  if (alim-- >= 0 ) alert( Strs[stno]+'  '+Strs[stno].substr(0,1) );
    if ( Strs[stno].substr(1,1) == '-' ) { gatect++ ; continue; };
    if ( Strs[stno].split('|')[2] ) { poict++ ; continue; };
    if ( Strs[stno].substr(0,1) <= 'G' ) { st1ct++; continue; };
    if ( Strs[stno].substr(0,1) <= 'O' ) { st2ct++; continue; };
    st3ct++;
  };
  
  Captn['alllist']='Combined List '+st1ct+'+'+st2ct+'+'+st3ct+'+'+poict+'+'+gatect+'='+Strs.length;
  sttemp1='<table width=100% border=0 cellpadding=3 cellspacing=0><tr valign=top><td class=v8>'; 
  sttemp2=sttemp1; sttemp3=sttemp1; alltemp=sttemp1; gatetemp=''; poitemp=sttemp1; 
  numcolsHalf=3; numcolsWhole=5; numcolsPOI=2;
  st1percol = Math.ceil(st1ct/numcolsHalf);
  st2percol = Math.ceil(st2ct/numcolsHalf);
  st3percol = Math.ceil(st3ct/numcolsHalf);
  poipercol = Math.ceil(poict/numcolsPOI);
  allpercol = Math.ceil( Strs.length/numcolsWhole);
// alert ( Strs.length+' '+gatect+' '+poict+' '+stct+' '+stpercol+' '+allpercol );  
  gatect=0; poict=0; st1ct=0; st2ct=0; st3ct=0; allct=0
  for (stno =0; stno < Strs.length; stno++) {
    alltemp += oneLine(stno,allct++);
    if ( allct == allpercol ) { alltemp += '</td><td class=v8>'; allct=0; };
    if ( Strs[stno].substr(1,1) == '-' ) { 
      gatetemp += oneLine(stno,gatect++);
    } else if ( Strs[stno].split('|')[2] ) { 
      poitemp += oneLine(stno,poict++)
      if ( poict == poipercol ) { poitemp += '</td><td class=v8>'; poict=0; };
     } else if ( Strs[stno].substr(0,1) <= 'G' ) {
      sttemp1 += oneLine(stno,st1ct++);
      if ( st1ct == st1percol ) { sttemp1 += '</td><td class=v8>'; st1ct=0; };
     } else if ( Strs[stno].substr(0,1) <= 'O' ) {
      sttemp2 += oneLine(stno,st2ct++);
      if ( st2ct == st2percol ) { sttemp2 += '</td><td class=v8>'; st2ct=0; };
    } else {
      sttemp3 += oneLine(stno,st3ct++);
      if ( st3ct == st3percol ) { sttemp3 += '</td><td class=v8>'; st3ct=0; };
    };

  };
  Mesage['streetlist1']=sttemp1+'</td></tr></table>';
  Mesage['streetlist2']=sttemp2+'</td></tr></table>';
  Mesage['streetlist3']=sttemp3+'</td></tr></table>';
  Mesage['POIlist']=poitemp;
  Mesage['gatewaylist']=gatetemp;
  Mesage['alllist']=alltemp;
  Captn['streetlist1']='Streets A-G';
  Captn['streetlist2']='Streets H-O';
  Captn['streetlist3']='Streets P-Z';
  Captn['POIlist']='Points of Interest and Parks';
  Captn['gatewaylist']='Gateways to Long Hill Township';

