function paginarNoticias(pagina){ var _pagina = (!pagina)?1:pagina; $('div.single-column-right').html("\"Loading\""); $('div.single-column-right').load("http://www.inofix.com/en/news-list/"+_pagina); } function resizeRows(ul,rowSize){ if (ul) { var count = 1; var maxHeight = 0; var arrElements = new Array(); ul.children('li').each(function(index){ _currentHeight = parseInt(jQuery(this).innerHeight()); if ( _currentHeight > maxHeight) maxHeight = _currentHeight; arrElements.push(this); if (count++ == rowSize) { // Alineamos todos los elementos a la altura mayor for (var ii = 0; ii < arrElements.length; ii++) { jQuery(arrElements[ii]).height(maxHeight); jQuery(arrElements[ii]).css('height',maxHeight+'px'); } arrElements = new Array(); maxHeight = 0; count = 1; } }); // Alineamos todos los elementos a la altura mayor for (var ii = 0; ii < arrElements.length; ii++) { jQuery(arrElements[ii]).height(maxHeight); } } } $(document).ready(function() { if($('#noticia-index').length > 0) paginarNoticias(1); if($('.product-lines-homepage .head').length > 0){ $('.product-lines-homepage .head').mouseover(function(e){ _rel = eval('(' + $(this).attr('rel') + ')'); $(this).css('color', _rel.color_on); $('#nodo_grafico_' + _rel.nodo_id).css('border-color', _rel.color_on); console.log($('#nodo_texto_' + _rel.nodo_id)); $('#nodo_texto_' + _rel.nodo_id + ' .head').css('color', _rel.color_on); }); $('.product-lines-homepage .head').mouseout(function(e){ _rel = eval('(' + $(this).attr('rel') + ')'); $(this).css('color', _rel.color_off); $('#nodo_grafico_' + _rel.nodo_id).css('border-color', _rel.color_default); $('#nodo_texto_' + _rel.nodo_id + ' .head').css('color', '#777'); }); } if($('#producto-modelo .product-types li').length > 0){ $('#producto-modelo .product-types li a').first().toggleClass('on'); _rel = $('#producto-modelo .product-types li a').attr('rel'); $('#codigos_padre_modelo_color_' + _rel).show(); $('#producto-modelo .product-types li a').click(function(e){ e.stopPropagation(); $('#producto-modelo .product-types li a').removeClass('on'); $(this).addClass('on'); _rel = $(this).attr('rel'); $('.codigos_padre_modelo_color').hide(); $('#codigos_padre_modelo_color_' + _rel).show(); return false; }); } $("ul").each( function() { var elem = $(this); if (elem.children().length == 0) elem.remove(); } ); if($("#lang").length > 0){ $("#lang").change(function(e){ var homes = new Array(); homes['ca'] = 'http://www.inofix.com/ca'; homes['es'] = 'http://www.inofix.com/es'; homes['en'] = 'http://www.inofix.com/en'; document.location.href = homes[$(this).val()]; }); } if($('#thumbs').length > 0){ var onMouseOutOpacity = 0.67; $('#thumbs ul.thumbs li, div#thumbs a.pageLink').opacityrollover({ mouseOutOpacity: onMouseOutOpacity, mouseOverOpacity: 1.0, fadeSpeed: 'fast', exemptionSelector: '.selected' }); var gallery = $('#thumbs').galleriffic({ delay: 2500, // in milliseconds numThumbs: 3, // The number of thumbnails to show page preloadAhead: 10, // Set to -1 to preload all images enableTopPager: false, enableBottomPager: false, maxPagesToShow: 7, // The maximum number of pages to display in either the top or bottom pager imageContainerSel: '#slideshow', // The CSS selector for the element within which the main slideshow image should be rendered loadingContainerSel: '#loading', // The CSS selector for the element within which should be shown when an image is loading renderSSControls: true, // Specifies whether the slideshow's Play and Pause links should be rendered renderNavControls: true, // Specifies whether the slideshow's Next and Previous links should be rendered playLinkText: 'Play', pauseLinkText: 'Pausa', prevLinkText: 'Previous', nextLinkText: 'Next', nextPageLinkText: 'Next ›', prevPageLinkText: '‹ Previous', enableHistory: false, // Specifies whether the url's hash and the browser's history cache should update when the current slideshow image changes enableKeyboardNavigation: true, // Specifies whether keyboard navigation is enabled autoStart: false, // Specifies whether the slideshow should be playing or paused when the page first loads syncTransitions: false , // Specifies whether the out and in transitions occur simultaneously or distinctly defaultTransitionDuration: 900, // If using the default transitions, specifies the duration of the transitions onSlideChange: function(prevIndex, nextIndex) { // 'this' refers to the gallery, which is an extension of $('#thumbs') this.find('ul.thumbs').children() .eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end() .eq(nextIndex).fadeTo('fast', 1.0); }, onPageTransitionOut: function(callback) { this.fadeTo('fast', 0.0, callback); }, onTransitionIn: function(){ var prevPageLink = this.find('a.prev').css('visibility', 'hidden'); var nextPageLink = this.find('a.next').css('visibility', 'hidden'); // Show appropriate next / prev page links if (this.displayedPage > 0) prevPageLink.css('visibility', 'visible'); var lastPage = this.getNumPages() - 1; if (this.displayedPage < lastPage) nextPageLink.css('visibility', 'visible'); this.fadeTo('fast', 1.0); $('.image-wrapper').css('opacity','1'); } }); gallery.find('a.prev').click(function(e) { gallery.previousPage(); e.preventDefault(); }); gallery.find('a.next').click(function(e) { gallery.nextPage(); e.preventDefault(); }); } if($("a.lightbox").length > 0) $("a.lightbox").colorbox(); }); $(window).load(function(){ if($('.product-types li').length > 0){ resizeRows($('.product-types'),5); } });