function showLoading() {
	var lDiv = document.getElementById("loadingDiv");

	var wwidth=(window.innerWidth)?window.innerWidth:((document.all)?document.body.clientWidth:null);
	var wheight=(window.innerHeight)?window.innerHeight:((document.all)?document.documentElement.clientHeight:null);

	lDiv.style.left = (wwidth-parseInt(lDiv.style.width))/2 + "px";
	lDiv.style.top = (wheight-parseInt(lDiv.style.height))/2 + "px";
	lDiv.style.display="block";

	lDiv.style.display="block";
}

function hideLoading() {
	var lDiv = document.getElementById("loadingDiv");
	lDiv.style.display="none";
}

function hideDiv(id) {
	var el = document.getElementById(id);
	if(el) {
		el.innerHTML = "";
		el.style.display = "none";
	}
}


// XML Functions
function checkNode(n, c) {
	if(!n.selectSingleNode(c)) {
		var el = n.ownerDocument.createElement(c)
		n.appendChild(el);
	}
}

function setValue(n, c, v) {
	checkNode(n, c);
	var t = n.selectSingleNode(c);
	while(t.hasChildNodes()) {
		t.removeChild(t.firstChild);
	}
	t.appendChild(n.ownerDocument.createTextNode(v));
}

function getValue(n, d) {
	return n ? (n.hasChildNodes() ? n.firstChild.nodeValue : d) : d;
}

function commonAddListener(e, a, f) {
	if(ie) {e.attachEvent("on"+a, f);} else {e.addEventListener(a, f, false);}
}

function commonRemoveListener(e, a, f) {
	if(ie) {e.detachEvent("on"+a, f);} else {e.removeEventListener(a, f, false);}
}

function emptySelect(sEl) {
	for(var i=sEl.options.length-1;i>=0;i--) {
		sEl.options[i] = null;
	}
}