/*
	ACT PHP Syntax Highlighter
	http://www.actwebdeigns.co.uk
	Luke Snowden
	2011
	
	$('pre').syntax({ 'url' : './syntax.php' });
*/
(function($){
    $.fn.syntax = function( options ) {
		$(this).each(function(){
			if( options.url.length != 0 ) {
				var ob = $(this);
				 $.ajax({ 
					type: 'POST', url: options.url, data: 'syntax=true&data=' + encodeURIComponent( ob.html() ), cache: false, timeout: 10000,
					error : function( html ){ alert( html ); },
					success: function(html){ ob.html( html.replace(/\t/g, '&nbsp;&nbsp;&nbsp;&nbsp;') ); }                            
				});
			}else{ alert( 'Please set the location of the PHP script.' ); }
		});
	};
})(jQuery);
