$(document).ready(function() {
$('#warningClose').click(function(e){
e.preventDefault();
$('#browserWarning').slideUp('slow');
return false;
});
$('#chromeFrameOpen').click(function(e) {
e.preventDefault();
openChromeFrame($(this).data('url'));
return false;
});
});
// Launch the Chrome Frame check
function openChromeFrame(url) {
CFInstall.check({
mode:'overlay',
destination: url
});
}
// Source derived from http://think2loud.com/147-build-an-unsupported-browser-warning-with-jquery/
function badBrowser(url){
var badBrowserMessage = "You are using an unsupported browser. Please install Google Chrome Frame or switch to Firefox or Google Chrome. Thanks! [close]";
$(document.createElement('div')).attr('id', 'browserWarning')
.html(badBrowserMessage)
.data('url', url)
.css({
'background-color': '#f9db17',
'color': '#000000',
'width': '100%',
'border-top': 'solid 1px #000',
'border-bottom': 'solid 1px #000',
'text-align': 'center',
'padding': '5px 0px 5px 0px'
})
.prependTo("body")
.hide();
$('#browserWarning').slideDown('slow');
}