<!--
var childWindow;
var childrenCount = 0;
var winattribs = 'toolbar=no, location=no, directories=no, status=yes, ';
winattribs += 'menubar=yes, resizable=no, copyhistory=no, scrollbars=yes, ';
var availheight = screen.availHeight - 60
var availwidth = screen.availWidth

function popup(filename, caption) {
	if (parseInt(childrenCount) > 0) {
		childWindow.close();
		childrenCount = 0;
	}
	var popupwidth = 745;
	if (popupwidth > availwidth) {popupwidth = availwidth;}
	var popupheight = 535;
	if (popupheight > availheight) {popupheight = availheight;}
	winattribs += 'width=' + popupwidth + ', height=' + popupheight;
	childWindow = window.open(filename, caption, winattribs);
	childrenCount = 1;
	childWindow.onUnload = childrenCount = 0;
	childWindow.focus();
}

function largepopup(filename, caption) {
	if (parseInt(childrenCount) > 0) {
		childWindow.close();
		childrenCount = 0;
	}
	winattribs += 'width=900, height=600';
	childWindow = window.open(filename, caption, winattribs);
	childrenCount = 1;
	childWindow.onUnload = childrenCount = 0;
	childWindow.focus();
}

function TrimIt(strArg) {
	var strObject;
	var strTrim;
	var firstLetter = 0;
	strObject = strArg;
	lastLetter = 0;
	while(strObject.charAt(firstLetter++) == " ") {;}
	firstLetter--;
	strObject = strObject.substr(firstLetter); // takes off leading spaces
	return strObject;
}

function IsExplorer(){
	if (window.navigator.appName == "Netscape")
		return false;
	else
		return true;
}

function IsOlderBrowser() {
	if (document.all) { // IE, >=5
		return false;
	} else if (document.getElementById) { // Netscape, >=6
		return false;
	}
	return true;
}

function nav(url) {
	if (IsExplorer()) {
		window.parent.window.navigate(url);
	} else {
		window.parent.location.href = url;
		window.parent.location.reload;
	}
}

function checkEmail(strVal) {
	var isAt = (strVal.indexOf("@") > 0) ? true : false;
	var dotIndex = strVal.lastIndexOf(".");
	var dotInPlace = (dotIndex > 0 && dotIndex < (strVal.length -1)) ? true : false;
	return (isAt && dotInPlace);
}

function IsNumber(strVal) {
	return isNaN(strVal) ?  0 : 1
}

function formatCurrency(amount) {
	// expects amount as a string with at least two decimal places
	var ret;
	var delimiter = ",";
	var a = amount.split('.', 2);
	var d = a[1];
	var i = parseInt(a[0]);
	if (isNaN(i)) {
		return '';
	}
	var minus = '';
	if (i < 0) {
		minus = '-';
	}
	i = Math.abs(i);
	var n = new String(i);
	var a = [];
	while (n.length > 3) {
		var nn = n.substr(n.length - 3);
		a.unshift(nn);
		n = n.substr(0,n.length - 3);
	}
	if (n.length > 0) {
		a.unshift(n);
	}
	n = a.join(delimiter);
	if (d.length < 1) {
		ret = n;
	} else {
		ret = n + '.' + d;
	}
	ret = minus + ret;
	return ret;
}
//-->
    
