/* adiciona uma dobra de folha em todas as div's com class ".dobra" */
$(function(){
	$(".dobra").append('<div class="dobraFolha"></div>').parent().css("position","relative");
});



/* substitui os títulos pela flash avenir.swf */
var avenir = {src: baseURL + 'swf/sifr3/avenir.swf'};
sIFR.activate(avenir);
sIFR.replace(avenir, {selector: 'h2.titulo', wmode: 'transparent', css:{ '.sIFR-root': { 'color': '#000000', 'font-size': '30px' }}});
sIFR.replace(avenir, {selector: 'h3.titulo', wmode: 'transparent', css:{ '.sIFR-root': { 'color': '#000000', 'font-size': '18px' }}});
sIFR.replace(avenir, {selector: 'h2.tituloBranco', wmode: 'transparent', css:{ '.sIFR-root': { 'color': '#FFFFFF', 'font-size': '30px' }}});
sIFR.replace(avenir, {selector: 'h3.tituloBranco', wmode: 'transparent', css:{ '.sIFR-root': { 'color': '#FFFFFF', 'font-size': '18px' }}});



/**
 * Loads in a URL into a specified divName, and applies the function to
 * all the links inside the pagination div of that page (to preserve the ajax-request)
 * @param string href The URL of the page to load
 * @param string divName The name of the DOM-element to load the data into
 * @return boolean False To prevent the links from doing anything on their own.
 */
function loadPiece(href,divName) {    
    $(divName).load(href, {}, function(){
        var divPaginationLinks = divName+" #pagination a";
        $(divPaginationLinks).click(function() {     
            var thisHref = $(this).attr("href");
            loadPiece(thisHref,divName);
            return false;
        });
    });
} 