/*
 * Revision 1.1  2002/11/1916:52:53  
 * use CVS Log for revision history
 *
 */

/* ***** BEGIN LICENSE BLOCK *****
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * Contributor(s): James Horne <james@horneconsulting.com>
 *
 * ***** END LICENSE BLOCK ***** */
function hc_clearTimeout()
{
	if (hcHideMenuTimer) clearTimeout(hcHideMenuTimer);
	hcHideMenuTimer = null;
	hcDHFlag = false;
}

function hcDoHide()
{
	if (!hcDHFlag) return;
	var elapsed = new Date() - hcStart;
	if (elapsed < 1000) {
		hcHideMenuTimer = setTimeout("hcDoHide()", 1100-elapsed);
		return;
	}
	hcDHFlag = false;
	hideActiveMenus();
}

function hc_startTimeout()
{
	hcStart = new Date();
	hcDHFlag = true;
	hcHideMenuTimer = setTimeout("hcDoHide()", 1000);
}

function hideActiveMenus() {
	hideMenu('productMenu');
	hideMenu('technologyMenu');
	hideMenu('companyMenu'); 
}

function showMenu(menuID) {
    var submenu = xbGetElementById(menuID);
   if (submenu) {
	    var submenuStyle = new xbStyle(submenu);
	    submenuStyle.setVisibility('visible');
	}
}
	
function hideMenu(menuID) {	
	var submenu = xbGetElementById(menuID);
	var submenuStyle = new xbStyle(submenu);
	submenuStyle.setVisibility('hidden');
	
	hc_clearTimeout();
	}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages(xsrcName, imageFile) {
/* problems in some circumstances in Netscape 4.7
   changeImages isn't working for absolutely positioned <div>s 
	if (document.images && (preloadFlag == true)&& changeImages.arguments) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
*/
	if (xsrcName && document && document.images && (preloadFlag == true)&& changeImages.arguments.length) {
	    //if not netscape 4.0
	    var ns4=document.layers?1:0
	    if (! ns4 ) document[xsrcName].src = imageFile;
	}
}
