function ajaxFunction(){
	var ajaxRequest;  
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				
				return false;
			}
		}
	}
	
	
	
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			
			fnParseXML(ajaxRequest.responseXML)
			
		}
	}
	
	ajaxRequest.open("GET", "xml/pFcontacts.xml", true);
	ajaxRequest.send(null);
	
	
	//ajaxRequest.send(null); 
}

function fnParseXML(myXML){
	var root=myXML.documentElement;
	var phone1=""
	var phone2=""
	var mobile1=""
	var mobile2=""
	var fax=""
	
	
	if (root.hasChildNodes){
		for (i=0; i<root.childNodes.length;i++){
			if (root.childNodes[i].nodeName == "phoneNumberOne"){
				phone1=root.childNodes[i].childNodes[0].nodeValue
			}
			if (root.childNodes[i].nodeName == "phoneNumberTwo"){
				phone2=root.childNodes[i].childNodes[0].nodeValue
			}
			if (root.childNodes[i].nodeName == "mobileOne"){
				mobile1=root.childNodes[i].childNodes[0].nodeValue
			}
			if (root.childNodes[i].nodeName == "mobileTwo"){
				mobile2=root.childNodes[i].childNodes[0].nodeValue
			}
			if (root.childNodes[i].nodeName == "fax"){
				fax=root.childNodes[i].childNodes[0].nodeValue
			}
			if (root.childNodes[i].nodeName == "email"){
				email=root.childNodes[i].childNodes[0].nodeValue
			}
			if (root.childNodes[i].nodeName == "address"){
				address=root.childNodes[i].childNodes[0].nodeValue
			}
			if (root.childNodes[i].nodeName == "pin"){
				pin=root.childNodes[i].childNodes[0].nodeValue
			}
		}
		

		document.getElementById("phoneNos").innerHTML="<strong>Phone:</strong> <br>" + phone1 +"<br>"+ phone2
		document.getElementById("mobiles").innerHTML="<strong>Mobile:</strong> <br>" + mobile1 +"<br>"+ mobile2
		document.getElementById("waiting1").style.display="none"
		document.getElementById("fax").innerHTML="<strong>Fax:</strong> <br>" + fax 
		
		document.getElementById("address1").innerHTML="<strong>Address:</strong> "+ address +" <strong>Pincode:</strong> "+pin+"<br><strong>Email:</strong> <a href='contactUs.aspx' class='whiteText1'>" + email +"</a>";
		
	}
	
}

