//nowy ajax

var req;
function loadXMLDoc(url){
if (window.XMLHttpRequest) {
    req = new XMLHttpRequest();
    req.onreadystatechange = processReqChange;
    req.open("GET", url, true);
    req.send(null);
} else if (window.ActiveXObject) {
    req = new ActiveXObject("Microsoft.XMLHTTP");
    if (req) {
      req.onreadystatechange = processReqChange;
      req.open("GET", url, true);
      req.send();
    }
  }
}

function processReqChange(){
    if (req.readyState == 4){
        if (req.status == 200){
          response  = req.responseXML.documentElement;
          A_Method  = response.getElementsByTagName('method')[0].firstChild.data;
          A_Result  = response.getElementsByTagName('result')[0].firstChild.data;
          if (A_Method!='addNew'){
              eval(A_Method + '(\'\', A_Result)');
              }else{
              eval(A_Method + '(\'\',\'\', A_Result)');
              }
        }else{
          alert("There was a problem retrieving the XML data:\n" + req.statusText);
        }
    }
}

function CreateObject(){
    var http;
    var browser = navigator.appName; 
    if(browser == "Microsoft Internet Explorer"){
      http = new ActiveXObject("Microsoft.XMLHTTP");
    }else{
      http = new XMLHttpRequest();
    }
    return http;
}

var xmlhttp = CreateObject();
if(!xmlhttp) alert('Sorry we can not creat an ActiveX on your browser');

function loading(action){
    xmlhttp.open("GET", action, true);
    xmlhttp.onreadystatechange = DOWAT;
    xmlhttp.send(null);
}

function DOWAT() {
    if(xmlhttp.readyState == 1 || xmlhttp.readyState == 2){
      document.getElementById("aktivcontent").innerHTML = "<div id=\"page\"><div id=\"content\"></div></div>";
    }else if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) {
      document.getElementById("aktivcontent").innerHTML = xmlhttp.responseText;      
    }   
}

function iwant2_pl(action){
    loading('ajax_PL.php?page='+action+'&js=1');
}
function iwant2_en(action){
    loading('ajax_EN.php?page='+action+'&js=1');
}
function iwant2_ru(action){
    loading('ajax_RU.php?page='+action+'&js=1');
}
//------------------------------------------------------------------------------

//mrugajacy tekst
//setInterval("document.recalc()",1);

var xhr;
function modifyPage(link, button) {
    try {
        xhr = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
        try {
            xhr = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (E) {
            xhr = false;
        }
    }

    if (!xhr && typeof XMLHttpRequest != 'undefined') {
          xhr = new XMLHttpRequest();
    }

    xhr.open("GET", link);
    xhr.setRequestHeader("User-Agent", "my browser");
    xhr.onreadystatechange=function() {
        if (xhr.readyState != 4) return;

        document.getElementById("aktivcontent").innerHTML = xhr.responseText;
    }
    xhr.send(null);
}

function modifyHist(link) {
    try {
        xhr = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
        try {
            xhr = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (E) {
            xhr = false;
        }
    }

    if (!xhr && typeof XMLHttpRequest != 'undefined') {
          xhr = new XMLHttpRequest();
    }

    xhr.open("GET", link);
    xhr.setRequestHeader("User-Agent", "my browser");
    xhr.onreadystatechange=function() {
        if (xhr.readyState != 4) return;

        document.getElementById("hist_activ").innerHTML = xhr.responseText;
    }
    xhr.send(null);
}

function modifyFlash(button) {
document.test.GotoFrame(35);
document.test.SetVariable("button", button);
document.test.Play();
}

function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            if (oldonload) {
                oldonload();
            }
            func();
        }
    }
}

function footerLink_pl(name, button){
iwant2_pl(name);
modifyFlash(button);
}
function footerLink_en(name, button){
iwant2_en(name);
modifyFlash(button);
}
function footerLink_ru(name, button){
iwant2_ru(name);
modifyFlash(button);
}

var http_request = false;
   function makePOSTRequest(url, parameters) {
      http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
         	// set type accordingly to anticipated content type
            //http_request.overrideMimeType('text/xml');
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
      
      http_request.onreadystatechange = alertContents;
      http_request.open('POST', url, true);
      http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      http_request.setRequestHeader("Content-length", parameters.length);
      http_request.setRequestHeader("Connection", "close");
      http_request.send(parameters);
   }

   function alertContents() {
      if (http_request.readyState == 4) {
         if (http_request.status == 200) {
            //alert(http_request.responseText);
            result = http_request.responseText;
            first = result.substring(0,1);
            //ustalamy co robic w zaleznosci od stanu wysylania
            if (first == 1) {
              tekst = result.substring(1);
              //czyscimy formularz
              document.getElementById("name").value = "";
              document.getElementById("mail").value = "";
              document.getElementById("subject").value = "";
              document.getElementById("data").value = "";
              document.getElementById("captcha").value = "";
              //odswierzamy obrazek
              document.getElementById('captchaimg').src = document.getElementById('captchaimg').src + '?';
            } else {
              tekst = http_request.responseText;
              document.getElementById("captcha").value = "";
              //odswierzamy obrazek
              document.getElementById('captchaimg').src = document.getElementById('captchaimg').src + '?';
            }
            document.getElementById('komunikat').innerHTML = tekst;            
         } else {
            alert('There was a problem with the request.');
         }
      }
   }
   
   function get(obj) {
      var poststr = "&name=" + escape(encodeURI(document.getElementById("name").value ))
       +"&mail=" + escape(encodeURI(document.getElementById("mail").value ))
       +"&subject=" + escape(encodeURI(document.getElementById("subject").value))
       +"&data=" + escape(encodeURI(document.getElementById("data").value))
       +"&captcha=" + escape(encodeURI(document.getElementById("captcha").value))
       +"&akcja=" + escape(encodeURI(document.getElementById("akcja").value));
      makePOSTRequest('php/check.php', poststr);
   }



<!--
function SymError()
{
  return true;
}
window.onerror = SymError;
var SymRealWinOpen = window.open;
function SymWinOpen(url, name, attributes)
{
  return (new Object());
}
window.open = SymWinOpen;
//-->

<!-- W3e JAVAScript Preset/Date
var DDMMYY =0
var MMDDYY =1
function getdate(mode)
{var now = new Date();
var dayNr = ((now.getDate()<10) ? "0" : "")+ now.getDate();
var rok = now.getYear();
   //uzupelnienie do bledu netscape
	rok2 = "" + rok;
	l = rok2.length;
	rok2 = rok2.substring(l-2,l);
	rok = "20" + rok2;
	//uzupelnienie do bledu netscape
   if (mode==DDMMYY)
      var MonthDayYear =(dayNr+"."+(now.getMonth()+1)+"."+rok);
   else var MonthDayYear =((now.getMonth()+1)+"/"+dayNr+"/"+rok);
return MonthDayYear;}
function gettime()
{var now = new Date();
   var ampm = (now.getHours() >= 12) ? " P.M." : " A.M."
   var hours = now.getHours();
       hours = ((hours > 12) ? hours - 12 : hours);
   var minutes = ((now.getMinutes() < 10) ? ":0" : ":") + now.getMinutes();
   var seconds = ((now.getSeconds() < 10) ? ":0" : ":") + now.getSeconds();
   var TimeValue =(" " + hours + minutes + seconds + " "  + ampm);
return TimeValue;}//-->

