
// Código para validação de formulário
//
campos_erro	= "";
erro 		= false;
function isNumero(valor){	
	var ver_numero = "1234567890";
	var cont = 0;
	
	for (i = 0;  i < valor.length;  i++){
		ch = valor.charAt(i);
		for (j = 0;  j < ver_numero.length;  j++){
			if (ch == ver_numero.charAt(j)){
				cont++;
			}
		}
	}
	if (cont == valor.length){
		return true
	}else{
		return false;
	}
}
function evita_letra(tecla) {  
     if (tecla.keyCode < 45 || tecla.keyCode > 57 || tecla.keyCode == 47 || tecla.keyCode == 45 || tecla.keyCode == 46)  
          tecla.returnValue = false;  
}
function validaData(campo){
	dia = document.form[campo].value.substring(0,2); 
	mes = document.form[campo].value.substring(3,5); 
	ano = document.form[campo].value.substring(6,10); 		

	mensagem = "Erro na data";		
	if(!isNumero(dia+mes+ano)){
		alert("No campo 'DATA' deve conter apenas número!");
		
		comando2 = "document.all."+campo+".style.backgroundColor = 'red'";
		erro = true;
		eval(comando2);
	}else if(document.form[campo].value.length != 10){
		alert("Tamanho da data inválido!");
		
		comando2 = "document.all.data.style.backgroundColor = 'red'";
		erro = true;
		eval(comando2);
	}else{
		if(dia < 1 || dia > 31){
			alert("No campo 'DATA' o dia é inválido!");
			
			comando2 = "document.all."+campo+".style.backgroundColor = 'red'";
		    erro = true;
		    eval(comando2);
		}else if(mes < 1 || mes > 12){
			alert("No campo 'DATA' o mês é inválido!");
			
			comando2 = "document.all."+campo+".style.backgroundColor = 'red'";
		    erro = true;
		    eval(comando2);	
		}else if(ano < 1900 || ano > 3000){
			alert("No campo 'DATA' o ano é inválido!");
			
			comando2 = "document.all."+campo+".style.backgroundColor = 'red'";
		    erro = true;
		    eval(comando2);
		}	
	}	
}
function valida(campo){
	comando = "document.form."+campo+".value";
	resulta = eval(comando);

	if (resulta == ""){
		comando2 = "document.all."+campo+".style.backgroundColor = 'red'";
		erro = true;
		eval(comando2);
	}
}
function submeter(arrayComCampos){
	campos 	= arrayComCampos;
	cont	= campos.length;
	
	for (i=0 ; i<cont; i++){
		
		if (campos[i] == "asd") {
		validaData(campos[i]);
		} else {
		valida(campos[i]);
		}
	}

	if(!erro){
		cmd_sub = "document.form.submit()";
		eval (cmd_sub);
		
	}else{
		alert ('Os campos marcados em vermelho sao de preenchimento obrigatório!');
		campos_erro="";
	}
}
function limpa_fundo(campo){
		comando3 = "document.all."+campo+".style.backgroundColor = 'white'";
		eval(comando3);
		erro = false;
}


// ------------------------------------------ FIM do Código para validação de formulário



function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function DisplayInfo(pagina,janela,w,h,scrolling) {
 if (!scrolling) { scrolling="auto" } resultado = window.open(pagina,janela,"width="+w+",height="+h+",scrollbars="+scrolling+",toolbar=no,location=no,status=yes,menubar=yes,resizable=yes,left=5,top=5")
}


function boldThis(from) { 
	strSelection = document.selection.createRange().text 
	if (strSelection == "") { 
	return false; 
	} 
	else document.selection.createRange().text = "<b>" + strSelection 
	+ "</b>" 
	return;
}

function italicThis(from) { 
	strSelection = document.selection.createRange().text 
	if (strSelection == "") { 
	return false; 
	} 
	else document.selection.createRange().text = "<i>" + strSelection 
	+ "</i>" 
	return;
}

function underlineThis(from) { 
	strSelection = document.selection.createRange().text 
	if (strSelection == "") { 
	return false; 
	} 
	else document.selection.createRange().text = "<u>" + strSelection 
	+ "</u>" 
	return;
}

function changecolor(t) { 
	strSelection = document.selection.createRange().text 
	if (strSelection == "") { 
	return false; 
	} 
	else document.selection.createRange().text = "<font" + " color" +"=" +t+">" + strSelection 
	+ "</font>" 
	return;
}

function changesize(t) { 
	strSelection = document.selection.createRange().text 
	if (strSelection == "") { 
	return false; 
	} 
	else document.selection.createRange().text = "<font" + " size" +"=" +t+">" + strSelection 
	+ "</font>" 
	return;
}
function changealign(t) { 
	strSelection = document.selection.createRange().text 
	if (strSelection == "") { 
	return false; 
	} 
	else document.selection.createRange().text = "<div" + " align" +"=" +t+">" + strSelection 
	+ "</div>" 
	return;
}

function DisplayInfo(pagina,janela,w,h,scrolling) {
 if (!scrolling) { scrolling="auto" } resultado = window.open(pagina,janela,"width="+w+",height="+h+",scrollbars="+scrolling+",toolbar=no,location=no,status=yes,menubar=yes,resizable=yes,left=5,top=5")
}

function FormataData(campo,teclapres) {
	var tecla = teclapres.keyCode;
	vr = document.form[campo].value;
	vr = vr.replace( ".", "" );
	vr = vr.replace( "/", "" );
	vr = vr.replace( "/", "" );
	tam = vr.length + 1;

	if ( tecla != 9 && tecla != 8 ){
		if ( tam > 2 && tam < 5 )
			document.form[campo].value = vr.substr( 0, tam - 2  ) + '/' + vr.substr( tam - 2, tam );
		if ( tam >= 5 && tam <= 10 )
			document.form[campo].value = vr.substr( 0, 2 ) + '/' + vr.substr( 2, 2 ) + '/' + vr.substr( 4, 4 ); 
	}
}
function FormataHora(campo,teclapres) {
	var tecla = teclapres.keyCode;
	vr = document.form[campo].value;
	vr = vr.replace( ".", "" );
	vr = vr.replace( ":", "" );
	vr = vr.replace( ":", "" );
	tam = vr.length + 1;

	if ( tecla != 9 && tecla != 8 ){
		if ( tam > 2 && tam < 5 )
			document.form[campo].value = vr.substr( 0, tam - 2  ) + ':' + vr.substr( tam - 2, tam );
	}
}
function imprimir(id) {
 DisplayInfo("imprimir.php?id="+id,"imprimir",600,500,"yes","no");
}

function opened(url,frame,param)
{
window.open(url,frame,param);
}
function home_sub(url)
{
top.opener.top.location.href=url;
window.self.close();
}
function openPopUp(URL, NAME, OPTIONS) 
{
window.open(URL, NAME, OPTIONS)
window.self.close();
}

function clearall (form) {
	form.reset();
}

function jczOpenWindow(theURL,winName) {
	window.open(theURL,winName,'status=yes,scrollbars=no,width=300,height=300');

}
function DisplayInfo(pagina,janela,w,h,scrolling) {
 if (!scrolling) { scrolling="auto" } resultado = window.open(pagina,janela,"width="+w+",height="+h+",scrollbars="+scrolling+",toolbar=no,location=no,status=yes,menubar=yes,resizable=yes,left=5,top=5")
}

function submit_login() {
	if (document.implogin.imapuser.value == "") {
		alert('Por favor, informe seu nome de usuário e sua senha');
		return false;
	} else if (document.implogin.pass.value == "") {
		alert('Por favor, informe seu nome de usuário e sua senha');
		return false;
	} else {
		document.implogin.submit();
	}
}

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 MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
	document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function popup(menuName,mostra) {
			if (mostra) {
			document.getElementById(menuName).style.visibility = "visible";
			} else {
			document.getElementById(menuName).style.visibility = "hidden";
		}
	}


<!-- codigo do menu

var DomYes=document.getElementById?1:0;

function expandit(curobj){
	if (DomYes) {
  		var catrow=document.getElementById("cat_"+curobj.id).style;
	} else {
		var catrow=document.all["cat_"+curobj.id].style;
	}

	if (catrow.display=="none")
		catrow.display="";
	else
  		catrow.display="none";
}

window.onload = function() {
	var CurrentSection = "";
	var CurrentSubSection = "";

	if (CurrentSection) {
		if (DomYes) {
	  		var catrow=document.getElementById("cat_"+CurrentSection).style;
		} else {
			var catrow=document.all["cat_"+CurrentSection].style;
		}
		catrow.display = "";
	}
	if (CurrentSubSection) {
		if (DomYes) {
	  		var subdiv=document.getElementById("sub_"+CurrentSubSection).style;
		} else {
			var subdiv=document.all["sub_"+CurrentSubSection].style;
		}
		subdiv.background = "#e7f0f8";
		subdiv.fontWeight = "bold";
	}
}


//--> fim do codigo do menu
//CORREÇÃO DO FLASH PARA IE

//v1.0
//Copyright 2006 Adobe Systems, Inc. All rights reserved.
function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '<object ';
  for (var i in objAttrs)
    str += i + '="' + objAttrs[i] + '" ';
  str += '>';
  for (var i in params)
    str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  str += '<embed ';
  for (var i in embedAttrs)
    str += i + '="' + embedAttrs[i] + '" ';
  str += ' ></embed></object>';

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "id":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}

// FINAL DA CORREÇÃO IE

//RELOGIO
var clockid=new Array()
var clockidoutside=new Array()
var i_clock=-1
var thistime= new Date()
var hours=thistime.getHours()
var minutes=thistime.getMinutes()
var seconds=thistime.getSeconds()
if (eval(hours) <10) {hours="0"+hours}
if (eval(minutes) < 10) {minutes="0"+minutes}
if (seconds < 10) {seconds="0"+seconds}
var thistime = hours+":"+minutes+":"+seconds

function writeclock() {
i_clock++
if (document.all || document.getElementById || document.layers) {
 clockid[i_clock]="clock"+i_clock
 document.write("<span id='"+clockid[i_clock]+"' style='position:relative'>"+thistime+"</span>")
}
}

function clockon() {
thistime= new Date()
hours=thistime.getHours()
minutes=thistime.getMinutes()
seconds=thistime.getSeconds()
if (eval(hours) <10) {hours="0"+hours}
if (eval(minutes) < 10) {minutes="0"+minutes}
if (seconds < 10) {seconds="0"+seconds}
thistime = hours+":"+minutes+":"+seconds

if (document.all) {
 for (i=0;i<=clockid.length-1;i++) {
  var thisclock=eval(clockid[i])
  thisclock.innerHTML=thistime
 }
}

if (document.getElementById) {
 for (i=0;i<=clockid.length-1;i++) {
  document.getElementById(clockid[i]).innerHTML=thistime
 }
}
var timer=setTimeout("clockon()",500)
}
window.onload=clockon
//FIM RELOGIO

//CONFIGURAÇÃO DO EDITOR DE TEXTO

<!-- // load htmlarea
_editor_url = "";                     // URL to htmlarea files
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
  document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
  document.write(' language="Javascript1.2"></scr' + 'ipt>');  
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
// -->
//;FIM EDITOR DE TEXTO



// Início do código de Aumentar/ Diminuir a letra
 
// Para usar coloque o comando: "javascript:mudaTamanho('tag_ou_id_alvo', -1);" para diminuir
// e o comando "javascript:mudaTamanho('tag_ou_id_alvo', +1);" para aumentar
 
var tagAlvo = new Array('p'); //pega todas as tags p//
 
// Especificando os possíveis tamanhos de fontes, poderia ser: x-small, small...
var tamanhos = new Array( '9px','10px','11px','12px','13px','14px','15px' );
var tamanhoInicial = 2;
 
function mudaTamanho( idAlvo,acao ){
  if (!document.getElementById) return
  var selecionados = null,tamanho = tamanhoInicial,i,j,tagsAlvo;
  tamanho += acao;
  if ( tamanho < 0 ) tamanho = 0;
  if ( tamanho > 6 ) tamanho = 6;
  tamanhoInicial = tamanho;
  if ( !( selecionados = document.getElementById( idAlvo ) ) ) selecionados = document.getElementsByTagName( idAlvo )[ 0 ];
  
  selecionados.style.fontSize = tamanhos[ tamanho ];
  
  for ( i = 0; i < tagAlvo.length; i++ ){
    tagsAlvo = selecionados.getElementsByTagName( tagAlvo[ i ] );
    for ( j = 0; j < tagsAlvo.length; j++ ) tagsAlvo[ j ].style.fontSize = tamanhos[ tamanho ];
  }
}
// Fim do código de Aumentar/ Diminuir a letra

//ADICIONAR A FAVORITOS

function add_bookmark() { 
	var browsName = navigator.appName; 
	if (browsName == "Microsoft Internet Explorer") { 
		window.external.AddFavorite('http://www.dentrodosfatos.com.br','Dentro dos Fatos' );
	} else if (browsName == "Netscape") { 
		alert ("Para adicionar o site ao seu BookMark aperte CTRL+D"); 
	}
}

//FIM FAVORITOS

//CONTAR CARACTERES
function textCounter(field,cntfield,maxlimit) {
if (field.value.length > maxlimit) // 
field.value = field.value.substring(0, maxlimit);

else
cntfield.value = maxlimit - field.value.length;
}
//FIM CONTADOR

// PREVISAO DO TEMPO

function checkBrowser(){
	this.ver=navigator.appVersion
//	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
//	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
};

bw=new checkBrowser();

var vari = "tmax";
var endereco = "www.cptec.inpe.br";

function chg_mapa(img){
//obj=bw.ie4?document.all.layer2.document:bw.ns4?document.layer2.document:0;

switch (img){
	case 1 :
	document.mapa.src = "http://www.cptec.inpe.br/tempo/img_sat_atu.jpg";
	endereco = "http://www.cptec.inpe.br/tempo/";
	break;
	case 2 :
	document.mapa.src = "http://www.cptec.inpe.br/~promet/analises/superficie/superficie.gif";
	endereco = "http://www.cptec.inpe.br/~promet/analises/superficie/";
	break;
	case 3 :
	document.mapa.src = "http://www.cptec.inpe.br/~promet/analises/altitude/altitude.gif";
	endereco = "http://www.cptec.inpe.br/~promet/analises/altitude/";
	break;
}
}

function chama_lnk(){
//obj=bw.ie4?document.all.layer2.document:bw.ns4?document.layer2.document:0;
	location.href = endereco;
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

var photos=new Array()
var photoslink=new Array()
var which=0

//define images. You can have as many as you want:
photos[0]="http://www.cptec.inpe.br/tempo/imagens/br1.jpg"
photos[1]="http://www.cptec.inpe.br/tempo/imagens/br2.jpg"
photos[2]="http://www.cptec.inpe.br/tempo/imagens/br3.jpg"
photos[3]="http://www.cptec.inpe.br/tempo/imagens/br4.jpg"

//Specify whether images should be linked or not (1=linked)
var linkornot=0

//Set corresponding URLs for above images. Define ONLY if variable linkornot equals "1"
photoslink[0]=""
photoslink[1]=""
photoslink[2]=""
photoslink[3]=""

//do NOT edit pass this line

var preloadedimages=new Array()
for (i=0;i<photos.length;i++){
preloadedimages[i]=new Image()
preloadedimages[i].src=photos[i]
}


function applyeffect(){
if (document.all && photoslider.filters){
photoslider.filters.revealTrans.Transition=Math.floor(6)
photoslider.filters.revealTrans.stop()
photoslider.filters.revealTrans.apply()
}
}

function playeffect(){
if (document.all && photoslider.filters)
photoslider.filters.revealTrans.play()
}

function keeptrack(){
window.status="Image "+(which+1)+" of "+photos.length
}

function backward(){
if (which>0){
which--
applyeffect()
document.images.photoslider.src=photos[which]
playeffect()
keeptrack()
}
}

function forward(){
if (which<photos.length-1){
which++
applyeffect()
document.images.photoslider.src=photos[which]
playeffect()
keeptrack()
}
}

function transport(){
window.location=photoslink[which]
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function go(pagina) {
window.open(pagina,'Cidades','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=435,height=360')

    }

function go2(pagina)
        {
        window.open(pagina,'Principal9','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,menubar=no,width=395,height=283')
        }

function go3(pagina,imageWidth,imageHeight) {
window.open(pagina,'Tempo','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,menubar=no,width='+imageWidth+',height='+imageHeight)   }

function go4(pagina4)
        {
        popupAlerta = window.open(pagina4,'Principal1','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,menubar=no,width=800,height=700');
		popupAlerta.focus();
        }
function go5(imageName,imageWidth,imageHeight) {
newWindow = window.open(imageName,"newWindow",",resizable=yes,scrollbars=yes,top=10,left=10,width="+imageWidth+",height="+imageHeight);
}

function cria_janela(imageName,imageWidth,imageHeight) {
//document.caixa.D1[0].selected=true;
newWindow = window.open("","newWindow",",resizable=yes,scrollbars=yes,width="+imageWidth+",height="+imageHeight);
newWindow.document.open();
newWindow.document.write('<html><title>Tempo</title><body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor="#ffffff">');
newWindow.document.write('<img src='+imageName+'>');
newWindow.document.write('</body></html>');
newWindow.document.close();
newWindow.focus();
}
//FIM PREVISÃO DO TEMPO

//TROCA MES TÁBUA DE MARÉS

function troca_mes (m) {
	location.replace('?ma='+m);
}

//FIM TROCA MES

//OCEANOGRAMAS

function jumpMenu(form) {

var x = form.D1.selectedIndex;

if(form.D1.options[x].value != "0") {

 window.open(form.D1.options[x].value,target="_blank");
}
}


//FIM OCEANOGRAMAS

//inicio das checkboxs
function checar(id){
                    din=document.getElementById('din');
                    bc=document.getElementById('bc');
                    ac=document.getElementById('ac');
                    cc=document.getElementById('cc');
                    din2=document.getElementById('din2');
                    np=document.getElementById('np');
                    din3=document.getElementById('din3');
                    
                    dc=document.getElementById('dc');
                    di=document.getElementById('di');
                    cp=document.getElementById('cp');
                    
                    money=document.getElementById('dinheiro');
                    depos=document.getElementById('deposito');
                    chpre=document.getElementById('chequepre');
                
                    if(dc.checked){
                            din.style.display='';
                            money.style.display='';
                        }else{
                            din.style.display='none';
                            money.style.display='none';
                        }
                        
                    if(di.checked){
                            depos.style.display='';
                            bc.style.display='';
                            ac.style.display='';
                            cc.style.display='';
                            din2.style.display='';
                        }else{
                            depos.style.display='none';
                            bc.style.display='none';
                            ac.style.display='none';
                            cc.style.display='none';
                            din2.style.display='none';
                        }
                    if(cp.checked){
                            chpre.style.display='';
                            np.style.display='';
                            din3.style.display='';
                        }else{
                            chpre.style.display='none';
                            np.style.display='none';
                            din3.style.display='none';
                        }
                        
                }
				
//FUNCOES DA ENQUETE
function orcamento ()  
	 {
	  document.forms[0].submit();
	 }
	
function impre_pes(parm1)
	 {
		if (document.all['qual'].value == "")
		 	window.alert("Você tem selecionar uma opção."); 
		else
			window.open("http://www.dentrodosfatos.com.br/apgresu.php?id="+parm1+"&modo=1&qual="+document.all['qual'].value,"_new","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=210,height=220");
	  }
	
function passarValor(parm1)
	  { 
		document.all['qual'].value = parm1; 
	  }