var onLoad_FuncQueue = new Array();
include('/ArrayLib.js');
include('/browser.js');


String.prototype.trim = function()
{
	return this.replace(/^\s+/g,'').replace(/\s+$/g,'');
}


var appVer = navigator.appVersion;

var bIsNS = (document.layers);
var NS3 = bIsNS && (appVer.indexOf('3.') != -1);
var NS4 = bIsNS && (appVer.indexOf('4.') != -1);
var NS5 = bIsNS && (appVer.indexOf('5.') != -1);
var NS6 = bIsNS && (appVer.indexOf('6.') != -1);

var bIsIE = (document.all);
var MSIE3 = (appVer.indexOf('MSIE 3') != -1);
var MSIE4 = (appVer.indexOf('MSIE 4') != -1);
var MSIE5 = (appVer.indexOf('MSIE 5') != -1);
var MSIE6 = (appVer.indexOf('MSIE 6') != -1);

var bIsUnknown = !bIsNS && !bIsIE
var bIsImgCompat = (NS4 || NS5 || MSIE4 || MSIE5 || MSIE6);
var bIsEvtCompat = (MSIE3 || MSIE4 || MSIE5 || MSIE6); // excluded for compatability NS4 || NS5

// include DHTML library
include('/xbDOM.js');		// NS4 & IE4 fix-up code to add W3C DOM functionality & IE features to NS
include('/dhtml.js');		// dhtml-shortcuts API
include('/FormCheck.js');	// form validation API

function initPage()
// calls all functions pushed onto the "onLoad" function queue
{
	while( onLoad_FuncQueue.length )
	{
		var f = onLoad_FuncQueue.shift();
		f();
	}
}

var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos)
{
	if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
	if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
	else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
	win=window.open(mypage,myname,settings);
}

function formatCurrency(num)
{
	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 hideIt(idList)
{
	for( var i = 0; i < arguments.length; i++)
	{
		var id = arguments[i];
		hE(gE(id));
	}
}

function showIt(idList)
{
	for( var i = 0; i < arguments.length; i++)
	{
		var id = arguments[i];
		sE(gE(id));
	}
}

function include(src)
{
	document.write('<script language="Javascript" src="'+src+'"><\/script>');
}
