function makeFlash(arquivo,id,largura,altura) {
    if (window.navigator.appName == "Microsoft Internet Explorer") {
        document.write('<object id="'+id+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+largura+'" height="'+altura+'">');
        document.write('<param name="allowScriptAccess" value="sameDomain">');
        document.write('<param name="movie" value="'+arquivo+'">');
        document.write('<param name="quality" value="high">');
        document.write('<param name="menu" value="false">');
        document.write('<param name="wmode" value="transparent">');
        document.write('<param name="salign" value="t">');
        document.write('</object>');

    }else{
        document.write('<embed src="'+arquivo+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+largura+'" height="'+altura+'" menu="false" wmode="transparent"></embed>');
    }
}
window.onload = function horizontal() {
 
   var navItems = document.getElementById("menu_dropdown").getElementsByTagName("li");
    
   for (var i=0; i< navItems.length; i++) {
      if(navItems[i].className == "submenu")
      {
         if(navItems[i].getElementsByTagName('ul')[0] != null)
         {
            navItems[i].onmouseover=function() {this.getElementsByTagName('ul')[0].style.display="block";this.style.backgroundColor = "#b50000";}
            navItems[i].onmouseout=function() {this.getElementsByTagName('ul')[0].style.display="none";this.style.backgroundColor = "#b50000";}
         }
      }
   }
 
}

function abrir(arquivo, nome, largura, altura) {
    window.open(arquivo, nome, "width="+largura+",height="+altura+"");
}

function validarContato(){
	form = document.contato;
	if(form.nome.value.length==0){
		alert('Campo Nome Obrigatório!');
		form.nome.focus();
		return false;
	}
	if(form.email.value.length==0){
		alert('Campo E-mail Obrigatório!');
		form.email.focus();
		return false;
	}
	if(form.assunto.value.length==0){
		alert('Campo Assunto Obrigatório!');
		form.assunto.focus();
		return false;
	}
	if(form.mensagem.value.length==0){
		alert('Campo mensagem Obrigatório!');
		form.mensagem.focus();
		return false;
	}
	//document.formContato.remetente.value = form.email.value;
}

function validarRegistro(){
	form = document.registre;
	if(form.nome.value.length==0){
		alert('Campo Nome Obrigatório!');
		form.nome.focus();
		return false;
	}
	if(form.email.value.length==0){
		alert('Campo E-mail Obrigatório!');
		form.email.focus();
		return false;
	}
	/*if(form.endereco.value.length==0){
		alert('Campo Endereço Obrigatório!');
		form.endereco.focus();
		return false;
	}*/
	if(form.pais.value.length==0){
		alert('Campo País Obrigatório!');
		form.pais.focus();
		return false;
	}
	if(form.estado.value.length==0){
		alert('Campo Estado Obrigatório!');
		form.estado.focus();
		return false;
	}
	//document.formContato.remetente.value = form.email.value;
}
function embedVideo(url,id,admin,counter){


var largura = 546;
var altura = 350;
var count = 1;
var classe = document.getElementById(id).className;

document.getElementById('player').innerHTML = '<object width="'+largura+'" height="'+altura+'"><param name="movie" value="'+url+'"></param>	<param name="allowFullScreen" value="true"></param>	<param name="allowScriptAccess" value="always"></param>	<embed src="'+url+'" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="'+largura+'" height="'+altura+'"></embed></object>';
if (admin == 0){
	while(count <= counter){
		if (count == 5 || count == 10){
			document.getElementById("div"+count).className  = "videos menosDir";
		}else{
			document.getElementById("div"+count).className  = "videos";
		}
		count = count + 1;
		
	}
	
	if (classe == "videos menosDir" || classe == "videosSelected menosDir"){
		document.getElementById(id).className = "videosSelected menosDir";
	}else{
		document.getElementById(id).className = "videosSelected";
	}
}else{
	while(count <= counter){
		if (count == 5 || count == 10){
			document.getElementById("div"+count).className = "videosAdmin menosDir";
		}else{
			document.getElementById("div"+count).className = "videosAdmin";
		}
		count = count + 1;
	}if (classe == "videosAdmin menosDir" || classe == "videosAdminSelected menosDir"){
		document.getElementById(id).className = "videosAdminSelected menosDir";
	}else{
		document.getElementById(id).className = "videosAdminSelected";
	}
}
}

function showEmbed(url,miniatura,width,height){
var showEmbed='<object width="'+width+'" height="'+height+'"><param name="movie" value="'+url+'"></param>';
showEmbed+='<param name="allowFullScreen" value="true"></param>';
showEmbed+='<param name="allowScriptAccess" value="always"></param>';
showEmbed+='<embed src="'+url+'" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="'+width+'" height="'+height+'"></embed>';
showEmbed+='</object>';

document.write(showEmbed);
	
}
function showDiv(id,event){
	document.getElementById('[hidden]'+id).style.display="inline";
	
}
function dontshowDiv(id){
	var newid = id+"";
	document.getElementById('[hidden]'+newid).style.display="none";
}
function validaAgenda(){
	var passou = true;
	var alerta = "O sistema encontrou os seguintes erros no preenchimento do formulario:\n\n";
	var indexdia = document.getElementById("AgendaDataDay").selectedIndex;
	var dia = document.getElementById("AgendaDataDay").options[indexdia].value;
	if (dia==""){
		 passou = false; alerta += "- Dia preenchido incorretamente.\n";
	}
	var indexmes = document.getElementById("AgendaDataMonth").selectedIndex;
	var mes = document.getElementById("AgendaDataMonth").options[indexmes].value;
	if (mes==""){
		 passou = false; alerta += "- Mes preenchido incorretamente.\n";
	}
	var indexano = document.getElementById("AgendaDataYear").selectedIndex;
	var ano = document.getElementById("AgendaDataYear").options[indexano].value;
	if (ano==""){
		 passou = false; alerta += "- Ano preenchido incorretamente.\n";
	}
	
	
  if (document.getElementById("AgendaTitulo").value == "") {
	 passou = false; alerta += "- Titulo preenchido incorretamente.\n";
  }
	
	if (passou == true) { return true; }
	else {
	alert(alerta);
	return false;
	}
	
}
function someHorario(){
	if(document.getElementById("AgendaPeriodo").checked){
		document.getElementById("AgendaHorarioHour").disabled=true;
		document.getElementById("AgendaHorarioMin").disabled=true;
	} else {
		document.getElementById("AgendaHorarioHour").disabled=false;
		document.getElementById("AgendaHorarioMin").disabled=false;
	}
}
