function fnTarget(str_target){
	var ch_tag_A, vet_A, int_i;
	var str_titulo;
    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;
			}
		}
	}
}
function onOff(id){
	esconder = (document.getElementById(id).style.display == 'block');
	/*if ( visivel == "" || visivel == "none" ) { document.getElementById(id).style.display = "block" }
	else{ document.getElementById(id).style.display = "none"; }*/
	lis = document.getElementsByTagName('LI');
	for(d=0; d<lis.length; d++){
		_li = lis[d];
		if(_li.className == 'titulo'){
			id_link = 'titulo_'+(_li.id);
			_link = document.getElementById(id_link);
			if(_li.id == id){ _li.style.display = esconder ? 'none' : 'block'; }
		}
	}
}
function oculta(id){
	esconder = (document.getElementById(id).style.display == 'block');
	/*if ( visivel == "" || visivel == "none" ) { document.getElementById(id).style.display = "block" }
	else{ document.getElementById(id).style.display = "none"; }*/
	divs = document.getElementsByTagName('DIV');
	for(d=0; d<divs.length; d++){
		_div = divs[d];
		if(_div.className == 'titulos'){
			id_link = 'titulos_'+(_div.id);
			_link = document.getElementById(id_link);
			if(_div.id != id){ _div.style.display = 'none'; }
			else{ _div.style.display = esconder ? 'none' : 'block'; }
		}
	}
}
function MM_openBrWindow(theURL,winName,features){
	var myWin = window.open(theURL,winName,features);
	myWin.focus();
}
function fnMascara(objeto,evt,mask){
	var LetrasU = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
	var LetrasL = 'abcdefghijklmnopqrstuvwxyz';
	var Letras  = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
	var Numeros = '0123456789';
	var Fixos  = '().-:/ ';
	var Charset = " !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_/`abcdefghijklmnopqrstuvwxyz{|}~";
	evt = (evt) ? evt : (window.event) ? window.event : "";
	var value = objeto.value;
	if(evt){
		var ntecla = (evt.which) ? evt.which : evt.keyCode;
		tecla = Charset.substr(ntecla - 32, 1);
		if(ntecla < 32) return true;
		var tamanho = value.length;
		if(tamanho >= mask.length) return false;
		var pos = mask.substr(tamanho,1);
		while(Fixos.indexOf(pos) != -1){
 	 		value += pos;
 	 		tamanho = value.length;
 	 		if(tamanho >= mask.length) return false;
 	 		pos = mask.substr(tamanho,1);
		}
		switch(pos){
   			case '#': if(Numeros.indexOf(tecla) == -1) return false; break;
   			case 'A': if(LetrasU.indexOf(tecla) == -1) return false; break;
   			case 'a': if(LetrasL.indexOf(tecla) == -1) return false; break;
   			case 'Z': if(Letras.indexOf(tecla) == -1) return false; break;
   			case '*': objeto.value = value; return true; break;
   			default: return false; break;
 		}
	}
	objeto.value = value;
	return true;
}
function ValidaForm_Busca(form){
	if(form.busca.value.length<=1){
		alert("O campo Busca deve estar preenchido corretamente.");
		form.busca.focus();
		return false;
	}
}
function ValidaForm_Login(form){
	if(form.usuario.value.length<=1){
		alert("O campo Login deve estar preenchido corretamente.");
		form.usuario.focus();
		return false;
	}
	if(form.senha.value.length<=1){
		alert("O campo Senha deve estar preenchido corretamente.");
		form.senha.focus();
		return false;
	}
}
function ValidaForm_esqueci(form){
	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;
	}
}
function ValidaForm_Cesta(form){
	if(form.quant.value.length<1){
		alert("O campo Quantidade deve estar preenchido corretamente.");
		form.quant.focus();
		return false;
	}
}
function ValidaForm_Login_interna(form){
	if(form.usuario.value.length<=1){
		alert("O campo Login deve estar preenchido corretamente.");
		form.usuario.focus();
		return false;
	}
	if(form.senha.value.length<=1){
		alert("O campo Senha deve estar preenchido corretamente.");
		form.senha.focus();
		return false;
	}
}
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>');
}