﻿    this.tooltip = function () {
        /* CONFIG */
        xOffset = -10;
        yOffset = 2;
        // these 2 variable determine popup's distance from the cursor
        // you might want to adjust to get the right result		
        /* END CONFIG */
        $("#cartsummary").hover(function (e) {
            var pos = $("#cartsummary").offset();
            var width = $("#cartsummary").width();
            var height = $("#cartsummary").height();
            var viewerwidth = $("#quickcartview").width();
            var widthdif = viewerwidth - width;
            //alert(widthdif);

            $("#quickcartview")
			.css("top", (pos.top + height + yOffset) + "px")
			.css("left", (pos.left - widthdif + xOffset) + "px")
			.fadeIn("300");
        },
	function () {
	    $("#quickcartview").hide();
	});
    };



    // starting the script on page load
    $(document).ready(function () {
        tooltip();
    });

