/*
Central manager class handling all siteguide operations
*/

var SiteGuideManager = Class.create();

SiteGuideManager.prototype =
{
    // Constructor
    initialize : function()
    {       
        // Get the siteguide container
        this.siteGuideLayer = $('flash_player_area');
        
        this.player;
        
        this.init();
    },
    
    init : function()
    {
        // Check if the siteGuideLayer div element is present
        if(this.siteGuideLayer != null)
        {
            // Declare variable holding the flash player filename
            if ( DetectFlashVer(9,0,00) ) 
            {
            	this.player = new FlashMoviePlayer(this.siteGuideLayer, null, 560, -11);
            	this.player.getHtmlElem().style.zIndex = 300;
            }
            else
            {   
                var anchor = Builder.node('a', { id: 'adobeFlashPluginAnchor', href: 'http://www.adobe.com/de/products/flashplayer/', target: '_blank'});
		        $('noflash_container').appendChild(anchor);
                var img = new WebImage('a66adb17-0acd-44a9-b9ad-ad93fe54a022', 'adobeFlashPluginAnchor'); 
                img.Show();         
                
            }
        }
    },
    
    MoveBy : function(x, y)
    {
        var playerId = this.player.getId();
    	var elem = $(playerId);
    	if(elem != null)
    	{
    	    new Effect.MoveBy(elem, y, x, { duration: 2.0 });
    	}
    },
    
    MoveTo : function(x, y)
    {
    	var playerId = this.player.getId();
    	var elem = $(playerId);
    	if(elem != null)
    	{    	    
    	    //new Effect.Morph(elem, { duration: 2.0, style: 'margin-top:' + y + 'px;margin-left:' + x + 'px'});      
    	    new Effect.Morph(elem, { duration: 2.0, style: 'top:' + y + 'px;left:' + x + 'px'});      
    	}
    }
}

