function initialise() {
//  initialiseMenu();
//  new Draggable('popup', {handle:'popupBanner', ghosting:false, revert:true, starteffect: function () {}, endeffect: function () {}});
}

// Popup Functions -------------------------------------------------------------------------------------------------------


function relocatePopup(popup) {
  var scrOfX = 0, scrOfY = 0;
  if (typeof(window.pageYOffset) == 'number') {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else
    if (document.body && (document.body.scrollLeft || document.body.scrollTop)) {
      //DOM compliant
      scrOfY = document.body.scrollTop;
      scrOfX = document.body.scrollLeft;
    } else
      if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
        //IE6 standards compliant mode
        scrOfY = document.documentElement.scrollTop;
        scrOfX = document.documentElement.scrollLeft;
      }

  
  var myWidth = 0, myHeight = 0;
  if (typeof(window.innerWidth) == 'number') {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else
    if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
      //IE 6+ in 'standards compliant mode'
      myWidth = document.documentElement.clientWidth;
      myHeight = document.documentElement.clientHeight;
    } else
      if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
      }
  
  var leftOffset = scrOfX + (myWidth - 800) / 2;
  var topOffset = scrOfY + (myHeight - 500) / 2;

  $(popup).style.top = topOffset + 'px';
  $(popup).style.left = leftOffset + 'px';

  $('blanket').style.top = '0px';
  $('blanket').style.left = '0px';

  $('blanket').style.width = scrOfX + myWidth - 16 + 'px';
  $('blanket').style.height = document.body.clientHeight + 'px';

}

function alertSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  window.alert( 'Width = ' + myWidth );
  window.alert( 'Height = ' + myHeight );
}

function showPopup(show) {
  if (show) {
    relocatePopup('popup');
    if ($('popup').style.display != 'block')
       Effect.Appear('blanket', {from:0.0, to: 0.6, beforeFinish: function() {
                                                        $('popup').style.display = 'block';
                                                         Effect.BlindDown('popupOuterBody', {fps: 50,duration: 0.4, transition: Effect.Transitions.sinoidal});
                                                      },
                                                      duration: 0.0
                                                      } );
  } else {
     Effect.BlindUp('popupOuterBody', {beforeFinish: function() {
                                                         $('popup').style.display = 'none';
                                                          Effect.Fade('blanket', {fps: 50,from:0.6, to: 0.0, duration:0.4});
                                                       },
                                         duration: 0.3,
                                         transition: Effect.Transitions.sinoidal
    });

  }
}

function closePopup() {
  showPopup(false);
}

function popup(url, show) {
  $('popupBody').innerHTML = '';
  if (show)
    new Ajax.Updater('popupBody', url, {onComplete: new function() {showPopup(true);}});
  else
    new Ajax.Updater('popupBody', url);

}

// Popup Functions -------------------------------------------------------------------------------------------------------
