// JavaScript Document
function abreJanela(url,nome,width,height,extras)
{
    tope = (screen.height-height)/2;
    lefte = (screen.width-width)/2;
    window.open(url,nome,"width=" + width + ",height=" + height + ",top=" + tope + ",left=" + lefte + extras);
}

function EscreveFlash(caminho, width, height)
{
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + width + '" height="' + height + '">');
    document.write('<param name="movie" value="' + caminho + '">');
    document.write('<param name="quality" value="high">');
    document.write('<param name="wmode" value="transparent">');
    document.write('<embed src="' + caminho + '" width="' + width + '" height="' + height + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>');
    document.write('</object>');
}

function EscreveFlashYouTube(caminho, width, height)
{
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + width + '" height="' + height + '">');
    document.write('<param name="movie" value="http://www.youtube.com/v/' + caminho + '&hl=en">');
    document.write('<param name="quality" value="high">');
    document.write('<param name="wmode" value="transparent">');
    document.write('<embed src="http://www.youtube.com/v/' + caminho + '&hl=en" width="' + width + '" height="' + height + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>');
    document.write('</object>');
}

function EscreveFlashYouTubeString(caminho, width, height)
{
    var texto = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + width + '" height="' + height + '">';
    texto += '<param name="movie" value="http://www.youtube.com/v/' + caminho + '&hl=en">';
    texto += '<param name="quality" value="high">';
    texto += '<param name="wmode" value="transparent">';
    texto += '<embed src="http://www.youtube.com/v/' + caminho + '&hl=en" width="' + width + '" height="' + height + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>';
    texto += '</object>';
	
	return texto;
}

function remove_letras (campo) {
	var atual = campo.value;
	comp = campo.value.length;
	if (isNaN(campo.value)) campo.value = campo.value.replace(campo.value.charAt(comp -1),'');
	
	/*var tecla=(window.event)?event.keyCode:e.which;
	
    if((tecla > 47 && tecla < 58)) return true;
    else{
		if (tecla != 8 || tecla != 9 || tecla != 20 || tecla != 13) return false;
		else return true;
	}*/
}

function compara_valores (campo, valor)
{
	if (campo.value == valor) campo.value = '';
	else if (campo.value == '') campo.value = valor;
}