// Check browser type
function ih_browser() {
	this.agent = navigator.userAgent;
	this.mac = (this.agent.indexOf("Mac")>-1) ? 1 : 0;		
	this.nn4 = (document.layers) ? 1 : 0;	
	this.nn = (this.agent.indexOf("Netscape")>-1 || this.nn4) ? 1 : 0;
	if (this.nn4) {
		this.styleref = "";
		this.hide = "hide";
		this.show = "show";
	} else {
		this.styleref = ".style";
		this.hide = "hidden";
		this.show = "visible";
	}
	return this;
}

// Popup window
var popupwin = null;
function popup(url,props) {
	if (!props) props = "width=600,height=500,scrollbars=yes,resizable=yes";
	popupwin = window.open(url,"popupwin",props);
	popupwin.focus();
	return false;
}

// Help window 
function popuphelp(id,page) {
	var url = "/help.aspx?" + ((page)?"page="+page:"id="+id);
	popupwin = popup(url)
	return false;
}

// Disable menus when printing
window.onbeforeprint = disablemenus;
window.onafterprint = enablemenus;
function disablemenus() {
	var doc=document.getElementById("dqmbar");
	if (doc) doc.style.display="none";
}
function enablemenus() {
	var doc=document.getElementById("dqmbar");
	if (doc) doc.style.display="inline";
}

