<!-- do the ajax calls -->
    function makeXmlHttp(){
        var xmlhttp = null;
        if(window.XMLHttpRequest){
        xmlhttp = new XMLHttpRequest();
        }else{
            try{
                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            }catch(e){
                window.alert("Uw browser ondersteunt het XMLHttpRequest object niet!");
            }
        }
        
        return xmlhttp;
    }
    
    function DoLogin(){
		// We don't want IE to cache reponse 
		var randomString = Math.floor(Math.random() * 1000000).toString() +  Math.floor(Math.random() * 1000000).toString(); 
		// End we don't want IE to cache reponse 
		
	//	var indicator = document.getElementById(id).style;
		//document.getElementById(id).src = 'images/tiny_red.gif';
		
	
		text = document.getElementById("loginform")
		//alert(text.get);
		//alert(document.getElementById('username').value);
		//var user = "none";
		//document.forms.item('').getElementById('username').value;
    	user = document.getElementById('username').value;
		var pass = document.getElementById('pass').value;
		//alert(text);
			document.getElementById('loginform').innerHTML="";
		document.getElementById('loginform').innerHTML="Content is Loading, please wait....";
	//	var a=document.getElementById("loginform");
	//	alert(a.username.value);
		if (pass != ''){
			var pass = hex_md5(pass);
		}
		if (user == ''){
			var user = 'noname';
		}
		var xmlhttp = makeXmlHttp();
        xmlhttp.open("POST", "login.php", true);
        xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		
		
        xmlhttp.onreadystatechange = function() {

			if(xmlhttp.readyState == 4){
				if(xmlhttp.status == 200) {
	   		//	 indicator.display = "none";
					 window.alert(xmlhttp.responseText);

    	    	}
				if(xmlhttp.status == 404) {
	   			 	window.alert('Er is helaas een fout opgetreden probeert u het later nogmaals');

    	    	}
	//		indicator.display = "none";
			}
        }
      
	  //	indicator.display = "inline";
      
	  xmlhttp.send('username=' + user + '&pass=' + pass +'&iefix=' + randomString);
    }
