var framing = window.framing = function($) {

    function loadFramedPrice(productid, frameid, siteid) {
        $.ajax({
            type: "get",
            url: "get_framed_price.aspx?productid=" + productid + "&frameid=" + frameid + "&siteid=" + siteid,
            success: function(xml) {
                var x = $(xml);

                if (x.find("frameID").text() == 0) {
                    $("span.price-label").text("Price");
                } else {
                    $("span.price-label").text("Total Price");
                }
                if (x.find("originalprice").length > 0) {
                    $("span.originalPrice").html("Was " + x.find("originalprice").text());
                    $("span.salePrice").html("Now " + x.find("price").text());
                } else {
                    $("span.price").html(x.find("price").text());
                }
            }
        });
    }

    return {
        "getFramedPrice": loadFramedPrice
    };


} (jQuery);

