// JavaScript Document
window.onload = loadHomeContent;

/*function loadHomeContent() {
	open_url("homeContent.html", "mainContentTable_1");
	}
	*/
var please_wait = null;

function open_url(url, target) {
 	if ( ! document.getElementById) {
		alert("sorry, this browser can't use features on this site");
  		return false;
 	}

 	if (please_wait != null) {
  		document.getElementById(target).innerHTML = please_wait;
 	}

 	if (window.ActiveXObject) {
  		link = new ActiveXObject("Microsoft.XMLHTTP");
 	} else if (window.XMLHttpRequest) {
  		link = new XMLHttpRequest();
 	}

 	if (link == undefined) {
  		return false;
 	}
 	link.onreadystatechange = function() { response(url, target); }
 	link.open("GET", url, true);
 	link.send(null);
}

function response(url, target) {
 	if (link.readyState == 4) {
	 	document.getElementById(target).innerHTML = (link.status == 200) ? link.responseText : "Ooops!! A broken link! Please contact the webmaster of this website ASAP and give him the fallowing errorcode: " + link.status;
	}
}

function set_loading_message(msg) {
 	please_wait = msg;
}

window.onload = rolloverInit;

function rolloverInit() {
	for (var i=0; i<document.images.length; i++) {
		if (document.images[i].parentNode.tagName == "A") {
			setupRollover(document.images[i]);
		}
	}
}
function setupRollover(thisImage) {
	thisImage.outImage = new Image();
	thisImage.outImage.src = thisImage.src;
	thisImage.onmouseout = rollOut;
	
	thisImage.overImage = new Image();
	thisImage.overImage.src = "images/navGif/" + thisImage.id +"_on.gif";
	thisImage.onmouseover = rollOver;
	
	thisImage.clickImage = new Image();
	thisImage.clickImage.src = "images/navGif/" + thisImage.id + "_click.gif";
	thisImage.onmousedown = rollClick;
	
	thisImage.parentNode.childImg = thisImage;
	thisImage.parentNode.onblur = rollOutChild;
	thisImage.parentNode.onfocus = rollOverChild;
}

function rollOut() {
	this.src = this.outImage.src;
}
function rollOver() {
	this.src = this.overImage.src;
}
function rollClick()  {
	this.src = this.clickImage.src;	
}
function rollOutChild() {
	this.childImg.src = this.childImg.outImage.src;
}
function rollOverChild() {
	this.childImg.src = this.childImg.overImage.src;	
}
