// JavaScript Document


 jQuery(document).ready(function() {
   // do stuff when DOM is ready
	// <![CDATA[
		jQuery("a")
			.filter(".rate_1")
			
				.click(function(){
				
				   var theId=jQuery(this).attr("rel");	
              	       theId=theId.substr(2,theId.length-1);

					jQuery.get('vote.asp', {
						rate: '1',
						id: theId
					}, function(res) {
						jQuery(".ratingbox"+theId).html(res);
					});
					return false;

				})
			.end()
			.filter(".rate_2")
				.click(function(){
				
				   var theId=jQuery(this).attr("rel");	
              	       theId=theId.substr(2,theId.length-1);
				
					jQuery.get('vote.asp', {
						rate: '2',
						id: theId
					}, function(res) {
						jQuery(".ratingbox"+theId).html(res);
					});
					return false;

				})
			.end()
			.filter(".rate_3")
				.click(function(){
				
				   var theId=jQuery(this).attr("rel");	
              	       theId=theId.substr(2,theId.length-1);
				
					jQuery.get('vote.asp', {
						rate: '3',
						id: theId
					}, function(res) {
						jQuery(".ratingbox"+theId).html(res);
					});
					return false;

				})
			.end()
			.filter(".rate_4")
				.click(function(){
				
				   var theId=jQuery(this).attr("rel");	
              	       theId=theId.substr(2,theId.length-1);
				
					jQuery.get('vote.asp', {
						rate: '4',
						id: theId
					}, function(res) {
						jQuery(".ratingbox"+theId).html(res);
					});
					return false;

				})
			.end()
			.filter(".rate_5")
				.click(function(){
				
				   var theId=jQuery(this).attr("rel");	
              	       theId=theId.substr(2,theId.length-1);
				
					jQuery.get('vote.asp', {
						rate: '5',
						id: theId
					}, function(res) {
						jQuery(".ratingbox"+theId).html(res);
					});
					return false;

				})
			.end();
			
			
			
			
	// ]]>

   
 });

  function getAvatar() {
	alert('Coming soon!\n\nBut you can put your own avatar full url!');
    jQuery.getJSON('http://bin.pcpixel.com/avatars/avatars.asp', function(data) {
      jQuery('#showimage').empty();
			  jQuery.each(data, function(entryIndex, entry) {
				var html = '<div class="entry">';
				html += '<h3 class="term">' + entry['nom'] + '</h3>';
				html += '<div class="part">' + entry['email'] + '</div>';
				html += '<div class="definition">';
				html += entry['idclient'];
/*				if (entry['nom']) {
				  html += '<div class="quote">';
				  $.each(entry['nom'], function(lineIndex, line) {
					html += '<div class="quote-line">' + line + '</div>';
				  });
				  if (entry['email']) {
					html += '<div class="quote-author">' + entry['email'] + '</div>';
				  }
				  html += '</div>';
				}
*/				html += '</div>';
				html += '</div>';
				$('#showimage').append(html);
			  });
    });
  };
			
			
			
