/*
 * jQuery jFontSize Plugin
 * Examples and documentation: http://jfontsize.com
 * Author: Frederico Soares Vanelli
 *         fredsvanelli@gmail.com
 *         http://twitter.com/fredvanelli
 *         http://facebook.com/fred.vanelli
 *
 * Copyright (c) 2011
 * Version: 1.0 (2011-07-13)
 * Dual licensed under the MIT and GPL licenses.
 * http://jfontsize.com/license
 * Requires: jQuery v1.2.6 or later
 */
(function($) {$.fn.jfontsize = function(opcoes) {var $this = $(this);var defaults = {btnMinusClasseId : '#jfontsize-minus',btnDefaultClasseId : '#jfontsize-default',btnPlusClasseId : '#jfontsize-plus',btnMinusMaxHits : 10,btnPlusMaxHits : 10,sizeChange : 1};if(($.isArray(opcoes)) || (!opcoes)) {opcoes = $.extend(defaults, opcoes);} else {defaults.sizeChange = opcoes;opcoes = defaults;}var limite = new Array();var fontsize_padrao = new Array();$(this).each(function(i) {limite[i] = 0;fontsize_padrao[i];});$('#jfontsize-minus, #jfontsize-default, #jfontsize-plus').removeAttr('href');$('#jfontsize-minus, #jfontsize-default, #jfontsize-plus').css('cursor', 'pointer');$('#jfontsize-minus').click(function() {$this.each(function(i) {if(limite[i] > (-(opcoes.btnMinusMaxHits))) {fontsize_padrao[i] = $(this).css('font-size');fontsize_padrao[i] = fontsize_padrao[i].replace('px', '');fontsize = $(this).css('font-size');fontsize = parseInt(fontsize.replace('px', ''));fontsize = fontsize - (opcoes.sizeChange);fontsize_padrao[i] = fontsize_padrao[i] - (limite[i] * opcoes.sizeChange);limite[i]--;$(this).css('font-size', fontsize + 'px');}})});$('#jfontsize-default').click(function() {$this.each(function(i) {limite[i] = 0;$(this).css('font-size', fontsize_padrao[i] + 'px');})});$('#jfontsize-plus').click(function() {$this.each(function(i) {if(limite[i] < opcoes.btnPlusMaxHits) {fontsize_padrao[i] = $(this).css('font-size');fontsize_padrao[i] = fontsize_padrao[i].replace('px', '');fontsize = $(this).css('font-size');fontsize = parseInt(fontsize.replace('px', ''));fontsize = fontsize + opcoes.sizeChange;fontsize_padrao[i] = fontsize_padrao[i] - (limite[i] * opcoes.sizeChange);limite[i]++;$(this).css('font-size', fontsize + 'px');}})})};})(jQuery);
/*
 * jQuery One Page Nav Plugin
 * http://github.com/davist11/jQuery-One-Page-Nav
 *
 * Copyright (c) 2010 Trevor Davis (http://trevordavis.net)
 * Dual licensed under the MIT and GPL licenses.
 * Uses the same license as jQuery, see:
 * http://jquery.org/license
 *
 * @version 0.6
 */
(function(e){e.fn.onePageNav=function(j){var g=e.extend({},e.fn.onePageNav.defaults,j),c={};c.sections={};c.bindNav=function(b,d,a){var f=b.parent(),h=b.attr("href"),i=e(window);if(!f.hasClass(a.currentClass)){a.begin&&a.begin();c.adjustNav(d,f,a.currentClass);i.unbind(".onePageNav");e.scrollTo(h,a.scrollSpeed,{onAfter:function(){if(a.changeHash)window.location.hash=h;i.bind("scroll.onePageNav",function(){c.scrollChange(d,a.currentClass)});a.end&&a.end()}})}};c.adjustNav=function(b,d,a){b.find("."+
a).removeClass(a);d.addClass(a)};c.getPositions=function(b){b.find("a").each(function(){var d=e(this).attr("href"),a=e(d).offset();a=a.top;c.sections[d.substr(1)]=Math.round(a)})};c.getSection=function(b){var d="",a=Math.round(e(window).height()/2);for(var f in c.sections)if(c.sections[f]-a<b)d=f;return d};c.scrollChange=function(b,d){c.getPositions(b);var a=e(window).scrollTop();a=c.getSection(a);a!==""&&c.adjustNav(b,b.find("a[href=#"+a+"]").parent(),d)};c.init=function(b,d){b.find("a").bind("click",
function(f){c.bindNav(e(this),b,d);f.preventDefault()});c.getPositions(b);var a=false;e(window).bind("scroll.onePageNav",function(){a=true});setInterval(function(){if(a){a=false;c.scrollChange(b,d.currentClass)}},250)};return this.each(function(){var b=e(this),d=e.meta?e.extend({},g,b.data()):g;c.init(b,d)})};e.fn.onePageNav.defaults={currentClass:"current",changeHash:false,scrollSpeed:750,begin:false,end:false}})(jQuery);
/**
 * jQuery.ScrollTo - Easy element scrolling using jQuery.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 5/25/2009
 * @author Ariel Flesler
 * @version 1.4.2
 *
 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
 */
;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);/*!
 * jQuery Tools v1.2.6 - The missing UI library for the Web
 * 
 * overlay/overlay.js
 * overlay/overlay.apple.js
 * toolbox/toolbox.expose.js
 * 
 * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
 * 
 * http://flowplayer.org/tools/
 * 
 */
(function(a){a.tools=a.tools||{version:"v1.2.6"},a.tools.overlay={addEffect:function(a,b,d){c[a]=[b,d]},conf:{close:null,closeOnClick:!0,closeOnEsc:!0,closeSpeed:"fast",effect:"default",fixed:!a.browser.msie||a.browser.version>6,left:"center",load:!1,mask:null,oneInstance:!0,speed:"normal",target:null,top:"10%"}};var b=[],c={};a.tools.overlay.addEffect("default",function(b,c){var d=this.getConf(),e=a(window);d.fixed||(b.top+=e.scrollTop(),b.left+=e.scrollLeft()),b.position=d.fixed?"fixed":"absolute",this.getOverlay().css(b).fadeIn(d.speed,c)},function(a){this.getOverlay().fadeOut(this.getConf().closeSpeed,a)});function d(d,e){var f=this,g=d.add(f),h=a(window),i,j,k,l=a.tools.expose&&(e.mask||e.expose),m=Math.random().toString().slice(10);l&&(typeof l=="string"&&(l={color:l}),l.closeOnClick=l.closeOnEsc=!1);var n=e.target||d.attr("rel");j=n?a(n):null||d;if(!j.length)throw"Could not find Overlay: "+n;d&&d.index(j)==-1&&d.click(function(a){f.load(a);return a.preventDefault()}),a.extend(f,{load:function(d){if(f.isOpened())return f;var i=c[e.effect];if(!i)throw"Overlay: cannot find effect : \""+e.effect+"\"";e.oneInstance&&a.each(b,function(){this.close(d)}),d=d||a.Event(),d.type="onBeforeLoad",g.trigger(d);if(d.isDefaultPrevented())return f;k=!0,l&&a(j).expose(l);var n=e.top,o=e.left,p=j.outerWidth({margin:!0}),q=j.outerHeight({margin:!0});typeof n=="string"&&(n=n=="center"?Math.max((h.height()-q)/2,0):parseInt(n,10)/100*h.height()),o=="center"&&(o=Math.max((h.width()-p)/2,0)),i[0].call(f,{top:n,left:o},function(){k&&(d.type="onLoad",g.trigger(d))}),l&&e.closeOnClick&&a.mask.getMask().one("click",f.close),e.closeOnClick&&a(document).bind("click."+m,function(b){a(b.target).parents(j).length||f.close(b)}),e.closeOnEsc&&a(document).bind("keydown."+m,function(a){a.keyCode==27&&f.close(a)});return f},close:function(b){if(!f.isOpened())return f;b=b||a.Event(),b.type="onBeforeClose",g.trigger(b);if(!b.isDefaultPrevented()){k=!1,c[e.effect][1].call(f,function(){b.type="onClose",g.trigger(b)}),a(document).unbind("click."+m).unbind("keydown."+m),l&&a.mask.close();return f}},getOverlay:function(){return j},getTrigger:function(){return d},getClosers:function(){return i},isOpened:function(){return k},getConf:function(){return e}}),a.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".split(","),function(b,c){a.isFunction(e[c])&&a(f).bind(c,e[c]),f[c]=function(b){b&&a(f).bind(c,b);return f}}),i=j.find(e.close||".close"),!i.length&&!e.close&&(i=a("<a class=\"close\"></a>"),j.prepend(i)),i.click(function(a){f.close(a)}),e.load&&f.load()}a.fn.overlay=function(c){var e=this.data("overlay");if(e)return e;a.isFunction(c)&&(c={onBeforeLoad:c}),c=a.extend(!0,{},a.tools.overlay.conf,c),this.each(function(){e=new d(a(this),c),b.push(e),a(this).data("overlay",e)});return c.api?e:this}})(jQuery);
(function(a){var b=a.tools.overlay,c=a(window);a.extend(b.conf,{start:{top:null,left:null},fadeInSpeed:"fast",zIndex:9999});function d(a){var b=a.offset();return{top:b.top+a.height()/2,left:b.left+a.width()/2}}var e=function(b,e){var f=this.getOverlay(),g=this.getConf(),h=this.getTrigger(),i=this,j=f.outerWidth({margin:!0}),k=f.data("img"),l=g.fixed?"fixed":"absolute";if(!k){var m=f.css("backgroundImage");if(!m)throw"background-image CSS property not set for overlay";m=m.slice(m.indexOf("(")+1,m.indexOf(")")).replace(/\"/g,""),f.css("backgroundImage","none"),k=a("<img src=\""+m+"\"/>"),k.css({border:0,display:"none"}).width(j),a("body").append(k),f.data("img",k)}var n=g.start.top||Math.round(c.height()/2),o=g.start.left||Math.round(c.width()/2);if(h){var p=d(h);n=p.top,o=p.left}g.fixed?(n-=c.scrollTop(),o-=c.scrollLeft()):(b.top+=c.scrollTop(),b.left+=c.scrollLeft()),k.css({position:"absolute",top:n,left:o,width:0,zIndex:g.zIndex}).show(),b.position=l,f.css(b),k.animate({top:f.css("top"),left:f.css("left"),width:j},g.speed,function(){f.css("zIndex",g.zIndex+1).fadeIn(g.fadeInSpeed,function(){i.isOpened()&&!a(this).index(f)?e.call():f.hide()})}).css("position",l)},f=function(b){var e=this.getOverlay().hide(),f=this.getConf(),g=this.getTrigger(),h=e.data("img"),i={top:f.start.top,left:f.start.left,width:0};g&&a.extend(i,d(g)),f.fixed&&h.css({position:"absolute"}).animate({top:"+="+c.scrollTop(),left:"+="+c.scrollLeft()},0),h.animate(i,f.closeSpeed,b)};b.addEffect("apple",e,f)})(jQuery);
(function(a){a.tools=a.tools||{version:"v1.2.6"};var b;b=a.tools.expose={conf:{maskId:"exposeMask",loadSpeed:"slow",closeSpeed:"fast",closeOnClick:!0,closeOnEsc:!0,zIndex:9998,opacity:.8,startOpacity:0,color:"#fff",onLoad:null,onClose:null}};function c(){if(a.browser.msie){var b=a(document).height(),c=a(window).height();return[window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,b-c<20?c:b]}return[a(document).width(),a(document).height()]}function d(b){if(b)return b.call(a.mask)}var e,f,g,h,i;a.mask={load:function(j,k){if(g)return this;typeof j=="string"&&(j={color:j}),j=j||h,h=j=a.extend(a.extend({},b.conf),j),e=a("#"+j.maskId),e.length||(e=a("<div/>").attr("id",j.maskId),a("body").append(e));var l=c();e.css({position:"absolute",top:0,left:0,width:l[0],height:l[1],display:"none",opacity:j.startOpacity,zIndex:j.zIndex}),j.color&&e.css("backgroundColor",j.color);if(d(j.onBeforeLoad)===!1)return this;j.closeOnEsc&&a(document).bind("keydown.mask",function(b){b.keyCode==27&&a.mask.close(b)}),j.closeOnClick&&e.bind("click.mask",function(b){a.mask.close(b)}),a(window).bind("resize.mask",function(){a.mask.fit()}),k&&k.length&&(i=k.eq(0).css("zIndex"),a.each(k,function(){var b=a(this);/relative|absolute|fixed/i.test(b.css("position"))||b.css("position","relative")}),f=k.css({zIndex:Math.max(j.zIndex+1,i=="auto"?0:i)})),e.css({display:"block"}).fadeTo(j.loadSpeed,j.opacity,function(){a.mask.fit(),d(j.onLoad),g="full"}),g=!0;return this},close:function(){if(g){if(d(h.onBeforeClose)===!1)return this;e.fadeOut(h.closeSpeed,function(){d(h.onClose),f&&f.css({zIndex:i}),g=!1}),a(document).unbind("keydown.mask"),e.unbind("click.mask"),a(window).unbind("resize.mask")}return this},fit:function(){if(g){var a=c();e.css({width:a[0],height:a[1]})}},getMask:function(){return e},isLoaded:function(a){return a?g=="full":g},getConf:function(){return h},getExposed:function(){return f}},a.fn.mask=function(b){a.mask.load(b);return this},a.fn.expose=function(b){a.mask.load(b,this);return this}})(jQuery);
/* BF functions | scripts.js */
/* Navigation: jumpTo ID using scrollTo with easing */
function jumpTo(link) {link.preventDefault(link);/* remove all active classes */jQuery('.menu li.current ul li a').removeClass("active");/* add class to clicked object */link.target.className += "active";/* stringify href value from clicked link */var whereTo = $(this).attr("href");/* remove leading hash sign (#) from clicked link */var targetLink = whereTo.substring(1);/* jump to target using jQ plugin */jQuery.scrollTo($("#" + targetLink), 850, {axis : 'y',easing : 'swing',onAfter : function(whereTo) {setTimeout(function() {window.location.hash = targetLink;hash = window.location.hash;}, 100);}});}function scrollToSubsection(anchor) {jQuery('.menu li.current ul li a').removeClass("active");jQuery.scrollTo('#' + anchor, 850, {axis : 'y',easing : 'swing'});}/* Read a page's GET URL variables and return them as an associative array. */function getUrlVars() {var vars = [], hash;var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');for(var i = 0; i < hashes.length; i++) {hash = hashes[i].split('=');vars.push(hash[0]);vars[hash[0]] = hash[1];}return vars;}function getUrlHash() {var hash, url;url = window.location.href;hash = url.substring(url.indexOf('#') + 1, url.length - 1);return hash;}function enableSend(){var buttonState = jQuery('#send').attr('disabled');var checkbox = jQuery('#disclaimer');if(buttonState === 'disabled' && $(checkbox).is(':checked'))  {jQuery('#send').removeAttr('disabled');} else if (!buttonState) {jQuery('#send').attr('disabled', 'disabled');}}function resetDisclaimer(){var disclaimer = jQuery('#disclaimer');if(typeof disclaimer !== undefined) {jQuery('#disclaimer').attr('checked', false);}}
jQuery(document).ready(function() {
/* go through all div.section and add z-index starting from highest value */var container = jQuery('.section');jQuery(container).each(function(i, e) {$(e).css('z-index', container.length - i);});
/* all .anker-links scroll smooth to local anchor! */jQuery('a.anker').click(function(e) {e.preventDefault();var anchor = $(this).attr('href');scrollToSubsection(anchor);});
/* check if we have a sub in the location.href and scrool smoothly to anchor */if(window.location.href.indexOf('?') != -1) {var subsection = getUrlVars()['sub'];scrollToSubsection(subsection);}/* FontSizing Plugin */jQuery('#content p, #content h2, #content h1, #content .introtext, #content .news_details, #content .text').jfontsize();
/* Load news content using AJAX and open hidden conatiner */jQuery('.news_more a.more').live('click', function(e) {e.preventDefault(e);var detailContainer = '#' + jQuery(this).attr('rel');var targetLink = jQuery(this).attr('href');var detail_text = jQuery.ajax({url : targetLink,success : function(data) {jQuery(detailContainer).html(data);},complete : function() {jQuery(detailContainer).slideDown(400);}});jQuery(this).hide();jQuery(this).next().show();});jQuery('.news_more a.less').live('click', function(e) {e.preventDefault(e);var detailContainer = '#' + jQuery(this).prev().attr('rel');jQuery(detailContainer).slideUp(200);jQuery(this).hide();jQuery(this).prev().show();});
/* navigation plugin */jQuery('.menu li.current ul').onePageNav({currentClass : 'active'});jQuery('ul.menu li ul li a').click(function() {var anchor = $(this).attr('href');/*anchor.substr*/scrollToSubsection(anchor.substr(1));});
/* Init Overlay */jQuery('#overlay').overlay({fixed : false,mask : '#789',top : '15%',onBeforeLoad : function() {var wrap = this.getOverlay().find('.contentWrap');wrap.load(this.getTrigger().attr('href'));},load : false});
/* define overlay for links in topnavi. Link must have 'overlay' class and a div with id overlay must be present anywhere on the page */var popup = jQuery("#overlay").data("overlay");
/* bind click trigger to a.class */jQuery('a.overlay').click(function() {jQuery('#overlay div').html('');var url = jQuery(this).attr('href');jQuery.get(url, function(data) {jQuery('#overlay div').html(data);});popup.load();jQuery(this).blur();return false;});
/* reset disclaimer checkbox */resetDisclaimer();
});
