// JavaScript Document

function Esvazia(valor_campo){
   
if (valor_campo.value == valor_campo.defaultValue)
	valor_campo.value='';
}

function Padrao(valor_campo){

if (valor_campo.value == '')
	valor_campo.value=valor_campo.defaultValue;
}


function SubmetPopUpNewsletter(){
with (document.formcadastro_newsletter) {
method = "POST";
action="conf_newsletter.php";
jan=window.open('conf_newsletter.php','popupImageWindow','width=420,height=240,scrollbars=no,screenX=150,screenY=150,top=150,left=150');
target='popupImageWindow';
submit();
}
return true;
}

function SubmetPopUp(){
with (document.formenquete) {
method = "POST";
action="enquete.php";
jan=window.open('enquete.php','popupImageWindow','width=460,height=335,scrollbars=no');
target='popupImageWindow';
submit();
}
return true;
}

function SubmetPopUp2(){
with (document.formenquete) {
method = "POST";
action="enquete.php?res=1";
jan=window.open('enquete.php?res=1','popupImageWindow','width=450,height=335,scrollbars=no');
target='popupImageWindow';
submit();
}
return true;
}

var win = null;
function NovaJanela(pagina,nome,w,h,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=no,status=yes'
	win = window.open(pagina,nome,settings);
}

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='wmode' value='transparent'>");
	document.write("<param name='movie' value='" + file + "'>");
    document.write("<param name='quality' value='high'>");
    document.write("<embed src='" + file + "' quality='high' wmode='transparent' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" + width + "' height='" + height + "'></embed>");
    document.write("</object>");
}

function formatar(src, mask)
{
  var i = src.value.length;
  var saida = mask.substring(0,1);
  var texto = mask.substring(i)
if (texto.substring(0,1) != saida)
  {
        src.value += texto.substring(0,1);
  }
}