// JavaScript Document - 28/06/2007 - 12:10h
//Para inserir o flash
function flash(largura, altura, arquivo, id){
	document.write('<object id="'+id+'" data="'+arquivo+'" type="application/x-shockwave-flash" width="'+largura+'" height="'+altura+'">');
	document.write('<param name="allowScriptAccess" value="sameDomain" /><param name="wmode" value="transparent" />');
	document.write('<param name="movie" value="'+arquivo+'" /><param name="quality" value="high" /><param name="wmode" value="transparent" />');
	document.write('</object>');
}


//Função para solicitar confirmação ao deletar um registro
function verify(){
	msg = "Você tem certeza que deseja excluir este(s) registro(s)?";
	return confirm(msg);	
    }
	
 
 //Check All
 function checkAll(checkname, chkControl) {
  for (i = 0; i < checkname.length; i++)
  checkname[i].checked = chkControl.checked;
}


function verifyCheck(ctlName, formName){

 var flg = false;
 
 if (window.document.forms[formName].elements[ctlName].length>1){
    for(i=0; i<window.document.forms[formName].elements[ctlName].length; i++)
       if(window.document.forms[formName].elements[ctlName][i].checked) flg = true;
} else {
    if (window.document.forms[formName].elements[ctlName].checked) flg = true;
}
 if(!flg){
  alert("Você deve selecionar um ou mais itens!");
  return false;
 }else{
   msg = "Você tem certeza que deseja excluir este(s) registro(s)?";
   if (confirm(msg)) {
     window.document.forms[formName].submit();
     return true;
   }
 }
}


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


//Função que esconde e mostra conteúdos (DIV Content - Show/ Hide) - 13/07/2006
function showContent(obj, objTitulo) {
	var el = document.getElementById(obj);
	if ( el.style.display != "block" ) {
		el.style.display = 'block';
		//objTitulo.style.backgroundImage = 'url(images/menos.gif)';
	}
	else {
		el.style.display = 'none';
		//objTitulo.style.backgroundImage = 'url(images/mais.gif)';
	}
}

/**
* FUNCAO QUE LIMPA OS INPUT TEXT.
*/

//onfocus="clearDefault(this)"


function clearDefault(el) {
  if (el.defaultValue==el.value) el.value = ""
}



//<a href="javascript:textversion();">Versão texto</a>
function textversion () {
		for(i=0;i<document.styleSheets.length;i++){
			void(document.styleSheets.item(i).disabled=true);
		}
		el=document.getElementsByTagName('*');
		for(i=0;i<el.length;i++){
			void(el[i].style.cssText='');
		}
	}
	
function abre(URL){ 
   window.open(URL,"Museu","width=20,height=20,scrollbars=0") 
} 
