
function subscribe() {
  if (document.form.email.value == "" || document.form.email.value.indexOf("@")==-1 || document.form.email.value.indexOf(".")==-1 ) {
    incomplete = 1;
    alert("Please type a valid email address!");
  }
  else { document.form.submit(); }
}


function runFlash(width, height, src, align) {
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="' +width+ '" height="' +height+ '" align="' +align+ '">\n');
  document.write('<param name="movie" value="' +src+ '" />\n');
  document.write('<param name="wmode" value="transparent" />\n');
  document.write('<param name="quality" value="high" />\n');
  document.write('<embed src="' +src+ '" quality="high" wmode="transparent" align="' +align+ '" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="' +width+ '" height="' +height+ '">\n');
  document.write('</embed>\n');
  document.write('</object>\n');
}


function validateViewingForm() {

  var vbCRLF = String.fromCharCode(13,10);
  var incomplete = 0, msg = "";

  if (document.viewingForm.name.value == "") {
    incomplete = 1;
    msg = "Please type your first and last name." + vbCRLF;
  }
  if (document.viewingForm.phone.value == "") {
    incomplete = 1;
    msg += "Please type your phone #." + vbCRLF;
  }
  if (document.viewingForm.email.value == "" || document.viewingForm.email.value.indexOf("@")==-1 || document.viewingForm.email.value.indexOf(".")==-1 ) {
    incomplete = 1;
    msg += "Please type a valid email address." + vbCRLF;
  }
  if (incomplete == 1) {
    alert(msg);
  }
  else {
    document.viewingForm.submit();
  }

}


function validateConForm() {

  var vbCRLF = String.fromCharCode(13,10);
  var incomplete = 0, msg = "";

  if (document.contactForm.name.value == "") {
    incomplete = 1;
    msg = "Please type your first and last name." + vbCRLF;
  }
  if (document.contactForm.phone.value == "") {
    incomplete = 1;
    msg += "Please type your phone #." + vbCRLF;
  }
  if (document.contactForm.email.value == "" || document.contactForm.email.value.indexOf("@")==-1 || document.contactForm.email.value.indexOf(".")==-1 ) {
    incomplete = 1;
    msg += "Please type a valid email address." + vbCRLF;
  }
  if (incomplete == 1) {
    alert(msg);
  }
  else {
    document.contactForm.submit();
  }

}


function validateCBSForm() {

  var vbCRLF = String.fromCharCode(13,10);
  var incomplete = 0, msg = "";

  if (document.cbsForm.email.value == "" || document.cbsForm.email.value.indexOf("@")==-1 || document.cbsForm.email.value.indexOf(".")==-1 ) {
    incomplete = 1;
    msg = "Please type a valid email address." + vbCRLF;
  }
  if (incomplete == 1) {
    alert(msg);
  }
  else {
    document.cbsForm.submit();
  }

}


function redirect(url, delay) {
  setTimeout("self.location='"+ url +"'", delay);
}


