

function nav(url)
{
    document.location = url;
}

// Home page functions
var g_HomeImages = new Array();
var g_HomeImageNames = new Array("images/home/home1.jpg", "images/home/home2.jpg");
var g_HomeImageIndex = 0;
function ScrollImagePanel()
{
    var homeImagePanel = document.images.imagePanel;
    document.images.imagePanel.style.filter = "blendTrans(duration=2)";
    document.images.imagePanel.style.filter = "blendTrans(duration=3)";
    document.images.imagePanel.style.filters.blendTrans.Apply(); 
    
    // Preload the rest of the images
    if(g_HomeImages.length == 0)
    {
       // Load the first image for now
       homeImagePanel.src = g_HomeImageNames[0];
 
       // Now preload everything else
       for (var i = 0; i < g_HomeImageNames.length; i++)
       {
           g_HomeImages[i] = new Image();
           g_HomeImages[i].src = g_HomeImageNames[i];
       } 
    }
    else
    {
        homeImagePanel.src = g_HomeImages[g_HomeImageIndex++].src;
        homeImagePanel.filters.blendTrans.Play()

        // Set back to 0 if necessary        
        if (g_HomeImageIndex >= g_HomeImages.length)
        {
            g_HomeImageIndex = 0;
        }
    }
    
    setTimeout("ScrollImagePanel()", 4000); 
}

/////////////////////
// UNUSED
////////


function loadcontent(URL)
{
  document.location=URL;  //Load the new content into the main content window
}

function swap(item)
{
	item.style.backgroundColor='white';
	item.style.border = 'black solid 1px';
}

function swapback(item)  
{
	item.style.backgroundColor='black';
	item.style.border = 'black solid 1px';
}

function sendEmail(contact, url)
{
	document.location="mailto:" + contact + "@" + url;
	return false;
}

////////////
//Menu Stuff
////////////
function MenuHandler()
{
	this.HideMenu = HideMenu;
	this.ShowMenu = ShowMenu;
	this.SetWaitTime = SetWaitTime;
	this.WaitCallback = 0;
	this.EndWait = EndWait;
	
	this.LastMenu = null;
}

function ShowMenu(menu)
{
    if (this.LastMenu != null)
    {
        HideMenu(this.LastMenu);
    }

	var item = document.getElementById(menu);
	if (item != null)
	{
	    item.style.visibility='visible';
	}
	
	this.LastMenu = menu;
}

function HideMenu(menu)
{
	var item = document.getElementById(menu);
	if (item != null)
	{
	    item.style.visibility='hidden';
	}
}

function SetWaitTime(menu)
{
	var wait = 60;
	this.WaitCallback = setTimeout('HideMenu("' + menu + '")', wait);
}

function EndWait(menu)
{
	clearTimeout(this.WaitCallback);
}

g_MenuHandler = new MenuHandler();

function HoverMenu(menu)
{
    menu.className = "sidenavOffHover";
}

function UnHoverMenu(menu)
{
    menu.className = "sidenavOff";
}