// JavaScript Document
function displayPopup(pageURL,title,w,h) {
	
	 w += 32;
 	 h += 96;
	
	var left = (screen.width/2)-(w/2);
	var top = (screen.height/2)-(h/2);
	
	if (left < 0) { w = screen.width; left = 0; }
	if (top < 0) { h = screen.height; top = 0; }
	
	var targetWin = window.open(pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
	// Just in case width and height are ignored
	targetWin.resizeTo(w, h);
	// Just in case left and top are ignored
	targetWin.moveTo(left, top);
	targetWin.focus();
} 


document.onkeypress = function (evt) { 
	
	if (document.all && document.URL) { 
		
		var curr_page = document.URL;
		var query_string = curr_page.substr(curr_page.indexOf("?"), curr_page.length);
		var pageID = document.getElementById("BD_PageID");
		
		if (pageID) { 
			pageID = pageID.firstChild.data;
		}
		
	
		// Innehåller sidans querystring pageID eller form pageID?
		if (query_string.indexOf("pageID") != -1 || pageID) { 
			
			if (event.shiftKey && event.ctrlKey && event.keyCode == "21") { 
                
                if (confirm("Vill du uppdatera den här sidan?")) {
					if (pageID != "") {
						location.href = '/bdadmin/myEditor.asp?pageID=' + pageID; 
					} else {
						location.href = '/bdadmin/myEditor.asp' + query_string; 
					}
				}
			}
		}
	}
	
	return true;
}




