// (c) 2009 SilvesterWebDesigns.com - Stuart Silvester. Thanks to the SevenUp Project.
$(document).ready(function () {
    function isCookieSet() {
        if (document.cookie.length > 0) { var i = document.cookie.indexOf("updateie6now="); return (i != -1); }
        return false;
    }
    var needUpgrade = /(MSIE 6|MSIE 5.(\d+))/i.test(navigator.userAgent);

    if (needUpgrade) {

      
       // $('#content').supersleight();
    }

    if (needUpgrade && !isCookieSet()) { $("body").prepend('<div class="updateie6" style="display:none;" ><h3 style="margin: 0px;border-bottom:none">Your web browser is outdated or unsupported</h3>You can easily upgrade to the latest version by clicking <a href="http://www.microsoft.com/windows/internet-explorer/default.aspx" target="_blank">here</a>. Alternatively contact your IT helpdesk.<div id="whyupcontent" style="display:none; border-bottom:none"> <h3>Why should I upgrade?</h3> <ul><li><strong>Websites load faster</strong>, often double the speed of this older version</li> <li><strong>Websites look better</strong> with more web standards compliance</li> <li><strong>Tabs</strong> let you view multiple sites in one window</li> <li><strong>Safer browsing</strong> with phishing protection</li> <li><strong>Convenient Printing</strong> with fit-to-page capability</li> </ul></div><span id="hideme" style="display: none;"><a href="#" id="whyupgrade">Why should I upgrade?</a> </span></div>'); $('div.updateie6').slideDown('fast'); $("span#hideme").fadeIn("fast"); $("a#whyupgrade").click(function () { $("div#whyupcontent").slideDown("fast"); }); $("a#goaway").click(function () { $("div.updateie6").slideUp("fast", function () { $(this).remove() }); var exp = new Date(); exp.setTime(exp.getTime() + (7 * 24 * 3600000)); document.cookie = "updateie6now=hide; expires=" + exp.toUTCString(); window.location.reload(); }); };
});




//alpha transparancey fix for IE6... !
jQuery.fn.supersleight = function (settings) {
    settings = jQuery.extend({
        imgs: false,
        backgrounds: true,
        shim: 'x.gif',
        apply_positioning: true
    }, settings);

    return this.each(function () {
        if (jQuery.browser.msie && parseInt(jQuery.browser.version, 10) < 7 && parseInt(jQuery.browser.version, 10) > 4) {
            jQuery(this).find('*').andSelf().each(function (i, obj) {
                var self = jQuery(obj);
                // background pngs
                if (settings.backgrounds && self.css('background-image').match(/\.png/i) !== null) {
                    var bg = self.css('background-image');
                    var src = bg.substring(5, bg.length - 2);
                    var mode = (self.css('background-repeat') == 'no-repeat' ? 'crop' : 'scale');
                    var styles = {
                        'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='" + mode + "')",
                        'background-image': 'url(' + settings.shim + ')'
                    };
                    self.css(styles);
                };

                // image elements
                if (settings.imgs && self.is('img[src$=png]')) {
                    var styles = {
                        'width': self.width() + 'px',
                        'height': self.height() + 'px',
                        'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + self.attr('src') + "', sizingMethod='scale')"
                    };
                    self.css(styles).attr('src', settings.shim);
                };

                // apply position to 'active' elements
                if (settings.apply_positioning && self.is('a, input') && (self.css('position') === '' || self.css('position') == 'static')) {
                    self.css('position', 'relative');
                };
            });
        };
    });
};


