// Identify variables

        var inst = null;
        var print = null;
        var print2 = null;

// Identify the user's browser and version

        browserCode = navigator.appCodeName;
    	browserName = navigator.appName;
        browserVersion = navigator.appVersion;
    	browserVer = parseInt(navigator.appVersion);

        if (browserName == "Microsoft Internet Explorer") {
            whiteSpace = "" }
        else {
            whiteSpace = "<BR><BR>" }

// Make the hover buttons work

 if (browserVer >= 3) version = "n3";
        else version = "n2";
     
        if (version == "n3") {
        button0on = new Image();
        button0on.src = "images/fhwa_home-lite.gif";
        button1on = new Image();
        button1on.src = "images/rtp_home-lite.gif";
        button2on = new Image();
        button2on.src = "images/save_print-lite.gif";
        button3on = new Image();
        button3on.src = "images/new_search-lite.gif";
        button0off = new Image();
        button0off.src = "images/fhwa_home.gif";
        button1off = new Image();
        button1off.src = "images/rtp_home.gif";
        button2off = new Image();
        button2off.src = "images/save_print.gif";
        button3off = new Image();
        button3off.src = "images/new_search.gif";
        }

function img_act(imgName) {
        if (version == "n3") {
        imgOn = eval(imgName + "on.src");
        document [imgName].src = imgOn;
        }
}

function img_inact(imgName) {
        if (version == "n3") {
        imgOff = eval(imgName + "off.src");
        document [imgName].src = imgOff;
        }
}

// print_act opens the single entry print windows
    
    function print_act(imgName, id) {            
            if (imgName == "print") {
            window_name = "print.aspx?i=" + id;
            print=open(window_name, "print", "width=520, height=300, menubar, scrollbars, resizable");
            }
            
            if (imgName == "print2") {
            window_name = "print2.aspx?i=" + id;
            print2=open(window_name, "print2", "width=620, height=480, menubar, scrollbars, resizable");
            }            
    } 


// instructions_act opens the instructions window
    
    function instructions_act(imgName) {
            window_name = "instruct.aspx";
            inst=open(window_name, "inst", "width=400, height=200, scrollbars, resizable");
    }


// srchprint_act opens the search result print windows
    
    function srchprint_act(imgName) {            
            if (imgName == "searchprint") { 
            window_name = "srchprint.aspx";
            srchprint=open(window_name, "srchprint", "width=520, height=300, menubar, scrollbars, resizable");
            }
            
            if (imgName == "searchprint2") {
            window_name = "srchprint2.aspx";
            srchprint2=open(window_name, "srchprint2", "width=625, height=480, menubar, scrollbars, resizable");
            }            
    } 


// open_win opens the test window
    
    function open_win() {
            window_name = "browser_print.aspx";
            inst=open(window_name, "browser_print", "width=400, height=200, menubar, scrollbars, resizable");
    }


// Check or Clear All Boxes
// source is CheckBoxList name and checked is true or false

function CheckAllBoxes(source, checked) {
    var children = source.all

    for (var i = 0; i < children.length; i++) {
        var input = children(i);
        if ((input.tagName == "INPUT") && (input.type == "checkbox"));
        input.checked = checked;
        }
    }

// Clear Form Button

    function ClearForm() {
       a = CheckAllBoxes(States, false);
       a = CheckAllBoxes(Activity, false);
       a = CheckAllBoxes(Category, false);
       a = CheckAllBoxes(Funding, false);
    }

// Generates random pictures

function WM_imageSwap(daImage, daSrc){
  var objStr,obj;
  /*
    WM_imageSwap()
    Changes the source of an image.

    Source: Webmonkey Code Library
    (http://hotwired.lycos.com/webmonkey/reference/javascript_code_library/)

    Author: Shvatz
    Author Email: shvatz@wired.com

    Usage: WM_imageSwap(originalImage, 'newSourceUrl');

    Requires: WM_preloadImages() (optional, but recommended)
    Thanks to Ken Sundermeyer (ksundermeyer@macromedia.com) for his help
    with variables in ie3 for the mac. 
    */

  // Check to make sure that images are supported in the DOM.
  if(document.images){
    // Check to see whether you are using a name, number, or object
    if (typeof(daImage) == 'string') {
      // This whole objStr nonesense is here solely to gain compatability
      // with ie3 for the mac.
      objStr = 'document.' + daImage;
      obj = eval(objStr);
      obj.src = daSrc;
    } else if ((typeof(daImage) == 'object') && daImage && daImage.src) {
      daImage.src = daSrc;
    }
  }
}


// Setup for function above

	today=new Date();
	jran=today.getTime();
	var number = 10;
	var random_number="";
	var image="";
	var imagea="";
	var imageb="";
	var imagec="";
	ia=9301;
	ic=49297;
	im=233280;
	jran = (jran*ia+ic) % im;
	random_number = Math.ceil( (jran/(im*1.0)) *number);
	// Loads the appropriate image based on random number.
	if (random_number==1) {
	image="images/trail1.jpg";
	}
	if (random_number==2) {
	image="images/trail3.jpg";
	}
	if (random_number==3) {
	image="images/trail5.jpg";
	}
	if (random_number==4) {
	image="images/trail7.jpg";
	}
	if (random_number==5) {
	image="images/trail9.jpg";
	}
	if (random_number==6) {
	image="images/trail11.jpg";
	}
	if (random_number==7) {
	image="images/trail13.jpg";
	}
	if (random_number==8) {
	image="images/trail15.jpg";
	}
	if (random_number==9) {
	image="images/trail17.jpg";
	}
	if (random_number==10) {
	image="images/trail19.jpg";
	}
	if (random_number==11) {
	image="images/trail21.jpg";
	}
	if (random_number==12) {
	image="images/trail23.jpg";
	}
	if (random_number==13) {
	image="images/trail25.jpg";
	}
	if (random_number==14) {
	image="images/trail27.jpg";
	}
	if (random_number==15) {
	image="images/trail29.jpg";
	}
	if (random_number==1) {
	imagea="images/trail2.jpg";
	}
	if (random_number==2) {
	imagea="images/trail4.jpg";
	}
	if (random_number==3) {
	imagea="images/trail6.jpg";
	}
	if (random_number==4) {
	imagea="images/trail8.jpg";
	}
	if (random_number==5) {
	imagea="images/trail10.jpg";
	}
	if (random_number==6) {
	imagea="images/trail12.jpg";
	}
	if (random_number==7) {
	imagea="images/trail14.jpg";
	}
	if (random_number==8) {
	imagea="images/trail16.jpg";
	}
	if (random_number==9) {
	imagea="images/trail18.jpg";
	}
	if (random_number==10) {
	imagea="images/trail20.jpg";
	}
	if (random_number==11) {
	imagea="images/trail22.jpg";
	}
	if (random_number==12) {
	imagea="images/trail24.jpg";
	}
	if (random_number==13) {
	imagea="images/trail26.jpg";
	}
	if (random_number==14) {
	imagea="images/trail28.jpg";
	}
	if (random_number==15) {
	imagea="images/trail30.jpg";
	}	
	




