//RollOver script
//Copyright(C): Altoros Systems, www.alroros.com
//This script looks through the links array of the document and sets events to those that
//that have preconfigured mask in their IDs.
window.onload = initRollOver;
	function initRollOver() {
		//Set up mask
		var mask = "tmLink";
		var mask2 = "lmLink";
		//
		for(var i = 0; i < document.links.length; i++) {
			if( document.links[i].id.indexOf(mask) != -1 ) {
				setEvent(document.links[i].id);
			}
			if( document.links[i].id.indexOf(mask2) != -1 ) {
				setEvent2(document.links[i].id);
			}
		}
	}
	function setEvent(ID) {
		var mItem = document.getElementById(ID);
		var pNode = mItem.parentNode;
		//
		pNode.onclick = function() {
			document.location.href = mItem.href;
		}
		//
		pNode.onmouseover = function() {
			this.style.backgroundImage = "url(skin1/images/bgTmRoll.gif)";
			this.style.cursor = "pointer";
			mItem.style.color = "#000000";
			mItem.style.textDecoration = "none";
		}
		//
		pNode.onmouseout  = function() {
			this.style.backgroundImage = "url(skin1/images/bgTm.gif)";
			this.style.cursor = "pointer";
			mItem.style.color = "#FFFFFF";
			mItem.style.textDecoration = "none";
		}
	}
	function setEvent2(ID) {
		var mItem = document.getElementById(ID);
		var pNode = mItem.parentNode;
//		var imgNode = pNode.firstChild;
		//
		pNode.onclick = function() {
			document.location.href = mItem.href;
		}
		//
		pNode.onmouseover = function() {
			this.style.backgroundColor = "#96B4C3";
			this.style.backgroundImage = "";
			this.style.cursor = "pointer";
			mItem.style.color = "#FFFFFF";
			mItem.style.textDecoration = "none";
//			imgNode.src = "skin1/images/lmCheck.gif";
		}
		//
		pNode.onmouseout  = function() {
			this.style.backgroundColor = "#E5E5E7";
			this.style.cursor = "pointer";
			this.style.backgroundImage = "";
			mItem.style.color = "#3D3D3B";
			mItem.style.textDecoration = "none";
//			imgNode.src = "skin1/images/spacer.gif";
		}
	}