/**
 *Handle the universe popup on the client pages
 */

function Page_PageHeader_Universe(){
  this.initialise_flash = false;
}

Page_PageHeader_Universe.prototype.flash = function(){
  
  if( !this.initialise_flash ){
    
    dojo.byId('Page_PageHeader_Universe_Dialog_Flash').style.width  =  '800px';
    dojo.byId('Page_PageHeader_Universe_Dialog_Flash').style.height =  '550px';
    
    swfobject.embedSWF(  CapsoolGlobalVariables.AppBase + '/../SecondParty/universe/version2.swf',
                         "Page_PageHeader_Universe_Dialog_Flash",
                         800,
                         550,
                         "8.0.0",
                         CapsoolGlobalVariables.AppBase + "/../ThirdParty/js/swfobject/expressInstall.swf",
                         {
                          
                         },
                         {   "allowFullScreen": "true",
		                       "allowScriptAccess": "sameDomain",
                                       "scale": "noscale",
                                       "wmode": "window"
                         }
                       );
    
    this.initialise_flash = true;
  }
};

Page_PageHeader_Universe.prototype.show = function( /*Event*/ evnt ){
  
  dojo.stopEvent(evnt);
  dijit.byId('Page_PageHeader_Universe_Dialog').show();
  
  var dijitDialogPaneContent = dojo.query( 'div.dijitDialogPaneContent', dojo.byId('Page_PageHeader_Universe_Dialog') );
  
  dijitDialogPaneContent = dijitDialogPaneContent[0];
  dijitDialogPaneContent.style.width  = '800px';
  dijitDialogPaneContent.style.height = '550px'; 
  
  this.flash();
};
 
dojo.addOnLoad(
  function(){
    
    //Set up the static variable
    Page_PageHeader_Universe.instance = new Page_PageHeader_Universe();
    
    //Wire up the event handler
    dojo.connect( dojo.byId('Page_PageHeader_Universe'),
                  'onclick',
                  dojo.hitch( Page_PageHeader_Universe.instance, 'show' )
                 );
  }
);
