// 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 RndMod=5000 ;
var PixACTIVE=1, PixPENDING= -1, PixHIDDEN=0 ;
var DocWriteThisFragmentInline=0, DefaultHpixCaption='';
var activeIndex='|', pendingIndex='|', prelimScan=1;
    for ( ImgX = 900; ImgX <= 1130; ImgX++ ) {
      switch ( InsetPixSelector(ImgX) ){
        case 1: activeIndex += ImgX+'|'; break;
        case -1: pendingIndex += ImgX+'|'; break;
      }; 
    };
var AllActives = new Array(); AllActives=activeIndex.split('|');
var AllPending = new Array(); AllPending=pendingIndex.split('|');
prelimScan=0;
var HpixChoices=AllActives.length-2;

function OneInset(){
  DocWriteThisFragmentInline=1; 
  ImgKey=parseInt(location.search.substring(1,5)); 
  if( ! ImgKey ) {
    ImgDate=new Date(); 
    ImgRandomIndex = Math.floor( 1 + ImgDate.valueOf()%(RndMod*HpixChoices) / RndMod ) ;
    ImgKey = parseInt( AllActives[ImgRandomIndex] );
  };
  document.write(InsetPixSelector(ImgKey));
};

function StuffAllPix(){ 
    DocWriteThisFragmentInline=0; 
    AllPixAccum = ''; DefaultHpixCaption='<i>no caption</i>';
    for ( ImgX = 1; ImgX <= AllActives.length-1; ImgX++ ) {
      ImgKey = parseInt( AllActives[ImgX] );
      AllPixAccum += InsetPixSelector(ImgKey); };
    for ( ImgX = 1; ImgX <= AllPending.length-1; ImgX++ ) {
      ImgKey = parseInt( AllPending[ImgX] );
      AllPixAccum += InsetPixSelector(ImgKey); };
    Mesage['AllHomePix'] ='<center>'+ AllPixAccum +'</center>';
    Captn['AllHomePix'] = 'All the images in the Home Page rotation'; 
};

function InsetPixSelector(ImgKeyLcl){
  HpixName=''; HpixWidth='50'; HpixHeight='50';
  HpixAlt='Inset Image'; HpixCaption=''; HpixCaption2='';

  HpixCaption=''; HpixCaption2=''; HpixStatus=PixHIDDEN;
  switch (ImgKeyLcl) {
  case (904): HpixName='linotype.jpg';
              HpixStatus=PixACTIVE;
              HpixWidth='166';
              HpixHeight='294';
              HpixAlt='Modern Sculpture';
              HpixCaption='Sculpture on Mercer Street';
              HpixCaption2='at Recorder Publishing';
              break;
  case (908): HpixName='homesec.jpg';
              HpixStatus=PixPENDING;
              HpixWidth='173';
              HpixHeight='232';
              HpixAlt='Homeland Security Sign';
              HpixCaption='To Protect and Serve';
              HpixCaption2='Signs at the roadway entrances to Long Hill Township';
              break;
  case (911): HpixName='ssjbell2.jpg';
              HpixStatus=PixACTIVE;
              HpixWidth='137';
              HpixHeight='256';
              HpixAlt='Bell Tower at the Shrine';
              HpixCaption='New <b>Tower of Remembrance</b> at the<br>Shrine of St. Joseph';
              HpixCaption2='made from WTC steel '+
                '<br><a href=churches.htm#bell>Aerial Photo</a>&nbsp;&nbsp; '+
                '<a href="javascript:NewWd(\'http://stshrine.org/announcements.htm\',\'belltower\')">Details</a>';
//                '<br>The bells toll at 47 minutes past the hour from 8:47AM to 8:47PM.';
              break;
  case (915): HpixName='bhladder.jpg';
              HpixStatus=PixACTIVE;
              HpixWidth='217';
              HpixHeight='144';
              HpixAlt='Berkeley Heights Ladder Truck';
              HpixCaption='UFO over Stirling';
              HpixCaption2='July 1, 2009';
              break;
 case (1011): HpixName='snobrd23.jpg';
              HpixStatus=PixPENDING;
              HpixWidth='193';
              HpixHeight='275';
              HpixAlt='Snowboarding';
              HpixCaption='Snowboarding behind Central&nbsp;School';
              HpixCaption2='February, 2003';
              break;
 case (1012): HpixName='snowman1.jpg';
              HpixStatus=PixHIDDEN;
            HpixStatus=PixPENDING;
              HpixWidth='125';
              HpixHeight='200';
              HpixAlt='Snowman on Skyline Drive';
              HpixCaption='Snowman on Skyline Drive';
              break;
 case (1014): HpixName='yr2003.gif';
              HpixStatus=PixPENDING;
              HpixWidth='160';
              HpixHeight='100';
              HpixAlt='Welcome 2003';
              break;
 case (1021): HpixName='valencnd.gif';
              HpixStatus=PixPENDING;
              HpixWidth='100';
              HpixHeight='85';
              HpixAlt='Candy Box';
              HpixCaption='Happy Valentines Day';
              break;
 case (1022): HpixName='groundhg.gif';
              HpixStatus=PixPENDING;
              HpixWidth='150';
              HpixHeight='100';
              HpixAlt='Groundhog';
              HpixCaption='Sunday';
              break;
 case (1023): HpixName='yrofram.jpg';
              HpixStatus=PixPENDING;
              HpixWidth='255';
              HpixHeight='157';
              HpixAlt='USPS stamp for Year of the Ram';
              HpixCaption='Chinese New Year February 1<br>The Year of the Ram (or goat or black sheep). Year 4701 (or 4700) in the Chinese calendar.';
//            HpixCaption2='Any reader who can explain the conflicting references should email the Webmaster.';
              HpixCaption2='<a href="javascript:NewWd(\'http://www.chineseastrologyonline.com/2003.htm\',\'chinesenewyear\')">Learn more</a>';
              break;
 case (1025): HpixName='usflagl.gif';
              HpixStatus=PixACTIVE;
             HpixStatus=PixPENDING;
              HpixWidth='100';
              HpixHeight='57';
              HpixAlt='U.S. flag';
              HpixCaption='Presidents Day';
              HpixCaption2='February 19';
              break;
 case (1027): HpixName='snowman2.jpg';
              HpixStatus=PixPENDING;
              HpixWidth='226';
              HpixHeight='323';
              HpixAlt='Snowman on Winding Way';
              HpixCaption='Snowman on Winding Way';
              HpixCaption2='February 19, 2003';
              break;
 case (1028): HpixName='snopicnc.jpg';
              HpixStatus=PixPENDING;
              HpixWidth='197';
              HpixHeight='132';
              HpixAlt='Picnic Table';
              HpixCaption='Presidents Day Picnic postponed';
              HpixCaption2='February 17, 2003';
              break;
 case (1029): HpixName='sno21703.jpg';
              HpixStatus=PixPENDING;
              HpixWidth='142';
              HpixHeight='152';
              HpixAlt='Snow bank at 16.5 inches';
              HpixCaption='February 17, 2003 2:00&nbsp;PM';
              break;
 case (1031): HpixName='goosoccr.jpg';
              HpixStatus=PixPENDING;
              HpixWidth='255';
              HpixHeight='180';
              HpixAlt='Geese at Riverside Park';
              HpixCaption='Getting ready for the Soccer Season';
              HpixCaption2='Geese at Riverside Park in March';
              break;
 case (1032): HpixName='mallgull.jpg';
              HpixStatus=PixPENDING;
              HpixWidth='249';
              HpixHeight='299';
              HpixAlt='Seagulls at Valley Mall';
              HpixCaption='Gulls at Valley Mall in March';
              HpixCaption2='Clever subtitles welcome. Email Webmaster';
              break;
 case (1033): HpixName='moosgilt.jpg';
              HpixStatus=PixACTIVE;
          HpixStatus=PixPENDING;
              HpixWidth='190';
              HpixHeight='266';
              HpixAlt='Moose in Gillette';
              HpixCaption='Moose come out of the swamp to eat our shrubs';
              HpixCaption2='This one seen on Lacey Ave.';
              break;
 case (1034): HpixName='yellowrb.jpg';
              HpixStatus=PixACTIVE;
          HpixStatus=PixPENDING;
              HpixWidth='168';
              HpixHeight='340';
              HpixAlt='Yellow Ribbon on Skyline Drive';
              HpixCaption='Large yellow ribbon on Skyline Drive';
              HpixCaption2='March 31, 2003';
              break;
 case (1035): HpixName='yellowr2.jpg';
              HpixStatus=PixACTIVE;
          HpixStatus=PixPENDING;
              HpixWidth='199';
              HpixHeight='319';
              HpixAlt='Yellow Ribbon on Main Avenue';
              HpixCaption='Tom DeLia installed yellow ribbons on Main Avenue';
              HpixCaption2='March 31, 2003';
              break;
 case (1041): HpixName='kidslow1.jpg';
              HpixStatus=PixACTIVE;
              HpixWidth='200';
              HpixHeight='160';
              HpixAlt='Child Warning Thing';
              HpixCaption='Our Children are in<br>the streets. Drive Slowly';
              HpixCaption2='Warning sign on Skyline Drive';
              break;
 case (1042): HpixName='gooseboc.jpg';
              HpixStatus=PixPENDING;
              HpixWidth='197';
              HpixHeight='230';
              HpixAlt='Goose at Recreation Fields';
              HpixCaption='Inspecting the Bocci Court';
              HpixCaption2='or is he just looking for a pickup match?';
              break;
 case (1043): HpixName='turtle62.jpg';
              HpixStatus=PixACTIVE;
              HpixWidth='230';
              HpixHeight='192';
              HpixAlt='Turtle in the road';
              HpixCaption='Watch out for deer, children, bicycles and turtles on our streets.';
              HpixCaption2='';
              break;
 case (1044): HpixName='daffs.jpg';
              HpixStatus=PixPENDING;
              HpixWidth='240';
              HpixHeight='278';
              HpixAlt='Daffodils';
              HpixCaption='April 7, 2003.';
              HpixCaption2='';
              break;
 case (1045): HpixName='goosedau.jpg';
              HpixStatus=PixACTIVE;
          HpixStatus=PixPENDING;
              HpixWidth='177';
              HpixHeight='299';
              HpixAlt='Another Goose';
              HpixCaption='The geese are everywhere';
              HpixCaption2='Homestead Park';
              break;
 case (1051): HpixName='turtle52.jpg';
              HpixStatus=PixACTIVE;
              HpixWidth='236';
              HpixHeight='181';
              HpixAlt='Turtles in the Great Swamp';
              HpixCaption='Turtles basking in the Great Swamp';
              HpixCaption2='Photo by Len Hamilton';
              break;
 case (1052): HpixName='goslings.jpg';
              HpixStatus=PixPENDING;
              HpixWidth='180';
              HpixHeight='116';
              HpixAlt='Goslings in the Great Swamp';
              HpixCaption='Goslings in Hines Pond<br>in the Great Swamp';
              HpixCaption2='Photo by Len Hamilton';
              break;
 case (1053): HpixName='duck402a.jpg';
              HpixStatus=PixPENDING;
              HpixWidth='200';
              HpixHeight='100';
              HpixAlt='Ducks at Stirling Lake';
              HpixCaption='Ducks in Stirling Lake';
              HpixCaption2='April 13, 2002';
              break;
 case (1054): HpixName='flowstrr.jpg';
              HpixStatus=PixPENDING;
              HpixWidth='202';
              HpixHeight='408';
              HpixAlt='Flowers at Stirling RR';
              HpixCaption='Flowers in the park at Stirling Station';
              HpixCaption2='donated and planted by the Joe DuPont family';
              break;
 case (1056): HpixName='lsctree1.jpg';
              HpixStatus=PixACTIVE;
            HpixStatus=PixPENDING;
              HpixWidth='176';
              HpixHeight='288';
              HpixAlt='Arbor Day at LSC';
              HpixCaption='Shade Tree Commission members Phyllis Fast and David Welch plant a tree on Arbor Day, 2003';
              HpixCaption2='In the WTC Memorial Grove at Liberty Science Center';
              break;
 case (1057): HpixName='momdaani.gif';
              HpixStatus=PixHIDDEN;
            HpixStatus=PixPENDING;
              HpixWidth='130';
              HpixHeight='112';
              HpixAlt='Mother\'s Day';
              HpixCaption='Mother\'s Day Sunday';
              HpixCaption2='';
              break;
 case (1081): HpixName='vulture.jpg';
              HpixStatus=PixPENDING;
              HpixWidth='225';
              HpixHeight='257';
              HpixAlt='Vulture eating';
              HpixCaption='Breakfast Buffet';
              HpixCaption2='on Skyline Drive';
              break;
 case (1091): HpixName='candle1.gif';
              HpixStatus=PixACTIVE;
              HpixWidth='217';
              HpixHeight='364';
              HpixAlt='We Remember';
              break;
 case (1101): HpixName='ssjfair5.jpg';
              HpixStatus=PixPENDING;
              HpixWidth='202';
              HpixHeight='263';
              HpixAlt='Decorated Pumpkin';
              HpixCaption='Coming Soon. <a href=recdept.htm#halloween>Parade Details</a>';
              break;
 case (1111): HpixName='usflagl.gif';
              HpixStatus=PixPENDING;
              HpixWidth='100';
              HpixHeight='57';
              HpixAlt='U.S. flag';
              HpixCaption='Veterans Day';
              HpixCaption2='November 11';
              break;
 case (1112): HpixName='vetsday.gif';
              HpixStatus=PixHIDDEN;
            HpixStatus=PixPENDING;
              HpixWidth='229';
              HpixHeight='235';
              HpixAlt='American Legion graphic';
              break;
 case (1125): HpixName='naylor1.jpg';
              HpixStatus=PixPENDING;
              HpixWidth='195';
              HpixHeight='305';
              HpixAlt='Santa greets motorists on Mountain Avenue';
              HpixCaption='Greeting motorists on Mountain&nbsp;Ave. December&nbsp;21';
              HpixCaption2='In front of Charlie Naylor\'s house';
              break;
 case (1126): HpixName='naylor2.jpg';
              HpixStatus=PixPENDING;
              HpixWidth='182';
              HpixHeight='303';
              HpixAlt='Santa listens on Mountain Avenue';
              HpixCaption='Talking to good children on Mountain&nbsp;Ave December&nbsp;21';
              HpixCaption2='In front of Charlie Naylor\'s house';
              break;
 case (1128): HpixName='xmasgoos.jpg';
              HpixStatus=PixPENDING;
              HpixWidth='195';
              HpixHeight='305';
              HpixAlt='Christmas Geese on Mountain Avenue';
              HpixCaption='Christmas Geese';
              HpixCaption2='part of a flock on Mountain Avenue, Gillette';
              break;
 default: return '';
  };
  if ( prelimScan ) return HpixStatus ;
  if ( ! HpixStatus || ! HpixName ) return ''; 

  LclCaption=''; LclCaption2=''; LclRowspan=1; 
  if( HpixCaption2 ) LclCaption2 = '<br><span class=v8>'+HpixCaption2+'</span>';
  if( ! HpixCaption ) HpixCaption=DefaultHpixCaption;
  if( HpixCaption ){
    LclCaption = '<tr><td width=2% bgcolor=#ffffff align=center class=v8>'+HpixCaption+LclCaption2+'</td></tr>';
    LclRowspan=2;
  };
  if ( HpixStatus == PixACTIVE || DocWriteThisFragmentInline ) {
    Grey=''; InactWord='&nbsp';
  } else { Grey=' bgcolor=#dddddd'; InactWord=' Not Currently in Rotation';};
  if( DocWriteThisFragmentInline ) { 
    HpixWidthPlus15 = parseInt(HpixWidth) + 15;
    TableSize='align=left width='+HpixWidthPlus15 ;
    GreyCell='';
    LclATagOpen = '<a href="javascript:NewWdLcl(\'AllHomePix\')" ' +
      ' onMouseout="window.status=window.defaultStatus; return true;" '+
      ' onMouseover="window.status=\'Show all the images in this rotation\'; return true;" '+ '>';
    RightCell='</td><td rowspan='+LclRowspan+' width=15>&nbsp;&nbsp;'
  } else {
    TableSize='width=100%'; 
    GreyCell='<td align=center valign=center rowspan='+(LclRowspan+1)+' width=49%' +Grey+ ' class=v12><font color=red>'+InactWord+'</font></td>';
    LclATagOpen='<a href="javascript:opener.location=\'home.htm?'+ImgKeyLcl+'\'; self.close();" '+
      ' onMouseout="window.status=window.defaultStatus; return true;" '+
      ' onMouseover="window.status=\'Show this image in the Home Page\'; return true;">'; 
    if ( ! isWeb ) RightCell='</td><td rowspan='+LclRowspan+' width=49%' +Grey+ ' valign=bottom align=right>'+ImgKey+' ['+HpixName+']&nbsp;&nbsp;' ;
    if ( isWeb ) 
       RightCell='</td><td rowspan='+LclRowspan+' width=49%'+Grey+ '>&nbsp;' ;
  };
  OneTableStr = ''+
  '<table border=0 cellspacing=0 cellpadding=0 '+ TableSize + '>'+
  '<tr>'+ GreyCell + 
      '<td width=2% align=center >'+
      LclATagOpen+
        '<img src="../lht/picts/'+HpixName+'" '+
        'width='+HpixWidth+' height='+HpixHeight+' alt="'+HpixAlt+'" border=0></a>'+RightCell +
    '</td>'+
  '</tr>'+ 
  LclCaption+
  '<tr><td colspan=2 '+ Grey +' class=v6>&nbsp;</td></tr>'+
  '</table>' ;
  return OneTableStr;
};

