function installFirefoxSearch()
{
	 window.sidebar.addSearchEngine(
		 'http://www.sharenova.com/js/firefox.src',
		 'http://www.sharenova.com/images/favicon.png',
		 'ShareNova Torrent Search',
		 'Reference'
	 );
}

$(document).ready(function(){
	
    jQuery('#new_videos').jcarousel({
        // Configuration goes here
    });

	$("#toggleRecommend").click(function () {
		$("#recommend").toggle();
		$("#playlists").hide();
	});
	
	$("#toggleComments").click(function () {
		$("#addComment").toggle();
	});
	
	$("#togglePlaylists").click(function () {
		$("#playlists").toggle();
		$("#recommend").hide();
	});
	
	$("#reportProblem").click(function () {
		
		$("#playlists").hide();
		$("#recommend").hide();
		
		var obj = $(this);
		var entry_id = $(this).attr('rel');
		
		$.ajax({
			type: 'GET',
			url: '/videos/problem/entry_id/' + entry_id,
			success: function(){
				$("#reportProblemSuccess").toggle();
   			}
		});
		
	});
	
	$("#addToFavorites").click(function () {
		
		$("#playlists").hide();
		$("#recommend").hide();
		
		var obj = $(this);
		var entry_id = $(this).attr('rel');
		
		$.ajax({
			type: 'GET',
			url: '/favorites/add/entry_id/' + entry_id,
			success: function(){
				$("#addToFavoritesSuccess").toggle();
   			}
		});
		
	});
	
	$(".reportSpam").click(function () {
		var obj = $(this);
		var comment_id = $(this).attr('rel');
		$.ajax({
			type: 'GET',
			url: '/comments/spam/comment_id/' + comment_id
		});
	});
	
	$(".votePositive").click(function () {
		var obj = $(this);
		var comment_id = $(this).attr('rel');
		$.ajax({
			type: 'GET',
			url: '/comments/vote/type/positive/comment_id/' + comment_id
		});
	});
	
	$(".voteNegative").click(function () {
		var obj = $(this);
		var comment_id = $(this).attr('rel');
		$.ajax({
			type: 'GET',
			url: '/comments/vote/type/negative/comment_id/' + comment_id,
//			data: 'comment_id=' + escape(comment_id),
			dataType: 'xml',
			success: function(msg){
				alert( "Data Saved: " + msg );
   			}
		});
	});
	
});