//var gmyWin=null;

function visaDialog(sida, namn, hojd, bredd, scroll) {
    var egenskaper;
    var t=(screen.height-hojd)/2;
    var l=(screen.width-bredd)/2;
	
    egenskaper = 'toolbar=no,status=no,menubar=no,scrollbars='+scroll+',resizable=yes,' +
                 'top='+t+',left='+l+',height=' + hojd + ',width=' + bredd
    window.open(sida, namn, egenskaper)

}

function visaModalDialog(sida, namn, hojd, bredd, scroll) {
    var egenskaper;
    var res;

    if (window.showModalDialog) {
        egenskaper = 'dialogHeight: ' + hojd + 'px; dialogWidth: ' + bredd + 'px; center: yes; help: no; resizable: yes; status: no; scroll: ' + scroll + ';';
        res = window.showModalDialog(sida, namn, egenskaper)
        return res;
    }
    else {
        var t=(screen.height-hojd)/2;
        var l=(screen.width-bredd)/2;
    	
        egenskaper = 'toolbar=no,status=no,menubar=no,scrollbars='+scroll+',resizable=yes,' +
                     'top='+t+',left='+l+',height=' + hojd + ',width=' + bredd + ',modal=yes'
        window.open(sida, namn, egenskaper)
        return "ok";
    }
}
/*function myOpenWindow(winURL, winName, winObj) {
	var theWin; // this will hold our opened window

	// first check to see if the window already exists
	if (winObj != null) {
		// the window has already been created, but did the user close it?
		// if so, then reopen it. Otherwise make it the active window.
		if (!winObj.closed) {
			winObj.focus();
			return winObj;
		}
		// otherwise fall through to the code below to re-open the window
	}
	// if we get here, then the window hasn't been created yet, or it
	// was closed by the user.
	theWin = window.open(winURL, winName);
	return theWin;
}

function Nyckeltal() {
	gmyWin=myOpenWindow('KDBS/ValjParam.aspx','myWin',gmyWin);
}
		
function visaKdbDialog(sida, namn, hojd, bredd) {
    var egenskaper
    var scroll='no'
    var t=(screen.height-hojd)/2
    var l=(screen.width-bredd)/2
	
    egenskaper = 'toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,' +
                 'top='+t+',left='+l+',height=' + hojd + ',width=' + bredd
    window.open(sida, namn, egenskaper)
}
*/