function msgbox(mensagem,classe,callback){
	callbackModal = callback;
	if(!classe)classe = "";
	var html = '<div class="'+classe+'" style="margin:0">'+mensagem+
	'<p><input style="cursor:hand" type="button" value="Ok" '+
	"onclick='fecharModal();'></p>"+
	'</div>';
	$.blockUI({ 
		message: html,		
		css: { 
			cursor:'default',
            border: 'none', 
	            padding: '0',
            padding: '0',  
            backgroundColor: '#000', 
            opacity: .9
			

        }  }); 	
		
	
}
function fecharModal(){
		$.unblockUI({onUnblock: callbackModal });
}				
		
function addCampo(maximo){
var i = 0;
		$("#camposfotos input[type=file]").each(function () {
					i++;
		});
if(i>=maximo)return false;

		var inputfile = document.createElement("INPUT");
		var labelfile = document.createElement("LABEL");
		var inputlegenda = document.createElement("INPUT");
		var labellegenda = document.createElement("LABEL");
		var br1 = document.createElement("BR");
		var br2 = document.createElement("BR");
		
		
		labelfile.appendChild(document.createTextNode("Upload: "));		
		labelfile.id = "foto";
		
		inputfile.type = "file"; 		
		inputfile.name = "foto[]";
		inputfile.id = "foto";

		
		inputlegenda.type = "text"; 
		inputlegenda.name = "legenda[]";
		inputlegenda.id = "legenda";
		inputlegenda.style.width ="240px";
		
		labellegenda.appendChild(document.createTextNode("Pequena descrição: "));		
		labellegenda.id = "foto";
		
		document.getElementById("camposfotos").appendChild(labelfile);
		document.getElementById("camposfotos").appendChild(inputfile);
		document.getElementById("camposfotos").appendChild(br1);
		document.getElementById("camposfotos").appendChild(labellegenda);
		document.getElementById("camposfotos").appendChild(inputlegenda);
		document.getElementById("camposfotos").appendChild(br2);
}

