function atLeastOne(){
  var objForm = document.forms[0];
  var el = document.getElementsByName('linhasMarcadas[]');
  for(i=0;i<el.length;i++){
    if(el[i].checked){
       return true;
    }
  }
  return false;
}


  function mostra(cmd){
  	
  	if (atLeastOne()){
	  	if ((cmd=='Copiar') || (cmd=='Mover')){ 
	  		//mostra layer cat
	  		MM_showHideLayers('Layer1','','show');
	  		MM_setTextOfLayer('Label1','',cmd + ' selecionados para');
	  		//MM_showHideLayers('Layer1','','hide');
	  		//submit
	  		var submita = document.getElementById('submit1');
	  		submita.value=cmd;
	  		
	  	}
	  	else if (cmd=='Apagar'){
	  		
	  	/// testar se esta checked
	  		 MM_showHideLayers('Layer2','','show');
	  		//MM_setTextOfLayer('Label1','',cmd + ' selecionados para');
	  		//MM_showHideLayers('Layer1','','hide');
	  		//submit
	  		var submita = document.getElementById('submit2');
	  		submita.value=cmd;
	  	}
  	}
  	
  }

function mostra2(){
	MM_showHideLayers('Layer2','','show');	
}


function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_setTextOfLayer(objName,x,newText) { //v4.01
  if ((obj=MM_findObj(objName))!=null) with (obj)
    if (document.layers) {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}

//if (!parent.document.help) parent.document.help=0;


function show_help(tipo, edit){
//parent.line.cols = "200,*,200";
if (parent.ajuda==0){
	parent.help.location.href="help/"+tipo+edit+".help.php";
	parent.document.getElementById('line').cols = '200,*,200';
	//document.dataform.help.value="esconde ajuda";
	parent.ajuda=1;
} else {
	parent.document.getElementById('line').cols = '200,*,0';
	//document.dataform.help.value="mostra ajuda";
	parent.ajuda=0;
	}
}