﻿// JScript File

// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
var IE = document.all ? true : false;


// Pass in a document element and it returns the opacity value
// as a floating point value between (0.0 - 1.0)
function getOpacity(node)
{
    var value;
    if (node.filters) 
    {// IE opacity
        value = 1;
        try {
            value = node.filters.item('DXImageTransform.Microsoft.Alpha').opacity / 100;
        } catch(e) {
            try {
                value = node.filters.item('alpha').opacity / 100;
            } catch(e) {
            }
        }
    }
    else if (node.style['opacity']) 
    {
        value = node.style['opacity'];
    }

    return value;
} 
 
 
      
function setOpacity(node, percent)
{
    if(typeof document.all != 'undefined')
        node.style["filter"] = "alpha(opacity=" + (percent * 100) + ")";
    if(typeof node.style.opacity != 'undefined')
        node.style.opacity = percent;
}


function disableSelection(element) 
{
    if(element)
    {
        element.onselectstart = function(){ return false; };
        element.unselectable = "on";
        element.style.MozUserSelect = "none";
        element.style.cursor = "default";
    }
}