IE = ((document.all)||(window.opera))
NN = (navigator.appName == "Netscape")
N5 = ((NN)&&(parseInt(navigator.appVersion) >= 5));
N4 = ((NN)&&(parseInt(navigator.appVersion) < 5));
NS = (document.layers)

function preload_img()
{ 
   var img_list = preload_img.arguments;
   if (document.preloadlist == null) 
       document.preloadlist = new Array();
   var top = document.preloadlist.length;
   for (var i=0; i < img_list.length; i++) {
       document.preloadlist[top+i] = new Image;
       document.preloadlist[top+i].src = img_list[i+1];
   } 
}

function load_all()
{
  preload_img(false);
}

function change_img(name, nsdoc, rpath, preload)
{ 
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '') 
     return;
  if (img) {
     img.altsrc = img.src;
     img.src    = rpath;
  } 
}

function restore_img(name, nsdoc)
{
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '') 
     return;
  if (img && img.altsrc) {
     img.src    = img.altsrc;
     img.altsrc = null;
  } 
}

// Ajax post
function AjaxPost(strURL, querystring, ret_func)
{
    var xmlHttpReq = false;
    var self = this;
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    } else {
        alert ("Can`t send request! Your browser don`t support XMLRequest");
        return false;
    }

    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            if (ret_func) {
                ret_func(self.xmlHttpReq.responseText, self.xmlHttpReq.responseXML);
            }
        }
    }
    self.xmlHttpReq.send( querystring );
}

