function impactimage() {
  var num = Math.round(Math.random()*2);
  switch (num) {
    case 1: document.write('<a href="http://www.vernontech.ca/uploads/vernon-crusher.htm" target="_blank"c><img src="/images/impact-hdc.jpg" alt="Hard Disk Crusher - Data Destruction" width="373" height="286" border="0" align="bottom" /></a>'); break;
    case 2: document.write('<a href="http://www.vernontech.ca/uploads/computer-recycling.htm" target="_blank"><img src="/images/impact-re.jpg" alt="Computer disposal &amp; Recycling Program" width="373" height="286" border="0" align="bottom" /></a>'); break;
    default: document.write('<a href="http://www.vernontech.ca/uploads/video-cloud.htm" target="_blank"><img src="/images/impact-vc.jpg" alt="HD Video Conferencing Services, Manaaged Teleprence" width="373" height="286" border="0" align="bottom" /></a>');
  }
}

function impactimage_fr() {
  var num = Math.round(Math.random()*2);
  switch (num) {
    case 1: document.write('<a href="http://www.vernontech.ca/fr/disposal-recycling.aspx"><img src="/images/impact-re-fr.jpg" alt="Mise au rancart et recyclage écologique" width="373" height="286" border="0" align="bottom" /></a>'); break;
    case 2: document.write('<a href="http://www.vernontech.ca/fr/disposal-recycling/hard-disk-crusher.aspx"><img src="/images/impact-hdc-fr.jpg" alt="Confirmation visuelle de la destruction des données" width="373" height="286" border="0" align="bottom" /></a>'); break;
    default: document.write('<a href="http://www.video-cloud.com/" target="_blank"><img src="/images/impact-vc-fr.jpg" alt="Services de vidéoconférence en Haute Définition" width="373" height="286" border="0" align="bottom" /></a>');
  }
}



function quote() {
  var val = function(name) { return document.forms["quickquoteform"].elements[name].value; }
  document.location = "/en/quote.aspx?computers=" + val("computers") + "&laptops=" + val("laptops") + "&monitors=" + val("monitors");
}



function listcheck() {
  var recipient = "";
  var sales = "Sales <brokers@vernontech.ca>";
  var rentals = "Rentals <insidesales@vernontech.ca>";
  if (document.forms["signupform"].elements["list"][0].checked) recipient += sales;
  if (document.forms["signupform"].elements["list"][1].checked) {
    (recipient == "") ?  recipient += rentals : recipient += ", " + rentals;
  }
  if (recipient == "") recipient = sales + ", " + rentals;
  document.forms["signupform"].elements["email"].value = recipient;
}



function quotevalidator() {
  var val = new validator("quoteform");
  val.add("email", "req", "Please select one of: Rentals, Leasing or Purchasing.");
  val.add("name", "req", "Please enter your full name.");
  val.add("company", "req", "Please enter the name of the company.");
  val.add("address", "req", "Please enter your address.");
  val.add("city", "req", "Please enter the city your organization is located in.");
  val.add("province", "req", "Please select the province your organization is located in.");
  val.add("postal", "req", "Please enter the postal code for your organization.");
  val.add("email2", "req", "Please enter your email address.");  
  val.add("email2", "email", "Please enter a valid email address.");  
  val.add("phone", "req", "Please enter your phone number.");
  val.add("computers_qty", "num", "Please enter a valid number for quantity of computers.");
  val.add("laptop_qty", "num", "Please enter a valid number for quantity of laptops.");
  val.add("printers_qty", "num", "Please enter a valid number for quantity of printers.");
  val.add("monitors_qty", "num", "Please enter a valid number for quantity of monitors.");
  val.add("av_qty", "num", "Please enter a valid number for quantity of AV/projectors.");
}

function quotevalidator_fr() {
  var val = new validator("quoteform");
  val.add("email", "req", "Veuillez choisir un de : Location, Crédit-bail, Achat.");
  val.add("name", "req", "Veuillez entrer votre nom complet.");
  val.add("company", "req", "Veuillez entrer le nom de votre entreprise.");
  val.add("address", "req", "Veuillez entrer votre adresse.");
  val.add("city", "req", "Veuillez entrer la ville où votre organisation est situé.");
  val.add("province", "req", "Veuillez entrer la province où votre organisation est situé.");
  val.add("postal", "req", "Veuillez entrer le code postal pour votre organisation.");
  val.add("email2", "req", "Veuillez entrer votre courriel.");  
  val.add("email2", "email", "Veuillez entrer une courriel valide.");  
  val.add("phone", "req", "Veuillez entrer votre numéro de téléphone.");
  val.add("computers_qty", "num", "Veuillez entrer un nombre valide pour la quantité d'ordinateurs.");
  val.add("laptop_qty", "num", "Veuillez entrer un nombre valide pour la quantité d'ordinateurs portatifs.");
  val.add("printers_qty", "num", "Veuillez entrer un nombre valide pour la quantité d'imprimantes.");
  val.add("monitors_qty", "num", "Veuillez entrer un nombre valide pour la quantité de moniteurs.");
  val.add("av_qty", "num", "Veuillez entrer un nombre valide pour la quantité d'audio-visuel projecteurs.");
}



function signupvalidator() {
  var val = new validator("signupform");
  val.add("signupemail", "req", "Please enter your email address.");  
  val.add("signupemail", "email", "Please enter a valid email address.");  
}

function signupvalidator_fr() {
  var val = new validator("signupform");
  val.add("signupemail", "req", "Veuillez entrer votre courriel.");  
  val.add("signupemail", "email", "Veuillez entrer une courriel valide.");  
}
