var elList=new Array("jogaId","hathaId","gimnId","sahaId","agniId","practId","tantraId",
"meditId","musicId","technId","transId","naukaId","liveId",
"kundalId","kundJogId","wakeKundId","raiseKundId","dangerKundId",
"isReklamId","whyFreeId","sektaId","askId");
var newAjax;

function showAll(){
    for(i=0;i<elList.length;i++) {
        document.getElementById(elList[i]).style.display="block";
    }
}

function hideAll() {
    parent.location.href="index.php?C=new#X"
    for(i=0;i<elList.length;i++) {
        document.getElementById(elList[i]).style.display="none";
    }
}

function clearForm() {
    document.getElementById("nickId").value = "";
    document.getElementById("mailId").value = "";
    document.getElementById("contId").value = "";
}

function sendMail() {
    if (document.getElementById("nickId").value=="" || document.getElementById("mailId").value=="" || document.getElementById("contId").value=="") {
        document.getElementById("noValidId").innerHTML = "Niepoprawnie wypełnione pole !!";
        return 0;
    }
    if (window.ActiveXObject) {
        try { newAjax = new ActiveXObject("Msxml2.XMLHTTP"); }
        catch (e) {
            try { newAjax = new ActiveXObject("Microsoft.XMLHTTP"); }
            catch (e) { newAjax = false; }
        }
    }
    else { try { newAjax = new XMLHttpRequest(); }
            catch (e) { newAjax = false; }
    }
    if ( ! newAjax)  {
        alert ("Nie mogę utworzyć obiektu AJAX");
        return 0;
    }
//     var mAdr = "http://192.168.1.108/Sonalika/SY/New/mail.php";
   var mAdr = "http://www.sonalika.com.pl/SY/New/mail.php";
    var mailContent = "nick=" + ((document.getElementById("nickId").value)) + "&mail=" + ((document.getElementById("mailId").value)) + "&cont=" + ((document.getElementById("contId").value));
    newAjax.open("POST",mAdr,true) ;
    newAjax.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    newAjax.onreadystatechange = mailSended;
    newAjax.send(mailContent);
}

function mailSended() {
    if (newAjax.readyState == 4)	{
        if (newAjax.status == 200)
	{
            var el = document.getElementById ("askId");
		el.innerHTML = newAjax.responseText;
	}
	}

}