function clientURL(a, b) {
  address = "http://www." + a;
  document.write("<a href='" + address + "' target='_blank' class='link'>");
  document.write(b);
  document.write("</a>")
}
function readCookie(a) {
  var b = "";
  a = a + "=";
  if(document.cookie.length > 0) {
    offset = document.cookie.indexOf(a);
    if(offset != -1) {
      offset += a.length;
      end = document.cookie.indexOf(";", offset);
      if(end == -1)end = document.cookie.length;
      b = unescape(document.cookie.substring(offset, end))
    }
  }return b
}
function checkFormat(a) {
  if(a < 10)a = "0" + a;
  return a
}
function writeCookie(a, b, d, f) {
  var e = "", c = new Date, g = c.getFullYear(), h = c.getMonth() + 1, j = c.getDate(), k = c.getHours(), l = c.getMinutes();
  c = c.getSeconds();
  if(d != null) {
    e = new Date((new Date).getTime() + d * 3600000);
    e = "; expires=" + e.toGMTString()
  }date = g + "-" + checkFormat(h) + "-" + checkFormat(j) + " " + checkFormat(k) + ":" + checkFormat(l) + ":" + checkFormat(c);
  values = date + "|" + b;
  document.cookie = a + "=" + values + e + "; path = " + f
}
function checkCookie() {
  if(readCookie("ref") == "") {
    var a = document.referrer, b = String(window.location), d = b.indexOf("?");
    b = b.substr(d + 1);
    referral = b.match("adw") ? a == "" ? "www.google-adw.com/" : a.replace(/google./g, "google-adw.") : a;
    writeCookie("ref", referral, 65000, "")
  }
}
function sendEmail(a, b) {
  address = a + "@" + b;
  document.write("<a href='mailto:" + address + "' class='link'>");
  document.write(address);
  document.write("</a>")
}
function blurOn(a) {
  if(a.query.value == "")a.query.value = "Search"
}
function showHint(a) {
  document.getElementById(a).className = "showHint";
}
function hideHint(a) {
  document.getElementById(a).className = "hide";
}
function hideDiv(a) {
  a = a;
  var b = document.getElementsByTagName("div");
  for(i = 0;i < b.length;i++)if(b[i].id.match(a))b[i].className = "hide"
}
function show_sshot(a) {
  a = a;
  product = a.split("-");
  productID = product[1];
  hideDiv("s_");
  a = document.getElementsByTagName("div");
  document.getElementById(productID).className = "show"
}
function show_event() {
  var a = Math.floor(Math.random() * 2);
  event_ID = "oxy_event" + a;
  hideDiv("oxy_event");
  document.getElementById(event_ID).className = "show"
}
function show_updateSite(a) {
  a = "sshot_" + a;
  document.getElementById(a).className = "show"
}
function hide_updateSite(a) {
  a = "sshot_upSite_" + a;
  document.getElementById(a).className = "hide"
}
function loadBuyLink() {
  r = document.getElementById("avangate");
  if(r != null) {
    r.checked = true;
    changeLink(r.id)
  }
}
function checkPid(a) {
  a = a.toLowerCase();
  productU = a.match("u");
  productM = a.match("m");
  productU == "u" || productM == "m" ? showAdditionalInfo() : hideAdditionalInfo()
}
function hideAdditionalInfo() {
  var a = document.getElementById("additional_info");
  a.className = "hide"
}
function showAdditionalInfo() {
  var a = document.getElementById("additional_info");
  a.className = "show"
}
    function checkPhoneBox(name) {
    var val = name;
    choice = document.getElementById(val).value;
    var phoneNumberEnabled = "PhoneNumberEnabled";
    var phoneNumberDisabled = "PhoneNumberDisabled";
    if (choice == '1') {
        // the input is enabled and must become disabled
        document.getElementById(val).value = '0';
        document.getElementById(phoneNumberEnabled).className = "show";
        document.getElementById(phoneNumberDisabled).className = "hide";
    } else {
        document.getElementById(val).value = '1';
        document.getElementById(phoneNumberEnabled).className = "hide";
        document.getElementById(phoneNumberDisabled).className = "show";
    }
    //alert ("Name " + name + " Value: " + document.getElementById(val).value + " ID" + document.getElementById(phoneNumberEnabled).className) ;
    } 
;