﻿
var menuItemList;
var subPageArray;
//var activeMenuIndex;

$(document).ready(doReady);

// initializes the javascript
function doReady()
{    
    //alert('doReady');
    //menuItemList = $('td[id*=menu]');
    //alert(menuItemList.length);   
    //setActiveMenu();
}

function notifyExit(url)
{
    //alert(url);
    $("#exitDialog").dialog
    ({
        autoOpen: true,
        buttons: { "Continue": function() { window.location = url; }},
        model: true        
    });
  
}


function showPanel(index)
{    
    //alert('showPanel ' + index);
    for (var i = 0; i < subPageArray.length; i++)
    {
        //alert(subPageArray[i]);
        if (index == i) $('#' + subPageArray[i]).show(); // = 'inline';
        else $('#' + subPageArray[i]).hide(); //[0].style.display = 'none';
    }   
}


function setActiveMenu()
{
    alert('setActiveMenu=' + activeMenuIndex);
    for (var i = 0; i < menuItemList.length; i++)
    {
        menuItemList[i].style.color = '';
        if (i == activeMenuIndex)
            menuItemList[i].style.color = 'Yellow';        
    }
}

function highlight(index, url)
{
    //activeMenuIndex = index;
    //alert(activeMenuIndex);    
    window.location = url;
}


function out(element)
{    
    element.style.className = 'out';
}

function over(element)
{
    element.style.className = 'over';
}



(function($) {
  var cache = [];
  // Arguments are image paths relative to the current page.
  $.preLoadImages = function() {
    var args_len = arguments.length;
    for (var i = args_len; i--;) {
      var cacheImage = document.createElement('img');
      cacheImage.src = arguments[i];
      cache.push(cacheImage);
    }
  }
})(jQuery)

// preload main page graphics
jQuery.preLoadImages("firm_graphic.jpg", "/HavenerCapital/Images/firm_graphic.jpg");
jQuery.preLoadImages("menu_slice_over.jpg", "/HavenerCapital/Images/menu_slice_over.jpg");
