<!--

function DisplayForm( Form ) {
  j = Form.elements.length;
  var s = new String;
  for(i=0;i<j;i++) s = s + i + ', ' + Form.elements[i].name + ': ' + Form.elements[i].value + '\n';
  s = s + 'Action: ' + Form.action + '\n';
  alert(s);
}

function highlight( Form ){
  Form.focus();
  Form.select();
}

function isEmpty( Form, error ) {
  if( Form.value == "" ) {
    alert( error );
    highlight( Form );
    return true;
  }

  if( Form.value == " " ) {
    alert( description );
    highlight( Form );
    return true;
  }
  return false;
}

function isEmailValid( Form, error ) {
  if( isEmpty( Form, error ) ) return false;
  badKeys = " /:;$%^&*()!|\~`=+'><"       // a list of invalid email characters
  for( i=0; i<badKeys.length; i++ ) {     // look for invalid characters
    badChar = badKeys.charAt(i);
    if (Form.value.indexOf(badChar, 0) > -1) {
      alert( "There is an invalid character in the email address. Please try again." );
      highlight( Form );
      return false;
    }
  }
  atPos = Form.value.indexOf("@", 0)      // must have a @
  if( atPos == -1 ) {
    alert( "There must be an @ symbol in your email address. Please try again." );
    highlight( Form );
    return false;
  }
  if( atPos < 1 ) {                       // "@" cannot be the first character of the email address
  alert( "The @ character can not be your first character within the email address. Please try again." );
    highlight( Form );
    return false;
  }
  if( Form.value.indexOf("@", atPos+1) != -1){  // only one @
    alert( "Only one @ within the email address is allowed. Please try again." );
    highlight( Form );
    return false;
  }
  periodPos = Form.value.indexOf(".", atPos)
  if( periodPos <= atPos + 2 ) {          // at least one char after the "."
    alert( "Invalid email address. There should be at least 2 characters after the period. Please try again." );
    highlight( Form );
    return false;
  }
  if (periodPos < atPos + 1){             // at least one character between the "@" and the "."
    alert( "There should be at least one '.' after the @ symbol in the email address. Please try again." );
    highlight( Form );
    return false;
  }
  return true;
}

if (document.images) {
arImageSrc = new Array (
//nav preload
//"images/contactUp.gif",
//"images/contactDwn.gif"
)

arImageList = new Array ();

for (counter in arImageSrc) {
arImageList[counter] = new Image ();
arImageList [counter].src = arImageSrc [counter];
}
};


// used by CheckForm()
function fixElement( element, message ) {
  alert( message );
  element.focus();
}

// used by contactApp.asp

function rollOver (imname,over) {
        if (!document.images) {return};
        if (over) { 
        document.images [imname].src = xPath+"images/" + imname  + "Dwn.gif";
		}
        else 
        { 
        document.images [imname].src = xPath+ "images/" + imname  + "Up.gif";		
        }
}


function webVoicePop(url,x,y) {
  mywin = window.open(url,"win",'toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=' + x + ',height=' + y);
  mywin.focus();
}


function openWindow(url,x,y,screenX,screenY,top,left) {
mywin = window.open(url,"win",'toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=' + x + ',height=' + y + ',screenX=' + screenX + ',screenY=' + screenY + ',top=' + top + ',left=' + left);
//window.location.href='thankyou.html';
mywin.focus();
}

function openPdf(url,x,y,screenX,screenY,top,left) {
mywin = window.open(url,"pdf",'toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=' + 750 + ',height=' + 550 + ',screenX=' + screenX + ',screenY=' + screenY + ',top=' + top + ',left=' + left);
mywin.focus();
}

function openWindowEmail(url,x,y,screenX,screenY,top,left) {
mywin = window.open(url,"win",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=' + 700 + ',height=' + 550 + ',screenX=' + screenX + ',screenY=' + screenY + ',top=' + top + ',left=' + left);
mywin.focus();
}

function openWindowVideo(url,x,y,screenX,screenY,top,left) {
mywin = window.open(url,"win",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=' + x + ',height=' + y + ',screenX=' + screenX + ',screenY=' + screenY + ',top=' + top + ',left=' + left);
//mywin = window.open(url,"win",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=' + 600 + ',height=' + 350 + ',screenX=' + screenX + ',screenY=' + screenY + ',top=' + top + ',left=' + left);
mywin.focus();
}

function openWindowVideo2(url,x,y) {
mywin = window.open(url,"win",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=' + x + ',height=' + y);
mywin.focus();
}

function closeEmailWindow(windowname)
{
	if (windowname=='close')
	{
	  opener.window.location.href='../cgi-bin/emailSent.asp';
	  window.location.href='javascript:closewindow()';
	  opener.window.focus();
	}
}

function closewindow()
{
  window.close();
}

function printpage() 
{
  window.print();  
}

function CheckForm( form ) {
  // assume form is incomplete
  var passed = false;
  if ( form.name.value == "" ) fixElement(form.name, "Please include your name.");
  else if ( form.email.value == "" ) fixElement(form.email, "Please include your email.");
  else passed = true;
  return passed;
}

function CheckExecutiveForm( form ) {
  // assume form is incomplete
  var passed = false;
  if ( form.name.value == "" ) fixElement(form.name, "Please include your name.");
  else if ( form.title.value == "" ) fixElement(form.title, "Please include your title.");
  else if ( form.company.value == "" ) fixElement(form.company, "Please include your company.");
  else if ( form.phone.value == "" ) fixElement(form.phone, "Please include your phone number.");
  else passed = true;
  return passed;
}

//-->

