// flash exemplo 1  eliminar borda  Internet Explorer------------------------------------

function flash(file, width, height){
    document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='" + width + "' height='" + height + "'>");
    document.write("<param name='movie' value='" + file + "'>");
    document.write("<param name='quality' value='high'>");
	document.write("<param name='wmode' value='transparent'>");
    document.write("<embed src='" + file + "' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" + width + "' height='" + height + "'></embed>");
    document.write("</object>");
}

function flash_01(file, width, height){
    document.write("<object  class='foto_esq' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='" + width + "' height='" + height + "'>");
    document.write("<param name='movie' value='" + file + "'>");
    document.write("<param name='quality' value='high'>");
	document.write("<param name='wmode' value='transparent'>");
    document.write("<embed src='" + file + "' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" + width + "' height='" + height + "'></embed>");
    document.write("</object>");
}

function data(wparam) {
	var campo = wparam;
	if (campo.value.length == 2)
			campo.value += "/";
	if (campo.value.length == 5)
			campo.value += "/";		
}	
	
function hora(wparam) {
  var campo = wparam;
	if (campo.value.length == 2)
			campo.value += ":";
}

function formatadata(wparam) 
{
	switch (wparam.value.length) 
	{
		case 2: wparam.value += ("/")
				break
		case 5:	wparam.value += ("/")
				break
	}
}

function isNumberKey(Key)
{
   var charCode = (Key.which) ? Key.which : event.keyCode
   if (charCode < 48 || charCode > 57)
	  return false;
   return true;
}
	
function formatatelefone(wparam) 
{
	switch (wparam.value.length) 
	{
		case 0: wparam.value += ("(")
				break
		case 3:	wparam.value += (")")
				break
		case 8:	wparam.value += ("-")
				break
	}
}
function validaData(data) {
    var ok = true;
	var s = '';
	var dia, mes, ano;
    if (!(data.match(/^[0-9]{2,2}[./-]{0,1}[0-9]{2,2}[./-]{0,1}[0-9]{4,4}$/))) {
        ok = false;
    }
	if((data.charAt(2) != '/') || (data.charAt(5) != '/')){
		ok =  false;
	}
    
	s = data.replace('/','').replace('/','');
	//s = data.replace('-','').replace('-','');
	//s = data.replace('.','').replace('.','');

    dia = parseInt(data.substr(0,2));
    mes = parseInt(data.substr(2,2));
    ano = parseInt(data.substr(4,4));
    if ((mes < 1) || (mes > 12)) {
        ok =  false;
    }
    if ((dia < 1) || (dia > 31)){
        ok =  false;
    }
    if ((mes == 2) || (mes == 4) || (mes == 6) || (mes == 9) || (mes == 11)) {
        if (dia > 30) {
            ok =  false;
        }
        if (mes == 2) {
            if (ano % 4 == 0) {
                if (dia > 29) {
                    ok =  false;
                }
            }
            else {
                if (dia > 28) {
                    ok =  false;
                }
            }
        }
    }
 if(!ok) alert('Data inválida!');
}