function hide_id(nodeId)
{
    var node = document.getElementById(nodeId);
    if (node)
    {
        node.className=node.className.replace('showed', '');
        node.className += ' hidden';
    }
}

function show_id(nodeId)
{
    var node = document.getElementById(nodeId);
    if (node)
    {
        node.className=node.className.replace('hidden', '');
        node.className += ' showed';
    }
}

function toggle_id(nodeId)
{
    var node = document.getElementById(nodeId);
    if (node)
    {
        if (node.className.indexOf('hidden') != -1)
            node.className=node.className.replace('hidden', 'showed')
        else if (node.className.indexOf('showed') != -1)
            node.className=node.className.replace('showed', 'hidden')
        else node.className += ' showed';
     }
}

function setPrintCSS(isPrint) {
// By Akella cssing.org.ua
// Определяем поддержку нужного нам элемента в броузерах
  if (document.getElementsByTagName)
      x = document.getElementsByTagName('link');
  else
  {
      alert('Простите, этот скрипт не работает в вашем броузере');
      return;
  }
// Пробегая по всем элементам LINK в HTML  - включаем и отключаем нужные нам стили
// идентифицируя их по атрибуту title
// параметр isPrint - отвечает просто за вариант стилей для печти или монитора
  for (var i=0;i<x.length;i++) {
      if(x[i].title == 'printview'){x[i].disabled = !isPrint;}
      if(x[i].title == 'screenview'){x[i].disabled = isPrint;}
  }
}

/* *********************************
        ON LOAD
********************************* */
window.onload = function(){
//	lightgallery.init();

}



function register_result(){
  if (document.getElementById("username").value == ""){
    document.getElementById("username").focus();
    alert ("Please input the Username");
    return false;
  }
  if (document.getElementById("password").value == ""){
    document.getElementById("password").focus();
    alert ("Please input the Password");
    return false;
  }
  if (document.getElementById("password_re_type").value == ""){
    document.getElementById("password_re_type").focus();
    alert ("Please input the Password re-type");
    return false;
  }
  if (document.getElementById("password").value != document.getElementById("password_re_type").value){
    document.getElementById("password").value = "";
    document.getElementById("password_re_type").value = "";
    document.getElementById("password").focus();
    alert ("Passwords are not the same");
    return false;
  }
  if (document.getElementById("full_name").value == ""){
    document.getElementById("full_name").focus();
    alert ("Please input the Full Name");
    return false;
  }
  if (document.getElementById("e_mail").value.indexOf ( "@" ,1 ) == -1 ) {
        alert ("Wrong email address was provided (Example: myname_40mysite.com)");
        document.getElementById("e_mail").focus();
    return false;
  }
  if (document.getElementById("web_site").value == ""){
    document.getElementById("web_site").focus();
    alert ("Please input Web Site");
    return false;
  }
  if (document.getElementById("address_1").value == ""){
    document.getElementById("address_1").focus();
    alert ("Please input Address 1");
    return false;
  }
  if (document.getElementById("address_2").value == ""){
    document.getElementById("address_2").focus();
    alert ("Please input Address 2");
    return false;
  }
  if (document.getElementById("city").value == ""){
    document.getElementById("city").focus();
    alert ("Please input City");
    return false;
  }
  if (document.getElementById("state_provin_reg").value == ""){
    document.getElementById("state_provin_reg").focus();
    alert ("Please input State / Province / Region");
    return false;
  }
  if (document.getElementById("zip_postal_code").value == ""){
    document.getElementById("zip_postal_code").focus();
    alert ("Please input Zip / Postal Code");
    return false;
  }
  if (document.getElementById("country").value == "0"){
    document.getElementById("country").focus();
    alert ("Please input Country");
    return false;
  }
  if (document.getElementById("name_check_recip").value == ""){
    document.getElementById("name_check_recip").focus();
    alert ("Please input Name of Check Recipient");
    return false;
  }
  if (document.getElementById("how_hear_us").value == ""){
    document.getElementById("how_hear_us").focus();
    alert ("Please input How did you hear of us?");
    return false;
  }
  if (document.getElementById("i_agree_with").checked == false){
    document.getElementById("i_agree_with").focus();
    alert ("Please set tick, if You agree with all of the terms & conditions");
    return false;
  }
document.getElementById("signup").submit();
}

