function detailWindow(url, title, table, id) 
{
    var targetPage = url + "?table=" + table + "&id=" + id;
    newwindow = window.open(targetPage,title,"width=800,height=550,scrollbars=yes,menubar=yes,toolbar=yes,status=yes,resizable=yes");
    if (window.focus) 
    {
      newwindow.focus();
    }
}

function detailWindow(url, title, table, id, width, height)
{
    var targetPage = url + '?table=' + table + '&id=' + id;
    newwindow = window.open(targetPage,title,"width=" + width + ",height=" + height +
        " ,scrollbars");
    if (window.focus) 
    {
      newwindow.focus();
    }
}

function popup(url, title)
{
    newwindow = window.open(url,title,"width=800,height=570,scrollbars=yes,menubar=yes,toolbar=yes,status=yes,resizable=yes");
    if (window.focus) 
    {
      newwindow.focus();
    }
}

function backToMainWindow(redir) 
{
    window.opener.location.href=redir;
    self.close();
}
		
function openWin(win, width, height) 
{
    str= "" + win;
    w   = "width=" + width;
    h   = "height=" + height;
    opt = "scrollbars=yes,menubar=yes,toolbar=yes,status=yes,resizable=yes," + w + "," + h;
    pressWin = window.open(str,"",opt);
    if (window.focus) 
    {
      pressWin.focus();
    }
}

function getAjaxRequest() {
	var xmlhttp = false;
	try {
	  // Firefox, Opera 8.0+, Safari    
	  xmlhttp = new XMLHttpRequest();    
	} catch (e) {
	  // Internet Explorer    
	  try {
	    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	  } catch (e) {     
	    try {
	      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	    } catch (e) {
	      alert("Your browser does not support AJAX!");        
	      xmlhttp = false;        
	    }      
	  }    
	}
	return xmlhttp;
}

/**
 * Show the help-text
 * @param url
 */
function showHelp(url) {
	var div = document.getElementById('helpContent');
	var xmlhttp = getAjaxRequest();
	xmlhttp.open("GET", url, true);
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState == 4) {
			div.innerHTML = xmlhttp.responseText;
		}
	}
	xmlhttp.send(null);
}

