$(document).ready(function() {

    //Control clicking of 'image'
    $("#anchor_image").click(
      function () {
        $("#product_graph").css({'z-index' : '-1'});
        $("#product_more").css({'z-index' : '-1'});
        $("#product_image").css({'z-index' : '2'});
      }
    );

    //Control clicking of 'price graph'
    $("#anchor_graph").click(
      function () {
        $("#product_image").css({'z-index' : '-1'});
        $("#product_more").css({'z-index' : '-1'});
        $("#product_graph").css({'z-index' : '2'});
      }
    );

    //Control clicking of 'more details'
    $("#anchor_more").click(
      function () {
        $("#product_more").css({'z-index' : '2'});
      }
    );

    //Handle voucher help tip on product page
    $("#voucher_code_help").hover(
        function () {
            $("#vc_help_hover").slideDown('200');
        },
        function() {
            $("#vc_help_hover").slideUp('100');
        }
    );

});

function reportPricecut(url_name)
{
    $('#report_link').html('Reporting...');
    $.ajax({
        type: "GET",
        url: "/report/"+url_name+"/",
        success: function(msg) {
            $('#report_link').html('Pricecut Reported!');
            $('#report_link').attr('href', '');
            $('#report_link').attr('onclick', 'return false;');
        }
    });
}
