// JScript File

function Navigate(drop_down_list) {
    var number = drop_down_list.selectedIndex;
    location.href = drop_down_list.options[number].value;
}

var current = 1;
var midcurrent = 1;
var bottomcurrent = 1;
var rightsidecurrent = 1;
var towerrightcurrent = 1;
var islandcurrent = 1;

function changeAds()
{
    numAds = countObjs('ad');
    for (i = 0; i < numAds; i ++)
    {
        if (i != current)
            document.getElementById('ad' + i).style.display = 'none';
        else
            document.getElementById('ad' + current).style.display = 'block';
    }
    current = (current + 1) % numAds;
	
	numAds = countObjs('tr');
    for (i = 0; i < numAds; i ++)
    {
        if (i != towerrightcurrent)
            document.getElementById('tr' + i).style.display = 'none';
        else
            document.getElementById('tr' + towerrightcurrent).style.display = 'block';
    }
    towerrightcurrent = (towerrightcurrent + 1) % numAds;

    nummids = countObjs('mid');
    for (i = 0; i < nummids; i ++)
    {
        if (i != midcurrent)
            document.getElementById('mid' + i).style.display = 'none';
        else
            document.getElementById('mid' + midcurrent).style.display = 'block';
    }
    midcurrent = (midcurrent + 1) % nummids;

    numbottoms = countObjs('bottom');
    for (i = 0; i < numbottoms; i ++)
    {
        if (i != bottomcurrent)
            document.getElementById('bottom' + i).style.display = 'none';
        else
            document.getElementById('bottom' + bottomcurrent).style.display = 'block';
    }
    bottomcurrent = (bottomcurrent + 1) % numbottoms;
    
    numrightsides = countObjs('rightside');
    for (i = 0; i < numrightsides; i ++)
    {
        if (i != rightsidecurrent)
            document.getElementById('rightside' + i).style.display = 'none';
        else
            document.getElementById('rightside' + rightsidecurrent).style.display = 'block';
    }
    rightsidecurrent = (rightsidecurrent + 1) % numrightsides;
	
	numIslands = countObjs('island');
	for (i = 0; i < numIslands; i ++)
	{
		if (i != islandcurrent)
			document.getElementById('island' + i).style.display = 'none';
		else
			document.getElementById('island' + islandcurrent).style.display = 'block';
	}
	islandcurrent = (islandcurrent + 1) % numIslands;
}

function countObjs(objName)
{
    var i = 0;
    var count = 0;
    
    while (document.getElementById(objName + i) != null)
    {
        count ++;
        i ++;
    }
    return count;
}

setInterval('changeAds()', 20000);

//function openWin1()
//{
//    win1=window.open('http://www.hoganstand.com/pop/thegaastore.htm','popU','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,height=520,width=500,top=140,left=140');
//    if(win1 != null)
//    {				
//        win1.blur();
//        window.focus();
//    }
//}

function NoEnter(event)
{
    if (document.all)
    {
        if (event.keyCode == 13)
        {
           event.returnValue=false;
           event.cancel = true;
        }
    }
    else if (document.getElementById)
    {
        if (event.which == 13)
        {
            event.returnValue=false;
            event.cancel = true;
        }
    }
    else if(document.layers)
    {
        if(event.which == 13)
        {
            event.returnValue=false;
            event.cancel = true;
        }
    }
}
