var timerID = null;

var timerRunning = false;



function stopclock (){

        if(timerRunning)

                clearTimeout(timerID);

        timerRunning = false;

}



function startclock () {

        // Make sure the clock is stopped

        stopclock();

        showtime();

}



function showtime () {

        var now = new Date();

        var hours = now.getHours();

        var minutes = now.getMinutes();

        var seconds = now.getSeconds()

        var timeValue = ((hours < 10) ? "0" : "") + hours

        timeValue += ((minutes < 10) ? ":0" : ":") + minutes

        timeValue += ((seconds < 10) ? ":0" : ":") + seconds

        document.clock.face.value = timeValue

        document.argentina.face.value = timeValue

        document.uruguai.face.value = timeValue;



        var hours = now.getHours() - 1;

        var hours = ((hours >= 24)  ? hours - 24 : hours);

        var hours = ((hours < 0)  ? 24 + hours : hours);

        var timeValue = ((hours < 10) ? "0" : "") + hours

        timeValue += ((minutes < 10) ? ":0" : ":") + minutes

        timeValue += ((seconds < 10) ? ":0" : ":") + seconds

        document.bolivia.face.value = timeValue

        document.chile.face.value = timeValue

        document.paraguai.face.value = timeValue

        document.portorico.face.value = timeValue

        document.repdominicana.face.value = timeValue

        document.venezuela.face.value = timeValue;



        var hours = now.getHours() - 2;

        var hours = ((hours >= 24)  ? hours - 24 : hours);

        var hours = ((hours < 0)  ? 24 + hours : hours);

        var timeValue = ((hours < 10) ? "0" : "") + hours

        timeValue += ((minutes < 10) ? ":0" : ":") + minutes

        timeValue += ((seconds < 10) ? ":0" : ":") + seconds

        document.canada.face.value = timeValue

        document.colombia.face.value = timeValue

        document.cuba.face.value = timeValue

        document.eua.face.value = timeValue

        document.novayork.face.value = timeValue

        document.miami.face.value = timeValue

        document.panama.face.value = timeValue

        document.peru.face.value = timeValue

        document.equador.face.value = timeValue;



        var hours = now.getHours() - 3;

        var hours = ((hours >= 24)  ? hours - 24 : hours);

        var hours = ((hours < 0)  ? 24 + hours : hours);

        var timeValue = ((hours < 10) ? "0" : "") + hours

        timeValue += ((minutes < 10) ? ":0" : ":") + minutes

        timeValue += ((seconds < 10) ? ":0" : ":") + seconds

        document.elsalvador.face.value = timeValue

        document.mexico.face.value = timeValue

        document.nicaragua.face.value = timeValue;



        var hours = now.getHours() + 3;

        var hours = ((hours >= 24)  ? hours - 24 : hours);

        var timeValue = ((hours < 10) ? "0" : "") + hours

        timeValue += ((minutes < 10) ? ":0" : ":") + minutes

        timeValue += ((seconds < 10) ? ":0" : ":") + seconds

        document.argelia.face.value = timeValue

        document.portugal.face.value = timeValue

        document.reinounido.face.value = timeValue

        document.senegal.face.value = timeValue

        document.marrocos.face.value = timeValue;



        var hours = now.getHours() + 4;

        var hours = ((hours >= 24)  ? hours - 24 : hours);

        var timeValue = ((hours < 10) ? "0" : "") + hours

        timeValue += ((minutes < 10) ? ":0" : ":") + minutes

        timeValue += ((seconds < 10) ? ":0" : ":") + seconds

        document.austria.face.value = timeValue

        document.belgica.face.value = timeValue

        document.dinamarca.face.value = timeValue

        document.franca.face.value = timeValue

        document.havai.face.value = timeValue

        document.holanda.face.value = timeValue

        document.hungria.face.value = timeValue

        document.italia.face.value = timeValue

        document.iugoslavia.face.value = timeValue

        document.polonia.face.value = timeValue

        document.suecia.face.value = timeValue

        document.suica.face.value = timeValue

        document.tchecoslovaquia.face.value = timeValue

        document.tunisia.face.value = timeValue

        document.espanha.face.value = timeValue

        document.nigeria.face.value = timeValue

        document.noruega.face.value = timeValue;



        var hours = now.getHours() + 5;

        var hours = ((hours >= 24)  ? hours - 24 : hours);

        var timeValue = ((hours < 10) ? "0" : "") + hours

        timeValue += ((minutes < 10) ? ":0" : ":") + minutes

        timeValue += ((seconds < 10) ? ":0" : ":") + seconds

        document.africadosul.face.value = timeValue

        document.alemanha.face.value = timeValue

        document.bulgaria.face.value = timeValue

        document.finlandia.face.value = timeValue

        document.grecia.face.value = timeValue

        document.israel.face.value = timeValue

        document.libano.face.value = timeValue

        document.libia.face.value = timeValue

        document.romenia.face.value = timeValue

        document.siria.face.value = timeValue

        document.egito.face.value = timeValue

        document.uganda.face.value = timeValue;



        var hours = now.getHours() + 6;

        var hours = ((hours >= 24)  ? hours - 24 : hours);

        var timeValue = ((hours < 10) ? "0" : "") + hours

        timeValue += ((minutes < 10) ? ":0" : ":") + minutes

        timeValue += ((seconds < 10) ? ":0" : ":") + seconds

        document.arabia.face.value = timeValue

        document.iraque.face.value = timeValue

        document.turquia.face.value = timeValue

        document.russia.face.value = timeValue;



        var hours = now.getHours() + 7;

        var hours = ((hours >= 24)  ? hours - 24 : hours);

        var timeValue = ((hours < 10) ? "0" : "") + hours

        timeValue += ((minutes < 10) ? ":0" : ":") + minutes

        timeValue += ((seconds < 10) ? ":0" : ":") + seconds

        document.emirados.face.value = timeValue;



        var hours = now.getHours() + 8;

        var hours = ((hours >= 24)  ? hours - 24 : hours);

        var timeValue = ((hours < 10) ? "0" : "") + hours

        timeValue += ((minutes < 10) ? ":0" : ":") + minutes

        timeValue += ((seconds < 10) ? ":0" : ":") + seconds

        document.indonesia.face.value = timeValue

        document.tailandia.face.value = timeValue;



        var hours = now.getHours() + 11;

        var hours = ((hours >= 24)  ? hours - 24 : hours);

        var timeValue = ((hours < 10) ? "0" : "") + hours

        timeValue += ((minutes < 10) ? ":0" : ":") + minutes

        timeValue += ((seconds < 10) ? ":0" : ":") + seconds

        document.china.face.value = timeValue

        document.filipinas.face.value = timeValue;



        var hours = now.getHours() + 12;

        var hours = ((hours >= 24)  ? hours - 24 : hours);

        var timeValue = ((hours < 10) ? "0" : "") + hours

        timeValue += ((minutes < 10) ? ":0" : ":") + minutes

        timeValue += ((seconds < 10) ? ":0" : ":") + seconds

        document.coreia.face.value = timeValue

        document.japao.face.value = timeValue;



        var hours = now.getHours() + 13;

        var hours = ((hours >= 24)  ? hours - 24 : hours);

        var timeValue = ((hours < 10) ? "0" : "") + hours

        timeValue += ((minutes < 10) ? ":0" : ":") + minutes

        timeValue += ((seconds < 10) ? ":0" : ":") + seconds

        document.australia.face.value = timeValue;



        var now = new Date();

        var minutes = now.getMinutes();

        var minutes = now.getMinutes() + 30;

        var hours = now.getHours() + 8;

        var hours = ((minutes >= 60)  ? hours + 1 : hours);

        var minutes = ((minutes >= 60)  ? minutes - 60 : minutes);

        var hours = ((hours >= 24)  ? hours - 24 : hours);

        var seconds = now.getSeconds();

        var timeValue = ((hours < 10) ? "0" : "") + hours

        timeValue += ((minutes < 10) ? ":0" : ":") + minutes

        timeValue += ((seconds < 10) ? ":0" : ":") + seconds

        document.india.face.value = timeValue;



        // you could replace the above with this

        // and have a clock on the status bar:

        // window.status = timeValue;



        timerID = setTimeout("showtime()",1000);

        timerRunning = true;

}



function Abrejanela(Opcao) { 

     Versao = navigator.appVersion 

     Versao = Versao.substring(0, 1)

     Local = ""



     if  (Versao < 3)  { 

         Local = document.location 

         UltLoc = Local.lastIndexOf("/") 

         Local = Local.substring(0, UltLoc + 1)

     }

} 


if (navigator.appName=="Netscape" && parseInt(navigator.appVersion)==4) {
	widthCheck = window.innerWidth;
	heightCheck = window.innerHeight;
	window.onResize = resizeFix;
}

function resizeFix() {
	if (widthCheck != window.innerWidth || heightCheck != window.innerHeight)
	document.location.href = document.location.href;
}




var isNew=0;
var isNS4=0;
var isIE4=0;
var brow= ((navigator.appName)+(parseInt(navigator.appVersion)));
if (parseInt(navigator.appVersion >=5)) {
isNew=1}
else if (brow=="Netscape4")
{isNS4 = 1;}
else if(brow=="Microsoft Internet Explorer4")
{isIE4=1;}

docObj=(isNS4)?'document' :'document.all';
styleObj= (isNS4)?'':'.style';

function lyroff(currElem){
	dom= eval(docObj+'.'+currElem+styleObj);
	state = dom.visibility;
	if(state=="visible" || state=="show"){dom.visibility="hidden";}
}

function lyron(currElem){
	dom=eval(docObj+'.'+currElem+styleObj);
	state=dom.visibility;
	if(state=="hide" || state=="hidden"){dom.visibility="visible"};
}

function alterNate(elm){
if (!elm.base) elm.base = elm.value
if (elm.value == elm.base) elm.value = "";
else if (elm.value == "") elm.value = elm.base;
}

function checkmail(str)
{
	var filter = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
	if (filter.test(str))
	{
		return true;
	}
	else
	{
		alert("O e-mail digitado não é válido!")
		return false;
	}
}


function openpopup(url, width, height, scrollbars){
window.open(url,"","toolbar=no,status=no,menubar=no,scrollbars=" + scrollbars + "top=10,left=10,width=" + width + ",height=" + height)
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}