function func() {
  		var currentDate = new Date();
		var curMonth = currentDate.getMonth() + 1;
		var curDay = currentDate.getDate();
		var curYear = currentDate.getYear();
		if (curYear < 1000) {
					curYear += 1900;
			}
		var lastYear = curYear - 1;
	return curMonth + "/" + curDay + "/" + lastYear;
}

var STATE = new Array(0, 'RentCar', 'Help', 'MyProfile');

var rightnow = true;

var lgrey = '#E4E4E2';	/* light grey */
var dgrey = '#999999';	/* dark grey */
var black = '#000000';	/* black */
var orange = '#FF6600';	/* orange */
var egreen = '#007D5D';	/* enterprise green */

var blank = '<IMG SRC="/images/dotBlank.gif" WIDTH="11" HEIGHT="1">';

var htmlstr = "";
var bgcolor = "";

var toplayer = new Array('RentCar', 'CarSales', 'FleetServices', 'Careers', 'AboutUs', 'ContactUs');
var topstr   = new Array('Rent&nbsp;a&nbsp;Car', 'Buy&nbsp;a&nbsp;Car', 'Manage&nbsp;Your&nbsp;Fleet',
                         'Careers', 'About&nbsp;Us', 'Contact&nbsp;Us');
var botlayer = null;
var botstr   = null;

var tophighlight = null;
var bothighlight = null;

var tophyperlinks = new Array('http://www.enterprise.com/',
                              'http://www.enterprise.com/carsales/home.do',
                              'http://www.enterprise.com/fleets/',
                              'http://www.erac.com/recruit/',
                              '/index.html',  //about us
                              'http://www.enterprise.com/car_rental/contactUs.do'
                             );
var bothyperlinks = null;

var topx = new Array(222, 303, 379, 553, 621, 691);
var botx = null;
var y = new Array(16, 33);

function layer_setup()
{
  if (STATE[0] == 0) {
    botlayer = new Array('Reservation', 'Vehicles', 'Locations', 'CorporateAccounts', 'MyProfile', 'Help');
    botstr   = new Array('Reservation', 'Vehicles', 'Locations', 'Corporate&nbsp;Accounts', 'My&nbsp;Profile', 'Help');
    bothyperlinks = new Array('#', '#', '#', '#', 'http://enterprise.custhelp.com/cgi-bin/enterprise.cfg/php/enduser/ask.php');
    botx = new Array(209, 285, 341, 406, 465, 587, 731);		
  } else if (STATE[0] == 1 || STATE[0] == 3) {
    botlayer = null;
    botstr   = null;
  } else if (STATE[0] == 2) {
    botlayer = new Array('Who_We_Are', 'What_We_Do', 'What_We_Believe', 'Press_Room', 'Help');
    botstr   = new Array('Who We Are', 'What We Do', 'What We Believe', 'Press Room', 'Help');
    bothyperlinks = new Array('/who_we_are/who_we_are.html',
                              '/what_we_do/what_we_do.html',
                              '/what_we_believe/what_we_believe.html',
                              '/press_room/press_room.asp',
                              'http://enterprise.custhelp.com/'
		                          );
    botx = new Array(209, 300, 390, 510, 727);
  } else {
    alert('This is not supposed to happen.');
  }
}

function hide_layers(arg)
{
  var pieces = new Array();
  
  if (arg == '') {
    return;
  }
  
  pieces = arg.split(" ");
 
  create_objects(); 
  
  for (var nr = 0; nr < pieces.length; nr++) {
    if (objects[pieces[nr]]) {
      objects[pieces[nr]].hide();
    }
  }
}

function change_state(arg0, arg1, arg2, arg3)
{
  if (arg3 == null) {
    arg3 = 'MyProfile';
  }

  STATE = new Array(arg0, arg1, arg2, arg3);
  tophighlight = arg1;
  bothighlight = arg2;
  layer_setup();
  navigation_start();
  hide_layers(arg3);
}

onresize = function()
{
  if (agent.ns) {
    document.location.href = document.location.href;
  }
}

function handle_mouse_over(arg, color)
{
  create_objects();
  objects[arg].set_bgcolor(color);
}

function handle_mouse_out(arg, color)
{
  create_objects();
  objects[arg].set_bgcolor(color);
}

function navigation_start()
{
  var DEBUG = 0;
  create_objects();
  
  for (var nr = 0; nr < toplayer.length; nr++) {
    if (toplayer[nr] == tophighlight) {
//      htmlstr = blank + '<SPAN CLASS="nav0on">' + topstr[nr] + '</SPAN>' + blank;
      htmlstr = blank + '<A target="_top" href="' + tophyperlinks[nr] + '" CLASS="nav0on">' + topstr[nr] + '</A>' + blank;
      bgcolor = black;
    } else {
      htmlstr = blank + '<A target="_top" href="' + tophyperlinks[nr] + '" CLASS="nav0off" ONMOUSEOVER="handle_mouse_over(\'' + toplayer[nr] + '\', dgrey);" ONMOUSEOUT="handle_mouse_out(\'' + toplayer[nr] + '\', lgrey);">' + topstr[nr] + '</A>' + blank;
      bgcolor = lgrey;
    }

//    if (DEBUG == 1) {
//      alert(htmlstr);
//    }
    
    if (agent.ie) {
    	var top_x = topx[nr] - 1;
    	var lyr_y = y[0] - 1;
    } else if (agent.gecko) {
    	var top_x = topx[nr] - 1;
    	var lyr_y = y[0] - 1;
    } else {
    	var top_x = topx[nr] - 1;    	
    	var lyr_y = y[0];
    }
    
    if (agent.ns) {
      objects[toplayer[nr]].set_height(16);
    }
     	
    //alert(toplayer[nr]);
    
    objects[toplayer[nr]].set_html(htmlstr);
    objects[toplayer[nr]].move(top_x, lyr_y);
    objects[toplayer[nr]].set_bgcolor(bgcolor);
    objects[toplayer[nr]].show();
  }

  if (botlayer == null) {
    return;
  }

  for (nr = 0; nr < botlayer.length; nr++) {
    if (botlayer[nr] == bothighlight) {
      htmlstr = blank + '<SPAN CLASS="nav1">' + botstr[nr] + '</SPAN>' + blank;
      bgcolor = black;
    } else if (bothyperlinks != null) {
      htmlstr = blank + '<A HREF="' + bothyperlinks[nr] + '" CLASS="nav1" ONMOUSEOVER="handle_mouse_over(\'' + botlayer[nr] + '\', egreen);" ONMOUSEOUT="handle_mouse_out(\'' + botlayer[nr] + '\', black);">' + botstr[nr] + '</A>' + blank;
      bgcolor = black;
    } else {
      htmlstr = blank + '<SPAN CLASS="nav1">' + botstr[nr] + '</SPAN>' + blank;
      bgcolor = black;
    }

//    if (DEBUG == 1) {
//      alert(htmlstr);
//    }   

    if (agent.ie) {
    	var bot_x = botx[nr] - 1;
    	var lyr_y = y[1] - 1;
    } else if (agent.gecko) {
    	var bot_x = botx[nr] - 1;
    	var lyr_y = y[1] - 1;
    } else {
    	var bot_x = botx[nr] - 1;    	
    	var lyr_y = y[1];
    }

    objects[botlayer[nr]].set_html(htmlstr);
    objects[botlayer[nr]].move(bot_x, lyr_y);
    objects[botlayer[nr]].set_bgcolor(bgcolor);
    objects[botlayer[nr]].show();
    
    if (botlayer[nr] == bothighlight) {
      objects["WhiteDot"].move(bot_x - 2, lyr_y + 3);
      objects["WhiteDot"].show();
    }
  }
}