function confirma() {
	a = document.form_home;
	err = '';
	
	if (a.nome.value.length==0) {
		err += '\n- Preencha o campo Nome';
	}
	if (a.empresa.value.length==0) {
		err += '\n- Preencha o campo Empresa';
	}
	if (a.email.value.length==0) {
		err += '\n- Preencha o campo E-mail';
	} else {
		if (a.email.value.indexOf('@')<1 || a.email.value.indexOf('.')<1) {
			err += '\n- Preencha o campo E-mail corretamente';
		}
		
	}
	
	if (err.length>0) {
		alert('Houve um erro ao enviar o formulário:'+err);
	} else  {
		a.submit();
	}
}

function muda_frame ( nid ) {
	var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1];
	var FFextraHeight=getFFVersion>=0.1? 16 : 0; //extra height in px to add to iframe in FireFox 1.0+ browsers
	var currentfr=document.getElementById(nid);
	if (currentfr && !window.opera) {
		currentfr.style.display="block";
	}
	if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) { //ns6 syntax
		currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; 
	} else if (currentfr.Document && currentfr.Document.body.scrollHeight) { //ie5+ syntax
		currentfr.height = currentfr.Document.body.scrollHeight;
	}
}

function NewWindow(mypage,myname,w,h,scroll,status){
	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+',status='+status+','
	win = window.open(mypage,myname,settings)
}
