/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

var cicloBannerCasosHome=self.setInterval('rotateBanner("#widget-casos-home")',10000);var cicloBannerPpal=self.setInterval('rotateBanner("#widget-paginacion")',10000);$(document).ready(function(){var ultimoBannerPpal=$("#widget-paginacion ul.paginacion-cont li:last-child a.paginacion-item-text");ultimoBannerPpal.addClass('last-item');$("#widget-paginacion ul.paginacion-cont li a.paginacion-item-text").click(function(e,data){e.preventDefault();var contenido="";var activo=$(this).parent().hasClass("activo");var accionado=$(this);if(!activo){if(data!='trigger1'){window.clearInterval(cicloBannerPpal)}$(this).parent().siblings('.activo').removeClass('activo');$(this).parent().addClass('activo');$("#widget-content").animate({opacity:0},800,function(){contenido=accionado.next().html();$("#widget-content").html(contenido).animate({opacity:1},800)})}});var ultimoBannerCasosHome=$("#widget-casos-home ul.paginacion-cont li:last-child a.paginacion-item-text");ultimoBannerCasosHome.addClass('last-item');$("#casos>div#casos-footer>div.casos-pagina>ul.paginacion-cont>li>a").click(function(e,data){e.preventDefault();var contenido="";var activo=$(this).parent().hasClass("activo");var accionado=$(this);$("#link-caso").attr('href',accionado.next().next().text());if(!activo){if(data!='trigger1'){window.clearInterval(cicloBannerCasosHome)}$(this).parent().siblings('.activo').removeClass('activo');$(this).parent().addClass('activo');$("#casos-cont").animate({opacity:0.1},800,function(){contenido=accionado.next().html();$("#casos-cont").html(contenido).animate({height:$("#casos-cont").height(),opacity:0.99},800);$("#casos-footer>div.casos-titulo").text(accionado.attr('title'))})}});$("a.client-gallery-launch").click(function(event){event.preventDefault();var relacion=$(this).attr('rel');$("a.client-gallery[rel="+relacion+"]").fancybox({'titleFormat':formatTitle});$("a.client-gallery[rel="+relacion+"]:first").trigger('click')});$("#btnEncuestaResult").click(function(){$("#resultadoEncuestaMain").slideDown("slow")});$("#btnEncuestaHide").click(function(){$("#resultadoEncuestaMain").slideUp("slow")});$('#frmEncuesta').submit(function(){$(this).ajaxSubmit({data:{operacion:"encuesta"},dataType:'json',beforeSubmit:function(){loader(1,'#contactLoader')},success:function showResponse(data,statusText){loader(0,'#contactLoader');var mssg="";for(x in data){mssg+=data[x].msg+"<br />"}jAlert(mssg,"Servidor")}});return false})});function formatTitle(title,currentArray,currentIndex,currentOpts){return'<div id="fancy_title" style="width:'+$("#fancy_content").width()+'px;"><span><a href="javascript:;" onclick="$.fancybox.close();"></a>'+title+'</span></div>'}

