/**
 * Ajax Runner
 * This script is built to run ajax requested forms, switching content with that from
 * respective PHP pages. Based on Prototype framework.  
 * 
 * @Author: Patrick Helms
 * @Date: March 11, 2010
 * @Credits: http://prototypejs.org
 */
 
function getPage(url)
{	
	// runs link with AJAX properties 
new Ajax.Request(url,
  {
    method:'get',
    onSuccess: function(transport){
      var response = transport.responseText || "no response text";
	   document.getElementById('content').innerHTML = response; 
    },
    onFailure: function(){ alert('Something went wrong...') }
  });

}


function changeElementContent(dentity, id)
{
		var url = 'index.php?id='+id+'&pages=portfolio';
				new Ajax.Request(url,
 				 {
  				  	 method:'get',
   					 onSuccess: function(transport){
     				 var response = transport.responseText || "no response text";
	 				 dentity.html(response); 
  				  },
    onFailure: function(){ alert('Something went wrong...') }
  });
}