var skinIdValue;
var pageURL=String(this.location.href);

//getSkinIdValue(pageURL);

//pre-load all the images
var dirTopPth='img/p/g/en_US/nav/';
MM_preloadImages(dirTopPth+'nav_light.gif',dirTopPth+'nav_light_over.gif',dirTopPth+'nav_light_other.gif',dirTopPth+'nav_light_over_other_high.gif',
            dirTopPth+'nav_light_mix.gif',dirTopPth+'nav_light_mix_over.gif',dirTopPth+'nav_light_mix_other.gif',dirTopPth+'nav_light_mix_over_other_high.gif',
            dirTopPth+'nav_olive.gif',dirTopPth+'nav_olive_over.gif',dirTopPth+'nav_olive_other.gif',dirTopPth+'nav_olive_over_other_high.gif',
            dirTopPth+'nav_olive_mix.gif',dirTopPth+'nav_olive_mix_over.gif',dirTopPth+'nav_olive_mix_other.gif',dirTopPth+'nav_olive_mix_over_other_high.gif',
            dirTopPth+'nav_dark.gif',dirTopPth+'nav_dark_over.gif',dirTopPth+'nav_dark_other.gif',dirTopPth+'nav_dark_over_other_high.gif',
            dirTopPth+'nav_dark_mix.gif',dirTopPth+'nav_dark_mix_over.gif',dirTopPth+'nav_dark_mix_other.gif',dirTopPth+'nav_dark_mix_over_other_high.gif',
            dirTopPth+'nav_black.gif',dirTopPth+'nav_black_over.gif');

topNavMouseOver();

function topNavMouseOver()
{
    var homeTab = document.getElementById('home');
    var buyTab = document.getElementById('buy');
    var sellTab = document.getElementById('sell');
    var transferTab = document.getElementById('transfer');
    var registerTab = document.getElementById('register');
    var loginTab = document.getElementById('sign_in');
    var aboutfsTab = document.getElementById('about_flash_seats');
    var faqTab = document.getElementById('faqs');
    var contactTab = document.getElementById('contact_us');
    var fscomTab = document.getElementById('fs_com');
    
    //Home mouse over and out
    document.getElementById('home').onmouseover = function() {
        var homeTab = document.getElementById('home');
       if (homeTab.style.display != 'block') 
        {
            //homeTab.style.background='url(img/p/g/en_US/nav/nav_light_over.gif) no-repeat right bottom'; 
            if(validTab(buyTab.href))
            {
                tabTopNavOverAndOut(homeTab,buyTab,'nav_light_over_other_high','nav_light_over'); 
            }
            else
            {
                tabTopNavOverAndOut(homeTab,buyTab,'nav_light_mix_other_grey','nav_light_mix_over_other_grey'); 
            }
        } 
    }
    
    document.getElementById('home').onmouseout = function() {
        var homeTab = document.getElementById('home');
        if (homeTab.style.display != 'block')
        {
         //homeTab.style.background='url(img/p/g/en_US/nav/nav_light.gif) no-repeat right bottom'; 
          if(validTab(buyTab.href))
          {
            tabTopNavOverAndOut(homeTab,buyTab,'nav_light_other','nav_light');
          }
          else
          {
            tabTopNavOverAndOut(homeTab,buyTab,'nav_light_mix_other_grey','nav_light_mix_other_grey');
          }
        }
    }

    //buy mouse over and out
    document.getElementById('buy').onmouseover = function() {
        if((validTab(buyTab.href)) && (buyTab.style.display != 'block'))
        {
            //buyTab.style.background='url(img/p/g/en_US/nav/nav_light_over.gif) no-repeat right bottom'; 
            tabTopNavOverAndOut(buyTab,sellTab,'nav_light_over_other_high','nav_light_over'); 
            tabTopNavOverAndOut(homeTab,homeTab,'nav_light_over_other_high','nav_light_other');
        }
        //if(!(validTab(buyTab.href))) buyTab.style.background = 'url(img/p/g/en_US/nav/nav_grey_mix_from_other.gif) no-repeat right bottom';  
    }
    
    document.getElementById('buy').onmouseout = function() {
        if ((validTab(buyTab.href)) && (buyTab.style.display != 'block'))
        {
            //buyTab.style.background='url(img/p/g/en_US/nav/nav_light.gif) no-repeat right bottom';
            tabTopNavOverAndOut(buyTab,sellTab,'nav_light_other','nav_light'); 
            tabTopNavOverAndOut(homeTab,homeTab,'nav_light_over','nav_light');
        }
        //if (!(validTab(buyTab.href))) buyTab.style.background = 'url(img/p/g/en_US/nav/nav_grey_mix_from_other.gif) no-repeat right bottom';  
    }

    //sell mouse over and out
    document.getElementById('sell').onmouseover = function() {
        if((validTab(sellTab.href)) && (sellTab.style.display != 'block'))
        {
              tabTopNavOverAndOut(sellTab,transferTab,'nav_light_over_other_high','nav_light_over'); 
              tabTopNavOverAndOut(buyTab,buyTab,'nav_light_over_other_high','nav_light_other');
        }
    }
    
    document.getElementById('sell').onmouseout = function() {
        if((validTab(sellTab.href)) && (sellTab.style.display != 'block'))
        {
            tabTopNavOverAndOut(sellTab,transferTab,'nav_light_other','nav_light'); 
            tabTopNavOverAndOut(buyTab,buyTab,'nav_light_over','nav_light');
        }
    }
    
    //transfer mouse over and out
    document.getElementById('transfer').onmouseover = function() {
        if (transferTab.style.display != 'block')
        {
            tabTopNavOverAndOut(transferTab,registerTab,'nav_light_mix_over_other_high','nav_light_mix_over'); 
            //transferTab.style.background='url(img/p/g/en_US/nav/nav_light_mix_over.gif) no-repeat right bottom'; 
            if (validTab(sellTab.href)){
                tabTopNavOverAndOut(sellTab,sellTab,'nav_light_over_other_high','nav_light_other');
            }
            else
            {
                tabTopNavOverAndOut(sellTab,sellTab,'nav_light_over_other_high','nav_grey_mix_from_other');
            }
        }
    }
    
    document.getElementById('transfer').onmouseout = function() {
        if (transferTab.style.display != 'block')
        {
            tabTopNavOverAndOut(transferTab,registerTab,'nav_light_mix_other','nav_light_mix'); 
            //transferTab.style.background='url(img/p/g/en_US/nav/nav_light_mix.gif) no-repeat right bottom'; 
            if (validTab(sellTab.href)){
                tabTopNavOverAndOut(sellTab,sellTab,'nav_light_over','nav_light');
            }
            else
            {
                tabTopNavOverAndOut(sellTab,sellTab,'nav_light_over_other_high','nav_grey_mix');
            }
        }
    }
    
     //register mouse over and out
    document.getElementById('register').onmouseover = function() {
        if (registerTab.style.display != 'block')
        {
            tabTopNavOverAndOut(registerTab,loginTab,'nav_olive_over_other_high','nav_olive_over'); 
            tabTopNavOverAndOut(transferTab,transferTab,'nav_light_mix_over_other_high','nav_light_mix_other'); 
        }
    }
    
    document.getElementById('register').onmouseout = function() {
        if (registerTab.style.display != 'block')
        {
            tabTopNavOverAndOut(registerTab,loginTab,'nav_olive_other','nav_olive'); 
            tabTopNavOverAndOut(transferTab,transferTab,'nav_light_mix_over','nav_light_mix'); 
        }
    }

    //login mouse over and out
    document.getElementById('sign_in').onmouseover = function() {
        if (loginTab.style.display != 'block')
        {
            loginTab.style.paddingTop='12px'; //12
            loginTab.style.paddingBottom='4px'; //12
            tabTopNavOverAndOut(loginTab,aboutfsTab,'nav_olive_mix'+'_over_other_high','nav_olive_mix'+'_over'); 
            tabTopNavOverAndOut(registerTab,registerTab,'nav_olive'+'_over_other_high','nav_olive'+'_other'); 
        }
    }
    
    document.getElementById('sign_in').onmouseout = function() {
        if (loginTab.style.display != 'block')
        {
            loginTab.style.paddingTop='5px'; // 5px
            loginTab.style.paddingBottom='10px'; //12
            tabTopNavOverAndOut(loginTab,aboutfsTab,'nav_olive_mix' + '_other','nav_olive_mix'); 
            tabTopNavOverAndOut(registerTab,registerTab,'nav_olive'+'_over','nav_olive'); 
        }
     }

     //about FS mouse over and out
    document.getElementById('about_flash_seats').onmouseover = function() {
        if (aboutfsTab.style.display != 'block')
        {
            tabTopNavOverAndOut(aboutfsTab,faqTab,'nav_dark'+'_over_other_high','nav_dark'+'_over'); 
            tabTopNavOverAndOut(loginTab,loginTab,'nav_olive_mix'+'_over_other_high','nav_olive_mix'+'_other'); 
        }
    }
    
    document.getElementById('about_flash_seats').onmouseout = function() {
        if (aboutfsTab.style.display != 'block')
        {
            tabTopNavOverAndOut(aboutfsTab,faqTab,'nav_dark' + '_other','nav_dark'); 
            tabTopNavOverAndOut(loginTab,loginTab,'nav_olive_mix'+'_over','nav_olive_mix'); 

        }
    }

     //faqs mouse over and out
    document.getElementById('faqs').onmouseover = function() {
        if (faqTab.style.display != 'block')
        {
            tabTopNavOverAndOut(faqTab,contactTab,'nav_dark'+'_over_other_high','nav_dark'+'_over'); 
            tabTopNavOverAndOut(aboutfsTab,aboutfsTab,'nav_dark'+'_over_other_high','nav_dark'+'_other'); 
        }
    }
    
    document.getElementById('faqs').onmouseout = function() {
        if (faqTab.style.display != 'block')
        {
            tabTopNavOverAndOut(faqTab,contactTab,'nav_dark' + '_other','nav_dark'); 
            tabTopNavOverAndOut(aboutfsTab,aboutfsTab,'nav_dark'+'_over','nav_dark'); 
        }
     }

     //contact_us mouse over and out
    document.getElementById('contact_us').onmouseover = function() {
        if (contactTab.style.display != 'block')
        {
            contactTab.style.background='url(img/p/g/en_US/nav/nav_dark_mix_over.gif) no-repeat right bottom'; 
            tabTopNavOverAndOut(faqTab,faqTab,'nav_dark'+'_over_other_high','nav_dark'+'_other'); 
        }
    }
    
    document.getElementById('contact_us').onmouseout = function() {
        if (contactTab.style.display != 'block')
        {
            contactTab.style.background='url(img/p/g/en_US/nav/nav_dark_mix.gif) no-repeat right bottom'; 
            tabTopNavOverAndOut(faqTab,faqTab,'nav_dark'+'_over','nav_dark'); 
        }
    }

    //fs_com mouse over and out
    document.getElementById('fs_com').onmouseover = function() {
        if (fscomTab.style.display != 'block')
        {
            fscomTab.style.background='url(img/p/g/en_US/nav/nav_black_over.gif) no-repeat right bottom'; 
            tabTopNavOverAndOut(contactTab,contactTab,'nav_dark_mix'+'_over_other_high','nav_dark_mix'+'_other'); 
        }
    }
    
    document.getElementById('fs_com').onmouseout = function() {
        if (fscomTab.style.display != 'block')
        {
            fscomTab.style.background='url(img/p/g/en_US/nav/nav_black.gif) no-repeat right bottom'; 
            tabTopNavOverAndOut(contactTab,contactTab,'nav_dark_mix'+'_over','nav_dark_mix'); 
        }
      }
      
      if( document.getElementById('subMenuList') != null)
      {
        hoverSubNavMenu();
      }
 } //end of all navigation

function tabTopNavOverAndOut(myTab,checkTab,selImage,unSelImage)
{
    var dpath='img/p/g/en_US/nav/';
    selImage = 'url('+dpath + selImage + '.gif) no-repeat right bottom'; 
    unSelImage = 'url('+dpath + unSelImage + '.gif) no-repeat right bottom'; 
    if (checkTab.style.display != 'block')
    {
        myTab.style.background=unSelImage;
    }
    else
    {
        myTab.style.background=selImage; 
    }
}

function validTab(url)
{
  if(url.indexOf('#') != -1) return false;
  return true;
}

function hoverSubNavMenu()
{
    //flashboard" 
    //tickets" 
    //bids" 
    //listings" 
    //transfers" 
    //purchases" 
    //sales" 
    //account" 
    //admin" 
}

function MM_preloadImages() 
{ //v3.0
  var d=document; 
  if(d.images)
  { 
    if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
    for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0)
		{ 
		  d.MM_p[j]=new Image; 
		  d.MM_p[j++].src=a[i];
		}
  }
}

function getSkinIdValue(url)
{
  if(url.indexOf('ss=') != -1) 
  {
    var ssPos = url.indexOf('ss=') - 0 + 3;
    var skinId =url.charAt(ssPos);
    skinIdParam = 's'+skinId;
  }
  else
  {
    skinIdParam ='s0';
  }
}