var	pageno = 1;
	genres = {
	init : function(){
		genre = $(".ident").attr("id");
		if (genre == "Fantasy") {
			$(".genretitle").text("SciFi & Fantasy");
		} else if (genre == "Specials") {
			$(".genretitle").text("Specials & Documentations");
		} else {
			$(".genretitle").text($(".ident").attr("id"));
		}
		$(".more-wrapper a").bind("click",function(){
			genres.load();
		});
		genres.load();
	},
	load : function(){
		pageno++;
		$("#genre-overlay").show();
		$.ajax({
	         type: "GET",
	         url: '/listinggenre?genre='+genre+'&page='+pageno,
	         dataType: "html",
	         success: function(html) {
				$("#genre-listing").html($(html).find(".view-content").html());
				genres.format();
	    	}
        });
	},
	format : function(){
		$("#genre-content .views-row").each(function(){
			$(this).addClass("genre"+$(this).find(".views-field-field-genre-value-1 span").text());
			/*if ($(this).find(".views-field-field-imagelink-url span").text().substring(0,4) === "http") {
				$(this).children(".views-field-field-synopsis-value").prepend('<img src="'+$(this).find(".views-field-field-imagelink-url span").text()+'"/>').append('<div style="clear:both;"></div>');
			}*/
		});
		$("#genre-overlay").hide();
		$(".more-wrapper a").show();
	}
};
