var x = null;
//var tdIn = 0;
var frame = null;


function doMainMenuOver(oThis, oMenu)
{
	if (x != null)
		window.clearInterval(x);

	// HighLight current Item
	oThis.style.backgroundColor = "#F1F1F1";
	oThis.style.borderColor = "#CCCCCC";

	// Hide old subMenu
	if (frame != null)
		{
			frame.style.visibility = "hidden";
			frame=null;
		}														
						
	// Show subMenu
	if (oMenu != null)
		{
			oMenu.style.top= oThis.style.top;
			oMenu.style.left = 198;
			oMenu.style.visibility = "visible";
			
			// Store subMenu reference
			frame = oMenu;
		}	
}

function doMainMenuOut(oThis)
{
	// LowLight current Item
	oThis.style.backgroundColor = "#E1ECF9";
	oThis.style.borderColor = "#E1ECF9";
	
	if (frame != null)
		{
			frame.style.visibility = "hidden";
			frame = null;
		}								
}

function doSubMenuOver(oThis, oMenu)
{
	// HighLight current Item
	oThis.style.backgroundColor = "#F1F1F1";
	oThis.style.borderColor = "#CCCCCC";
				
	oMenu.style.visibility = "visible";
	frame = oMenu;
	//tdIn=1;
	
	if (x != null)
		window.clearInterval(x);				
}

function doSubMenuOut(oThis)
{
	oThis.style.backgroundColor = "#E1ECF9";
	oThis.style.borderColor = "#E1ECF9";
	
	td=0;
	x = window.setInterval(doMyOver,400);
}

function doMyOver()
{
	if ((frame != null) && (td == 0))
		{
			frame.style.visibility = "hidden";
			frame = null;
			window.clearInterval(x);
		}
}			

function doOver(oThis)
{
	eval(oThis + '.style.color = 16711680');
}

function doOut(oThis)
{
	eval(oThis + '.style.color = 26367');
}

function setDefaultButton(btnName)
{
    var btn = document.getElementById(btnName);
    
    if (event.keyCode == 13)
    {
        event.returnValue=false;
        event.cancelBubble = true;
        btn.click();
    }
}
