/*

Centered popup script

*/


function winpop(url,name,sizex,sizey) {
        newwin = window.open(url, name, "width=" + sizex + ",height=" + sizey + ",toolbar=no,location=no,directories=no,status=0,resizable=no,scrollbars=auto,menubar=no");
newwin.moveTo(((screen.width/2)-(sizex/2)),((screen.height/2)-(sizey/2)));
}


/*

Form Validation

*/


function CheckFields2() {

  // The fields are checked for blanks
  if ( document.pform.firstname.value   == "" ||
       document.pform.subject.value   == "" ||
       document.pform.message.value  == "" ||
       document.pform.email.value  == "" )
  {
      alert( "You haven't completed the form.\nPlease ensure that all boxes are filled in." );
      return false;
  }

	// check for valid email address
	else if ( document.pform.email.value.length <= 6 ||
		  document.pform.email.value.indexOf ('@', 0) == -1 ||
		  document.pform.email.value.indexOf ('.', 0) == -1){
		  alert("Sorry, " + document.pform.email.value + " is not a valid Email Address.");
		   return false;
	} else { 
 		//document.pform.submit()
		return true;
	}
}


function CheckFields3() {

  // The fields are checked for blanks
  if ( document.pform.firstname.value   == "" ||
	   document.pform.company.value   == "" ||
	   document.pform.phone.value   == "" ||
       document.pform.email.value  == "" )
  {
      alert( "You haven't completed the form.\nPlease ensure that all boxes are filled in." );
      return false;
  }

	// check for valid email address
	else if ( document.pform.email.value.length <= 6 ||
		  document.pform.email.value.indexOf ('@', 0) == -1 ||
		  document.pform.email.value.indexOf ('.', 0) == -1){
		  alert("Sorry, " + document.pform.email.value + " is not a valid Email Address.");
		   return false;
	} else { 
 		//document.pform.submit()
		return true;
	}
}