jQuery.noConflict();

jQuery(document).ready(
	function(){  // first inner function
	jQuery('.ajaxtrigger').click(
		function(){ // second inner function
		jQuery("#wall-data").html('<br /><br /><br /><br /><br /><p style="text-align:center;"><img src="/wp-content/plugins/tf_Wall/bigrotation2.gif"></p>');
		var dataString = 'nonce=' +jQuery("#ajax-trigger-nonce").html()+ '&user=' +jQuery("#ajax-user-id").html();
		jQuery.ajax({
			   type:  "POST",
			   url:   "/wp-admin/admin-ajax.php?action=tf_wall_show&",
			   data:  dataString,
			   success: function(xml){
				   		dummymsg(xml);
					}, // end success function
			   error: function(xml) {jQuery("#wall-data").html('Holy smokes, we have an error');}
			   });  // end .post
		
		
		
		return false;
	}  // end second inner function
	); // end click
	
	}  // end first inner function					   
) // end document ready

jQuery(document).ready(				   
	function(){  // first inner function
	jQuery("form#submit_wall").submit(
		function(){ // second inner function
		jQuery("#wall").html('<p style="text-align:center;"><img src="/wp-content/plugins/tf_Wall/bigrotation2.gif">');
		var dataString = 'message_wall='+ jQuery('#message_wall').attr('value') + '&nonce=' + jQuery('#nonce').attr('value') + '&to_uid='  + jQuery('#to_uid').attr('value') + '&from_uid=' + jQuery('#from_uid').attr('value') + '&parent=' +  jQuery('#parent').attr('value');
		jQuery.ajax({
			   type:  "POST",
			   url:   "/wp-admin/admin-ajax.php?action=tf_wall_update&",
			   data:  dataString,
			   success: function(xml){
				   		addMessages(xml);
					} // end success function
			   
			   });  // end .post
		
		
		jQuery('#message_wall').val(''); // reset the form to blank
		return false;
	}  // end second inner function
	); // end click
	
	}  // end first inner function

) // end document ready


function dummymsg(xml) {
    jQuery("#wall-data").html(xml);
}

function addMessages(xml) {   
/* if(jQuery("status",xml).text() == "0") return;   
 timestamp = jQuery("time",xml).text();   
 jQuery("message",xml).each(function(id) {   
   message = jQuery("message",xml).get(id);   
   jQuery("ul#wall").prepend("<li style=\"display: none;\">"+jQuery("author",message).text()+   
             "<\/li>: "+jQuery("text",message).text()+   
             "<br />"); 
   jQuery("ul#wall li:first").fadeIn();
 });   
*/
message = jQuery("author",xml).text() + ": " + jQuery("text",xml).text();
jQuery("#wall").html(message);
}





