﻿function sendEvent(swf,typ,prm) { 
  thisMovie(swf).sendEvent(typ,prm); 
};
function getUpdate(typ,pr1,pr2,swf) {};
function thisMovie(swf) {
  if(navigator.appName.indexOf("Microsoft") != -1) {
    return window[swf];
  } else {
    return document[swf];
  }
};

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;

function checkEmail(inputvalue){	
    var pattern=/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;
    if(pattern.test(inputvalue)){  
    }else{   
    return (false);
    }
}
function validateReg(theForm)
{
  if (theForm._00N3000000185DA.selectedIndex < 1)
  {
    alert("Please select one of the \"Download\ options.");
    theForm._00N3000000185DA.focus();
    return (false);
  }
  if (theForm.first_name.value == "" || theForm.first_name.value == null)
  {
    alert("Please enter a value for your \"First Name\".");
    theForm.first_name.focus();
    return (false);
  }
  if (theForm.last_name.value == "" || theForm.last_name.value == null)
  {
    alert("Please enter a value for your \"Last Name\".");
    theForm.last_name.focus();
    return (false);
  }
  if (theForm.title.value == "" || theForm.title.value == null)
  {
    alert("Please enter a value for your \"Title\".");
    theForm.title.focus();
    return (false);
  }
  if (theForm.company.value == "" || theForm.company.value == null)
  {
    alert("Please enter a value for your \"Company\".");
    theForm.company.focus();
    return (false);
  }
  if (theForm.country.selectedIndex < 1 || theForm.country.selectedIndex == 14)
  {
    alert("Please select one of the \"Country\" options.");
    theForm.country.focus();
    return (false);
  }
  if (theForm.phone.value == "" || theForm.phone.value == null)
  {
    alert("Please enter a value for \"Phone Number\".");
    theForm.phone.focus();
    return (false);
  }
  if (theForm.email.value == "" || theForm.email.value == null)
  {
    alert("Please enter a value for your \"Email Address\".");
    theForm.email.focus();
    return (false);
  }
  if (checkEmail(theForm.email.value) >=0)
  {
    alert("Please enter a valid \"Email Address\".");
    theForm.email.focus();
    return (false);
  }
  var stringToSearch = theForm.company.value.toLowerCase();
  if (stringToSearch.search("google") >= 0 && theForm.phone.value.search("123456") >=0){    
    alert("Invalid submission");
	theForm.first_name.focus();
    return (false);
  }
  return (true);
}


