﻿if (!window.ArtsAndArchitecture)
    window.ArtsAndArchitecture = {};
    
ArtsAndArchitecture.PanelAttract = function(control, target, x, y)
{
    this.control = control;
    this.target = target;
    
    this._panelAttractButtonBegin = this.target.findName("PanelAttractButtonBegin");
    this._panelAttractButtonBegin.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.handleMouseEnter_PanelAttractButtonBegin));    
    this._panelAttractButtonBegin.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.handleMouseLeave_PanelAttractButtonBegin));    
    this._panelAttractButtonBegin.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.handleMouseLeftButtonDown_PanelAttractButtonBegin));
    
    this._storyboardSlideIn = this.target.findName("SlideIn");
    this._storyboardSlideOut = this.target.findName("SlideOut");
    
    this._panelAttractClickShield = this.target.findName("PanelAttractClickShield");
    this._panelAttractKioskDescription = this.target.findname("PanelAttractKioskDescription");
    
   // this._panelAttractKioskDescription.setFontSource(AAFonts);
   // this._panelAttractKioskDescription["FontFamily"] = "LOC_WM_LEAD_IN";
        
    this.target["Canvas.Top"] = y;
    this.target["Canvas.Left"] = x;
}

ArtsAndArchitecture.PanelAttract.prototype = 
{
    slideIn: function()
    {
       this._panelAttractClickShield.Visibility = "Visible";
       this._storyboardSlideIn.Begin();
    },
    
    slideOut: function()
    {
        this._panelAttractClickShield.Visibility = "Collapsed";
        this._storyboardSlideOut.Begin();
    },
    
    handleMouseLeftButtonDown_PanelAttractButtonBegin: function(sender, args)
    {
		AAViewSelect.selectEast();

        this._panelAttractButtonBegin.source = "Content/attract/button_lt_begin_u.png";
        this.slideOut();
        AAMainView.stopAttractMode();
        AAMainView.tweenToStart();
       // AAMainView.showHotSpots();
        AANavBar.slideIn();
        AAViewSelect.slideButtonsIn();
    },
    
    handleMouseEnter_PanelAttractButtonBegin: function(sender, args)
    {
        this._panelAttractButtonBegin.source = "Content/attract/button_lt_begin_d.png";
    },
    
    handleMouseLeave_PanelAttractButtonBegin: function(sender, args)
    {
        this._panelAttractButtonBegin.source = "Content/attract/button_lt_begin_u.png";
    }

}