﻿/* This script requires jquery >= v1.2 */

// this function adds shadows to the item passed in - it wraps the item up in a new div and positions appropriately if possible - not tested in every circumstance, so may need adjusting
function addShadows(item)
{
    item=$(item);
    wrapper = $("<div class='jq_popup_outer'><div class='jq_core'></div></div>");
    wrapper.css('position', item.css('position')).css('top', item.css('top')).css('left', item.css('left')).css('width', item.outerWidth() + 8).css('height', item.outerHeight());
    item.css('position','static').css('top','').css('left','').css('margin', 0).css('padding',0).css('width','').css('height','');
    outer = item.wrap(wrapper).parents('.jq_popup_outer');
    outer.prepend("<div style='position: absolute; top: 0px; right: 0px; width: 8px; background-color: transparent;'><img src='/images/shadow_top.png' alt='' /><img src='/images/shadow_side.png' alt='' class='jq_shadow_side' /></div>");
    outer.append("<img src='/images/shadow_bottom_left.png' alt='' /><img src='/images/shadow_bottom.png' alt='' class='jq_shadow_bottom' /><img src='/images/shadow_bottom_right.png' alt='' />");
    var shadowSide = outer.find("img.jq_shadow_side");
    shadowSide.width(8).height(shadowSide.parents(".jq_popup_outer").find(".jq_core").height() - 8);
    var shadowbottom = outer.find("img.jq_shadow_bottom");
    shadowbottom.height(8).width(shadowbottom.parents(".jq_popup_outer").find(".jq_core").width() - 16);
    
    // return the new outer object
    return outer.get(0);
}

// returns true if the browser is god awful IE6 (apologies - 3 days of frustration)
function isIE6() {
    return(($.browser.msie) && ($.browser.version.substr(0,1) == '6'));
}

// returns true if the browser is god awful IE6 (apologies - 3 days of frustration)
function isIE() {
    return(($.browser.msie));
}
