document.observe('dom:loaded', function() {
    document.fire('pmp:styleDropdowns');
    showIE6Alert();
});

function setCookie(c_name, value, duration) {
    var exdate = new Date();
    var date = new Date();
    var days = duration || 0;
    date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
    document.cookie = c_name + "=" + escape(value);
}

function getCookie(c_name) {
    if (document.cookie.length > 0) {
        var c_start = document.cookie.indexOf(c_name + "=");
        if (c_start != -1) {
            c_start = c_start + c_name.length + 1;
            var c_end = document.cookie.indexOf(";", c_start);
            if (c_end == -1) c_end = document.cookie.length;
            return unescape(document.cookie.substring(c_start, c_end));
        }
    }
    return null;
}

function showIE6Alert() {
    var a = navigator.userAgent.toLowerCase();
    var v = parseInt(navigator.appVersion);
    var ie = ((a.indexOf("msie") != -1) && (a.indexOf("opera") == -1));
    var ie6 = (ie && (v == 4) && (a.indexOf("msie 6.") != -1) );
    if (ie6 && !getCookie('ie6used')) {
        setCookie('ie6used', 1, 100000);
        var ie6alert = new lightbox(new Element('a', { href: '/content/includes/ie6_alert.jhtml' }));
        ie6alert.activate({ stop: function() { }});
    }
}

