if (document.images)
{
	var imglist = new Array (
	"/images/etfs_nav_home_1.gif"
,	"/images/etfs_nav_about_etfsetcs_1.gif"
, 	"/images/etfs_nav_products_1.gif"
, 	"/images/etfs_nav_how_1.gif"
, 	"/images/etfs_nav_library_1.gif"
, 	"/images/etfs_nav_faqs_1.gif"
, 	"/images/etfs_nav_news_1.gif"
, 	"/images/etfs_nav_events_1.gif"

);
 
	var imgs = new Array(); var count;
 	for (count=0; count<imglist.length; count++)
 	{
 		imgs[count]=new Image(); imgs[count].src=imglist[count];
 	}
}

function hilite(name,m)
{
	if ((!(document.all)) && (!(document.layers)))
	{
		imgswap(name, imgs[m]);
	}
	else if (document.images)
 	{
 		imgswap(name, imgs[m]);
 	}
}

function imgswap(i1,i2)
{
	if ((!(document.all)) && (!(document.layers)))
	{
		var temp = i1.src; i1.src=i2.src; i2.src=temp;
	}
	else if (document.images)
 	{
		var temp = i1.src; i1.src=i2.src; i2.src=temp;
 	}
}

// Homepage Random Images

function getRand(onPage) {
    numArray = null;

    if (onPage == 'sidepic') {
        numArray = new Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17");
    }

    if (onPage == 'welcomepic1') {
        numArray = new Array("1", "10");
    }

    if (onPage == 'welcomepic2') {
        numArray = new Array("3", "4");
    }

    if (onPage == 'welcomepic3') {
        numArray = new Array("5", "6");
    }

    if (onPage == 'welcomepic4') {
        numArray = new Array("7", "8");
    }

    //randomly load an image, using the var randNum
    //maxNum is the highest numbered image within the images directory


    var maxNum = numArray.length;
    var randNum = (Math.floor(Math.random() * maxNum));

    randNum = numArray[randNum];

    return randNum;
}


function getfocus() {
    window.focus();
}


// Show tabs

$(document).ready(function () {
    $('.tabs ul li:first').css('background-image', 'url(/images/tabBgOver.gif)');

    $('.tabs ul li').click(function () {
        $('.tabs ul li').css('background-image', 'url(/images/tabBg.gif)');
        $(this).css('background-image', 'url(/images/tabBgOver.gif)');
    });
});

function showTab(section) {
    var displaySection = section;

    $('.tab1').hide();
    $('.tab2').hide();
    $('.tab3').hide();
    $('.tab4').hide();

    $(displaySection).show();
}



