// Funçoes JavaScript
////////////////////////////////////////////////////////////////////////////////////////////
// Insere flash ativado
function hp_escreveflash(piWid, piHei, psSrc, psWm, psId) {
	var strSwf;

	strSwf = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" id="+psId+" width="+piWid+" height="+piHei+">";
	strSwf += "<param name=\"movie\" value="+psSrc+" />";
	strSwf += "<param name=\"allowScriptAccess\" value=\"sameDomain\" />";
	strSwf += "<param name=\"quality\" value=\"high\" />";
	strSwf += "<param name=\"wmode\" value=\""+psWm+"\" />";
	strSwf += "<embed id="+psId+" name="+psId+" allowScriptAccess=\"sameDomain\" swLiveConnect=\"true\" src="+psSrc+" quality=\"high\" wmode=\"transparent\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width="+piWid+" height="+piHei+"></embed></object>";
	
	this.document.write(strSwf);
} 

////////////////////////////////////////////////////////////////////////////////////////////
// Validador dos Campos de Login e Senha da Tarja Superior das Escolas
function ValidaLogin(form) {

 if (form.strLogin.value == "") {
  window.alert('Favor entrar com um valor no campo "Login".');
  form.strLogin.focus();
  return (false);
 }
 try{
	if (form.strSenha.value == "") {
		window.alert('Favor entrar com um valor no campo "Senha".');
		form.strSenha.focus();
		return (false);
	}else
	{
		return true;
	}
 }catch(erross){}
 	
 if (document.getElementById('strSenhaSS').value == "") {
  window.alert('Favor entrar com um valor no campo "Senha".');
  form.strSenhaSS.focus();
  return (false);
 }
 
 return (true);
}

///////////////////////////////////////////////////////////////////////////////////////////

// Menu de A a Z XML
function Go2(address) {
	document.getElementById('linkaz').href = address;
	document.getElementById('linkaz').target = '_top';
	document.getElementById('linkaz').click();
	}
	
function focoLogin(){
	if(document.getElementById('strLogin').value == "Login"){
		document.getElementById('strLogin').value = "";	
	}
}

function blurLogin(){
	if(document.getElementById('strLogin').value == ""){
		document.getElementById('strLogin').value = "Login";
	}
}

function focoSenha(){
	if(document.getElementById('strSenhaSS').value == "Senha"){
		document.getElementById('strSenhaSS').value = "";	
		document.getElementById('strSenhaSS').type = "password";
	}
}

function blurSenha(){
	if(document.getElementById('strSenhaSS').value == ""){
		document.getElementById('strSenhaSS').value = "Senha";
		document.getElementById('strSenhaSS').type = "text";
	}
	
}

function focoPesquisa(){
	document.getElementById('strpc_topo').value = "";	
}

function blurPesquisa(){	
	if(document.getElementById('strpc_topo').value == ""){
		document.getElementById('strpc_topo').value = "Pesquisa Escolar";	
	}
}

function ocultarSenhaSS(oCampo){
  oCampo.style.display = "none";
  document.getElementById("strSenhaSS").style.display = "";
  document.getElementById("strSenhaSS").focus();
}

function restaurarCampoSS(oCampo){
	if(oCampo.value==""){
	  document.getElementById("strSenhaSS").style.display = "none";
	  document.getElementById("strSenhaSSFD").style.display = "";
	  document.getElementById("strSenhaSSFD").value = "Senha";
    }
}