function initializeArray(){
	aryErrors = new Array();
}
function addErr(e2add){
	nextIndex = aryErrors.length;
	aryErrors[nextIndex] = e2add;
}
function hasErrors(){
	if(aryErrors.length < 1){
		return false;
	}
	else{
		errString = "Your form cannot be processed\nfor the following reasons:\n==========================\n";
		totalErrors = aryErrors.length;
		if(totalErrors > 10){
			loopLimit = 10;}
		else{
			loopLimit = totalErrors;}
		for(i = 0; i < loopLimit; i++){
			errString = errString + "- " + aryErrors[i] + "\n";
		}
		if(totalErrors > loopLimit){
			extraErrors = totalErrors - loopLimit;
			errString = errString + "\n...plus " + (extraErrors) + " more ";
			errString = errString + (extraErrors == 1 ? "error" : "errors");}
		alert(errString);
		return true;
	}
}
function isEmail(eml) {
	if(eml.search){
		if (eml.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1) {return true;}
		else {return false;}
		}
	else{return true;}
}
function hasSpecChar(fld){
	arySpecChars = "<>%*#";
	for(i = 0; i < fld.length; i++){
		for(j = 0; j < arySpecChars.length; j++){
			if(fld.indexOf(arySpecChars.charAt(j)) != -1){
				return true;
				break;
			}
		}
	}
	return false;
}
function checkDollarFormat(val) {
	badFormat = false;
	dot = val.indexOf('.');
	lastdot = val.lastIndexOf('.');
	if(dot == -1 || ( (dot!=-1) && ((dot!=(val.length-3)) || (dot!=lastdot)) ) ) {
		badFormat = true;}
	
	for (i = 0; i < val.length; i++) {
		ch = val.substring(i, i + 1);
		if(!isDollar(ch)){
			badFormat = true;}
	}
	if(badFormat == true){
		return false;}
	else{
		return true;}
}
function isDollar(n){
	if( ((n < "0") || ("9" < n)) && (n!=".") ) {
		return false;} 
	else {
		return true;}
}

function LaunchExternalWin(fUrl,fWidth,fHeight,fParams,fName){
	if(fWidth == "") {fWidth = 600;}
	if(fHeight == "") {fHeight = 400;}
	if(fParams == ''){fParams = ',scrollbars=1';}
	if(fName == ""){fName = "winLoad" + Math.round(Math.random()*1000);}
	
	fWinL = (screen.availWidth - fWidth) / 2;
	fWinT = (screen.availHeight - fHeight) / 2;
	fParams += ",top="+fWinT+",left="+fWinL;
	
	window.open(fUrl, fName, 'width='+fWidth+',height='+fHeight+fParams);
}