﻿// Archivo JScript

/* 
 * Change county image onmouseover on index page 
 */
function change_image (region) {
	var ShowItem = document.getElementById("county_image");
	//var LinkItem = document.getElementById("county_" + region);
	ShowItem.style.backgroundImage = 'url(/plantillas/ppceditorial/img/mapa/ptosdeventa_' + region + '.gif)';
	//LinkItem.style.textDecoration = "underline";
	return true;
}

/* 
 * Change back county image onmouseout on index page
 */ 
function hide_image (region) {
	var ShowItem = document.getElementById("county_image");
	//var LinkItem = document.getElementById("county_" + region);
	ShowItem.style.backgroundImage = 'url(/plantillas/ppceditorial/img/mapa/ptosdeventa_none.gif)';
	//LinkItem.style.textDecoration = "none";
	return true;
}

function insertEstadistica(codigoLibro){
              AJAXPro.PortalWeb.Frontal.VisitasLibrosporSesion(30, codigoLibro, callback_VisitasLibrosporSession);
}

function callback_VisitasLibrosporSession(res){

}


var dialogClose;
var opcionCierre=0;
var opcionCierreUrl='';
function abrirPopup(capa, width, height, iopcionCierre){
     try{
        opcionCierre=iopcionCierre;
     }catch(uiww){
        opcionCierreUrl=iopcionCierre;
     }
     dialogClose = $jq('#' + capa).dialog({
     autoOpen: false,
     width: width,
     height: height,
     modal:true,
     close: function(event, ui) {
            //cierre popup cuando se acaba el registro en el paso1
            if (opcionCierre==1){
                loginEnPaso3();
                //document.location=urlRaiz;
            }
            //cierre popup en el final de un registro completo y logado posterior
            if (opcionCierre==2){
                loginEnPaso3();
            }
            //redireccion a la url pasada por parametros en jornadas infantiles
            if (opcionCierre==3){
                document.location.href=urlReturn;
            }
            opcionCierre=0;
            $jq('#' + capa).dialog('destroy');
         },
         draggable: false,
         resizable: false
     });
    dialogClose.dialog('open');
    $jq('#' + capa).css('font-size','11px');
}

function cerrarPopup(){
    dialogClose.dialog('close');
}


