boxes = new Array();
var currBox;
function hideAll(currItem) {

    $("div#P").hide();
    $("div#O").hide();
    $("div#B").hide();
    $("div#G").hide();
    $("div#C").hide();

    switch (currItem) {

        case 'P':
            $("div#P").show();
            break;
        case 'O':
            $("div#O").show();
            break;
        case 'B':
            $("div#B").show();
            break;
        case 'G':
            $("div#G").show();
            break;
        case 'C':
            $("div#C").show();
            break;
        default:
            $("div#P").show();

    }
}
$(document).ready(function() {


    // CHANGE THE WIDTH OF THE MODAL WINDOWS HERE
    // THIS IS FOR THE WEB MD SITE
    $(".modalWindow").colorbox({ width: "1080", height: "100%", iframe: true });
    // THIS IS FOR THE QUOTE REQUEST  FORMS
    $(".modalForms").colorbox({ width: "550", height: "100%", iframe: true });
    $('div.banner').each(function() {
        var id = $(this).attr('id').replace(/_hidden/, '');
        var pos = $("#" + id).offset();

        if (pos) {
            // Show the banner directly over the placeholder
            $(this).css(
        {
            "left": pos.left + "px",
            "top": pos.top + "px"
        });
            $("#" + id).height($(this).height() + 5);
            $("#" + id).width($(this).width());
        }
    });

    // Repositioning the ads divs
    $(window).resize(function() {
        $('div.banner').each(function() {
            var id = $(this).attr('id').replace(/_hidden/, '');
            var pos = $("#" + id).offset();

            if (pos) {
                // Show the banner directly over the placeholder
                $(this).css(
          {
              "left": pos.left + "px",
              "top": pos.top + "px"
          });
            }
        });
    });
    $("div#P").show();
});

