/*
 * jQuery Cycle Lite Plugin
 * http://malsup.com/jquery/cycle/lite/
 * Copyright (c) 2008 M. Alsup
 * Version: 1.0 (06/08/2008)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 * Requires: jQuery v1.2.3 or later
 */
;(function(D){var A="Lite-1.0";D.fn.cycle=function(E){return this.each(function(){E=E||{};if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=0;this.cyclePause=0;var I=D(this);var J=E.slideExpr?D(E.slideExpr,this):I.children();var G=J.get();if(G.length<2){if(window.console&&window.console.log){window.console.log("terminating; too few slides: "+G.length)}return }var H=D.extend({},D.fn.cycle.defaults,E||{},D.metadata?I.metadata():D.meta?I.data():{});H.before=H.before?[H.before]:[];H.after=H.after?[H.after]:[];H.after.unshift(function(){H.busy=0});var F=this.className;H.width=parseInt((F.match(/w:(\d+)/)||[])[1])||H.width;H.height=parseInt((F.match(/h:(\d+)/)||[])[1])||H.height;H.timeout=parseInt((F.match(/t:(\d+)/)||[])[1])||H.timeout;if(I.css("position")=="static"){I.css("position","relative")}if(H.width){I.width(H.width)}if(H.height&&H.height!="auto"){I.height(H.height)}var K=0;J.css({position:"absolute",top:0,left:0}).hide().each(function(M){D(this).css("z-index",G.length-M)});D(G[K]).css("opacity",1).show();if(D.browser.msie){G[K].style.removeAttribute("filter")}if(H.fit&&H.width){J.width(H.width)}if(H.fit&&H.height&&H.height!="auto"){J.height(H.height)}if(H.pause){I.hover(function(){this.cyclePause=1},function(){this.cyclePause=0})}D.fn.cycle.transitions.fade(I,J,H);J.each(function(){var M=D(this);this.cycleH=(H.fit&&H.height)?H.height:M.height();this.cycleW=(H.fit&&H.width)?H.width:M.width()});J.not(":eq("+K+")").css({opacity:0});if(H.cssFirst){D(J[K]).css(H.cssFirst)}if(H.timeout){if(H.speed.constructor==String){H.speed={slow:600,fast:200}[H.speed]||400}if(!H.sync){H.speed=H.speed/2}while((H.timeout-H.speed)<250){H.timeout+=H.speed}}H.speedIn=H.speed;H.speedOut=H.speed;H.slideCount=G.length;H.currSlide=K;H.nextSlide=1;var L=J[K];if(H.before.length){H.before[0].apply(L,[L,L,H,true])}if(H.after.length>1){H.after[1].apply(L,[L,L,H,true])}if(H.click&&!H.next){H.next=H.click}if(H.next){D(H.next).bind("click",function(){return C(G,H,H.rev?-1:1)})}if(H.prev){D(H.prev).bind("click",function(){return C(G,H,H.rev?1:-1)})}if(H.timeout){this.cycleTimeout=setTimeout(function(){B(G,H,0,!H.rev)},H.timeout+(H.delay||0))}})};function B(J,E,I,K){if(E.busy){return }var H=J[0].parentNode,M=J[E.currSlide],L=J[E.nextSlide];if(H.cycleTimeout===0&&!I){return }if(I||!H.cyclePause){if(E.before.length){D.each(E.before,function(N,O){O.apply(L,[M,L,E,K])})}var F=function(){if(D.browser.msie){this.style.removeAttribute("filter")}D.each(E.after,function(N,O){O.apply(L,[M,L,E,K])})};if(E.nextSlide!=E.currSlide){E.busy=1;D.fn.cycle.custom(M,L,E,F)}var G=(E.nextSlide+1)==J.length;E.nextSlide=G?0:E.nextSlide+1;E.currSlide=G?J.length-1:E.nextSlide-1}if(E.timeout){H.cycleTimeout=setTimeout(function(){B(J,E,0,!E.rev)},E.timeout)}}function C(E,F,I){var H=E[0].parentNode,G=H.cycleTimeout;if(G){clearTimeout(G);H.cycleTimeout=0}F.nextSlide=F.currSlide+I;if(F.nextSlide<0){F.nextSlide=E.length-1}else{if(F.nextSlide>=E.length){F.nextSlide=0}}B(E,F,1,I>=0);return false}D.fn.cycle.custom=function(K,H,I,E){var J=D(K),G=D(H);G.css({opacity:0});var F=function(){G.animate({opacity:1},I.speedIn,I.easeIn,E)};J.animate({opacity:0},I.speedOut,I.easeOut,function(){J.css({display:"none"});if(!I.sync){F()}});if(I.sync){F()}};D.fn.cycle.transitions={fade:function(F,G,E){G.not(":eq(0)").css("opacity",0);E.before.push(function(){D(this).show()})}};D.fn.cycle.ver=function(){return A};D.fn.cycle.defaults={timeout:4000,speed:1000,next:null,prev:null,before:null,after:null,height:"auto",sync:1,fit:0,pause:0,delay:0,slideExpr:null}})(jQuery);

/* ------------------------------------------------------------------------
	Class: prettyPhoto
	Use: Lightbox clone for jQuery
	Author: Stephane Caron (http://www.no-margin-for-errors.com)
	Version: 2.2.7
------------------------------------------------------------------------- */
var $pp_pic_holder;var $ppt;(function(A){A.fn.prettyPhoto=function(P){var D=true;var L=[];var C=0;var R;var J=F();A(window).scroll(function(){B();J=F();});A(window).resize(function(){B();N();});A(document).keyup(function(U){switch(U.keyCode){case 37:if(C==1){return ;}K("previous");break;case 39:if(C==setCount){return ;}K("next");break;case 27:I();break;}});P=jQuery.extend({animationSpeed:"normal",padding:40,opacity:0.35,showTitle:true,allowresize:true,counter_separator_label:"/",theme:"light_rounded"},P);A(this).each(function(){var W=false;var V=false;var X=0;var U=0;L[L.length]=this;A(this).bind("click",function(){G(this);return false;});});function G(U){R=A(U);theRel=R.attr("rel");galleryRegExp=/\[(?:.*)\]/;theGallery=galleryRegExp.exec(theRel);isSet=false;setCount=0;for(i=0;i<L.length;i++){if(A(L[i]).attr("rel").indexOf(theGallery)!=-1){setCount++;if(setCount>1){isSet=true;}if(A(L[i]).attr("href")==R.attr("href")){C=setCount;arrayPosition=i;}}}Q();$pp_pic_holder.find("p.currentTextHolder").text(C+P.counter_separator_label+setCount);B();A("#pp_full_res").hide();$pp_pic_holder.find(".pp_loaderIcon").show();}showimage=function(X,U,a,Z,Y,V,W){A(".pp_loaderIcon").hide();if(A.browser.opera){windowHeight=window.innerHeight;windowWidth=window.innerWidth;}else{windowHeight=A(window).height();windowWidth=A(window).width();}$pp_pic_holder.find(".pp_content").animate({height:Y,width:a},P.animationSpeed);projectedTop=J.scrollTop+((windowHeight/2)-(Z/2));if(projectedTop<0){projectedTop=0+A("div.ppt").height();}$pp_pic_holder.animate({top:projectedTop,left:((windowWidth/2)-(a/2)),width:a},P.animationSpeed,function(){$pp_pic_holder.width(a);$pp_pic_holder.find(".pp_hoverContainer,#fullResImage").height(U).width(X);$pp_pic_holder.find("#pp_full_res").fadeIn(P.animationSpeed);E($pp_pic_holder,$ppt);if(W){A("a.pp_expand,a.pp_contract").fadeIn(P.animationSpeed);}});};function K(U){if(U=="previous"){arrayPosition--;C--;}else{arrayPosition++;C++;}if(!D){D=true;}$pp_pic_holder.find(".pp_hoverContainer,.pp_details").fadeOut(P.animationSpeed);$pp_pic_holder.find("#pp_full_res").fadeOut(P.animationSpeed,function(){A(".pp_loaderIcon").show();S();});T();A("a.pp_expand,a.pp_contract").fadeOut(P.animationSpeed,function(){A(this).removeClass("pp_contract").addClass("pp_expand");});}function I(){A("div.pp_pic_holder,div.ppt").fadeOut(P.animationSpeed,function(){A("div.pp_overlay").fadeOut(P.animationSpeed,function(){A("div.pp_overlay,div.pp_pic_holder,div.ppt").remove();if(A.browser.msie&&A.browser.version==6){A("select").css("visibility","visible");}});});D=true;}function H(){if(C==setCount){$pp_pic_holder.find("a.pp_next").css("visibility","hidden");$pp_pic_holder.find("a.pp_arrow_next").addClass("disabled").unbind("click");}else{$pp_pic_holder.find("a.pp_next").css("visibility","visible");$pp_pic_holder.find("a.pp_arrow_next.disabled").removeClass("disabled").bind("click",function(){K("next");return false;});}if(C==1){$pp_pic_holder.find("a.pp_previous").css("visibility","hidden");$pp_pic_holder.find("a.pp_arrow_previous").addClass("disabled").unbind("click");}else{$pp_pic_holder.find("a.pp_previous").css("visibility","visible");$pp_pic_holder.find("a.pp_arrow_previous.disabled").removeClass("disabled").bind("click",function(){K("previous");return false;});}$pp_pic_holder.find("p.currentTextHolder").text(C+P.counter_separator_label+setCount);R=(isSet)?A(L[arrayPosition]):R;if(R.attr("title")){$pp_pic_holder.find(".pp_description").show().html(unescape(R.attr("title")));}else{$pp_pic_holder.find(".pp_description").hide().text("");}if(R.find("img").attr("alt")&&P.showTitle){hasTitle=true;$ppt.find(".ppt_content").html(unescape(R.find("img").attr("alt")));}else{hasTitle=false;}}function M(V,U){hasBeenResized=false;A("div.pp_pic_holder .pp_details").width(V);A("div.pp_pic_holder .pp_details p.pp_description").width(V-parseFloat(A("div.pp_pic_holder a.pp_close").css("width")));contentHeight=U+parseFloat(A("div.pp_pic_holder .pp_details").height())+parseFloat(A("div.pp_pic_holder .pp_details").css("margin-top"))+parseFloat(A("div.pp_pic_holder .pp_details").css("margin-bottom"));contentWidth=V;containerHeight=U+parseFloat(A("div.ppt").height())+parseFloat(A("div.pp_pic_holder .pp_top").height())+parseFloat(A("div.pp_pic_holder .pp_bottom").height());containerWidth=V+P.padding;imageWidth=V;imageHeight=U;windowHeight=A(window).height();windowWidth=A(window).width();if(((containerWidth>windowWidth)||(containerHeight>windowHeight))&&D&&P.allowresize){hasBeenResized=true;notFitting=true;while(notFitting){if((containerWidth>windowWidth)){imageWidth=(windowWidth-200);imageHeight=(U/V)*imageWidth;}else{if((containerHeight>windowHeight)){imageHeight=(windowHeight-200);imageWidth=(V/U)*imageHeight;}else{notFitting=false;}}containerHeight=imageHeight;containerWidth=imageWidth;}contentHeight=imageHeight+parseFloat(A("div.pp_pic_holder .pp_details").height())+parseFloat(A("div.pp_pic_holder .pp_details").css("margin-top"))+parseFloat(A("div.pp_pic_holder .pp_details").css("margin-bottom"));contentWidth=imageWidth;containerHeight=imageHeight+parseFloat(A("div.ppt").height())+parseFloat(A("div.pp_pic_holder .pp_top").height())+parseFloat(A("div.pp_pic_holder .pp_bottom").height());containerWidth=imageWidth+P.padding;A("div.pp_pic_holder .pp_details").width(contentWidth);A("div.pp_pic_holder .pp_details p.pp_description").width(contentWidth-parseFloat(A("div.pp_pic_holder a.pp_close").css("width")));}return{width:imageWidth,height:imageHeight,containerHeight:containerHeight,containerWidth:containerWidth,contentHeight:contentHeight,contentWidth:contentWidth,resized:hasBeenResized};}function B(){if($pp_pic_holder){if($pp_pic_holder.size()==0){return ;}}else{return ;}if(A.browser.opera){windowHeight=window.innerHeight;windowWidth=window.innerWidth;}else{windowHeight=A(window).height();windowWidth=A(window).width();}if(D){$pHeight=$pp_pic_holder.height();$pWidth=$pp_pic_holder.width();$tHeight=$ppt.height();$offset=$pp_pic_holder.offset();projectedTop=(windowHeight/2)+J.scrollTop-($pHeight/2);if(projectedTop<0){projectedTop=0+$tHeight;}$pp_pic_holder.css({top:projectedTop,left:(windowWidth/2)+J.scrollLeft-($pWidth/2)});$ppt.css({top:$offset.top-$tHeight,left:$offset.left+(P.padding/2)});}}function E(){if(isSet){$pp_pic_holder.find(".pp_hoverContainer").fadeIn(P.animationSpeed);}$pp_pic_holder.find(".pp_details").fadeIn(P.animationSpeed);O($pp_pic_holder,$ppt);}function O(){if(P.showTitle&&hasTitle){$ppt.css({top:$pp_pic_holder.offset().top-22,left:$pp_pic_holder.offset().left+(P.padding/2),display:"none"});$ppt.find("div.ppt_content").css("width","auto");if($ppt.width()>$pp_pic_holder.width()){$ppt.find("div.ppt_content").css("width",$pp_pic_holder.width()-(P.padding*2));}else{$ppt.find("div.ppt_content").css("width","");}$ppt.fadeIn(P.animationSpeed);}}function T(){$ppt.fadeOut(P.animationSpeed);}function S(){H();imgPreloader=new Image();nextImage=new Image();if(isSet&&C>setCount){nextImage.src=A(L[arrayPosition+1]).attr("href");}prevImage=new Image();if(isSet&&L[arrayPosition-1]){prevImage.src=A(L[arrayPosition-1]).attr("href");}$pp_pic_holder.find(".pp_content").css("overflow","hidden");$pp_pic_holder.find("#fullResImage").attr("src",R.attr("href"));imgPreloader.onload=function(){var U=M(imgPreloader.width,imgPreloader.height);imgPreloader.width=U.width;imgPreloader.height=U.height;showimage(imgPreloader.width,imgPreloader.height,U.containerWidth,U.containerHeight,U.contentHeight,U.contentWidth,U.resized);};imgPreloader.src=R.attr("href");}function F(){scrollTop=window.pageYOffset||document.documentElement.scrollTop||0;scrollLeft=window.pageXOffset||document.documentElement.scrollLeft||0;return{scrollTop:scrollTop,scrollLeft:scrollLeft};}function N(){A("div.pp_overlay").css({height:A(document).height(),width:A(window).width()});}function Q(){toInject="";toInject+="<div class='pp_overlay'></div>";toInject+='<div class="pp_pic_holder"><div class="pp_top"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div><div class="pp_content"><a href="#" class="pp_expand" title="Expand the image">Expand</a><div class="pp_loaderIcon"></div><div class="pp_hoverContainer"><a class="pp_next" href="#">next</a><a class="pp_previous" href="#">previous</a></div><div id="pp_full_res"><img id="fullResImage" src="" /></div><div class="pp_details clearfix"><a class="pp_close" href="#">Close</a><p class="pp_description"></p><div class="pp_nav"><a href="#" class="pp_arrow_previous">Previous</a><p class="currentTextHolder">0'+P.counter_separator_label+'0</p><a href="#" class="pp_arrow_next">Next</a></div></div></div><div class="pp_bottom"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div></div>';toInject+='<div class="ppt"><div class="ppt_left"></div><div class="ppt_content"></div><div class="ppt_right"></div></div>';A("body").append(toInject);$pp_pic_holder=A(".pp_pic_holder");$ppt=A(".ppt");A("div.pp_overlay").css("height",A(document).height()).bind("click",function(){I();});$pp_pic_holder.css({opacity:0}).addClass(P.theme);A("a.pp_close").bind("click",function(){I();return false;});A("a.pp_expand").bind("click",function(){$this=A(this);if($this.hasClass("pp_expand")){$this.removeClass("pp_expand").addClass("pp_contract");D=false;}else{$this.removeClass("pp_contract").addClass("pp_expand");D=true;}T();$pp_pic_holder.find(".pp_hoverContainer, #pp_full_res, .pp_details").fadeOut(P.animationSpeed,function(){S();});return false;});$pp_pic_holder.find(".pp_previous, .pp_arrow_previous").bind("click",function(){K("previous");return false;});$pp_pic_holder.find(".pp_next, .pp_arrow_next").bind("click",function(){K("next");return false;});$pp_pic_holder.find(".pp_hoverContainer").css({"margin-left":P.padding/2});if(!isSet){$pp_pic_holder.find(".pp_hoverContainer,.pp_nav").hide();}if(A.browser.msie&&A.browser.version==6){A("body").addClass("ie6");A("select").css("visibility","hidden");}A("div.pp_overlay").css("opacity",0).fadeTo(P.animationSpeed,P.opacity,function(){$pp_pic_holder.css("opacity",0).fadeIn(P.animationSpeed,function(){$pp_pic_holder.attr("style","left:"+$pp_pic_holder.css("left")+";top:"+$pp_pic_holder.css("top")+";");S();});});}};})(jQuery);


/* ***********************************************************
 * @author izus.com.ar
 */
$(document).ready(function(){
	

	//media slideshow
	$('.slideshow').cycle({ 
    	fx:    'fade', 
		speed:	1300,
		timeout:5000,
    	pause:  1 
  	});	
	
	$("a[rel^='gallery']").prettyPhoto({
		animationSpeed: 'normal', /* fast/slow/normal */
		padding: 40, /* padding for each side of the picture */
		opacity: 0.35, /* Value betwee 0 and 1 */
		showTitle: true, /* true/false */
		allowresize: true, /* true/false */
		counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
		theme: 'dark_square' /* light_rounded / dark_rounded / light_square / dark_square */
	});
	
}); // close document.ready


