/*------------------------------------------------------------------------
# $JA#PRODUCT_NAME$ - Version $JA#VERSION$ - Licence Owner $JA#OWNER$
# ------------------------------------------------------------------------
# Copyright (C) 2004-2008 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
# @license - Copyrighted Commercial Software
# Author: J.O.O.M Solutions Co., Ltd
# Websites:  http://www.joomlart.com -  http://www.joomlancers.com
# This file may not be redistributed in whole or significant part.
-------------------------------------------------------------------------*/
var OnLoadFunctions = new Array();
var OnLoadFunctionsEx = new Array();
function AddOnLoadFunction(OnLoadFunction, OnLoadFunctionEx)
{
    OnLoadFunctions.push(OnLoadFunction);
    OnLoadFunctionsEx.push(OnLoadFunctionEx);
}

window.onload = OnBodyLoad;
function OnBodyLoad()
{
    for (var i = 0; i < OnLoadFunctions.length; i++)
    {
        var cfunction = OnLoadFunctions[i];
        var cfunctionex = OnLoadFunctionsEx[i];
        eval("if (window." + cfunction + ") { " + cfunctionex + "; }");
    }
}

function GetEventObject( evt )
{
	if( !evt && window.event )
	{
		evt = window.event;
	}

    if (evt)
	{
		if( evt.srcElement )
			return evt.srcElement;
		else
			return evt.target;
	}
	else
		return null;
}

function sfHover() 
{
	var sfEls = document.getElementById("ja-cssmenu").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; ++i) 
	{
		sfEls[i].onmouseover = ItemMouseOver;
		sfEls[i].onmouseout = ItemMouseOut;
	}
}

function ItemMouseOut(item) 
{
	var li = GetEventObject(item);
    if (li != null )
    {
		clearTimeout();
		this.className=this.className.replace(new RegExp("sfhover\\b"), "");
    }
}

function ItemMouseOver(item)
{
	var li = GetEventObject(item);
    if (li != null )
    {
		clearTimeout();
		if (this.className.indexOf("sfhover") == -1)
			this.className+="sfhover";
    }
}

AddOnLoadFunction("sfHover", "sfHover();");

