// Script Lora-Page - lora_pics.js

/*	This page does all the magic for applying
 *	Ajax principles to a lora index page.
 */
 
var elementName;

// Function that starts the Ajax process:
function showLora(str, url) {
 
 	elementName = str;

	// Confirm that the object is usable:
	if (ajax) { 
		
		// Call the PHP script.
		// Use the GET method.
		// Pass the image, movie and id name in the URL.
		ajax.open('get', url);
		
		// Function that handles the response:
		ajax.onreadystatechange = handle_check;
		
		// Send the request:
		ajax.send(null);

	} else { // Can't use Ajax!
		document.getElementById(elementName).innerHTML = 'Your browser does not support AJAX!';
	}
	
} // End of check_username() function.

// Function that handles the response from the PHP script:
function handle_check() {

	// If everything's OK:
	if ( (ajax.readyState == 4) && (ajax.status == 200) ) {

		// Assign the returned value to a document element:
		document.getElementById(elementName).innerHTML = ajax.responseText;
		
	}
	
} // End of handle_check() function.
