window.history.forward(1);
// open new window
function openAppWindow(url, name, w, h) {
 //   alert('status=yes,resizable=no,toolbar=no,scrollbars=no' + winCenterCoordinates(w,h));
     var debug = 'no';
    // debug = 'yes';
//    onclick="openAppWindow('', 'appwin', 500, 270);window.opener=null;"
    var configStr = 'status=yes,resizable=' + debug + ',toolbar=' + debug + ',scrollbars=' + debug + winCenterCoordinates(w,h);
//    alert(configStr);
    popupWin = window.open(url, name, configStr);
    if (!popupWin.opener) {
        popupWin.opener = self;
    }
}
// open new window
function openWindow(url, name, rs, w, h) {
    alert('wtf');
    var resize = "";
    if (rs) {
        resize = "resizable,";
    }
    popupWin = window.open(url, name, 'scrollbars, menubar, ' +resize + 'width = ' +w + ',height = ' +h);

    if (!popupWin.opener) {
        popupWin.opener = self;
    }
}
function openNewWindow(URLtoOpen, windowName, windowFeatures) {
//    alert(URLtoOpen + ' -- ' +  windowName + ' -- ' + windowFeatures)
    newWindow = window.open(URLtoOpen, windowName, windowFeatures);
}

function winCenterCoordinates(w, h) {
    LeftPosition = (screen.width) ? (screen.width - w) / 2 : 0;
    TopPosition = (screen.height) ? (screen.height - h) / 2 : 0;
    position = ',top = ' +TopPosition + ',left = ' +LeftPosition + ',height = ' +h + ',width = ' +w;
    return position;
}
