function openPictureWindow_Fever(imageType,imageName,imageWidth,imageHeight,alt,posLeft,posTop) {  // v4.01
	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=no,left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	if (imageType == "swf"){
	newWindow.document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\">');
	newWindow.document.write('<param name=movie value=\"'+imageName+'\"><param name=quality value=high>');
	newWindow.document.write('<embed src=\"'+imageName+'\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\">');
	newWindow.document.write('</embed></object>');	}else{
	newWindow.document.write('<img src=\"'+imageName+'\" width='+imageWidth+' height='+imageHeight+' alt=\"'+alt+'\">'); 	}
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}



function AceitarFormulario(aceito)
{
if (document.getElementById(aceito).checked == false )
	{
	alert('Aceite as condições de serviço para prosseguir');
	return false;
	}
	else
	return true;
}


/*Cria mascara para entrada de campos
CEP
OnKeyPress="formularioEntradaFormata(this, '#####-###')"
CPF
OnKeyPress="formularioEntradaFormata(this, '###.###.###-##')"
DATA
OnKeyPress="formularioEntradaFormata(this, '##/##/####')"
*/

function formularioEntradaFormata(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);
	}
}
	
	


//Contar caracteres de campoTexto
// onKeyUp='contaCaracteres(this,car,500);

	function contaCaracteres(texto,subtrair,total)
	{ 
	var campoTexto = texto;
	var contar = subtrair;
	var caracteres = total;
	
	intCaracteres = caracteres - campoTexto.value.length; 
	if (intCaracteres > 0)
	{ 
	contar.value = intCaracteres; 
	return true; 
	} 
	else 
	{ 
	contar.value = 0; 
	campoTexto.value = campoTexto.value.substr(0,caracteres) 
	return false; 
	} 
	} 

function formCriaPopup(t,lar,alt)
{
//onsubmit="return formCriaPopup(this.target,'300','350')" target="formtarget"
window.open("", t, "width="+lar+",height="+alt+",status=1,scrollbars=1,resizable=1,top=10,left=10");
return true;
}

//onkeypress="return formataCPF(this , event)"
function formataCPF(input, evento)
{
var BACKSPACE=  8; 
var DEL=  46; 
var FRENTE=  39; 
var TRAS=  37;          
var tecla= (evento.keyCode ? evento.keyCode: evento.which ? evento.which : evento.charCode)
if (( tecla == BACKSPACE )||(tecla == DEL)||(tecla == FRENTE)||(tecla == TRAS)) {
return true; 
}
if ( tecla == 13 )     return false; 

if ((tecla<48)||(tecla>57))
{
evento.returnValue =false;
return false;
} 
else 
	{ 
	if((input.value.length==3)||(input.value.length==7))
		{
		input.value=input.value + "." ;
		} 
	else 
		{
		if(input.value.length==11) 
			{
			input.value=input.value + "-" ;
			}
		}
	}
return true;		

}


//onkeypress="return formataTelefone(this , event)"
function formataTelefone(input, evento)
	{
	var BACKSPACE=  8; 
	var DEL=  46; 
	var FRENTE=  39; 
	var TRAS=  37; 
	var tecla= (evento.keyCode ? evento.keyCode: evento.which ? evento.which : evento.charCode)
	if (( tecla == BACKSPACE )||(tecla == DEL)||(tecla == FRENTE)||(tecla == TRAS)) {
	return true; 
	}
	if ( tecla == 13 )     return false; 
	
	
	if ((tecla<48)||(tecla>57)) {
	evento.returnValue = false; 
	return false;
	} else { 
	

	if ((input.value.length==0)) 
		{
		input.value=input.value + "(" ;
		}

	else if ((input.value.length==3)) 
		{
		input.value=input.value + ")" ;
		}
	else if ((input.value.length==8)) 
		{
		input.value=input.value + "-" ;
		}


	}
	return true;			
};


//onkeypress="return formataData(this , event)"
function formataData(input, evento)
	{
	var BACKSPACE=  8; 
	var DEL=  46; 
	var FRENTE=  39; 
	var TRAS=  37; 
	var tecla= (evento.keyCode ? evento.keyCode: evento.which ? evento.which : evento.charCode)
	if (( tecla == BACKSPACE )||(tecla == DEL)||(tecla == FRENTE)||(tecla == TRAS)) {
	return true; 
	}
	if ( tecla == 13 )     return false; 
	
	
	if ((tecla<48)||(tecla>57)) {
	evento.returnValue = false; 
	return false;
	} else { 
	if ((input.value.length==2)||(input.value.length==5)) 
		{
		input.value=input.value + "/" ;
		}
	}
	return true;			
};



function checa_destino(){
// Checo se o checbox 1 está marcado
	f = eval('document.form1');
	if(f.destino[1].checked){
		// Se estiver marcado 
		// Zero os campos largura, altura, top, left
		f.top.value = "";
		f.left.value = "";
		f.redimencionar.value = "";
		f.rolagem.value = "";
		f.status.value = "";
		f.navegacao.value = "";
		f.endereco.value = "";
		f.menu.value = "";
										
		// Modifico as cores dos campos dos campos 
		f.largura.style.backgroundColor = "#DDDDDD";
		f.altura.style.backgroundColor = "#DDDDDD";					
		f.top.style.backgroundColor = "#DDDDDD";
		f.left.style.backgroundColor = "#DDDDDD";
		
		// Desabilito os campos largura, altura, top, left
		f.largura.disabled = true;
		f.altura.disabled = true;
		f.top.disabled = true;
		f.left.disabled = true;

	}else{
		if(f.destino[2].checked){
		
			// Modifico as cores dos campos
			f.largura.style.backgroundColor = "#FFFFFF";
			f.altura.style.backgroundColor = "#FFFFFF";					
			f.top.style.backgroundColor = "#FFFFFF";
			f.left.style.backgroundColor = "#FFFFFF";
			
			// abilito os campos largura, altura, top, left
			f.largura.disabled = false;
			f.altura.disabled = false;
			f.top.disabled = false;
			f.left.disabled = false;
			
			// Coloco o cursor de texto no campo Nome Empresa 
			f.largura.focus();

		}
	}
								
}


