<!--// Hide me
//*********************************************//
// Created for the Ada County Highway District //
// Ridgeline Design & Development              //
// jforst@cableone.net                         //
// Last Revision December 2004                 //
// Current Version 1.0c                        //
//                                             //
// Revised: 03-04-2005 Changed height on popup //
//                                             //
//*********************************************//
//Random Number Generator
rnd.today=new Date();
rnd.seed=rnd.today.getTime();
function rnd() {
        rnd.seed = (rnd.seed*9301+49297) % 233280;
        return rnd.seed/(233280.0);
};

function rand(number) {
        return Math.ceil(rnd()*number);
};

// Sets global variables that are used by all functions
var current_image;
var stat1 = "window.status='Click To View Image'; return true";
var stat2 = "window.status='Click For More Information'; return true";
var stat3 = "window.status=''";

// Page Reload  60000 miliseconds = 60 Sec -- 300000 = 5 Min -- 180000 = 3 Min
function autoReload() {
	var timeID = setTimeout("parent.fraMapNav.maincache = 1;document.location.reload();", 180000)
}

// This function will place either <div> tags or <layer> tags for the layer control.
function layer_control(layer_name, ind, vis) {

var vis1;

  if (layer_name == "camera") {
	vis1 = parent.fraMapNav.cameraStatus;
	ind = 3;
	parent.fraMapNav.createCam = 1;
  } else if (layer_name == "signs") {
	vis1 = parent.fraMapNav.signsStatus;
	ind = 4;
	parent.fraMapNav.createSig = 1;
  } else if (layer_name == "planned") {
	vis1 = parent.fraMapNav.plannedStatus;
	ind = 8;
	parent.fraMapNav.createPla = 1;
  } else if (layer_name == "construction") {
	vis1 = parent.fraMapNav.constructionStatus;
	ind = 5;
	parent.fraMapNav.createCon = 1;
  } else if (layer_name == "incidents") {
	vis1 = parent.fraMapNav.incidentStatus;
	ind = 6;
	parent.fraMapNav.createInc = 1;
  } 

  if (parent.fraMapNav.browserVersion == "nav") {
    document.open();
    document.write('<layer id="' + layer_name + '" style="position:absolute;  visibility: ' + vis1 + ';  z-index:' + ind + '; top: 0px; left: 0px">');
    document.close();
  } else {
    document.open();
    document.write('<div id="' + layer_name + '" style="position:absolute;  visibility: ' + vis1 + ';  z-index:' + ind + '; top: 0px; left: 0px">');
    document.close();
  }
}

// This function will place either </div> tags or </layer> tags to close the layer control.
function layer_control2() {

  if (parent.fraMapNav.browserVersion == "nav") {
	    document.open();
    document.write('</layer>');
    document.close();
  } else {
    document.open();
    document.write('</div>');
    document.close();
  }
}
// New Window Show Content 
  	var newWindow;
	function showContent(contentURL)
	{
		//newWindow = window.open("Display.aspx?URL=" + contentURL,"myNewWindow","width=360,height=360,scrollbars=1,top=100,left=100,status=no","");
		newWindow = window.open("Display.aspx?URL=" + contentURL,"myNewWindow","width=380,height=420,scrollbars=1,top=100,left=100,status=no","");
		newWindow.focus();
	}

// This function displays the camera icons in either <div> tags or <layer> tags
// depending on which version of the parent.fraMapNav.browserVersion is being used.
function camera_icon(left1, top1, icon1, img5, mouse1) {
var left2 = left1
var top2 = top1
if (parent.fraMapNav.browserVersion == "nav") {
  var vis1 = parent.fraMapNav.cameraStatus;
  var thisCam = parent.fraMapNav.createCam;
  document.open();
  document.write('<layer id="cam' + thisCam + '" visibility="' + vis1 + '" width="21px" height="8px" z-index="5" top="' + top2 + 'px" left="' + left2 + 'px">');
  document.write('<a ');
  document.write(' onMouseOver="' + stat1 + '"');
  document.write(' onMouseOut="' + stat3 + '"');
  document.write('href=javascript:showContent(');
  document.write("'Display.aspx?ID=");
  document.write(img5);
  document.write("'");
  document.write(');>');
  document.write('<img alt="' + mouse1 + '"  border="0" src="Images/' + icon1 + '.gif" width="21" height="8"></a></layer>');
  parent.fraMapNav.createCam = parent.fraMapNav.createCam + 1;
  document.close();
  } else {
  document.open();
  document.write('<div style="position:absolute; width:21px; height:8px; z-index:0; top: ' + top2 + 'px; left: ' + left2 + 'px">');
  document.write('<a ');
  document.write(' onMouseOver="' + stat1 + '"');
  document.write(' onMouseOut="' + stat3 + '"');
  document.write('href=javascript:showContent(');
  document.write("'Display.aspx?ID=");
  document.write(img5);
  document.write("'");
  document.write(');>');
  document.write('<img alt="' + mouse1 + '"  border="0" src="Images/' + icon1 + '.gif" width="21" height="8">');
  document.write('</a></div>');
  document.close();
  }

}

// This function displays the device icons in either <div> tags or <layer> tags
// depending on which version of the parent.fraMapNav.browserVersion is being used.
var device_icon_left;
var device_icon_top;
var device_icon_vis;
var device_icon_thisDev;
var device_icon_thisName;
function device_icon(left1, top1, icon2, title1, text1, img1) 
{
    device_icon_left = left1;
    device_icon_top = top1;
    
      if (parent.fraMapNav.browserVersion == "nav") {
        if (icon2 == "construction") {
          device_icon_vis = parent.fraMapNav.constructionStatus;
          device_icon_thisDev = parent.fraMapNav.createCon;
          device_icon_thisName = "con";
          parent.fraMapNav.createCon = parent.fraMapNav.createCon + 1;
        } else if (icon2 == "incident") {
          device_icon_vis = parent.fraMapNav.incidentStatus;
          device_icon_thisDev = parent.fraMapNav.createInc;
          device_icon_thisName = "inc";
          parent.fraMapNav.createInc = parent.fraMapNav.createInc + 1;
 	} else if (icon2 == "planned") {
          device_icon_vis = parent.fraMapNav.plannedStatus;
          device_icon_thisDev = parent.fraMapNav.createPla;
          device_icon_thisName = "pla";
        } else {
          device_icon_vis = parent.fraMapNav.signsStatus;
          device_icon_thisDev = parent.fraMapNav.createSig;
          device_icon_thisName = "sig";
          parent.fraMapNav.createSig = parent.fraMapNav.createSig + 1;
        }
        document.open();
        document.write('<layer id="' + device_icon_thisName + device_icon_thisDev + '" visibility="' + device_icon_vis + '" width="22px" height="22px" z-index="5" top="' + device_icon_top + 'px" left="' + device_icon_left + 'px">');
        document.write('<a ');
        document.write(' onMouseOver="' + stat2 + '"');
        document.write(' onMouseOut="' + stat3 + '"');
        //document.write(' href="javascript:parent.blank.focus();device(');
        document.write(' href="DMS/');
        document.write("'");
        document.write(title1);
        document.write("'");
        document.write(", ");
        document.write("'");
        document.write(text1);
        document.write("'");
        document.write(');">');
        document.write('<img  alt="' + title1 + '" border="0" src="Images/' + icon2 + '.gif" width="22" height="22"></a></layer>');
        document.close();
      } else {
        document.open();
        document.write('<div style="position:absolute; width:22px; height:22px; z-index:0; top: ' + device_icon_top + 'px; left: ' + device_icon_left + 'px">');
        document.write('<a ');
        document.write(' onMouseOver="' + stat2 + '"');
        document.write(' onMouseOut="' + stat3 + '"');
        document.write(' href="javascript:showContent(');
        //document.write(' href="Display.aspx?Path=');
        //document.write("'");
        //document.write(title1);
        //document.write("'");
        //document.write(", ");
        document.write("'");
        document.write(text1);
        //document.write("'");
        document.write(img1);
        document.write("?");
        document.write(rand(100));
        document.write("'");
        document.write(');">');
        //document.write('">');
        document.write('<img alt="' + title1 + '"  border="0" src="Images/' + icon2 + '.gif" width="22" height="22">');
        document.write('</a></div>');
        document.close();
     }
}
//-->