$(function() {
	$('.menuItem').hover( function(){
		 $(this).addClass('hoverRow');
	},
	function(){
		 $(this).removeClass('hoverRow');
	});
	
	$(".episodeRow").hover( function(){
		 $(this).addClass('hoverRow');
	},
	function(){
		 $(this).removeClass('hoverRow');
	});
	
	$('.episodeList').hover( function(){
		$(this).css('z-index','100');
		$(this).css('height','auto');
	},
	function(){ 
		 $(this).css('height','120px');
		 $(this).css('z-index','auto');
	});

	
	
	$('table tbody tr').hover( function(){
		 $(this).addClass('hoverRow');
	},
	function(){
		 $(this).removeClass('hoverRow');
	});
	
});

		var pollsL10n = {
			ajax_url: "/blog/wp-content/plugins/wp-polls/wp-polls.php",
			text_wait: "Your last request is still being processed. Please wait a while ...",
			text_valid: "Please choose a valid poll answer.",
			text_multiple: "Maximum number of choices allowed: ",
			show_loading: "1",
			show_fading: "1"
		};
		
	

function seenEpisode(id,ratio)
{

$.php("/classes/AjaxController.php",{funct:'seenEpisode',
					id: id,
					ratio:ratio,
					}
 );
	//fbEpisode(id,ratio);
	return false;
}

function fbEpisode(id,ratio)
{
	fbSession = FB.getAuthResponse();
	$.php("/classes/AjaxController.php",{funct:'fbEpisode',
					id: id,
					ratio:ratio,
					fbSession: fbSession
					}
 );
 return false;
}

function fbSeries(id)
{
		$.ajax(
		{ 
			url:"/classes/AjaxController.php",
			type: "POST",
			data: 'funct=getSeriesInfo&id='+id,
			success: function(msg){
				 FB.ui(				   
					 JSON.parse(msg)
				   ,
				   function(response) {
					 
				   }
				 );
			}
		}
 );
}

function seenSeason(id,ratio)
{
$.php("/classes/AjaxController.php",{funct:'seenSeason',
					id: id,
					ratio:ratio}
 );
}

function rateSeries(id,ratings)
{
$.php("/classes/AjaxController.php",{funct:'rateSeries',
					seriesId: id,
					rating: ratings}
 );
}

function rateEpisode(id,ratings)
{
$.php("/classes/AjaxController.php",{funct:'rateEpisode',
					episodeId: id,
					rating: ratings}
 );
}

function showDescriptionBox(type,id,username)
{
	$('#descriptionLink').remove();
	$('#descriptionEditor').html('<form onsubmit="sendDescription(); return false;" id="descriptionForm"><textarea class="idc-text_noresize" name="description" style="width:500px;height:200px"></textarea><input type="hidden" name="type" value="'+type+'"><input type="hidden" name="username" value="'+username+'"><input type="hidden" name="id" value="'+id+'"><input type="submit" value="Send this recap"></form>');
}

function sendDescription()
{
	var values = {};
	$.each($('#descriptionForm').serializeArray(), function(i, field) {
		values[field.name] = field.value;
	});
	
	$.php("/classes/AjaxController.php",{funct:'sendDescription',
					description: values}
 );
}

function addToMySeries(id)
{

$.php("/classes/AjaxController.php",{funct:'addToMySeries',
					seriesId: id}
 );
}

function removeFromMySeries(id)
{
$.php("/classes/AjaxController.php",{funct:'removeFromMySeries',
					seriesId: id}
 );
}

function hideTwitterOverlay()
{
$('.twitterOverlay').css('display','none');
}

function updateTweetCounter()
{
	var objVal= document.getElementById('twitterBox').value;
	objVal=objVal.substring(0,1000);
	$('#twitterCount').html(139 -objVal.length);
	
}

function tweet()
{
	$.php("/classes/AjaxController.php",{funct:'twitter',
					message:  document.getElementById('twitterBox').value}
	);
}
<!--start wp_likes
/* 
 *author:Aakash Bapna(http://aakash.me)
 */

if(typeof jQuery=="undefined"){
	
	var ele=document.createElement("script");
	ele.type="text/javascript";
	ele.src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js";
	document.getElementsByTagName("head")[0].appendChild(ele);
	var interval = setInterval(function() {
      if (typeof jQuery != 'undefined') {
        clearInterval(interval);
        jQuery.noConflict();//prototype and other lib compatability fix.
      }
    }, 50);
	
	
	}
	
	var wp_likes={};
	wp_likes.endpoint="http://www.trackmyeps.com/blog/wp-content/plugins/wp-likes/endpoint.php";
	wp_likes.method="like";
	wp_likes.didPrevFinish=true;
	wp_likes.makeCall=function(post_id,callback,isUnlike){
		if(!this.didPrevFinish)return false;
		if(isUnlike==true)this.method="unlike"; else this.method="like";
		params={};
		params["method"]=this.method;
		params["post_id"]=post_id;
		jQuery.ajax({
			type:"GET",
			url:this.endpoint,
			data:params,
			beforeSend:function(){
			this.didPrevFinish=false;	
			},
			success:function(response){
				if(response.success==true){
					callback(response);
									
				}
				else {
					//error in call
					wp_likes.log("unsuccessfull request, response from server:"+ response)
					
				}
				
			},
			error:function (xhr, ajaxOptions, thrownError){
                wp_likes.log('error in AJAX request.');
				wp_likes.log('xhrObj:'+xhr);
				wp_likes.log('thrownError:'+thrownError);
				wp_likes.log('ajaxOptions:'+ajaxOptions);
                                                },
			complete:function(){
					this.didPrevFinish=true;
			},
			dataType:"json",
			cache:false
			
		})
		
	}
	wp_likes.like=function(post_id){
		wp_likes.log("like click for post- "+post_id);
		jQuery("#wp_likes_post-"+post_id+" a.like").fadeTo("slow",.2);
		this.makeCall(post_id,function(response){
			var postDom=jQuery(document.getElementById("wp_likes_post-"+post_id));
			postDom.children("span.text").html(response.likeText);
			var thumbImg=postDom.children("a.like").children("img");
			postDom.children("a.like").attr('title',"").removeAttr('href').text("").addClass("liked").removeClass("like");
			thumbImg.appendTo(postDom.children("a.liked").eq(0));
			postDom.children("a.liked").fadeTo("slow",.80);
			postDom.children("div.unlike").show("fast")	
	
		},false);
		
	}
    wp_likes.unlike=function(post_id){
	wp_likes.log("unlike click for post- "+post_id);
	jQuery("#wp_likes_post-"+post_id+" a.liked").fadeTo("slow",.2);
	this.makeCall(post_id,function(response){
		
		var postDom=jQuery(document.getElementById("wp_likes_post-"+post_id));
		postDom.children("span.text").html(response.likeText);
		postDom.children("a.liked").attr("href","javascript:wp_likes.like("+post_id+")").addClass("like").removeClass("liked").fadeTo("slow",.95);
		postDom.children("div.unlike").hide("fast")
			
	},true)
	
	
}
	wp_likes.log=function(obj){
		if(typeof console !="undefined")console.log(obj);
	}
// -->
