

arImageSrc = new Array ("loading.gif","loaded.gif");
arImageList = new Array ();
for (counter in arImageSrc) {
arImageList[counter] = new Image();
arImageList[counter].src = arImageSrc[counter];
}
var height = screen.height;
var width = screen.width;
var leftpos = width / 2 - 50;
var toppos = height / 2 - 50;
function encode(str){ // Netscape fix thanks to Cyanide_7
return escape(str.replace(/ /g,'+'));
}
function view(what) {
var url = 'viewer.html?pic='+encode(what);
window.open(url,'WIN','scrollbars=no,status=no,toolbar=no,resizable=1,location=no,menu=no,width=100,height=100,left=' + leftpos + ',top=' + toppos);
}
function getParams() {
var idx = document.URL.indexOf('?');
var params = new Array();
if (idx != -1) {
var pairs = document.URL.substring(idx+1, document.URL.length).split('&');
for (var i=0; i<pairs.length; i++) {
nameVal = pairs[i].split('=');
params[nameVal[0]] = nameVal[1];
   }
}
return params;
}
params = getParams();
function resize() {
if (eval(pic).height) {
var name = navigator.appName
if (name == "Microsoft Internet Explorer") {
myHeight = eval(pic).height + 40;
myWidth = eval(pic).width + 12;
}
else {
myHeight = eval(pic).height + 9;
myWidth = eval(pic).width;
}
clearTimeout();
var height = screen.height;
var width = screen.width;
var leftpos = width / 2 - myWidth / 2;
var toppos = height / 2 - myHeight / 2; 
self.moveTo(leftpos, toppos);
self.resizeTo(myWidth, myHeight);
document.il.src = 'loaded.gif';
}
else setTimeOut(resize(), 100);
}


function abre_janela_figura(figura,figura2,texto)
{
    new_fig=new Image();
    new_fig.src=figura;
//    alert (new_fig.complete);
     

//    alert (new_fig.complete);       
    janela2=window.open(figura,"","resizable,scrollbars");
    if (figura2 !='')
	{
	janela2.document.open();
	janela2.document.clear();
    janela2.document.writeln ("<html><head>");
	janela2.document.writeln ("<title>" + texto +"</title>");
	janela2.document.writeln ("<body>");
//	//

		janela2.document.writeln ("<center><img src ='" + figura + "'</img></center>");	
		janela2.document.writeln ("<center><a href='"+figura2 +"'target='_blank'>Clique aqui para maior visualização</a></center>");

	
    janela2.document.writeln ("</body></head></html>");
      }
    janela2.resizeTo(new_fig.width+60,new_fig.height+60); 			
        
    janela2.focus();    
    janela2.moveTo(50,50);	
//    alert (new_fig.complete);
   
    janela2.document.close();
}

function abre_janela(janela,hor,ver)
{
 height1 = screen.height;
 width1 = screen.width;
 leftpos1 =( width1 / 2) -ver ;
 toppos1 = ( height1 / 2 )-hor;
	jan=window.open(janela,'','height='+ver +',width='+hor+',scrollbars=1,top=' + toppos1+ ',left=leftpos1')
       
}

function abre_janela_impr(janela,hor,ver)
{
 height1 = screen.height;
 width1 = screen.width;
 leftpos1 =( width1 / 2) -ver ;
 toppos1 = ( height1 / 2 )-hor;
 jan=window.open(html,'','height='+ver +',width='+hor+',scrollbars=1,top=' + toppos1+ ',left=leftpos1')
 
}


function popupWin() {

	if (browsers ='Microsoft Internet Explorer6')
	{
		text =  "<html>\n<head>\n<title>Aviso !</title>\n<body>\n";
		text += "<center>\n";
		text += "<font color='#CC6600'><i><font size='3' color='#003366'>Usu&aacute;rios 			do";
		text += "Internet Explorer 6: para melhor visualiza&ccedil;&atilde;o das 		fotos<br>";
		text += "desabilite a op&ccedil;&atilde;o 'Ativar redimensionamento 			autom&aacute;tico de 		imagens'";
		text += "</center>\n</body>\n</html>\n";
		setTimeout('windowProp(text)', 1000); 		// delay 1 seconds before opening
	}
}
function windowProp(text) {
newWindow = window.open('','newWin','width=300,height=120');
newWindow.document.write(text);
setTimeout('closeWin(newWindow)', 12000);	// delay 12 seconds before closing
}
function closeWin(newWindow) {
newWindow.close();		}	


function browsers() {
browser = (((navigator.appName == "Netscape") &&
(parseInt(navigator.appVersion)  )) || 
((navigator.appName == "Microsoft Internet Explorer") && 
(parseInt(navigator.appVersion) )))
return browser
}
function data_pagina()
{
var days = new Array(8);
days[1] = "Domingo";
days[2] = "Segunda";
days[3] = "Terça";
days[4] = "Quarta";
days[5] = "Quinta";
days[6] = "Sexta";
days[7] = "Sábado";
var months = new Array(13);
months[1] = "Janeiro";
months[2] = "Fevereiro";
months[3] = "Março";
months[4] = "Abril";
months[5] = "Maio";
months[6] = "Junho";
months[7] = "Julho";
months[8] = "Agosto";
months[9] = "Setembro";
months[10] = "Outubro";
months[11] = "Novembro";
months[12] = "Dezembro";
var dateObj = new Date(document.lastModified)
var wday = days[dateObj.getDay() + 1]
var lmonth = months[dateObj.getMonth() + 1]
var date = dateObj.getDate()
var fyear = dateObj.getYear()
//var timeObj = new Time(document.lastModified) 
var hora = dateObj.getHours()
var minuto = dateObj.getMinutes()
if (minuto < 10)
	minuto='0'+ minuto;
if (fyear < 2000) 
fyear = fyear + 1900
return (wday + ", " + date + " de " + lmonth + " de " + fyear+ " às " + hora + ":" + minuto)
}

function mostraFotosCombo(index,width,height){
	if ((index!='') && (index.match("fotos")=="fotos")) { 	    
		document.all.fotos.src=index;
		document.all.fotos.height=height ;//550;
		document.all.fotos.width=width; //00;
		
	}else{
		document.all.fotos.height=0;
		document.all.fotos.width=0;
		document.all.fotos.src="";
		if( (index!='') && (index.match("fotos")!="fotos")){
			abre_janela(index,'720','520');
		}
	}	
}

function mostraFrame(src,width,height,border){
		document.all.fotos.frameBorder=border;
		document.all.fotos.src=src;
		document.all.fotos.height=height ;//550;
		document.all.fotos.width=width; //00;

}


