var tableArray = new Array(), mapcoords = new Array(), picLink = new Array(), tableIdx=0, mapIdx=0;
function PixLine(){
  picLink[0] = '<tr><td><b>'+arguments[0].toUpperCase()+' - '+arguments[1]+'</b>'+
          '<br>'+arguments[2]+'<br>'+arguments[3]+
          '<br>'+arguments[4]+'<br>'+arguments[5]+'.</td>';
  plc=0;
  for (sl=1; sl<=3; sl++){
    lohi='lo';slx='s';slwd='small';slwdC='Small';wsiz=-9;
    if(sl==2){lohi='hi';slx=''; slwd='large';slwdC='Large';wsiz=-6; };
    if(sl==3){lohi='09';slx='v'; slwd='verylarge';slwdC='Very Large';wsiz=-6; };
    for (ud=1; ud<=2; ud++){
      udx='u';udwd='upstream';udwdC='Upstream';
      if(ud==2){udx='d'; udwd='downstream';udwdC='Downstream';};
//minverlo/xx1us.jpg  minverhi/xx1u.jpg  
//minver09/XX1 up.jpg (manual>)  minver09/xx1uv.jpg
      if (sl==3 && ( typeof arguments[7] == udf || arguments[7].indexOf(udx) < 0) ) {
        picLink[++plc]=''; continue; 
      };
      picLink[++plc] = '<a href="javascript:NewWd(\''+pixPath+'minver'+lohi+'/'+
          arguments[0]+udx+slx+'.jpg\','+
          '\'minvsitephoto_'+arguments[0]+udx+'_'+slwd+'\','+wsiz+')" '+ 
          ' onMouseover="window.status=\''+slwdC+' image of '+arguments[1]+
          ' facing '+udwd+'\'; return true;" '+
          ' onMouseout="window.status=window.defaultStatus; return true;"'+
          '>'+udwdC+'</a>';
    };
  };
  tableArray[tableIdx++] = picLink[0]+
    '<td valign=center align=center>'+picLink[1]+'<br>'+picLink[2]+'</td>'+
    '<td valign=center align=center>'+picLink[3]+'<br>'+picLink[4]+'</td>'+
    '<td valign=center align=center>'+picLink[5]+'&nbsp;<br>'+picLink[6]+'&nbsp;</td>'+
    '</tr>';
  if( typeof arguments[6] == 'undefined' || ! arguments[6] ) return;
  mapcoords[mapIdx++] = arguments[0]+','+arguments[6]+','+arguments[1];
  Captn[arguments[0]] = arguments[0].toUpperCase()+' - '+arguments[1];
  Mesage[arguments[0]] = arguments[2]+'<br>'+arguments[3]+'<br>'+arguments[4]+
                         '<br>'+arguments[5]+'<br>'+
                         '<center>Photos: '+picLink[1]+'&nbsp;&nbsp;'+picLink[2]+
                         '<br>Large photos: '+picLink[3]+'&nbsp;&nbsp;'+picLink[4]+
                         
                         ( (picLink[5] || picLink[6])?'<br>Very Large photos: '+picLink[5]+'&nbsp;&nbsp;'+picLink[6]:'' )+
                         
                         '</center>';
  return;
};
function mapWrite(){
  for (x=0; x<mapIdx;x++){
    mapFrag=new Array(); mapFrag=mapcoords[x].split(',');
    document.write('<area shape="circle" coords="'+mapFrag[1]+','+mapFrag[2]+',20" '+
      'href="javascript:void(0)" '+
      'onmouseover="return HintPop(\''+mapFrag[0]+'\',\''+mapFrag[3]+'\',-400)" '+
      'onmouseout="xnd()">');
  };
};
function tableWrite(){
  for (x=0; x<tableIdx;x++){
    document.write(tableArray[x]);
  };
};

PixLine('bb1','Black Brook Site 1',
        'Downstream of Southern Blvd bridge (Fairmont Country Club)',
        'Chatham Township',
        'Order: 1; Gradient: 0 ',
        'Golf Course, erosion: heavy, channelized, small impoundment',
        '700,630');
PixLine('bb2','Black Brook Site 2',
        'Downstream of  Tanglewood Lane bridge; Sewage Treat. Plant',
        'Chatham Township',
        'Order:1 Gradient: 0',
        'Forested/STP, erosion, moderate, channelized, no dam',
        '700,710');
PixLine('lb1','Loantaka Brook site 1',
        'Downstream of Green Village Rd. bridge',
        'Chatham Township',
        'Order 3: Gradient: 0.002',
        'Forest/field, erosion: heavy, channelized, no',
        '595,605','ud');
PixLine('lb2','Loantaka Brook site 2',
        '50 yards downstream from Kitchell Pond bridge',
        'Morris Township',
        'Order: 2; Gradient: 0.002',
        'Forest/productive pond, erosion: heavy, channelized, no dam',
        '570,445','ud');
PixLine('lb3','Loantaka Brook site 3',
        '50 yards downstream from Morris Township STP',
        'Morris Township',
        'Order 2: Gradient: 0',
        'Forest/STP, erosion: heavy, channelized, no dam',
        '525,405','ud');
PixLine('lb4','Loantaka Brook site 4',
        'Opposite municipal pool at Fanok Rd',
        'Morris Township',
        'Order 1: Gradient: 0',
        'Residential/ Pool, erosion: heavy, channelized, no dam',
        '515,360','ud');
PixLine('gb2','Great Brook site 2',
        'Upstream of Woodland Rd. (Green Village) bridge',
        'Harding Township',
        'Order: 2; Gradient: 0.002',
        'Field/horses, erosion: moderate, channelized, no dam',
        '540,635','u');
PixLine('gb3','Great Brook site 3',
        'Downstream from Blue Mill Rd bridge',
        'Harding Township',
        'Order: 2; Gradient: 0.002',
        'Field/Residential moderate, no channelization,  dam',
        '515,550','ud');
PixLine('gb4','Great Brook site 4',
        'Downstream of bridge to offices off Blackberry Lane (James St.)',
        'Morris Township',
        'Order:1; Gradient:0',
        'Commercial, erosion: heavy, channelized, no dam',
        '450,420','ud');
PixLine('gb5','Great Brook site 5',
        'Upstream of James St. bridge (near Erskine Dr.',
        'Morristown',
        'Order: 1; Gradient:0.003 ',
        'Forest/residential, erosion: heavy, channelized, dam',
        '450,340','ud');
PixLine('pb1','Primrose Brook site 1',
        'Downstream of Lee\'s Mill Rd. bridge ',
        'Harding Township',
        'Order: 2; Gradient:0.002',
        'Field,  erosion: moderate, no channelization, no dam',
        '295,670','ud');
PixLine('pb2','Primrose Brook site 2',
        'Off Bailey\'s Mill Rd. (Opposite Youngs Rd.)',
        'Harding Township',
        'Order: 2; Gradient:0.006',
        'Forest/pond, erosion: moderate, no channelization, nearby dam',
        '240,620','ud');
PixLine('pb3','Primrose Brook site 3',
        'Downstream of Tempe Wick Rd bridge',
        'Harding Township',
        'Order: 2; Gradient:0.013',
        'Forest/residential, erosion: moderate, no channelization, dam',
        '225,515','ud');
PixLine('pr1','Passaic River site 1',
        '200 yards downstream of Osborn Pond at Lee\'s Mill Rd',
        'Bernards Township',
        'Order: 3; Gradient: 0',
        'Forest/residential, erosion: heavy, channelized, dam',
        '225,720');
PixLine('pr2','Passaic River site 2',
        'Downstream of northbound I-287 bridge',
        'Bernards Township',
        'Order: 3; Gradient:0.006 ',
        'Forest/Highway, erosion: heavy, channelized, dam',
        '205,640');
PixLine('pr3','Passaic River site 3',
        'Off Hardscrabble Rd.  (opposite Butternut Rd.)',
        'Bernardsville',
        'Order: 3; Gradient:0.006 ',
        'Forest erosion: heavy, not channelized, no dam',
        '140,625','ud');
PixLine('ig1','Indian Grave Brook site 1',
        'Downstream of Chestnut Avenue bridge',
        'Bernardsville',
        'Order: 2; Gradient:0.017',
        'Field/forest, erosion: low, channelized, dam',
        '125,585','ud');
