$(document).ready(function()
{
$(window).load(function()
{
SetarEffects();
SetarEffectsOverlay();
});
});
function loadPage()
{
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
}
function EndRequestHandler()
{
SetarEffects();
}
startLoad=function()
{
loadPage();
}
window.onload=startLoad;
function SetarEffects()
{
if($(".listagem-scroll").height()>300){
$(".listagem-scroll").css("height","300px");
$(".listagem-scroll").jScrollPane({scrollMargin:0});
}else{
$(".listagem-scroll").css("width","100%");
}
}
function SetarEffectsOverlay()
{
var dimensoes=getPageSize();
var pageWidth=dimensoes[0];
var pageHeight=dimensoes[1];
var overlayCSS={
'display':'none',
'background-color':'#000',
'width':pageWidth+'px',
'height':pageHeight+'px',
'position':'absolute',
'left':'0',
'top':'0',
'z-index':'5',
'opacity':'0.7',
'filter':'alpha(opacity=70)',
'-moz-opacity':'0.7'
};
$("#overlay").css(overlayCSS);
$("#fale").click(function(){
$(".lb-faleconosco").show();
$("#overlay").fadeIn("fast",function(){
$(".lb-faleconosco").show();
});
});
$("#expediente").click(function(){
$("#overlay").fadeIn("fast",function(){
$(".lb-expediente").show();
});
});
$("#newsletter").click(function(){
$("#overlay").fadeIn("fast",function(){
$(".lb-newsletter").show();
});
});
$("#overlay").click(function(){
$(".lb-newsletter").fadeOut("fast");
$(".lb-faleconosco").fadeOut("fast");
$(".lb-expediente").fadeOut("fast");
$(".conteudo-ok").fadeOut("fast");
$(this).fadeOut("slow");
});
$(".fechar").click(function fechar(){
$(".lb-newsletter").fadeOut("fast");
$(".lb-faleconosco").fadeOut("fast");
$(".lb-expediente").fadeOut("fast");
$(".conteudo-ok").fadeOut("fast");
$("#overlay").fadeOut("slow");
});
$(".fecharNews").click(function fechar(){
$(".lb-newsletter").fadeOut("fast");
$(".lb-faleconosco").fadeOut("fast");
$(".lb-expediente").fadeOut("fast");
$(".conteudo-ok").fadeOut("fast");
$("#overlay").fadeOut("slow");
});
}
$(document).ready(function(){
LoadCreditos();
LoadLegendas();
});
function LoadCreditos(){
var strAlignments='';
var strCredito='';
$("img[_credito]").each(
function(callBack,oImagem){
if($(oImagem).attr('align')=='right'){
strAlignments='float:right; clear:right;';
}else if($(oImagem).attr('align')=='left'){
strAlignments='float:left; clear:left;';
}
if(typeof($(oImagem).attr('_credito'))!='undefined'&&$(oImagem).attr('_credito').length>0){
if($(oImagem).attr('_credito').substring(this.length-1,this.length)=='.'){
strCredito=$(oImagem).attr('_credito')+' ';
}else{
strCredito=$(oImagem).attr('_credito')+' ';
}
}else{
strCredito='';
}
if($(oImagem).width()<=48){
var width='auto';
}else{
var width=$(oImagem).width()+'px';
}
if(strCredito.length>0)
{
strHTML='<div class="credito" style="width:'+width+'; '+strAlignments+'">';
strHTML+=strCredito;
strHTML+='</div>';
$(oImagem).after(strHTML);
}
}
);
}
function LoadLegendas(){
var strAlignments='';
var strLegenda='';
$("img[_legenda]").each(
function(callBack,oImagem){
if($(oImagem).attr('align')=='right'){
strAlignments='float:right; clear:right;';
}else if($(oImagem).attr('align')=='left'){
strAlignments='float:left; clear:left;';
}
if(typeof($(oImagem).attr('_legenda'))!='undefined'&&$(oImagem).attr('_legenda').length>0){
if($(oImagem).attr('_legenda').substring(this.length-1,this.length)=='.'){
strLegenda=$(oImagem).attr('_legenda')+' ';
}else{
strLegenda=$(oImagem).attr('_legenda')+' ';
}
}else{
strLegenda='';
}
if($(oImagem).width()<=48){
var width='auto';
}else{
var width=$(oImagem).width()+'px';
}
if(strLegenda.length>0)
{
strHTML='<div class="credito" style="width:'+width+'; '+strAlignments+'">';
strHTML+=strLegenda;
strHTML+='</div>';
$(oImagem).after(strHTML);
}
}
);
}
