// JavaScript Document

// EDIT THESE VALUES IF REQUIRED
var alertText = 'Are you sure you wish to perform this action' + "\n"; //DEFAULT TEXT DISPLAYED ON CONFIRM BUTTONS/LINKS WHEN NO ALT/TITLE
var newWindowLink = false; //OPEN EXTERNAL LINKS BY DEFAULT IN A NEW WINDOW (TRUE/FALSE)?


var woms = new Array(); //CREATE ARRAY OF FUNCTIONS TO LAUNCH ONLOAD

//ONLOAD MANAGER
function womOn(){
  window.onload = womGo;
}

function womGo(){
  for(var i = 0;i < woms.length;i++)
    eval(woms[i]);
}

function womAdd(func){
  woms[woms.length] = func;
}

function CreateBookmarkLink() {

	title = document.title;
	url = window.location.href;
	
	if (window.sidebar) { 
		window.sidebar.addPanel(title, url,"");
	} else if(window.external) {
		window.external.AddFavorite( url, title); 
	} else if(window.opera && window.print) {
		return true;
	}
	
}

function objToggle(obj) { 

	var obj = document.getElementById(obj);

	if(obj.style.display == "block") { 
		obj.style.display = "none";
	} else { 
		obj.style.display = "block";
	}

}

function expandMenu() {
	
	var control=document.getElementById('nav');
	var listElements=control.getElementsByTagName("li");
	
	for(var i=0; i<listElements.length; i++) {
		//EXPAND MENU
		listElements[i].onmouseover=function() {
				var uls=this.getElementsByTagName("ul");
				for(var n=0; n<uls.length; n++) {
					if(n==0) {
						uls[n].style.display="block";
					}
					
				}
			}
		//CLOSE MENU	
		listElements[i].onmouseout=function() {
			var uls=this.getElementsByTagName("ul");
				for(var n=0; n<uls.length; n++) {
					if(n==0) {
						uls[n].style.display="none";
					}
					
				}
		}
	}
}

/*
* homepage
*/

/*
if(!document.getElementById('keyword')) return false;
	
	var keyword = document.getElementById('keyword');
	
	keyword.onfocus = function()
	{
		if(document.getElementById('keyword').value == 'Keyword / Item code')
		{
				document.getElementById('keyword').value = '';
		}
	}
*/


function searchform() 
{
	if(!document.getElementById('searchterm')) return false;
		
	var searchterm = document.getElementById('searchterm');
	
	searchterm.onfocus = function()
	{
		if(document.getElementById('searchterm').value == 'Search the site')
		{
			document.getElementById('searchterm').value = '';
		}
	}	
}




   
