function get (name){
	
	return document.getElementById (name);	
}

function getWindowDimensions (){
	var x,y;
	if (self.innerHeight) // all except Explorer
	{
		x = self.innerWidth;
		y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		x = document.body.clientWidth;
		y = document.body.clientHeight;
	}

	return new Array (x,y);
}

function getElementsByClassName(className, tag, elm){
	var testClass = new RegExp("(^|\\s)" + className + "(\\s|$)");
	var tag = tag || "*";
	var elm = elm || document;
	var elements = (tag == "*" && elm.all)? elm.all : elm.getElementsByTagName(tag);
	var returnElements = [];
	var current;
	var length = elements.length;
	for(var i=0; i<length; i++){
		current = elements[i];
		if(testClass.test(current.className)){
			returnElements.push(current);
		}
	}
	return returnElements;
}

function resizeContent (){
	var leftNav = get ("LeftNavUL");
	if (leftNav){
		var content = get ("Content") || get ("FullContent");
		if (content.offsetHeight-40 < leftNav.offsetHeight){

			content.style.height = new String (leftNav.offsetHeight + 40) + "px";
		}
	}
}
/**
 * Helper function to allow multiple functions to execute on page load.
 * http://simon.incutio.com/archive/2004/05/26/addLoadEvent
 */
function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            if (oldonload) {
                oldonload();
            }
            func();
        }
    }
}

/// This script will format positive money values. Pass it a number
/// with or without decimal digits. It will be formatted with the currency,
/// thousands, and decimal symbols passed to it.
/// PASSED PARAMETERS
/// theNumber - the number to be formatted
/// theCurrency - the currency symbol
/// theThousands - the thousands separator
/// theDecimal - the decimal separator

function isThousands(position) {
	if (Math.floor(position/3)*3==position) return true;
	return false;
};

function formatMoney (theNumber,theCurrency,theThousands,theDecimal) {
	var theDecimalDigits =
	Math.round((theNumber*100)-(Math.floor(theNumber)*100));
	theDecimalDigits= ""+ (theDecimalDigits + "0").substring(0,2);
	theNumber = ""+Math.floor(theNumber);
	var theOutput = theCurrency;
	for (x=0; x<theNumber.length; x++) {
		theOutput += theNumber.substring(x,x+1);
		if (isThousands(theNumber.length-x-1) && (theNumber.length-x-1!=0)) {
			theOutput += theThousands;
		};
	};
	theOutput += theDecimal + theDecimalDigits;
	return theOutput;
};