var timezone_options = new Array();
	timezone_options["eastern"] = "Eastern(ET)";
	timezone_options["central"] = "Central(CT)";
	timezone_options["mountain"] = "Mountain(MT)";
	timezone_options["pacific"] = "Pacific(PT)";
	timezone_options["alaskan"] = "Alaskan(AK)";
	timezone_options["hawaiian"] = "Hawaiian(HI)";
	timezone_options["atlantic"] = "Atlantic(AT)";

var timezone_abbreviations = new Array();
	timezone_abbreviations["eastern"] = "ET";
	timezone_abbreviations["central"] = "CT";
	timezone_abbreviations["mountain"] = "MT";
	timezone_abbreviations["pacific"] = "PT";
	timezone_abbreviations["alaskan"] = "AK";
	timezone_abbreviations["hawaiian"] = "HI";
	timezone_abbreviations["atlantic"] = "AT";
	
	
// Modal Box
path_to_root_dir = webroot;
var showMyBox = function() {
	//window.focus();
	if($("SessionTimingOut_overlay")!='undefined')
	{
		//$("SessionTimingOut_overlay").remove();
	}
	var myBox = new GlassBox();
	$("SessionTimingOut").style.display = 'block';
	myBox.init( 'SessionTimingOut', '450px', '360px', 'hidden', '', true, false );
	myBox.lbo( true, 0.50 ); 
}

var hideMyBox = function() {
	new Effect.Fade('SessionTimingOut');
	new Effect.Fade('SessionTimingOut_overlay', { afterUpdate: function(effect) {
          //$('SessionTimingOut_overlay').remove();
        }});
	
	document.body.style.height = 'auto';
	document.body.style.overflow = 'auto';
	window.onscroll=function() { return true; }
	//myBox.fade();
	//$("SessionTimingOut").style.display = 'block';
	//myBox.lbo( true, 0.50 ); 
}

$(document).observe("dom:loaded", function(){
	//showMyBox();
	$("SessionTimingOut").style.display = 'none';
	$("SessionTimedOut").style.display = 'none';	
});


function clickclear(thisfield, defaulttext) {
if (thisfield.value == defaulttext) {
thisfield.value = "";
}
}
function clickrecall(thisfield, defaulttext) {
if (thisfield.value == "") {
thisfield.value = defaulttext;
}
}

function cleanString(inputtext)
{
	return encodeURIComponent(inputtext);
}
function getStDay()
{
 calendar = new Date();
 var retstring = "";
 day = calendar.getDay();
 month = calendar.getMonth();
 date = calendar.getDate();
 year = calendar.getYear();
 if (year < 1000)
 year+=1900
 cent = parseInt(year/100);
 g = year % 19;
 k = parseInt((cent - 17)/25);
 i = (cent - parseInt(cent/4) - parseInt((cent - k)/3) + 19*g + 15) % 30;
 i = i - parseInt(i/28)*(1 - parseInt(i/28)*parseInt(29/(i+1))*parseInt((21-g)/11));
 j = (year + parseInt(year/4) + i + 2 - cent + parseInt(cent/4)) % 7;
 l = i - j;
 emonth = 3 + parseInt((l + 40)/44);
 edate = l + 28 - 31*parseInt((emonth/4));
 emonth--;
 var dayname = new Array ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
 var monthname = new Array ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec" );
 
 retstring = retstring + dayname[day] + ", ";
 retstring = retstring + monthname[month] + " ";
 if (date< 10) retstring = retstring + "0" + date + " ";
         else retstring = retstring + date + " ";
         
 return retstring;
}
function updateTopTime()
{
	var currentTime = new Date()
	var hours = currentTime.getHours()
	var minutes = currentTime.getMinutes()
	
	var month = currentTime.getMonth() + 1
	var day = currentTime.getDate()
	var year = currentTime.getFullYear()
	var datestring = month + "/" + day + "/" + year;
	
	if (minutes < 10){
		minutes = "0" + minutes
	}
	var timestring = hours + ":" + minutes + " ";
	
	if(hours > 11){
		timestring = timestring+"PM";
	} else {
		timestring = timestring+"AM";
	}
	
	timezone = parseInt(currentTime.getTimezoneOffset()/60);
	retstring = timestring + " " + getStDay() + " " + year;
	
	$("top_time").innerHTML = retstring;
}


function updateClock ( )
{
  var currentTime = new Date ( );

  var currentHours = currentTime.getHours ( );
  var currentMinutes = currentTime.getMinutes ( );
  var currentSeconds = currentTime.getSeconds ( );

 	var month = currentTime.getMonth() + 1
	var day = currentTime.getDate()
	var year = currentTime.getFullYear()
	var datestring = month + "/" + day + "/" + year;

  // Pad the minutes and seconds with leading zeros, if required
  currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
  currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;

  // Choose either "AM" or "PM" as appropriate
  var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM";

  // Convert the hours component to 12-hour format if needed
  currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours;

  // Convert an hours component of "0" to "12"
  currentHours = ( currentHours == 0 ) ? 12 : currentHours;

  // Compose the string for display
  var currentTimeString = currentHours + ":" + currentMinutes + " " + timeOfDay;

  // Update the time display
 
  timezone = parseInt(currentTime.getTimezoneOffset()/60);
  $("top_time").innerHTML = currentTimeString + " " + getStDay() + " " + year;;
}

Element.addMethods({
  scrollTo: function(element, left, top){
    var element = $(element);
    if (arguments.length == 1){
      var pos = element.cumulativeOffset();
      window.scrollTo(pos[0], pos[1]);
    } else {
      element.scrollLeft = left;
      element.scrollTop  = top;
    }
    return element;
  }
});
