// JavaScript Document
function diasemana()
{
	var mydate=new Date()
	var year=mydate.getYear()
	if (year<2000)
	year += (year < 1900) ? 1900 : 0
	var day=mydate.getDay()
	var month=mydate.getMonth()
	var daym=mydate.getDate()
	if (daym<10)
	daym="0"+daym
	var dayarray=new Array("Domingo","Segunda-feira","Terça-feira","Quarta-feira","Quinta-feira","Sexta-feira","Sábado")
	var montharray=new Array(" de Janeiro de "," de Fevereiro de "," de Março de ","de Abril de ","de Maio de ","de Junho de","de Julho de ","de Agosto de ","de Setembro de "," de Outubro de "," de Novembro de "," de Dezembro de ")
	document.write(dayarray[day]+", "+daym+" "+montharray[month]+year);
}

function openWindow(id)
{
	var wind=window.open('popup_swf.php?id=' + id, 'wind', 'resizable=yes, scrollbars=yes, width=450, height=462');	
	wind.focus();
}

function openJanela(id)
{
	var wind=window.open('popup_img.php?id=' + id, 'wind', 'resizable=yes, scrollbars=yes, width=510, height=340');
	wind.focus();
}

function submitFrm()
{
	var frm = document.frmContato;
	
	if(frm['nome'].value.length < 2)
	{
		alert("Por favor, verifique o campo \"Nome\".");
		frm['nome'].focus();
		return (false);
	}
	
	if(frm['email'].value.length < 2)
	{
		alert("Por favor, verifique o campo \"E-mail\".");
		frm['email'].focus();
		return (false);
	}
	
	if(frm['assunto'].value == '')
	{
		alert("Por favor, verifique o campo \"Assunto\".");
		frm['assunto'].focus();
		return (false);
	}
	
	if(frm['msg'].value.length < 2)
	{
		alert("Por favor, verifique o campo \"Comentário\".");
		frm['msg'].focus();
		return (false);
	}
	
	frm.submit();
}

function chkSatisfacao()
{
	var f = document.frm;
	
	if(f['nome'].value.length < 2)
	{
		alert("Por favor, verifique o campo \"Nome\".");
		f['nome'].focus();
		return (false);
	}
	
	if(f['empresa'].value.length < 2)
	{
		alert("Por favor, verifique o campo \"Empresa\".");
		f['empresa'].focus();
		return (false);
	}
	
	if(f['cnpj'].value.length < 2)
	{
		alert("Por favor, verifique o campo \"Comentário\".");
		f['cnpj'].focus();
		return (false);
	}
}

function checkCurriculum()
{
	var f = document.frm;
	
	if(f['nome'].value.length < 2)
	{
		alert("Por favor, verifique o campo \"Nome\".");
		f['nome'].focus();
		return (false);
	}
	
	if(f['email'].value.length < 2)
	{
		alert("Por favor, verifique o campo \"E-mail\".");
		f['email'].focus();
		return (false);
	}
	
	if(f['fone'].value.length < 2)
	{
		alert("Por favor, verifique o campo \"Fone\".");
		f['fone'].focus();
		return (false);
	}
	
	if(f['endereco'].value.length < 2)
	{
		alert("Por favor, verifique o campo \"Endereço\".");
		f['endereco'].focus();
		return (false);
	}
	
	if(f['cidade'].value.length < 2)
	{
		alert("Por favor, verifique o campo \"Cidade\".");
		f['cidade'].focus();
		cidade (false);
	}
	
	if(f['estado'].value.length < 2)
	{
		alert("Por favor, verifique o campo \"Estado\".");
		f['estado'].focus();
		return (false);
	}
	
	return (true);
}

function changeStatus(field, n)
{
	if(n==1)
	{
		document.frm[field].disabled = false;
	}
	else
	{
		document.frm[field].disabled = true;	
	}
}
