﻿/*=============================================================================
hovercode.js - Javascript for hover menus
	
author: Phil Allison
Date:   November 11, 2009
=============================================================================*/
	var inparms = 0;
	var timeid = 0;
	var mouseon = 0;
	
//function startHover(divno)
//{
//	if (mouseon != 0)
//		return;
//	clearTimeout(timeid);
//	hideSubMenu();
//	isHover = divno;
//	timeid = setTimeout('showSubMenu()', 1000);
//}

function startHPop(fld, parms)
{
	if (mouseon != 0)
		return;
	clearTimeout(timeid);
	hideSubMenu();
	curFld = fld;
	inparms = parms;
	timeid = setTimeout('AJAXHover()', 1000);
}

var inset = 'pop_in'; 

function AJAXHover()
{
	url = "../AJAX/AjaxHover.aspx?";
	url += inparms;
	AJAXCall(url, AJAXHoverView);
}

function AJAXHoverView(text)
{
	document.getElementById(inset).className = '';
	setValueOfId(inset, "&nbsp;");
	setValueOfId(inset, text);
	toggleDIV(inset, 'block');
	setDIV(curFld, inset);
	adjustDIV(curFld, 'setme');
}

function stopHover()
{
	clearTimeout(timeid);
	toggleDIV(inset, 'none');
}
function hideSub()
{
	toggleDIV(inset, 'none');
}

function showSubMenu()
{
//	if (isHover != 0)
//	{
//		var fld = document.getElementById('subcat'+isHover);
//		
//		if (fld != null)
//			fld.style.display = 'block';
//	}
}

function hideSubMenu()
{
//		var fld = document.getElementById('subcat'+isHover);
		
//		if (fld != null)
//			fld.style.display = 'none';
}

function setMouseOn(divno)
{
	if (divno == 1)
		toggleDIV(inset, 'block');
	else
		toggleDIV(inset, 'none');
	mouseon = divno;
}


