por tanda cargada,
asi que getElementById de arriba solo alcanza al primero y el resto se queda
como estaba: media pagina en grilla y media en lista. alinear_vista_rst() vive
en resultado_dinamico1.php y propaga el estado del primer bloque a los demas.
Si no existe (paginas sin pager dinamico) no hay nada que propagar. */
try { if (typeof alinear_vista_rst === "function") alinear_vista_rst(); } catch (e) {}
set_vista_productos(modo, f_forzar);
}
function aplicar_clase_objeto(obj,clase)
{
if (typeof(obj) != "object")
objeto=getObj(obj);
else
objeto = obj;
if (objeto!=null && objeto.className!=undefined)
{
if ( objeto.className != "" ) {
objeto.className += " ";
}
objeto.className += clase;
}
}
function aplicar_clase_objeto(obj,clase,sin_repetir)
{
if (typeof(obj) != "object")
objeto=getObj(obj);
else
objeto = obj;
if (objeto!=null && objeto.className!=undefined) {
if (sin_repetir)
{
objeto.className = objeto.className.split(clase).join("");
objeto.className = objeto.className.split(" ").join("");
if ( objeto.className.indexOf(clase)!=-1)
return;
}
if ( objeto.className != "" ) {
objeto.className += " ";
}
objeto.className += clase;
}
}
function str_replace(str,s,t)
{
return str.split(s).join(t);
}
function resize_obj(id_obj, h_px, w_px)
{
obj=getObj(id_obj);
if (h_px!=undefined && h_px!="")
{
if (isNaN(h_px))
h_px=parseInt(str_replace(h_px.toString(),"px",""));
obj.style.height=h_px+"px";
}
if (w_px!=undefined && w_px!="")
{
if (isNaN(w_px))
w_px=parseInt(str_replace(w_px.toString(),"px",""));
obj.style.width=w_px+"px";
}
}
function showAndCenter(id, img)
{
var obj = id;
if (typeof obj != "object")
obj=getObj(id);
if (obj==null) return;
obj.style.display="";
obj.style.visibility="visible";
ancho_layer=obj.style.width;
ancho_layer=ancho_layer.replace("px","");
alto_layer=obj.style.height;
alto_layer=alto_layer.replace("px","");
if (document.body && document.body.scrollTop)
{
var altobody=document.body.scrollTop;
} else if (document.documentElement && !document.documentElement.scrollTop) {
var altobody=document.documentElement.scrollTop;
} else if (document.documentElement && document.documentElement.scrollTop) {
var altobody=document.documentElement.scrollTop;
}
var X = ((document.body.scrollWidth-ancho_layer)/2);
var Y = ((screen.availHeight-alto_layer)/2);
obj.style.zIndex=99999999;
obj.style.left=parseInt((document.body.scrollLeft+(X)))+"px";
obj.style.top =parseInt((altobody +(Y) - 100))+"px";
}
var focused = null; // salvado al abrir el DHTMLALERT
var salvo_document_onkeydown = null; // salvado al abrir el DHTMLALERT
var foco_anterior = null; // cargado A MANO antes de abrir el DHTMLALERT
var dhtml_alert_params = {}; // parametros pasados al ultimo DHTMLALERT abierto
function DHTMLALERT( msg, focus_obj, params, noclose )
{
if ( msg == undefined ) msg = "";
if ( params == undefined ) params = {};
if ( noclose == undefined ) noclose = false;
var dalert_msg = getObj("dhtml_alert_MSG");
var titulo = getObj("dhtml_alert_title");
// ---------------------------------------------------------------
// cerrar dialogo: si se paso mensaje vacio o no se incluyo el objeto en el arbol
if ( msg == "" ||
! dalert_msg )
{
// si hay que
// cerrar el dialogo usar los parametros actuales
cerrado_dhtmlalert( dalert_msg );
return;
}
// ---------------------------------------------------------------
// hay que abrir un nuevo dialogo
// cancelo timer del dialogo anterior, si lo habia
if ( dhtml_alert_params.ocultar_timer_id )
{
clearInterval( params.ocultar_timer_id );
params.ocultar_timer_id = undefined;
}
// de aca en adelante construyo nuevo dialogo
dhtml_alert_params = params;
// muestro mensaje
dalert_msg.innerHTML = msg;
if ( params.titulo != undefined && titulo != null )
{
titulo.innerHTML = params.titulo;
}
else
{
titulo.innerHTML = " ";
}
// oculto titulo si corrsponde
if ( params.ocultar_titulo )
agregar_clase_objeto( 'dhtml_alert', 'dhtml_alert_3' );
// muestro dialogo
agregar_clase_objeto( 'dhtml_alert', 'dhtml_alert_on' );
if (noclose)
{
activar_layer_transparente( 'ly_transparente' );
getObj("btn_cerrar_dhmlalert").onclick = function() { return; }
o=getObj("cont_close_dhtmlalert");
if (o!=null) o.style.display="none";
}
else
{
activar_layer_transparente( 'ly_transparente', cerrar_dhtmlalert );
getObj("btn_cerrar_dhmlalert").onclick = function() { cerrar_dhtmlalert(); }
o=getObj("cont_close_dhtmlalert");
if (o!=null) o.style.display="";
}
// hay que enfocar algo que paso el usuario ?
var o = focus_obj == undefined
? getObj( "btn_cerrar_dhmlalert" ) // no -> enfocar el boton de cerrar
: getObj( focus_obj ); // si -> enfocar lo que paso
if ( o != null )
o.focus();
// pongo funcion que espera escape
salvo_document_onkeydown = document.onkeydown;
document.onkeydown = cerrar_dhtmlalert_esc;
// programo timer para que se oculte dialogo automaticamente si corresponde
if ( params.ocultar_en_ms )
params.ocultar_timer_id = setInterval( cerrar_dhtmlalert, params.ocultar_en_ms );
}
function cerrar_dhtmlalert_esc(e)
{
e = e || window.event;
if ( e.keyCode == 27 )
{
e.preventDefault();
// llamo directo, hay que
// cerrar el dialogo usar los parametros actuales
cerrado_dhtmlalert();
}
}
function cerrar_dhtmlalert()
{
// en lugar de llamar a la funcion de abrir sin parametros
//DHTMLALERT();
// llamo directo, hay que
// cerrar el dialogo usar los parametros actuales
cerrado_dhtmlalert();
}
function cerrado_dhtmlalert( dalert_msg )
{
// remuevo funcion que espera escape
document.onkeydown = salvo_document_onkeydown;
salvo_document_onkeydown = null;
// cancelo timer
if ( dhtml_alert_params.ocultar_timer_id )
{
clearInterval( dhtml_alert_params.ocultar_timer_id );
dhtml_alert_params.ocultar_timer_id = undefined;
}
// oculto dialogo
if ( ! dalert_msg )
dalert_msg = getObj("dhtml_alert_MSG");
if ( dalert_msg )
{
dalert_msg.innerHTML = "";
if ( getObj("ly_transparente").style.display != "none" )
{
aplicar_quitar_clase( 'dhtml_alert', 'dhtml_alert_on' );
activar_layer_transparente( 'ly_transparente', cerrar_dhtmlalert );
}
}
// enfoco lo que estaba antes
if ( foco_anterior != null )
{
foco_anterior.focus();
foco_anterior = null;
}
// notifico que se cerro el dialogo
if ( dhtml_alert_params.fnc_cerrar )
dhtml_alert_params.fnc_cerrar.call();
// limpio parametros para la proxima
dhtml_alert_params = {};
}
function activar_layer_transparente(id_obj,addfunction)
{
var obj=getObj(id_obj);
if (obj==null) return;
if (obj.className!="u")
{
obj.className="u";
if (typeof addfunction == "function")
{
if (obj.removeEventListener)
{
obj.removeEventListener("click", addfunction, false);
} if (obj.detachEvent) {
obj.detachEvent("onclick", addfunction);
} else {
obj["click"] = null;
}
}
} else {
if (typeof addfunction == "function")
{
if (obj.addEventListener) {
obj.addEventListener("click", addfunction, false);
} else if (obj.attachEvent) {
obj.attachEvent("onclick", addfunction);
} else {
obj["onclick"] = addfunction;
}
}
obj.className="block";
}
}
function getPageSize()
{
var xScroll, yScroll;
if (window.innerHeight && window.scrollMaxY) {
xScroll = document.body.scrollWidth;
yScroll = window.innerHeight + window.scrollMaxY;
} else if (document.body.scrollHeight > document.body.offsetHeight){
xScroll = document.body.scrollWidth;
yScroll = document.body.scrollHeight;
} else {
xScroll = document.body.offsetWidth;
yScroll = document.body.offsetHeight;
}
var windowWidth, windowHeight;
if (self.innerHeight) {
windowWidth = self.innerWidth;
windowHeight = self.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) {
windowWidth = document.documentElement.clientWidth;
windowHeight = document.documentElement.clientHeight;
} else if (document.body) {
windowWidth = document.body.clientWidth;
windowHeight = document.body.clientHeight;
}
if(yScroll < windowHeight){
pageHeight = windowHeight;
} else {
pageHeight = yScroll;
}
if(xScroll < windowWidth){
pageWidth = windowWidth;
} else {
pageWidth = xScroll;
}
arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
return arrayPageSize;
}
function recomendar_web(){
var ly_transparente=getObj("ly_transparente");
var obj=getObj("recomendar");
if (obj.className.indexOf("dhtml_alert_on")!=-1) {
activar_layer_transparente("ly_transparente",recomendar_web);
aplicar_quitar_clase('recomendar','dhtml_alert_on');
} else {
activar_layer_transparente("ly_transparente",recomendar_web);
aplicar_quitar_clase('recomendar','dhtml_alert_on');
o=getObj("form_recomendar").tuemail;
if (o!=null) {
o.focus();
} else {
o=getObj("form_recomendar").tuemail;
if (o!=null) o.focus();
}
}
}
var clases_visibles = [];
function desocultar_ids(id_clase,visible_defecto)
{
if(clases_visibles[id_clase]==undefined)clases_visibles[id_clase]=visible_defecto;
clases_visibles[id_clase]=!clases_visibles[id_clase];
if(clases_visibles[id_clase])
$("."+id_clase).show();
else
$("."+id_clase).hide();
}
var ALTO_CABECERA = 350;
$(document).ready(function () {
$(document).on("scroll", onScroll);
$('#ly_menu_b span').removeClass('menuactivo');
onScroll( null );
$('#ly_menu_b a[href^="#"]').on('click', function (e)
{
e.preventDefault();
$(document).off("scroll");
var ps = window.location.href.split("#");
var url = ps[0];
if ( url.endsWith("/") ) url = url.substr( 0, url.length - 1 );
if ( e.currentTarget.hash != null &&
e.currentTarget.hash != "" &&
e.currentTarget.hash != "#" &&
url != main_url &&
url != main_url_https )
{
url = (url.startsWith("https:") ? main_url_https : main_url ) + e.currentTarget.hash;
window.location.href = url;
return;
}
$('a').each(function () {
$(this).removeClass('menuactivo');
})
$(this).addClass('menuactivo');
var target = this.hash;
window.location.hash = target;
$target = $(target);
$('html, body').stop().animate({
'scrollTop': $target.offset().top-ALTO_CABECERA
}, 500, 'swing', function () {
$(document).on("scroll", onScroll);
});
});
});
function onScroll(event)
{
var scrollPos = $(document).scrollTop();
var activar = null;
$('#ly_menu_b a').each( function ()
{
var currLink = $(this);
var href = currLink.attr("href");
if ( href == undefined || href == "" || href.substr(0,1) != "#" ) return;
var refElement = $(href);
var ref_pos = refElement.position();
if ( ! ref_pos )
{
return;
}
if ( refElement.position().top-ALTO_CABECERA <=
scrollPos && scrollPos <=
refElement.position().top + refElement.height() )
activar = currLink;
}
);
if ( activar )
{
$('#ly_menu_b a').each(function ()
{
var currLink = $(this);
currLink.removeClass("menuactivo");
}
);
activar.addClass("menuactivo");
}
}function set_tab_new(obj)
{
var obj_id = obj.id;
var prefijo="container_";
var obj_class = obj.className;
var vec_tab_names = obj_id.split("_");
if (vec_tab_names.length<=1)
{
alert("Nombre TAG inválido falta prefijo _#");
return;
}
vec_tab_names.pop();
var tab_name = vec_tab_names.join("_");
obj_class = obj_class.split("_off").join("");
obj_class = obj_class.split("_on").join("");
for (var i=1;i<20;i++)
{
tab_actual=getObj(tab_name+"_"+i);
container_actual=getObj(prefijo+tab_name+"_"+i);
if (tab_actual!=null && container_actual!=null)
{
tab_actual.className="off";
container_actual.style.display="none";
}
}
tab_actual=getObj(obj_id);
container_actual=getObj(prefijo+obj_id);
tab_actual.className="active";
container_actual.style.display="";
}var autoexpandiendo=false;
var tipo_categorias="";
var contenidos_categorias_mostrar_items="";
var forzar_navegar_siempre=false;
function init_cats() {
var pdiv,phref;
for (var i=0;i < paths.length;i++) {
aux=paths[i].split(".");
pdiv=getObj("a"+paths[i]);
return_false=false;
if (pdiv==null) {
return_false=true;
pdiv=getObj("p"+paths[i]);
}
phref=getObj("l"+paths[i]);
phrefimg=getObj("limg"+paths[i]);
if ("0"=="1" && aux.length<=2) {
} else {
if (pdiv!=null) {
if (pdiv.addEventListener) {
if (return_false) {
if (phref!=null) phref.setAttribute("onclick","return false");
}
if (pdiv!=null) pdiv.setAttribute("onclick","expand_contract_cats('"+paths[i]+"')");
if (phrefimg!=null) phrefimg.setAttribute("onclick","expand_contract_cats('"+paths[i]+"')");
} else {
if (return_false) {
if (phref!=null) phref.attachEvent("onclick", function(){return false}, false);
}
if (pdiv!=null) pdiv.attachEvent("onclick", new Function("expand_contract_cats('"+paths[i]+"')"), false);
if (phrefimg!=null) phrefimg.attachEvent("onclick", new Function("expand_contract_cats('"+paths[i]+"')"), false);
}
}
}
}
}
var last_url_expand="";
var last_padre_expandido="";
function expand_contract_cats(path) {
var plus=getObj("plus"+path);
if (plus!=null) {
//vascula la clase
if (plus.className==class_plus) {
plus.className=class_minus;
} else {
plus.className=class_plus;
}
}
var aux=path.split(".");
o=getObj("l"+path);
if (o!=null) last_url_expand=o.href; else last_url_expand="";
var clase_padre="level1";
if (expandidos[path] == undefined || expandidos[path]==0) {
expandir_hijos(path);
clase_padre="level1 treeactive";
} else {
if (forzar_navegar_siempre || (aux.length==2 && !autoexpandiendo)) {
if (cat_url.charAt(cat_url.length-1)=="&" || cat_url.charAt(cat_url.length-1)=="?") {
var nav_url=cat_url+"path="+path;
} else if (cat_url=="") {
var nav_url=o.href;
} else {
var nav_url=cat_url+"&path="+path;
}
if (!forzar_navegar_siempre) {
contraer_hijos(path);
} else {
location.href=nav_url;
return;
}
} else {
contraer_hijos(path);
clase_padre="level1";
}
}
var aux=path.split(".");
if (aux.length==2) {
if (last_padre_expandido!="") {
var li_padre=getObj("p"+last_padre_expandido);
if (li_padre!=null) li_padre.className="level1";
}
var li_padre=getObj("p"+path);
if (li_padre!=null) li_padre.className=clase_padre;
last_padre_expandido=path;
}
}
function expandir_hijos(path) {
var ids_actual,prof_actual,path_actual,objhijo;
var ids=path.split(".");
var prof=ids.length-1;
var hubo_expansion=false;
for (var i=0;i < paths.length;i++) {
path_actual=paths[i];
ids_actual=path_actual.split(".");
prof_actual=ids_actual.length-1;
if ((prof+1)==prof_actual) {
if ((path_actual.substring(0,(path.length+1))) == (path+".")) {
objhijo=getObj("p"+path_actual);
if (objhijo!=null) {
objhijo.style.display="";
hubo_expansion=true;
}
}
}
}
if (tipo_categorias=="contenidos" && contenidos_categorias_mostrar_items=="") hubo_expansion=false;
if (!hubo_expansion) {
if (cat_url.charAt(cat_url.length-1)=="&" || cat_url.charAt(cat_url.length-1)=="?") {
var nav_url=cat_url+"path="+path;
} else {
var nav_url=cat_url+"&path="+path;
}
if (!autoexpandiendo) {
if (cat_url!="") {
var h=getObj("l"+path);
if (h==null || h.href=="") location.href=nav_url; else location.href=h.href;
} else {
if (last_url_expand!="") location.href=last_url_expand;
}
}
} else {
expandidos[path]=1;
}
}
function contraer_hijos(path) {
var path_actual,objhijo;
var ids=path.split(".");
var prof=ids.length-1;
for (var i=0;i < paths.length;i++) {
path_actual=paths[i];
if ((path_actual.substring(0,(path.length+1))) == (path+".")) {
objhijo=getObj("p"+path_actual);
plus=getObj("plus"+path_actual);
if (plus!=null) plus.className=class_plus;
expandidos[path_actual]=0;
if (objhijo!=null) objhijo.style.display="none";
}
}
expandidos[path]=0;
}
function autoexpand(path) {
if (path=="") return;
autoexpandiendo=true;
var ids=path.split(".");
var path_nav="0";
for (var i=1;i<(ids.length);i++) {
path_nav+="."+ids[i];
expandir_hijos(path_nav);
plus=getObj("plus"+path_nav);
if (plus!=null) plus.className=class_minus;
}
autoexpandiendo=false;
}/*
* easy-autocomplete
* jQuery plugin for autocompletion
*
* @author Ċukasz PaweĊczak (http://github.com/pawelczak)
* @version 1.3.5
* Copyright License:
*/
var EasyAutocomplete=function(a){return a.Configuration=function(a){function b(){if("xml"===a.dataType&&(a.getValue||(a.getValue=function(a){return $(a).text()}),a.list||(a.list={}),a.list.sort||(a.list.sort={}),a.list.sort.method=function(b,c){return b=a.getValue(b),c=a.getValue(c),c>b?-1:b>c?1:0},a.list.match||(a.list.match={}),a.list.match.method=function(a,b){return a.search(b)>-1}),void 0!==a.categories&&a.categories instanceof Array){for(var b=[],c=0,d=a.categories.length;d>c;c+=1){var e=a.categories[c];for(var f in h.categories[0])void 0===e[f]&&(e[f]=h.categories[0][f]);b.push(e)}a.categories=b}}function c(){function b(a,c){var d=a||{};for(var e in a)void 0!==c[e]&&null!==c[e]&&("object"!=typeof c[e]||c[e]instanceof Array?d[e]=c[e]:b(a[e],c[e]));return void 0!==c.data&&null!==c.data&&"object"==typeof c.data&&(d.data=c.data),d}h=b(h,a)}function d(){if("list-required"!==h.url&&"function"!=typeof h.url){var b=h.url;h.url=function(){return b}}if(void 0!==h.ajaxSettings.url&&"function"!=typeof h.ajaxSettings.url){var b=h.ajaxSettings.url;h.ajaxSettings.url=function(){return b}}if("string"==typeof h.listLocation){var c=h.listLocation;"XML"===h.dataType.toUpperCase()?h.listLocation=function(a){return $(a).find(c)}:h.listLocation=function(a){return a[c]}}if("string"==typeof h.getValue){var d=h.getValue;h.getValue=function(a){return a[d]}}void 0!==a.categories&&(h.categoriesAssigned=!0)}function e(){void 0!==a.ajaxSettings&&"object"==typeof a.ajaxSettings?h.ajaxSettings=a.ajaxSettings:h.ajaxSettings={}}function f(a){return void 0!==h[a]&&null!==h[a]}function g(a,b){function c(b,d){for(var e in d)void 0===b[e]&&a.log("Property '"+e+"' does not exist in EasyAutocomplete options API."),"object"==typeof b[e]&&-1===$.inArray(e,i)&&c(b[e],d[e])}c(h,b)}var h={data:"list-required",url:"list-required",dataType:"json",listLocation:function(a){return a},xmlElementName:"",getValue:function(a){return a},autocompleteOff:!0,placeholder:!1,ajaxCallback:function(){},matchResponseProperty:!1,list:{sort:{enabled:!1,method:function(a,b){return a=h.getValue(a),b=h.getValue(b),b>a?-1:a>b?1:0}},maxNumberOfElements:6,hideOnEmptyPhrase:!0,match:{enabled:!1,caseSensitive:!1,method:function(a,b){return a.search(b)>-1}},showAnimation:{type:"normal",time:400,callback:function(){}},hideAnimation:{type:"normal",time:400,callback:function(){}},onClickEvent:function(){},onSelectItemEvent:function(){},onLoadEvent:function(){},onChooseEvent:function(){},onKeyEnterEvent:function(){},onMouseOverEvent:function(){},onMouseOutEvent:function(){},onShowListEvent:function(){},onHideListEvent:function(){}},highlightPhrase:!0,theme:"",cssClasses:"",minCharNumber:0,requestDelay:0,adjustWidth:!0,ajaxSettings:{},preparePostData:function(a,b){return a},loggerEnabled:!0,template:"",categoriesAssigned:!1,categories:[{maxNumberOfElements:4}]},i=["ajaxSettings","template"];this.get=function(a){return h[a]},this.equals=function(a,b){return!(!f(a)||h[a]!==b)},this.checkDataUrlProperties=function(){return"list-required"!==h.url||"list-required"!==h.data},this.checkRequiredProperties=function(){for(var a in h)if("required"===h[a])return logger.error("Option "+a+" must be defined"),!1;return!0},this.printPropertiesThatDoesntExist=function(a,b){g(a,b)},b(),c(),h.loggerEnabled===!0&&g(console,a),e(),d()},a}(EasyAutocomplete||{}),EasyAutocomplete=function(a){return a.Logger=function(){this.error=function(a){console.log("ERROR: "+a)},this.warning=function(a){console.log("WARNING: "+a)}},a}(EasyAutocomplete||{}),EasyAutocomplete=function(a){return a.Constans=function(){var a={CONTAINER_CLASS:"easy-autocomplete-container",CONTAINER_ID:"eac-container-",WRAPPER_CSS_CLASS:"easy-autocomplete"};this.getValue=function(b){return a[b]}},a}(EasyAutocomplete||{}),EasyAutocomplete=function(a){return a.ListBuilderService=function(a,b){function c(b,c){function d(){var d,e={};return void 0!==b.xmlElementName&&(e.xmlElementName=b.xmlElementName),void 0!==b.listLocation?d=b.listLocation:void 0!==a.get("listLocation")&&(d=a.get("listLocation")),void 0!==d?"string"==typeof d?e.data=$(c).find(d):"function"==typeof d&&(e.data=d(c)):e.data=c,e}function e(){var a={};return void 0!==b.listLocation?"string"==typeof b.listLocation?a.data=c[b.listLocation]:"function"==typeof b.listLocation&&(a.data=b.listLocation(c)):a.data=c,a}var f={};if(f="XML"===a.get("dataType").toUpperCase()?d():e(),void 0!==b.header&&(f.header=b.header),void 0!==b.maxNumberOfElements&&(f.maxNumberOfElements=b.maxNumberOfElements),void 0!==a.get("list").maxNumberOfElements&&(f.maxListSize=a.get("list").maxNumberOfElements),void 0!==b.getValue)if("string"==typeof b.getValue){var g=b.getValue;f.getValue=function(a){return a[g]}}else"function"==typeof b.getValue&&(f.getValue=b.getValue);else f.getValue=a.get("getValue");return f}function d(b){var c=[];return void 0===b.xmlElementName&&(b.xmlElementName=a.get("xmlElementName")),$(b.data).find(b.xmlElementName).each(function(){c.push(this)}),c}this.init=function(b){var c=[],d={};return d.data=a.get("listLocation")(b),d.getValue=a.get("getValue"),d.maxListSize=a.get("list").maxNumberOfElements,c.push(d),c},this.updateCategories=function(b,d){if(a.get("categoriesAssigned")){b=[];for(var e=0;e
e;e+=1)c[e].data=b(a,c[e],d);return c},this.checkIfDataExists=function(a){for(var b=0,c=a.length;c>b;b+=1)if(void 0!==a[b].data&&a[b].data instanceof Array&&a[b].data.length>0)return!0;return!1}},a}(EasyAutocomplete||{}),EasyAutocomplete=function(a){return a.proccess=function(b,c,d){function e(a,c){var d=[],e="";if(b.get("list").match.enabled)for(var g=0,h=a.length;h>g;g+=1)e=b.get("getValue")(a[g]),f(e,c)&&d.push(a[g]);else d=a;return d}function f(a,c){return b.get("list").match.caseSensitive||("string"==typeof a&&(a=a.toLowerCase()),c=c.toLowerCase()),!!b.get("list").match.method(a,c)}function g(a){return void 0!==c.maxNumberOfElements&&a.length>c.maxNumberOfElements&&(a=a.slice(0,c.maxNumberOfElements)),a}function h(a){return b.get("list").sort.enabled&&a.sort(b.get("list").sort.method),a}a.proccess.match=f;var i=c.data,j=d;return i=e(i,j),i=g(i),i=h(i)},a}(EasyAutocomplete||{}),EasyAutocomplete=function(a){return a.Template=function(a){var b={basic:{type:"basic",method:function(a){return a},cssClass:""},description:{type:"description",fields:{description:"description"},method:function(a){return a+" - description"},cssClass:"eac-description"},iconLeft:{type:"iconLeft",fields:{icon:""},method:function(a){return a},cssClass:"eac-icon-left"},iconRight:{type:"iconRight",fields:{iconSrc:""},method:function(a){return a},cssClass:"eac-icon-right"},links:{type:"links",fields:{link:""},method:function(a){return a},cssClass:""},custom:{type:"custom",method:function(){},cssClass:""}},c=function(a){var c,d=a.fields;return"description"===a.type?(c=b.description.method,"string"==typeof d.description?c=function(a,b){return a+" - "+b[d.description]+" "}:"function"==typeof d.description&&(c=function(a,b){return a+" - "+d.description(b)+" "}),c):"iconRight"===a.type?("string"==typeof d.iconSrc?c=function(a,b){return a+" "}:"function"==typeof d.iconSrc&&(c=function(a,b){return a+" "}),c):"iconLeft"===a.type?("string"==typeof d.iconSrc?c=function(a,b){return" "+a}:"function"==typeof d.iconSrc&&(c=function(a,b){return" "+a}),c):"links"===a.type?("string"==typeof d.link?c=function(a,b){return""+a+" "}:"function"==typeof d.link&&(c=function(a,b){return""+a+" "}),c):"custom"===a.type?a.method:b.basic.method},d=function(a){return a&&a.type&&a.type&&b[a.type]?c(a):b.basic.method},e=function(a){var c=function(){return""};return a&&a.type&&a.type&&b[a.type]?function(){var c=b[a.type].cssClass;return function(){return c}}():c};this.getTemplateClass=e(a),this.build=d(a)},a}(EasyAutocomplete||{}),EasyAutocomplete=function(a){return a.main=function(b,c){function d(){return 0===t.length?void p.error("Input field doesn't exist."):o.checkDataUrlProperties()?o.checkRequiredProperties()?(e(),void g()):void p.error("Will not work without mentioned properties."):void p.error("One of options variables 'data' or 'url' must be defined.")}function e(){function a(){var a=$(""),c=n.getValue("WRAPPER_CSS_CLASS");o.get("theme")&&""!==o.get("theme")&&(c+=" eac-"+o.get("theme")),o.get("cssClasses")&&""!==o.get("cssClasses")&&(c+=" "+o.get("cssClasses")),""!==q.getTemplateClass()&&(c+=" "+q.getTemplateClass()),a.addClass(c),t.wrap(a),o.get("adjustWidth")===!0&&b()}function b(){var a=t.outerWidth();t.parent().css("width",a)}function c(){t.unwrap()}function d(){var a=$("
").addClass(n.getValue("CONTAINER_CLASS"));a.attr("id",f()).prepend($("
")),function(){a.on("show.eac",function(){switch(o.get("list").showAnimation.type){case"slide":var b=o.get("list").showAnimation.time,c=o.get("list").showAnimation.callback;a.find("ul").slideDown(b,c);break;case"fade":var b=o.get("list").showAnimation.time,c=o.get("list").showAnimation.callback;a.find("ul").fadeIn(b),c;break;default:a.find("ul").show()}o.get("list").onShowListEvent()}).on("hide.eac",function(){switch(o.get("list").hideAnimation.type){case"slide":var b=o.get("list").hideAnimation.time,c=o.get("list").hideAnimation.callback;a.find("ul").slideUp(b,c);break;case"fade":var b=o.get("list").hideAnimation.time,c=o.get("list").hideAnimation.callback;a.find("ul").fadeOut(b,c);break;default:a.find("ul").hide()}o.get("list").onHideListEvent()}).on("selectElement.eac",function(){a.find("ul li").removeClass("selected"),a.find("ul li").eq(w).addClass("selected"),o.get("list").onSelectItemEvent()}).on("loadElements.eac",function(b,c,d){var e="",f=a.find("ul");f.empty().detach(),v=[];for(var h=0,i=0,k=c.length;k>i;i+=1){var l=c[i].data;if(0!==l.length){void 0!==c[i].header&&c[i].header.length>0&&f.append(""+c[i].header+"
");for(var m=0,n=l.length;n>m&&h
"),function(){var a=m,b=h,f=c[i].getValue(l[a]);e.find(" > div").on("click",function(){t.val(f).trigger("change"),w=b,j(b),o.get("list").onClickEvent(),o.get("list").onChooseEvent()}).mouseover(function(){w=b,j(b),o.get("list").onMouseOverEvent()}).mouseout(function(){o.get("list").onMouseOutEvent()}).html(q.build(g(f,d),l[a]))}(),f.append(e),v.push(l[m]),h+=1}}a.append(f),o.get("list").onLoadEvent()})}(),t.after(a)}function e(){t.next("."+n.getValue("CONTAINER_CLASS")).remove()}function g(a,b){return o.get("highlightPhrase")&&""!==b?i(a,b):a}function h(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function i(a,b){var c=h(b);return(a+"").replace(new RegExp("("+c+")","gi"),"$1 ")}t.parent().hasClass(n.getValue("WRAPPER_CSS_CLASS"))&&(e(),c()),a(),d(),u=$("#"+f()),o.get("placeholder")&&t.attr("placeholder",o.get("placeholder"))}function f(){var a=t.attr("id");return a=n.getValue("CONTAINER_ID")+a}function g(){function a(){s("autocompleteOff",!0)&&n(),b(),c(),d(),e(),f(),g()}function b(){t.focusout(function(){var a,b=t.val();o.get("list").match.caseSensitive||(b=b.toLowerCase());for(var c=0,d=v.length;d>c;c+=1)if(a=o.get("getValue")(v[c]),o.get("list").match.caseSensitive||(a=a.toLowerCase()),a===b)return w=c,void j(w)})}function c(){t.off("keyup").keyup(function(a){function b(a){function b(){var a={},b=o.get("ajaxSettings")||{};for(var c in b)a[c]=b[c];return a}function c(a,b){return o.get("matchResponseProperty")!==!1?"string"==typeof o.get("matchResponseProperty")?b[o.get("matchResponseProperty")]===a:"function"==typeof o.get("matchResponseProperty")?o.get("matchResponseProperty")(b)===a:!0:!0}if(!(a.length0?h():i()}var f=b();void 0!==f.url&&""!==f.url||(f.url=o.get("url")),void 0!==f.dataType&&""!==f.dataType||(f.dataType=o.get("dataType")),void 0!==f.url&&"list-required"!==f.url&&(f.url=f.url(a),f.data=o.get("preparePostData")(f.data,a),$.ajax(f).done(function(b){var d=r.init(b);d=r.updateCategories(d,b),d=r.convertXml(d),c(a,b)&&(d=r.processData(d,a),k(d,a)),r.checkIfDataExists(d)&&t.parent().find("li").length>0?h():i(),o.get("ajaxCallback")()}).fail(function(){p.warning("Fail to load response data")}).always(function(){}))}}switch(a.keyCode){case 27:i(),l();break;case 38:a.preventDefault(),v.length>0&&w>0&&(w-=1,t.val(o.get("getValue")(v[w])),j(w));break;case 40:a.preventDefault(),v.length>0&&w40||8===a.keyCode){var c=t.val();o.get("list").hideOnEmptyPhrase!==!0||8!==a.keyCode||""!==c?o.get("requestDelay")>0?(void 0!==m&&clearTimeout(m),m=setTimeout(function(){b(c)},o.get("requestDelay"))):b(c):i()}}})}function d(){t.on("keydown",function(a){a=a||window.event;var b=a.keyCode;return 38===b?(suppressKeypress=!0,!1):void 0}).keydown(
function(a)
{
if(a.keyCode===13){o.get("list").onKeyEnterEvent();}
if(a.keyCode===13&&w>-1){t.val(o.get("getValue")(v[w]));o.get("list").onChooseEvent();w=-1;i();a.preventDefault();}
//13===a.keyCode&&w>-1&&(t.val(o.get("getValue")(v[w])),o.get("list").onKeyEnterEvent(),o.get("list").onChooseEvent(),w=-1,i(),a.preventDefault())
}
)}function e(){t.off("keypress")}function f(){t.focus(function(){""!==t.val()&&v.length>0&&(w=-1,h())})}function g(){t.blur(function(){setTimeout(function(){w=-1,i()},250)})}function n(){t.attr("autocomplete","off")}a()}function h(){u.trigger("show.eac")}function i(){u.trigger("hide.eac")}function j(a){u.trigger("selectElement.eac",a)}function k(a,b){u.trigger("loadElements.eac",[a,b])}function l(){t.trigger("blur")}var m,n=new a.Constans,o=new a.Configuration(c),p=new a.Logger,q=new a.Template(c.template),r=new a.ListBuilderService(o,a.proccess),s=o.equals,t=b,u="",v=[],w=-1;a.consts=n,this.getConstants=function(){return n},this.getConfiguration=function(){return o},this.getContainer=function(){return u},this.getSelectedItemIndex=function(){return w},this.getItems=function(){return v},this.getItemData=function(a){return v.length0},a.assignRandomId=function(b){var c="";do c="eac-"+Math.floor(1e4*Math.random());while(0!==$("#"+c).length);elementId=a.consts.getValue("CONTAINER_ID")+c,$(b).attr("id",c)},a.setHandle=function(b,c){a.eacHandles[c]=b},a}(EasyAutocomplete||{});!function(a){a.fn.easyAutocomplete=function(b){return this.each(function(){var c=a(this),d=new EasyAutocomplete.main(c,b);EasyAutocomplete.inputHasId(c)||EasyAutocomplete.assignRandomId(c),d.init(),EasyAutocomplete.setHandle(d,c.attr("id"))})},a.fn.getSelectedItemIndex=function(){var b=a(this).attr("id");return void 0!==b?EasyAutocomplete.getHandle(b).getSelectedItemIndex():-1},a.fn.getItems=function(){var b=a(this).attr("id");return void 0!==b?EasyAutocomplete.getHandle(b).getItems():-1},a.fn.getItemData=function(b){var c=a(this).attr("id");return void 0!==c&&b>-1?EasyAutocomplete.getHandle(c).getItemData(b):-1},a.fn.getSelectedItemData=function(){var b=a(this).attr("id");return void 0!==b?EasyAutocomplete.getHandle(b).getSelectedItemData():-1}}(jQuery);var destacados_pag_actual=0;
var hrefs_productos=new Array();
var last_tr_orden="";
function set_precio_variante(id_producto) {
at1 = getObj("id_atributo1"+id_producto);
if (at1==null) return;
at2 = getObj("id_atributo2"+id_producto);
if (at2==null) return;
id_atributo1 = at1.value;
id_atributo2 = at2.value;
if (id_atributo1==0 || id_atributo1=="") return;
if (id_atributo2==0 || id_atributo2=="") return;
pr = getObj("pr_"+id_producto+"_"+id_atributo1+"_"+id_atributo2);
pa = getObj("pa_"+id_producto+"_"+id_atributo1+"_"+id_atributo2);
if (pr==null) return;
if (pa==null) return;
pr = parseFloat(pr.value);
pa = parseFloat(pa.value);
cont_pa = getObj("cont_pa"+id_producto);
str_pa = getObj("str_pa"+id_producto);
str_pa_deci = getObj("str_pa_deci"+id_producto);
str_pr = getObj("str_pr"+id_producto);
str_pr_deci = getObj("str_pr_deci"+id_producto);
cont_sin_pa = getObj("cont_sin_pa"+id_producto);
if (cont_pa == null) return;
if (str_pa == null) return;
if (str_pa_deci == null) return;
if (str_pr == null) return;
if (str_pr_deci == null) return;
if (cont_sin_pa == null) return;
if (pa <= pr) {
cont_pa.style.display="none";
cont_sin_pa.style.display="";
} else {
cont_pa.style.display="";
cont_sin_pa.style.display="none";
}
if (parseInt(pa)!=pa) {
m = (pa + "").split(".");
d = m[1];
if (d.length==1) d+="0";
str_pa_deci.innerHTML=","+d;
str_pa_deci.style.display="";
} else {
str_pa_deci.innerHTML="";
str_pa_deci.style.display="none";
}
m = Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(pa).split(",");
n = m[0];
str_pa.innerHTML = n;
if (parseInt(pr)!=pr) {
m = (pr + "").split(".");
d = m[1];
if (d.length==1) d+="0";
str_pr_deci.innerHTML=","+d;
str_pr_deci.style.display="";
} else {
str_pr_deci.innerHTML="";
str_pr_deci.style.display="none";
}
m = Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(pr).split(",");
n = m[0];
str_pr.innerHTML = n;
cont_dto_esp = getObj("cont_dto_esp_"+id_producto);
dto_esp = getObj("dto_esp_"+id_producto);
if (cont_dto_esp == null) return;
if (dto_esp == null) return;
if ( pa > pr && pa>0 ) {
porc = ((Math.round(pa - pr)) * 100) / pa;
porc = Math.round(Math.abs(porc));
cont_dto_esp.className = "descuento_especial";
dto_esp.innerHTML = porc;
} else {
cont_dto_esp.className = "descuento_especial vh";
}
}
function eliminar_guardado(producto)
{
if (window.confirm("żConfirmar borrar producto?"))
{
url="/productos/cart/includes/eliminar_guardar_para_despues.php?producto="+producto;
crear_script_tag(url,"cart");
}
}
function orden_ver_mas(id_orden)
{
var tr=getObj("tr_orden1"+id_orden);
if (tr.style.display=="")
{
tr.style.display="none";
}
else
{
tr.style.display="";
}
}
function select_marca_alt(id_marca,path)
{
if (id_marca>0)
{
var url=DIR+"/productos/productos.php?secc=productos&id_marca2="+id_marca+"&path="+path;
location.href=url;
}
}
var last_id_superdest=0;
var last_label_superdest="";
function get_superdestacados(id,l)
{
if (last_id_superdest>0) {
var o=getObj("option_cat"+last_id_superdest);
var link=" "+last_label_superdest+" ";
o.innerHTML=link;
}
var o=getObj("option_cat"+id);
var link=""+l+" ";
o.innerHTML=link;
var o=getObj("nombre_cat_seleccionada");
o.innerHTML=l;
last_id_superdest=id;
last_label_superdest=l;
cargar_url_ayax(DIR+"/productos/resumenes/resumen_para_ayax.php?id_categoria="+id, "cont_superdestacados", "POST", "reset_nav_prods()");
}
function reset_nav_prods()
{
var o=getObj("categorias_combo");
if (o!=null) o.style.display="none";
var o=getObj("combo_cat_super");
if (o!=null) o.className="combocont comboseleccionado";
}
function normalizar_nombre_cat(orig)
{
str = new String(orig);
rExp = "/'/g";
rExp = eval(rExp);
newS = String("\\u0027");
str = new String(str.replace(rExp, newS));
return str;
}
function show_list_combo_dinamico()
{
var o=getObj("categorias_combo");
if (o==null) return;
if (o.style.display=="none") o.style.display=""; else o.style.display="none";
}
function checkout_cart(id)
{
var o=getObj("ir_al_final_directo"+id);
if (o!=null) {
o.value=1;
var o=getObj("btn_agregar_cart"+id);
if (o!=null) {
o.click();
}
}
}
var cont_nombre_atributo_marcas=new Array();
function seleccionar_atributo(grupo,id_attr,prod,indice_atr,label,id_categoria_atributo)
{
var o;
for (i=0;i < variantes_activas.length;i++) {
variante=variantes_activas[i];
keyvar=variante[0];
activa=variante[1];
aux=keyvar.split("_");
attr1=aux[0];
attr2=aux[1];
if (grupo==0 && id_attr==attr1) {
//oculto y desoculto al atributo2 si lo hay
if (activa==1) dsp=""; else dsp="none";
o=getObj("div_cont_atributo1"+attr2);
if (o!=null) o.style.display=dsp;
o=getObj("cont_nombre_atributo_1_"+attr2);
if (o!=null) o.style.display=dsp;
o=getObj("id_atributo2"+prod);
if (o!=null) o.value="0";
o=getObj("elemento_sel_atr1");
if (o!=null) {
lbl="";
l=getObj("label_atributo2");
if (l!=null) lbl=l.value;
o.innerHTML=lbl;
}
//recuperar el color que estaba seleccionado
} else if (grupo==1 && id_attr==attr2) {
}
}
if (typeof id_categoria_atributo=="undefined") id_categoria_atributo=0;
for (var i=0;i < atributos.length;i++) {
if (atributos[i][0]==grupo) {
o=getObj("div_cont_atributo"+grupo+atributos[i][1]);
if (o!=null) o.className="item";
}
}
o=getObj("div_cont_atributo"+grupo+id_attr);
if (o!=null) o.className="item seleccionado";
if (grupo==0) {
id_atributo1_preseleccionado=id_attr;
v=getObj("id_atributo1"+prod);
} else {
id_atributo2_preseleccionado=id_attr;
v=getObj("id_atributo2"+prod);
}
if (v!=null) v.value=id_attr;
i=id_atributo1_preseleccionado+"_"+id_atributo2_preseleccionado;
try {
vec_precio=precios_atributos[i];
} catch (e) {
vec_precio=Array(0,0);
}
if (typeof vec_precio!="undefined" && parseFloat(vec_precio[0]) <= 0) {
if (getObj("btn_agregar_cart"+prod)!=null) getObj("btn_agregar_cart"+prod).value="Consultar ";
if (getObj("producto_agotado")!=null) getObj("producto_agotado").style.display="";
if (getObj("contenedor_precio_anterior")!=null) getObj("contenedor_precio_anterior").style.display="none";
if (getObj("precio_ent_actual")!=null) {getObj("precio_ent_actual").innerHTML="";getObj("precio_dec_actual").innerHTML="";}
}
if (typeof codigos[i] != "undefined") {
o=getObj("codigo_producto0");
if (o!=null) o.innerHTML=codigos[i];
for (ind=1;ind < 10;ind++) {
o=getObj("codigo_producto"+ind);
if (o!=null) o.innerHTML="Código: "+codigos[i];
}
}
if (typeof vec_precio != "undefined")
{
precio=""+vec_precio[0];
precio_anterior=""+vec_precio[1];
o=getObj("contenedor_precio_anterior");
if (o!=null) {
if (parseFloat(precio_anterior)!=parseFloat(precio) && parseFloat(precio_anterior) > 0 && parseFloat(precio) < parseFloat(precio_anterior)) {
o.style.display="";
} else {
o.style.display="none";
}
}
o=getObj("precio_ent_actual");
if (o!=null) {
aux=precio.split(".");e=aux[0];d=aux[1];
if (typeof d != "undefined") if (d.length==1) d=d+"0";
m = Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(e).split(",");
e = m[0];
getObj("precio_ent_actual").innerHTML=e;
getObj("precio_dec_actual").innerHTML=","+d;
if (precio!=parseInt(precio)) getObj("precio_dec_actual").style.display=""; else getObj("precio_dec_actual").style.display="none";
}
o=getObj("precio_ent_anterior");
if (o!=null) {
aux=precio_anterior.split(".");e=aux[0];d=aux[1];
if (typeof d != "undefined") if (d.length==1) d=d+"0";
m = Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(e).split(",");
e = m[0];
getObj("precio_ent_anterior").innerHTML=e;
getObj("precio_dec_anterior").innerHTML=","+d;
if (precio_anterior!=parseInt(precio_anterior)) getObj("precio_dec_anterior").style.display=""; else getObj("precio_dec_anterior").style.display="none";
}
o=getObj("contenedor_precio_actual");
if (o!=null) {
if (parseFloat(precio) > 0 ) {
o.style.display="";
} else {
o.style.display="none";
}
}
str_dto_especial = getObj("str_dto_especial");
pr = parseFloat(precio);
pa = parseFloat(precio_anterior);
if ( pa > precio && pa>0 ) {
porc = ((Math.round(pa - pr)) * 100) / pa;
porc = Math.round(Math.abs(porc));
if (getObj("descuento_especial")!=null) getObj("descuento_especial").style.display="";
if (str_dto_especial!=null) str_dto_especial.innerHTML=porc;
} else {
if (getObj("descuento_especial")!=null) getObj("descuento_especial").style.display="none";
if (str_dto_especial!=null) str_dto_especial.innerHTML="";
}
o=getObj("frmaddcart"+prod);
if (o!=null) {
if (parseFloat(precio) > 0 ) {
o.style.display="";
} else {
o.style.display="none";
}
}
/*
o=getObj("producto_agotado");
if (o!=null) {
if (parseFloat(precio) > 0 ) {
o.style.display="none";
} else {
o.style.display="";
}
}
*/
}
o=getObj("atributo_navegacion_alternativa"+grupo);
if (o!=null) o.style.display="none";
o=getObj("elemento_sel_atr"+grupo);
if (o!=null) o.innerHTML=label;
o=getObj("atributo_nombre"+id_categoria_atributo);
if (o!=null) o.innerHTML=label;
if (typeof cont_nombre_atributo_marcas[grupo] == "undefined") {
cont_nombre_atributo_marcas[grupo]=id_attr;
}
var id_marcacion_anterior=cont_nombre_atributo_marcas[grupo];
var id_marcacion_actual=id_attr;
o=getObj("cont_nombre_atributo_"+grupo+"_"+id_marcacion_anterior);
if (o!=null) {
el=str_replace(o.innerHTML,"","");
el=str_replace(el," ","");
o.innerHTML=el;
}
o=getObj("cont_nombre_atributo_"+grupo+"_"+id_attr);
if (o!=null) {
o.innerHTML=""+o.innerHTML+" ";
}
cont_nombre_atributo_marcas[grupo]=id_attr;
}
function str_replace_on_prods(str, sear, repl)
{
return str.split(sear).join(repl);
}
var cant_cart_alt_anterior=1;
function set_cant_alt(i,id) {
o=getObj("cantidad_"+id);
if (o!=null) o.value=i;
o=getObj("productos_compra_cantidad_selector");
if (o!=null) o.style.display="none";
o=getObj("cant_seleccionada_alt");
if (o!=null) o.innerHTML=i;
o=getObj("cant_cart_alt"+cant_cart_alt_anterior);
if (o!=null) {
el=str_replace(o.innerHTML,"","");
el=str_replace(el," ","");
o.innerHTML=el;
}
o=getObj("cant_cart_alt"+i);
if (o!=null) {
o.innerHTML=""+o.innerHTML+" ";
}
cant_cart_alt_anterior=i;
o=getObj("cont_add_unidades");
if (o!=null) {
if (id_unidad_de_medida==1) mult=100; else mult=1;
lbl="Agregar al carrito" + " " + (unidad_minima_de_medida*i*mult) + " " + nombre_unidad_medida;
o.innerHTML=lbl;
}
}
function check_preguntar(form)
{
if (form.pregunta.value=="") {
DHTMLALERT("Ingresa la pregunta.");
return false;
}
form.btnpreguntar.disabled=true;
return true;
}
var colores_seleccionados=new Array();
function set_color_producto_foto(id_producto,id_color)
{
var img=getObj("img_producto"+id_producto);
if (img==null) return;
if (typeof array_fotos_colores == "undefined") return;
if (typeof array_fotos_colores[id_producto] == "undefined") return;
var colores=array_fotos_colores[id_producto];
if (typeof colores[id_color] == "undefined") return;
var foto_color=colores[id_color];
var id_foto=foto_color[0];
var ext=foto_color[1]
var src=img.src;
var last_ocurr=src.lastIndexOf("_");
var new_img=src.substring(0,last_ocurr+1)+id_foto+"."+ext;
img.src=new_img;
img.srcset=new_img+" 1x,"+new_img+" 2x,"+new_img+" 3x";
colores_seleccionados[id_producto]=id_color;
}
function nav_prod_masinfo(obj_href,id_producto)
{
if (typeof colores_seleccionados[id_producto] == "undefined")
{
return;
}
var url=obj_href.href;
if (url.indexOf("?")==-1)
{
add_url="?";
} else {
add_url="&";
}
obj_href.href+=add_url+"selcolor="+colores_seleccionados[id_producto];
return;
}
function nav_prod_masinfo_button(url,id_producto)
{
if (typeof colores_seleccionados[id_producto] == "undefined") {
location.href=url;
return;
}
if (url.indexOf("?")==-1) {
add_url="?";
} else {
add_url="&";
}
var new_url=url+add_url+"selcolor="+colores_seleccionados[id_producto];
location.href=new_url;
return;
}
function change_pais(id_pais)
{
var o=getObj("tr_DESTINARIO_id_departamento");
if (o==null) return;
if (id_pais==858) var dsp=""; else var dsp="none";
o.style.display=dsp;
}
function activar_datos_extra(codigo)
{
var o=getObj("datos_CUY");
if (o!=null) {
if (codigo=="CUY") {
url="/productos/cart/includes/calc_peso_cuy.php";
crear_script_tag(url,"cartpeso");
} else {
o.style.display="none";
}
}
}
var flag_dir_cuy_modificada=false;
function cp_cuy_data(direccion,dest) {
var o=getObj(dest);
if (o==null) return;
o.value=direccion;
}
function cp_cuy_dir(direccion)
{
var o=getObj("CUY_calle");
if (o==null) return;
if (o.value=="" || !flag_dir_cuy_modificada) {
o.value=direccion;
}
}
function dir_cuy_modificada()
{
flag_dir_cuy_modificada=true;
}
function check_formas_de_pago(id_envio) {
return;
}
function marcar_pago_envio(contenedor, nom_clase)
{
if (contenedor.split("_").length==1)
return;
var nom_contenedor = contenedor.split("_")[0];
var id_contenedor = parseInt(contenedor.split("_")[1]);
for (var i=0;i < 200;i++)
{
if (getObj(nom_contenedor+"_"+i)!=null)
{
aplicar_quitar_clase(nom_contenedor+"_"+i, nom_clase, 1);
}
}
aplicar_quitar_clase(contenedor,nom_clase);
if (nom_contenedor=="pago")
{
if(getObj("formadepago"+id_contenedor) && !getObj("formadepago"+id_contenedor).checked)
getObj("formadepago"+id_contenedor).click();
}
if (nom_contenedor=="envio")
{
if(getObj("formadeenvio"+id_contenedor) && !getObj("formadeenvio"+id_contenedor).checked)
getObj("formadeenvio"+id_contenedor).click();
}
}
var ultima_vista_producto = -1;
function set_vista_productos(modo, f_forzar)
{
if (!f_forzar && ultima_vista_producto==modo) return;
ultima_vista_producto = modo;
var url="/productos/tools/set_vista_productos.php?ID_SESSION_USR=tecmarcomuysublimesolutionscomR5200&modo="+modo;
crear_script_tag(url,"get_vista_productos");
}
function generar_pdf(p)
{
DHTMLALERT('Generando PDF...');
url="/productos/scripts/exportar_resultado_pdf.php?"+p;
crear_script_tag(url,"exportar_resultado_pdf");
}
var atr_seleccionados = new Array();
function set_attr_listado(id_producto,id_atributo,nroatr,invertir_atributos) {
if (typeof atr_seleccionados[id_producto]=="undefined") {
atr_seleccionados[id_producto]=new Array();
atr_seleccionados[id_producto][nroatr]=id_atributo;
}
if (invertir_atributos==1) {
if (nroatr==0) {
o=getObj("id_atributo2"+id_producto);
} else {
o=getObj("id_atributo1"+id_producto);
}
} else {
if (nroatr==0) {
o=getObj("id_atributo1"+id_producto);
} else {
o=getObj("id_atributo2"+id_producto);
}
}
if (o==null) return;
anterior = getObj("atributo_"+id_producto+"_"+atr_seleccionados[id_producto][nroatr]+"_"+nroatr);
actual = getObj("atributo_"+id_producto+"_"+id_atributo+"_"+nroatr);
if (anterior!=null) anterior.className="";
if (actual!=null) actual.className="atributo2_seleccionado";
atr_seleccionados[id_producto][nroatr]=id_atributo;
o.value=id_atributo;
o=getObj("str_stocks_atributo_"+id_producto+"_"+id_atributo+"_"+nroatr);
if (o==null) return;
atrstock=o.value.split(",");
for (i=0;i < atrstock.length;i++) {
aux=atrstock[i].split(":");
id_atributo2=aux[0];
stock=aux[1];
nro_atr_dest=aux[2];
if (stock>0) {
dsp="";
} else {
dsp="none";
}
o=getObj("atributo_"+id_producto+"_"+id_atributo2+"_1");
if (o!=null) o.style.display=dsp;
o=getObj("atributo_"+id_producto+"_"+id_atributo2+"_0");
if (o!=null) o.style.display=dsp;
}
set_precio_variante(id_producto);
}
function check_add_producto_listado(id_producto)
{
o=getObj("id_atributo1"+id_producto);
id_atributo1=o.value;
o=getObj("id_atributo2"+id_producto);
id_atributo2=o.value;
mensaje_falta_atributo1=getObj("mensaje_falta_atributo1"+id_producto)
mensaje_falta_atributo2=getObj("mensaje_falta_atributo2"+id_producto)
o=getObj("id_atributo1"+id_producto);
if (o==null || o.value=="0" || o.value=="") {
alerta_agregando_off();
DHTMLALERT(mensaje_falta_atributo1.value);
return false;
}
id_atributo1=o.value;
o=getObj("id_atributo2"+id_producto);
if ((o==null || o.value=="0" || o.value=="") && mensaje_falta_atributo2.value!="") {
alerta_agregando_off();
DHTMLALERT(mensaje_falta_atributo2.value);
return false;
}
id_atributo2=o.value;
return true;
}
function set_label_arribando(i) {
o=getObj("div_stock_arribando");
if (o==null) return;
if (i==0) {
o.innerHTML="";
o.style.display="none";
return;
}
if (typeof stock_proximos_arribos[i] != "undefined") {
s=stock_proximos_arribos[i];
if (s[0]==0) {
o.innerHTML="";
o.style.display="none";
} else {
l="Stock a arribar "+s[0]+" "+s[1];
o.innerHTML=l;
o.style.display="";
o=getObj("divstock2");
if (o!=null) o.style.display="none";
}
}
}jQuery.easing['jswing'] = jQuery.easing['swing'];
jQuery.extend( jQuery.easing,
{
def: 'easeOutQuad',
swing: function (x, t, b, c, d) {
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
},
easeInQuad: function (x, t, b, c, d) {
return c*(t/=d)*t + b;
},
easeOutQuad: function (x, t, b, c, d) {
return -c *(t/=d)*(t-2) + b;
},
easeInOutQuad: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t + b;
return -c/2 * ((--t)*(t-2) - 1) + b;
},
easeInCubic: function (x, t, b, c, d) {
return c*(t/=d)*t*t + b;
},
easeOutCubic: function (x, t, b, c, d) {
return c*((t=t/d-1)*t*t + 1) + b;
},
easeInOutCubic: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t + b;
return c/2*((t-=2)*t*t + 2) + b;
},
easeInQuart: function (x, t, b, c, d) {
return c*(t/=d)*t*t*t + b;
},
easeOutQuart: function (x, t, b, c, d) {
return -c * ((t=t/d-1)*t*t*t - 1) + b;
},
easeInOutQuart: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
return -c/2 * ((t-=2)*t*t*t - 2) + b;
},
easeInQuint: function (x, t, b, c, d) {
return c*(t/=d)*t*t*t*t + b;
},
easeOutQuint: function (x, t, b, c, d) {
return c*((t=t/d-1)*t*t*t*t + 1) + b;
},
easeInOutQuint: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
return c/2*((t-=2)*t*t*t*t + 2) + b;
},
easeInSine: function (x, t, b, c, d) {
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
},
easeOutSine: function (x, t, b, c, d) {
return c * Math.sin(t/d * (Math.PI/2)) + b;
},
easeInOutSine: function (x, t, b, c, d) {
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
},
easeInExpo: function (x, t, b, c, d) {
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
},
easeOutExpo: function (x, t, b, c, d) {
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
},
easeInOutExpo: function (x, t, b, c, d) {
if (t==0) return b;
if (t==d) return b+c;
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
},
easeInCirc: function (x, t, b, c, d) {
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
},
easeOutCirc: function (x, t, b, c, d) {
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
},
easeInOutCirc: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
},
easeInElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
},
easeOutElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
},
easeInOutElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
},
easeInBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
return c*(t/=d)*t*((s+1)*t - s) + b;
},
easeOutBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
},
easeInOutBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
},
easeInBounce: function (x, t, b, c, d) {
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
},
easeOutBounce: function (x, t, b, c, d) {
if ((t/=d) < (1/2.75)) {
return c*(7.5625*t*t) + b;
} else if (t < (2/2.75)) {
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
} else if (t < (2.5/2.75)) {
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
} else {
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
}
},
easeInOutBounce: function (x, t, b, c, d) {
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
}
});!function(a){a.fn.viewportChecker=function(b){var c={classToAdd:"visible",classToRemove:"invisible",classToAddForFullView:"full-visible",removeClassAfterAnimation:!1,offset:100,repeat:!1,invertBottomOffset:!0,callbackFunction:function(a,b){},scrollHorizontal:!1,scrollBox:window};a.extend(c,b);var d=this,e={height:a(c.scrollBox).height(),width:a(c.scrollBox).width()};return this.checkElements=function(){var b,f;c.scrollHorizontal?(b=Math.max(a("html").scrollLeft(),a("body").scrollLeft(),a(window).scrollLeft()),f=b+e.width):(b=Math.max(a("html").scrollTop(),a("body").scrollTop(),a(window).scrollTop()),f=b+e.height),d.each(function(){var d=a(this),g={},h={};if(d.data("vp-add-class")&&(h.classToAdd=d.data("vp-add-class")),d.data("vp-remove-class")&&(h.classToRemove=d.data("vp-remove-class")),d.data("vp-add-class-full-view")&&(h.classToAddForFullView=d.data("vp-add-class-full-view")),d.data("vp-keep-add-class")&&(h.removeClassAfterAnimation=d.data("vp-remove-after-animation")),d.data("vp-offset")&&(h.offset=d.data("vp-offset")),d.data("vp-repeat")&&(h.repeat=d.data("vp-repeat")),d.data("vp-scrollHorizontal")&&(h.scrollHorizontal=d.data("vp-scrollHorizontal")),d.data("vp-invertBottomOffset")&&(h.scrollHorizontal=d.data("vp-invertBottomOffset")),a.extend(g,c),a.extend(g,h),!d.data("vp-animated")||g.repeat){String(g.offset).indexOf("%")>0&&(g.offset=parseInt(g.offset)/100*e.height);var i=g.scrollHorizontal?d.offset().left:d.offset().top,j=g.scrollHorizontal?i+d.width():i+d.height(),k=Math.round(i)+g.offset,l=g.scrollHorizontal?k+d.width():k+d.height();g.invertBottomOffset&&(l-=2*g.offset),kb?(d.removeClass(g.classToRemove),d.addClass(g.classToAdd),g.callbackFunction(d,"add"),j<=f&&i>=b?d.addClass(g.classToAddForFullView):d.removeClass(g.classToAddForFullView),d.data("vp-animated",!0),g.removeClassAfterAnimation&&d.one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){d.removeClass(g.classToAdd)})):d.hasClass(g.classToAdd)&&g.repeat&&(d.removeClass(g.classToAdd+" "+g.classToAddForFullView),g.callbackFunction(d,"remove"),d.data("vp-animated",!1))}})},("ontouchstart"in window||"onmsgesturechange"in window)&&a(document).bind("touchmove MSPointerMove pointermove",this.checkElements),a(c.scrollBox).bind("load scroll",this.checkElements),a(window).resize(function(b){e={height:a(c.scrollBox).height(),width:a(c.scrollBox).width()},d.checkElements()}),this.checkElements(),this}}(jQuery);var marqueeSpawned = [];
var marqueeHovered = false;
if(document.hasFocus()) {
var focused = true;
} else {
var focused = false;
}
function marqueeObj (newElement){
this.el = newElement;
this.counter = 0;
this.getPosition = getCurrentPosition;
this.name = "";
this.timeLeft = 0;
this.currentPos = 0;
this.distanceLeft = 0;
this.totalDistance = 0;
this.contentWidth = 0;
this.endPoint = 0;
this.duration = 0;
this.hovered = false;
this.padding = 0;
}
function getCurrentPosition(){
this.currentPos = parseInt($(this.name).css('left'));
return this.currentPos;
}
function createMarquee(settings){
var defaults = {
duration:85000,
padding:10,
marquee_class:'.marquee',
container_class:'.marquee-container',
sibling_class:0,
hover:true
};
var config = $.extend({}, defaults, settings);
if($(config.marquee_class).width() == 0){
console.error('FATAL: marquee css or children css not correct. Width is either set to 0 or the element is collapsing. Make sure overflow is set on the marquee, and the children are postitioned relatively');
return;
}
if(typeof $(config.marquee_class) === 'undefined'){
console.error('FATAL: marquee class not valid');
return;
}
if(typeof $(config.container_class) === 'undefined'){
console.error('FATAL: marquee container class not valid');
return;
}
if(config.sibling_class != 0 && typeof $(config.sibling_class) === 'undefined'){
console.error('FATAL: sibling class container class not valid');
return;
}
var config = $.extend({}, defaults, settings);
var marqueeContent = $(config.marquee_class).html()
var containerWidth = $(config.container_class).width();
var contentWidth = $(config.marquee_class).width();
if (config.sibling_class == 0) {
var widthToIgnore = 0;
} else {
var widthToIgnore = $(config.sibling_class).width();
}
var spawnAmount = Math.ceil(containerWidth / contentWidth);
$(config.marquee_class).remove();
if(spawnAmount<=2){
spawnAmount =3;
} else {
spawnAmount++
}
var totalContentWidth = (contentWidth + config.padding)*spawnAmount;
var endPoint = -(totalContentWidth - containerWidth);
var totalDistance = containerWidth - endPoint;
for (i = 0; i < spawnAmount; i++) {
if(config.hover == true){
var newElement = $('' + marqueeContent + '
')
.mouseenter(function() {
if ((focused == true) && (marqueeHovered == false)){
marqueeHovered = true;
for (var key in marqueeSpawned){
marqueeSpawned[key].el.clearQueue().stop();
marqueeSpawned[key].hovered = true;
}
}
})
.mouseleave(function() {
if ((focused == true) && (marqueeHovered == true)){
for (var key in marqueeSpawned){
marqueeManager(marqueeSpawned[key]);
}
marqueeHovered = false;
}
});
} else {
var newElement = $('' + marqueeContent + '
') ;
}
marqueeSpawned[i] = new marqueeObj(newElement);
$(config.container_class).append(newElement);
marqueeSpawned[i].currentPos = (widthToIgnore + (contentWidth*i))+(config.padding*i);
marqueeSpawned[i].name = '.marquee-'+(i+1);
marqueeSpawned[i].totalDistance = totalDistance;
marqueeSpawned[i].containerWidth = containerWidth;
marqueeSpawned[i].contentWidth = contentWidth;
marqueeSpawned[i].endPoint = endPoint;
marqueeSpawned[i].duration = config.duration;
marqueeSpawned[i].padding = config.padding;
marqueeSpawned[i].el.css('left', marqueeSpawned[i].currentPos+config.padding +'px');
if (focused == true){
marqueeManager(marqueeSpawned[i]);
}
}
}
function marqueeManager(marqueed_el) {
if (marqueed_el.hovered == false) {
if (marqueed_el.counter > 0) {
marqueed_el.timeLeft = marqueed_el.duration;
marqueed_el.el.css('left', marqueed_el.containerWidth +'px');
marqueed_el.currentPos = marqueed_el.containerWidth;
marqueed_el.distanceLeft = marqueed_el.totalDistance - (marqueed_el.containerWidth - marqueed_el.getPosition());
} else {
marqueed_el.timeLeft = (((marqueed_el.totalDistance - (marqueed_el.containerWidth - marqueed_el.getPosition()))/ marqueed_el.totalDistance)) * marqueed_el.duration;
}
} else {
marqueed_el.hovered = false;
marqueed_el.currentPos = parseInt(marqueed_el.el.css('left'));
marqueed_el.distanceLeft = marqueed_el.totalDistance - (marqueed_el.containerWidth - marqueed_el.getPosition());
marqueed_el.timeLeft = (((marqueed_el.totalDistance - (marqueed_el.containerWidth - marqueed_el.currentPos))/ marqueed_el.totalDistance)) * marqueed_el.duration;
}
marqueeAnim(marqueed_el);
}
function marqueeAnim (marqueeObject){
marqueeObject.counter++
marqueeObject.el.clearQueue().animate({'left': marqueeObject.endPoint+'px'}, marqueeObject.timeLeft, 'linear', function(){marqueeManager(marqueeObject)});
}
window.onfocus = function(){
focused = true;
for (var key in marqueeSpawned){
marqueeManager(marqueeSpawned[key]);
}
};
window.onblur = function(){
focused = false;
for (var key in marqueeSpawned){
marqueeSpawned[key].el.clearQueue().stop();
marqueeSpawned[key].hovered = true;
}
};!function(a,b,c,d){function e(b,c){this.settings=null,this.options=a.extend({},e.Defaults,c),this.$element=a(b),this._handlers={},this._plugins={},this._supress={},this._current=null,this._speed=null,this._coordinates=[],this._breakpoint=null,this._width=null,this._items=[],this._clones=[],this._mergers=[],this._widths=[],this._invalidated={},this._pipe=[],this._drag={time:null,target:null,pointer:null,stage:{start:null,current:null},direction:null},this._states={current:{},tags:{initializing:["busy"],animating:["busy"],dragging:["interacting"]}},a.each(["onResize","onThrottledResize"],a.proxy(function(b,c){this._handlers[c]=a.proxy(this[c],this)},this)),a.each(e.Plugins,a.proxy(function(a,b){this._plugins[a.charAt(0).toLowerCase()+a.slice(1)]=new b(this)},this)),a.each(e.Workers,a.proxy(function(b,c){this._pipe.push({filter:c.filter,run:a.proxy(c.run,this)})},this)),this.setup(),this.initialize()}e.Defaults={items:3,loop:!1,center:!1,rewind:!1,checkVisibility:!0,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:b,fallbackEasing:"swing",slideTransition:"",info:!1,nestedItemSelector:!1,itemElement:"div",stageElement:"div",refreshClass:"owl-refresh",loadedClass:"owl-loaded",loadingClass:"owl-loading",rtlClass:"owl-rtl",responsiveClass:"owl-responsive",dragClass:"owl-drag",itemClass:"owl-item",stageClass:"owl-stage",stageOuterClass:"owl-stage-outer",grabClass:"owl-grab"},e.Width={Default:"default",Inner:"inner",Outer:"outer"},e.Type={Event:"event",State:"state"},e.Plugins={},e.Workers=[{filter:["width","settings"],run:function(){this._width=this.$element.width()}},{filter:["width","items","settings"],run:function(a){a.current=this._items&&this._items[this.relative(this._current)]}},{filter:["items","settings"],run:function(){this.$stage.children(".cloned").remove()}},{filter:["width","items","settings"],run:function(a){var b=this.settings.margin||"",c=!this.settings.autoWidth,d=this.settings.rtl,e={width:"auto","margin-left":d?b:"","margin-right":d?"":b};!c&&this.$stage.children().css(e),a.css=e}},{filter:["width","items","settings"],run:function(a){var b=(this.width()/this.settings.items).toFixed(3)-this.settings.margin,c=null,d=this._items.length,e=!this.settings.autoWidth,f=[];for(a.items={merge:!1,width:b};d--;)c=this._mergers[d],c=this.settings.mergeFit&&Math.min(c,this.settings.items)||c,a.items.merge=c>1||a.items.merge,f[d]=e?b*c:this._items[d].width();this._widths=f}},{filter:["items","settings"],run:function(){var b=[],c=this._items,d=this.settings,e=Math.max(2*d.items,4),f=2*Math.ceil(c.length/2),g=d.loop&&c.length?d.rewind?e:Math.max(e,f):0,h="",i="";for(g/=2;g>0;)b.push(this.normalize(b.length/2,!0)),h+=c[b[b.length-1]][0].outerHTML,b.push(this.normalize(c.length-1-(b.length-1)/2,!0)),i=c[b[b.length-1]][0].outerHTML+i,g-=1;this._clones=b,a(h).addClass("cloned").appendTo(this.$stage),a(i).addClass("cloned").prependTo(this.$stage)}},{filter:["width","items","settings"],run:function(){for(var a=this.settings.rtl?1:-1,b=this._clones.length+this._items.length,c=-1,d=0,e=0,f=[];++c",h)||this.op(b,"<",g)&&this.op(b,">",h))&&i.push(c);this.$stage.children(".active").removeClass("active"),this.$stage.children(":eq("+i.join("), :eq(")+")").addClass("active"),this.$stage.children(".center").removeClass("center"),this.settings.center&&this.$stage.children().eq(this.current()).addClass("center")}}],e.prototype.initializeStage=function(){this.$stage=this.$element.find("."+this.settings.stageClass),this.$stage.length||(this.$element.addClass(this.options.loadingClass),this.$stage=a("<"+this.settings.stageElement+">",{class:this.settings.stageClass}).wrap(a("
",{class:this.settings.stageOuterClass})),this.$element.append(this.$stage.parent()))},e.prototype.initializeItems=function(){var b=this.$element.find(".owl-item");if(b.length)return this._items=b.get().map(function(b){return a(b)}),this._mergers=this._items.map(function(){return 1}),void this.refresh();this.replace(this.$element.children().not(this.$stage.parent())),this.isVisible()?this.refresh():this.invalidate("width"),this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass)},e.prototype.initialize=function(){if(this.enter("initializing"),this.trigger("initialize"),this.$element.toggleClass(this.settings.rtlClass,this.settings.rtl),this.settings.autoWidth&&!this.is("pre-loading")){var a,b,c;a=this.$element.find("img"),b=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:d,c=this.$element.children(b).width(),a.length&&c<=0&&this.preloadAutoWidthImages(a)}this.initializeStage(),this.initializeItems(),this.registerEventHandlers(),this.leave("initializing"),this.trigger("initialized")},e.prototype.isVisible=function(){return!this.settings.checkVisibility||this.$element.is(":visible")},e.prototype.setup=function(){var b=this.viewport(),c=this.options.responsive,d=-1,e=null;c?(a.each(c,function(a){a<=b&&a>d&&(d=Number(a))}),e=a.extend({},this.options,c[d]),"function"==typeof e.stagePadding&&(e.stagePadding=e.stagePadding()),delete e.responsive,e.responsiveClass&&this.$element.attr("class",this.$element.attr("class").replace(new RegExp("("+this.options.responsiveClass+"-)\\S+\\s","g"),"$1"+d))):e=a.extend({},this.options),this.trigger("change",{property:{name:"settings",value:e}}),this._breakpoint=d,this.settings=e,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}})},e.prototype.optionsLogic=function(){this.settings.autoWidth&&(this.settings.stagePadding=!1,this.settings.merge=!1)},e.prototype.prepare=function(b){var c=this.trigger("prepare",{content:b});return c.data||(c.data=a("<"+this.settings.itemElement+"/>").addClass(this.options.itemClass).append(b)),this.trigger("prepared",{content:c.data}),c.data},e.prototype.update=function(){for(var b=0,c=this._pipe.length,d=a.proxy(function(a){return this[a]},this._invalidated),e={};b0)&&this._pipe[b].run(e),b++;this._invalidated={},!this.is("valid")&&this.enter("valid")},e.prototype.width=function(a){switch(a=a||e.Width.Default){case e.Width.Inner:case e.Width.Outer:return this._width;default:return this._width-2*this.settings.stagePadding+this.settings.margin}},e.prototype.refresh=function(){this.enter("refreshing"),this.trigger("refresh"),this.setup(),this.optionsLogic(),this.$element.addClass(this.options.refreshClass),this.update(),this.$element.removeClass(this.options.refreshClass),this.leave("refreshing"),this.trigger("refreshed")},e.prototype.onThrottledResize=function(){b.clearTimeout(this.resizeTimer),this.resizeTimer=b.setTimeout(this._handlers.onResize,this.settings.responsiveRefreshRate)},e.prototype.onResize=function(){return!!this._items.length&&(this._width!==this.$element.width()&&(!!this.isVisible()&&(this.enter("resizing"),this.trigger("resize").isDefaultPrevented()?(this.leave("resizing"),!1):(this.invalidate("width"),this.refresh(),this.leave("resizing"),void this.trigger("resized")))))},e.prototype.registerEventHandlers=function(){a.support.transition&&this.$stage.on(a.support.transition.end+".owl.core",a.proxy(this.onTransitionEnd,this)),!1!==this.settings.responsive&&this.on(b,"resize",this._handlers.onThrottledResize),this.settings.mouseDrag&&(this.$element.addClass(this.options.dragClass),this.$stage.on("mousedown.owl.core",a.proxy(this.onDragStart,this)),this.$stage.on("dragstart.owl.core selectstart.owl.core",function(){return!1})),this.settings.touchDrag&&(this.$stage.on("touchstart.owl.core",a.proxy(this.onDragStart,this)),this.$stage.on("touchcancel.owl.core",a.proxy(this.onDragEnd,this)))},e.prototype.onDragStart=function(b){var d=null;3!==b.which&&(a.support.transform?(d=this.$stage.css("transform").replace(/.*\(|\)| /g,"").split(","),d={x:d[16===d.length?12:4],y:d[16===d.length?13:5]}):(d=this.$stage.position(),d={x:this.settings.rtl?d.left+this.$stage.width()-this.width()+this.settings.margin:d.left,y:d.top}),this.is("animating")&&(a.support.transform?this.animate(d.x):this.$stage.stop(),this.invalidate("position")),this.$element.toggleClass(this.options.grabClass,"mousedown"===b.type),this.speed(0),this._drag.time=(new Date).getTime(),this._drag.target=a(b.target),this._drag.stage.start=d,this._drag.stage.current=d,this._drag.pointer=this.pointer(b),a(c).on("mouseup.owl.core touchend.owl.core",a.proxy(this.onDragEnd,this)),a(c).one("mousemove.owl.core touchmove.owl.core",a.proxy(function(b){var d=this.difference(this._drag.pointer,this.pointer(b));a(c).on("mousemove.owl.core touchmove.owl.core",a.proxy(this.onDragMove,this)),Math.abs(d.x)0^this.settings.rtl?"left":"right";a(c).off(".owl.core"),this.$element.removeClass(this.options.grabClass),(0!==d.x&&this.is("dragging")||!this.is("valid"))&&(this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(this.closest(e.x,0!==d.x?f:this._drag.direction)),this.invalidate("position"),this.update(),this._drag.direction=f,(Math.abs(d.x)>3||(new Date).getTime()-this._drag.time>300)&&this._drag.target.one("click.owl.core",function(){return!1})),this.is("dragging")&&(this.leave("dragging"),this.trigger("dragged"))},e.prototype.closest=function(b,c){var e=-1,f=30,g=this.width(),h=this.coordinates();return this.settings.freeDrag||a.each(h,a.proxy(function(a,i){return"left"===c&&b>i-f&&bi-g-f&&b",h[a+1]!==d?h[a+1]:i-g)&&(e="left"===c?a+1:a),-1===e},this)),this.settings.loop||(this.op(b,">",h[this.minimum()])?e=b=this.minimum():this.op(b,"<",h[this.maximum()])&&(e=b=this.maximum())),e},e.prototype.animate=function(b){var c=this.speed()>0;this.is("animating")&&this.onTransitionEnd(),c&&(this.enter("animating"),this.trigger("translate")),a.support.transform3d&&a.support.transition?this.$stage.css({transform:"translate3d("+b+"px,0px,0px)",transition:this.speed()/1e3+"s"+(this.settings.slideTransition?" "+this.settings.slideTransition:"")}):c?this.$stage.animate({left:b+"px"},this.speed(),this.settings.fallbackEasing,a.proxy(this.onTransitionEnd,this)):this.$stage.css({left:b+"px"})},e.prototype.is=function(a){return this._states.current[a]&&this._states.current[a]>0},e.prototype.current=function(a){if(a===d)return this._current;if(0===this._items.length)return d;if(a=this.normalize(a),this._current!==a){var b=this.trigger("change",{property:{name:"position",value:a}});b.data!==d&&(a=this.normalize(b.data)),this._current=a,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})}return this._current},e.prototype.invalidate=function(b){return"string"===a.type(b)&&(this._invalidated[b]=!0,this.is("valid")&&this.leave("valid")),a.map(this._invalidated,function(a,b){return b})},e.prototype.reset=function(a){(a=this.normalize(a))!==d&&(this._speed=0,this._current=a,this.suppress(["translate","translated"]),this.animate(this.coordinates(a)),this.release(["translate","translated"]))},e.prototype.normalize=function(a,b){var c=this._items.length,e=b?0:this._clones.length;return!this.isNumeric(a)||c<1?a=d:(a<0||a>=c+e)&&(a=((a-e/2)%c+c)%c+e/2),a},e.prototype.relative=function(a){return a-=this._clones.length/2,this.normalize(a,!0)},e.prototype.maximum=function(a){var b,c,d,e=this.settings,f=this._coordinates.length;if(e.loop)f=this._clones.length/2+this._items.length-1;else if(e.autoWidth||e.merge){if(b=this._items.length)for(c=this._items[--b].width(),d=this.$element.width();b--&&!((c+=this._items[b].width()+this.settings.margin)>d););f=b+1}else f=e.center?this._items.length-1:this._items.length-e.items;return a&&(f-=this._clones.length/2),Math.max(f,0)},e.prototype.minimum=function(a){return a?0:this._clones.length/2},e.prototype.items=function(a){return a===d?this._items.slice():(a=this.normalize(a,!0),this._items[a])},e.prototype.mergers=function(a){return a===d?this._mergers.slice():(a=this.normalize(a,!0),this._mergers[a])},e.prototype.clones=function(b){var c=this._clones.length/2,e=c+this._items.length,f=function(a){return a%2==0?e+a/2:c-(a+1)/2};return b===d?a.map(this._clones,function(a,b){return f(b)}):a.map(this._clones,function(a,c){return a===b?f(c):null})},e.prototype.speed=function(a){return a!==d&&(this._speed=a),this._speed},e.prototype.coordinates=function(b){var c,e=1,f=b-1;return b===d?a.map(this._coordinates,a.proxy(function(a,b){return this.coordinates(b)},this)):(this.settings.center?(this.settings.rtl&&(e=-1,f=b+1),c=this._coordinates[b],c+=(this.width()-c+(this._coordinates[f]||0))/2*e):c=this._coordinates[f]||0,c=Math.ceil(c))},e.prototype.duration=function(a,b,c){return 0===c?0:Math.min(Math.max(Math.abs(b-a),1),6)*Math.abs(c||this.settings.smartSpeed)},e.prototype.to=function(a,b){var c=this.current(),d=null,e=a-this.relative(c),f=(e>0)-(e<0),g=this._items.length,h=this.minimum(),i=this.maximum();this.settings.loop?(!this.settings.rewind&&Math.abs(e)>g/2&&(e+=-1*f*g),a=c+e,(d=((a-h)%g+g)%g+h)!==a&&d-e<=i&&d-e>0&&(c=d-e,a=d,this.reset(c))):this.settings.rewind?(i+=1,a=(a%i+i)%i):a=Math.max(h,Math.min(i,a)),this.speed(this.duration(c,a,b)),this.current(a),this.isVisible()&&this.update()},e.prototype.next=function(a){a=a||!1,this.to(this.relative(this.current())+1,a)},e.prototype.prev=function(a){a=a||!1,this.to(this.relative(this.current())-1,a)},e.prototype.onTransitionEnd=function(a){if(a!==d&&(a.stopPropagation(),(a.target||a.srcElement||a.originalTarget)!==this.$stage.get(0)))return!1;this.leave("animating"),this.trigger("translated")},e.prototype.viewport=function(){var d;return this.options.responsiveBaseElement!==b?d=a(this.options.responsiveBaseElement).width():b.innerWidth?d=b.innerWidth:c.documentElement&&c.documentElement.clientWidth?d=c.documentElement.clientWidth:console.warn("Can not detect viewport width."),d},e.prototype.replace=function(b){this.$stage.empty(),this._items=[],b&&(b=b instanceof jQuery?b:a(b)),this.settings.nestedItemSelector&&(b=b.find("."+this.settings.nestedItemSelector)),b.filter(function(){return 1===this.nodeType}).each(a.proxy(function(a,b){b=this.prepare(b),this.$stage.append(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)},this)),this.reset(this.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate("items")},e.prototype.add=function(b,c){var e=this.relative(this._current);c=c===d?this._items.length:this.normalize(c,!0),b=b instanceof jQuery?b:a(b),this.trigger("add",{content:b,position:c}),b=this.prepare(b),0===this._items.length||c===this._items.length?(0===this._items.length&&this.$stage.append(b),0!==this._items.length&&this._items[c-1].after(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)):(this._items[c].before(b),this._items.splice(c,0,b),this._mergers.splice(c,0,1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)),this._items[e]&&this.reset(this._items[e].index()),this.invalidate("items"),this.trigger("added",{content:b,position:c})},e.prototype.remove=function(a){(a=this.normalize(a,!0))!==d&&(this.trigger("remove",{content:this._items[a],position:a}),this._items[a].remove(),this._items.splice(a,1),this._mergers.splice(a,1),this.invalidate("items"),this.trigger("removed",{content:null,position:a}))},e.prototype.preloadAutoWidthImages=function(b){b.each(a.proxy(function(b,c){this.enter("pre-loading"),c=a(c),a(new Image).one("load",a.proxy(function(a){c.attr("src",a.target.src),c.css("opacity",1),this.leave("pre-loading"),!this.is("pre-loading")&&!this.is("initializing")&&this.refresh()},this)).attr("src",c.attr("src")||c.attr("data-src")||c.attr("data-src-retina"))},this))},e.prototype.destroy=function(){this.$element.off(".owl.core"),this.$stage.off(".owl.core"),a(c).off(".owl.core"),!1!==this.settings.responsive&&(b.clearTimeout(this.resizeTimer),this.off(b,"resize",this._handlers.onThrottledResize));for(var d in this._plugins)this._plugins[d].destroy();this.$stage.children(".cloned").remove(),this.$stage.unwrap(),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$stage.remove(),this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr("class",this.$element.attr("class").replace(new RegExp(this.options.responsiveClass+"-\\S+\\s","g"),"")).removeData("owl.carousel")},e.prototype.op=function(a,b,c){var d=this.settings.rtl;switch(b){case"<":return d?a>c:a":return d?ac;case">=":return d?a<=c:a>=c;case"<=":return d?a>=c:a<=c}},e.prototype.on=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,d):a.attachEvent&&a.attachEvent("on"+b,c)},e.prototype.off=function(a,b,c,d){a.removeEventListener?a.removeEventListener(b,c,d):a.detachEvent&&a.detachEvent("on"+b,c)},e.prototype.trigger=function(b,c,d,f,g){var h={item:{count:this._items.length,index:this.current()}},i=a.camelCase(a.grep(["on",b,d],function(a){return a}).join("-").toLowerCase()),j=a.Event([b,"owl",d||"carousel"].join(".").toLowerCase(),a.extend({relatedTarget:this},h,c));return this._supress[b]||(a.each(this._plugins,function(a,b){b.onTrigger&&b.onTrigger(j)}),this.register({type:e.Type.Event,name:b}),this.$element.trigger(j),this.settings&&"function"==typeof this.settings[i]&&this.settings[i].call(this,j)),j},e.prototype.enter=function(b){a.each([b].concat(this._states.tags[b]||[]),a.proxy(function(a,b){this._states.current[b]===d&&(this._states.current[b]=0),this._states.current[b]++},this))},e.prototype.leave=function(b){a.each([b].concat(this._states.tags[b]||[]),a.proxy(function(a,b){this._states.current[b]--},this))},e.prototype.register=function(b){if(b.type===e.Type.Event){if(a.event.special[b.name]||(a.event.special[b.name]={}),!a.event.special[b.name].owl){var c=a.event.special[b.name]._default;a.event.special[b.name]._default=function(a){return!c||!c.apply||a.namespace&&-1!==a.namespace.indexOf("owl")?a.namespace&&a.namespace.indexOf("owl")>-1:c.apply(this,arguments)},a.event.special[b.name].owl=!0}}else b.type===e.Type.State&&(this._states.tags[b.name]?this._states.tags[b.name]=this._states.tags[b.name].concat(b.tags):this._states.tags[b.name]=b.tags,this._states.tags[b.name]=a.grep(this._states.tags[b.name],a.proxy(function(c,d){return a.inArray(c,this._states.tags[b.name])===d},this)))},e.prototype.suppress=function(b){a.each(b,a.proxy(function(a,b){this._supress[b]=!0},this))},e.prototype.release=function(b){a.each(b,a.proxy(function(a,b){delete this._supress[b]},this))},e.prototype.pointer=function(a){var c={x:null,y:null};return a=a.originalEvent||a||b.event,a=a.touches&&a.touches.length?a.touches[0]:a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:a,a.pageX?(c.x=a.pageX,c.y=a.pageY):(c.x=a.clientX,c.y=a.clientY),c},e.prototype.isNumeric=function(a){return!isNaN(parseFloat(a))},e.prototype.difference=function(a,b){return{x:a.x-b.x,y:a.y-b.y}},a.fn.owlCarousel=function(b){var c=Array.prototype.slice.call(arguments,1);return this.each(function(){var d=a(this),f=d.data("owl.carousel");f||(f=new e(this,"object"==typeof b&&b),d.data("owl.carousel",f),a.each(["next","prev","to","destroy","refresh","replace","add","remove"],function(b,c){f.register({type:e.Type.Event,name:c}),f.$element.on(c+".owl.carousel.core",a.proxy(function(a){a.namespace&&a.relatedTarget!==this&&(this.suppress([c]),f[c].apply(this,[].slice.call(arguments,1)),this.release([c]))},f))})),"string"==typeof b&&"_"!==b.charAt(0)&&f[b].apply(f,c)})},a.fn.owlCarousel.Constructor=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._interval=null,this._visible=null,this._handlers={"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoRefresh&&this.watch()},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={autoRefresh:!0,autoRefreshInterval:500},e.prototype.watch=function(){this._interval||(this._visible=this._core.isVisible(),this._interval=b.setInterval(a.proxy(this.refresh,this),this._core.settings.autoRefreshInterval))},e.prototype.refresh=function(){this._core.isVisible()!==this._visible&&(this._visible=!this._visible,this._core.$element.toggleClass("owl-hidden",!this._visible),this._visible&&this._core.invalidate("width")&&this._core.refresh())},e.prototype.destroy=function(){var a,c;b.clearInterval(this._interval);for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoRefresh=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel resized.owl.carousel":a.proxy(function(b){if(b.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(b.property&&"position"==b.property.name||"initialized"==b.type)){var c=this._core.settings,e=c.center&&Math.ceil(c.items/2)||c.items,f=c.center&&-1*e||0,g=(b.property&&b.property.value!==d?b.property.value:this._core.current())+f,h=this._core.clones().length,i=a.proxy(function(a,b){this.load(b)},this);for(c.lazyLoadEager>0&&(e+=c.lazyLoadEager,c.loop&&(g-=c.lazyLoadEager,e++));f++-1||(e.each(a.proxy(function(c,d){var e,f=a(d),g=b.devicePixelRatio>1&&f.attr("data-src-retina")||f.attr("data-src")||f.attr("data-srcset");this._core.trigger("load",{element:f,url:g},"lazy"),f.is("img")?f.one("load.owl.lazy",a.proxy(function(){f.css("opacity",1),this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("src",g):f.is("source")?f.one("load.owl.lazy",a.proxy(function(){this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("srcset",g):(e=new Image,e.onload=a.proxy(function(){f.css({"background-image":'url("'+g+'")',opacity:"1"}),this._core.trigger("loaded",{element:f,url:g},"lazy")},this),e.src=g)},this)),this._loaded.push(d.get(0)))},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this._core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Lazy=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(c){this._core=c,this._previousHeight=null,this._handlers={"initialized.owl.carousel refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&this.update()},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&"position"===a.property.name&&this.update()},this),"loaded.owl.lazy":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&a.element.closest("."+this._core.settings.itemClass).index()===this._core.current()&&this.update()},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers),this._intervalId=null;var d=this;a(b).on("load",function(){d._core.settings.autoHeight&&d.update()}),a(b).resize(function(){d._core.settings.autoHeight&&(null!=d._intervalId&&clearTimeout(d._intervalId),d._intervalId=setTimeout(function(){d.update()},250))})};e.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},e.prototype.update=function(){var b=this._core._current,c=b+this._core.settings.items,d=this._core.settings.lazyLoad,e=this._core.$stage.children().toArray().slice(b,c),f=[],g=0;a.each(e,function(b,c){f.push(a(c).height())}),g=Math.max.apply(null,f),g<=1&&d&&this._previousHeight&&(g=this._previousHeight),this._previousHeight=g,this._core.$stage.parent().height(g).addClass(this._core.settings.autoHeightClass)},e.prototype.destroy=function(){var a,b;for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoHeight=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._videos={},this._playing=null,this._handlers={"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.register({type:"state",name:"playing",tags:["interacting"]})},this),"resize.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.video&&this.isInFullScreen()&&a.preventDefault()},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.is("resizing")&&this._core.$stage.find(".cloned .owl-video-frame").remove()},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"===a.property.name&&this._playing&&this.stop()},this),"prepared.owl.carousel":a.proxy(function(b){if(b.namespace){var c=a(b.content).find(".owl-video");c.length&&(c.css("display","none"),this.fetch(c,a(b.content)))}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",a.proxy(function(a){this.play(a)},this))};e.Defaults={video:!1,videoHeight:!1,videoWidth:!1},e.prototype.fetch=function(a,b){var c=function(){return a.attr("data-vimeo-id")?"vimeo":a.attr("data-vzaar-id")?"vzaar":"youtube"}(),d=a.attr("data-vimeo-id")||a.attr("data-youtube-id")||a.attr("data-vzaar-id"),e=a.attr("data-width")||this._core.settings.videoWidth,f=a.attr("data-height")||this._core.settings.videoHeight,g=a.attr("href");if(!g)throw new Error("Missing video URL.");if(d=g.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/),d[3].indexOf("youtu")>-1)c="youtube";else if(d[3].indexOf("vimeo")>-1)c="vimeo";else{if(!(d[3].indexOf("vzaar")>-1))throw new Error("Video URL not supported.");c="vzaar"}d=d[6],this._videos[g]={type:c,id:d,width:e,height:f},b.attr("data-video",g),this.thumbnail(a,this._videos[g])},e.prototype.thumbnail=function(b,c){var d,e,f,g=c.width&&c.height?"width:"+c.width+"px;height:"+c.height+"px;":"",h=b.find("img"),i="src",j="",k=this._core.settings,l=function(c){e='
',d=k.lazyLoad?a("
",{class:"owl-video-tn "+j,srcType:c}):a("
",{class:"owl-video-tn",style:"opacity:1;background-image:url("+c+")"}),b.after(d),b.after(e)};if(b.wrap(a("
",{class:"owl-video-wrapper",style:g})),this._core.settings.lazyLoad&&(i="data-src",j="owl-lazy"),h.length)return l(h.attr(i)),h.remove(),!1;"youtube"===c.type?(f="//img.youtube.com/vi/"+c.id+"/hqdefault.jpg",l(f)):"vimeo"===c.type?a.ajax({type:"GET",url:"//vimeo.com/api/v2/video/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a[0].thumbnail_large,l(f)}}):"vzaar"===c.type&&a.ajax({type:"GET",url:"//vzaar.com/api/videos/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a.framegrab_url,l(f)}})},e.prototype.stop=function(){this._core.trigger("stop",null,"video"),this._playing.find(".owl-video-frame").remove(),this._playing.removeClass("owl-video-playing"),this._playing=null,this._core.leave("playing"),this._core.trigger("stopped",null,"video")},e.prototype.play=function(b){var c,d=a(b.target),e=d.closest("."+this._core.settings.itemClass),f=this._videos[e.attr("data-video")],g=f.width||"100%",h=f.height||this._core.$stage.height();this._playing||(this._core.enter("playing"),this._core.trigger("play",null,"video"),e=this._core.items(this._core.relative(e.index())),this._core.reset(e.index()),c=a(''),c.attr("height",h),c.attr("width",g),"youtube"===f.type?c.attr("src","//www.youtube.com/embed/"+f.id+"?autoplay=1&rel=0&v="+f.id):"vimeo"===f.type?c.attr("src","//player.vimeo.com/video/"+f.id+"?autoplay=1"):"vzaar"===f.type&&c.attr("src","//view.vzaar.com/"+f.id+"/player?autoplay=true"),a(c).wrap('
').insertAfter(e.find(".owl-video")),this._playing=e.addClass("owl-video-playing"))},e.prototype.isInFullScreen=function(){var b=c.fullscreenElement||c.mozFullScreenElement||c.webkitFullscreenElement;return b&&a(b).parent().hasClass("owl-video-frame")},e.prototype.destroy=function(){var a,b;this._core.$element.off("click.owl.video");for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Video=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this.core=b,this.core.options=a.extend({},e.Defaults,this.core.options),this.swapping=!0,this.previous=d,this.next=d,this.handlers={"change.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&(this.previous=this.core.current(),this.next=a.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":a.proxy(function(a){a.namespace&&(this.swapping="translated"==a.type)},this),"translate.owl.carousel":a.proxy(function(a){a.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};e.Defaults={animateOut:!1,
animateIn:!1},e.prototype.swap=function(){if(1===this.core.settings.items&&a.support.animation&&a.support.transition){this.core.speed(0);var b,c=a.proxy(this.clear,this),d=this.core.$stage.children().eq(this.previous),e=this.core.$stage.children().eq(this.next),f=this.core.settings.animateIn,g=this.core.settings.animateOut;this.core.current()!==this.previous&&(g&&(b=this.core.coordinates(this.previous)-this.core.coordinates(this.next),d.one(a.support.animation.end,c).css({left:b+"px"}).addClass("animated owl-animated-out").addClass(g)),f&&e.one(a.support.animation.end,c).addClass("animated owl-animated-in").addClass(f))}},e.prototype.clear=function(b){a(b.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.onTransitionEnd()},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Animate=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._call=null,this._time=0,this._timeout=0,this._paused=!0,this._handlers={"changed.owl.carousel":a.proxy(function(a){a.namespace&&"settings"===a.property.name?this._core.settings.autoplay?this.play():this.stop():a.namespace&&"position"===a.property.name&&this._paused&&(this._time=0)},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoplay&&this.play()},this),"play.owl.autoplay":a.proxy(function(a,b,c){a.namespace&&this.play(b,c)},this),"stop.owl.autoplay":a.proxy(function(a){a.namespace&&this.stop()},this),"mouseover.owl.autoplay":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"mouseleave.owl.autoplay":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.play()},this),"touchstart.owl.core":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"touchend.owl.core":a.proxy(function(){this._core.settings.autoplayHoverPause&&this.play()},this)},this._core.$element.on(this._handlers),this._core.options=a.extend({},e.Defaults,this._core.options)};e.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},e.prototype._next=function(d){this._call=b.setTimeout(a.proxy(this._next,this,d),this._timeout*(Math.round(this.read()/this._timeout)+1)-this.read()),this._core.is("interacting")||c.hidden||this._core.next(d||this._core.settings.autoplaySpeed)},e.prototype.read=function(){return(new Date).getTime()-this._time},e.prototype.play=function(c,d){var e;this._core.is("rotating")||this._core.enter("rotating"),c=c||this._core.settings.autoplayTimeout,e=Math.min(this._time%(this._timeout||c),c),this._paused?(this._time=this.read(),this._paused=!1):b.clearTimeout(this._call),this._time+=this.read()%c-e,this._timeout=c,this._call=b.setTimeout(a.proxy(this._next,this,d),c-e)},e.prototype.stop=function(){this._core.is("rotating")&&(this._time=0,this._paused=!0,b.clearTimeout(this._call),this._core.leave("rotating"))},e.prototype.pause=function(){this._core.is("rotating")&&!this._paused&&(this._time=this.read(),this._paused=!0,b.clearTimeout(this._call))},e.prototype.destroy=function(){var a,b;this.stop();for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.autoplay=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){"use strict";var e=function(b){this._core=b,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":a.proxy(function(b){b.namespace&&this._core.settings.dotsData&&this._templates.push(''+a(b.content).find("[data-dot]").addBack("[data-dot]").attr("data-dot")+"
")},this),"added.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,0,this._templates.pop())},this),"remove.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,1)},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&this.draw()},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&!this._initialized&&(this._core.trigger("initialize",null,"navigation"),this.initialize(),this.update(),this.draw(),this._initialized=!0,this._core.trigger("initialized",null,"navigation"))},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._initialized&&(this._core.trigger("refresh",null,"navigation"),this.update(),this.draw(),this._core.trigger("refreshed",null,"navigation"))},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers)};e.Defaults={nav:!1,navText:['‹ ','› '],navSpeed:!1,navElement:'button type="button" role="presentation"',navContainer:!1,navContainerClass:"owl-nav",navClass:["owl-prev","owl-next"],slideBy:1,dotClass:"owl-dot",dotsClass:"owl-dots",dots:!0,dotsEach:!1,dotsData:!1,dotsSpeed:!1,dotsContainer:!1},e.prototype.initialize=function(){var b,c=this._core.settings;this._controls.$relative=(c.navContainer?a(c.navContainer):a("").addClass(c.navContainerClass).appendTo(this.$element)).addClass("disabled"),this._controls.$previous=a("<"+c.navElement+">").addClass(c.navClass[0]).html(c.navText[0]).prependTo(this._controls.$relative).on("click",a.proxy(function(a){this.prev(c.navSpeed)},this)),this._controls.$next=a("<"+c.navElement+">").addClass(c.navClass[1]).html(c.navText[1]).appendTo(this._controls.$relative).on("click",a.proxy(function(a){this.next(c.navSpeed)},this)),c.dotsData||(this._templates=[a('
').addClass(c.dotClass).append(a("")).prop("outerHTML")]),this._controls.$absolute=(c.dotsContainer?a(c.dotsContainer):a("").addClass(c.dotsClass).appendTo(this.$element)).addClass("disabled"),this._controls.$absolute.on("click","button",a.proxy(function(b){var d=a(b.target).parent().is(this._controls.$absolute)?a(b.target).index():a(b.target).parent().index();b.preventDefault(),this.to(d,c.dotsSpeed)},this));for(b in this._overrides)this._core[b]=a.proxy(this[b],this)},e.prototype.destroy=function(){var a,b,c,d,e;e=this._core.settings;for(a in this._handlers)this.$element.off(a,this._handlers[a]);for(b in this._controls)"$relative"===b&&e.navContainer?this._controls[b].html(""):this._controls[b].remove();for(d in this.overides)this._core[d]=this._overrides[d];for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},e.prototype.update=function(){var a,b,c,d=this._core.clones().length/2,e=d+this._core.items().length,f=this._core.maximum(!0),g=this._core.settings,h=g.center||g.autoWidth||g.dotsData?1:g.dotsEach||g.items;if("page"!==g.slideBy&&(g.slideBy=Math.min(g.slideBy,g.items)),g.dots||"page"==g.slideBy)for(this._pages=[],a=d,b=0,c=0;a
=h||0===b){if(this._pages.push({start:Math.min(f,a-d),end:a-d+h-1}),Math.min(f,a-d)===f)break;b=0,++c}b+=this._core.mergers(this._core.relative(a))}},e.prototype.draw=function(){var b,c=this._core.settings,d=this._core.items().length<=c.items,e=this._core.relative(this._core.current()),f=c.loop||c.rewind;this._controls.$relative.toggleClass("disabled",!c.nav||d),c.nav&&(this._controls.$previous.toggleClass("disabled",!f&&e<=this._core.minimum(!0)),this._controls.$next.toggleClass("disabled",!f&&e>=this._core.maximum(!0))),this._controls.$absolute.toggleClass("disabled",!c.dots||d),c.dots&&(b=this._pages.length-this._controls.$absolute.children().length,c.dotsData&&0!==b?this._controls.$absolute.html(this._templates.join("")):b>0?this._controls.$absolute.append(new Array(b+1).join(this._templates[0])):b<0&&this._controls.$absolute.children().slice(b).remove(),this._controls.$absolute.find(".active").removeClass("active"),this._controls.$absolute.children().eq(a.inArray(this.current(),this._pages)).addClass("active"))},e.prototype.onTrigger=function(b){var c=this._core.settings;b.page={index:a.inArray(this.current(),this._pages),count:this._pages.length,size:c&&(c.center||c.autoWidth||c.dotsData?1:c.dotsEach||c.items)}},e.prototype.current=function(){var b=this._core.relative(this._core.current());return a.grep(this._pages,a.proxy(function(a,c){return a.start<=b&&a.end>=b},this)).pop()},e.prototype.getPosition=function(b){var c,d,e=this._core.settings;return"page"==e.slideBy?(c=a.inArray(this.current(),this._pages),d=this._pages.length,b?++c:--c,c=this._pages[(c%d+d)%d].start):(c=this._core.relative(this._core.current()),d=this._core.items().length,b?c+=e.slideBy:c-=e.slideBy),c},e.prototype.next=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!0),b)},e.prototype.prev=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!1),b)},e.prototype.to=function(b,c,d){var e;!d&&this._pages.length?(e=this._pages.length,a.proxy(this._overrides.to,this._core)(this._pages[(b%e+e)%e].start,c)):a.proxy(this._overrides.to,this._core)(b,c)},a.fn.owlCarousel.Constructor.Plugins.Navigation=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){"use strict";var e=function(c){this._core=c,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":a.proxy(function(c){c.namespace&&"URLHash"===this._core.settings.startPosition&&a(b).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":a.proxy(function(b){if(b.namespace){var c=a(b.content).find("[data-hash]").addBack("[data-hash]").attr("data-hash");if(!c)return;this._hashes[c]=b.content}},this),"changed.owl.carousel":a.proxy(function(c){if(c.namespace&&"position"===c.property.name){var d=this._core.items(this._core.relative(this._core.current())),e=a.map(this._hashes,function(a,b){return a===d?b:null}).join();if(!e||b.location.hash.slice(1)===e)return;b.location.hash=e}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers),a(b).on("hashchange.owl.navigation",a.proxy(function(a){var c=b.location.hash.substring(1),e=this._core.$stage.children(),f=this._hashes[c]&&e.index(this._hashes[c]);f!==d&&f!==this._core.current()&&this._core.to(this._core.relative(f),!1,!0)},this))};e.Defaults={URLhashListener:!1},e.prototype.destroy=function(){var c,d;a(b).off("hashchange.owl.navigation");for(c in this._handlers)this._core.$element.off(c,this._handlers[c]);for(d in Object.getOwnPropertyNames(this))"function"!=typeof this[d]&&(this[d]=null)},a.fn.owlCarousel.Constructor.Plugins.Hash=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){function e(b,c){var e=!1,f=b.charAt(0).toUpperCase()+b.slice(1);return a.each((b+" "+h.join(f+" ")+f).split(" "),function(a,b){if(g[b]!==d)return e=!c||b,!1}),e}function f(a){return e(a,!0)}var g=a("").get(0).style,h="Webkit Moz O ms".split(" "),i={transition:{end:{WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}},animation:{end:{WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",OAnimation:"oAnimationEnd",animation:"animationend"}}},j={csstransforms:function(){return!!e("transform")},csstransforms3d:function(){return!!e("perspective")},csstransitions:function(){return!!e("transition")},cssanimations:function(){return!!e("animation")}};j.csstransitions()&&(a.support.transition=new String(f("transition")),a.support.transition.end=i.transition.end[a.support.transition]),j.cssanimations()&&(a.support.animation=new String(f("animation")),a.support.animation.end=i.animation.end[a.support.animation]),j.csstransforms()&&(a.support.transform=new String(f("transform")),a.support.transform3d=j.csstransforms3d())}(window.Zepto||window.jQuery,window,document);$(document).ready(function()
{
$('.mtt').hover(function(){
var title = $(this).attr('title');
$(this).data('tipText', title).removeAttr('title');
$('
')
.text(title)
.appendTo('body')
.fadeIn('slow');
}, function() {
$(this).attr('title', $(this).data('tipText'));
$('.tooltip1').remove();
}).mousemove(function(e) {
var mousex = e.pageX + 26;
var mousey = e.pageY + 26;
$('.tooltip1')
.css({ top: mousey, left: mousex })
});
$('.mtt2').hover(function(){
var title = $(this).attr('title');
$(this).data('tipText', title).removeAttr('title');
$('
') //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
.text(title)
.appendTo('body')
.fadeIn('slow');
}, function() {
$(this).attr('title', $(this).data('tipText'));
$('.tooltip2').remove();
}).mousemove(function(e) {
var mousex = e.pageX + 26;
var mousey = e.pageY + 26;
$('.tooltip2')
.css({ top: mousey, right: mousex })
});
});var agregue_clase_scroll=false;
var tope_actual = -1;
$(window).scroll(
function()
{
if ($(this).scrollTop() > 666)
{
$('.subir').fadeIn("slow");
}else{
$('.subir').fadeOut("slow");
}
if ($(this).scrollTop() < 1){$('div.gencont1').removeClass("gencont1_on");}
if ($(this).scrollTop() > 1 && $("body").height() >= $(window).height()){$('div.gencont1').addClass("gencont1_on");}
if ($(this).scrollTop() == 0){$('div.gencont1').removeClass("gencont1_on");}
//if ($(this).scrollTop() == 0){$('div.gencont2').removeClass("gencont2_on");}
}
);
function scrollToAnchor(aid)
{
var aTag = $("a[name='"+ aid +"']");
$('html,body').animate({scrollTop: aTag.offset().top},'slow');
}
function encajar_img( w_scr, h_scr, w_img, h_img )
{
var r_img = w_img / h_img;
var r_scr = w_scr / h_scr;
var w, h;
if ( w_img <= w_scr && h_img <= h_scr )
{
w = w_img;
h = h_img;
}
else
{
if ( r_scr > r_img )
{
w = w_img * h_scr / h_img;
h = h_scr;
}
else
{
w = w_scr;
h = h_img * w_scr / w_img;
}
}
w = parseInt( w );
h = parseInt( h );
return [ w, h ];
}
var ALTO_BANNER_SUSCRIPCION = 0; //50;
function getScrollbarWidth()
{
const outer = document.createElement('div');
outer.style.visibility = 'hidden';
outer.style.overflow = 'scroll';
outer.style.msOverflowStyle = 'scrollbar';
document.body.appendChild(outer);
const inner = document.createElement('div');
outer.appendChild(inner);
const scrollbarWidth = (outer.offsetWidth - inner.offsetWidth);
outer.parentNode.removeChild(outer);
return scrollbarWidth;
}
function vert_scrollbar_visible()
{
return $(document).height() > $(window).height()
}
function posicionar_super_banner( SBIMG, winW, winH )
{
var $img = $( SBIMG );
var $cont = $img.closest( "#banner_super" );
var $caja = $cont.parent();
var alto_extra = 0;
$caja.children().each(function( i, v ){
v = $(v);
if ( v.is( $cont ) || v.hasClass( "cerrar" ) )
return;
alto_extra += v.outerHeight( true ) || 0;
});
var disp_w = winW * 0.95;
var disp_h = ( winH * 0.95 ) - alto_extra;
if ( vert_scrollbar_visible() )
disp_w -= getScrollbarWidth();
if ( disp_w < 80 ) disp_w = 80;
if ( disp_h < 80 ) disp_h = 80;
var fix = encajar_img( disp_w, disp_h, SBIMG.naturalWidth, SBIMG.naturalHeight );
var ancho_imagen = parseInt( fix[0] );
SBIMG.style.width = ancho_imagen + "px";
SBIMG.style.height = "auto";
$caja.children().each(function( i, v ){
v = $(v);
if ( v.is( $cont ) || v.hasClass( "cerrar" ) )
return;
v.css( "width", ancho_imagen + "px" );
});
}
function desplegar_super_banner_resize( SBIMG, winW, winH )
{
var id = '#bs_dialog';
var id2 = '#banner_super_mask';
var id3 = '#banner_super_cont';
posicionar_super_banner( SBIMG, winW, winH );
$(id ).fadeTo("slow",1 );
$(id2).fadeTo("slow",0.5);
function bs_cerrar()
{
if ( bs_cerrado ) return;
bs_cerrado = true; if ( bs_timer ) { clearInterval( bs_timer ); bs_timer = null; }
$(document).off("keydown.bs");
$(id ).css("transition","none").fadeOut(400,function(){ $(this).css("transition",""); });
$(id2).fadeOut(400);
}
$('.bs_window .bs_close').off("click");
$('.bs_window .bs_close').click(function(e){
e.preventDefault();
bs_cerrar();
});
$(id).off("click.bs");
$(id).on("click.bs", function(e){
if ( e.target === this ) bs_cerrar();
});
$('#banner_super_mask').off("click");
$('#banner_super_mask').click(function(e){
e.preventDefault();
bs_cerrar();
});
$(document).off("keydown.bs");
$(document).on("keydown.bs", function(e){
if ( e.key === "Escape" || e.keyCode === 27 ) bs_cerrar();
});
}
var last_src = null;
var last_winW = -1;
var last_winH = -1;
var bs_cerrado = false; // el usuario ya lo cerro: no volver a mostrarlo
var bs_timer = null; // id del setInterval, para poder cancelarlo
function get_SBIMG()
{
var SB = getObj("banner_super");
if ( ! SB )
return null;
var SBIMG = SB.getElementsByTagName("IMG")[0];
return SBIMG;
}
function img_ok( img )
{
if ( ! img )
return false;
if ( ! img.complete ||
img.naturalWidth === 0 ||
img.naturalHeight === 0 )
return false;
return true;
}
var BS_DELAY = 1500;
function desplegar_super_banner()
{
setTimeout( desplegar_super_banner_ahora, BS_DELAY );
}
function desplegar_super_banner_ahora()
{
if ( bs_cerrado ) return;
if ( bs_timer ) clearInterval( bs_timer );
bs_timer = setInterval(
function()
{
if ( bs_cerrado ) { clearInterval( bs_timer ); bs_timer = null; return; }
var SBIMG = get_SBIMG();
if ( ! img_ok( SBIMG ) )
return;
var cur_src = SBIMG.src;
var cur_winW = $(window).width();
var cur_winH = $(window).height();
if ( cur_src != last_src ||
cur_winW != last_winW ||
cur_winH != last_winH )
{
if ( cur_src != last_src )
desplegar_super_banner_resize( SBIMG, cur_winW, cur_winH );
else
bs_reubicar();
last_src = cur_src;
last_winW = cur_winW;
last_winH = cur_winH;
}
},
500
);
}
var bs_resize_t = null;
function bs_reubicar()
{
if ( bs_cerrado ) return;
var SBIMG = get_SBIMG();
if ( ! img_ok( SBIMG ) )
return;
var winW = $(window).width();
var winH = $(window).height();
var id = $("#bs_dialog");
var tr = id.css("transition");
id.css("transition","none");
posicionar_super_banner( SBIMG, winW, winH );
last_winW = winW;
last_winH = winH;
id[0].offsetHeight;
id.css("transition",tr);
}
$(window).resize(function()
{
if ( bs_cerrado ) return;
if ( bs_resize_t ) clearTimeout( bs_resize_t );
bs_resize_t = setTimeout( bs_reubicar, 120 );
});
jQuery(document).ready(function()
{
$("#go_top").click(function(){
$("html, body").animate({scrollTop:0}, 500);
return false;
});
});
(function ($){
$.fn.countTo = function (options){
options = options || {};
return $(this).each(function (){
var settings = $.extend({}, $.fn.countTo.defaults,{
from: $(this).data('from'),
to: $(this).data('to'),
speed: $(this).data('speed'),
refreshInterval:$(this).data('refresh-interval'),
decimals: $(this).data('decimals')
}, options);
var loops = Math.ceil(settings.speed / settings.refreshInterval),
increment = (settings.to - settings.from) / loops;
var self = this,
$self = $(this),
loopCount = 0,
value = settings.from,
data = $self.data('countTo') || {};
$self.data('countTo', data);
if (data.interval){clearInterval(data.interval);}
data.interval = setInterval(updateTimer, settings.refreshInterval);
render(value);
function updateTimer(){
value += increment;
loopCount++;
render(value);
if (typeof(settings.onUpdate) == 'function'){settings.onUpdate.call(self, value);}
if (loopCount >= loops){
$self.removeData('countTo');
clearInterval(data.interval);
value = settings.to;
if (typeof(settings.onComplete) == 'function'){settings.onComplete.call(self, value);}
}
}
function render(value){
var formattedValue = settings.formatter.call(self, value, settings);
$self.html(formattedValue);
}
});
};
$.fn.countTo.defaults={
from:0,
to:0,
speed:1000,
refreshInterval:100,
decimals:0,
formatter:formatter,
onUpdate:null,
onComplete:null
};
function formatter(value, settings){return value.toFixed(settings.decimals);}
}(jQuery));
jQuery(function ($){
$('.count-number').data('countToOptions',{
formatter:function (value, options){
return value.toFixed(options.decimals).replace(/\B(?=(?:\d{3})+(?!\d))/g, ',');
}
});
$('.timer').each(count);
function count(options){
var $this = $(this);
options = $.extend({}, options || {}, $this.data('countToOptions') || {});
$this.countTo(options);
}
});
jQuery(document).ready(function(){
jQuery('.banner_elementos').addClass("hidden").viewportChecker({classToAdd:'animate__animated animate__fadeInLeft',classToAddForFullView:'full-visible',offset:100});jQuery('.foto').addClass("hidden").viewportChecker({classToAdd:'animate__animated animate__fadeIn',classToAddForFullView:'full-visible',offset:100});});/*jslint browser:true, plusplus:true, vars:true */
/*jshint browser:true, jquery:true */
/*jshint -W040:false */ /* to don't alert on "this" in triggerLoadOrError */
(function ($, window, document, undefined) {
'use strict';
// options
var lazyLoadXT = 'lazyLoadXT',
dataLazied = 'lazied',
load_error = 'load error',
classLazyHidden = 'lazy-hidden',
docElement = document.documentElement || document.body,
// force load all images in Opera Mini and some mobile browsers without scroll event or getBoundingClientRect()
forceLoad = (window.onscroll === undefined || !!window.operamini || !docElement.getBoundingClientRect),
options = {
autoInit: true, // auto initialize in $.ready
selector: 'img[data-src]', // selector for lazyloading elements
blankImage: 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7',
throttle: 99, // interval (ms) for changes check
forceLoad: forceLoad, // force auto load all images
loadEvent: 'pageshow', // check AJAX-loaded content in jQueryMobile
updateEvent: 'load orientationchange resize scroll touchmove focus', // page-modified events
forceEvent: 'lazyloadall', // force loading of all elements
//onstart: null,
oninit: {removeClass: 'lazy'}, // init handler
onshow: {addClass: classLazyHidden}, // start loading handler
onload: {removeClass: classLazyHidden, addClass: 'lazy-loaded'}, // load success handler
onerror: {removeClass: classLazyHidden}, // error handler
//oncomplete: null, // complete handler
//scrollContainer: undefined,
checkDuplicates: true
},
elementOptions = {
srcAttr: 'data-src',
edgeX: 0,
edgeY: 0,
visibleOnly: true
},
$window = $(window),
$isFunction = $.isFunction,
$extend = $.extend,
$data = $.data || function (el, name) {
return $(el).data(name);
},
elements = [],
topLazy = 0,
/*
waitingMode=0 : no setTimeout
waitingMode=1 : setTimeout, no deferred events
waitingMode=2 : setTimeout, deferred events
*/
waitingMode = 0;
$[lazyLoadXT] = $extend(options, elementOptions, $[lazyLoadXT]);
/**
* Return options.prop if obj.prop is undefined, otherwise return obj.prop
* @param {*} obj
* @param {*} prop
* @returns *
*/
function getOrDef(obj, prop) {
return obj[prop] === undefined ? options[prop] : obj[prop];
}
/**
* @returns {number}
*/
function scrollTop() {
var scroll = window.pageYOffset;
return (scroll === undefined) ? docElement.scrollTop : scroll;
}
/**
* Add new elements to lazy-load list:
* $(elements).lazyLoadXT() or $(window).lazyLoadXT()
*
* @param {object} [overrides] override global options
*/
$.fn[lazyLoadXT] = function (overrides) {
overrides = overrides || {};
var blankImage = getOrDef(overrides, 'blankImage'),
checkDuplicates = getOrDef(overrides, 'checkDuplicates'),
scrollContainer = getOrDef(overrides, 'scrollContainer'),
forceShow = getOrDef(overrides, 'show'),
elementOptionsOverrides = {},
prop;
// empty overrides.scrollContainer is supported by both jQuery and Zepto
$(scrollContainer).on('scroll', queueCheckLazyElements);
for (prop in elementOptions) {
elementOptionsOverrides[prop] = getOrDef(overrides, prop);
}
return this.each(function (index, el) {
if (el === window) {
$(options.selector).lazyLoadXT(overrides);
} else {
var duplicate = checkDuplicates && $data(el, dataLazied),
$el = $(el).data(dataLazied, forceShow ? -1 : 1);
// prevent duplicates
if (duplicate) {
queueCheckLazyElements();
return;
}
if (blankImage && el.tagName === 'IMG' && !el.src) {
el.src = blankImage;
}
// clone elementOptionsOverrides object
$el[lazyLoadXT] = $extend({}, elementOptionsOverrides);
triggerEvent('init', $el);
elements.push($el);
queueCheckLazyElements();
}
});
};
/**
* Process function/object event handler
* @param {string} event suffix
* @param {jQuery} $el
*/
function triggerEvent(event, $el) {
var handler = options['on' + event];
if (handler) {
if ($isFunction(handler)) {
handler.call($el[0]);
} else {
if (handler.addClass) {
$el.addClass(handler.addClass);
}
if (handler.removeClass) {
$el.removeClass(handler.removeClass);
}
}
}
$el.trigger('lazy' + event, [$el]);
// queue next check as images may be resized after loading of actual file
queueCheckLazyElements();
}
/**
* Trigger onload/onerror handler
* @param {Event} e
*/
function triggerLoadOrError(e) {
triggerEvent(e.type, $(this).off(load_error, triggerLoadOrError));
}
/**
* Load visible elements
* @param {bool} [force] loading of all elements
*/
function checkLazyElements(force) {
if (!elements.length) {
return;
}
force = force || options.forceLoad;
topLazy = Infinity;
var viewportTop = scrollTop(),
viewportHeight = window.innerHeight || docElement.clientHeight,
viewportWidth = window.innerWidth || docElement.clientWidth,
i,
length;
for (i = 0, length = elements.length; i < length; i++) {
var $el = elements[i],
el = $el[0],
objData = $el[lazyLoadXT],
removeNode = false,
visible = force || $data(el, dataLazied) < 0,
topEdge;
// remove items that are not in DOM
if (!$.contains(docElement, el)) {
removeNode = true;
} else if (force || !objData.visibleOnly || el.offsetWidth || el.offsetHeight) {
if (!visible) {
var elPos = el.getBoundingClientRect(),
edgeX = objData.edgeX,
edgeY = objData.edgeY;
topEdge = (elPos.top + viewportTop - edgeY) - viewportHeight;
visible = (topEdge <= viewportTop && elPos.bottom > -edgeY &&
elPos.left <= viewportWidth + edgeX && elPos.right > -edgeX);
}
if (visible) {
$el.on(load_error, triggerLoadOrError);
triggerEvent('show', $el);
var srcAttr = objData.srcAttr,
src = $isFunction(srcAttr) ? srcAttr($el) : el.getAttribute(srcAttr);
if (src) {
el.src = src;
}
removeNode = true;
} else {
if (topEdge < topLazy) {
topLazy = topEdge;
}
}
}
if (removeNode) {
$data(el, dataLazied, 0);
elements.splice(i--, 1);
length--;
}
}
if (!length) {
triggerEvent('complete', $(docElement));
}
}
/**
* Run check of lazy elements after timeout
*/
function timeoutLazyElements() {
if (waitingMode > 1) {
waitingMode = 1;
checkLazyElements();
setTimeout(timeoutLazyElements, options.throttle);
} else {
waitingMode = 0;
}
}
/**
* Queue check of lazy elements because of event e
* @param {Event} [e]
*/
function queueCheckLazyElements(e) {
if (!elements.length) {
return;
}
// fast check for scroll event without new visible elements
if (e && e.type === 'scroll' && e.currentTarget === window) {
if (topLazy >= scrollTop()) {
return;
}
}
if (!waitingMode) {
setTimeout(timeoutLazyElements, 0);
}
waitingMode = 2;
}
/**
* Initialize list of hidden elements
*/
function initLazyElements() {
$window.lazyLoadXT();
}
/**
* Loading of all elements
*/
function forceLoadAll() {
checkLazyElements(true);
}
/**
* Initialization
*/
$(document).ready(function () {
triggerEvent('start', $window);
$window
.on(options.updateEvent, queueCheckLazyElements)
.on(options.forceEvent, forceLoadAll);
$(document).on(options.updateEvent, queueCheckLazyElements);
if (options.autoInit) {
$window.on(options.loadEvent, initLazyElements);
initLazyElements(); // standard initialization
}
});
})(window.jQuery || window.Zepto || window.$, window, document);var responsivelyLazy="undefined"!==typeof responsivelyLazy?responsivelyLazy:function(){var r=!1,t=!1,l=null,p=null,m="undefined"!==typeof IntersectionObserver,q=!1,u=[],v=function(a){if(null===l)return!1;var b=a.getBoundingClientRect();a=b.top;var c=b.left,d=b.width,b=b.height;return ab[1])return 1;if(a[1]===b[1]){if(-1!==b[0].indexOf(".webp",b[0].length-5))return 1;if(-1!==a[0].indexOf(".webp",a[0].length-5))return-1}return 0});c=d}else c=[];else c=[];k=a.offsetWidth*("undefined"!==typeof window.devicePixelRatio?window.devicePixelRatio:1);d=null;h=c.length;for(f=0;f=k){d=e;break}null===d&&(d=[b.getAttribute("src"),
999999]);"undefined"===typeof a.responsivelyLazyLastSetOption&&(a.responsivelyLazyLastSetOption=["",0]);a.responsivelyLazyLastSetOption[1]