
function isValid(ein) {		
	ein = trim(ein);		
	if(!IsNumeric(ein)) {
		alert("Please enter your EIN in this format: ##-########");
		return false;
	}
	if(ein.length != 10) {
		alert("Your EIN is 9 digits long and includes a dash between the second and third digits");
		return false;
	}
	return true;
}	

function IsNumeric(sText) {
	var ValidChars = "0123456789-";
	  var IsNumber = true;
	var Char;

	for (i = 0; i < sText.length && IsNumber == true; i++) { 
		Char = sText.charAt(i); 
		if (ValidChars.indexOf(Char) == -1) {
			IsNumber = false;
		}
	}
	   return IsNumber;	   
}

function trim(strText) { 
// this will get rid of leading spaces 
	while (strText.substring(0,1) == ' ') 
		strText = strText.substring(1, strText.length);	
	// this will get rid of trailing spaces 
	while (strText.substring(strText.length-1,strText.length) == ' ')
		strText = strText.substring(0, strText.length-1);	
   return strText;
}

/*
	Stipe tables function
*/
function stripeTables() { 
	var tables = document.getElementsByTagName("table");
	for(var x=0; x<tables.length; x++){
		if(tables.item(x).className=="support_table"){
			rows = tables.item(x).getElementsByTagName("tr");
			for(var y=0; y<rows.length; y++){
				cells = rows.item(y).getElementsByTagName("td");
				for(var z=0; z<cells.length; z++){
					if( y%2){
						cells.item(z).style.backgroundColor= "white";
					}
				}
			}
		}
	}
}