﻿///<reference path="../yui/yahoo/yahoo.js" />
///<reference path="../yui/dom/dom.js" />
///<reference path="../yui/event/event.js" />

(function() {

    //Local references to YUI
    var _DOM = YAHOO.util.Dom,
        _EVENT = YAHOO.util.Event;

    _EVENT.onDOMReady(function() {
        _DOM.removeClass("rotateImage", "hidden");

        _EVENT.on("rotateImage", "click", function(ev) {
            _DOM.removeClass("flash360Panel", "hidden");
            BBE.flash360Panel = new YAHOO.widget.Panel(
                "flash360Panel", {
                    width: "520px",
                    visible: false,
                    constraintoviewport: true,
                    fixedcenter: true
                });

            BBE.flash360Panel.hideEvent.subscribe(function() {
                _DOM.addClass("flash360Panel", "hidden");
            });

            BBE.flash360Panel.render(document.body);
            BBE.flash360Panel.show();
            BBE.flash360Panel.cfg.setProperty("fixedcenter", false);

            BBE.trackPageEvent("Item Webrotate", "View-Rotate", BBE.product.name);
        });

        if (BBE_BoxImage !== "NA") {
            _DOM.removeClass("boxImage", "hidden");

            _EVENT.on("boxImage", "click", function(ev) {
                _DOM.removeClass("boxImagePanel", "hidden");
                BBE.boxImagePanel = new YAHOO.widget.Panel(
                "boxImagePanel", {
                    width: "520px",
                    visible: false,
                    constraintoviewport: true,
                    fixedcenter: true
                });
                BBE.boxImagePanel.render(document.body);
                BBE.boxImagePanel.show();
                BBE.boxImagePanel.cfg.setProperty("fixedcenter", false);

                BBE.trackPageEvent("Item View Case", "View-Case", BBE.product.name);
            });
        }
    });

})();
  