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 stocks[i] != "undefined") {
if (getObj("btn_agregar_cart"+prod)!=null) {
if (stocks[i]>0) {
if (document.getElementById("producto_agotado")!=null)
document.getElementById("producto_agotado").style.display="none";
if (getObj("btn_agregar_cart"+prod)!=null)
document.getElementById("btn_agregar_cart"+prod).innerHTML="Comprar";
} else {
if (document.getElementById("producto_agotado")!=null)
document.getElementById("producto_agotado").style.display="";
if (getObj("btn_agregar_cart"+prod)!=null)
document.getElementById("btn_agregar_cart"+prod).innerHTML="Consultar";
}
}
}
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=wwwdigistarcomuyR6382&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;
}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(B){var X={topLeft:["top","left"],top:["top","center"],topRight:["top","right"],bottomLeft:["bottom","left"],bottom:["bottom","center"],bottomRight:["bottom","right"],leftTop:["left","top"],left:["left","center"],leftBottom:["left","bottom"],rightTop:["right","top"],right:["right","center"],rightBottom:["right","bottom"]};var r={fade:["vCover","fade"],zoomIn:["vCover","zoom"],zoomOut:["vCover","zoom"],coverDown:["vCover","sliceDown"],coverUp:["vCover","sliceUp"],coverRight:["hCover","sliceRight"],coverLeft:["hCover","sliceLeft"],blockExpandDown:["blocks","expand"],blockExpandUp:["blocks","expand"],blockExpandRight:["blocks","expand"],blockExpandLeft:["blocks","expand"],diagonalFade:["blocks","diagonalFade"],reverseDiagonalFade:["blocks","diagonalFade"],diagonalExpand:["blocks","diagonalExpand"],reverseDiagonalExpand:["blocks","diagonalExpand"],diagonalShift:["blocks","diagonalShift"],reverseDiagonalShift:["blocks","diagonalShift"],blockRandomFade:["blocks","randomEffect"],blockRandomExpand:["blocks","randomEffect"],blockRandomDrop:["blocks","randomEffect"],zigZagDown:["blocks","zigZag"],zigZagUp:["blocks","zigZag"],zigZagRight:["blocks","zigZag"],zigZagLeft:["blocks","zigZag"],spiralIn:["blocks","spiral"],spiralOut:["blocks","spiral"],sliceDownRight:["vSlices","sliceDown"],sliceDownLeft:["vSlices","sliceDown"],sliceDownRandom:["vSlices","sliceDown"],sliceUpRight:["vSlices","sliceUp"],sliceUpLeft:["vSlices","sliceUp"],sliceUpRandom:["vSlices","sliceUp"],sliceFadeRight:["vSlices","fade"],sliceFadeLeft:["vSlices","fade"],verticalRandomFade:["vSlices","fade"],sliceAltRight:["vSlices","sliceAlt"],sliceAltLeft:["vSlices","sliceAlt"],blindsRight:["vSlices","blinds"],blindsLeft:["vSlices","blinds"],verticalRandomBlinds:["vSlices","blinds"],sliceMoveRight:["vSlices","move"],sliceMoveLeft:["vSlices","move"],sliceRightDown:["hSlices","sliceRight"],sliceRightUp:["hSlices","sliceRight"],sliceRightRandom:["hSlices","sliceRight"],sliceLeftDown:["hSlices","sliceLeft"],sliceLeftUp:["hSlices","sliceLeft"],sliceLeftRandom:["hSlices","sliceLeft"],sliceFadeDown:["hSlices","fade"],sliceFadeUp:["hSlices","fade"],horizontalRandomFade:["hSlices","fade"],sliceAltDown:["hSlices","sliceAlt"],sliceAltUp:["hSlices","sliceAlt"],blindsDown:["hSlices","blinds"],blindsUp:["hSlices","blinds"],horizontalRandomBlinds:["hSlices","blinds"],sliceMoveDown:["hSlices","move"],sliceMoveUp:["hSlices","move"],horizontalSlide:["hSlide","slide"],verticalSlide:["vSlide","slide"]};var V="ontouchstart" in window;var s=a();var t=a(6);var f=q(2.9);var v=J();var Q=500;var h=50;var E="updateThumbnails";var b="resizeControlPanel";var d="updateSize";var x="rotator";var e="rotatorInit";var k="rotatorSlideChange";var U="rotatorSlideComplete";var L="rotatorFirst";var z="rotatorLast";var P="rotatorPlay";var w="rotatorPause";var R="rotatorPrevious";var o="rotatorNext";var O={linear:"linear","":"ease",swing:"ease",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out",easeInQuad:"cubic-bezier(.55,.085,.68,.53)",easeOutQuad:"cubic-bezier(.25,.46,.45,.94)",easeInOutQuad:"cubic-bezier(.455,.03,.515,.955)",easeInCubic:"cubic-bezier(.55,.055,.675,.19)",easeOutCubic:"cubic-bezier(.215,.61,.355,1)",easeInOutCubic:"cubic-bezier(.645,.045,.355,1)",easeInQuart:"cubic-bezier(.895,.03,.685,.22)",easeOutQuart:"cubic-bezier(.165,.84,.44,1)",easeInOutQuart:"cubic-bezier(.77,0,.175,1)",easeInQuint:"cubic-bezier(.755,.05,.855,.06)",easeOutQuint:"cubic-bezier(.23,1,.32,1)",easeInOutQuint:"cubic-bezier(.86,0,.07,1)",easeInSine:"cubic-bezier(.47,0,.745,.715)",easeOutSine:"cubic-bezier(.39,.575,.565,1)",easeInOutSine:"cubic-bezier(.445,.05,.55,.95)",easeInExpo:"cubic-bezier(.95,.05,.795,.035)",easeOutExpo:"cubic-bezier(.19,1,.22,1)",easeInOutExpo:"cubic-bezier(1,0,0,1)",easeInCirc:"cubic-bezier(.6,.04,.98,.335)",easeOutCirc:"cubic-bezier(.075,.82,.165,1)",easeInOutCirc:"cubic-bezier(.785,.135,.15,.86)",easeInBack:"cubic-bezier(.60,-.28,.735,.045)",easeOutBack:"cubic-bezier(.175,.885,.32,1.275)",easeInOutBack:"cubic-bezier(.68,-.55,.265,1.55)"};m("transform");m("transition");m("backgroundSize");m("borderRadius");var g;var S;switch(B.support.transition){case"WebkitTransition":g="-webkit-transition";S="webkitTransitionEnd";break;case"MozTransition":g="-moz-transition";S="transitionend";break;case"OTransition":g="-o-transition";S="oTransitionEnd";break;default:g="transition";S="transitionend";break}function y(Z,ab){this._$timer=B("").addClass("br-bar-timer");var aa=H(X[ab],X.top);this._$timer.addClass("bottom"===aa[0]?"br-bottom":"br-top");Z.append(this._$timer)}y.prototype={start:function(Z){this._$timer.animate({width:"101%"},{duration:Z,easing:"linear",queue:false})},stop:function(){this._$timer.stop().width(0)},pause:function(){this._$timer.stop()}};function Y(Z,ab){this._$timer=B('');var aa=H(X[ab],X.topRight);this._$timer.css(aa[0],0).css(aa[1],0).addClass("br-opacity-transition");this._$left=this._$timer.find(">.br-lside .br-rotate");this._$right=this._$timer.find(">.br-rside .br-rotate");this._elapsed=this._delay=0;this._startTime;Z.append(this._$timer)}Y.prototype={start:function(Z){if(0===this._delay){this._delay=Z;this._$timer.addClass("br-opacity");this._$left.add(this._$right).stopTransition(true).css({transform:"rotateZ(0deg)"})}var aa=this._delay/2;this._startTime=(new Date()).getTime();this._$right.transition({transform:"rotateZ(180deg)"},Math.max(aa-this._elapsed,0),"linear",B.proxy(function(){var ab=Math.max(aa-Math.max(this._elapsed-aa,0),0);this._$left.transition({transform:"rotateZ(180deg)"},ab,"linear")},this))},stop:function(){this._elapsed=this._delay=0;this._$left.add(this._$right).stopTransition(true).css({transform:"rotateZ(180deg)"});this._$timer.removeClass("br-opacity")},pause:function(){this._$left.add(this._$right).stopTransition(true);this._elapsed+=(new Date()).getTime()-this._startTime;var aa=this._elapsed/this._delay,Z=aa*360;if(aa<=0.5){this._$right.css({transform:"rotateZ("+Z+"deg)"})}else{this._$left.css({transform:"rotateZ("+(Z-180)+"deg)"})}}};function n(aa,Z){this._parent=aa;this._intervalId=null;this._delay=Z}n.prototype={create:function(Z){var aa=this._total,ab="",ac=this._parent._$screen.find(">.br-effects");while(aa--){ab+=''}ac.append(ab);$el=ac.children("."+Z).slice(-this._total);$el.css({backgroundColor:this._parent._$screen.css("backgroundColor")});if(f){$el.css("backface-visibility","visible")}return $el},clear:function(){clearInterval(this._intervalId);this._$el.stopTransition(true,false).css({visibility:"hidden"});this._parent._inProgress=false},resize:function(Z){this.clear();this._width=Math.ceil(this._$el.data("width")*Z);this._height=Math.ceil(this._$el.data("height")*Z)},setImage:function(Z,aa){Z.find(">img").remove();Z.append(B('
').css({top:aa.css("top"),left:aa.css("left"),width:aa.width(),height:aa.height()}))},setBgImage:function(Z,aa){Z.css({backgroundImage:"url("+aa.attr("src")+")",backgroundSize:aa.css("width")+" "+aa.css("height"),backgroundPosition:aa.css("left")+" "+aa.css("top")})},animate:function(ad,aa,ac,ae){var Z=0,ab=this._total-1;this._intervalId=setInterval(B.proxy(function(){if(Z!==ab){B(ad[Z]).transition(aa,ac,ae)}else{B(ad[Z]).transition(aa,ac,ae,B.proxy(function(){this._parent.displayCurrent();this._$el.css({visibility:"hidden"})},this))}if(++Z==this._total){clearInterval(this._intervalId)}},this),this._delay)}};N.prototype=new n();N.prototype.constructor=N;function N(ab,Z){n.call(this,ab,0);this._cssTransform=this._parent._cssTransform;this._orientation=Z;this._total=1;var aa;if("vertical"===this._orientation){this._position="top";aa="br-vslide"}else{this._position="left";aa="br-hslide"}this._$el=this.create(aa).append("");this._$slides=this._$el.children()}N.prototype.slide=function(ag,ai,ac,ad){var Z,af,ae={},ab=this._parent._$prevItem.find(">img.br-main-img"),ah,aa;if("vertical"===this._orientation){ah=-this._$slides.height();aa="translateY"}else{ah=-this._$slides.width();aa="translateX"}if(this._parent._backward){af=this._$slides.first();Z=this._$slides.last();if(this._cssTransform){this._$el.css({transform:aa+"("+ah+"px)"});ae.transform=aa+"(0)"}else{this._$el.css(this._position,ah);ae[this._position]=0}}else{af=this._$slides.last();Z=this._$slides.first();if(this._cssTransform){this._$el.css({transform:aa+"(0)"});ae.transform=aa+"("+ah+"px)"}else{this._$el.css(this._position,0);ae[this._position]=ah}}if(B.support.backgroundSize){this.setBgImage(Z,ab);this.setBgImage(af,ag)}else{this.setImage(Z,ab);this.setImage(af,ag)}if(v){setTimeout(B.proxy(function(){this._$el.css({visibility:"visible"});this._parent._$items.css({visibility:"hidden"});this.animate(this._$el.toArray(),ae,ac,ad)},this),1)}else{this._$el.css({visibility:"visible"});this._parent._$items.css({visibility:"hidden"});this.animate(this._$el.toArray(),ae,ac,ad)}};W.prototype=new n();W.prototype.constructor=W;function W(aa,ab,Z){n.call(this,aa,Z);this._cssTransform=this._parent._cssTransform;this._total=ab;this._width=Math.ceil(this._parent._stageWidth/this._total);this._$el=this.create("br-vslice").data({width:this._width})}W.prototype.sliceDown=function(Z,aa,ab,ad){var ac=this._$el.toArray();if("sliceDownLeft"===aa){ac.reverse()}else{if("sliceDownRandom"===aa){p(ac)}}if(this._cssTransform){this.set(Z,{transform:"translateY(-100%)"});this.animate(ac,{transform:"translateY(0)"},ab,ad)}else{this.set(Z,{top:-this._$el.height()});this.animate(ac,{top:0},ab,ad)}};W.prototype.sliceUp=function(Z,aa,ab,ad){var ac=this._$el.toArray();if("sliceUpLeft"===aa){ac.reverse()}else{if("sliceUpRandom"===aa){p(ac)}}if(this._cssTransform){this.set(Z,{transform:"translateY(100%)"});this.animate(ac,{transform:"translateY(0)"},ab,ad)}else{this.set(Z,{top:this._$el.height()});this.animate(ac,{top:0},ab,ad)}};W.prototype.sliceAlt=function(Z,aa,ab,ad){var ac=this._$el.toArray();if("sliceAltLeft"===aa){ac.reverse()}if(this._cssTransform){this.set(Z,{transform:"translateY(-100%)"});this._$el.filter(":odd").css({transform:"translateY(100%)"});this.animate(ac,{transform:"translateY(0)"},ab,ad)}else{this.set(Z,{top:-this._$el.height()});this._$el.filter(":odd").css({top:this._$el.height()});this.animate(ac,{top:0},ab,ad)}};W.prototype.blinds=function(Z,aa,ab,ad){this.set(Z,{width:0});var ac=this._$el.toArray();if("blindsLeft"===aa){ac.reverse()}else{if("verticalRandomBlinds"===aa){p(ac)}}this.animate(ac,{width:this._width+"px"},ab,ad)};W.prototype.fade=function(Z,aa,ab,ad){this.set(Z,{opacity:0});var ac=this._$el.toArray();if("sliceFadeLeft"===aa){ac.reverse()}else{if("verticalRandomFade"===aa){p(ac)}}this.animate(ac,{opacity:1},ab,ad)};W.prototype.move=function(Z,ab,ac,ae){var ad=this._$el.toArray(),aa=this._$el.parent().width();if("sliceMoveRight"===ab){ad.reverse();aa*=-1}if(this._cssTransform){this.set(Z,{transform:"translateX("+aa+"px)"});this.animate(ad,{transform:"translateX(0)"},ac,ae)}else{this.set(Z,{left:"+="+aa});this.animate(ad,{left:"-="+aa},ac,ae)}};W.prototype.zoom=function(Z,aa,ab,ac){if(this._cssTransform){this.set(Z,"zoomOut"===aa?{transform:"scale(2)"}:{transform:"scale(0)"});this.animate(this._$el.toArray(),{transform:"scale(1)"},ab,ac)}else{this.fade(Z,aa,ab,ac)}};W.prototype.set=function(aa,Z){var ab=aa.position().left;if(B.support.backgroundSize){this.setBgImage(this._$el,aa)}else{this.setImage(this._$el,aa)}var ac=this._$el.parent().width();this._$el.each(B.proxy(function(ah,af){var ae=Math.min(this._width,ac),ag=ah*this._width,ad=(ab-ag)+"px";B(af).css({left:ag,width:ae});if(B.support.backgroundSize){B(af).css({backgroundPosition:ad+" "+aa.css("top")})}else{B(af).find(">img").css({left:ad})}ac-=ae},this));this._$el.css(B.extend({opacity:1,top:0,visibility:"visible",transform:"none"},Z))};T.prototype=new n();T.prototype.constructor=T;function T(aa,ab,Z){n.call(this,aa,Z);this._cssTransform=this._parent._cssTransform;this._total=ab;this._height=Math.ceil(this._parent._stageHeight/this._total);this._$el=this.create("br-hslice").data({height:this._height})}T.prototype.sliceRight=function(Z,aa,ab,ad){var ac=this._$el.toArray();if("sliceRightUp"===aa){ac.reverse()}else{if("sliceRightRandom"===aa){p(ac)}}if(this._cssTransform){this.set(Z,{transform:"translateX(-100%)"});this.animate(ac,{transform:"translateX(0)"},ab,ad)}else{this.set(Z,{left:-this._$el.width()});this.animate(ac,{left:0},ab,ad)}};T.prototype.sliceLeft=function(Z,aa,ab,ad){var ac=this._$el.toArray();if("sliceLeftUp"===aa){ac.reverse()}else{if("sliceLeftRandom"===aa){p(ac)}}if(this._cssTransform){this.set(Z,{transform:"translateX(100%)"});this.animate(ac,{transform:"translateX(0)"},ab,ad)}else{this.set(Z,{left:this._$el.width()});this.animate(ac,{left:0},ab,ad)}};T.prototype.sliceAlt=function(Z,aa,ab,ad){var ac=this._$el.toArray();if("sliceAltUp"===aa){ac.reverse()}if(this._cssTransform){this.set(Z,{transform:"translateX(-100%)"});this._$el.filter(":odd").css({transform:"translateX(100%)"});this.animate(ac,{transform:"translateX(0)"},ab,ad)}else{this.set(Z,{left:-this._$el.width()});this._$el.filter(":odd").css({left:this._$el.width()});this.animate(ac,{left:0},ab,ad)}};T.prototype.blinds=function(Z,aa,ab,ad){this.set(Z,{height:0});var ac=this._$el.toArray();if("blindsUp"===aa){ac.reverse()}else{if("horizontalRandomBlinds"===aa){p(ac)}}this.animate(ac,{height:this._height+"px"},ab,ad)};T.prototype.fade=function(Z,aa,ab,ad){this.set(Z,{opacity:0});var ac=this._$el.toArray();if("sliceFadeUp"===aa){ac.reverse()}else{if("horizontalRandomFade"===aa){p(ac)}}this.animate(ac,{opacity:1},ab,ad)};T.prototype.move=function(aa,ab,ac,ae){var ad=this._$el.toArray(),Z=this._$el.parent().height();if("sliceMoveDown"===ab){ad.reverse();Z*=-1}if(this._cssTransform){this.set(aa,{transform:"translateY("+Z+"px)"});this.animate(ad,{transform:"translateY(0)"},ac,ae)}else{this.set(aa,{top:"+="+Z});this.animate(ad,{top:"-="+Z},ac,ae)}};T.prototype.set=function(ac,ab){var aa=ac.position().top;if(B.support.backgroundSize){this.setBgImage(this._$el,ac)}else{this.setImage(this._$el,ac)}var Z=this._$el.parent().height();this._$el.each(B.proxy(function(ah,ae){var ad=Math.min(this._height,Z),af=ah*this._height,ag=(aa-af)+"px";B(ae).css({top:af,height:ad});if(B.support.backgroundSize){B(ae).css({backgroundPosition:ac.css("left")+" "+ag})}else{B(ae).find(">img").css({top:ag})}Z-=ad},this));this._$el.css(B.extend({opacity:1,left:0,visibility:"visible",transform:"none"},ab))};u.prototype=new n();u.prototype.constructor=u;function u(ad,ae,af,ab){n.call(this,ad,ab);this._cssTransform=this._parent._cssTransform;this._blockArray;this._numRows=ae;this._numCols=af;this._width=Math.ceil(this._parent._stageWidth/this._numCols);this._height=Math.ceil(this._parent._stageHeight/this._numRows);this._total=this._numRows*this._numCols;this._$el=this.create("br-block").data({width:this._width,height:this._height});var Z=0;this._blockArray=[];for(var ac=0;acimg").css({left:aj,top:ah})}ae-=aa}}this._$el.css(B.extend({opacity:1,visibility:"visible",transform:"none"},af))};u.prototype.getDiagonalArray=function(){var aa=[];var ab=0,Z=(this._numRows-1)+(this._numCols-1)+1;while(ab!=Z){i=Math.min(this._numRows-1,ab);while(i>=0){j=Math.abs(i-ab);if(j>=this._numCols){break}aa.push(this._blockArray[i][j]);i--}ab++}return aa};u.prototype.getZigZagArray=function(ac){var ab=0,Z=0,aa=true;var ae=[];if("zigZagUp"===ac||"zigZagDown"===ac){for(var ad=0;ad=0;Z--){for(var aa=0;aa=0;aa--){for(var Z=0;Z=0&&af>=0){var ae=0;while(true){ag.push(this._blockArray[ad][ac]);if((++ae)>Z){break}switch(ab){case 0:ac++;break;case 1:ad++;break;case 2:ac--;break;case 3:ad--;break}}switch(ab){case 0:ab=1;Z=(--aa);ad++;break;case 1:ab=2;Z=(--af);ac--;break;case 2:ab=3;Z=(--aa);ad--;break;case 3:ab=0;Z=(--af);ac++;break}}return ag};function I(aa,Z){this._options=Z;this._stageWidth=Z.width;this._stageHeight=Z.height;this._rotate=Z.autoPlay;this._cssTransition=B.support.transition&&!f?Z.cssTransition:false;this._cssTransform=B.support.transform&&this._cssTransition;this._numItems;this._currIndex;this._effects={};this._backward;this._verticalCPanel;this._timer;this._timerId=null;this._tooltipId=null;this._layerIds=[];this._inProgress=false;this._start;this._delay=0;this._cpAlign;this._effectArray;this._startX;this._startY;this._swipeMove;this._swipeStart;this._touchScrolling;this._scrollEasing;this._promise;this._winWidth;this._$rotator=B(aa);this._$stage;this._$screen;this._$layers;this._$preloader;this._$cpanel;this._$cpWrapper;this._$extPanel;this._$thumbPanel;this._$list;this._$items;this._$thumbList;this._$thumbs;this._$tooltip;this._$currItem;this._$prevItem;this._namespace="."+((typeof this._$rotator.attr("id")!=="undefined")?this._$rotator.attr("id"):"rotator");this.init()}I.prototype={init:function(){if(!this._cssTransition){B.fn.transition=B.fn.animate;B.fn.stopTransition=B.fn.stop}this._$list=this._$rotator.find(">ul");if(!this._$list.hasClass("br-slides")){this._$list.addClass("br-slides")}if(this._options.shuffle){this.shuffleItems(this._$list)}this._$items=this._$list.children("li").addClass("br-item");this._numItems=this._$items.length;if("random"===this._options.startIndex){this._currIndex=Math.floor(Math.random()*this._numItems)}else{var Z=parseInt(this._options.startIndex,0);this._currIndex=(!isNaN(Z)&&0<=Z&&Z
');this._$screen=this._$list.parent();this._$stage=this._$screen.parent();this.setBackgroundColor(this._$screen,this._options.backgroundColor);this._$screen.append('
');this._$preloader=this._$screen.find(">.br-preloader");if(false!==this._options.timer&&"none"!==this._options.timer){if("pie"===this._options.timer){if(this._cssTransform){this._timer=new Y(this._$screen,this._options.timerAlign)}}else{this._timer=new y(this._$screen,this._options.timerAlign)}}if("large"===this._options.navButtons&&1 ").addClass("br-wrapper").copyBorder(this._$rotator);this._$rotator.css({borderWidth:0,borderRadiusTopLeft:0,borderRadiusTopRight:0,borderRadiusBottomLeft:0,borderRadiusBottomRight:0});if(!this._options.responsive){Z.css({width:this._$rotator.outerWidth(true),height:this._$rotator.outerHeight(true)})}this._$rotator.wrap(Z)},initSideButtons:function(){var Z=B("