function isEmpty(str) {

            for (var intLoop = 0; intLoop < str.length; intLoop++)
               if (" " != str.charAt(intLoop))
                  return false;
            return true;
         }

         function checkRequired(f) {
            var strError = "";
            for (var intLoop = 0; intLoop<f.elements.length; intLoop++)
               if (null!=f.elements[intLoop].getAttribute("required")) 
                  if (isEmpty(f.elements[intLoop].value))
                     strError += "  " + f.elements[intLoop].name + "\n";
            if ("" != strError) {
               alert("Preecha os seguintes campos:\n" + strError);
               return false;
            }
}


function Abrir(url, div){
	
$('a[class="actual"]').removeClass("actual");
	
$('#centro').html("<p align='center'><img src='imagens/loading.gif' hspace='4' align='absmiddle' vspace='100'>Carregando...</p>");

$(div).toggleClass("actual");

$.ajax({
  url: url+'&ajax=true',
  cache: false,
  success: function(data){$('#centro').html(data);}
});
} 
