var workingElement = false;
var workingContent;
function initDisplayElements() {
	//Working
	//-----------
	workingElement = new Dialog(Dialog.AUTO);		//Dialogo
	workingContent = new Element("div");			//Contenido
	
	//Estilos
	workingElement.setEffectsMultiplier(0.5);
	workingElement.setDialogClass("working");
	workingElement.setTitleClass("ajax_title");
}
	
//Muestra el working
function setWorkingOn(aTitle) {
	if (!workingElement) initDisplayElements();
	if (!aTitle) aTitle = "Cargando...";
	workingElement.setTitle(aTitle);
	
	while (aChild = workingContent.firstChild) workingContent.removeChild(aChild);
	workingElement.show(workingContent);
}
function setWorkingOff() {
	workingElement.hide();
}


function setWorkingOff() {
	workingElement.hide();
}

function showWarning(aText) {
	var aDialog = new Dialog(Dialog.ERROR);
	aDialog.setTitle("Informaci&oacute;n");
	aDialog.show(new Element("div").setHTML(aText));
}

function showError(aText) {
	var aDialog = new Dialog(Dialog.ERROR);
	aDialog.setTitle("Error de ejecuci&oacute;n");
	aDialog.show(new Element("div").setHTML(aText));
}

function showDebug(aText) {
	var aDialog = new Dialog(Dialog.NORMAL);
	aDialog.setTitle("Debugging");
	aDialog.show(new Element("div").setHTML(aText));
}

function showMessage(aText) {
	var aDialog = new Dialog(Dialog.ERROR);
	aDialog.setTitle("Mensaje");
	aDialog.show(new Element("div").setHTML(aText));
}

function showConfirmDialog(aText, acceptHandler, cancelHandler) {
	var aDialog = new Dialog(Dialog.CONFIRM);
	aDialog.setTitle("Confirme la acci&oacute;n");
	aDialog.show(new Element("div").setHTML(aText));
	
	
	if (acceptHandler) aDialog.addAcceptHandler(acceptHandler)
	if (cancelHandler) aDialog.addCancelHandler(cancelHandler)
}
