﻿
$(document).ready(function () {
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(assignFeaturedBookHovers)
	assignFeaturedBookHovers();
});

function assignFeaturedBookHovers() {
    $("A[name^='featuredBook']").each(function () {
        var featuredBookID = $(this).attr("name").toString().split("-")[1];
        $(this).cluetip(
				{
				    arrows: true,
				    showTitle: false,
				    ajaxCache: true,
				    clickThrough: true,
				    ajaxSettings: {
				        type: "POST",
				        data: "{'featuredBookID':'" + featuredBookID + "'}",
				        contentType: "application/json; charset=utf-8",
				        dataType: "json"
				    },
				    ajaxProcess: function (data) {
				        return data.d;
				    }
				});
    });
}
