function genTestimonial(programName,body,senderName,company){
	var res=new String();
	res+='<a href="/testimonials/"><img src="/_img/b_8.gif" alt="See all Testimonials" /></a> ';
    res+='<a href="/testimonials/addTestimonial/index.htm"><img style="float:right; margin-right:5px" width="24px" height="24px" src="/_img/plus2.png" title="Submit your testimonial about Atomic software"></a>';	
	res+='<p><font color="#0000FF"><b><font color="#0000CC">'+programName+'</font></b></font></p><p>';//date
    res+= body;
	res+='<font color="#666666"> '+senderName;
	if(company) res+='|'+company;
	res+='</font></p><p><span><a href="/testimonials/">SEE ALL &gt;&gt;</a></span> </p>';
	return res;
}

function getRandomTesti(){
	jQuery.post('/testimonials/controller/Testimonials.php', {
        'action': "getRandomTestimonial"
    }, function(data){
        if(data.result){
			jQuery.each(data.testimonials_list,function(index,value){
					jQuery.each(value,function(indexI,valueI){
					jQuery('#rndTesti').html(genTestimonial(index,valueI.en,valueI.name,valueI.company));
					});
				}
			);
        
		  // j('#itestiTab').show();
        }
    }, "json");
}
jQuery(function(){
		getRandomTesti();
});


