/** Class: Main
*** File: main.js
*** Author: Ofer Ohel
*** Version: 1.01
*** Date: 2005-05-19
**/

/** **************** ***
*** **** CONFIG **** ***
*** **************** **/
var ciDebug = false;
/** **************** ***
*** Global Variables ***
*** **************** **/
var ciURL = document.URL; if(ciDebug) alert(ciURL);

/** private
*** Name: leftNavOn
*** Description: used by the onmouseoverevent of a left nav a tag
*** Param: Object - an href object
*** Returns: Boolean
**/
function leftNavOn(anObj) {
	//alert(anObj.style.color);
	anObj.style.color = '#2B5BA7';
}

/** private
*** Name: leftNavOff
*** Description: used by the onmouseoverevent of a left nav a tag
*** Param: Object - an href object
*** Returns: Boolean
**/
function leftNavOff(anObj) {
	//alert(anObj.style.color);
	anObj.style.color = '#86292d';
}

function onloadFunction() {
    var bodyObj = document.getElementById('bodyContent');
	var leftNavImgFix = document.getElementById('leftNavImgFix');
	var leftNavDivObj = document.getElementById('leftNavDiv');
	leftNavImgFix.height = Math.max(bodyObj.scrollHeight - 200, 150);
}

/** public
*** Name: showObj
*** Description: takes an object or an object's id and makes it visible
*** Param: An Object or the id of the object
*** Returns: Nothing
**/
function showObj(anObj) {
	var theType = typeof anObj;
	var theObj = anObj;
	try {
		if(theType.toLowerCase() == 'string')
			theObj = document.getElementById(anObj);
	
		theObj.style.visibility = 'visible';
		theObj.style.display = 'block';
	}
	catch (e) {
		alert(e);
	}
}

/** public
*** Name: hideObj
*** Description: takes an object or an object's id and hides it
*** Param: An Object or the id of the object
*** Returns: Nothing
**/
function hideObj(anObj) {
	var theType = typeof anObj;
	var theObj = anObj;
	try {
		if(theType.toLowerCase() == 'string')
			theObj = document.getElementById(anObj);
	
		theObj.style.visibility = 'hidden';
		theObj.style.display = 'none';
	}
	catch (e) {
		alert(e);
	}
}

/** public
*** Name: getParam
*** Description: returns a param value from the url search string
*** Param: the key 
*** Returns: string
**/
function getParam(param) {
	var val = "";
	var qs = window.location.search;
	var start = qs.indexOf(param);

	if (start != -1) {
		start += param.length + 1;
		var end = qs.indexOf("&", start);
		if (end == -1) {
			end = qs.length
		}
		val = qs.substring(start,end);
	}
	return val;
}

