<!-- 
//
function troca_destaque(num)
{
	for (i=1; i<=6; i++)
	{
		elemento = 'imagemdest' + i;
		if (i != num)
		{
			document.getElementById(elemento).style.display = "none";
		}
		else
		{
			document.getElementById(elemento).style.display = "";
		}
	}
}
function mostraspan(obj,tipo){
	// array com as tabelas
	if (tipo == 'cap')
		limite = 6;
	if (tipo == 'sub')
		limite = 6;
	
	for (x=1;x<=limite;x++){
//			alert(x);
		if (x == obj){
			if (eval(tipo+x+".style.display == 'none'"))
				eval(tipo+x+".style.display = ''") ;
			else
				eval(tipo+x+".style.display = 'none'") ;				
		}else{
			eval(tipo+x+".style.display = 'none'") ;
		}
	}
}
function acesso_ucn(empreg,acesso,base,w,h) { //v2.0 - ABRE O POPUP (CENTRALIZADO)
	var winl = (screen.width - w) / 2;
  	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=yes,resizable=yes'
	UCN = window.open('http://sistema.ucn.com.br/'+base+'/'+acesso+'/'+empreg,'UCN',winprops)
	UCN.focus() 
}

function abre_layer(layer){
	document.getElementById(layer).style.visibility = "visible";
}
	
function fecha_layer3(layer){
	document.getElementById(layer).style.visibility = "hidden";
}
	
function abretela(imagem,largura,altura){
	var popup_URL = "../include/abre_imagem.asp?imag="+imagem;
	popup = window.open(popup_URL,"TELAS","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=" + largura + " height=" + altura);
}

function popupabrefoto(largura,altura, id){
	var popup_URL = "../popup/popup.asp?id="+id+"&h="+altura+"&w="+largura;
	popup = window.open(popup_URL,"FOTOS","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=" + largura + " height=" + altura + ",top=0,left=0");
	//,top="+((screen.availHeight/2)-(altura/2))+",left="+((screen.availWidth/2)-(largura/2))
	popup.focus();
}

function textCounter(campo, countcampo, maxlimit){//conta/mostra caracteres restantes e limita o tamanho do campo
    if (campo.value.length > maxlimit) //se passar do limite nao deixa entrar o caracter
        campo.value = campo.value.substring(0, maxlimit);
        //reduz o valor do campo de contadem
    else 
        countcampo.value = maxlimit - campo.value.length;
}

function confereComent()
{
	str = "É preciso preencher o nome, o e-mail e o texto.";

	if (document.forms[0].nome.value.length == 0)
	{
		alert(str);
		return false;	
	}
	if (document.forms[0].email.value.length == 0)
	{
		alert(str);
		return false;	
	}
	if (document.forms[0].desc.value.length == 0)
	{
		alert(str);
		return false;	
	}
}
function validaEmail() {
	cad = document.form1 
	if (cad.email.value.indexOf ('@',0) == -1 || cad.email.value.indexOf ('.',0) == -1){
		alert("Esse não é um e-mail válido.")
		return false;   
	}else{
		return true;
	}
}

function conferePedido(page)
{
	str = "Os campos marcados com * são obrigatórios.";
	if (page == 'inscricao'){
		if (document.form1.str_curso.value == 0){
			alert(str);
			return false;	
		}
	}
	if (document.form1.nome.value.length == 0)
	{
		alert(str);
		return false;	
	}
	if (document.form1.telefone.value.length == 0)
	{
		alert(str);
		return false;	
	}else{
		return validaEmail();
	}
}

function carregaDados(){
	var indice = document.form1.str_curso.selectedIndex ;
	var curso = document.form1.str_curso.options[eIndice].text;

	document.form1.str_nmCurso.value = curso;

}


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_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_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_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 validaEnquete(page){
	var controle = 0;
	var divMsg = document.getElementById("msgEnquete");
	for (i=0;i<document.form1.elements.length;i++){
		if (document.form1.elements[i].type == "radio"){
			if (document.form1.elements[i].checked == true){
				controle++;
			}
		}
	}
	if (controle <= 0){
		divMsg.style.visibility = "visible";
		//alert("Selecione uma das opções");
		return false;
	}else{
		envioForm(page);
		return true;	
	}
}
function envioForm(page){
	if (formulario==1){
		document.form1.action = "cont_cursos.asp?form=1#b"
	}else{
		document.form1.action = "cont_cursos.asp?form=2#g"
	}
}
function MM_openBrWindow(theURL,winName,w,h,features) { //v2.0
  var winl = (screen.width - w) / 2;
  var wint = (screen.height - h) / 2;
  winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=no'
  win = window.open(theURL,winName,winprops,features);
  if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
function MM_openBrWindow2(theURL,winName,features) { //v2.0 - ABRE O POPUP (CENTRALIZADO)
  var w = screen.width;
  var h = (screen.height-70);
  winprops = 'height='+h+',width='+w+',top=0,left=0,scrollbars=yes,resizable=no'
  win = window.open(theURL,winName,winprops,features);//showModalDialog
  if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

//-->

