

function set_cookie ( name, value, exp_y, exp_m, exp_d, path, domain, secure )
{
  var cookie_string = name + "=" + escape ( value );

  if ( exp_y )
  {
    var expires = new Date ( exp_y, exp_m, exp_d );
    cookie_string += "; expires=" + expires.toGMTString();
  }

  if ( path )
        cookie_string += "; path=" + escape ( path );

  if ( domain )
        cookie_string += "; domain=" + escape ( domain );
  
  if ( secure )
        cookie_string += "; secure";
  
  document.cookie = cookie_string;
}


function delete_cookie ( cookie_name )
{
  var cookie_date = new Date ( );  // current date & time
  cookie_date.setTime ( cookie_date.getTime() - 1 );
  document.cookie = cookie_name += "=; expires=" + cookie_date.toGMTString();
}
function get_cookie ( cookie_name )
{
	
  var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );

  if ( results ){
  	
    return ( unescape ( results[2] ) );
  }else
    return null;
}

	
function randomImageLinks(){
	
	var numimages=9;
	var rndimg = new Array("../CommonFiles/Images/bridgebuilding.jpg","../CommonFiles/Images/Hoop3.jpg", "../CommonFiles/Images/switch1.jpg","../CommonFiles/Images/switch2.jpg","../CommonFiles/Images/goGreen.jpg", "../CommonFiles/Images/fleetinfohub.jpg","../CommonFiles/Images/fleetinfohub_2.jpg","../CommonFiles/Images/switch3.jpg","../CommonFiles/Images/switch4.jpg");
	var x=(Math.floor(Math.random()*numimages));
	var randomimage=(rndimg[x]);
	if(randomimage==rndimg[0])
	  document.getElementById('randomlink').href="../im3/im3technology.html";
	else if(randomimage==rndimg[1])
		document.getElementById('randomlink').href="../about/about.html";
	else if(randomimage==rndimg[2])
		document.getElementById('randomlink').href="../goGreen/goGreen.asp";
	else if(randomimage==rndimg[3])
		document.getElementById('randomlink').href="../goGreen/goGreen.asp";
	else if(randomimage==rndimg[4])
		document.getElementById('randomlink').href="../goGreen/goGreen.asp";
	else if(randomimage==rndimg[5])
		document.getElementById('randomlink').href="../fleetinfohub/fleetinfohub.html";
	else if(randomimage==rndimg[6])
		document.getElementById('randomlink').href="../fleetinfohub/fleetinfohub.html";
	else if(randomimage==rndimg[7])
		document.getElementById('randomlink').href="../goGreen/goGreen.asp";
	else if(randomimage==rndimg[8])
		document.getElementById('randomlink').href="../goGreen/goGreen.asp";
	document.getElementById("randomimage").src = randomimage ; 
	
	
	
	
	
}
function randomGreenLinks(){
	
	var numimages=4;
	var rndimg = new Array("../CommonFiles/Images/switch1.jpg", "../CommonFiles/Images/switch2.jpg", "../CommonFiles/Images/switch3.jpg","../CommonFiles/Images/switch4.jpg");
	var x=(Math.floor(Math.random()*numimages));
	var randomimage=(rndimg[x]);
	if(randomimage==rndimg[0])
	  document.getElementById('randomlink').href="../goGreen/goGreen.asp";
	else if(randomimage==rndimg[1])
		document.getElementById('randomlink').href="../goGreen/goGreen.asp";
	else if(randomimage==rndimg[2])
	document.getElementById('randomlink').href="../goGreen/goGreen.asp";
	else if(randomimage==rndimg[3])
	document.getElementById('randomlink').href="../goGreen/goGreen.asp";
	document.getElementById("randomimage").src = randomimage ; 
	
	
	
	
	
}

