/*
 * Internet Explorer 6 Upgrade Warning (XHTML)
 * Version:	1.3 (September 24, 2010)
 * Author:	Erik van Paassen (http://www.evpwebdesign.nl)
 * 
 * Dependencies:
 * - jQuery					(tested with v1.4.2)	(http;//www.jquery.com)
 * - jQuery Cookie plugin	(tested with v1.0)		(http://plugins.jquery.com/project/cookie)
 * 
 * THIS PROJECT IS LICENSED UNDER THE MIT LICENSE:
 * http://www.opensource.org/licenses/mit-license.php
 * 
 * Copyright (c) 2010 Erik van Paassen
 */

function ie6Bar(options){this.txtIE="Internet Explorer 8+";if(options.txtIE)this.txtIE=options.txtIE;this.urlIE="http://www.microsoft.com/windows/internet-explorer/";if(options.urlIE)this.urlIE=options.urlIE;this.txtFirefox="Mozilla Firefox 3.0+";if(options.txtFirefox)this.txtFirefox=options.txtFirefox;this.urlFirefox="http://www.firefox.com/";if(options.urlFirefox)this.urlFirefox=options.urlFirefox;this.txtChrome="Google Chrome 3.0+";if(options.txtChrome)this.txtChrome=options.txtChrome;this.urlChrome="http://chrome.google.com/";if(options.urlChrome)this.urlChrome=options.urlChrome;this.txtSafari="Safari 3+";if(options.txtSafari)this.txtSafari=options.txtSafari;this.urlSafari="http://www.apple.com/safari/download/";if(options.urlSafari)this.urlSafari=options.urlSafari;this.txtOpera="Opera 9.5+";if(options.txtOpera)this.txtOpera=options.txtOpera;this.urlOpera="http://www.opera.com/download/";if(options.urlOpera)this.urlOpera=options.urlOpera;this.txtTitle="We see you use Internet Explorer 6, but we can no longer support this browser...";if(options.txtTitle)this.txtTitle=options.txtTitle;this.txtSubTitle="That's why we strongly recommend you to upgrade to a more modern browser, like Internet Explorer 8.";if(options.txtSubTitle)this.txtSubTitle=options.txtSubTitle;this.txtMoreInfo="More information";if(options.txtMoreInfo)this.txtMoreInfo=options.txtMoreInfo;this.txtExplanation="The five browsers below are supported. <strong>Click on a logo to upgrade.</strong>";if(options.txtExplanation)this.txtExplanation=options.txtExplanation;this.txtClose="Close and don't show again";if(options.txtClose)this.txtClose=options.txtClose;this.cookieName="ie6bar";if(options.cookieName)this.cookieName=options.cookieName;this.cookieDays=1;if(options.cookieDays)this.cookieDays=options.cookieDays;this.overlay=true;if(options.overlay)this.overlay=options.overlay;if(options.contentWidth)this.contentWidth=options.contentWidth;this.html='<div id="ie6-warning-wrapper">   <div id="ie6-warning">    <div id="ie6-warning-container">     <div id="ie6-warning-logo"></div>     <div id="ie6-warning-text">      <span id="ie6-warning-title">'+this.txtTitle+'</span>      '+this.txtSubTitle+'     </div>          <div id="ie6-warning-moreinfo">'+this.txtMoreInfo+'</div>          <div id="ie6-warning-explanation">'+this.txtExplanation+'</div>          <div id="ie6-warning-details">      <a class="ie6-warning-browserbutton" href="'+this.urlIE+'" target="_blank">       <span class="ie6-warning-browserbutton">        <a href="'+this.urlIE+'" target="_blank">         <span id="ie6bar-warning-browserbutton-ie"></span>        </a>        <span class="ie6-warning-browserbutton-title">'+this.txtIE+'</span>       </span>      </a>            <a class="ie6-warning-browserbutton" href="'+this.urlFirefox+'" target="_blank">       <span class="ie6-warning-browserbutton">        <a href="'+this.urlFirefox+'" target="_blank">         <span id="ie6bar-warning-browserbutton-firefox"></span>        </a>        <span class="ie6-warning-browserbutton-title">'+this.txtFirefox+'</span>       </span>      </a>            <a class="ie6-warning-browserbutton" href="'+this.urlChrome+'" target="_blank">       <span class="ie6-warning-browserbutton">        <a href="'+this.urlChrome+'" target="_blank">         <span id="ie6bar-warning-browserbutton-chrome"></span>        </a>        <span class="ie6-warning-browserbutton-title">'+this.txtChrome+'</span>       </span>      </a>            <a class="ie6-warning-browserbutton" href="'+this.urlSafari+'" target="_blank">       <span class="ie6-warning-browserbutton">        <a href="'+this.urlSafari+'" target="_blank">         <span id="ie6bar-warning-browserbutton-safari"></span>        </a>        <span class="ie6-warning-browserbutton-title">'+this.txtSafari+'</span>       </span>      </a>            <a class="ie6-warning-browserbutton" href="'+this.urlOpera+'" target="_blank">       <span class="ie6-warning-browserbutton">        <a href="'+this.urlOpera+'" target="_blank">         <span id="ie6bar-warning-browserbutton-opera"></span>        </a>        <span class="ie6-warning-browserbutton-title">'+this.txtOpera+'</span>       </span>      </a>     </div>    </div>    <a id="ie6-warning-close" title="'+this.txtClose+'"></a>   </div>  </div>';return true};ie6Bar.prototype.initialize=function(){if(jQuery.cookie(this.cookieName)!="hide"){jQuery("body").prepend(this.html);if(this.overlay)jQuery("#ie6-warning-wrapper").addClass('ie6-warning-overlay');if(this.contentWidth)jQuery("#ie6-warning-container").css({width:this.contentWidth});jQuery("div#ie6-warning").fadeIn(200);jQuery("a#ie6-warning-close").bind("click",{cookieName:this.cookieName,cookieDays:this.cookieDays},function(event){jQuery.cookie(event.data.cookieName,"hide",{expires:event.data.cookieDays});jQuery("span.ie6-warning-browserbutton").fadeOut(400,function(){jQuery("div#ie6-warning-details").slideUp(500,function(){jQuery("div#ie6-warning").slideUp(500)})})});jQuery("div#ie6-warning-container").click(function(){jQuery("div#ie6-warning-moreinfo").fadeOut(250,function(){jQuery("div#ie6-warning-explanation").fadeIn(500,function(){jQuery("div#ie6-warning").addClass("ie6-warning-expanded");jQuery("div#ie6-warning-details").slideDown(500,function(){jQuery("span.ie6-warning-browserbutton").fadeIn(400)})})})})}}

jQuery(document).ready(
	function() {
		var options = { };
		
		/*
		 * Example configuration: Dutch translation.
		 * See 'docs/index.html#configuration' for all configuration directives.
		 */
		
		var options = {
			txtTitle:		"Wie wir sehen, benutzen Sie Internet Explorer 6. Leider k&ouml;nnen wir diesen Browser nicht mehr unterst&uuml;tzen.",
			txtSubTitle:	"Diese Version ist stark veraltet und \<a href\=\"http://www.ie6countdown.com\" target=\"_blank\"\>sogar Microsoft bittet darum\</a\>, sie nicht mehr zu verwenden.",
			txtMoreInfo:	"Weitere Informationen",
			txtExplanation:	"Folgende Browser werden von unserer Webseite weiterhin unterst&uuml;tzt.<br /> <strong>Bitte klicken Sie auf ein Logo, um einen neueren Browser herunterzuladen.</strong>",
			txtClose:		"Schlie&szlig;en",
			
			urlIE:			"http://www.microsoft.com/germany/windows/internet-explorer/",
			urlSafari:		"http://www.apple.com/de/safari/download/",
			
			contentWidth:	900
		};
		
		
		// Create a new ie6Bar-object and initialize the bar.
		var i6b = new ie6Bar(options);
		i6b.initialize();
	}
);
