// JavaScript Document

var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
var isPulldownOver = false;

function menu_DoFSCommand(command, args) {
	var menuObj = isInternetExplorer ? document.all.menu : document.menu;
	if ( command == "showPulldownMenu" ){
		showPulldown();
		isPulldownOver = false;
	} else if ( command == "hidePulldownMenu" ){
		hidePulldown();
	}
}

function showPulldown(){
	isPulldownOver = true;
	var obj = document.getElementById('pulldownMenu');
	if ( obj )
		obj.style.display = 'block';
}

function hidePulldown(){
	if ( arguments.length > 0 ){
		var e = arguments[0];
		var obj = document.getElementById('pulldownMenu');
		if ( obj ){
			var b = getBounds(obj);
			var dx = e.clientX - b.left;
			var dy = e.clientY - b.top;
			if ( !((dx > 0) && (dx < b.width) && (dy > 0) && (dy < b.height)) ){
				isPulldownOver = false;
				obj.style.display = 'none';
			}
		}
	}else{
		setTimeout( "tryOut();", 5000 );
	}
}
function tryOut(){
	if ( isPulldownOver == false ){
		var obj = document.getElementById('pulldownMenu');
		if ( obj )
			obj.style.display = 'none';
	}
}

function itemOver( obj ){
	//isPulldownOver=true;
	showPulldown();
	obj.className = "pulldownOver";
}
function itemOut( obj ){
	obj.className = "pulldown";
	//hidePulldown();
}

// Hook for Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub menu_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call menu_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}
