function popup(url) 
{
 params  = 'width='+screen.width;
 params += ', height='+screen.height;
 params += ', top=0, left=0'
 params += ', fullscreen=yes, scrollbars=yes';

 newwin=window.open(url,'galeria', params);
 if (window.focus) {newwin.focus()}
 return false;
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function OpenWindow (URL, WinName, Features)
{
window.open(URL, WinName, Features);
}

var startTime=new Date();
function currentTime(){
  var a=Math.floor((new Date()-startTime)/100)/10;
  if (a%1==0) a+=".0";
  document.getElementById("endTime").innerHTML=a;
}

window.onload=function(){
  clearTimeout(loopTime);
}

function Open_window_auto(img){
  foto1= new Image();
  foto1.src=(img);
  Controlla(img);
}
function Controlla(img){
  if((foto1.width!=0)&&(foto1.height!=0)){
    viewFoto(img);
  }
  else{
    funzione="Controlla('"+img+"')";
    intervallo=setTimeout(funzione,20);
  }
}
function viewFoto(img){
  largura=foto1.width+20;
  altura=foto1.height+20;
  stringa="width="+largura+",height="+altura;
  abrir=window.open(img,"",stringa);
}

var osd = ""
osd +=" ... ::: ||| www.macrofotografia.com.br - olhe mais de perto ||| ::: ...";
osd +="          ";
var timer;
var msg = "";
function scrollMaster () {
msg = customDateSpring(new Date())
clearTimeout(timer)
msg += " " + showtime() + " " + osd
for (var i= 0; i < 100; i++){
msg = " " + msg;
}
scrollMe()
}
function scrollMe(){
window.status = msg;
msg = msg.substring(1, msg.length) + msg.substring(0,1);
timer = setTimeout("scrollMe()", 200);
}
function showtime (){
var now = new Date();
var hours= now.getHours();
var minutes= now.getMinutes();
var seconds= now.getSeconds();
var months= now.getMonth();
var dates= now.getDate();
var years= now.getYear();
var timeValue = ""
timeValue += ((months >9) ? "" : " ")
timeValue += ((dates >9) ? "" : " ")
timeValue = ( months +1)
timeValue +="/"+ dates
timeValue +="/"+  years
var ap=""
var timeValue2 = " " + hours
timeValue2 += ((minutes < 10) ? ":0":":") + minutes + " " + ap + " - "
return timeValue2;
}
function MakeArray(n) {
this.length = n
return this
}
monthNames = new MakeArray(12)
monthNames[1] = " Janeiro"
monthNames[2] = " Fevereiro"
monthNames[3] = " Março"
monthNames[4] = " Abril"
monthNames[5] = " Maio"
monthNames[6] = " Junho"
monthNames[7] = " Julho"
monthNames[8] = " Agosto"
monthNames[9] = " Setembro"
monthNames[10] = " Outubro"
monthNames[11] = " Novembro"
monthNames[12] = " Dezembro"
daysNames = new MakeArray(7)
daysNames[1] = "Domingo"
daysNames[2] = "Segunda"
daysNames[3] = "Terça"
daysNames[4] = "Quarta"
daysNames[5] = "Quinta"
daysNames[6] = "Sexta"
daysNames[7] = "Sábado"
function customDateSpring(oneDate) {
var theDay = daysNames[oneDate.getDay() +1]
var theDate =oneDate.getDate()
var theMonth = monthNames[oneDate.getMonth() +1]
var dayth="th"
if ((theDate == 1) || (theDate == 21) || (theDate == 31)) {
dayth="st";
}
if ((theDate == 2) || (theDate ==22)) {
dayth="nd";
}
if ((theDate== 3) || (theDate  == 23)) {
dayth="rd";
}
return theDay + ", " + theDate + " de" + theMonth + " -"
}
scrollMaster();

/*------------------------------------------------------------
	Copyright 2003 - Taewook Kang.  All rights reserved.
	Coded by: Taewook Kang (txkang.REMOVETHIS@hotmail.com)
	Web Site: http://txkang.com
	
	Please retain this copyright notice in the script.
	License is granted to user to reuse this code on 
	their own website if, and only if, 
	this entire copyright notice is included.
--------------------------------------------------------------*/

var tgs = new Array('div','td','tr');
var szs = new Array('8px','10px','11px','12px','14px','16px','18px');
var startSz = 3;

function tamanhofonte(trgt,inc)
{
	var d = document,cEl = null,sz,i,j,cTags;
	
	sz = startSz;
	sz += inc;
	if (sz < 0) sz = 0;
	if (sz > 6) sz = 6;
	startSz = sz;

	if (!(cEl = d.getElementById(trgt)))
		cEl = d.getElementsByTagName(trgt)[0];

	cEl.style.fontSize = szs[sz];

	for (i = 0 ; i < tgs.length ; i++)
	{
		cTags = cEl.getElementsByTagName(tgs[i]);
		
		for (j = 0 ; j < cTags.length ; j++)
			cTags[j].style.fontSize = szs[sz];
	}
}

function toggle(obj)
{
var el = document.getElementById(obj);
if ( el.style.display != 'none' ) {
el.style.display = 'none';
}
else {
el.style.display = '';
}
}
