/* Author: Tim Beglinger
*/

$(window).load(function() {
	$("#background").fullBg();
});



/* Author: http://www.htmldog.com/articles/suckerfish/dropdowns/
*/
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);



/* Font size
*/


jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){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()}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{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]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break}}}return cookieValue}};


$(document).ready(function() {
 if($.cookie('TEXT_SIZE')) {
  $('body').addClass($.cookie('TEXT_SIZE')); 
 }
 $('.resizer a').click(function() {
  var textSize = $(this).attr('class');
  $('body').removeClass('medium large').addClass(textSize);
  $.cookie('TEXT_SIZE',textSize, { path: '/', expires: 10000 });
  return false;
 });
});  



/*! ResponsiveSlides.js v1.03. (c) 2011 Viljami Salminen. MIT License. http://responsive-slides.viljamis.com  */
(function(a){a.fn.responsiveSlides=function(e){var c={speed:4E3,fade:1E3,auto:!0,maxwidth:"none",namespace:"rs"};return this.each(function(){var b=a(this);e&&a.extend(c,e);var g=function(){var a=parseFloat(c.maxwidth);e.maxwidth&&"undefined"===typeof document.body.style.maxHeight&&b.each(function(){b.css("width","100%");b.width()>a?b.css("width",a):b.width()<a&&b.css("width","100%")})};(function(){var f=b.find("img"),d=c.namespace,j=d+"_here",h=d+"_on",i=d+"_s",e=d+"_tabs",d=a('<ul class="'+e+'" />'),
k=parseFloat(c.fade),l={position:"relative","float":"left"},g={position:"absolute","float":"none"};1>=b.find(f).length||(f.each(function(a){this.id=i+a}),f.css({top:0,left:0,width:"100%",height:"inherit",position:"absolute"}),b.css({"max-width":parseFloat(c.maxwidth),width:"100%",overflow:"hidden",position:"relative"}),b.find(":first-child").css(l),b.find(f+":gt(0)").hide(),!0===c.auto?setInterval(function(){b.find(":first-child").fadeOut(k,function(){a(this).css(g)}).next(f).fadeIn(k,function(){a(this).css(l)}).end().appendTo(b)},
parseFloat(c.speed)):(tabMarkup="",f.each(function(a){a+=1;tabMarkup+=["<li>",'<a href="#'+i+a+'"','class="'+i+a+'">'+a+"</a>","</li>"].join("")}),d.append(tabMarkup),b.after(d).find(":first-child").addClass(h),a("."+i+"1").parent().addClass(j),a("."+e+" a").each(function(b){var c=a(this);c.click(function(d){d.preventDefault();if(a("."+h+":animated").length)return!1;c.parent().hasClass(j)||(a("."+e+" li").removeClass(j),a("."+h).stop().fadeOut(k,function(){a(this).removeClass(h).css(g)}).end(),a("#"+
i+b).stop().fadeIn(k,function(){a(this).addClass(h).css(l)}).end(),c.parent().addClass(j))})})))})();g();a(window).resize(function(){g()})})}})(jQuery);



