// JavaScript Document
numberOfMenuItems = 5;

 // DISPLAY RELEVENT MENU ITEM
function showHide(n){
	for(i=1;i<=numberOfMenuItems;i++){//loop through all menu items
		m = "menu"+i;
		if(n == m){
			document.getElementById(m).style.display = "block";
		}
	}
}

// RETURN VALUE OF m IN URL HTTP GET VALUE  ie. index.asp?m=welcome  -- returns "welcome"
function getId(){
	s = "";
	defaultS = "1";
	if(location.search != ""){// if HTTP GET value exists...
		var loc = location.search.substr(1)
		var v = loc.split("&"); // creates strings where & exists. ie. "m=3" , "t = 30",  "d = 20"
		for(i=0;i<v.length;i++){ // loop through all name/value pairs
		var n = v[i].split("=");
			if(n[0] == "id"){ // first n value is the variable name
				s = n[1];
			}
		}
		if(s==""){
			s = defaultS; // if GET variables available but no match set S to default
		}
	}else{
		s = defaultS; // if no GET variables available set S to default
	}
	return s;
}
function _getVal(v){
	 // RETURN VALUE OF id IN URL HTTP GET VALUE  ie. index.asp?id=12  -- returns 12
	s = "";
	defaultS = "1";
	if(location.search != ""){// if HTTP GET value exists...
		var loc = location.search.substr(1)
		var v = loc.split("&"); // creates strings where & exists. ie. "m=3" , "t = 30",  "d = 20"
		for(i=0;i<v.length;i++){ // loop through all name/value pairs
		var n = v[i].split("=");
			if(n[0] == v){ // first n value is the variable name
				s = n[1];
			}
		}
		if(s==""){
			s = defaultS; // if GET variables available but no match set S to default
		}
	}else{
		s = defaultS; // if no GET variables available set S to default
	}
	return s;
}

function fillTitle(i){
	menu = document.getElementById(i); // find selected ul menu
	var mitems = menu.getElementsByTagName("li")[0];
	t = document.getElementById("title");
	t.innerHTML = mitems.innerHTML;
}
function date_n_time(){
//returns date string in format:   Thu, 20 Sep 2007 11:38:55 GMT
	var now = new Date()
	d=now.toUTCString();
	
	return d;
}