  
function formatGiftLink(string) {
	  	if (string.length > 0 ) {
				return '<div class="testimonialsLinks"><a href="/shop/'+string+'">View recommended gift</a></div>'
				//return '<div class="testimonialsLinks"><a href="/shop/'+string+'">View recommended gift</a> | <a href="/shop/'+string+'#product-reviews">Write a review</a></div>'
			} else return '';
		}  
function formatPhoto(string) {
	  	if (string.length > 0 ) {
				return string
			} else return '/shop/content/unwrapped/images/testimonial_archie.gif';
		}  		

function GetTestimonial(criteria,corners) {

	$j(document).ready(function () {
		$j('#testimonialsContent').jParse({
			ajaxOpts: {url: '/shop/content/unwrapped/2010_testimonials.xml'},
			elementTag: ['text', 'name', {elem:'photo',format:formatPhoto},{elem:'giftLink',format:formatGiftLink},{elem:'category',include:criteria}],
			output: '<div class="cf"><div class="testimonialPhoto"><img src="jpet02" alt="" width="100" height="100" class="rcimg"/></div><blockquote><p>jpet00<br/><strong>jpet01</strong></p></blockquote>jpet03</div>',
			parentElement: 'item',
			finish: showTestimonial(corners)
		});
	});
}

function GetHubTestimonial(criteria) {

	$j(document).ready(function () {
		$j('#testimonialsContent').jParse({
			ajaxOpts: {url: '/shop/content/unwrapped/2010_testimonials.xml'},
			elementTag: ['text', 'name', {elem:'photo',format:formatPhoto},{elem:'giftLink',format:formatGiftLink},{elem:'category',include:criteria}],
			output: '<div class="cf"><p>&quot;jpet00&quot;<br/><strong>jpet01</strong></p>jpet03</div><div class="testimonialPhoto"><img src="jpet02" alt="" width="100" height="100" class="rcimg"/></div>',
			parentElement: 'item',
			finish: showTestimonial(false)
		});
	});
}
   
function showTestimonial(corners) {
	if (corners == false) {
		$j('#ttl_testimonials h3').uncorner()
		$j('#testimonialsContent').uncorner()
	}
	$j('#testimonialContainer').fadeIn("fast");
}

