//*-- ======================================================================= --*/
//*--   Tim's scripts                                                         --*/
//*-- ======================================================================= --*/

<!--

//<%' If Section=="Home" Then %>

// randomMantleImage called from body.onload

function randomMantleImage(xxx){
	var arraySize = 5
	
	if (xxx == -1){
		rndIndex = Math.round(Math.random()*(arraySize-1));
		//alert(rndIndex);
	}
	else if (xxx == (arraySize - 1)) {
		rndIndex = 0
	}
	else {
		rndIndex = xxx + 1
	}
		
	var arMantleSrcs = new Array(arraySize)
	arMantleSrcs[0]="Images/Home_Trans_Insp.jpg";
	arMantleSrcs[1]="Images/Home_Municipal.jpg";
	arMantleSrcs[2]="Images/Home_Site.jpg";
	arMantleSrcs[3]="Images/Home_Surveying.JPG";
	arMantleSrcs[4]="Images/Home_Trans_Design.jpg";

	imgMantle.src = arMantleSrcs[rndIndex];
	
switch (rndIndex)
{
  case 0:
    TextLayer1.innerHTML="Transportation Inspection";
    TextLayer2.innerHTML="Transportation Inspection";
    break

  case 1:
    TextLayer1.innerHTML="Municipal Engineering";
    TextLayer2.innerHTML="Municipal Engineering";
    break

  case 2:
    TextLayer1.innerHTML="Site Development";
    TextLayer2.innerHTML="Site Development";
    break

  case 3:
    TextLayer1.innerHTML="Land Surveying";
    TextLayer2.innerHTML="Land Surveying";
    break

  case 4:
    TextLayer1.innerHTML="Transportation Design";
    TextLayer2.innerHTML="Transportation Design";
    break
}
		
	setTimeout("randomMantleImage(" + rndIndex + ")", 5000); // 5 seconds
}

//<%' End If %>

function WM_netscapeCssFix() {
  if (document.WM.WM_netscapeCssFix.initWindowWidth != window.innerWidth || document.WM.WM_netscapeCssFix.initWindowHeight != window.innerHeight) {
    document.location = document.location;
  }
}
function WM_netscapeCssFixCheckIn() {
  // This function checks to make sure the version of Netscape 
  // in use contains the bug; if so, it records the window's 
  // width and height and sets all resize events to be handled 
  // by the WM_netscapeCssFix() function.
  if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) {
    if (typeof document.WM == 'undefined'){
      document.WM = new Object;
    }
    if (typeof document.WM.WM_scaleFont == 'undefined') {
      document.WM.WM_netscapeCssFix = new Object;
      document.WM.WM_netscapeCssFix.initWindowWidth = window.innerWidth;
      document.WM.WM_netscapeCssFix.initWindowHeight = window.innerHeight;
    }
    window.onresize = WM_netscapeCssFix;
  }
}
WM_netscapeCssFixCheckIn()



function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-3); i+=4) 
  	if ( (obj=MM_findObj(args[i])) != null ) { 
		v=args[i+2];
	    if (obj.style) { 
			obj=obj.style; 
			v=(v=='show')?'visible':(v='hide')?'hidden':v; 
		}
	    obj.visibility=v;
		if (v=='show' || v=='visible'){
			zz = args[i+3];
			
			var pos = getXYcoord( zz );

			obj.left = pos.x;
			obj.top = pos.y + eval(zz).height;
		}
		
	}
}

function getXYcoord ( nvn ) {
   var elm = document.images[nvn];
   if ( document.layers ) return elm;
           // NS4 images contain x and y values
   var rd = { x:0 ,y:0 };
   do { rd.x += parseInt( elm.offsetLeft );
        rd.y += parseInt( elm.offsetTop );
        elm = elm.offsetParent;
   } while ( elm );
   return rd
}; //end getXYcoord ( string ) -> object{x,y}

function MM_preloadImages() { //v2.0
  if (document.images) {
    var imgFiles = MM_preloadImages.arguments;
    if (document.preloadArray==null) document.preloadArray = new Array();
    var i = document.preloadArray.length;
    with (document) for (var j=0; j<imgFiles.length; j++) if (imgFiles[j].charAt(0)!="#"){
      preloadArray[i] = new Image;
      preloadArray[i++].src = imgFiles[j];
  } }
}

function MM_swapImgRestore() { //v2.0
  if (document.MM_swapImgData != null)
    for (var i=0; i<(document.MM_swapImgData.length-1); i+=2)
      document.MM_swapImgData[i].src = document.MM_swapImgData[i+1];
}

function MM_swapImage() { //v2.0
  var i,j=0,objStr,obj,swapArray=new Array,oldArray=document.MM_swapImgData;
  for (i=0; i < (MM_swapImage.arguments.length-2); i+=3) {
    objStr = MM_swapImage.arguments[(navigator.appName == 'Netscape')?i:i+1];
    if ((objStr.indexOf('document.layers[')==0 && document.layers==null) ||
        (objStr.indexOf('document.all[')   ==0 && document.all   ==null))
      objStr = 'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);
    obj = eval(objStr);
    if (obj != null) {
      swapArray[j++] = obj;
      swapArray[j++] = (oldArray==null || oldArray[j-1]!=obj)?obj.src:oldArray[j];
      obj.src = MM_swapImage.arguments[i+2];
  } }
  document.MM_swapImgData = swapArray; //used for restore
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  
  if(!d) d=document; 
  	if((p=n.indexOf("?"))>0&&parent.frames.length) {
	    d=parent.frames[n.substring(p+1)].document; 
		n=n.substring(0,p);
	}
  if(!(x=d[n])&&d.all) x=d.all[n]; 
  for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
 window.open(theURL,winName,features);
}


//-->
