/* Setup */
/*********/
// 1 Set this the the name of the class to be used for IE6 hover emulation
var ieClassName = "iehover";

// 2 set this to the location of the ajax page
var ajaxPage = "/modules/ajazMenu.aspx";

// 3 set this to the id of the div where the menu should be loaded
var menuDiv = "theNav";
	
/*
In this example the 3 li's with subnavs will require :hover emulation for IE6, the classes 'first' and 'last' 
will be replaced (and the styles won't then work correctly) unless they are added to this array.
*/
var preserveStyles = new Array()
preserveStyles[0] = 'iehover'
preserveStyles[1] = 'hasSub'
	
/* DO NOT EDIT AFTER THIS LINE */
/*******************************/

//sets default to non emulation mode
var isIE6 = "no";

Event.observe(window, 'load', function() {
  ajaxMenu(menuDiv);
});

/* MAD CSS AJAX MENU V1	- AJAX CALL*/
/* where = target div */
//function ajaxMenu(where) {
//Check that the menu is not disabled and get the menu if it is
	//if (disableMenu == false) {
		//new Ajax.Updater({ success: where }, host+ajaxPage+'?active='+ activeItem + '&ie=' + isIE6, { method: 'get' });
		//}//if
//}

/*IE6 Hover emulation functions */
function on(which) {
		var i;
		for (i=0; i<preserveStyles.length; ++i) {
			if(which.className == preserveStyles[i]){
				which.className= preserveStyles[i] + ' ' + ieClassName;
			}//if
		} // for

		if(which.className == ''){
			which.className=ieClassName;
		}//if
	}

function off(which) {
		var i;

		for (i=0; i<preserveStyles.length; ++i) {
			if(which.className == preserveStyles[i] + ' ' + ieClassName){
				which.className= preserveStyles[i];
			}//if
		} // for

		if(which.className == ieClassName){
			which.className='';
		}//if
	}	