// JavaScript Document
function redimen() {
	var ifram = document.getElementById('meio');
	var altura = ifram.contentWindow.document.body.scrollHeight;
	if(altura > 10)	ifram.style.height = altura;
	else ifram.style.height = 10;
}
function mostadm(tabela_id,qts) {
	for(var xx=1;xx<=qts;xx++) {
		if(tabela_id!=xx) document.getElementById(xx).style.display='none';	
	}
	document.getElementById(tabela_id).style.display='';
}
function nav() {
	nav=navigator.appName.toLowerCase();
	moz=nav.indexOf('netscape')+1;
	if(moz) return 'moz';
	else return 'ie';
}
function form_data(campo) {
	if(campo.value.length==2) campo.value=campo.value+"/";	
	if(campo.value.length==5) campo.value=campo.value+"/";	
}
function show_video(arq,wid,hei) {
	nav=navigator.appName.toLowerCase();
	moz=nav.indexOf('netscape')+1;
	if(moz) var nave='moz';
	else var nave='ie';
	if(nave=="ie") {
		document.write("<object ID=\"MediaPlayer\" CLASSID=\"CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95\" CODEBASE=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=5,1,52,701\" STANDBY=\"Loading Microsoft Windows Media Player Components . . .\" TYPE=\"application/x-oleobject\" width=\""+wid+"\" autostart=\"no\" height=\""+hei+"\" align=\"left\" border=\"0\" align=\"left\"><PARAM NAME=\"filename\" VALUE=\""+arq+"\" ref ><PARAM NAME=\"animationatstart\" VALUE=\"-1\"><PARAM NAME=\"transparentatstart\" VALUE=\"-1\">");
	document.write("<PARAM NAME=\"autostart\" VALUE=\"0\">    <PARAM NAME=\"showcontrols\" VALUE=\"-1\">");
    document.write("<param name=\"AudioStream\" value=\"-1\">    <param name=\"AutoSize\" value=\"0\">");
   document.write("<param name=\"AllowScan\" value=\"0\">    <param name=\"AllowChangeDisplaySize\" value=\"-1\">");
    document.write("<param name=\"AutoRewind\" value=\"0\">    <param name=\"Balance\" value=\"0\">");
    document.write("<param name=\"BaseURL\" value>    <param name=\"BufferingTime\" value=\"5\">");
    document.write("<param name=\"CaptioningID\" value>");
    document.write("<param name=\"ClickToPlay\" value=\"-1\">");
    document.write("<param name=\"CursorType\" value=\"0\">");
    document.write("<param name=\"CurrentPosition\" value=\"-1\">");
    document.write("<param name=\"CurrentMarker\" value=\"0\">");
    document.write("<param name=\"DefaultFrame\" value>");
    document.write("<param name=\"DisplayBackColor\" value=\"0\">");
    document.write("<param name=\"DisplayForeColor\" value=\"16777215\">");
    document.write("<param name=\"DisplayMode\" value=\"0\">");
    document.write("<param name=\"DisplaySize\" value=\"0\">");
    document.write("<param name=\"Enabled\" value=\"-1\">");
    document.write("<param name=\"EnableContextMenu\" value=\"-1\">");
    document.write("<param name=\"EnablePositionControls\" value=\"-1\">");
    document.write("<param name=\"EnableFullScreenControls\" value=\"0\">");
    document.write("<param name=\"EnableTracker\" value=\"-1\">");
    document.write("<param name=\"InvokeURLs\" value=\"-1\">");
    document.write("<param name=\"Language\" value=\"-1\">");
    document.write("<param name=\"Mute\" value=\"0\">");
    document.write("<param name=\"PlayCount\" value=\"0\">");
    document.write("<param name=\"PreviewMode\" value=\"0\">");
    document.write("<param name=\"Rate\" value=\"1\">");
    document.write("<param name=\"SAMILang\" value>");
    document.write("<param name=\"SAMIStyle\" value>");
    document.write("<param name=\"SAMIFileName\" value>");
    document.write("<param name=\"SelectionStart\" value=\"-1\">");
    document.write("<param name=\"SelectionEnd\" value=\"-1\">");
    document.write("<param name=\"SendOpenStateChangeEvents\" value=\"-1\">");
    document.write("<param name=\"SendWarningEvents\" value=\"-1\">");
    document.write("<param name=\"SendErrorEvents\" value=\"-1\">");
    document.write("<param name=\"SendKeyboardEvents\" value=\"0\">");
    document.write("<param name=\"SendMouseClickEvents\" value=\"0\">");
    document.write("<param name=\"SendMouseMoveEvents\" value=\"0\">");
    document.write("<param name=\"SendPlayStateChangeEvents\" value=\"-1\">");
    document.write("<param name=\"ShowCaptioning\" value=\"0\">");
    document.write("<param name=\"ShowAudioControls\" value=\"-1\">");
    document.write("<param name=\"ShowDisplay\" value=\"0\">");
    document.write("<param name=\"ShowGotoBar\" value=\"0\">");
    document.write("<param name=\"ShowPositionControls\" value=\"0\">");
    document.write("<param name=\"ShowStatusBar\" value=\"-1\">");
    document.write("<param name=\"ShowTracker\" value=\"0\">");
    document.write("<param name=\"VideoBorderWidth\" value=\"0\">");
    document.write("<param name=\"VideoBorderColor\" value=\"0\">");
    document.write("<param name=\"VideoBorder3D\" value=\"0\">");
    document.write("<param name=\"Volume\" value=\"-600\">");
    document.write("<param name=\"WindowlessVideo\" value=\"0\">");
    document.write("</embed>");
	document.write("</object>");	
	}
	else {
		document.write("<embed src=\""+arq+"\" width=\""+wid+"\" height=\""+hei+"\" align=\"left\"></embed>");
	}
}

var navegador = navigator.appName.toLowerCase();
var mozilla = navegador.indexOf("netscape")+1;
function sonum(evento) {
	tecla = mozilla ? evento.which : evento.keyCode;
	if ( !(tecla >= 48 && tecla <= 57) && (tecla!=8) && (tecla!=46) ) {
		return false;
	}
}
function vld_contato(campo) {
	cp=campo;
	if(cp.nome.value.length==0) {
		alert('Complete o campo NOME!');
		cp.nome.style.backgroundColor="#FFF0F0";
		return false;
	}
	else if(cp.empresa.value.length==0) {
		alert('Complete o campo EMPRESA!');
		cp.empresa.style.backgroundColor="#FFF0F0";
		return false;
	}
	else if(cp.email.value.length==0) {
		alert('Complete o campo E-MAIL!');
		cp.email.style.backgroundColor="#FFF0F0";
		return false;
	}
	else if(cp.cidade.value.length==0) {
		alert('Complete o campo CIDADE!');
		cp.cidade.style.backgroundColor="#FFF0F0";
		return false;
	}
	else if(cp.estado.value.length==0) {
		alert('Complete o campo ESTADO!');
		cp.estado.style.backgroundColor="#FFF0F0";
		return false;
	}
	else if(cp.ddd.value.length==0) {
		alert('Complete o campo TELEFONE!');
		cp.ddd.style.backgroundColor="#FFF0F0";
		return false;
	}
	else if(cp.tel.value.length==0) {
		alert('Complete o campo TELEFONE!');
		cp.tel.style.backgroundColor="#FFF0F0";
		return false;
	}
	else if(cp.cel.value.length==0) {
		alert('Complete o campo CELULAR!');
		cp.cel.style.backgroundColor="#FFF0F0";
		return false;
	}
	else if(cp.msg.value.length==0) {
		alert('Complete o campo MENSAGEM!');
		cp.msg.style.backgroundColor="#FFF0F0";
		return false;
	}
}
/* deleta */
function site(campo) {
	if(campo=="si") {
		document.admin.url.disabled=false;
		document.admin.url.style.backgroundColor='#f8f8f8';
	}
	else {
		document.admin.url.disabled=true;
		document.admin.url.style.backgroundColor='#CCCCCC';
	}
	
}
function maiusc(campo) {
	campo.value=campo.value.toUpperCase();
}
function res(textof) {
	var texto=textof;
	texto=texto.replace("[neg]","<b>");
	texto=texto.replace("[/neg]","</b>");
	texto=texto.replace("[sub]","<u>");
	texto=texto.replace("[/sub]","</u>");
	texto=texto.replace("[ita]","<i>");
	texto=texto.replace("[/ita]","</i>");
	texto=texto.replace("[top]","<font color=\"#FF9900\"><b>");
	texto=texto.replace("[/top]","</font></b>");
	texto=texto.replace("[ico]","<img src=\"images/marcadorLaranja.gif\" border=\"0\">");
	document.write('a'+texto);

}
function formata(oque) {
	var campo=document.admin.texto;
	if(oque=="neg") {
		var jt=campo.value;
		campo.value=jt+"[neg] ESCREVA_AQUI_EM_NEGRITO [/neg]";
	}
	if(oque=="sub") {
		var jt=campo.value;
		campo.value=jt+"[sub] ESCREVA_AQUI_SUBLINHADO [/sub]";
	}
	if(oque=="ita") {
		var jt=campo.value;
		campo.value=jt+"[ita] ESCREVA_AQUI_EM_ITÁLICO [/ita]";
	}
	if(oque=="top") {
		var jt=campo.value;
		campo.value=jt+"[top] ESCREVA_AQUI_O_TÓPICO [/top]";
	}
	if(oque=="ico") {
		var jt=campo.value;
		campo.value=jt+"\n[ico]";
	}
	if(oque=="link") {
		var jt=campo.value;
		nome=prompt("Digite o nome do link:","");
		url=prompt("Digite a URL do link:","http://");
		janela=confirm("Abrir em uma nova Janela ?");
		if(janela) var blank=' target=blank';
		else blank='';
		if(url=="" || nome=="") return false;
		else {
			campo.value=jt+ "\n[link='"+url+"'/l"+blank+"][neg][sub]"+nome+"[/neg][/sub][/link]";
		}
	}
	if(oque=="table") {
		var jt=campo.value;
		var colunas=prompt("Digite o número de colunas","");
		var linhas=prompt("Digite o número de linhas", "");
		var show="";
		for(l=0;l<linhas;l++) {
			show+="[tabela]\n";
			show+="[linha]\n";
			for(c=0;c<colunas;c++) {
				var ll=l+1;
				var cc=c+1;
				show+="[col] CÉLULA "+ll+"."+cc+" [/col]\n";
			}
			show+="[/linha]\n";
			show+="[/tabela]\n";
		}
		campo.value=jt+"\n"+show;
	}
	document.getElementById('texto').focus();
	return false;
}
function pop(pagina,nome,larg,altu,scrollbar) {
  PosIniX=((screen.availWidth/2)-(larg/2));
  PosIniY=((screen.availHeight/2)-(altu/2));
  window.open(pagina,nome,'toolbar=no,location=no,directories=no,menubar=no,scrollbars='+scrollbar+',resizable=no,top='+PosIniY+',left='+PosIniX+',width='+larg+',height='+altu+'');
  window.refresh;
}
function most(tabela_id) {
	if(document.getElementById(tabela_id).style.display=="") {
		document.getElementById(tabela_id).style.display='none';
	}
	else document.getElementById(tabela_id).style.display='';
	return false;
}

 onclick="document.location.href='index.php?op=11'" 
function menu_over(tabela_id,menu_id) {
	document.getElementById(tabela_id).bgColor='#587596';
	document.getElementById(menu_id).style.color='#FFFFFF';
}
function menu_out(tabela_id,menu_id) {
	document.getElementById(tabela_id).bgColor='#6B8DAB';
	document.getElementById(menu_id).style.color='#053335'; // cor que volta 
}
function menu_click(url,target) {
	if(target=="s") {
		window.open(url,'','');	
	}
	else document.location.href=url;
}
function reseta(oq,oq2) {
	if (oq.value=="" && oq2=="l") oq.value='Seu login';
	if (oq.value=="" && oq2=="s") oq.value='xxxxxx';
}
function apaga(oq) {
	if(oq.value=="Seu login") oq.value="";
}

function form_data(campo) {
	if(campo.value.length==2) campo.value=campo.value+"/";	
	if(campo.value.length==5) campo.value=campo.value+"/";	
}
function adm_1(campo) {
	if(campo.checked){
		document.admin.s_index.disabled=true;	
		document.admin.s_empresa.disabled=true;	
		document.admin.s_transporte.disabled=true;	
		document.admin.s_ambiental.disabled=true;	
		document.admin.s_mapas.disabled=true;	
		document.admin.s_noticias.disabled=true;	
		document.admin.s_videos.disabled=true;	
		document.admin.s_contatos.disabled=true;	
		document.admin.s_banner.disabled=true;	
		document.admin.s_rodape.disabled=true;	
		document.admin.s_bl.disabled=true;	
	}
	else {
		document.admin.s_index.disabled=false;	
		document.admin.s_empresa.disabled=false;	
		document.admin.s_transporte.disabled=false;	
		document.admin.s_ambiental.disabled=false;	
		document.admin.s_mapas.disabled=false;	
		document.admin.s_noticias.disabled=false;	
		document.admin.s_videos.disabled=false;	
		document.admin.s_contatos.disabled=false;	
		document.admin.s_banner.disabled=false;	
		document.admin.s_rodape.disabled=false;	
		document.admin.s_bl.disabled=false;	
	}
}
