

 var preloadFlag = false;

 function newImage(arg) {
         if (document.images) {
                 rslt = new Image();
                 rslt.src = arg;
                 return rslt;
         }
 }


 function preloadImages() {
         if (document.images) {
		 	var spacer1;
            spacer1 = newImage("images/spacer.gif");
			
                 preloadFlag = true;
         }
 }

 
 function changeImages() {
         if (document.images && (preloadFlag == true)) {
                 for (var i=0; i<changeImages.arguments.length; i+=2) {
                         document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
                 }
         }
 }
 
 //end of rollover script





function open_popup(photo) {
    winObj = window.open(photo, photo, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=300,height=300,top=200,left=10');
    winObj.close();
    winObj = window.open(photo, photo, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=300,height=300,top=200,left=10');
    return true;
}


// form verifications functions below - note: use em all!!
function formVerify(){
   if ((document.form.first_name.value == "") || (isNotAlphanumeric(document.form.first_name.value))) {
      alert('Please enter a valid first name');
      document.form.first_name.focus();
      return false;
   }  
   if ((document.form.last_name.value == "") || (isNotAlphanumeric(document.form.last_name.value))){
      alert('Please enter a valid last name');
      document.form.last_name.focus();
      return false;
   }
   if (document.form.email.value == "") {
      alert('Please enter an email');
      document.form.email.focus();
      return false;
   } 
}
   

function isNotAlphanumeric (s){   
	var i;
    // search string's characters for non-alphanumeric character.
    // yes: return true; no: return false.
    for (i = 0; i < s.length; i++)    { 
		var c = s.charAt(i);  
        // Check that current character is number or letter.
        if (! (isLetter(c) || isDigit(c) ) )
        return true;
    }
	// if all characters ok
    return false;
}


// Returns true if character c is a character (adjusted to accept certain charachters
function isLetter (c)
{  return ( ((c >= "a") && (c <= "z")) || ((c >= "A") && (c <= "Z")) || (c==" ") || (c=="#") || (c=="'") || (c==",") || (c=="-") || (c=="/") || (c=="." || (c==":"))) }

// Returns true if character c is a digit 
function isDigit (c)
{   return ((c >= "0") && (c <= "9"))
}
