jQuery(document).ready(function(){
								
	var iratingprefix = "irating" ;		
	var rating_avg = "blog_rating_avg" ;
	
	jQuery(".blog-rating img").mouseover(function () {
		count=document.getElementById(this.id).title;
		for(x=0;x<=count;x++)	
		{
			jQuery("#"+iratingprefix+x).attr("src","http://interaktco.com/blog/wp-content/plugins/blog-rating/images/icon_rating_On.png");
		}
	});
	jQuery(".blog-rating img").mouseout(function () {
		count=document.getElementById(this.id).title;
		for(x=0;x<=count;x++)	
		{
			jQuery("#"+iratingprefix+x).attr("src","http://interaktco.com/blog/wp-content/plugins/blog-rating/images/icon_rating_Off.png");
		}												  
	});	
	jQuery(".blog-rating img").click(function () {
		count=document.getElementById(this.id).title;
		bid=document.getElementById("blog_rating_id").title;
		document.getElementById("blog-rating").className="fLeft disBlock";
		chBlogRated(count,"blog-rating",bid);
		jxProcess(bid,count,rating_avg);
	});	
});										  

function chBlogRated(rate,conBlock,blogId)
{	
	$.ajax({
	  type: "GET",		   	
	  url: "http://interaktco.com/blog/wp-content/plugins/blog-rating/blog-rating_rated.php",
	  data: "rating="+rate+"&id="+blogId,
	  cache: false,
	  success: function(html){
		 if(html.length>0)
		 {
			document.getElementById(conBlock).innerHTML = html ;
		 }
	  }
	});
}
function jxProcess(id,rate,conBlock)
{	
	$.ajax({
	  type: "GET",		   	
	  url: "http://interaktco.com/blog/wp-content/plugins/blog-rating/blog-rating_add.php",
	  data: "rating="+rate+"&id="+id,
	  cache: false,
	  success: function(html){
		 if(html.length>0)
		 {
			document.getElementById(conBlock).innerHTML = html ;
		 }
	  }
	});
}
