window.onload = function()
{
    positionBottom();
}
window.onresize = function()
{
    positionBottom();
}
window.onscroll = function()
{
//    positionBottom();
}




function showsub(o)
{
    if (!o) return;
    
    hideall();
    
    var ul = o.getElementsByTagName('ul');
    
    if(ul.length > 0)
        ul[0].style.display = 'block';  
        
    var flashback = document.getElementById('flashback');
    var banner = document.getElementById('banner');
    if(flashback)
    {
        flashback.style.display = 'block';
        banner.style.display = 'none';
    
    }
}

function hideall()
{
    var subnavigationContainer = document.getElementById('TopNavigationContainer');
    var ul = subnavigationContainer.getElementsByTagName('ul');
    for (var i=0; i<ul.length; i++)
        if(ul[i].className == 'sub')
            ul[i].style.display = 'none';
            
    var flashback = document.getElementById('flashback');
    var banner = document.getElementById('banner');
    
    if(flashback)
    {
        flashback.style.display = 'none';
        banner.style.display = 'block';
    
    }
}


function swapImage(newurl, destination, o)
{
    var destinationContainer = document.getElementById(destination);
    destinationContainer.src = newurl;
    
    var RightSection = document.getElementById('RightSection');
    var images = RightSection.getElementsByTagName('img');
    for (var i=0; i<images.length; i++)
        images[i].src = '/images/smallmask.gif';
    
    var activeImage = o.getElementsByTagName('img');   
    activeImage[0].src = '/images/smallactivemask.gif';
}
function swapPlan(newurl, destination, o)
{
    var destinationContainer = document.getElementById(destination);
    destinationContainer.src = newurl;
    
    var RightSection = document.getElementById('miniplancontainer');
    var images = RightSection.getElementsByTagName('img');
    for (var i=0; i<images.length; i++)
        images[i].src = '/images/smallmask.gif';
    
    var activeImage = o.getElementsByTagName('img');   
    activeImage[0].src = '/images/smallactivemask.gif';
}

function toggleTab(o,contentcontainer)
{
    var tabs = document.getElementById('Tabs').getElementsByTagName('li');
    var imgs = document.getElementById('Tabs').getElementsByTagName('img');
    var contentad = document.getElementById('contentad');

    var TabContents = document.getElementById('TabContent').getElementsByTagName('div');
    var currentImg = o.getElementsByTagName('img')[0];
    for (var i=0; i<tabs.length; i++)
    {
        imgs[i].src = '/images/tabright.gif';
        tabs[i].className = '';
    }
    for (var j=0; j<TabContents.length; j++)
        if(TabContents[j].className == 'container')
            TabContents[j].style.display = 'none';   

    document.getElementById(contentcontainer).style.display = 'block';  

    contentad.style.height = document.getElementById(contentcontainer).offsetHeight + 150 + 'px';
   
    o.className = 'selected';
    currentImg.src = '/images/tabrightactive.gif';


}


function getWindowWidth(){	return window.innerWidth ? window.innerWidth : document.body.offsetWidth;}	
function positionBottom()
{
    return;
    var bottom = document.getElementById('BottomContainer');
    var contentad = document.getElementById('contentad');


    if(bottom)
    {
	    if(!contentad)
        {

                var position = (getWindowWidth() - bottom.offsetWidth) / 2;
                bottom.style.position = 'absolute';
                bottom.style.bottom = 10 + 'px';
                bottom.style.left = position + 'px';
        }
    }



}


