
try{addLoadEvent(splashLoadImgs);}catch(e){window.onload=splashLoadImgs;}
var navegador=new verifNavegador();var lista_imagens=new Array();var lista_pos=-1;splashWrite();function splashWrite(){document.write('<div id="splash_esconde_fundo" onclick="splashClose()"></div>');document.write('<div id="splash_centro">');document.write('  <div id="splash_nav_bar">');document.write('    <div class="prev"><div id="splash_nav_bar_prev"><a href="javascript:void(0)" onclick="showSplash( lista_pos-1 )"></a></div></div>');document.write('    <div class="next"><div id="splash_nav_bar_next"><a href="javascript:void(0)" onclick="showSplash( lista_pos+1 )"></a></div></div>');document.write('    <div class="close"><a href="javascript:void(0)" onclick="splashClose()"></a></div>');document.write('  </div>');document.write('  <div id="splash_nome"></div>');document.write('  <div id="splash_principal">');document.write('    <div id="anima_loading"></div>');document.write('    <img id="splash_img" src="" class="unload">');document.write('  </div>');document.write('  <div id="splash_texto"></div>');document.write('  <img id="splash_back_load" src="">');document.write('  <img id="splash_next_load" src="">');document.write('</div>');document.getElementById('splash_centro').style.maxWidth=1000;}
function showSplash(pos){lista_pos=pos;if(!splashVerifExisteImg(pos)){return;}
splashShowImg(pos);splashAtivacaoNavBar(pos);splashOpen();splashResize();window.onresize=splashResize;}
function splashShow2(path){pos=splashGetPosByPath(path);if(pos>-1){showSplash(pos);return false;}
return true;}
function splashOpen(){document.getElementById('splash_esconde_fundo').style.display='block';document.getElementById('splash_centro').style.display='block';}
function splashClose(){document.getElementById('splash_esconde_fundo').style.display='none';document.getElementById('splash_centro').style.display='none';}
function splashResize(){var fundo=document.getElementById('splash_esconde_fundo');if(fundo==null){return;}
fundo.style.height='100%';var maior_largura=(document.body.clientWidth>document.body.scrollWidth)?document.body.clientWidth:document.body.scrollWidth;var maior_altura=(document.body.clientHeight>document.body.scrollHeight)?document.body.clientHeight:document.body.scrollHeight;fundo.style.width=maior_largura;fundo.style.height=maior_altura;splashSetDim(lista_pos,true);}
function splashLoaded(){splashSetDim(lista_pos,true);document.getElementById('anima_loading').style.display='none';document.getElementById('splash_img').className='loaded';try{ElemOpacity.set('splash_img',0);ElemOpacity.fading('splash_img',0,100,600);}catch(e){}
splashLoadNextFileInBackground(lista_pos);}
function splashUnload(){document.getElementById('anima_loading').style.display='';document.getElementById('splash_img').className='unload';}
function splashAtivacaoNavBar(pos){if(lista_imagens.length<=1){document.getElementById('splash_nav_bar_prev').style.display='none';document.getElementById('splash_nav_bar_next').style.display='none';return;}
document.getElementById('splash_nav_bar_prev').style.display='block';document.getElementById('splash_nav_bar_next').style.display='block';if(pos==0){document.getElementById('splash_nav_bar_prev').style.display='none';}else if(pos==(lista_imagens.length-1)){document.getElementById('splash_nav_bar_next').style.display='none';}}
function splashResetImgs(){lista_imagens=new Array();lista_pos=-1;}
function splashAddImg(path_img,width,height,nome,descricao){if(path_img==null)
return false;if(width==null||width<0)
return false;if(height==null||height<0)
return false;if(nome==null)
nome='';if(descricao==null)
descricao='';var pos=lista_imagens.length;if(pos>0&&(lista_imagens[pos-1][0])==path_img){return false;}
lista_imagens[pos]=new Array();lista_imagens[pos][0]=path_img;lista_imagens[pos][1]=width;lista_imagens[pos][2]=height;lista_imagens[pos][3]=nome;lista_imagens[pos][4]=descricao;return pos;}
function splashVerifExisteImg(pos){if(pos>=lista_imagens.length){return false;}
return true;}
function splashGetImgPath(pos){return lista_imagens[pos][0];}
function splashGetImgWidth(pos){return lista_imagens[pos][1];}
function splashGetImgHeight(pos){return lista_imagens[pos][2];}
function splashGetImgNome(pos){return lista_imagens[pos][3];}
function splashGetImgDescricao(pos){return lista_imagens[pos][4];}
function splashGetPosByPath(path){for(var i=0;i<lista_imagens.length;i++){if(splashGetImgPath(i)==path||splashGetImgPath(i).indexOf(path)>-1||path.indexOf(splashGetImgPath(i))>-1){return i;}}
return-1;}
function splashShowImg(pos){splashUnload();if(!splashVerifExisteImg(pos)){return false;}
splashSetDim(pos,false);document.getElementById('splash_nome').innerHTML=splashGetImgNome(pos);document.getElementById('splash_texto').innerHTML=splashGetImgDescricao(pos);document.getElementById('splash_centro').title=splashGetImgNome(pos);document.getElementById('splash_img').onload=function(){setTimeout("splashLoaded()",50)};document.getElementById('splash_img').src=splashGetImgPath(pos);}
function splashSetDim(pos,loaded){splash_width=300;splash_height=200;width=splashGetImgWidth(pos);height=splashGetImgHeight(pos);if(loaded&&((width<=0)&&(height<=0))){width=document.getElementById('splash_img').width;height=document.getElementById('splash_img').height;}
if((width>0)&&(height>0)){splash_width=width+40;splash_height=height+100;}
splash_width=(splash_width<150)?150:splash_width;splash_height=(splash_height<100)?100:splash_height;if(splash_width>=document.body.clientWidth){splash_width=document.body.clientWidth-20;}
splash_left=(document.body.clientWidth/2)-(splash_width/2);splash_top=(document.body.clientHeight/2)-(splash_height/2)+document.body.scrollTop;if(splash_top<(document.body.scrollTop+10)){splash_top=document.body.scrollTop+10;}
document.getElementById('splash_centro').style.width=splash_width;document.getElementById('splash_centro').style.height=splash_height;document.getElementById('splash_centro').style.left=splash_left;document.getElementById('splash_centro').style.top=splash_top;}
function splashLoadNextFileInBackground(pos){var elemBackImg=document.getElementById('splash_back_load');var elemNextImg=document.getElementById('splash_next_load');try{elemBackImg.src=splashGetImgPath(pos-1);elemNextImg.src=splashGetImgPath(pos+1);}catch(e){}}
function splashLoadImgs(){var atualElemA,arrElemsImg;var nome,path_img,descricao,width,height,valueRel;if(!document.getElementById)
return;var elemA=document.getElementsByTagName("a");for(var i=0;i<elemA.length;i++){atualElemA=elemA.item(i);if(atualElemA.getAttribute("target")=='splash'){arrElemsImg=atualElemA.getElementsByTagName("img");nome=(arrElemsImg.length>0)?arrElemsImg.item(0).getAttribute("alt"):'';path_img=atualElemA.getAttribute("href");descricao=atualElemA.getAttribute("title");valueRel=atualElemA.getAttribute("rel");if(valueRel!=null&&valueRel.length>0){width=parseInt(valueRel.substr(0,valueRel.indexOf(',')));height=parseInt(valueRel.substr(valueRel.indexOf(',')+1));}else{width=0;height=0;}
splashAddImg(path_img,width,height,nome,descricao);atualElemA.onclick=function(){return splashShow2(this.href);};atualElemA.target='_blank';atualElemA.rel=null;}}}