
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');
}


sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


function validate() {
  var vbCRLF = String.fromCharCode(13,10);
  var incomplete = 0, msg = "";
  if (document.inquiry.field1.value == "") {
    incomplete = 1;
    msg = " - Name" + vbCRLF;
  }
  if (document.inquiry.field2.value == "" || document.inquiry.field2.value.indexOf("@")==-1 || document.inquiry.field2.value.indexOf(".")==-1 ) {
    incomplete = 1;
    msg += " - Email Address" + vbCRLF;
  }
  if (document.inquiry.field6.value == "") {
    incomplete = 1;
    msg += " - Message" + vbCRLF;
  }
  if (incomplete == 1) {
    alert("Please fill in missing information:" + vbCRLF + msg);
  }
  else {document.inquiry.submit();}
}


function validateEmailOffer() {
  var vbCRLF = String.fromCharCode(13,10);
  var incomplete = 0, msg = "";
  if (document.emailOffer.field1.value == "") {
    incomplete = 1;
    msg = " - First Name" + vbCRLF;
  }
  if (document.emailOffer.field2.value == "") {
    incomplete = 1;
    msg += " - Last Name" + vbCRLF;
  }
  if (document.emailOffer.field3.value == "" || document.emailOffer.field3.value.indexOf("@")==-1 || document.emailOffer.field3.value.indexOf(".")==-1 ) {
    incomplete = 1;
    msg += " - Valid Email Address" + vbCRLF;
  }
  if (document.emailOffer.field4.value == "") {
    incomplete = 1;
    msg += " - Telephone" + vbCRLF;
  }
  if (document.emailOffer.field5.value == "") {
    incomplete = 1;
    msg += " - Address" + vbCRLF;
  }
  if (document.emailOffer.field7.value == "") {
    incomplete = 1;
    msg += " - City" + vbCRLF;
  }
  if (document.emailOffer.field9.value == "") {
    incomplete = 1;
    msg += " - ZIP Code" + vbCRLF;
  }
  if (document.emailOffer.field10.value == "") {
    incomplete = 1;
    msg += " - Country" + vbCRLF;
  }
  if (incomplete == 1) {
    alert("Please fill in missing information:" + vbCRLF + msg);
  }
  else {document.emailOffer.submit();}
}


function topEmail(user, domain, suffix){
  document.write('<a href="' + 'mailto:' + user + '@' + domain + '.' + suffix + '" id="top-nav-02">Email</a>');
}


function redirect(url, delay) {
  setTimeout("self.location='"+ url +"'", delay);
}

