function xbrowserById(objectId) {
	// cross browser function to getElementById
	if	( document.getElementById && document.getElementById(objectId) ) {
		// W3C DOM
		return document.getElementById(objectId);
	} else if ( document.nativeGetElementById && document.nativeGetElementById(objectId) ) {
		// MSIE 7 && Opera
		return document.nativeGetElementById(objectId);
	} else if ( document.all && document.all(objectId) ) {
		// MSIE 4 DOM
		return document.all(objectId);
	} else {
		return false;
	}
}

var onLayer = '';

function showLayer(layerName){
	//if (onLayer != '') hideLayer(onLayer);
	//document.all[layerName].style.left = "500px";
	if (document.layers) document.layers[''+layerName+''].display = "block"
	else if (document.all) document.all[''+layerName+''].style.display = "block"
	else if (document.getElementById) document.getElementById(''+layerName+'').style.display = "block"	
	//onLayer = layerName
	/* 
		USAGE: onmouseout="hideLayer('id');"
	*/
}
function hideLayer(layerName){
	//document.all[layerName].style.left = "-500px";
	if (document.layers) document.layers[''+layerName+''].display = "none"
	else if (document.all) document.all[''+layerName+''].style.display = "none"
	else if (document.getElementById) document.getElementById(''+layerName+'').style.display = "none"	
	/* 
		USAGE: onmouseout="hideLayer('id');"
	*/
}

function openWin( windowURL, windowName, windowFeatures ) { 
	return window.open( windowURL, windowName, windowFeatures ) ; 
	/* 
		USAGE: href="JavaScript: newWindow = openWin( 'path', 'windowName', 'width=400,height=200,toolbar=0,location=0,directories=0,status=1,menuBar=0,scrollBars=0,resizable=0' ); newWindow.focus()"
	*/
}


function formatCurrency(num) {
	// http://javascript.internet.com
	num = num.toString().replace(/\$|\,/g,'');
	if(isNaN(num))
	num = "0";
	sign = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	cents = num%100;
	num = Math.floor(num/100).toString();
	if(cents<10)
	cents = "0" + cents;
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
	num = num.substring(0,num.length-(4*i+3))+','+
	num.substring(num.length-(4*i+3));
	return (((sign)?'':'-') + '$' + num + '.' + cents);
}

function formatDecimal(num) {
	// http://javascript.internet.com
	num = num.toString().replace(/\$|\,/g,'');
	if(isNaN(num))
	num = "0";
	sign = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	cents = num%100;
	num = Math.floor(num/100).toString();
	if(cents<10)
	cents = "0" + cents;
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
	num = num.substring(0,num.length-(4*i+3))+','+
	num.substring(num.length-(4*i+3));
	return (((sign)?'':'-') +  num + '.' + cents);
	// NOTE: NO '$' PREPENDED
}
