function OpenWindow( url, name, width, height, opt) {
window.open( url, (name || "_blank"), "width="+(width || 714)+",height="+(height || 536)+","+(opt ||  "scrollbars=yes,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes")).focus();
}

function goHist(a) 
{
history.go(a); // Go back one.
}
function FrontPage_Form1_Validator(theForm){
  if (theForm.Name.value == ""){
    alert("Please enter a value for the \"Name\" field.");
    theForm.Name.focus();
    return (false);
  }
  if (theForm.Name.value.length < 1){
    alert("Please enter at least 1 characters in the \"Name\" field.");
    theForm.Name.focus();
    return (false);
  }
  if (theForm.Title.value == ""){
    alert("Please enter a value for the \"Title\" field.");
    theForm.Title.focus();
    return (false);
  }
  if (theForm.Title.value.length < 1){
    alert("Please enter at least 1 characters in the \"Title\" field.");
    theForm.Title.focus();
    return (false);
  }
  if (theForm.Facility.value == ""){
    alert("Please enter a value for the \"Facility Name\" field.");
    theForm.Facility.focus();
    return (false);
  }
  if (theForm.Facility.value.length < 1){
    alert("Please enter at least 1 characters in the \"Facility Name\" field.");
    theForm.Facility.focus();
    return (false);
  }
  if (theForm.Address.value == ""){
    alert("Please enter a value for the \"Address\" field.");
    theForm.Address.focus();
    return (false);
  }
  if (theForm.Address.value.length < 1){
    alert("Please enter at least 1 characters in the \"Address\" field.");
    theForm.Address.focus();
    return (false);
  }
  if (theForm.City.value == ""){
    alert("Please enter a value for the \"City\" field.");
    theForm.City.focus();
    return (false);
  }
  if (theForm.City.value.length < 1){
    alert("Please enter at least 1 characters in the \"City\" field.");
    theForm.City.focus();
    return (false);
  }
  if (theForm.State.selectedIndex < 0){
    alert("Please select one of the \"State\" options.");
    theForm.State.focus();
    return (false);
  }
  if (theForm.State.selectedIndex == 0){
    alert("The first \"State\" option is not a valid selection.  Please choose one of the other options.");
    theForm.State.focus();
    return (false);
  }
  if (theForm.ZIP.value == ""){
    alert("Please enter a value for the \"ZIP Code\" field.");
    theForm.ZIP.focus();
    return (false);
  }
  if (theForm.ZIP.value.length < 1){
    alert("Please enter at least 1 characters in the \"ZIP Code\" field.");
    theForm.ZIP.focus();
    return (false);
  }
  if (theForm.Phone.value == ""){
    alert("Please enter a value for the \"Phone\" field.");
    theForm.Phone.focus();
    return (false);
  }
  if (theForm.Phone.value.length < 1){
    alert("Please enter at least 1 characters in the \"Phone\" field.");
    theForm.Phone.focus();
    return (false);
  }
  if (theForm.email.value == ""){
    alert("Please enter a value for the \"E-Mail\" field.");
    theForm.email.focus();
    return (false);
  }
  if (echeck(theForm.email.value)==false){
		theForm.email.value="";
		theForm.email.focus();
		return (false);
  }

   if (theForm.imgz.value == ""){
    alert("Please enter a value for the \"Verification Code\" field.");
    theForm.imgz.focus();
    return (false);
  } 
 
  
  return (true);
}

function FrontPage_Form2_Validator(theForm){
  if (theForm.name.value == ""){
    alert("Please enter a value for the \"Name\" field.");
    theForm.name.focus();
    return (false);
  }
  if (theForm.name.value.length < 1){
    alert("Please enter at least 1 characters in the \"Name\" field.");
    theForm.name.focus();
    return (false);
  }
  if (theForm.name.value.length > 100){
    alert("Please enter at most 100 characters in the \"Name\" field.");
    theForm.name.focus();
    return (false);
  }
  if (theForm.title.value == ""){
    alert("Please enter a value for the \"Title\" field.");
    theForm.title.focus();
    return (false);
  }
  if (theForm.title.value.length < 1){
    alert("Please enter at least 1 characters in the \"Title\" field.");
    theForm.title.focus();
    return (false);
  }
  if (theForm.title.value.length > 100){
    alert("Please enter at most 100 characters in the \"Title\" field.");
    theForm.title.focus();
    return (false);
  }
  if (theForm.email.value == ""){
    alert("Please enter a value for the \"E-Mail\" field.");
    theForm.email.focus();
    return (false);
  }
  if (echeck(theForm.email.value)==false){
		theForm.email.value="";
		theForm.email.focus();
		return (false);
  }
  if (theForm.Facility.value == ""){
    alert("Please enter a value for the \"Company Name\" field.");
    theForm.Facility.focus();
    return (false);
  }
  if (theForm.Facility.value.length < 1){
    alert("Please enter at least 1 characters in the \"Company Name\" field.");
    theForm.Facility.focus();
    return (false);
  }
  if (theForm.address.value == ""){
    alert("Please enter a value for the \"Address\" field.");
    theForm.address.focus();
    return (false);
  }
  if (theForm.address.value.length < 1){
    alert("Please enter at least 1 characters in the \"Address\" field.");
    theForm.address.focus();
    return (false);
  }
  if (theForm.city.value == ""){
    alert("Please enter a value for the \"City\" field.");
    theForm.city.focus();
    return (false);
  }
  if (theForm.city.value.length < 1){
    alert("Please enter at least 1 characters in the \"City\" field.");
    theForm.city.focus();
    return (false);
  }
  if (theForm.State.selectedIndex < 0){
    alert("Please select one of the \"State\" options.");
    theForm.State.focus();
    return (false);
  }
  if (theForm.State.selectedIndex == 0){
    alert("The first \"State\" option is not a valid selection.  Please choose one of the other options.");
    theForm.State.focus();
    return (false);
  }
  if (theForm.zip.value == ""){
    alert("Please enter a value for the \"ZIP Code\" field.");
    theForm.zip.focus();
    return (false);
  }
  if (theForm.zip.value.length < 1){
    alert("Please enter at least 1 characters in the \"ZIP Code\" field.");
    theForm.zip.focus();
    return (false);
  }
  if (theForm.phone.value == ""){
    alert("Please enter a value for the \"Phone\" field.");
    theForm.phone.focus();
    return (false);
  }
  if (theForm.phone.value.length < 1){
    alert("Please enter at least 1 characters in the \"Phone\" field.");
    theForm.phone.focus();
    return (false);
  }
  if (theForm.phone.value.length > 35){
    alert("Please enter at most 35 characters in the \"Phone\" field.");
    theForm.phone.focus();
    return (false);
  }
  if (theForm.custtype.value == ""){
    alert("Please enter a value for the \"Customer Type\" field.");
    theForm.custtype.focus();
    return (false);
  }
  if (theForm.custtype.value.length < 1){
    alert("Please enter at least 1 characters in the \"Customer Type\" field.");
    theForm.custtype.focus();
    return (false);
  }
  return (true);
}

function S60_Form_Validator(theForm){
  if (theForm.Custno.value == ""){
    alert("Please enter a value for the \"Medline Customer Number\" field.");
    theForm.Custno.focus();
    return (false);
  }
  if (theForm.Custno.value.length < 1){
    alert("Please enter at least 1 characters in the \"Medline Customer Number\" field.");
    theForm.Custno.focus();
    return (false);
  }
  if (theForm.Companyname.value == ""){
    alert("Please enter a value for the \"Company Name\" field.");
    theForm.Companyname.focus();
    return (false);
  }
  if (theForm.Companyname.value.length < 1){
    alert("Please enter at least 1 characters in the \"Company Name\" field.");
    theForm.Companyname.focus();
    return (false);
  }
  if (theForm.Custname.value == ""){
    alert("Please enter a value for the \"Your Name\" field.");
    theForm.Custname.focus();
    return (false);
  }
  if (theForm.Custname.value.length < 1){
    alert("Please enter at least 1 characters in the \"Your Name\" field.");
    theForm.Custname.focus();
    return (false);
  }
  if (theForm.Address.value == ""){
    alert("Please enter a value for the \"Address\" field.");
    theForm.Address.focus();
    return (false);
  }
  if (theForm.Address.value.length < 1){
    alert("Please enter at least 1 characters in the \"Address\" field.");
    theForm.Address.focus();
    return (false);
  }
  if (theForm.City.value == ""){
    alert("Please enter a value for the \"City\" field.");
    theForm.City.focus();
    return (false);
  }
  if (theForm.City.value.length < 1){
    alert("Please enter at least 1 characters in the \"City\" field.");
    theForm.City.focus();
    return (false);
  }
  if (theForm.State.selectedIndex < 0){
    alert("Please select one of the \"State\" options.");
    theForm.State.focus();
    return (false);
  }
  if (theForm.State.selectedIndex == 0){
    alert("The first \"State\" option is not a valid selection.  Please choose one of the other options.");
    theForm.State.focus();
    return (false);
  }
  if (theForm.ZIP.value == ""){
    alert("Please enter a value for the \"ZIP Code\" field.");
    theForm.ZIP.focus();
    return (false);
  }
  if (theForm.ZIP.value.length < 1){
    alert("Please enter at least 1 characters in the \"ZIP Code\" field.");
    theForm.ZIP.focus();
    return (false);
  }
  if (theForm.Phone.value == ""){
    alert("Please enter a value for the \"Phone Number\" field.");
    theForm.Phone.focus();
    return (false);
  }
  if (theForm.Phone.value.length < 1){
    alert("Please enter at least 1 characters in the \"Phone Number\" field.");
    theForm.Phone.focus();
    return (false);
  }

   if (theForm.imgz.value == ""){
    alert("Please enter a value for the \"Verification Code\" field.");
    theForm.imgz.focus();
    return (false);
  } 
 
  
  return (true);
}

function echeck(str) {
		var at="@";
		var dot=".";
		var lat=str.indexOf(at);
		var lstr=str.length;
		var ldot=str.indexOf(dot);
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail address.");
		   return (false);
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail address");
		   return (false);
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail address");
		    return (false);
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail address");
		    return (false);
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail address");
		    return (false);
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail address");
		    return (false);
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail address");
		    return (false);
		 }
		return (true);
	
	}
	
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_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_nbGroup(event, grpName) { //v6.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}
	
function emailimage_formvalidator(theForm){
  if (theForm.Name.value == ""){
    alert("Please enter a value for the \"Name\" field.");
    theForm.Name.focus();
    return (false);
  }
  if (theForm.Name.value.length < 1){
    alert("Please enter at least 1 characters in the \"Name\" field.");
    theForm.Name.focus();
    return (false);
  }
  if (theForm.Email.value == ""){
    alert("Please enter a value for the \"E-Mail\" field.");
    theForm.Email.focus();
    return (false);
  }  
  if (echeck(theForm.Email.value)==false){
		theForm.Email.value="";
		theForm.Email.focus();
		return (false);
  }
  if (theForm.tEmail.value == ""){
    alert("Please enter a value for the \"E-Mail\" field.");
    theForm.tEmail.focus();
    return (false);
  }  
  if (echeck(theForm.tEmail.value)==false){
		theForm.tEmail.value="";
		theForm.tEmail.focus();
		return (false);
  }

  
  return (true);
}	

function FrontPage_Form3_Validator(theForm){
  if (theForm.Name.value == ""){
    alert("Please enter a value for the \"Name\" field.");
    theForm.Name.focus();
    return (false);
  }
  if (theForm.Name.value.length < 1){
    alert("Please enter at least 1 characters in the \"Name\" field.");
    theForm.Name.focus();
    return (false);
  }
  if (theForm.Title.value == ""){
    alert("Please enter a value for the \"Title\" field.");
    theForm.Title.focus();
    return (false);
  }
  if (theForm.Title.value.length < 1){
    alert("Please enter at least 1 characters in the \"Title\" field.");
    theForm.Title.focus();
    return (false);
  }
  if (theForm.Facility.value == ""){
    alert("Please enter a value for the \"Facility Name\" field.");
    theForm.Facility.focus();
    return (false);
  }
  if (theForm.Facility.value.length < 1){
    alert("Please enter at least 1 characters in the \"Facility Name\" field.");
    theForm.Facility.focus();
    return (false);
  }
  if (theForm.Address.value == ""){
    alert("Please enter a value for the \"Address\" field.");
    theForm.Address.focus();
    return (false);
  }
  if (theForm.Address.value.length < 1){
    alert("Please enter at least 1 characters in the \"Address\" field.");
    theForm.Address.focus();
    return (false);
  }
  if (theForm.City.value == ""){
    alert("Please enter a value for the \"City\" field.");
    theForm.City.focus();
    return (false);
  }
  if (theForm.City.value.length < 1){
    alert("Please enter at least 1 characters in the \"City\" field.");
    theForm.City.focus();
    return (false);
  }
  if (theForm.State.selectedIndex < 0){
    alert("Please select one of the \"State\" options.");
    theForm.State.focus();
    return (false);
  }
  if (theForm.State.selectedIndex == 0){
    alert("The first \"State\" option is not a valid selection.  Please choose one of the other options.");
    theForm.State.focus();
    return (false);
  }
  if (theForm.ZIP.value == ""){
    alert("Please enter a value for the \"ZIP Code\" field.");
    theForm.ZIP.focus();
    return (false);
  }
  if (theForm.ZIP.value.length < 1){
    alert("Please enter at least 1 characters in the \"ZIP Code\" field.");
    theForm.ZIP.focus();
    return (false);
  }
  if (theForm.Phone.value == ""){
    alert("Please enter a value for the \"Phone\" field.");
    theForm.Phone.focus();
    return (false);
  }
  if (theForm.Phone.value.length < 1){
    alert("Please enter at least 1 characters in the \"Phone\" field.");
    theForm.Phone.focus();
    return (false);
  }
  if (theForm.email.value == ""){
    alert("Please enter a value for the \"E-Mail\" field.");
    theForm.email.focus();
    return (false);
  }
  if (echeck(theForm.email.value)==false){
		theForm.email.value="";
		theForm.email.focus();
		return (false);
  }
	if (theForm.Comments.value == "")
	{
	alert("Please enter a value for the \"Comments\" field.");
	theForm.Comments.focus();
	return (false);
	}
	if (theForm.Comments.value.length < 2)
	{
	alert("Please enter at least 2 characters in the \"Comments\" field.");
	theForm.Comments.focus();
	return (false);
	}
	if (theForm.Comments.value.length > 1000)
	{
	alert("Please enter at most 1000 characters in the \"Comments\" field.");
	theForm.Comments.focus();
	return (false);
	}
   if (theForm.imgz.value == ""){
    alert("Please enter a value for the \"Verification Code\" field.");
    theForm.imgz.focus();
    return (false);
  } 	
	
	return (true);

}

