function validateAlbum(){
	// Variaveis para o Script
	var sNome = document.getElementById('AlbumNome');
	var sLocal = document.getElementById('AlbumLocal');
	var sDesc = document.getElementById('AlbumDesc');
	var erroCount = 0;
	var myMsg = "";
	var searchCountNome = 0;
	var searcCountLocal = 0;
	
	// Faz verificações
	if(sNome.value == ""){ myMsg = myMsg + "Você esqueceu de preencher o Nome do album\n"; erroCount++;	}
	if(sLocal.value == ""){	myMsg = myMsg + "Você esqueceu de preencher o Local do album\n"; erroCount++; }
	if(sDesc.value == ""){ myMsg = myMsg + "Você esqueceu de preencher a Descrição do album\n"; erroCount++; }

	// Faz verificações Secundarias
	var searchPattern = "! @ # $ % ¨ & * ( ) { } \" \'";
	searchPattern = searchPattern.split(" ");
	
	for(i=0; i<searchPattern.length; i++){ if(sNome.value.indexOf(searchPattern[i]) !== -1){ searchCountNome++; }}
	if(searchCountNome > 0){ myMsg = myMsg + "Não coloque nenhum caractere especial no Nome do Album\n"; erroCount++; }
	
	// Verifica se houve erros
	if(erroCount > 0){ alert(myMsg); return false; }else{ return true; }
}

function validaBusca(){
	// Variaveis para o Script
	var sTerm = document.getElementById('searchTerm');
	var erroCount = 0;
	var myMsg = "";
	var searchCountNome = 0;
	var searcCountLocal = 0;
	
	// Faz verificações
	if(sTerm.value == ""){ myMsg = myMsg + "Você esqueceu de preencher um termo para efetuar a busca\n"; erroCount++;	}

	// Faz verificações Secundarias
	var searchPattern = "! @ # $ % ¨ & * ( ) { } \" \'";
	searchPattern = searchPattern.split(" ");
	
	for(i=0; i<searchPattern.length; i++){ if(sTerm.value.indexOf(searchPattern[i]) !== -1){ searchCountNome++; }}
	if(searchCountNome > 0){ myMsg = myMsg + "Não coloque nenhum caractere especial no termo da busca\n"; erroCount++; }
	
	// Verifica se houve erros
	if(erroCount > 0){ alert(myMsg); return false; }else{ return true; }
}


function goAct(action, objName, objUrl){
	if(action == "delete"){
		if(confirm("Deseja realmente deletar o registro (" + objName + ") do banco de dados.\nESTA OPERAÇÃO É IRREVERSÍVEL.\n") == true){
			location.href = objUrl;
		}
	}
}

function displayimage(picURL,picWidth,picHeight,picTitle){
	newWindow=window.open(picURL,'newWin','toolbar=no,width='+picWidth+',height='+picHeight)
	newWindow.document.write('<html><head><title>'+picTitle+'<\/title><\/head><body background="'+picURL+'" onclick="self.close();" style=\"margin:0px 0px 0px 0px;padding:0px;\"></body><img src="images/trans.gif" width="100%" height="100%" /><\/html>')
	newWindow.resizeBy(picWidth-newWindow.document.body.clientWidth,picHeight-newWindow.document.body.clientHeight)
	newWindow.moveTo((screen.availWidth / 2)-(picWidth / 2),(screen.availHeight / 2)-(picHeight / 2));
	newWindow.focus()
}			