var months = new Array();
months = ["January ","February ","March ","April ","May ","June ","July ","August ","September ","October ","November ","December "];
var days = new Array();
days = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];

function ShowDate(){
	var today = new Date();
	document.write(days[today.getDay()] +", "+ months[today.getMonth()] + today.getDate() +", "+ today.getFullYear());
}

//Date display function for Australia
function ShowDate_au(){
	var today = new Date();
	document.write(days[today.getDay()] +", "+ today.getDate() +" "+ months[today.getMonth()] +" "+ today.getFullYear());
}

function LaunchTool(toolHTMLFile) {
	window.open(toolHTMLFile,'_blank','width=500,height=360,top=20,left=10,resizable=yes');
}

function LaunchHelp(helpHTMLFile) {
	window.open(helpHTMLFile,'Trouble','width=200,height=300,top=20,left=520,scrollbars=yes');
}


//VERSION 7.0 UPDATES TO THE STANDARD.JS FILE 5-5-00 BY B.SARSANY 
//Date function to change GMT string to local
function gmt2local(gmt,area){
	var today = new Date(gmt);
	var offst = today.toLocaleString();
	if (area == 1){
	
	document.write(days[today.getDay()] +", "+ months[today.getMonth()] + today.getDate() +", "+ today.getFullYear());
	}
	else {
	if (area == 2){
	document.write(days[today.getDay()] +", "+ today.getDate() +" "+ months[today.getMonth()] +" "+ today.getFullYear());
}
}
}



//Function to convert the offset and GMT time to local time
function date_calc(gmt,offset) {
	var today = new Date(gmt);
	var hours = offset;
	
	
	var houroffset=(60*60*1000*offset);
	
	var parsedate = Date.parse(today);
	var newdate=(parsedate+houroffset);
	var finaldate = new Date(newdate);
	return(finaldate);
	//document.write(finaldate);
	}
	
	
//Date function to change format of the date passed in
//display types
//type "" = type 1 us/au 
//type 1  = 'wednesday, Apr. 5, 2000' or 'wednesday, 5 Apr. 2000'
//type 2  = '10:50 pm'
//type 3  = 'mm/dd/yy' 
function date_formatter(gmt,area,disp) {
if (disp == ""){
	var today = new Date(gmt);
	var offst = today.toLocaleString();
	if (area == 1){
	
	document.write(days[today.getDay()] +", "+ months[today.getMonth()] + today.getDate() +", "+ today.getFullYear());
	}
	else {
	if (area == 2){
	document.write(days[today.getDay()] +", "+ today.getDate() +" "+ months[today.getMonth()] +" "+ today.getFullYear());
}
}
}

if (disp == "1"){
	var today = new Date(gmt);
	var offst = today.toLocaleString();
	if (area == 1){
	
	document.write(days[today.getDay()] +", "+ months[today.getMonth()] + today.getDate() +", "+ today.getFullYear());
	}
	else {
	if (area == 2){
	document.write(days[today.getDay()] +", "+ today.getDate() +" "+ months[today.getMonth()] +" "+ today.getFullYear());
}
}
}


if (disp == "2"){
	var today = new Date(gmt);
	
	hours = ["1","2","3","4","5","6","7","8","9","10","11","12","1","2","3","4","5","6","7","8","9","10","11","12"];
	var temp = today.getHours();
	
	//var ammm = "am";
	if (temp <= 12){var ampm = "AM";}else{var ampm = "PM";}
	
	var offst = today.toLocaleString();
	if (area == 1){
	
	document.write(hours[today.getHours()] +":"+ today.getMinutes() +" "+ ampm);
	}
	else {
	if (area == 2){
	document.write(hours[today.getHours()] +":"+ today.getMinutes() +" "+ ampm);
}
}
}

if (disp == "3"){
	var today = new Date(gmt);
	
	var offst = today.toLocaleString();
	if (area == 1){
	
	document.write(today.getMonth() +"/"+ today.getDate() +"/"+ today.getYear());
	}
	else {
	if (area == 2){
	document.write(today.getMonth() +"/"+ today.getDate() +"/"+ today.getYear());
}
}
}

}