//VARIABLES
var highlightcolor = "#98FB98";//ie current page menu colour
var mouseovercolor = "#98FB98";
var mouseoutcolor = "#CDFFCD";// should be same as original table cell colour
var menupages = "hosting,advanced,design,domain,access,other";//insert filename of pages linked to in left menu

//BROWSERS
var recentBrowser = false; 
var isIE = false;
if ((parseInt(navigator.appVersion) >= 4 && navigator.appVersion.indexOf("MSIE") != -1) || ((parseInt(navigator.appVersion) >= 6 && navigator.appName.indexOf("Netscape") != -1))){
isIE = true;
recentBrowser = true;
//opera 7 also true for these parameters
}
if ((parseInt(navigator.appVersion) >= 5 && navigator.appName.indexOf("Netscape") != -1) || ((parseInt(navigator.appVersion) >= 6 && navigator.appName.indexOf("Netscape") != -1))){
recentBrowser = true;
}

//PRELOAD IMAGES
var img1 = new Image; img1.src = "images/marker1.gif";

//DATE & TIME
var days = new Array(7)
days[1] = "Sunday";
days[2] = "Monday";
days[3] = "Tuesday"; 
days[4] = "Wednesday";
days[5] = "Thursday";
days[6] = "Friday";
days[7] = "Saturday";

var months = new Array(12)
months[1] = "Jan";
months[2] = "Feb";
months[3] = "Mar";
months[4] = "Apr";
months[5] = "May";
months[6] = "Jun";
months[7] = "Jul";
months[8] = "Aug";
months[9] = "Sep";
months[10] = "Oct"; 
months[11] = "Nov";
months[12] = "Dec";

var today = new Date();
var day = days[today.getDay() + 1]
var month = months[today.getMonth() + 1]
var date = today.getDate()
var year=today.getYear(); 

if (year < 2000){
	year = year + 1900;
}

//MENU HIGHLIGHTING
var fname;
function highlightMenu(){
	if (recentBrowser){
		var thispathname= window.location.toString();
		var parts = thispathname.split("/");
		var fnameextn = parts[parts.length-1];
		var bits = fnameextn.split(".");
		fname = bits[0];
		var menuarray=menupages.split(",");
		var isMenuPage=false;
		for (var i=0;i<menuarray.length;i++){
			if(menuarray[i]==fname){
				isMenuPage=true;
			}
		}	
  		var filepath = document.location.toString();
    		if ((filepath.indexOf("index.htm")== -1)&& isMenuPage){
  			document.getElementById(fname).style.backgroundColor=highlightcolor;
  			document.getElementById(fname).style.backgroundImage="url(images/marker1.gif)";
  			document.getElementById(fname).style.backgroundRepeat="no-repeat";
  			document.getElementById(fname).style.backgroundPositionY="8px";
  		}
	}
}

function mouseoverMenu(menuid){
	if (recentBrowser){
		if (menuid==fname){
			document.getElementById(menuid).style.backgroundColor=highlightcolor;
		}else{
			if (isIE){
				document.getElementById(menuid).title="Go to "+menuid.toUpperCase();
				document.getElementById(menuid).style.cursor="hand"
			};
			document.getElementById(menuid).style.backgroundColor=mouseovercolor;
			window.status="http://www.wangnet.com.au/"+menuid+".htm";
		}
	}
}

function mouseoutMenu(menuid){
	if (recentBrowser){
		if (menuid==fname){
			document.getElementById(menuid).style.backgroundColor=highlightcolor;
		}else{
			document.getElementById(menuid).style.backgroundColor=mouseoutcolor;
		}
	}
}
