<!-- Hide from non-JavaScript Browsers
function externalLinks() { 
	if (!document.getElementsByTagName) return; 
	var anchors = document.getElementsByTagName("a"); 
	for (var i=0; i<anchors.length; i++) { 
		var anchor = anchors[i]; 
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") anchor.target = "_blank"; 
	} 
} 

function openWin(vsURL,vsWindowName,vnWidth,vnHeight) {
	var loWin;
	loWin = window.open(vsURL, vsWindowName, 'toolbar=0, location=0, directories=0, status=0, menubar=no, scrollbars=yes, resizable=yes, width='+vnWidth+', height='+vnHeight);
	loWin.focus();
	loWin.resizeTo(vnWidth,vnHeight);
}


function validateForm(voWhichForm) {
//	form elements can have req=true, num, truenum
var lsMsg="";
var lnWhichone = -1;
	for (a=0; a<voWhichForm.elements.length; a++) {
		if ((voWhichForm.elements[a].req == "num")|(voWhichForm.elements[a].req == "truenum")) {
			if (!(validateNumeric(voWhichForm.elements[a].value))&(voWhichForm.elements[a].value!="")) {
				if (lnWhichone == -1 ) {
					lnWhichone = a;
				}
				lsMsg  = "Oops. You seem to have entered a non numerical amount.\n";
				lsMsg += "Please only enter a number in the field, " +  replaceCharacters(voWhichForm.elements[a].name,'_',' ')  + ".";
				break;
			}
		}
		if ((voWhichForm.elements[a].req == "true")|(voWhichForm.elements[a].req == "truenum")) {
			if (voWhichForm.elements[a].value == "") {
				if (lnWhichone == -1 ) {
					lnWhichone = a;
				}
				lsMsg  = "Oops. You seem to have left out some required information.\n";
				lsMsg += "Please fill in the field, " +  replaceCharacters(voWhichForm.elements[a].name,'_',' ')  + ".";
				break;
		   }
		}
	}
	if (lsMsg == "") {
		return;
	}

	voWhichForm.elements[lnWhichone].focus();
	alert(lsMsg);
	return false;
}

function  validateNumeric( vsString ) {
	var loRegExp  =  /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/;
	return loRegExp.test(vsString);
}

function replaceCharacters( vsSource, vsMatchPattern, vsReplaceString ) {
/************************************************
DESCRIPTION: Removes characters from a source string
  based upon matches of the supplied pattern and replaces with something else.

PARAMETERS:
  vsSource - source string
  vsMatchPattern - pattern to replace
  strReplaceString - replacement characters

RETURNS: String modified with characters matching search pattern removed

USAGE:  strNoSpaces = replaceCharacters( ' sfdf  dfd', '\s*', '')
*************************************************/
 var loRegExp =  new RegExp( vsMatchPattern, 'gi' );

 //replace passed pattern matches with replacement string
  return vsSource.replace(loRegExp,vsReplaceString);
}

//Done Hiding -->