function showPopup(id,module)
{
	window.open("popupHandler.php?popup="+module+"&id=" + id, "BSCMS", "width=700,height=550,toolbar=no,status=no,scrollbar=true;titlebar=no,dependent=yes");
}

//lavet til at popup vinduet kan sende parameter tilbage 
function showPopupWithReturn(id,module,elementId,dir)
{
	window.open("popupHandler.php?popup="+module+"&id=" + id +"&dir=" + dir +"&elementid=" + elementId , "BSCMS1", "width=700,height=450,toolbar=no,status=no,scrollbar=true;titlebar=no,dependent=yes");
}

function showPageHandle(id,module,position,parentid)
{
	window.open("popupHandler.php?popup="+module+"&id=" + id + "&pos=" + position + "&parentid=" + parentid , "BSCMS", "width=900,height=750,toolbar=no,status=no,scrollbar=true;titlebar=no,dependent=yes");
}




function returnPathToParent(elementid, path) {
    if (document.getElementById(path) != null) {
    	opener.document.getElementById(elementid).value = document.getElementById(path).innerHTML;
       }
        else {
        	opener.document.getElementById(elementid).value = path;
        }
        //window.opener.refresh();
    window.close();
}




    function getQueryString() {
    var args = new Object();
    var query = location.search.substring(1);
    var pairs = query.split("&");
    for(var i = 0; i < pairs.length; i++)
    {
        var pos = pairs[i].indexOf('=');
        if (pos == -1) continue;
        var argname = pairs[i].substring(0,pos);
        var value = pairs[i].substring(pos+1);
        args[argname] = unescape(value);
    }
    return args;
}
