  YAHOO.namespace("myexample.fortehome");  
  
  if( navigator.userAgent.indexOf('Firefox') != -1 )
  {
    YAHOO.util.AnimMgr.delay = 30
    // alert('Browser = Firefox')
  }
 
  // YAHOO.util.Event.onDOMReady(positionHomePage); 
 
  var mainContent;
  var xCoord;
  var yCoord;
  var documentWidth;
  var documentHeight;
  var documentViewportWidth;
  var documentViewportHeight;
  var mainContentStyleWidth;
  var mainContentStyleHeight;
  var mainContentXYCoord;
  var mainContentX;
  var mainContentY;
  var windowWidth;
  var windowHeight;
  
  // positionHomePage();

  
  function positionHomePage()
  {
    mainContent = YAHOO.util.Dom.get('main_content');

    centerMainContent()

/* If still have problems with Firefox, might put a timer delay here */

/*  
  documentWidth = YAHOO.util.Dom.getDocumentWidth();
  documentHeight = YAHOO.util.Dom.getDocumentHeight();
  documentViewportWidth = YAHOO.util.Dom.getViewportWidth();
  documentViewportHeight = YAHOO.util.Dom.getViewportHeight();
  mainContentStyleWidth = YAHOO.util.Dom.getStyle(mainContent, 'width');
  mainContentStyleHeight = YAHOO.util.Dom.getStyle(mainContent, 'height');
*/
  mainContentXYCoord = YAHOO.util.Dom.getXY('main_content');
  mainContentX = mainContentXYCoord[0]
  mainContentY = mainContentXYCoord[1]

  /* These dont work on IE, but do work on Firefox (and most others) */
  /*
  var windowWidth = window.innerWidth;
  var windowHeight = window.innerHeight;
  */

  windowWidth = getBrowserInnerWidth()
  windowHeight = getBrowserInnerHeight()
/*
  if( navigator.userAgent.indexOf('Firefox') != -1 )
    alert('Browser is Firefox')
  else if( navigator.userAgent.indexOf('MSIE') != -1 )
    alert('Browser is Internet Explorer')
  else
    alert('Browser is neither Firefox or IE')
  
  alert( '(forteHome.js) positionHomePage: mainContentXY = ' + mainContentXYCoord + 
          ' mainContentX = ' + mainContentX + ' mainContentY = ' + mainContentY +
          '\ndocumentWidth = ' + documentWidth + 
          '\ndocumentHeight = ' + documentHeight + 
          '\ndocumentViewportWidth = ' + documentViewportWidth + 
          '\ndocumentViewportHeight = ' + documentViewportHeight +         
          '\nmainContentStyleWidth = ' + mainContentStyleWidth +
          '\nmainContentStyleHeight = ' + mainContentStyleHeight + 
          '\nwindowWidth = ' + windowWidth + 
          '\nwindowHeight = ' + windowHeight +
          '\nCenter xCoord = ' + xCoord + ', Center yCoord = ' + yCoord
            );
*/
  YAHOO.util.Event.onAvailable('right_header_swoosh', moveHeaderText, this) 
    // moveHeaderText();

  }

  function getBrowserInnerWidth()
  {
     var de = document.documentElement
     if( navigator.userAgent.indexOf('MSIE') == -1 )
     {
        var barwidth = de.scrollHeight > de.clientHeight ? 17 : 0
        return window.innerWidth - barwidth
     }

     return (de.clientWidth || document.body.clientWidth) + 17
  }

  function getBrowserInnerHeight()
  {
     var de = document.documentElement
     if( navigator.userAgent.indexOf('MSIE') == -1 )
     {
        var barwidth = de.scrollWidth > de.clientWidth ? 17 : 0
        return window.innerHeight - barwidth
     }

     return de.clientHeight || document.body.clientHeight
  }

  function centerMainContent()
  {
    xCoord = (Math.round((getBrowserInnerWidth() - 732) / 2)) + 'px'
    yCoord = (Math.round((getBrowserInnerHeight() - 500) / 2)) + 'px'
    
    mainContent.style.left = xCoord
    mainContent.style.top = yCoord
    mainContent.style.visibility = 'visible'
  }
    

  // A function that handles the window resize event
  var windowResizeHome = function(e) 
  {
    // alert("Window Resized!");
    
    // window.location.replace('http://127.0.0.1/315/forteHome_9.php')
    
    centerMainContent() 
    mainContentXYCoord = YAHOO.util.Dom.getXY(mainContent);
    mainContentX = mainContentXYCoord[0]
    mainContentY = mainContentXYCoord[1]
    
    // animBlurb0.attributes = blurb0Attributes;
    
    // moveBlurb0()
  }

  // Subscribe to the resize event for the window
  // YAHOO.util.Event.addListener(window, "resize", windowResize);
  YAHOO.util.Event.addListener(window, "resize", windowResizeHome);    
  // Move header in on a curve when first open page
  function moveHeaderText()
  {
    var mainContentXYCoord = YAHOO.util.Dom.getXY(mainContent);
    var mainContentX = mainContentXYCoord[0]
    var mainContentY = mainContentXYCoord[1]
                
    
    var rightHeaderText = document.getElementById('right_header_swoosh');
    var motionAttributes2 = {
      points: {
        from: [mainContentX + 521, mainContentY + 450],
        to: [mainContentX + 522, mainContentY + 18],
        control: [[mainContentX + 400, mainContentY + 350], 
                  [mainContentX + 300, mainContentY + 300], 
                  [mainContentX + 350, mainContentY + 200], 
                  [mainContentX + 500, mainContentY + 100]]
      }
    };
    var animRightHeaderText = new YAHOO.util.Motion(rightHeaderText, motionAttributes2);
    animRightHeaderText.animate();
    // animRightHeaderText.onComplete.subscribe(playMusic) 
  }

  var resizeFlag = 0
  
  // A function that handles the window resize event
  /*
  var windowResize = function(e) 
  {
    if( resizeFlag == 0 )
    {
    resizeFlag = 1
    
    var pathname = window.location.pathname
    
    var filename = pathname.substr(pathname.lastIndexOf('/') + 1)
    
    if( filename == '')
      filename = 'forteHome_9.php'
    
      
    // alert( 'location.pathname = ' + pathname + '\n' +
    //         'filename = ' + filename)
     
    // alert("Window Resized!");
    
    
    // window.location.replace(filename) 
    // window.location.reload(filename)
    }
    else
    {
      // alert( 'resizeFlag = 1' )
      resizeFlag = 0
    }
  }
  */
  
  // Subscribe to the resize event for the window
  // YAHOO.util.Event.addListener(window, "resize", windowResizeHome);
                                                                                                                                      
  /* ********************* function playMusic() ***************************** */
  // musicPlayer is defined in forteHome_9.php
/*
  function playMusic() 
  { 
    var musicPlayer = document.getElementById('music_player'); 
    musicPlayer.innerHTML = '<embed src="Bursting_Out_loop4.wav" type="audio/wav" autostart="true" loop="true" width=60 height=20 />';
  }
*/  
    
  // YAHOO.util.Event.onDOMReady(positionHomePage);
  YAHOO.util.Event.onAvailable('main_content', positionHomePage, this) 
       
