// Troca imagem referenciada por idObject
function troca_img_byid(idObject, Src_ref){
	document.getElementById(idObject).src=Src_ref;
}
// Troca limpa um campo form caso valor seja igual a uma referencia
function limpa_campo(idObject, valorRef){
	if(valorRef == document.getElementById(idObject).value){
	    document.getElementById(idObject).value='';
	}
}
// Troca o tipo de um campo passado como parâmetro
function troca_tipo_campo(idObject, objTipo, valorRef){
	if(valorRef == document.getElementById(idObject).value){
	    document.getElementById(idObject).value='';
	    document.getElementById(idObject).type=objTipo;
	}
}
// Exibe ou esconde um div conforme parâmetro onClick="JavaScript:abre_fecha_div('form_login', 'a');"
function abre_fecha_div(idObject, Oper){
	if(Oper == 'a'){
		document.getElementById(idObject).style.display='block';
	}else{
		document.getElementById(idObject).style.display='none';
	}
}
// Exibe menu DHTML com função dropdown baseada em DOM 
function dd_menu(indexMenu, indexObjectItem, numObjects){
	var Object_id = '';
	var Object_id_ref = 'mn_top_' + indexMenu + '_' + indexObjectItem;
	var i = 0;
	for(i=0; i < numObjects; i++){
		Object_id = 'mn_top_' + indexMenu + '_' + i;
		if(indexObjectItem != i){
			document.getElementById(Object_id).style.display='none';
		}
	}
	if(document.getElementById(Object_id_ref).style.display=='none'){
		document.getElementById(Object_id_ref).style.display='block';		
	}else{
		document.getElementById(Object_id_ref).style.display='none';		
	}
}


// Tirar borda arquivos swf
function objectSwftransparencia(swf,width,height) {
  document.write('<object type="application/x-shockwave-flash" width="' + width + '" height="' + height + '" data="' + swf + '">');
  document.write('<param name="bgcolor" value="#ffffff" />');
  document.write('<param name="movie" value="' + swf + '" />');
  document.write('<param name="quality" value="high" />');
  document.write('<param name="menu" value="false" />');
  document.write('<param name="wmode" value="transparent" />');
  document.write('<embed src="' + swf + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '" wmode="transparent"></embed>');
  document.write('</object>');
  
}

function objectSwf(swf,width,height) {
  document.write('<object type="application/x-shockwave-flash" width="' + width + '" height="' + height + '" data="' + swf + '">');
  document.write('<param name="bgcolor" value="#ffffff" />');
  document.write('<param name="movie" value="' + swf + '" />');
  document.write('<param name="quality" value="high" />');
  document.write('<param name="menu" value="false" />');
  document.write('<embed src="' + swf + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>');
  document.write('</object>');
  
}
// Abrir janela capela
		function abrirJanela (URL){
	if(screen.width < 850){
   			window.open(URL,"_blank","width=780, height=536, resizable=no, scrollbars=1, top=0, left=0, toolbar=no,	menubar=no, status=0, location=no");
	}else{
	   window.open(URL,"_blank","width=780, height=700, resizable=no, scrollbars=auto, top=0, left=0, toolbar=no,	menubar=no, status=0, location=no");
	}
}




