// regexp strings

	var mail_regexp=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+$/;
	var security_code_regexp=/^[0-9A-Za-z]{6}$/;
	var number_N_regexp=/^[0-9]+$/;
	var number_Np_regexp=/^[1-9]+[0-9]*$/;
  var number_R0_regexp=/^[0-9]+([\.,][0-9]+)?$/;
  var number_Rp_regexp=/^[1-9]+[0-9]*([\.,][0-9]+)?$/;
  var ids_list_regexp=/^[1-9][0-9]*([,][1-9][0-9]*)*$/;

// variables definitions

  var days_in_month=new Array("0","31","29","31","30","31","30","31","31","30","31","30","31");

  var overdiv_mousefollow_interval;
  var mouse_position_x=0;
  var mouse_position_y=0;

// functions to make things easier... :-)

  function status_clear(a) {
    self.status=a;
  }

  var IE=document.all?true:false;
  if (!IE) document.captureEvents(Event.MOUSEMOVE);
  function get_mouse_position(e) {
    if (IE) {
      mouse_position_x=event.clientX;
      mouse_position_y=event.clientY;
      if (document.body && (document.body.scrollLeft || document.body.scrollTop) ) {
        mouse_position_x+=document.body.scrollLeft;
        mouse_position_y+=document.body.scrollTop;
      } else if (document.documentElement && (document.documentElement.scrollLeft>0 || document.documentElement.scrollTop>0) ) {
        mouse_position_x+=document.documentElement.scrollLeft;
        mouse_position_y+=document.documentElement.scrollTop;
      }
    } else {
      mouse_position_x=e.pageX;
      mouse_position_y=e.pageY;
    }  
    if (mouse_position_x<0) { mouse_position_x=0; }
    if (mouse_position_y<0) { mouse_position_y=0; }
  }

  function get_window_height() {
    var window_height=0;
    if (typeof(window.innerWidth)=='number' ) { //Non-IE
      window_height=window.innerHeight-20;
    } else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight) ) { //IE 6+ in 'standards compliant mode'
      window_height=document.documentElement.clientHeight;
    } else if(document.body && (document.body.clientWidth || document.body.clientHeight) ) { //IE 4 compatible
      window_height=document.body.clientHeight;
    }
    return window_height;
  }

  function get_window_scroll_top() {
    var window_scroll_top=0;
    if (typeof(window.pageYOffset)=='number') { //Netscape compliant
      window_scroll_top=window.pageYOffset;
    } else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) { //DOM compliant
      window_scroll_top=document.body.scrollTop;
    } else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) { //IE6 standards compliant mode
      window_scroll_top=document.documentElement.scrollTop;
    }
    return window_scroll_top;
  }

  function get_object(name) {
    if (document.getElementById) {
      return document.getElementById(name);
    } else if (document.all) {
      return document.all[name];
    } else if (document.layers) {
      return document.layers[name];
    }
  }

  function logout() {
    window.location.href="/logout.php";
    return false;
  }

  function createXmlHttpRequestObject() {
    var xmlHttp;
    try {
      xmlHttp = new XMLHttpRequest();
    } catch(e) {
      var XmlHttpVersions = new Array("MSXML2.XMLHTTP.6.0", "MSXML2.XMLHTTP.5.0", "MSXML2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP");
      for (var i=0; i<XmlHttpVersions.length && !xmlHttp; i++) {
        try { 
          xmlHttp = new ActiveXObject(XmlHttpVersions[i]);
        } catch (e) {}
      }
    }
    if (!xmlHttp) alert("Your browser doesn't support Ajax.");
    else return xmlHttp;
  }

  function xml_value_return(xml_obj,xml_tag) {
    if (xml_obj) {
      if (xml_obj.getElementsByTagName(xml_tag)) {
        xml_obj=xml_obj.getElementsByTagName(xml_tag);
        if (xml_obj[0]) {
          if (xml_obj[0].firstChild) {
            if (xml_obj[0].firstChild.nodeValue) return xml_obj[0].firstChild.nodeValue; else return null;
          } else return null;
        } else return null;
      } else return null;
    } else return null;
  }

  function set_style(id, style, value) {
    if (typeof(id)=="string") if (get_object(id).style) eval("get_object(id).style."+style+"=value;");
    else if (typeof(id)=="object") if (id.style) eval("id.style."+style+"=value;");
  }
  function set_class(id, class_name) {
    if (typeof(id)=="string") get_object(id).className=class_name;
    else if (typeof(id)=="object") id.className=class_name;
  }
  
  function trim(text) {
  	return String(text).replace(/^\s+|\s+$/g,"");
  }

  function checkbox_max_checked(form_name, checkbox_name, checkboxes_count, clicked_id, max_checked_count, switch_checked) {
    var checked_count=0;
    for (i=0; i<checkboxes_count; i++) {
      if (document.forms[form_name][checkbox_name+'['+i+']'].checked==true) checked_count++;
    }
    if (checked_count>max_checked_count && switch_checked==0) {
      document.forms[form_name][checkbox_name+'['+clicked_id+']'].checked=false;
    } else if (checked_count>max_checked_count) {
      for (i=checkboxes_count-1; i>=0; i--) {
        if (i!=clicked_id && document.forms[form_name][checkbox_name+'['+i+']'].checked==true) {
          document.forms[form_name][checkbox_name+'['+i+']'].checked=false;
          break;
        }
      }
    }
  }

  var overdiv_black_style_visibility="hidden";
  function overdiv_black_resize(my_width) {
    my_width=typeof(my_width)!='undefined'?my_width:1000;
    if (get_object("full_height_container").offsetHeight>document.body.offsetHeight) get_object("overdiv_black").style.height=get_object("full_height_container").offsetHeight+"px";
    else get_object("overdiv_black").style.height=document.body.offsetHeight+"px";
    if (document.body.offsetWidth<my_width) get_object("overdiv_black").style.width=(my_width+"px");
    else get_object("overdiv_black").style.width=document.body.offsetWidth+"px";
    var k=get_object("overdiv_black").style.visibility;
    //if (k=="visible") flash_objects_visibility_change("hidden");
    //if (k=="hidden") flash_objects_visibility_change("visible");
    setTimeout("overdiv_black_resize()",200);
  }

  function overdiv_popup_close() {
    get_object("overdiv_popup").innerHTML="";
    set_style("overdiv_black","visibility","hidden");
    set_style("overdiv_popup","visibility","hidden");
  }

  function form_field_reset(obj,i,word) {
    if (i==1) { // onfocus
      if (obj.value==word) obj.value="";
    } else { // onblur
      if (obj.value=="") obj.value=word;
    }
  }
  /*function form_password_field_reset(obj,i,word) {
    if (i==1) { // onfocus
      if (obj.value==word) {
        var obj1=obj.cloneNode(true);
        obj1.type="password";
        obj1.value="";
        obj.parentNode.replaceChild(obj1,obj);
        setTimeout("document.log_in_form['password'].focus();",100);
      }
    } else { // onblur
      if (obj.value.length==0) {
        var obj1=obj.cloneNode(true);
        obj1.type="text";
        obj1.value=huzz_dictionary["password"];
        obj.parentNode.replaceChild(obj1,obj);
      }
    }
  }*/

  function element_content(element, content) {
    var xml_http_content_object=createXmlHttpRequestObject();
    if (xml_http_content_object) {
      xml_http_content_object.onreadystatechange=function() {
        if (xml_http_content_object.readyState==4) {
          if (xml_http_content_object.status==200) {
            get_object(element).innerHTML="";
            if (xml_http_content_object.responseText!="") get_object(element).innerHTML=xml_http_content_object.responseText;
          }
        }
      }
      xml_http_content_object.open("GET",content,true);
      xml_http_content_object.send(null);
    }
  }

// sounds

  function play_sound(sound,volume,play) {
    if (play==1) {
      soundManager.setVolume(sound,volume);
      soundManager.play(sound);
    }
  }

// to be done...

  function tbd() {
    //user_menu_close(id_user);
    alert("To be done ...");
  }

// country+language select

  function clch(id_language) {
    get_object("id_new_id_language["+document.country_language_form["new_id_language"].value+"]").style.fontWeight="";
    get_object("id_new_id_language["+id_language+"]").style.fontWeight="bold";
    document.country_language_form["new_id_language"].value=id_language;
  }

  var country_languages_options_opened=-1;
  function country_language_options(id_country,id_language,language_only) {
    if (language_only!=-1 && country_languages_options_opened!=language_only) {
      get_object('country_language_selector_content').innerHTML="<img src='"+huzz_variables["images_files_dir"]+"loading.gif' style='margin-right: 5px; vertical-align: middle;'> "+huzz_dictionary["loading"]+"...";
      element_content('country_language_selector_content', '/ajax/country_languages.php?template=1&id_country='+id_country+'&id_language='+id_language+'&language_only='+language_only);
      set_style("country_language_selector","display","block");
      country_languages_options_opened=language_only;
    } else {
      set_style("country_language_selector","display","none");
      country_languages_options_opened=-1;
    }
  }


// log in

  function log_in_box_open() {
    forgot_password_box_close();
    set_style("login_form_container","display","block");
  }
  function log_in_box_close() {
    set_style("login_form_container","display","none");
    get_object("log_in_td_error").innerHTML="";
    document.log_in_form["email"].value=huzz_dictionary["email"];
    document.log_in_form["password"].value=huzz_dictionary["password"];
    document.log_in_form["remember_me"].checked=false;
    document.log_in_form["email"].disabled=false;
    document.log_in_form["password"].disabled=false;
    document.log_in_form["remember_me"].disabled=false;
    document.log_in_form["submit"].disabled=false;
  }

  function log_in_form_check() {
    if (mail_regexp.test(document.log_in_form["email"].value)==false) {
			get_object("log_in_td_error").innerHTML=huzz_dictionary["please_fill_in_correct_email"];
			document.log_in_form["email"].focus();
		  return false;
		}
  }

// forgot password

  function forgot_password_box_open() {
    log_in_box_close();
    generate_security_code(1);
    set_style("forgot_password_form_container","display","block");
  }
  function forgot_password_box_close() {
    set_style("forgot_password_form_container","display","none");
    get_object("forgot_password_td_error").innerHTML="";
    document.forgot_password_form["email"].value=huzz_dictionary["email"];
    get_object("forgot_password_security_image").src=huzz_variables["images_files_dir"]+"form_check_code_bg.png";
    document.forgot_password_form["security_code"].value=huzz_dictionary["security_code"];
    document.forgot_password_form["email"].disabled=false;
    document.forgot_password_form["security_code"].disabled=false;
    document.forgot_password_form["submit"].disabled=false;
  }

  function forgot_password_form_check() {
    if (mail_regexp.test(document.forgot_password_form["email"].value)==false) {
			get_object("forgot_password_td_error").innerHTML=huzz_dictionary["please_fill_in_correct_email"];
			document.forgot_password_form["email"].focus();
		}
    else if (security_code_regexp.test(document.forgot_password_form["security_code"].value)==false) {
			get_object("forgot_password_td_error").innerHTML=huzz_dictionary["please_fill_in_correct_security_code"];
			document.forgot_password_form["security_code"].focus();
		}
		else {
      var xml_http_forgot_password=createXmlHttpRequestObject();
      if (xml_http_forgot_password) {
        document.forgot_password_form["email"].disabled=true;
        document.forgot_password_form["security_code"].disabled=true;
        document.forgot_password_form["submit"].disabled=true;
        get_object("forgot_password_td_error").innerHTML="";

        var url_forgot_password="/ajax/forgotten_password.php";
        var params_forgot_password="id_form=1&email="+document.forgot_password_form["email"].value+"&security_code="+document.forgot_password_form["security_code"].value+"&requested_index="+document.forgot_password_form["requested_index"].value;

        xml_http_forgot_password.open("POST",url_forgot_password,true);
        xml_http_forgot_password.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        xml_http_forgot_password.setRequestHeader("Content-length", params_forgot_password.length);
        xml_http_forgot_password.setRequestHeader("Connection", "close");

        xml_http_forgot_password.onreadystatechange=function() {
          if (xml_http_forgot_password.readyState==4) {
            if (xml_http_forgot_password.status==200) {
              var response_forgot_password=xml_http_forgot_password.responseText;
              if (response_forgot_password!="") {
                if (response_forgot_password.charAt(0)=="1") {
                  get_object("forgot_password_td_error").innerHTML=huzz_dictionary["wrong_email_or_security_code"];
                  //document.forgot_password_form["email"].value=huzz_dictionary["email"];
                  document.forgot_password_form["security_code"].value=huzz_dictionary["security_code"];
                  generate_security_code(1);
                  document.forgot_password_form["email"].disabled=false;
                  document.forgot_password_form["security_code"].disabled=false;
                  document.forgot_password_form["submit"].disabled=false;
                  //document.forgot_password_form["email"].focus();
                }
                else if (response_forgot_password.charAt(0)=="2") {
                  get_object("forgot_password_td_error").innerHTML=huzz_dictionary["new_password_was_sent"]+". <a href=\"javascript: log_in_box_open();\">"+huzz_dictionary["log_in"]+"!</a>";
                  setTimeout("log_in_box_open()",2000);
                }
                else if (response_forgot_password.charAt(0)=="3") {
                  get_object("forgot_password_td_error").innerHTML=huzz_dictionary["an_error_occured_while_sending_email_try_again_later"];
                  //document.forgot_password_form["email"].value=huzz_dictionary["email"];
                  document.forgot_password_form["security_code"].value=huzz_dictionary["security_code"];
                  generate_security_code(1);
                  document.forgot_password_form["email"].disabled=false;
                  document.forgot_password_form["security_code"].disabled=false;
                  document.forgot_password_form["submit"].disabled=false;
                  //document.forgot_password_form["security_code"].focus();
                }
              }
            } else if (xml_http_forgot_password.status==12029 || xml_http_forgot_password.status==12030 || xml_http_forgot_password.status==12031 || xml_http_forgot_password.status==12152 || xml_http_forgot_password.status==12159) forgot_password_form_check();
          }
        }
        xml_http_forgot_password.send(params_forgot_password);
      }
    }
		return false;
  }

  function generate_security_code(id_form) {
    var xml_http_security_code=createXmlHttpRequestObject();
    if (xml_http_security_code) {
      xml_http_security_code.open("GET","/ajax/form_check_code.php?id_form="+id_form+"&ri=-1&id_language="+huzz_variables["id_interface_language"],true);
      xml_http_security_code.onreadystatechange=function() {
        if (xml_http_security_code.readyState==4 && xml_http_security_code.status==200) {
          var response=xml_http_security_code.responseText;
          if (response!="") {
            if (id_form==1) {
              document.forgot_password_form["requested_index"].value=parseInt(response);
              get_object("forgot_password_security_image").src="/ajax/form_check_code.php?id_form=1&ri="+parseInt(response)+"&id_language="+huzz_variables["id_interface_language"];
            } else if (id_form==2) {
              document.sign_up_form["requested_index"].value=parseInt(response);
              get_object("sign_up_security_image").src="/ajax/form_check_code.php?id_form=2&ri="+parseInt(response)+"&id_language="+huzz_variables["id_interface_language"];
            }
          }
        }
      }
      xml_http_security_code.send(null);
    }
  }

// sign up

  function pseudonym_generate() {
    if (document.sign_up_form["first_name"].value!=trim(document.sign_up_form["first_name"].value).toUpperCase().substr(0,1)+trim(document.sign_up_form["first_name"].value).substr(1)) document.sign_up_form["first_name"].value=trim(document.sign_up_form["first_name"].value).toUpperCase().substr(0,1)+trim(document.sign_up_form["first_name"].value).substr(1);
    if (document.sign_up_form["last_name"].value!=trim(document.sign_up_form["last_name"].value).toUpperCase().substr(0,1)+trim(document.sign_up_form["last_name"].value).substr(1)) document.sign_up_form["last_name"].value=trim(document.sign_up_form["last_name"].value).toUpperCase().substr(0,1)+trim(document.sign_up_form["last_name"].value).substr(1);
    if (document.sign_up_form["pseudonym"].value!=trim(document.sign_up_form["pseudonym"].value).toUpperCase().substr(0,1)+trim(document.sign_up_form["pseudonym"].value).substr(1)) document.sign_up_form["pseudonym"].value=trim(document.sign_up_form["pseudonym"].value).toUpperCase().substr(0,1)+trim(document.sign_up_form["pseudonym"].value).substr(1);
    if (trim(document.sign_up_form["first_name"].value)!="" && trim(document.sign_up_form["last_name"].value)!="") {
      get_object("pseudonym_type_text_1").innerHTML=trim(document.sign_up_form["first_name"].value)+" "+trim(document.sign_up_form["last_name"].value);
      get_object("pseudonym_type_text_2").innerHTML=trim(document.sign_up_form["first_name"].value)+" "+trim(document.sign_up_form["last_name"].value).substring(0,1);
      get_object("pseudonym_type_text_3").innerHTML=trim(document.sign_up_form["first_name"].value);
      get_object("pseudonym_type_text_4").innerHTML=trim(document.sign_up_form["last_name"].value);
      set_style("pseudonym_table","display","block");
    } else {
      set_style("pseudonym_table","display","none");
    }
  }
  function pseudonym_clear() {
    if (document.sign_up_form["pseudonym"].value==huzz_dictionary["other"]) document.sign_up_form["pseudonym"].value='';
    set_style("pseudonym_textinput","color","#000000");
    document.sign_up_form["pseudonym_type"][4].checked=true;
  }

  function sign_up_form_check() {
    if (trim(document.sign_up_form["first_name"].value)=="") {
      get_object("sign_up_td_error").innerHTML=huzz_dictionary["please_fill_in_first_name"];
      set_style("sign_up_td_error","height","");
      set_style("sign_up_td_error","paddingBottom","10px");
      document.sign_up_form["first_name"].focus();
    }
    else if (trim(document.sign_up_form["last_name"].value)=="") {
      get_object("sign_up_td_error").innerHTML=huzz_dictionary["please_fill_in_last_name"];
      set_style("sign_up_td_error","height","");
      set_style("sign_up_td_error","paddingBottom","10px");
      document.sign_up_form["last_name"].focus();
    }
    else if (document.sign_up_form["pseudonym_type"][4].checked==true && (trim(document.sign_up_form["pseudonym"].value)=="" || trim(document.sign_up_form["pseudonym"].value)==huzz_dictionary["other"]) ) {
      get_object("sign_up_td_error").innerHTML=huzz_dictionary["please_fill_in_user_name"];
      set_style("sign_up_td_error","height","");
      set_style("sign_up_td_error","paddingBottom","10px");
      document.sign_up_form["pseudonym"].focus();
    }
    else if (trim(document.sign_up_form["email"].value)=="" || trim(document.sign_up_form["email"].value)=="@") {
      get_object("sign_up_td_error").innerHTML=huzz_dictionary["please_fill_in_email"];
      set_style("sign_up_td_error","height","");
      set_style("sign_up_td_error","paddingBottom","10px");
      document.sign_up_form["email"].focus();
    }
    else if(mail_regexp.test(document.sign_up_form["email"].value)==false) {
			get_object("sign_up_td_error").innerHTML=huzz_dictionary["please_fill_in_correct_email"];
      set_style("sign_up_td_error","height","");
      set_style("sign_up_td_error","paddingBottom","10px");
			document.sign_up_form["email"].focus();
		}
    else if (document.sign_up_form["password"].value=="") {
      get_object("sign_up_td_error").innerHTML=huzz_dictionary["please_fill_in_password"];
      set_style("sign_up_td_error","height","");
      set_style("sign_up_td_error","paddingBottom","10px");
      document.sign_up_form["password"].focus();
    }
    else if (document.sign_up_form["confirm_password"].value=="") {
      get_object("sign_up_td_error").innerHTML=huzz_dictionary["please_fill_in_confirmation_password"];
      set_style("sign_up_td_error","height","");
      set_style("sign_up_td_error","paddingBottom","10px");
      document.sign_up_form["confirm_password"].focus();
    }
    else if (document.sign_up_form["password"].value!=document.sign_up_form["confirm_password"].value) {
      get_object("sign_up_td_error").innerHTML=huzz_dictionary["password_and_confirmation_password_dont_match"];
      set_style("sign_up_td_error","height","");
      set_style("sign_up_td_error","paddingBottom","10px");
      document.sign_up_form["password"].value="";
      document.sign_up_form["confirm_password"].value="";
      document.sign_up_form["password"].focus();
    }
    else if (document.sign_up_form["security_code"].value=="") {
      get_object("sign_up_td_error").innerHTML=huzz_dictionary["please_fill_in_security_code"];
      set_style("sign_up_td_error","height","");
      set_style("sign_up_td_error","paddingBottom","10px");
      document.sign_up_form["security_code"].focus();
    }
    else if(security_code_regexp.test(document.sign_up_form["security_code"].value)==false) {
			get_object("sign_up_td_error").innerHTML=huzz_dictionary["please_fill_in_correct_security_code"];
      set_style("sign_up_td_error","height","");
      set_style("sign_up_td_error","paddingBottom","10px");
			document.sign_up_form["security_code"].focus();
		}
    else if (document.sign_up_form["accept_terms"].checked==false) {
      get_object("sign_up_td_error").innerHTML=huzz_dictionary["you_must_accept_the_terms_of_use"];
      set_style("sign_up_td_error","height","");
      set_style("sign_up_td_error","paddingBottom","10px");
      document.sign_up_form["accept_terms"].focus();
    }
		else {
      var xml_http_sign_up=createXmlHttpRequestObject();
      if (xml_http_sign_up) {
        document.sign_up_form["first_name"].disabled=true;
        document.sign_up_form["last_name"].disabled=true;
        document.sign_up_form["pseudonym_type"][0].disabled=true;
        document.sign_up_form["pseudonym_type"][1].disabled=true;
        document.sign_up_form["pseudonym_type"][2].disabled=true;
        document.sign_up_form["pseudonym_type"][3].disabled=true;
        document.sign_up_form["pseudonym_type"][4].disabled=true;
        document.sign_up_form["pseudonym"].disabled=true;
        document.sign_up_form["email"].disabled=true;
        document.sign_up_form["password"].disabled=true;
        document.sign_up_form["confirm_password"].disabled=true;
        document.sign_up_form["security_code"].disabled=true;
        document.sign_up_form["remember_me"].disabled=true;
        document.sign_up_form["accept_terms"].disabled=true;
        document.sign_up_form["submit"].disabled=true;

        var url_sign_up="/ajax/signup.php";
        var remember_me_sign_up=0; if (document.sign_up_form["remember_me"].checked) remember_me_sign_up=1;
        var accept_terms_sign_up=0; if (document.sign_up_form["accept_terms"].checked) accept_terms_sign_up=1;
        var pseudonym_type=0;
        for (i=0; i<5; i++) if (document.sign_up_form["pseudonym_type"][i].checked==true) pseudonym_type=i+1;
        var params_sign_up="first_name="+document.sign_up_form["first_name"].value+"&last_name="+document.sign_up_form["last_name"].value+"&pseudonym_type="+pseudonym_type+"&pseudonym="+document.sign_up_form["pseudonym"].value+"&email="+document.sign_up_form["email"].value+"&password="+document.sign_up_form["password"].value+"&confirm_password="+document.sign_up_form["confirm_password"].value+"&security_code="+document.sign_up_form["security_code"].value+"&requested_index="+document.sign_up_form["requested_index"].value+"&remember_me="+remember_me_sign_up+"&accept_terms="+accept_terms_sign_up+"&id_invitation="+document.sign_up_form["id_invitation"].value+"&invitation_code="+document.sign_up_form["invitation_code"].value;

        xml_http_sign_up.open("POST",url_sign_up,true);
        xml_http_sign_up.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        xml_http_sign_up.setRequestHeader("Content-length", params_sign_up.length);
        xml_http_sign_up.setRequestHeader("Connection", "close");

        xml_http_sign_up.onreadystatechange=function() {
          if (xml_http_sign_up.readyState==4) {
            if (xml_http_sign_up.status==200) {
              var response_sign_up=xml_http_sign_up.responseText;
              //alert(response_sign_up);
              if (response_sign_up=="" || (response_sign_up!="" && (response_sign_up.charAt(0)=="0" || response_sign_up.charAt(0)=="1" || response_sign_up.charAt(0)=="2") ) ) {
                document.sign_up_form["security_code"].value="";
                generate_security_code(2);
                document.sign_up_form["first_name"].disabled=false;
                document.sign_up_form["last_name"].disabled=false;
                document.sign_up_form["pseudonym_type"][0].disabled=false;
                document.sign_up_form["pseudonym_type"][1].disabled=false;
                document.sign_up_form["pseudonym_type"][2].disabled=false;
                document.sign_up_form["pseudonym_type"][3].disabled=false;
                document.sign_up_form["pseudonym_type"][4].disabled=false;
                document.sign_up_form["pseudonym"].disabled=false;
                document.sign_up_form["email"].disabled=false;
                document.sign_up_form["password"].disabled=false;
                document.sign_up_form["confirm_password"].disabled=false;
                document.sign_up_form["security_code"].disabled=false;
                document.sign_up_form["remember_me"].disabled=false;
                document.sign_up_form["accept_terms"].disabled=false;
                document.sign_up_form["submit"].disabled=false;
              }
              if (response_sign_up!="") {
                if (response_sign_up.charAt(0)=="0") {
                  get_object("sign_up_td_error").innerHTML=huzz_dictionary["you_must_fill_in_all_fields"];
                  set_style("sign_up_td_error","height","");
                  set_style("sign_up_td_error","paddingBottom","10px");
                  document.sign_up_form["first_name"].focus();
                }
                if (response_sign_up.charAt(0)=="1") {
                  get_object("sign_up_td_error").innerHTML=huzz_dictionary["this_email_is_already_registered"]+".<br /><a href=\"javascript: document.forgot_password_form['email'].value=document.sign_up_form['email'].value; forgot_password_box_open();\">"+huzz_dictionary["forgot_your_password"]+"</a>";
                  set_style("sign_up_td_error","height","");
                  set_style("sign_up_td_error","paddingBottom","10px");
                  document.sign_up_form["email"].focus();
                }
                else if (response_sign_up.charAt(0)=="2") {
                  get_object("sign_up_td_error").innerHTML=huzz_dictionary["wrong_security_code"];
                  set_style("sign_up_td_error","height","");
                  set_style("sign_up_td_error","paddingBottom","10px");
                  document.sign_up_form["security_code"].focus();
                }
                else if (response_sign_up.charAt(0)=="3") {
                  window.location.href="/";
                }
              }
            } else if (xml_http_sign_up.status==12029 || xml_http_sign_up.status==12030 || xml_http_sign_up.status==12031 || xml_http_sign_up.status==12152 || xml_http_sign_up.status==12159) sign_up_form_check();
          }
        }
        xml_http_sign_up.send(params_sign_up);
      }
    }
    return false;
  }

// end

  function find_people_submit_check() {
    if (trim(document.find_people_form["username"].value)=="") {
      alert(huzz_dictionary["please_fill_in_user_name"]+".");
      document.find_people_form["username"].focus();
      return false;
    }
  }

