var menucollection=new Array();
var NS=(navigator.appName=='Netscape');
var g_oCurrentDrag=null;

function lwFocusLayer(oLayer) {
	document.lw_maxZ++;
	if (NS)
		oLayer.zIndex = document.lw_maxZ;
	else
		oLayer.style.zIndex = document.lw_maxZ;
}

function lwShowLayer(name,toFront) {
	var theLayer;
	if (NS) {
		theLayer = document.layers[name];
		theLayer.visibility = "visible";
	}
	else {
		theLayer = document.all[name];
		theLayer.style.visibility = "visible";
	}
	if( toFront )
		lwFocusLayer(theLayer);
}

function lwHideLayer(name) {
	if (NS)
		document.layers[name].visibility = "hidden";
	else
		document.all[name].style.visibility = "hidden";
}

function lwMoveLayer(oLayer,newLeft,newTop) {
	if (NS)
		document.layers[oLayer].moveTo(newLeft,newTop);
	else {
		document.all[oLayer].style.pixelTop = newTop;
		document.all[oLayer].style.pixelLeft = newLeft;
	}
}

function menu(IDnr){
	this.ID=IDnr;
}

function clearmenu(id){
	parent.main.clearmenu(id);
	for(var i=0;i<menucollection.length;i++){
		if(id!=menucollection[i].ID){
			lwHideLayer('ID'+menucollection[i].ID+'h');
			lwShowLayer('ID'+menucollection[i].ID,true);
		}
	}
}

function showmenu(id,posleft,postop){
	if(parent.main==null)
		return;
	if(parent.main.showmenu==null) {
		return;
	}
	if(NS){
		if(parent.main.document.layers['vit']==null) {
			return;
		}
	}
	clearmenu(id);
	lwHideLayer('ID'+id);
	lwShowLayer('ID'+id+'h',true);
	parent.main.showmenu(id,posleft,postop);
	return;
}


