// Pixelsilk IE Detector Plugin
// Version 1.0.3 - DMC
// Last Update: 12/12/2011 - DMC
// This simple plugin will detect which version of Internet Explorer the user is using and display an appropriate "upgrade" message.

// Update 12/12/2011: Add cookie function to set a cookie and prevent the message from displaying on every page load.

// ## Syntax ##
// if you wish to add the message to the <body> tag, use this:

// $('body').ieDetector();

jQuery.fn.ieDetector=function(a){var b={browserVersion:6,slideDownSpeed:1e3,slideUpSpeed:500,elementID:"browserAlert",barClose:true,barTextAlign:"center",barPosition:"absolute",barPositionLeft:"0",barWidth:"100%",barZindex:"1000",barOpacity:"0.90",barBorderBottom:"solid 1px #a29330",barAlertGraphic:"/browser-alert.gif",barForegroundColor:"#000",barBackgroundColor:"#fdf2ab",linkColor:"#00f",contentMargin:"0 auto",contentPadding:"5px 30px",contentMaxWidth:"850px",content:'<p><strong>Did you know that your version of Internet Explorer is out of date?</strong> To get the best possible experience using our website, we recommend that you <a href="http://www.microsoft.com/windows/internet-explorer/default.aspx" target="_blank">upgrade your current browser</a>, or install another web browser. Here is a list of the most popular web browsers: <strong><a href="http://www.getfirefox.com" target="_blank">FireFox</a></strong>, <a href="http://www.google.com/chrome" target="_blank">Chrome</a>, <a href="http://www.opera.com" target="_blank">Opera</a>.</p>',cookie:true,cookieName:location.host.replace(/\./g,"")+"_broswer_version_cookie"};var a=$.extend(b,a);if(jQuery.browser.msie&&jQuery.browser.version<=a.browserVersion){function c(a,b,c){if(c){var d=new Date;d.setTime(d.getTime()+c*24*60*60*1e3);var e="; expires="+d.toGMTString()}else var e="";document.cookie=a+"="+b+e+"; path=/"}function d(a){var b=a+"=";var c=document.cookie.split(";");for(var d=0;d<c.length;d++){var e=c[d];while(e.charAt(0)==" ")e=e.substring(1,e.length);if(e.indexOf(b)==0)return e.substring(b.length,e.length)}return null}function e(a){c(a,"",-1)}if(a.cookie&&!d(a.cookieName)){c(a.cookieName,"true","")}else if(a.cookie&&d(a.cookieName).length>-1){return false}$(this).append('<div id="'+a.elementID+'" style="color:'+a.barForegroundColor+';"></div>');var f={"text-align":a.barTextAlign,position:a.barPosition,left:a.barPositionLeft,width:a.barWidth,"z-index":a.barZindex,opacity:a.barOpacity,"border-bottom":a.barBorderBottom,background:""+a.barBackgroundColor+" url("+a.barAlertGraphic+") no-repeat 5px center"};var g={margin:a.contentMargin,padding:a.contentPadding,"max-width":a.contentMaxWidth};if($("#"+a.elementID).size()>0){$("#"+a.elementID).css({top:"-"+$(this).height()+"px"}).html(a.content).css(f).find("p").css(g).parent().animate({top:"0"},a.slideDownSpeed);$("#"+a.elementID+" a").css({color:a.linkColor})}if(a.barClose){$("#"+a.elementID).append('<div id="barClose" title="Close">X</div>');$("#barClose").css({position:"absolute",top:"5px",right:"5px",display:"block",width:"18px",height:"18px",overflow:"hidden",cursor:"pointer",color:"#000",border:"solid 2px #f00",background:"#fff"});$("#barClose").click(function(){$("#"+a.elementID).animate({top:"-"+$("#"+a.elementID).height()+"px"},a.slideUpSpeed)})}}}
