
onerror = errorHandler;
function errorHandler(errorMessage, url, line) {
//alert (errorMessage + "   " + line);
return false;
}



originalColorArray = new Array();

function changeBg(tr) {
	if (isTrMarked(tr)) return;
	var children = tr.childNodes;
	tmpArray = new Array();
	if (tr.children) {
		for (var i=0;i < children.length; i++) {
			tmpArray[i] = tr.children[i].bgColor;
			tr.children[i].bgColor='ffffcc';
		}
	}
	originalColorArray[tr.rowIndex] = tmpArray;
}

function resetBg(tr) {
	if (isTrMarked(tr)) return;
	tmpArray = originalColorArray[tr.rowIndex];
	var children = tr.childNodes;
	if (tr.children) {
		for (var i=0;i < children.length; i++) {
			tr.children[i].bgColor=tmpArray[i];
		}
	}
}

function isTrMarked(tr) {

	if (tr.children && tr.children[0].bgColor=='#437ca7') {
		return true;
	}
	return false;
}

function markTr(tr) {
	var children = tr.childNodes;
	var doStyle = true;
	if (isTrMarked(tr)) {
		unMarkTr(tr);
	} else {
		tmpArray = new Array();
		if (tr.children) {
			for (var i=0;i < children.length; i++) {
				tr.children[i].bgColor='437CA7';
				if (tr.children[i].style.color == "red") {
					tr.children[i].style.color="ffff00";
				} else {
					tr.children[i].style.color="ffffff";
				}
				if (tr.children[i].childNodes[0] != null && tr.children[i].childNodes[0].nodeName == "A") {
					tr.children[i].childNodes[0].style.color="ffffff";
				}
			}
		}
	}
}

function unMarkTr(tr) {
	var children = tr.childNodes;
	tmpArray = originalColorArray[tr.rowIndex];
	if (tr.children) {
		for (var i=0;i < children.length; i++) {
			tr.children[i].bgColor=tmpArray[i];
			if (tr.children[i].style.color == "#ffff00") {
				tr.children[i].style.color="red";
			} else {
				tr.children[i].style.color="000000";
			}
			if (tr.children[i].childNodes[0].nodeName == "A") {
				tr.children[i].childNodes[0].style.color="305E80";
			}
		}
	}
}


function getById(id) {
   return document.getElementById?document.getElementById(id):(document.all?document.all(id):null);
}

function hideDiv(id) {
   getById(id).style.visibility = "hidden";
   getById(id).style.display = "none";
}

function showDiv(id) {
   	getById(id).style.visibility = "visible";
   	getById(id).style.display = "inline";
}

function doNothing() {}

function getScroll() {
	if (document.all) {
		var ieBox = document.compatMode != "CSS1Compat";
		var cont = ieBox ? document.body : document.documentElement;
		return {x:cont.scrollLeft, y:cont.scrollTop};
	} else {
		return {x:window.pageXOffset, y:window.pageYOffset};
	}
}

function hidePopBox() {
	hideDiv('popBox');
	hideDiv('popBoxShadow');
}

