//
// header_js.js
//
// javascripts for the HepSEQ-Research site
//

// JAVASCRIPT INDEXOF FUNCTION IS NEEDED FOR IE5
		if(!Array.indexOf){
			Array.prototype.indexOf = function(obj){
				for(var i=0; i<this.length; i++){
					if(this[i]==obj){
						return i;
					}
				}
				return -1;
			}
		}

// GLOBAL VARIABLES
	var page = "";

// FUNCTION TO HIGHLIGHT THE TAB AFTER LOADING THE PAGE
	function tab_highlighter() {
		if ((window.location.href == "http://158.119.147.40/gnani/HepSEQ-Research/Public/Web_Front/main.php")
				|| (window.location.href == "http://158.119.147.40/HepSEQ-Research/Public/Web_Front/main.php")
				|| (window.location.href == "http://www.hpa-bioinformatics.org.uk/gnani/HepSEQ-Research/Public/Web_Front/main.php")
				|| (window.location.href == "http://www.hpa-bioinformatics.org.uk/HepSEQ-Research/Public/Web_Front/main.php")) {
			page = "home";
		}
		else if ((window.location.href == "http://158.119.147.40/gnani/HepSEQ-Research/Public/Web_Front/news.php")
				|| (window.location.href == "http://158.119.147.40/HepSEQ-Research/Public/Web_Front/news.php")
				|| (window.location.href == "http://www.hpa-bioinformatics.org.uk/gnani/HepSEQ-Research/Public/Web_Front/news.php")
				|| (window.location.href == "http://www.hpa-bioinformatics.org.uk/HepSEQ-Research/Public/Web_Front/news.php")) {
			page = "news";
		}
		else if ((window.location.href == "http://158.119.147.40/gnani/HepSEQ-Research/Public/Web_Front/overview.php")
				|| (window.location.href == "http://158.119.147.40/HepSEQ-Research/Public/Web_Front/overview.php")
				|| (window.location.href == "http://www.hpa-bioinformatics.org.uk/gnani/HepSEQ-Research/Public/Web_Front/overview.php")
				|| (window.location.href == "http://www.hpa-bioinformatics.org.uk/HepSEQ-Research/Public/Web_Front/overview.php")) {
			page = "overview";
		}
		else if ((window.location.href == "http://158.119.147.40/gnani/HepSEQ-Research/Public/Web_Front/clinical.php")
				|| (window.location.href == "http://158.119.147.40/HepSEQ-Research/Public/Web_Front/clinical.php")
				|| (window.location.href == "http://www.hpa-bioinformatics.org.uk/gnani/HepSEQ-Research/Public/Web_Front/clinical.php")
				|| (window.location.href == "http://www.hpa-bioinformatics.org.uk/HepSEQ-Research/Public/Web_Front/clinical.php")) {
			page = "clinical";
		}
		else if ((window.location.href == "http://158.119.147.40/gnani/HepSEQ-Research/Public/Web_Front/epi.php")
				|| (window.location.href == "http://158.119.147.40/HepSEQ-Research/Public/Web_Front/epi.php")
				|| (window.location.href == "http://www.hpa-bioinformatics.org.uk/gnani/HepSEQ-Research/Public/Web_Front/epi.php")
				|| (window.location.href == "http://www.hpa-bioinformatics.org.uk/HepSEQ-Research/Public/Web_Front/epi.php")) {
			page = "epi";
		}
		else if ((window.location.href == "http://158.119.147.40/gnani/HepSEQ-Research/Public/Web_Front/sequence.php")
				|| (window.location.href == "http://158.119.147.40/HepSEQ-Research/Public/Web_Front/sequence.php")
				|| (window.location.href == "http://www.hpa-bioinformatics.org.uk/gnani/HepSEQ-Research/Public/Web_Front/sequence.php")
				|| (window.location.href == "http://www.hpa-bioinformatics.org.uk/HepSEQ-Research/Public/Web_Front/sequence.php")) {
			page = "sequence";
		}
		else if ((window.location.href == "http://158.119.147.40/gnani/HepSEQ-Research/Public/Web_Front/site_search.php")
				|| (window.location.href == "http://158.119.147.40/HepSEQ-Research/Public/Web_Front/site_search.php")
				|| (window.location.href == "http://www.hpa-bioinformatics.org.uk/gnani/HepSEQ-Research/Public/Web_Front/site_search.php")
				|| (window.location.href == "http://www.hpa-bioinformatics.org.uk/HepSEQ-Research/Public/Web_Front/site_search.php")) {
			page = "search";
		}
		else if ((window.location.href == "http://158.119.147.40/gnani/HepSEQ-Research/Public/Web_Front/contacts.php")
				|| (window.location.href == "http://158.119.147.40/HepSEQ-Research/Public/Web_Front/contacts.php")
				|| (window.location.href == "http://www.hpa-bioinformatics.org.uk/gnani/HepSEQ-Research/Public/Web_Front/contacts.php")
				|| (window.location.href == "http://www.hpa-bioinformatics.org.uk/HepSEQ-Research/Public/Web_Front/contacts.php")) {
			page = "contact";
		}
		else if ((window.location.href == "http://158.119.147.40/gnani/HepSEQ-Research/Public/Web_Front/register.php")
				|| (window.location.href == "http://158.119.147.40/HepSEQ-Research/Public/Web_Front/register.php")
				|| (window.location.href == "http://www.hpa-bioinformatics.org.uk/gnani/HepSEQ-Research/Public/Web_Front/register.php")
				|| (window.location.href == "http://www.hpa-bioinformatics.org.uk/HepSEQ-Research/Public/Web_Front/register.php")) {
			page = "register";
		}

		if ((page != undefined) &&  (page != "")) {
			if (document.getElementById(page)) {
				document.getElementById(page).style.backgroundColor 	= "#EF8686";
			}
		}
	}

// FUNCTION TO HIGHLIGHT THE TAB WHEN MOUSEOVER
	function bgHighlight(overCell) {
		if (overCell != page) {
			var overTab 	= document.getElementById(overCell);
			overTab.style.backgroundColor	= "#ffffff";
		}
	}

// FUNCTION TO HIGHLIGHT THE TAB WHEN MOUSEOUT
	function bgNormal(outCell) {
		if (outCell != page) {
			var outTab 	= document.getElementById(outCell);
			outTab.style.backgroundColor	= "#ffffff";
		}
	}
