// functions to make things easier... :-)
  
  function status_clear(a) {
    self.status=a;
  }
  
  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 createXmlHttpRequestObject() {
    var xmlHttp;
    try {
      xmlHttp = new XMLHttpRequest();
      if (xmlHttp.overrideMimeType) xmlHttp.overrideMimeType('text/html');
    } 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 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,"");
  }

// main menu

  function main_menu_open_submenu(i,a) {
    if (a==1) {
     set_style("main_menu_item["+i+"]","borderTop","1px solid #cfcfcf");
     set_style("main_menu_submenu["+i+"]","display","block");
    }
    else {
     set_style("main_menu_item["+i+"]","borderTop","1px solid #ffffff");
     set_style("main_menu_submenu["+i+"]","display","none");
    }
  }

function open_livechat()
  {
  var width=600, height=500;
  var screen_w=640, screen_h=480;
  if (parseInt(navigator.appVersion)>3)
    {
    screen_w=screen.width;
    screen_h=screen.height;
    }
  livechat=window.open("http://web.it-development.com/livechat/index.php","livechat","status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,scrollbars=0,height="+height+",width="+width);
/*
  livechat.moveTo((screen_w-width)/2,(screen_h-height)/2);
*/
  livechat.focus();
  }

  function get_xml_http_request()
    {
    var xml_http;
    try { xml_http=new XMLHttpRequest(); }
    catch (e) {
      try { xml_http=new ActiveXObject("Msxml2.XMLHTTP"); }
      catch (e) {
        try { xml_http=new ActiveXObject("Microsoft.XMLHTTP"); }
        catch (e) {
          return false;
          }
        }
      }
    return xml_http;
    }

  function check_online_status()
    {
    var xml_http=get_xml_http_request();
    xml_http.onreadystatechange=function()
      {
      if(xml_http.readyState==4)
        {
        var response=xml_http.responseText;
        if (response!="")
          {

          if (response.charAt(0)=="1")
            {
            document.getElementById("box_livechat").innerHTML=document.getElementById("box_livechat_online").innerHTML;
            }
          else
            {
            document.getElementById("box_livechat").innerHTML=document.getElementById("box_livechat_offline").innerHTML;
            }
          if (response.charAt(1)=="1")
            {
            document.getElementById("box_skype").innerHTML=document.getElementById("box_skype_online").innerHTML;
            }
          else
            {
            document.getElementById("box_skype").innerHTML=document.getElementById("box_skype_offline").innerHTML;
            }

          }
        }
      }

    xml_http.open("GET","online_checker.php",true);
    xml_http.send(null);
    }


