var curBG = 1;
var posBtn = 0;
var posDiv = 0;
var posBtnOn = -45;
var blank = new Image();
var badBrowser = (/MSIE ((5\.5)|6)/.test(navigator.userAgent) && navigator.platform == "Win32");
var windowStatus = 0; //status of the size of the window.  0 = standard, 1 = suboptimal, 2 = minimum
paperDesc = new Array();
paperDesc[0] = "From&nbsp;the&nbsp;<br>delight&nbsp;digital&nbsp;<br>power&nbsp;palette&nbsp;kit&nbsp;";
paperDesc[1] = $('<img />').attr('src', '/sitecollectionimages/Bkgd_paper_info_icon.gif').attr('alt', 'From the delight digital power palette kit').attr('title', 'From the delight digital power palette kit');

blank.src = '/SiteCollectionImages/blank.gif';

function fixPng(png) {
		// get src
		var src = png.src;
		// set width and height
		if (!png.style.width) { png.style.width = $(png).width(); }
		if (!png.style.height) { png.style.height = $(png).height(); }
		// replace by blank image
		png.onload = function() { };
		png.src = blank.src;
		// set filter (display original image)
		png.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
}

$(document).ready(function() {
    preloadImages = new Array();
    preloadImages[0] = $('<img />').attr('src', '/SiteCollectionImages/hotspot_on.gif');
    preloadImages[1] = $('<img />').attr('src', '/SiteCollectionImages/hotspot_off.gif');
    preloadImages[2] = $('<img />').attr('src', '/SiteCollectionImages/left1.gif');
    preloadImages[3] = $('<img />').attr('src', '/SiteCollectionImages/left2.gif');
    preloadImages[4] = $('<img />').attr('src', '/SiteCollectionImages/left3.gif');
    preloadImages[5] = $('<img />').attr('src', '/SiteCollectionImages/left4.gif');
    preloadImages[6] = $('<img />').attr('src', '/SiteCollectionImages/right1.gif');
    preloadImages[7] = $('<img />').attr('src', '/SiteCollectionImages/right2.gif');
    preloadImages[8] = $('<img />').attr('src', '/SiteCollectionImages/right3.gif');
    preloadImages[9] = $('<img />').attr('src', '/SiteCollectionImages/right4.gif');
    preloadImages[10] = $('<img />').attr('src', '/SiteCollectionImages/1_bkgd_tile.jpg');
    preloadImages[11] = $('<img />').attr('src', '/SiteCollectionImages/2_bkgd_tile.jpg');
    preloadImages[12] = $('<img />').attr('src', '/SiteCollectionImages/3_bkgd_tile.jpg');

    if ((window.location + "").match(/(shophome|default).aspx/i)) {
        $('#CenterPane').css('border-left', '0px');
    }

    if ($('#zz2_SiteActionsMenu_t').length > 0) {
        $('.ms-globalbreadcrumb').css('display', 'block');
    } else {
        $('.ms-globalbreadcrumb').css('display', 'none');
    }

    var bgcolor = new Array("#FFF", "#b7d193", "#c89c81", "#ffeaa1", "#c8dde6");

    $("#shop").hover(
		function() {
            $("#shopMenu").show();
            var max = 0;
            var menus = $('#shopMenu .menuinner .col1 .col1style');
            var i;
            for (i = 0; i < menus.length; i++) {
                if ($(menus[i]).height() > max) {
                    max = $(menus[i]).height();
                }
            }
            menus.height(max);
		},
		function() {
		    $("#shopMenu").hide();
		}
	);
    $("#shopMenu").hover(
		function() {
		    $("#shopMenu").show();
		    $("#shop").attr("src", $("#shop").attr("src").replace("_off", "_on"));
		},
		function() {
		    $("#shopMenu").hide();
		    $("#shop").attr("src", $("#shop").attr("src").replace("_on", "_off"));
		}
	);
});