function showWindow(url, w, h)
{
	if(w == 0) {
		w = screen.availWidth;
	}
	if(h == 0) {
		h = screen.availHeight;
	} else {
		h = h + 40;
	}
	
	hWnd = window.open("", "Popup", 'toolbar=0,left=0,top=0,location=0,directories=0,status=0,menubar=0,resizable=1,dependent=1,hotkeys=0,scrollbars=1,titlebar=0,z-lock=1,width=' + w + ',height=' + h + ',left=' + (screen.availWidth - w) / 2 + ',top=' + (screen.availHeight - h) / 2);
	hWnd.resizeTo(w, h);
	hWnd.focus();
	hWnd.location.href=""+url;
}

function markButton(sdr, dest_name) {
  if (sdr != null) {
    sdr.src = '/webdav/img/site/'+dest_name;
    return true;
  }
  return false;
}

function contextMenu(e)
{
	// IE is evil and doesn't pass the event object
	if(e == null) {
		e = window.event;
	}
	 
	// we assume we have a standards compliant browser, but check if we have IE
	var target = e.target != null ? e.target : e.srcElement; 
	
	// only show the context menu if the right mouse button is pressed and is img
	if(/*e.button == 2 &&*/target.tagName.toLowerCase() == 'img') {
		return false;
	} else {
		return true;
	}
}

document.oncontextmenu = contextMenu;
