﻿// Alpha Image Script...

// Define Namespace...

if (!WillCurson) var WillCurson = {};
if (!WillCurson.AlphaImage) WillCurson.AlphaImage = {};

//--------------------------------------------------------------------------------

// Globals...

// Namespace Shorthand...
var ns = WillCurson.AlphaImage

//--------------------------------------------------------------------------------

WillCurson.AlphaImage.mouseOver = function(node, imageURL, isIE6)
{
    // Mouse Over...

    try
    {
        // Namespace Shorthand...
        var ns = WillCurson.AlphaImage;
        
        // Set Image...
        if (isIE6)
        {
            // IE 6 Set Filter Image...
            node.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + imageURL + "', sizingMethod='scale')";
        }
        else
        {
            // Other Browsers Set Image...
            node.src = imageURL;
        }

        // Set Cursor...
        node.style.cursor = "pointer";
    }
    catch (e)
    {
        alert("AlphaImage.mouseOver Error: " + e.message);
    }
};

//--------------------------------------------------------------------------------

WillCurson.AlphaImage.mouseOut = function(node, imageURL, isIE6)
{
    // Mouse Out...

    try
    {
        // Namespace Shorthand...
        var ns = WillCurson.AlphaImage;

        // Set Image...
        if (isIE6)
        {
            // IE 6 Set Image...
           node.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + imageURL + "', sizingMethod='scale')";
        }
        else
        {
            // Other Browsers Set Image...
            node.src = imageURL;
        }

        // Set Cursor...
        node.style.cursor = "default";
    }
    catch (e)
    {
        alert("AlphaImage.mouseOut Error: " + e.message);
    }
};

//--------------------------------------------------------------------------------

WillCurson.AlphaImage.popupWindow = function popupWindow(url, width, height)
{
    // Open Popup Window...

    try
    {
        // Namespace Shorthand...
        var ns = WillCurson.AlphaImage;
        
        // Open Window...
        window.open(url, 'popup', 'width=' + width + ', height=' + height + ', toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, copyhistory=no, resizable=yes, screenX=200, screenY=200');
    }
    catch (e)
    {
        alert("AlphaImage.popupWindow Error: " + e.message);
    }
};

//--------------------------------------------------------------------------------
