// http://www.dynamicajax.com/fr/AJAX_Hello_World-.html	
// 	Copyright 2006 Ryan Smith / 345 Technical / 345 Group.

//Gets the browser specific XmlHttpRequest Object
function getXmlHttpRequestObject() {
	if (window.XMLHttpRequest) {
		return new XMLHttpRequest(); //Not IE
	} else if(window.ActiveXObject) {
		return new ActiveXObject("Microsoft.XMLHTTP"); //IE
	} else {
		//Display your error message here. 
		//and inform the user they might want to upgrade
		//their browser.
		alert("Your browser doesn't support the XmlHttpRequest object.  Better upgrade to Firefox.");
	}
}			
//Get our browser specific XmlHttpRequest object.
var receiveReq = getXmlHttpRequestObject();		
//Initiate the asyncronous request.
function blog() {
	//If our XmlHttpRequest object is not in the middle of a request, start the new asyncronous call.
	if (receiveReq.readyState == 4 || receiveReq.readyState == 0) {
		//Setup the connection as a GET call to SayHello.html.
		//True explicity sets the request to asyncronous (default).
		receiveReq.open("GET", 'deckhands/wordpress.py', true);
		//Set the function that will be called when the XmlHttpRequest objects state changes.
		receiveReq.onreadystatechange = handleSayHello; 
		//Make the actual request.
		receiveReq.send(null);
	}			
}

//Called every time our XmlHttpRequest objects state changes.
function handleSayHello() {
	//Check to see if the XmlHttpRequests state is finished.
	if (receiveReq.readyState == 4) {
		//Set the contents of our span element to the result of the asyncronous call.
		document.getElementById('content').innerHTML = receiveReq.responseText;
	}
}


function photos() {
	content = '<iframe align="center" src="http://www.flickr.com/slideShow/index.gne?user_id=26612941@N05" frameBorder="0" width="620" height="560" scrolling="no"></iframe>';
	it = document.getElementById('content');
	alert(it);
	it.innerHTML = content;
}


function photos() {
	//If our XmlHttpRequest object is not in the middle of a request, start the new asyncronous call.
	if (receiveReq.readyState == 4 || receiveReq.readyState == 0) {
		//Setup the connection as a GET call to SayHello.html.
		//True explicity sets the request to asyncronous (default).
		receiveReq.open("GET", 'deckhands/page_content/photos.html', true);
		//Set the function that will be called when the XmlHttpRequest objects state changes.
		receiveReq.onreadystatechange = handleSayHello; 
		//Make the actual request.
		receiveReq.send(null);
	}			
}


function shows() {
	//If our XmlHttpRequest object is not in the middle of a request, start the new asyncronous call.
	if (receiveReq.readyState == 4 || receiveReq.readyState == 0) {
		//Setup the connection as a GET call to SayHello.html.
		//True explicity sets the request to asyncronous (default).
		receiveReq.open("GET", 'deckhands/shows.py', true);
		//Set the function that will be called when the XmlHttpRequest objects state changes.
		receiveReq.onreadystatechange = handleSayHello; 
		//Make the actual request.
		receiveReq.send(null);
	}			
}
