<!-- Begin
/*
check to make sure that the form has been filled out
if not, output alert and do not process form
*/

function trim(str)
{
	str = str.replace (/^\s+/g, "");
	str = str.replace (/\s+$/g, "");
	return str;
}

//This function is responsible for validating email addresses
function isEmail(v_email)
{
	var x = v_email;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if ( filter.test(x) )
	{
		//alert('YES! Correct email address');
		return true;
	}
	else 
	{
		//alert('Please provide a valid email address');
		return false;
	}
}


/*
start up the left nav menu tool bar from Body onLoad event handler
count through the number of parent and children elements inside
the container DIV tag
*/

document.TF = new Object();
document.TF.menu = new Object();
document.TF.menu.dropdown = new Array();

function TF_initializeToolbar(){
    var i;
    if (document.all){
	for(i = 0; i < document.all('container').all.length; i++){
	    if ((document.all('container').all[i].className == 'parent') ||
(document.all('container').all[i].className == 'children')){
		document.TF.menu.dropdown[document.TF.menu.dropdown.length]
= document.all('container').all[i];
	    }
	}
    } else if (document.getElementsByTagName && document.getElementById){
	var contained =
document.getElementById('container').getElementsByTagName('div');
	for(i = 0; i < contained.length; i++){
	    if ((contained[i].getAttribute('class') == 'children') ||
(contained[i].getAttribute('class') == 'links')){
		document.TF.menu.dropdown[document.TF.menu.dropdown.length]
= contained[i];
	    }
	}
    }
}




/*
expand or collapse the menu based on the onClick event handler
each item in the drop down needs to increment by 2 for the expanded
or collapsed value for each parent link
*/

function TF_collapse(item){
    if(document.TF.menu.dropdown.length){
	if (document.TF.menu.dropdown[item + 1].style.display == 'none'){
	    document.TF.menu.dropdown[item + 1].style.display = '';
	} else {
	    document.TF.menu.dropdown[item + 1].style.display = 'none';
	    }
	}
}

	
/*
Random number function provides random numbers for picture rotation
in the upper right hand corner of the interface.
*/
	
	function randnumb(lo,hi) {
    hi = hi - 1
    var now = new Date()
    var rnd = 98726471 * (now.getTime() / ((now.getMinutes() + 1) * 1000))
    rnd = lo + Math.floor(rnd % (hi - lo))
    return rnd
	}
	
/* 
assigns picture to randnumb function return
when adding new pictures to be displayed in the upper
right hand corner of the interface, this is where they
need to be defined
*/
	
	function picture1() {
    var num = randnumb(0,4);
    if (num==0) document.write("<img src='../images/vehicle1.jpg' border=0>");
    if (num==1) document.write("<img src='../images/vehicle2.jpg' border=0>");
    if (num==2) document.write("<img src='../images/vehicle3.jpg' border=0>");
	}
	
/* 
assigns a path for logout button to resolve to
called from header
*/	
	
	function logout()
	{
		document.login.action = '../logout.asp';
		document.login.submit();
	}
	
//  End -->