// Function that starts the Ajax process:
function check_input(input) {
	// Confirm that the object is usable:
	if (ajax) { 
		ajax.open('get', 'journal_finder.php?journal_finder=' + encodeURIComponent(input));		
		// Function that handles the response:
		ajax.onreadystatechange = handle_check;		
		// Send the request:
		ajax.send(null);
	} else { // Can't use Ajax!
		document.getElementById('insert_input').innerHTML = 'This functionality is unavailable on your browser';
	}	
} 

// 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('insert_input').innerHTML = ajax.responseText;		
	}	
} 
