var doc = null;

function ajax() {
	// Make a new XMLHttp object
	if (typeof window.ActiveXObject != 'undefined' ) doc = new ActiveXObject("Microsoft.XMLHTTP");
	else doc = new XMLHttpRequest();
}

function CheckLogin(section, login, destination, id){
    if (login != '') {
		ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
	    if (doc){
	       	destination.innerHTML = "Loading data...";	
	       	if (id!=0){
	       		doc.open("GET", "check_login.php?sec=" + section + "&" + section + "=" + login + "&id=" + id, false);
	       		doc.send(null);
	    		// Write the response to the div	    	
	       		destination.innerHTML = doc.responseText;
	       	}else{
	       		doc.open("GET", "check_login.php?sec=" + section + "&" + section + "=" + login, false);
	       		doc.send(null);
	    		// Write the response to the div	    	
	       		destination.innerHTML = doc.responseText;
	       	}
	       
	    }
	    else{
	      
	       destination.innerHTML = 'Browser unable to create XMLHttp Object';
	    }        
    }
    else {
    	destination.innerHTML = "Nick is empty";
    }

}

