function showMenu(obj) {
	hideMenu();
	var rightedge = document.body.clientWidth-event.clientX;
	var bottomedge = document.body.clientHeight-event.clientY;
//	if (rightedge < obj.offsetWidth)
		obj.style.left = document.body.scrollLeft + (document.body.clientWidth - 724)/2 + 330 - obj.offsetWidth + 18;
//		obj.style.left = document.body.scrollLeft + event.clientX - obj.offsetWidth;
//	else
//		obj.style.left = document.body.scrollLeft + event.clientX;
	if (bottomedge < obj.offsetHeight)
		obj.style.top = document.body.scrollTop + event.clientY - obj.offsetHeight;
	else
		obj.style.top = document.body.scrollTop + event.clientY - 3;
	obj.style.visibility = "visible";
	document.menuForm.flag.value = obj.id;
	return false;
}

function hideMenu() {
	var objc = document.menuForm.flag.value;
	if (objc != 0) {
		eval (objc + ".style.visibility = 'hidden';");
		document.menuForm.flag.value = 0;
	}
}

function hideMenu1(obj) {
	if (obj == 'all') {
		if (menu_1.style.visibility != "hidden")
			menu_1.style.visibility = "hidden";
	}
	else
		obj.style.visibility = "hidden";
}

//-----------------------------------------------------------------------------
// Global popup window function
//-----------------------------------------------------------------------------
function window_pop(url, name, nheight, nwidth, resize, scroll, status ) {
	var myloc = window.location.href;
	var locarray = myloc.split("/");
	var tmpurl = url;
	/*
	delete locarray[(locarray.length-1)];


	if (tmpurl.substring(0,2)=='..'){
		delete locarray[(locarray.length-2)];
		url = url.substring(3,url.length);
	}

	var arraytext = locarray.join("/");

	//strip last / from url (http://localhost:8075//)
	if (tmpurl.substring(0,2)=='..'){
		arraytext = arraytext.substring(0,arraytext.length-1);
	}

	url = arraytext + url;
	*/
	var popup = false;
	var postop = screen.availHeight/2 - nheight/2 - 50;
	postop = parseInt(postop);
	var posleft = screen.width/2 - nwidth/2;
	posleft = parseInt(posleft);
	// Config for the window
	var config = 'height'      +  '='         +  nheight     +  ','  +
        	       'width'       +  '='         +  nwidth      +  ','  +
		             'toolbar'      +  '=no,'     +
		             'menubar'      +  '=no,'     +
		             'scrollbars'   +  '='+ scroll +','  +
		             'resizable'    +  '='+ resize +','  +
		             'location'     +  '=no,'      +
		          //   'location'     +  '=yes,'      +
		             'directories'  +  '=no,'      +
		             'status'       +  '='+ status +','  +
		          //   'status'       +  '=yes,'  +
		             'screenX'      +  '=300,'     +
		             'screenY'      +  '=300,'     +
		             'top'          +  '=' + postop + ','     +
		             'left'         +  '=' + posleft;

	if(navigator.appName.indexOf("Net") != -1) {
		if(popup) {
			if(popup.document == '') {
				popup.close();
			}
		}
		popup = eval("window.open(url,name,config='" + config + "')");
		popup.focus();
	}
	else if (navigator.appVersion.indexOf("MSIE") != -1) {
		if (popup) {
			if (popup.closed) {
				popup = eval("window.open(url,name,config='" + config + "')");
			}
			else {
				pop_url = new String(popup.location).replace(/^http:\/\/[a-zA-Z0-9.\-]+(\/.*)$/, "$1");
				if (pop_url != url) {
					popup.location = url;
				}
				popup.focus();
			}
		}
		else {
			popup = eval("window.open(url,name,config='" + config + "')");
		//	alert(popup.name);
			popup.focus();
		}
	}
}


//-----------------------------------------------------------------------------
// Open resizable dialog
//-----------------------------------------------------------------------------
function pop_up(url, name, nheight, nwidth) {
  window_pop(url, name, nheight, nwidth, 'no', 'no', 'no' )
}
