// Testimonial Randomizer

/*jQuery.jQueryRandom = 0;  
jQuery.extend(jQuery.expr[":"],  
{  
	random: function(a, i, m, r) {  
		if (i == 0) {  
			jQuery.jQueryRandom = Math.floor(Math.random() * r.length);  
		};  
		return i == jQuery.jQueryRandom;  
	}  
});*/

// Testimonial XML Repeater
$.ajax({
	type: "GET",
	url: "testimonials.xml",
	dataType: "xml",
	error: function(xhr, ajaxOptions, thrownError){alert("Massive Error/Screwup!!!!");alert(xhr.status);alert(thrownError);},
	success: function(xml) {
		$(xml).find('testimonial:random').each(function(){
			var text = $(this).find('text').text()
			var name = $(this).find('name').text()
			var hometown = $(this).find('hometown').text()
			$("div.testimonial").append('<div><div class="quote">&ldquo;'+text+'&rdquo;</div> <div class="clr"></div> <div class="name">'+name+'</div> <div class="clr"></div> <div class="hometown">'+hometown+'</div> <div class="clr"></div>');
		});  //close each
	} // close success: function(xml)
});

$(document).ready(function(){
});