function flash(w,h,wmode,movie) {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+w+'" height="'+h+'">');
	document.write('<param name="scale" value="noscale">');
	document.write('<param name="wmode" value="'+wmode+'">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="menu" value="false">');
	document.write('<param name="movie" value="'+movie+'">');
	document.write('<embed src="'+movie+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="'+wmode+'" scale="noscale" menu="false" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'"></embed>');
	document.write('</object>');
}


function wmp(w,h,movie) {
	document.write('<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" width="'+w+'" height="'+h+'" standby="Loading..." type="application/x-oleobject" codeBase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701">');
	document.write('<param name="FileName" value="'+movie+'" />');
	document.write('<param name="AutoStart" value="1" />');
	document.write('<param name="TransparentAtStart" value="0" />');
	document.write('<param name="ShowControls" value="1" />');
	document.write('<param name="ShowDisplay" value="0" />');
	document.write('<param name="ShowStatusBar" value="1" />');
	document.write('<param name="AutoSize" value="0" />');
	document.write('<param name="ShowPositionControls" value="0" />');
	document.write('<embed filename="'+movie+'" width="'+w+'" height="'+h+'" type="application/octet-stream" autostart="1" transparentatstart="0" showcontrols="1" showdisplay="0" showstatusbar="1" showpositioncontrols="0"></embed>');
	document.write('</object>');
}


// onkeypress="return soNumeros(event)"
function soNumeros(caracter) {
   var tecla = 0;
   if (caracter.keyCode != '') {
      tecla = event.keyCode;
   }
   else {
      tecla = caracter.which;
   }

  if(tecla > 47 && tecla < 58) { // numeros de 0 a 9
		return true;
   }else 
      if ((tecla == 0) || (tecla == 8) || (tecla == 13)) { // backspace e Del
        return true;
    }
      else {
         return false;
    }

}


// onblur="verificaData(this)"
function verificaData(data) { 
	if (data.value != "") {
		dia = (data.value.substring(0,2));
		mes = (data.value.substring(3,5)); 
		ano = (data.value.substring(6,10)); 
		situacao = ""; 
		if ((dia < 01)||(dia < 01 || dia > 30) && (  mes == 04 || mes == 06 || mes == 09 || mes == 11 ) || dia > 31) { 
			situacao = "falsa"; 
		} 
		if (mes < 01 || mes > 12 ) { 
			situacao = "falsa"; 
		}
		if (mes == 2 && ( dia < 01 || dia > 29 || ( dia > 28 && (parseInt(ano / 4) != ano / 4)))) { 
			situacao = "falsa"; 
		} 
		if (situacao == "falsa") { 
			data.select();
			alert("Data inválida."); 
		}
	}
}


// onkeypress="return mascaraData(this,event)"
function mascaraData(input,evnt) {
	if (input.value.length == 2 || input.value.length == 5) {
 		if (navigator.appName.indexOf('Microsoft') != -1) {
 			input.value += "/";
 		}
		else {
			if (evnt.keyCode == 0) {
 				input.value += "/";
 			}
 		}
 	}
 	return soNumeros(evnt);
}


function poupImagens(tabela, owner) {
	var width = 300;
	var height = 450;
	var left = (screen.width - width) / 2;
	var top = (screen.height - height) / 2;
	window.open('imagens.asp?tabela='+tabela+'&owner='+owner, 'poupImagens', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, locationbar=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}

function poupVideo(codigo) {
	var width = 280;
	var height = 430;
	var left = (screen.width - width) / 2;
	var top = (screen.height - height) / 2;
	window.open('video.asp?cod='+codigo, 'poupVideo', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, locationbar=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}


// onkeypress="return validaLoginSenha(event)"
function validaLoginSenha(caracter){

	var tecla = 0;
		
	if (caracter.keyCode != '')
	{
		tecla = event.keyCode;
	}
	else
	{
		tecla = caracter.which;
	}
		
	if ((tecla > 47 && tecla < 58) || (tecla > 96 && tecla < 123) || (tecla == 10) || (tecla == 13) || (tecla == 177))
	{
		document.getElementById("erro").innerHTML = '';
		return true;
	}	
	else
	{
		document.getElementById("erro").innerHTML = 'use minúsculas ou números';
		return false;
	}
}


function ocultaDisney() {
	document.getElementById('disney').style.display = 'none';
}


function abreLinkUtil(endereco) {
	if (endereco != "") {
		window.open(endereco);
	}
}