// Validate email

function checkEmail() {
  text=document.emailform.Recipient_Email.value;
  if (text.indexOf("@")<3){
    alert(" This recipient's email address seems wrong. Please"
    +" check the prefix and '@' sign.");
    return false;
  }
  if ((text.indexOf(".com")<5)&&(text.indexOf(".org")<5)
    &&(text.indexOf(".gov")<5)&&(text.indexOf(".net")<5)
    &&(text.indexOf(".co.uk")<7)&&(text.indexOf(".nl")<4)
    &&(text.indexOf(".mil")<5)&&(text.indexOf(".edu")<5)
	&&(text.indexOf(".ca")<4))
  {
     alert(" The recipient's email address seems wrong. Please"
     +" check the suffix. (It should include a .com, .ca, .edu,"
     +" .net, .org, .gov, .co.uk, .nl, or .mil)");
     return false;
  }
return true;
} 

// Pop up window 

function openPopUp(fileName, sc, ht)
   {
   // get the screen width and amount to subtract for popupwindow width
   var wd = screen.width;
   var amt = wd-520;
   var where = "left="+amt;
   var params = sc+',status=no,menubar=no,toolbar=no,width=510,'+ht+',top=0,'+where; 

   // open the window
   copyWin = window.open(fileName,'popupwin',params);
   }
                                
// clear text box
function doClear(theText) 
	{
		if (theText.value == theText.defaultValue)
	{
		theText.value = ""
	}
}

// cell rollovers
function cellSwitch(cellName, newColor)
	{
	cellName.bgColor = newColor;
}

// Pop up window 
var win= null;
function NewWindow(mypage,myname,w,h,scroll){
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  var settings  ='height='+h+',';
      settings +='width='+w+',';
      settings +='top='+wint+',';
      settings +='left='+winl+',';
      settings +='scrollbars='+scroll+',';
      settings +='resizable=no';
  win=window.open(mypage,myname,settings);
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
