// JavaScript Document

jQuery(document).ready(function(){
	jQuery(".graytab").bind("mouseover", function(e){
		jQuery("#" + this.id).attr("src", "/images/nav/" + this.id + "_ov.gif");
	});

	jQuery(".graytab").bind("mouseout", function(e){
		jQuery("#" + this.id).attr("src", "/images/nav/" + this.id + ".gif");
	});
	
	jQuery("#view_locations").bind("mouseover", function(e){
		jQuery("#view_locations").attr("src", "/images/view_locations_ov.png");
		jQuery('.locationsDD').css({'display' : 'block'});
		jQuery('.locationsDD').slideDown("slow");
	});
	jQuery(".locationsDD").bind("mouseout", function(e){
		setTimeout("hideLocations()", 3000);
	});
	jQuery("#search").bind("mouseover", function(e){
		hideLocations();
	});
	jQuery("#closemenu").bind("mouseover", function(e){
		hideLocations();
	});
	
	/*jQuery('#view_locations').hover(function () {
			jQuery(this).animate({ marginTop: 35 }, 125, "swing");
	}, function () {
			jQuery(this).animate({ marginTop: 0 }, 500, "swing");
	});*/
	
	jQuery(".uploadlink").bind("click", function(e){
		var popup = window.open('http://upload.youtube.com/my_videos_upload','video','resizable=yes,scrollbars=yes,width=1020,height=700,left='+(screen.availWidth/2-250)+',top='+(screen.availHeight/2-200)+'');

		jQuery(".doneupload").css({'display' : 'block'});
		jQuery(".uploadvid").css({'display' : 'none'});
		return false;
	});
	
	jQuery(".votelink").bind("click", function(e){
		jQuery(".voteresults").html('<img src="/images/ajax-loader.gif"/>');
		
		jQuery.ajax({
			type: "POST",
			url: "/content/includes/tceavideos-vote.asp",
			data: "id="+this.id,
			success: function(msg){
				jQuery(".voteresults").html('Thank you for voting. Come back tomorrow to vote on your favorite video.');
			}
		});
		
		
	});
	
});

initializePage = function (id, primaryid) {
	var pushpane = function(e,idx){	
		location.hash = 'Pane'+(idx+1);
	}
		
	if (id == 50) {
		// Accordions
		jQuery(".accordion").tabs(".accordion div.pane", {tabs: 'h2', effect: 'slide', initialIndex: 0, onClick: pushpane});
	}
}

var openpane = function(idx) {
	jQuery(".accordionGroup h2[href='#"+ idx +"']").trigger('click');
}

var hideLocations = function() {
	jQuery('.locationsDD').css({'display' : 'none'});
	jQuery("#view_locations").attr("src", "/images/view_locations.png");
}

function MM_preloadImages() { //v3.0
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function restoreImg() { //v3.0
	var divArray = new Array('business', 'education', 'government');
	for(var z=0; z<divArray.length;z++) {
		document.getElementById(divArray[z]).src = '/images/tab_btn_'+divArray[z]+'.gif';
	}
}

function clearSearchField() {
	if (document.search.search2.value == 'Search this site...')
		document.search.search2.value = '';
}

function callDiv(s) { 
	this.callHide();
	document.getElementById(s).style.display = "block";
}

function callHide() { 
	var divArray = new Array('forbusiness', 'foreducation', 'forgovernment');
	for(var x=0; x<divArray.length;x++) {
		document.getElementById(divArray[x]).style.display = "none";
	}
}

var requestSupport = function() {
	var theForm = document.requestsupport;
	
	var temp = theForm.name.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter name.");
		theForm.name.focus();
		return false;
	}
	
	var temp = theForm.company.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter company.");
		theForm.company.focus();
		return false;
	}
	
	var temp = theForm.email.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter email.");
		theForm.email.focus();
		return false;
	}
	var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
	var check=/@[\w\-]+\./;
	var checkend=/\.[a-zA-Z]{2,3}$/;

	if(((temp.search(exclude) != -1)||(temp.search(check)) == -1)||(temp.search(checkend) == -1)) {
		alert("Invalid email address.");
		theForm.email.focus();
		return false;
	}
	
	var temp = theForm.phone.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter telephone.");
		theForm.phone.focus();
		return false;
	}
	
	var temp = theForm.equipment.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter equipment.");
		theForm.equipment.focus();
		return false;
	}
	
	var temp = theForm.model.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter model #.");
		theForm.model.focus();
		return false;
	}
	
	var temp = theForm.support.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter supported required.");
		theForm.support.focus();
		return false;
	}
}

var requestRMA = function() {
	var theForm = document.requestrma;
	
	var temp = theForm.name.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter name.");
		theForm.name.focus();
		return false;
	}
	
	var temp = theForm.company.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter company.");
		theForm.company.focus();
		return false;
	}
	
	var temp = theForm.email.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter email.");
		theForm.email.focus();
		return false;
	}
	var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
	var check=/@[\w\-]+\./;
	var checkend=/\.[a-zA-Z]{2,3}$/;

	if(((temp.search(exclude) != -1)||(temp.search(check)) == -1)||(temp.search(checkend) == -1)) {
		alert("Invalid email address.");
		theForm.email.focus();
		return false;
	}
	
	var temp = theForm.phone.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter telephone.");
		theForm.phone.focus();
		return false;
	}
	
	var temp = theForm.order.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter order #.");
		theForm.order.focus();
		return false;
	}
	
	var temp = theForm.purchasedate.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter purchase date.");
		theForm.purchasedate.focus();
		return false;
	}
	
	var temp = theForm.manufacturer.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter manufacturer.");
		theForm.manufacturer.focus();
		return false;
	}
	
	var temp = theForm.model.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter model #.");
		theForm.model.focus();
		return false;
	}
	
	var temp = theForm.serial.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter serial #.");
		theForm.serial.focus();
		return false;
	}
	
	var temp = theForm.description.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter product description.");
		theForm.description.focus();
		return false;
	}
	
	var temp = theForm.reason.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter reason for return.");
		theForm.reason.focus();
		return false;
	}
	
	var temp = theForm.purpose.length;
	var check = 0;
	for (i=0;i<temp;i++) {
		if (theForm.purpose[i].checked) {
			break;
		}
		check++;
	}
	if(check == 2) {
		alert("Please select purpose of return.");
		return false;
	}
}

var requestTraining = function() {
	var theForm = document.requesttraining;
	
	var temp = theForm.name.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter name.");
		theForm.name.focus();
		return false;
	}
	
	var temp = theForm.company.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter company.");
		theForm.company.focus();
		return false;
	}
	
	var temp = theForm.email.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter email.");
		theForm.email.focus();
		return false;
	}
	var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
	var check=/@[\w\-]+\./;
	var checkend=/\.[a-zA-Z]{2,3}$/;

	if(((temp.search(exclude) != -1)||(temp.search(check)) == -1)||(temp.search(checkend) == -1)) {
		alert("Invalid email address.");
		theForm.email.focus();
		return false;
	}
	
	var temp = theForm.phone.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter telephone.");
		theForm.phone.focus();
		return false;
	}
	
	var temp = theForm.address.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter address.");
		theForm.address.focus();
		return false;
	}
	
	var temp = theForm.training.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter training required.");
		theForm.training.focus();
		return false;
	}
	
	var temp = theForm.course.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter course/equipment type.");
		theForm.course.focus();
		return false;
	}
	
	var temp = theForm.datetraining.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter date of training requested.");
		theForm.datetraining.focus();
		return false;
	}
	
	var temp = theForm.traininglength.length;
	var check = 0;
	for (i=0;i<temp;i++) {
		if (theForm.traininglength[i].checked) {
			break;
		}
		check++;
	}
	if(check == 2) {
		alert("Please select training.");
		return false;
	}
}

var contactUs = function() {
	var theForm = document.contactus;
	
	var temp = theForm.first_name.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter first name.");
		theForm.first_name.focus();
		return false;
	}
	
	var temp = theForm.last_name.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter last name.");
		theForm.last_name.focus();
		return false;
	}
	
	var temp = theForm.company.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter company.");
		theForm.company.focus();
		return false;
	}
	
	var temp = theForm.title.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter title.");
		theForm.title.focus();
		return false;
	}
	
	var temp = theForm.phone.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter telephone.");
		theForm.phone.focus();
		return false;
	}
	
	var temp = theForm.email.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter email.");
		theForm.email.focus();
		return false;
	}
	var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
	var check=/@[\w\-]+\./;
	var checkend=/\.[a-zA-Z]{2,3}$/;

	if(((temp.search(exclude) != -1)||(temp.search(check)) == -1)||(temp.search(checkend) == -1)) {
		alert("Invalid email address.");
		theForm.email.focus();
		return false;
	}
	
	var temp = theForm.city.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter city.");
		theForm.city.focus();
		return false;
	}
	
	var temp = theForm.state.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter state.");
		theForm.state.focus();
		return false;
	}
	
	var temp0 = theForm.industry.selectedIndex;
	var temp = theForm.industry[temp0].value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter industry.");
		theForm.industry.focus();
		return false;
	}

	var temp0 = theForm.solutionInterest.selectedIndex;
	var temp = theForm.solutionInterest[temp0].value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter solution interest.");
		theForm.solutionInterest.focus();
		return false;
	}
	
	var temp = theForm.description.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter description.");
		theForm.description.focus();
		return false;
	}
}

// Used on: 
// Interactive Whiteboard page ID 37
// Dallas Polycom page ID 175
function checkWhiteboard() {
	var theForm = window.document.whiteboard;
	
	var temp = theForm.first_name.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter first name.");
		theForm.first_name.focus();
		return false;
	}

	var temp = theForm.last_name.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter last name.");
		theForm.last_name.focus();
		return false;
	}
	
	var temp = theForm.company.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter company or school name.");
		theForm.company.focus();
		return false;
	}
	
	var temp = theForm.city.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){


		alert("Please enter city.");
		theForm.city.focus();
		return false;
	}
	
	var temp = theForm.email.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter email.");
		theForm.email.focus();
		return false;
	}
	var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
	var check=/@[\w\-]+\./;
	var checkend=/\.[a-zA-Z]{2,3}$/;

	if(((temp.search(exclude) != -1)||(temp.search(check)) == -1)||(temp.search(checkend) == -1)) {
		alert("Invalid email address.");
		theForm.email.focus();
		return false;
	}
	
	var temp = theForm.email_retype.value;
	if (temp != theForm.email.value){
		alert("Please re-enter email address.");
		theForm.email_retype.focus();
		return false;
	}
	
	var temp = theForm.phone.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter phone.");
		theForm.phone.focus();
		return false;
	}
	
}

var howWeHelp = function(type) {
	var theForm = document.howwehelp;
	
	var temp = theForm.name.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter name.");
		theForm.name.focus();
		return false;
	}
	
	if(type=="email") {
		var temp = theForm.email.value;
		if ((temp == '') || (temp.charAt(0) == ' ')){
			alert("Please enter email.");
			theForm.email.focus();
			return false;
		}
		var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
		var check=/@[\w\-]+\./;
		var checkend=/\.[a-zA-Z]{2,3}$/;
	
		if(((temp.search(exclude) != -1)||(temp.search(check)) == -1)||(temp.search(checkend) == -1)) {
			alert("Invalid email address.");
			theForm.email.focus();
			return false;
		}
	} else {
		var temp = theForm.phone.value;
		if ((temp == '') || (temp.charAt(0) == ' ')){
			alert("Please enter phone number.\n999-999-9999")
			theForm.phone.focus();
			return false
		}
		if (checkInternationalPhone(temp)==false){
			alert("Please enter a valid phone number.\n999-999-9999")
			theForm.phone.focus();
			return false
		}
	}
}

var digits = "0123456789";
var phoneNumberDelimiters = "()- ";
var validWorldPhoneChars = phoneNumberDelimiters + "+";
var minDigitsInIPhoneNumber = 10;

function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    return true;
}

function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkInternationalPhone(strPhone){
s=stripCharsInBag(strPhone,validWorldPhoneChars);
return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}

function emailpage(emailURL) {
	var temploc 			= emailURL + "?myURL=";
	temploc 				+= window.location.href.gsub(/\&/, '%26').escapeHTML().gsub(/\?/, '%3F');
	temploc 				+= "&pathURL=" + emailURL;
	window.location.href 	= temploc;
}

var checkceo = function() {
	var theForm = document.ceospecial;
	
	var temp = theForm.firstname.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter first name.");
		theForm.firstname.focus();
		return false;
	}
	
	var temp = theForm.lastname.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter last name.");
		theForm.lastname.focus();
		return false;
	}
	
	var temp = theForm.organization.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter organization.");
		theForm.organization.focus();
		return false;
	}
	
	var temp = theForm.title.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter title.");
		theForm.title.focus();
		return false;
	}
	
	var temp = theForm.email.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter email.");
		theForm.email.focus();
		return false;
	}
	var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
	var check=/@[\w\-]+\./;
	var checkend=/\.[a-zA-Z]{2,3}$/;

	if(((temp.search(exclude) != -1)||(temp.search(check)) == -1)||(temp.search(checkend) == -1)) {
		alert("Invalid email address.");
		theForm.email.focus();
		return false;
	}
}


function checkTCEA() {
	var theForm = window.document.tcea;

	var temp = theForm.firstname.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter first name.");
		theForm.firstname.focus();
		return false;
	}

	var temp = theForm.lastname.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter last name.");
		theForm.lastname.focus();
		return false;
	}
	
	var temp = theForm.email.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter email.");
		theForm.email.focus();
		return false;
	}
	var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
	var check=/@[\w\-]+\./;
	var checkend=/\.[a-zA-Z]{2,3}$/;

	if(((temp.search(exclude) != -1)||(temp.search(check)) == -1)||(temp.search(checkend) == -1)) {
		alert("Invalid email address.");
		theForm.email.focus();
		return false;
	}
	
	var temp = theForm.email_retype.value;
	if (temp != theForm.email.value){
		alert("Please re-enter email address.");
		theForm.email_retype.focus();
		return false;
	}
	
	var temp = theForm.school.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter school name.");
		theForm.school.focus();
		return false;
	}
	
	var temp = theForm.district.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter district.");
		theForm.district.focus();
		return false;
	}	
	
	var temp = theForm.description.value;//alert(temp != 'Briefly tell us how you are connecting. (200 characters max)');
	if ((temp == '') || (temp.charAt(0) == ' ') || (temp == 'Briefly tell us how you are connecting. (200 characters max)')){
		alert("Please enter description.");
		theForm.description.focus();
		return false;
	}
	
	var temp = theForm.photo.value;
	if ((temp == '') || (temp.charAt(0) == ' ')) {// || temp.substr(-3).toLowerCase() != 'jpg'){
		alert("Please upload a JPG file type.");
		theForm.photo.focus();
		return false;
	}
	
	var temp = theForm.agreeterms.checked;
	if (temp == false){
		alert("Please agree to the terms.");
		theForm.agreeterms.focus();
		return false;
	}

}

function limitText(limitField, limitNum) {
	if (limitField.value.length > limitNum) {
			limitField.value = limitField.value.substring(0, limitNum);
	} 
}


function checkTextarea(currfield, defaultText) {
	if (currfield.value.length > 0) {
		if (currfield.value == defaultText) {
			currfield.value = '';
		}
	}
}

// Used on: 
// SMART User Conference page ID 177
function checkRSVP() {
	var theForm = window.document.whiteboard;
	
	if ( ( document.whiteboard.subject[0].checked == false )
    && ( document.whiteboard.subject[1].checked == false ) )
    {
        alert ( "Please select an event." );
        return false;
    }
	
	var temp = theForm.first_name.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter first name.");
		theForm.first_name.focus();
		return false;
	}

	var temp = theForm.last_name.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter last name.");
		theForm.last_name.focus();
		return false;
	}
	
	var temp = theForm.company.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter school name.");
		theForm.company.focus();
		return false;
	}
	
	var temp = theForm.title.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter title (grade/subject).");
		theForm.title.focus();
		return false;
	}
	
	var temp = theForm.city.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter city.");
		theForm.city.focus();
		return false;
	}
	
	var temp = theForm.email.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter email.");
		theForm.email.focus();
		return false;
	}
	var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
	var check=/@[\w\-]+\./;
	var checkend=/\.[a-zA-Z]{2,3}$/;

	if(((temp.search(exclude) != -1)||(temp.search(check)) == -1)||(temp.search(checkend) == -1)) {
		alert("Invalid email address.");
		theForm.email.focus();
		return false;
	}
	
	var temp = theForm.email_retype.value;
	if (temp != theForm.email.value){
		alert("Please re-enter email address.");
		theForm.email_retype.focus();
		return false;
	}
	
	var temp = theForm.phone.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter phone.");
		theForm.phone.focus();
		return false;
	}	
}
	
// Used on: 
// Houston Open House page ID 181
function checkRSVP_title() {
	var theForm = window.document.whiteboard;
	
	var temp = theForm.first_name.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter first name.");
		theForm.first_name.focus();
		return false;
	}

	var temp = theForm.last_name.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter last name.");
		theForm.last_name.focus();
		return false;
	}
	
	var temp = theForm.company.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter school name.");
		theForm.company.focus();
		return false;
	}
	
	var temp = theForm.title.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter title (grade/subject).");
		theForm.title.focus();
		return false;
	}
	
	var temp = theForm.city.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter city.");
		theForm.city.focus();
		return false;
	}
	
	var temp = theForm.email.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter email.");
		theForm.email.focus();
		return false;
	}
	var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
	var check=/@[\w\-]+\./;
	var checkend=/\.[a-zA-Z]{2,3}$/;

	if(((temp.search(exclude) != -1)||(temp.search(check)) == -1)||(temp.search(checkend) == -1)) {
		alert("Invalid email address.");
		theForm.email.focus();
		return false;
	}
	
	var temp = theForm.email_retype.value;
	if (temp != theForm.email.value){
		alert("Please re-enter email address.");
		theForm.email_retype.focus();
		return false;
	}
	
	var temp = theForm.phone.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter phone.");
		theForm.phone.focus();
		return false;
	}		
}




