/*
	Standards Compliant Rollover Script
	Author : Daniel Nolan http://www.bleedingego.co.uk/webdev.php
	Modified: add input & load
 -------------------------------------------------- */

function initRolloversMod() {
	if (!document.getElementById) return;
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');
	var aInput = document.getElementsByTagName('input');

	for (var i = 0; i < aImages.length; i++) {
		if (aImages[i].className == 'imgover') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_o'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_over'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
	for (var i = 0; i < aInput.length; i++) {
		if (aInput[i].className == 'imgover') {
			var src = aInput[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_o'+ftype);

			aInput[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aInput[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			aInput[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_over'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}
try {
	window.addEventListener("load",initRolloversMod,false);
} catch(e) {
	window.attachEvent("onload",initRolloversMod);
}


/* Popup Script
 -------------------------------------------------- */

function doPopups() {
	if (!document.getElementsByTagName) return false;
	var links = document.getElementsByTagName("a");
	for (var i=0; i < links.length; i++) {
		if (links[i].className.match("popup")) {
		links[i].onclick = function() {
			popwin =window.open(this.href,"popwin","left=0,top=0,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=650,height=670").focus();
			return false;
			}
		}
		if (links[i].className.match("popup1")) {
		links[i].onclick = function() {
			popwin =window.open(this.href,"popwin","left=0,top=0,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=630,height=620").focus();
			return false;
			}
		}
		if (links[i].className.match("popup2")) {
		links[i].onclick = function() {
			popwin =window.open(this.href,"popwin","left=0,top=0,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=545,height=680").focus();
			return false;
			}
		}
		if (links[i].className.match("popup3")) {
		links[i].onclick = function() {
			popwin =window.open(this.href,"popwin","left=0,top=0,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=680,height=670").focus();
			return false;
			}
		}
		if (links[i].className.match("popupNews")) {
		links[i].onclick = function() {
			popwin =window.open(this.href,"sub02","left=25,top=25,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=540,height=500").focus();
			return false;
			}
		}
		if (links[i].className.match("popupNews2")) {
		links[i].onclick = function() {
			popwin =window.open(this.href,"sub02","left=25,top=25,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=540,height=660").focus();
			return false;
			}
		}
		if (links[i].className.match("popup_obo")) {
		links[i].onclick = function() {
			popwin =window.open(this.href,"pop_obo","left=0,top=0,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=760,height=450").focus();
			return false;
			}
		}
	}
}
try {
	window.addEventListener("load",doPopups,false);
} catch(e) {
	window.attachEvent("onload",doPopups);
}

/* tooltip
 -------------------------------------------------- */
function showHide(id){
	if(document.all || document.getElementById){
		if(document.all){
			if(document.all(id).style.display == "none"){
				document.all(id).style.display = "block";
			} else {
				document.all(id).style.display = "none";
			}
		} else if(document.getElementById){
			if(document.getElementById(id).style.display == "none"){
				document.getElementById(id).style.display = "block";
			} else {
				document.getElementById(id).style.display = "none";
			}
		}
	}
}