var IE6 = (navigator.userAgent.indexOf("MSIE 6")>=0) ? true : false;
if(IE6){
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24* 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};
if( $.cookie('iesix') == null ) { 
	$(function(){
		
		$("<div id=\"block-bg\">")
			.css({
				'position': 'absolute',
				'top': '0px',
				'left': '0px',
				backgroundColor: '#000',
				'opacity': '0.9',
				'width': '100%',
				'height': '250%',
				zIndex: 2
			})
			.appendTo("body");
		$("<div id=\"warning\"><a href=\"#\" class=\"close\"><img src=\"assets/templates/main/images/close_pop.png\" class=\"btn_close\" title=\"Close Window\" alt=\"Close\" /></a><p>You seem to be using Internet Explorer 6, it really is time for a browser upgrade!</p><p>Mainly because IE6 is 10 years old and has already been replaced by three newer versions.</p><p>Major sites such as Google and YouTube and even Microsoft are dropping support for IE6, as reported on the BBC's News website a year ago. </p><p>To view all the features of this and most other modern websites as intended please upgrade your browser to something more modern such as <a href=\"http://www.mozilla.com/en-US/firefox/fx/\" class=\"external\">FireFox</a>,<a href=\"http://www.apple.com/safari/download/\" class=\"external\"> Safari</a>,<a href=\"http://www.google.com/chrome/intl/en-GB/landing_tv.html\" class=\"external\"> Chrome</a> or a newer version of <a href=\"http://windows.microsoft.com/en-US/internet-explorer/downloads/ie-8\" class=\"external\"> Internet Explorer</a></p></div>")
			.css({
				backgroundColor: '#fff',
				border: '10px solid #b36100',
				'text-align': 'left',
				'font-weight': 'bold',
				'top': '15%',
				'left': '50%',
				marginLeft: -260,
				marginTop: -50,
				width: 520,
				padding: 30,
				fontSize: '1.6em',
				lineHeight: '1.6em',
				letterSpacing: '0.15em',
				'position': 'absolute',
				zIndex: 3
			})
			.appendTo("body");
	});
	}
	
	$('.close, #block-bg').live('click', function() { //When clicking on the close or fade layer...
        $('#warning, #block-bg').fadeOut(); //fade them both out
        $('#block-bg').remove();
        $.cookie('iesix', 'no_show', { 'expires': 365 } );
        return false;
    });
    		
}
