﻿function NewWindow(href, windowName, width, height, scrollable) 
{
    var posLeft = (screen.width - width) / 2;
    var posTop = (screen.height - height) / 2;
    var properties = 'height = ' + height + ', width = ' + width + ', top = '+ posTop + ', left = ' + posLeft + ', scrollbars = ' + scrollable + ', resizable';
    var win = window.open(href, windowName, properties);
    win.window.focus();
}

var ImageHelper = 
{
    tmpImages : new Array(),

    newImage : function(document, id, url) 
    {
        this.tmpImages[id] = new Image();
        this.tmpImages[id].src = url;
        return this.tmpImages[id];
    },

    changeImage : function(document, id, url)
    {
        document.getElementById(id).src = url;
    },
    
    setMenuItemMouseHandlers : function (document, id, normalUrl, hoverUrl)
    {
        var image = document.getElementById(id);
        if (image)
        {
            image.onmouseover = function() { ImageHelper.changeImage(document, id, hoverUrl); return true; }
            image.onmouseout = function() { ImageHelper.changeImage(document, id, normalUrl); return true; }
        }
    }
};

