/**
 * Change the image source
 */
function changeImage(node, imageName) {
    if (node.tagName == 'IMG') {
        node.src = "images/" + imageName;
    }
}

function createNewWindow(url, windowName) {
    var x;
    var y;
    var nWidth = 800;
    var nHeight = 600;

    if (top.screen.availWidth) {
        x = (top.screen.availWidth - nWidth) / 2;
    } else if (screen.availWidth) {
        x = (screen.availWidth - nWidth) / 2;
    }
    if (top.screen.availHeight) {
        y = (top.screen.availHeight - nHeight) / 2;
    } else if (screen.availHeight) {
        y = (screen.availHeight - nHeight) / 2;
    }

    if (!windowName) {
        windowName = 'popUp';
    }
    try {
        var win = window.open(url, windowName, "top=" + y + ", left=" + x
            + ", resizable=yes, status=no, scrollbars=yes");
    } catch (e) {
        alert(e);
        return;
    }
    win.location = url;
    win.focus();
}

