// Documento JavaScript - essa função é utilizada para IE e cria os id over, menuparent e menuparent2
function IEHoverPseudo() {

	var navItems = document.getElementById("primary-nav").getElementsByTagName("li");
	
	for (var i=0; i<navItems.length; i++) {
		if(navItems[i].className == "menuparent") {
			navItems[i].onmouseover=function() { this.className += " over"; }
			navItems[i].onmouseout=function() { this.className = "menuparent"; }
		}
		else{
			navItems[i].onmouseover=function() { this.className += " over"; }
			navItems[i].onmouseout=function() { this.className = "menuparent2"; }
		}
	}

}


function validarBusca(){
	d = document.busca.palavrachave.value;
	if(d.length < 2 || d == ""){
		alert('mínimo de três letras');
		return false;
	}
	else{
			var numero = d.length;
			for(i=0;i<numero;i++){
			var letra = d.charAt(i);
			especiais = "~`=!@#$%^*()_+\][';/.{}|:?><";
			resultado = especiais.indexOf(letra);
			if(resultado != -1){
			alert("Não utilize os caracteres:\n" + especiais);
			return false
			}
			}
		
	}
}
// When the page loads: 
window.onload = function(){ 
IEHoverPseudo();
if (document.getElementsByTagName) { 
// Get all the tags of type object in the page. 
var objs = document.getElementsByTagName("object"); 
for (i=0; i<objs.length; i++) { 
// Get the HTML content of each object tag 
// and replace it with itself. 
objs[i].outerHTML = objs[i].outerHTML; 
} 
} 
} 
// When the page unloads: 
window.onunload = function() { 
IEHoverPseudo();
if (document.getElementsByTagName) { 
//Get all the tags of type object in the page. 
var objs = document.getElementsByTagName("object"); 
for (i=0; i<objs.length; i++) { 
// Clear out the HTML content of each object tag 
// to prevent an IE memory leak issue. 
objs[i].outerHTML = ""; 
} 
} 
} 

