//CUSTOMISABLE VARIABLES
var highlightcolor = "#FFCCCC";//colour of menu button when on the page specified in the menu
var mouseovercolor = "#FF0000";
var mouseoutcolor = "#DD0000";//= btn color; this value will also be sent to index.css for button background colour at .menubtn in css/index.css
var menubackgroundcolor = "#C0C0C0";
var headerbackgroundcolor = "#000000";
var menupages = "about,cherries,quality,marketing,employ,contact,links";//insert filename of pages linked to in left menu

//GLOBAL VARIABLES
var fname;

//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))){
	recentBrowser = true; //Opera 7 also true for these parameters
	isIE=true;
}
if ((parseInt(navigator.appVersion) >= 5 && navigator.appName.indexOf("Netscape") != -1) || ((parseInt(navigator.appVersion) >= 6 && navigator.appName.indexOf("Netscape") != -1))){
	recentBrowser = true;
}

//FRAMES
if (window.location != top.location){top.location.href=window.location};

//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
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;
				}
			}	
			if ((thispathname.indexOf("index.htm")== -1) && isMenuPage){
				document.getElementById(fname).style.backgroundColor=highlightcolor;
				document.getElementById(fname).childNodes[0].childNodes[0].childNodes[0].childNodes[0].className="textHighlight";
			}
		}
}
function mouseoverMenu(menuid){
	if(recentBrowser){
		if (menuid==fname){
			document.getElementById(menuid).style.backgroundColor=highlightcolor;
		}else{
			if (isIE){document.getElementById(menuid).style.cursor="hand";}
			document.getElementById(menuid).style.backgroundColor=mouseovercolor;
			window.status=menuid+".htm";
			document.getElementById(menuid).title="Go to "+menuid.toUpperCase();
		}
	}	
}
function mouseoutMenu(menuid){
	if(recentBrowser){
		if (menuid==fname){
			document.getElementById(menuid).style.backgroundColor=highlightcolor;
		}else{
			document.getElementById(menuid).style.backgroundColor=mouseoutcolor;
		}
	}
}
function fnmenulink(menuid){
	if(recentBrowser){
		var menulink = menuid + ".htm";
		location.href= menulink;
	}
}
