﻿// JScript File

<!--
	var arrayOfRolloverClasses = new Array();
	var arrayOfClickClasses = new Array();
	var activeRow = false;
	var activeRowClickArray = new Array();
	if (document.getElementById(tableName)){
    addTableRolloverEffect(tableName,'over','selected');}
    
	function highlightTableRow()
	{
		var tableObj = this.parentNode;
		if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;

		if(this!=activeRow){
			this.setAttribute('origCl',this.className);
			this.origCl = this.className;
		}
		this.className = arrayOfRolloverClasses[tableObj.id];
		
		activeRow = this;
		
	}
	
	function clickOnTableRow(selectedRow)
	{
		var tableObj = selectedRow.parentNode;
		if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;		
		
		if(activeRowClickArray[tableObj.id] && selectedRow!=activeRowClickArray[tableObj.id]){
			activeRowClickArray[tableObj.id].className='';
		}
		selectedRow.className = arrayOfClickClasses[tableObj.id];
		var trId = selectedRow.id;
		putCookie(trId.replace(/r/,""));
		activeRowClickArray[tableObj.id] = selectedRow;
		
	}
	
	function resetRowStyle()
	{
		var tableObj = this.parentNode;
		if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;

		if(activeRowClickArray[tableObj.id] && this==activeRowClickArray[tableObj.id]){
			this.className = arrayOfClickClasses[tableObj.id];
			return;	
		}
		
		var origCl = this.getAttribute('origCl');
		if(!origCl)origCl = this.origCl;
		this.className=origCl;
		
	}
		
	function addTableRolloverEffect(tableId,whichClass,whichClassOnClick)
	{
		arrayOfRolloverClasses[tableId] = whichClass;
		arrayOfClickClasses[tableId] = whichClassOnClick;
		
		var tableObj = document.getElementById(tableId);
		var tBody = tableObj.getElementsByTagName('TBODY');
		if(tBody){
			var rows = tBody[tBody.length-1].getElementsByTagName('TR');
		}else{
			var rows = tableObj.getElementsByTagName('TR');
		}
		for(var no=0;no<rows.length;no++){
			rows[no].onmouseover = highlightTableRow;
			rows[no].onmouseout = resetRowStyle;
		}
		
	}


function getElement(src, tagName) {
    var obj = src;
    while (obj != null && obj.tagName != tagName) {
        obj = obj.parentNode;
    }
    return obj;
}

function putCookie(ID) {
    var days = 1;
    var expires = new Date(); 
    expires.setTime(expires.getTime() + days * (24 * 60 * 60 * 1000));  
	if(document.cookie != document.cookie) 
	{index = document.cookie.indexOf(cookie_name);}
	else 
	{ index = -1;}

	if (index == -1)
	{
	 document.cookie=cookie_name + "=" + escape(ID) + "; expires=" + expires.toGMTString()+ ";path=/;";
	}
}

function getTRID() {
if(document.cookie)	{	
	index = document.cookie.indexOf(cookie_name);
	if (index != -1){
		namestart = (document.cookie.indexOf("=", index) + 1);
		nameend = document.cookie.indexOf(";", index);
		if (nameend == -1) {nameend = document.cookie.length;}
		var TRID = "r" + document.cookie.substring(namestart, nameend);	
		if(TRID != "undefined" && TRID != ""){
			var oTR = document.getElementById(TRID);
			//var oTBODY = getElement(oTR, "TBODY");
			var oTABLE = getElement(oTR,"TABLE");
			if(oTR != null){
			clickOnTableRow(oTR);
			    //oldClass = oTR.className
				//oTR.className = "selected";
       	 		//oTR.active = "true";
        		//oTABLE.activeRow = oTR;
				}
			}
		}
	}		
}
getTRID();
-->
