function abrirClausula (boton, elemento, enlace) { //CVAZ
	if(enlace && boton.checked == false){
		boton.checked = true;
	} else if(enlace && boton.checked == true){
		boton.checked = false;
	}
	elemento = String('#'+elemento);
	if(boton.checked == true){
		$(elemento).slideDown('fast');
		$(elemento).animate({opacity: '1'}, 300);
	} else {
		$(elemento).animate({opacity: '0.3'}, 300);
		$(elemento).slideUp('fast');
	}
}



//////////////////// Modal //////////////////////

function abrirModal (idbloque) {
			$('#'+idbloque).modal({
				close: false,
				overlayId: 'fw_overlay',
				containerId: 'fw_contenedor',
				onOpen: fw.open,
				onClose: fw.close
			});
}

function cerrarModal(dialog) {
/*	$('#fw_contenedor .fw_info').fadeOut();
	$('#fw_contenedor .fw_titulo').html('Guardando...');
	$('#fw_contenedor form').fadeOut(200);
	$('#fw_contenedor p').fadeOut(200);
	$('#fw_contenedor .fw_contenido').animate({
		height: 40
	}, function () {*/
		dialog.data.fadeOut(200, function () {
			dialog.container.fadeOut(200, function () {
				dialog.overlay.fadeOut(200, function () {
					$.modal.close();
				});
			});
		});
/*	});*/
}

var fw = {
	message: null,
	open: function (dialog) {
		/*$('#fw_contenedor').css({'width': w, 'height': h, 'margin-left': -(w/2) });
		$('#fw_datos').css({ 'height': h-40 });
		var title = $('#fw_contenedor .fw_titulo').html();
		$('#fw_contenedor .fw_titulo').html("Cargando...");*/
		$("#fw_overlay").css({'opacity': 0.7});
		dialog.overlay.fadeIn(200, function () {
			dialog.container.fadeIn(200, function () {
				dialog.data.fadeIn(200, function () {
					/*$('#fw_contenedor .fw_contenido').animate({
						height: h
					}, function () {
						$('#fw_contenedor .fw_titulo').html(title);
						$('#fw_contenedor p').fadeIn(200);
						$('#fw_contenedor form').fadeIn(200);
						$("#fw_titulo span").dropShadow({ left: 1, top: 1, color: "white", blur: 0 });
						$(".fw_boton span strong").dropShadow({ left: 1, top: 1, color: "white", blur: 0 });
					});*/
				});
			});
		});
	},

	close: function (dialog) {
		cerrarModal(dialog)
	},
	error: function (xhr) {
		alert(xhr.statusText);
	}
};
