/**
 * Objects and functions is (c) 2008 http://www.ipp.co.il
 *
 */

function SetHP(hn)
{
  var str = '';
  var obj = document.body;
  str = hn;

  if (document.all) 
  {
    try
    {
      obj.style.behavior='url(#default#homepage)';
      if (!(obj.isHomePage(str))) obj.setHomePage(str);
    } catch(x) {
    }
  } 
  else 
    if(!document.layers) 
    {
      netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite");
      navigator.preference("browser.startup.homepage", str);
    }
}

function MyLoad(method, url, args, async, doneFunc, funcArg)
{
  var xmlHttp;
  try {
    xmlHttp = new XMLHttpRequest();
  } catch(e) {
    try {
      xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch(e) {
      try {
	xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch(e) {
	alert("Your browser does not support AJAX!");
	return false;
      }
    }
  }

  if(doneFunc) {
    xmlHttp.onreadystatechange = function() {
      if(xmlHttp.readyState == 4) doneFunc(xmlHttp, funcArg, args);
    };
  }

  var cgi_args = '';
  if(args) {
    for(var i in args) {
      if(cgi_args != '') cgi_args += '&';
      cgi_args += escape(i) + '=' + escape(args[i]);
    }
    if (cgi_args && method == 'GET') url += '?' + cgi_args;
  }

  xmlHttp.open(method, url, async);
  if(cgi_args && method == 'POST') {
    xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlHttp.send(cgi_args);
  } else xmlHttp.send(null);
  return xmlHttp;
}


