/*----- Check if a string is only whitespace -----*/function isBlankString(s){	for (var i = 0; i < s.length; i++){		var c = s.charAt(i);		if ((c!= ' ') && (c != '\n') && (c != '\t') && (c != '\r')) return false;	}	return true;}/*----- Check to see if a text area or input field is empty -----*/function isEmpty(theField) {        if (		  (theField.value == "")		||(theField.value == null)		||(isBlankString(theField.value))	   ) 		{ return true;} 	else 		{ return false; }} /*----- Check to see if a radio group is empty -----*/function isRadioEmpty(theField) {	for (var i=0;i<theField.length;i++){		if (theField[i].checked) {return false}	}	return true;		}/*----- Check fields in a form ---*/function RegistrationCheck(thisForm) {        var Empty=false;         var errstring="";		        if (isEmpty(thisForm.elements.first)&&isEmpty(thisForm.elements.last)) {                errstring += "\n first or name";                 Empty=true;         }        if (isEmpty(thisForm.elements.email)) {                errstring += "\n email";                 Empty=true;         }        if (isEmpty(thisForm.elements.phone)) {                errstring += "\n phone number";                 Empty=true;         }        if (isEmpty(thisForm.elements.dept)) {                errstring += "\n department";                 Empty=true;         }        if (isEmpty(thisForm.elements.association)) {                errstring += "\n university association";                 Empty=true;         }       if (thisForm.elements.workshop7.checked        		 &&         	thisForm.elements.workshop8.checked)         {                errstring += "\n\nSelect no more than one";                 errstring += "\n     WebCT Vista - Creating a Course from Scratch";                 errstring += "\nworkshop";                 Empty=true;         }               if (thisForm.elements.workshop12.checked        		 &&         	thisForm.elements.workshop13.checked)         {                errstring += "\n\nSelect no more than one";                 errstring += "\n     Video Editing workshop";                 Empty=true;         }                if (Empty){			var finalerrstring=""; 			if (Empty) finalerrstring+="The following information is required:\n\n"+errstring+"\n\n";            alert(finalerrstring);             return false;         } else { return true; } }function gradeUploadCheck(thisForm) {        var Empty=false;         var errstring="";        if (isEmpty(thisForm.elements.last_name)) {                errstring += "\n Last Name";                 Empty=true;         }        if (isEmpty(thisForm.elements.email)) {                errstring += "\n Email";                 Empty=true;         }        if (isEmpty(thisForm.elements.subject)) {                errstring += "\n Subject";                 Empty=true;         }        if (Empty){			var finalerrstring=""; 			if (Empty) finalerrstring+="The following information is required:\n\n"+errstring+"\n\n";            alert(finalerrstring);             return false;         } else { return true; } }