
//simple browser check
//alert(navigator.appVersion)

nav=(navigator.appName.indexOf("Netscape") != -1)?1:0; 
ie2=(navigator.userAgent.indexOf("MSIE") != -1)?1:0;

v4=(parseInt(navigator.appVersion)>=4)?1:0;
ie=(document.all && v4)?1:0;
ie4=(nav || document.getElementById)?1:0;
ns=(document.layers && v4)?1:0;
nc=(!ie && document.getElementById && v4)?1:0;

keep=-1;
timer=0;

//code for drops
function shwLayer(thelayer){
  if(v4){
    if(keep==thelayer)clearTimeout(timer);
    else hideit(keep);
    keep=thelayer; 
    showit(thelayer)
  }else{
   return
  }
}

function showit(thelayer){

nsvalue = "drop"+eval(thelayer+1)
  if(ie4==0)return;
  if(ie || nc){
    if(ie2){
      bob=(document.body.clientWidth/2)-171;
      document.getElementById("drop"+(thelayer+1)).style.left=bob;}
    else {
      bob = eval((window.innerWidth/2) - 171);
      document.getElementById("drop"+(thelayer+1)).style.left=bob;
    }
  document.getElementById("drop"+(thelayer+1)).style.visibility="visible";  
  }else
  {}
  if(ns){
    bob = eval((window.innerWidth/2) - 179);
    document.layers[nsvalue].left=bob;
    document.layers[nsvalue].visibility='show'; 
  }
  else{}
}

function hidedrop(){
  timer=setTimeout('hideit('+keep+')',350);
}
function hideit(thelayer){
  if(ie4==0)return;
nsvalue = "drop"+eval(thelayer+1)
    if(thelayer<0)return;
    if(ie || nc)document.getElementById("drop"+(thelayer+1)).style.visibility="hidden";
    if(ns)document.layers[nsvalue].visibility='hide';  
}

function invisiBle(){
  if(v4==0 || ie4==0){ return;
  }else{
    if(ie || nc){
      for (var j=1;j<looptimes.length;j++){
      k = j-1
      document.write('<div id="'+looptimes[j]+'" nowrap="true" class="dropdown" style="left:'+leftie[j]+'px; top:'+toppie[j]+'px;" onmouseover="shwLayer('+k+')" onmouseout="hidedrop()">')
      document.write('<p>')
      var links=eval('link'+j);
        var button=eval('button'+j);
        for (var i=1;i<button.length;i++){
        document.write('<a href="'+links[i]+'" class="dropitem">'+button[i]+'</a><br>')
        }
      document.write('</p>')
      document.write('</div>')
      }
    } else if(ns){
      for (var j=1;j<looptimes.length;j++){
      k = j-1
      document.write('<layer id="'+looptimes[j]+'" nowrap="true"  visibility="hide" left="'+leftie[j]+'" top="'+toppie[j]+'" onmouseover="shwLayer('+k+')" onmouseout="hidedrop()">')
      document.write('<table bgcolor="#DDDDC0" width="225" cellpadding="4" cellspacing="0" border="1">')
      document.write('<tr><td><font size="1" face="Verdana">')  
      var links=eval('link'+j)
      var button=eval('button'+j);
        for (var i=1;i<button.length;i++){
        document.write('<a href="'+links[i]+'" class="dropitem">'+button[i]+'</a><br>')
        }
      document.write('</font></td></tr>')
      document.write('</table>')
      document.write('</layer>')
      }
    }
  }
}

//add all of the images into this array
adImg = new Array("/tech/images/top_pic.gif","/tech/images/top_pic2.gif","/tech/images/top_pic3.gif","/tech/images/top_pic4.gif");
imgCntr = adImg.length;

function cyClr() {
if (document.images){
  rndNum = Math.floor
    ((Math.random() * imgCntr))
  document.picycle.src=
     adImg[rndNum]
  }
}

function where(){
cyClr();
locDir = "/tech/images/";
trial = document.URL;
if(trial.indexOf('/overview/') >= 0){document.images['overview'].src=locDir+'overview_on.gif'}
if(trial.indexOf('/ctc/') >= 0){document.images['ctc'].src=locDir+'ctc_on.gif'}
if(trial.indexOf('/tmf/') >= 0){document.images['tech'].src=locDir+'tech_matching_on.gif'}
//if(trial.indexOf('/digital_divide/') >= 0){document.images['divide'].src=locDir+'digital_divide_on.gif'}
if(trial.indexOf('/seniors/') >= 0){document.images['seniors'].src=locDir+'seniors_on.gif'}
if(trial.indexOf('/free_stuff/') >= 0){document.images['free'].src=locDir+'free_stuff_on.gif'}
if(trial.indexOf('/get_involved/') >= 0){document.images['getinvolved'].src=locDir+'get_involved_on.gif'}
if(trial.indexOf('/indicators/') >= 0){document.images['indicators'].src=locDir+'indicators_on.gif'}
if(trial.indexOf('/reports/') >= 0){document.images['reports'].src=locDir+'reports_on.gif'}
if(trial.indexOf('/npo/') >= 0){document.images['resources'].src=locDir+'nonprofitresources_on.gif'}
if(trial.indexOf('/photos/') >= 0){document.images['gallery'].src=locDir+'photo_gallery_on.gif'}
if(trial.indexOf('/contact/') >= 0){document.images['contact'].src=locDir+'contact_on.gif'}
if(trial.indexOf('/smallbiz/') >= 0){document.images['indicators'].src=locDir+'indicators_on.gif'}

if(trial.indexOf('http://www.cityofseattle.net/tech/overview.htm') >= 0){document.images['overview'].src='images/overview_on.gif'}
if(trial.indexOf('http://www.cityofseattle.net/tech/ctc.htm') >= 0){document.images['ctc'].src='images/ctc_on.gif'}
if(trial.indexOf('http://www.cityofseattle.net/tech/tech_matching.htm') >= 0){document.images['tech'].src='images/tech_matching_on.gif'}
//if(trial.indexOf('http://www.cityofseattle.net/tech/digital_divide.htm') >= 0){document.images['divide'].src='images/digital_divide_on.gif'}
if(trial.indexOf('http://www.cityofseattle.net/tech/seniors.htm') >= 0){document.images['seniors'].src='images/seniors_on.gif'}
if(trial.indexOf('http://www.cityofseattle.net/tech/free_stuff.htm') >= 0){document.images['free'].src='images/free_stuff_on.gif'}
if(trial.indexOf('http://www.cityofseattle.net/tech/get_involved.htm') >= 0){document.images['getinvolved'].src='images/get_involved_on.gif'}
if(trial.indexOf('http://www.cityofseattle.net/tech/indicators.htm') >= 0){document.images['indicators'].src='/tech/images/indicators_on.gif'}
if(trial.indexOf('http://www.seattle.gov/tech/indicators/smallbiz/') >= 0){document.images['indicators'].src='/tech/images/indicators_on.gif'}
if(trial.indexOf('http://www.cityofseattle.net/tech/indicators/smallbiz/') >= 0){document.images['indicators'].src='/tech/images/indicators_on.gif'}
if(trial.indexOf('http://www.cityofseattle.net/tech/reports.htm') >= 0){document.images['reports'].src='images/reports_on.gif'}
if(trial.indexOf('http://www.cityofseattle.net/tech/resources.htm') >= 0){document.images['resources'].src='images/nonprofitresources_on.gif'}



else if(trial.indexOf('http://www.cityofseattle.net/tech/default.htm') == 0){document.images['home'].src='images/home_on.gif'}
}

