function wyjazdy_archiwalne(wyjazdy_pokazane)
{

    var xmlHttp = getAjax();

  
    xmlHttp.onreadystatechange=function(){
        if(wyjazdy_pokazane==false){
            document.getElementById("archiwalne").innerHTML="";
        }
        else if(xmlHttp.readyState==4){
            document.getElementById("archiwalne").innerHTML=xmlHttp.responseText;
        }
    }

   xmlHttp.open("GET","ajax.php?action=grupowe_archiwalne",true);
    xmlHttp.send(null);
}

function is_correct_email(email)
{
    var xmlHttp = getAjax();
    xmlHttp.open("GET","ajax.php?action=check_email&email="+email, false);
    xmlHttp.send(null);

    var email_exist = xmlHttp.responseText;
    if (email_exist =='1')
        return true;
    else
        return false;
}

function getAjax(){
    try{
        // Firefox, Opera 8.0+, Safari
        xmlHttp=new XMLHttpRequest();
    }
    catch (e)
    {
        // Internet Explorer
        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;
            }
        }
    }

    return xmlHttp;
}