window.i3.std.dist = {}

window.i3.std.dist.globalInherit = function(type)
{
    var object = null;
    if (type)
    {
        if (type.prototype)
            switch(type.prototype.toString)
            {
                case 'String':
                    if ($(type).length > 0)
                        object = $(type);
                    else
                        object = $('#'+type);
                break;
                
                case 'Object':
                    object = $(type);
                break;
            }
        else
            if ($(type).length > 0)
                object = $(type);
            else
                object = $('#'+type);
    }
    else
        object = $(document.body);
    
    if (window.Cufon)
    {
        Cufon.replace('.MyriadPro', { fontFamily: 'MyriadPro' });
    }
    
    if (i3.cart)
    {        
        $(object).find(".productDetails .addToCart.quick").unbind('click').click(function(ev)
        {
            ev.preventDefault();
            
            i3.cart.addQuickToCart(this);
        });
    }

    if (window.DD_roundies)
    {
        DD_roundies.addRule('.sfourCorners', '3px 3px 3px 3px', true);
        DD_roundies.addRule('.fourCorners', '5px 5px 5px 5px', true);
        DD_roundies.addRule('.twoCornersTop', '5px 5px 0px 0px', true);
        DD_roundies.addRule('.twoCornersBottom', '0px 0px 5px 5px', true);
        DD_roundies.addRule('.ltrbCorner', '5px 0px 0px 5px', true);
        DD_roundies.addRule('.ltCorner', '5px 0px 0px 0px', true);
    }
}
