// JavaScript Document




var myurl = "http://www.recyclingbox.co.uk/test.php";

 
	 
	var handleSuccess = function(o){ 
	    if(o.responseText !== undefined){ 
	       
	        document.getElementById("myselectarea").innerHTML = o.responseText; 
			
	       
	    } 
	} 
	 
	var handleFailure = function(o){ 
	    if(o.responseText !== undefined){ 
	        
	        document.getElementById("myselectarea").innerHTML = "<li>HTTP status: " + o.status + "</li>"; 
	        
	    } 
	} 
	
	
	 
	var callback = 
	{ 
	  success:handleSuccess, 
	  failure: handleFailure, 
	  argument: { foo:"foo", bar:"bar" } 
	}; 
	
	
	
	function myRequest() {
	    
		var request = YAHOO.util.Connect.asyncRequest('GET', myurl, callback);
		myurl = "http://www.recyclingbox.co.uk/test.php";
		
	}
	
	function ajaxFunction(divid){
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	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
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			//var response = ajaxRequest.responseText;
			//var nameNode = responsexml.getElementsByTagName("name")[0];
			//var nameText = nameNode.childNodes[0].nodeValue;
			var myspace = "content" + divid;
			var mydiv = document.getElementById(myspace); 
		
			if(mydiv.style.display != "block")
			{
			  mydiv.innerHTML = ajaxRequest.responseText;
			  mydiv.style.display = "block";
             
			} else {
			  mydiv.innerHTML = "";
			  mydiv.style.display = "none";
			 
			  
			}
		}
	}

	//var queryString = "?eid=" + userid;
	ajaxRequest.open("GET", "http://www.recyclingbox.co.uk/test.php", true);
	ajaxRequest.send(null); 
}

	
