<!--
/*	This is a script that was created by PSI Developing in Nov. 2000 and modified since then.
It is for use by anyone that wishes to use it. The script preloads images, displays status msgs,
allows caching and non-caching of images for a type of retrieve-upon-request image "tour."
It also allows the hiding and showing of <div> layers. If you have any additions/subtractions
for a faster runtime please let me know. <sbeardsley@csus.edu>	*/

ns = (document.layers)? true:false
ie = (document.all)? true:false
var root = "";

// Its best to call PSI_ImgPreload right after defining it to allow the rest of the page to load.
// example >> PSI_ImgPreload("wsacon","../../../images/tour/wsac_blu.gif");
function PSI_ImgPreload(name,src) {
  if (document.images) {
    eval(name+' = new Image()');
    eval(name+'.src = "'+src+'"')
  }
}
function PreloadNavbar(){
PSI_ImgPreload("navHomeOn",(root+"images/boxes/home_gry.gif"));
PSI_ImgPreload("navHomeOff",(root+"images/boxes/home_blk.gif"));
PSI_ImgPreload("navCompOn",(root+"images/boxes/company_gry.gif"));
PSI_ImgPreload("navCompOff",(root+"images/boxes/company_blk.gif"));
PSI_ImgPreload("navProjOn",(root+"images/boxes/projects_gry.gif"));
PSI_ImgPreload("navProjOff",(root+"images/boxes/projects_blk.gif"));
PSI_ImgPreload("navCustOn",(root+"images/boxes/customers_gry.gif"));
PSI_ImgPreload("navCustOff",(root+"images/boxes/customers_blk.gif"));
PSI_ImgPreload("navRentOn",(root+"images/boxes/rentals_gry.gif"));
PSI_ImgPreload("navRentOff",(root+"images/boxes/rentals_blk.gif"));
PSI_ImgPreload("navServOn",(root+"images/boxes/services_gry.gif"));
PSI_ImgPreload("navServOff",(root+"images/boxes/services_blk.gif"));
PSI_ImgPreload("navFeedOn",(root+"images/boxes/feedback_gry.gif"));
PSI_ImgPreload("navFeedOff",(root+"images/boxes/feedback_blk.gif"));
PSI_ImgPreload("navIntOn",(root+"images/boxes/internet_gry.gif"));
PSI_ImgPreload("navIntOff",(root+"images/boxes/internet_blk.gif"));
PSI_ImgPreload("navSearOn",(root+"images/boxes/search_gry.gif"));
PSI_ImgPreload("navSearOff",(root+"images/boxes/search_blk.gif"));
}

//for PSI_ImgManip if the image is not in a layer pass the layer arg as "null".
function PSI_ImgManip(imgName,layer,newImg){
  if (document.images) {
    if (document.layers && layer!=null) eval('document.'+layer+'.document.images["'+imgName+'"].src = '+newImg);
    else document.images[imgName].src = eval(newImg);
  }
}

function PSI_LayManip(id,which){
  if (ns) document.layers[id].visibility = which;
  else if (ie){
    if (which == "show") document.all[id].style.visibility = "visible";
    else document.all[id].style.visibility = "hidden";
  }
}

function PSI_OpenWin(URL,winName,options) { 
  window.open(URL,winName,options);
}

defaultPic = "../../images/res/wsac/ovrbef3.jpg";
defaultDescLay = "defBeforeLay";
picIndex = 0;
maxPics = 32;
lastPicMsg = "We have no more current pictures available please stay tuned.";
firstPicMsg = "This is our first picture for this project.";
//picSrcArray = new Array(maxPics);
//descArray = new Array(maxPics);


function PSI_ImgTour(whichway){

  if (picIndex == 0 && whichway == "prev") alert(firstPicMsg);
  else if (picIndex == maxPics-1 && whichway == "next") alert(lastPicMsg);
  else {
    PSI_layManip(descArray[picIndex],"hide");
    if (whichway == "next")picIndex++;
    else if (whichway == "prev")picIndex--;
    PSI_ImgManip("mainImg","mainLay","picSrcArray[picIndex]")
    PSI_layManip(descArray[picIndex],"show");
  }
}

//
// written by Debbi McDaniel mailto:mdnitecreepr@earthlink.net
//
// This JavaScript function will create a text variable indicating
// the last time your page was modified.  It includes the day of 
// the week, name of the month, day, year, and time (in a 12 hour 
// clock format).
//
function LastUpdate()
{
var Days = new Array("Sunday", 
   "Monday", "Tuesday", "Wednesday", 
   "Thursday", "Friday", "Saturday");           //Day Names array
var Months = new Array(
   "January", "February", "March", 
   "April", "May", "June", "July", 
   "August","September", "October", 
   "November", "December");                      //Month Names array

var Updated = new Date(document.lastModified);   //last modified date
var dName   = Days[Updated.getDay()];            //name of the day of the week
var mName   = Months[Updated.getMonth()];        //name of the month
var d       = Updated.getDate();                 //date
var dSuf    = "th";                              //date suffix
if (d == 1 || d == 21 || d == 31) dSuf="st";     //change date suffix for 1s
if (d == 2 || d == 22) dSuf = "nd";              //change date suffix for 2s
if (d == 3 || d == 23) dSuf = "rd";              //change date suffix for 3s
var y       = Updated.getFullYear();             //year
var h       = Updated.getHours();                //hour
var ampm    = "am"                               //AM
if (h >=12) ampm = "pm";                         //change am to pm, if after noon
if (h > 12) h -= 12;                             //change pm to 12 hour clock
if (h == 0) h = 12;                              //change 0 to midnight
var m       = Updated.getMinutes();              //minutes
if (m < 10) m = "0" + m;                         //2-digit minutes

var UpdateText= "Last updated: " + dName + " " + mName + " " +  d +
   "<sup>" + dSuf + "</sup>" + ", " + y + 
   " at " + h + ":" + m + ampm + ".";           //The Last Updated Statement
return UpdateText
}

//-->