
$.fn.fancybox.defaults.titleShow = false;
$.fn.fancybox.defaults.type = 'iframe';   // con 'iframe' crea un iframe aislado de la página principal
										  // con 'ajax' la ventana es un div dentro de la misma página (ventaja: funciona la opcion 'autoDimensions')
$.fn.fancybox.defaults.margin = 30;   // distancia de la ventana del explorador a la ventana fancyBox
$.fn.fancybox.defaults.padding = 15;
$.fn.fancybox.defaults.autoScale = false;  // con 'true' el fancybox se ajusta para que no sobresalga de la ventana del explorador
$.fn.fancybox.defaults.autoDimensions = true;  // con iframe no funciona
//$.fn.fancybox.defaults.centerOnScroll = true;    // no funciona bien
$.fn.fancybox.defaults.hideOnOverlayClick = false;
$.fn.fancybox.defaults.overlayOpacity = 0.6;
$.fn.fancybox.defaults.overlayColor = '#000';
$.fn.fancybox.defaults.speedIn = 400;
$.fn.fancybox.defaults.speedOut = 400;

/*
$(document).ready(function() {
	$("a#linkRegistro").fancybox({
		'href'            : 'ventanas/registrar.php',
		'width'           : 600,
		'height'          : 650
	});
	$("a#linkInicioSesion").fancybox({
		'href'            : 'ventanas/iniciar_sesion.php',
		'width'           : 360,
		'height'          : 220
	});
});
*/ 

function mostrarVentanaRegistro() {
    $.fancybox({'href': ROOT+'ventanas/registrar.php', 'width': 620, 'height': 716, 'autoScale': true});
}

function mostrarVentanaInicioSesion(){
    $.fancybox({'href': ROOT+'ventanas/iniciar_sesion.php', 'width': 460, 'height': 300});
}

function mostrarVentanaVaciaParaInicioSesion(){
   // GB_hide();
   // return GB_showCenter('Iniciar Sesión', '', 240, 500);
   $.fancybox({'width': 460, 'height': 300, 'transitionIn': 'none'});
}

function retornoActivacion(){
   window.location.replace("index.php");
}

function mostrarVentanaActivacion(parametros){
   // try{ greybox_google.hide(); } catch(e){}
   // greybox_google.setDimension(500, 500);
   // greybox_google.setCallback(retornoActivacion);
   // return greybox_google.show('Activación', 'activar.php?' + parametros);
   //----
   // GB_hide();
   // return GB_showCenter('Activación', '../activar.php?' + parametros, 500, 500, retornoActivacion);
   
   $.fancybox({'href': ROOT+'ventanas/activar.php?' + parametros, 'width': 460, 'height': 450, 'onClosed': function(){retornoActivacion();}});
}

function mostrarVentanaConfiguracionCuenta(){
   $.fancybox({'href': ROOT+'ventanas/configurar_cuenta.php', 'width': 460, 'height': 180});
}

function mostrarVentanaDatosPersonales(){
   $.fancybox({'href': ROOT+'ventanas/editar_datos_personales.php', 'width': 520, 'height': 940, 'autoScale': true});
}

function retornoCierreSesion(){
   window.location.reload();
}

function mostrarVentanaCerrarSesion(){
   // GB_hide();
   // return GB_showCenter('Cerrar sesión', '../ventanas/terminar_sesion.php', 150, 500, retornoCierreSesion);
   $.fancybox({'href': ROOT+'ventanas/terminar_sesion.php', 'width': 460, 'height': 140, 'onClosed': function(){retornoCierreSesion();}});
}

function mostrarVentanaPeticionCambiarPassword(){
   $.fancybox({'href': ROOT+'ventanas/peticion_cambiar_password.php', 'width': 460, 'height': 400});
}

function retornoCambioPass(){
   window.location.replace(ROOT+"index.php");
}

function mostrarVentanaCambioPass(parametros){
   // GB_hide();
   // return GB_showCenter('Cambio de contraseña', '../cambiar_password.php?' + parametros, 340, 500, retornoCambioPass);
   $.fancybox({'href': ROOT+'ventanas/cambiar_password.php?' + parametros, 'width': 460, 'height': 340, 'onClosed': function(){retornoCambioPass();}});
}

function mostrarVentanaCambioPass2(parametros){
   // GB_hide();
   // return GB_showCenter('Cambio de contraseña', '../cambiar_password.php?' + parametros, 340, 500, retornoCambioPass);
   $.fancybox({'href': ROOT+'ventanas/cambiar_password.php?' + parametros, 'width': 460, 'height': 390});
}

function mostrarVentanaCambiarAvisosPorEmail(){
   $.fancybox({'href': ROOT+'ventanas/cambiar_avisos_por_email.php', 'width': 460, 'height': 240});
}

function mostrarVentanaDescarga(parametros){
   // GB_hide();
   // return GB_showCenter('Descarga', '../ventanas/descargar.php?' + parametros, 550, 600);
   $.fancybox({'href': ROOT+'ventanas/descargar.php?' + parametros, 'width': 460, 'height': 200});
}

function mostrarVentanaDescargaContrato(){
   $.fancybox({'href': ROOT+'ventanas/descargar_contrato.php', 'width': 460, 'height': 210});
}

function mostrarVentanaCancelarCuenta(){
   $.fancybox({'href': ROOT+'ventanas/cancelar_cuenta.php', 'width': 460, 'height': 240, 'onClosed': function(){retornoCierreSesion();}});
}

function mostrarVentanaFormularioContacto(){
   $.fancybox({'href': ROOT+'ventanas/contactoForm.php', 'width': 520, 'height': 700});
}

function mostrarVentanaFormularioSoportePostVenta(){
   $.fancybox({'href': ROOT+'ventanas/contactoForm.php?tipo=soportePostVenta', 'width': 520, 'height': 700});
}

function mostrarVentanaFormularioAsistenciaTecnica(){
   $.fancybox({'href': ROOT+'ventanas/contactoForm.php?tipo=asistenciaTecnica', 'width': 520, 'height': 700});
}

function mostrarVentanaFormularioInclusionUniversidad(parametros){
   $.fancybox({'href': ROOT+'ventanas/peticion_incluir_universidad.php?' + parametros, 'width': 520, 'height': 660});
}

function mostrarVentanaVacia(){
   // GB_hide();
   // return GB_showCenter('', '', 500, 500);
   $.fancybox({'width': 460, 'height': 460});
}

function ocultarVentana(){
   //GB_hide();
   $.fancybox.close();
   return false;
}

