///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//drop-down
function open_window_opcao(form)
			{
			  var result="";
			  for (var i = 0; i < form.opcao.length; i++)
			  	{
				  if (form.opcao.options[i].selected)
				  	{
					  result += form.opcao.options[i].value;
					}
				}
			  if (result == "Null")
			   {
			    alert ("Selecione um Artigo !")
			   }
			    else 
				 {
			  	   aWindow = window.open(result,"_self");
				 }
			}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//valida formulario 
function ValidaComentario(form){
	if(form.nome_comentario.value.length<=1){
		alert("O campo Nome deve estar preenchido corretamente.");
		form.nome_comentario.focus();
		return false;
	}
	if(form.comentario_comentario.value.length<=1){
		alert("O campo Comentário deve estar preenchido corretamente.");
		form.comentario_comentario.focus();
		return false;
	}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//valida formulario 
function ValidaTrabalheConosco(form){
	if(form.nome.value.length<=1){
		alert("O campo Nome deve estar preenchido corretamente.");
		form.nome.focus();
		return false;
	}
	if(form.endereco.value.length<=1){
		alert("O campo Endere&ccedil;o deve estar preenchido corretamente.");
		form.endereco.focus();
		return false;
	}
	if(form.telefone.value.length<=1){
		alert("O campo Telefone deve estar preenchido corretamente.");
		form.telefone.focus();
		return false;
	}
	var str_email = form.email.value ;
    if (( str_email.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) == -1 ) || ( str_email == 'Email:' )){
    	alert("O campo E-mail deve ser preenchido corretamente");
    	form.email.focus();
    	return false;
	}
	if(form.cargo.value.length<=1){
		alert("O campo Cargo Pretendido deve estar preenchido corretamente.");
		form.cargo.focus();
		return false;
	}
	if(form.porquegostaria.value.length<=1){
		alert("O campo Porque Gostaria de Trabalhar conosco deve estar selecionado corretamente.");
		form.estado.focus();
		return false;
	}
	if(form.observacoes.value.length<=1){
		alert("O campo Observações Informações Adicionais deve estar preenchido corretamente.");
		form.observacoes.focus();
		return false;
	}
}
////////////////////////////////////////////////////////////////////////////////////////////
/*Funcao para target*/
function fnTarget(str_target){
	//declaracao de variaveis
	var ch_tag_A, vet_A, int_i;
	var str_titulo;	
	//pega todos os <a> da pagina e percorre um por um para achar o rel="external"
    ch_tag_A = document.getElementsByTagName('a');
    for(int_i=0; int_i<ch_tag_A.length; int_i++){
		vet_A = ch_tag_A[int_i];
		if(vet_A.getAttribute("href") && vet_A.getAttribute('rel') != null){
			if(vet_A.getAttribute('rel').substring(0,8) == 'external'){
				vet_A.target = str_target;
				str_titulo = ch_tag_A.title;
				ch_tag_A.title = str_titulo;
			}
		}
	}
}
///////////////////////////////////////////////////////////////////////////////////////////
//Funcao para flash
function fnFlash(str_url, int_largura, int_altura){
	document.writeln('<object type="application/x-shockwave-flash" data="' + str_url + '" width="' + int_largura + '" height="' + int_altura + '">');
	document.writeln('<param name="movie" value="' + str_url + '">');
	document.writeln('<param name="quality" value="high">');
	document.writeln('<param name="wmode" value="transparent">');
	document.writeln('</object>');
}
////////////////////////////////////////////////////////////////////////////////////////////
//Funcao de popup
function MM_openBrWindow(theURL,winName,features) 
{
	var myWin =  window.open(theURL,winName,features);
	myWin.focus();
}