// JavaScript Document

var CMisDHTML = 0;
var CMisLayers = 0;
var CMisALL = 0;
var CMisID = 0;

if (document.getElementById) { CMisID = 1; CMisDHTML = 1; }
else {
	if (document.all) { CMisALL = 1; CMisDHTML = 1; }
	else {
		browserVersion = parseInt(navigator.appVersion);
	if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) { CMisLayers = 1; CMisDHTML = 1;}
	}
}

function findDOM(objectID,withStyle) {
	if (withStyle == 1) {
		if (CMisID) { return (document.getElementById(objectID).style); }
		else {
			if (CMisALL) { return (document.all[objectID].style); }
		else {
			if (CMisLayers) { return (document.layers[objectID]); }
		};}
	}
	else {
		if (CMisID) { return (document.getElementById(objectID)); }
		else {
			if (CMisALL) { return (document.all[objectID]); }
		else {
			if (CMisLayers) { return (document.layers[objectID]); }
		};}
	}
	return false;
} // end of function

function autoFocus() {
	var dom = findDOM('autoFocus','0')
	dom.focus();
} // end of function

function vis(objectID,state) {
	var domStyle = findDOM(objectID,1);
	domStyle.display = state;
} // end of function


function currencyFormatted(amount)
{
	var i = parseFloat(amount);
	if(isNaN(i)) { i = 0.00; }
	var minus = '';
	if(i < 0) { minus = '-'; }
	i = Math.abs(i);
	i = parseInt((i + .005) * 100);
	i = i / 100;
	s = new String(i);
	if(s.indexOf('.') < 0) { s += '.00'; }
	if(s.indexOf('.') == (s.length - 2)) { s += '0'; }
	s = minus + s;
	return s;
} // end of function