/*!
 * TSNAccoslider
 *
 * tagliagambe@tesene.it - August 2011
 * 
 * This script uses JQuery (http://www.jquery.com)
 * 
 */
(function(a){TSNAccoSlider=function(){var b=this;b.menu_num=4;b.currmenu=-1;b.currdisp=-1;b.playstate=true;b.speed=600;b.pause=4e3;b.tout=null;b.baseclasses=[];b.currentopen=-1;b.init=function(c,d){b.menu_num=c;b.playstate=d;for(var e=0;e<b.menu_num;e++){a("#box"+e).click(b.click);b.baseclasses[e]=a("#box"+e).attr("class")}b.goto(0);clearTimeout(b.tout);if(b.playstate==true){b.tout=setTimeout(b.rotate,b.pause)}};b.click=function(a){b.playstate=false;clearTimeout(b.tout);b.open(parseInt(a.currentTarget.id.substr(a.currentTarget.id.length-1,1)))};b.openmenu=function(c){for(var d=0;d<b.menu_num;d++){if(d==c){if(b.currentopen!=d){a("#expand"+d).slideDown(b.speed);b.menu_aperto(d);b.currentopen=d}else{a("#expand"+d).slideUp(b.speed);b.menu_attivo(d);b.currentopen=-1}}else{a("#expand"+d).slideUp(b.speed);b.menu_nonattivo(d)}}console.log("APERTO:"+b.currentopen);b.currmenu=c;if(b.currentopen==-1){b.playstate=true;b.tout=setTimeout(b.rotate,b.pause)}else{b.goto(c,false)}};b.rotate=function(){clearTimeout(b.tout);if(b.playstate==true){b.goto(b.currdisp+1);b.tout=setTimeout(b.rotate,b.pause)}};b.goto=function(a,c){if(c==undefined){c=true}if(a!=b.currdisp){var d=b.currdisp;b.currdisp=a;if(b.currdisp>=b.menu_num){b.currdisp=0}if(b.currdisp!=b.currentopen){b.menu_attivo(b.currdisp)}b.changeimage(b.currdisp,d);if(d!=-1){b.menu_nonattivo(d)}}};b.changeimage=function(c,d){a("#img"+c).fadeIn(b.speed);a("#img"+d).fadeOut(b.speed)};b.open=function(a){if(b.playstate!=true){if(a<b.menu_num){b.openmenu(a)}}};b.menu_aperto=function(c){a("#box"+c).attr("class",b.baseclasses[c]+"_aperto")};b.menu_attivo=function(c){a("#box"+c).attr("class",b.baseclasses[c]+"_attivo")};b.menu_nonattivo=function(c){a("#box"+c).attr("class",b.baseclasses[c])}}})(jQuery)
;
(function ($) {
  // Use jQuery with the shortcut:

TSNCarousel = function()
{
	var self=this;
	self.slidenum=0;
	self.currslide=0;
	self.baseid="";
	self.container="";
	self.nextbutton="";
	self.prevbutton="";
	self.pageno="";
	self.numimg_baseurl="";
	self.speed=500;
	self.width=0;
	self.height=0;
	self.anim=false;
	
	self.init  = function(w,h,nf,ba,nurl)
	{
		self.width=w;
		self.height=h;
		self.slidenum=parseInt(nf);
		self.baseid="#"+ba;
		self.container=self.baseid+"container";
		self.nextbutton=self.baseid+"next";
		self.prevbutton=self.baseid+"prev";
		self.pageno=self.baseid+"pageno";
		self.numimg_baseurl=nurl;
		self.anim=false;
		
		for (var k=0;k<self.slidenum;k++)
		{
			if (k!=0)
			{
				$("carousel_"+k).css("display","none");
			}
			else
			{
				$("carousel_"+k).css("display","block");
			}
		}
		$("#pall_0").attr("src","sites/all/modules/tesene/hp_slider/images/qua_attivo.jpg");
		self.currslide=0;
		$(self.baseid+"0").css("display","block").css("left","0px");
		self.updatepageno(0);
	}
	
	self.clicknext = function()
	{
		var num=self.currslide;
		num++;
		if (num>=self.slidenum)
		{
			num=0;
		}
		self.setslide(num,"forw");
	}
	
	self.clickprev = function()
	{
		var num=self.currslide;
		num--;
		if (num<0)
		{
			num=self.slidenum-1;
		}
		self.setslide(num,"revr");
	}
	
	self.setpallino = function(n)
	{
		for (var k=0;k<self.slidenum;k++)
		{
			if (k==n)
			{
				$("#pall_"+k).attr("src","sites/all/modules/tesene/hp_slider/images/qua_attivo.jpg");
			}
			else
			{
				$("#pall_"+k).attr("src","sites/all/modules/tesene/hp_slider/images/qua.jpg");
			}
		}
	}
	
	self.setslide = function(num,dir)
	{
		if (dir==undefined)
		{
			if (num>self.currslide) { dir="forw"; } else { dir="back"; }
			
		}
		if (!self.anim)
		{
			self.setpallino(num);
			var last=self.currslide;
			self.currslide=num;
			if (last!=self.currslide)
			{
				
				if (dir=="forw")
				{
					// AVANTI!
					self.anim=true;
					$(self.baseid+self.currslide).css("left","400px").css("display","block").animate({"left":"-=400"},self.speed);
					$(self.baseid+last).animate({"left":"-=400"},self.speed,function()
					{
						self.anim=false;
						$(self.baseid+last).css("display","none").css("left","0px");
						self.updatepageno(self.currslide);
					});
				}
				else
				{
					// INDIETRO!
					self.anim=true;
					$(self.baseid+self.currslide).css("left","-400px").css("display","block").animate({"left":"+=400"},self.speed);
					$(self.baseid+last).animate({"left":"+=400"},self.speed,function()
					{
						self.anim=false;
						$(self.baseid+last).css("display","none").css("left","0px");
						self.updatepageno(self.currslide);
					});
				}     
			}
		}
	}
	
	self.updatepageno = function(num)
	{
		$(self.pageno).attr("src",self.numimg_baseurl+(num+1)+".jpg");
	}
}
}(jQuery));;
/*!
 * TSNAnimage
 *
 * tagliagambe@tesene.it - August 2011
 * 
 * This script uses JQuery (http://www.jquery.com)
 * 
 */
(function($){TSNAnimage=function(){var self=this;self.container="";self.rel_container="";self.img_container="";self.text_container="";self.text_courtain="";self.imgs_url=[];self.imgs=[];self.text_html=[];self.img_loaded=0;self.img_w=720;self.img_h=480;self.speed=750;self.pausetime=3e3;self.curdisp=0;self.slice_w=9;self.slice_h=6;self.basename="animage";self.queuetype="random";self.anims=["xfade","push_up","push_right","push_down","push_left","squeeze_up","squeeze_right","squeeze_down","squeeze_left","zoom_in","zoom_out","quad_open","quad_close","veneziana_horiz","veneziana_vert","cubize_fade_rand","cubize_fade_vert","cubize_fade_horiz","cubize_zoomin","cubize_zoomout","stripe_vert","stripe_horiz","open_horiz","open_vert","close_horiz","close_vert"];self.animscycle=[];self.queue=[];self.readycb=null;self.animstartcb=null;self.animfinishcb=null;self.playstate=true;self.courtainstate=true;self.textanim_in="xfade";self.textanim_out="xfade";self.textheight=0;self.init=function(a){if(a){self.parse_settings(a)}$(self.container).html("");self.rel_container=self.basename+"_rel_container";self.img_container=self.basename+"_img_container";self.text_container=self.basename+"_text_container";self.text_courtain=self.basename+"_text_courtain";var b='<div id="'+self.rel_container+'" style="width:'+self.img_w+"px; height:"+self.img_h+'px; overflow:hidden; position:relative;">';b+='<div id="'+self.img_container+'" style="width:'+self.img_w+"px; height:"+self.img_h+'px; position:absolute; top:0px; left:0px;"></div>';b+='<div id="'+self.text_courtain+'" style="width:'+self.img_w+"px; height:"+self.textheight+"px; background:#000000; opacity:0.6; position:absolute; top:"+(self.img_h-self.textheight)+'px; left:0px;"></div>';b+="</div>";self.rel_container="#"+self.rel_container;self.img_container="#"+self.img_container;self.text_container="#"+self.text_container;self.text_courtain="#"+self.text_courtain;$(self.container).append(b);if(self.text_html[0]==""){self.courtainstate=false;$(self.text_courtain).css("display","none")}self.animscycle=self.clone_array(self.anims);for(var c=0;c<self.imgs_url.length;c++){if(c==0){ds="block"}else{ds="none"}if(self.text_html[c]!=undefined){b='<div id="'+self.text_container.substring(1,self.text_container.length)+"_"+c+'" style="display:'+ds+"; position:absolute; top:"+(self.img_h-self.textheight)+"; left:0px; color:#ffffff; width:"+self.img_w+"px; height:"+self.textheight+'px; overflow:hidden;">'+self.text_html[c]+"</div>"}else{b='<div id="'+self.text_container.substring(1,self.text_container.length)+"_"+c+'" style="display:'+ds+"; position:absolute; top:"+(self.img_h-self.textheight)+"; left:0px; color:#ffffff; width:"+self.img_w+"px; height:"+self.textheight+'px; overflow:hidden;"></div>'}$(self.rel_container).append(b);self.imgs[c]=new Image;$(self.imgs[c]).attr("id",self.basename+"_"+c);self.img_reset(self.imgs[c]);if(c==0){$(self.imgs[c]).css("display","block");self.curdisp=0}$(self.imgs[c]).load(function(){$(self.img_container).append(this);self.img_loaded++;if(self.img_loaded==self.imgs_url.length){if(self.readycb!=null){self.readycb({event:"ready",currimg:self.curdisp})}if(self.playstate==true){setTimeout(self.animate,self.pausetime)}}});$(self.imgs[c]).attr("src",self.imgs_url[c])}};self.img_reset=function(a){$(a).css("display","none").css("position","absolute").css("top","0px").css("left","0px").css("width",self.img_w+"px").css("height",self.img_h+"px")};self.anim_finish=function(){if(self.animfinishcb!=null){self.animfinishcb({event:"animfinish",currimg:self.curdisp})}if(self.playstate==true){setTimeout(self.animate,self.pausetime)}};self.start=function(){if(self.playstate==false){self.playstate=true;self.animate()}};self.stop=function(){self.playstate=false};self.goto=function(a){if(self.playstate==false){var b=self.curdisp;var c=self.courtainstate;var d="";var e="#"+self.basename+"_"+self.curdisp;if(a<self.imgs_url.length){self.curdisp=a;if(self.text_html[self.curdisp]==""){self.courtainstate=false}else{self.courtainstate=true}if(self.courtainstate==true&&c==false){d="in"}if(self.courtainstate==false&&c==true){d="out"}self.text_anim(self.text_container+"_"+self.curdisp,self.text_container+"_"+b,d);var f="#"+self.basename+"_"+self.curdisp;self.anim_random(f,e)}}};self.next=function(){if(self.playstate==false){var a=self.curdisp;var b=self.courtainstate;var c="";var d="#"+self.basename+"_"+self.curdisp;self.curdisp++;if(self.curdisp>=self.imgs_url.length){self.curdisp=0}if(self.text_html[self.curdisp]==""){self.courtainstate=false}else{self.courtainstate=true}if(self.courtainstate==true&&b==false){c="in"}if(self.courtainstate==false&&b==true){c="out"}self.text_anim(self.text_container+"_"+self.curdisp,self.text_container+"_"+a,c);var e="#"+self.basename+"_"+self.curdisp;self.anim_random(e,d)}};self.animate=function(){if(self.playstate==true){var a=self.curdisp;var b=self.courtainstate;var c="";var d="#"+self.basename+"_"+self.curdisp;self.curdisp++;if(self.curdisp>=self.imgs_url.length){self.curdisp=0}var e="#"+self.basename+"_"+self.curdisp;if(self.text_html[self.curdisp]==""){self.courtainstate=false}else{self.courtainstate=true}if(self.courtainstate==true&&b==false){c="in"}if(self.courtainstate==false&&b==true){c="out"}self.text_anim(self.text_container+"_"+self.curdisp,self.text_container+"_"+a,c);self.anim_random(e,d)}};self.prev=function(){if(self.playstate==false){var a=self.curdisp;var b=self.courtainstate;var c="";var d="#"+self.basename+"_"+self.curdisp;self.curdisp--;if(self.curdisp<0){self.curdisp=self.imgs_url.length-1}if(self.text_html[self.curdisp]==""){self.courtainstate=false}else{self.courtainstate=true}if(self.courtainstate==true&&b==false){c="in"}if(self.courtainstate==false&&b==true){c="out"}self.text_anim(self.text_container+"_"+self.curdisp,self.text_container+"_"+a,c);var e="#"+self.basename+"_"+self.curdisp;self.anim_random(e,d)}};self.clone_array=function(a){var b=[];for(var c in a){b[c]=a[c]}return b};self.parse_settings=function(a){if(typeof a.container=="string"){self.container=a.container}if(typeof a.basename=="string"){self.basename=a.basename}if(typeof a.queuetype=="string"){self.queuetype=a.queuetype}if(typeof a.textanim_in=="string"){self.textanim_in=a.textanim_in}if(typeof a.textanim_out=="string"){self.textanim_out=a.textanim_out}if(typeof a.width=="number"){self.img_w=a.width}if(typeof a.height=="number"){self.img_h=a.height}if(typeof a.speed=="number"){self.speed=a.speed}if(typeof a.pausetime=="number"){self.pausetime=a.pausetime}if(typeof a.slice_h=="number"){self.slice_h=a.slice_h;}if(typeof a.slice_w=="number"){self.slice_w=a.slice_w}if(typeof a.autostart=="boolean"){self.playstate=a.autostart}if(typeof a.readycb=="function"||typeof a.readycb=="object"){self.readycb=a.readycb}if(typeof a.animstartcb=="function"||typeof a.animstartcb=="object"){self.animstartcb=a.animstartcb}if(typeof a.animfinishcb=="function"||typeof a.animfinishcb=="object"){self.animfinishcb=a.animfinishcb}if(a.imgs_url instanceof Array){self.imgs_url=self.clone_array(a.imgs_url)}if(a.anims instanceof Array){self.anims=self.clone_array(a.anims)}if(a.text_html instanceof Array){self.text_html=a.text_html}};self.text_anim=function(a,b,c){switch(self.textanim_in){case"from_right":$(a).css("left",self.img_w+"px").css("display","block").animate({left:"-="+self.img_w},self.speed);if(c=="in"){$(self.text_courtain).css("left",self.img_w+"px").css("display","block").animate({left:"-="+self.img_w},self.speed)}break;case"from_left":$(a).css("left","-"+self.img_w+"px").css("display","block").animate({left:"+="+self.img_w},self.speed);if(c=="in"){$(self.text_courtain).css("left","-"+self.img_w+"px").css("display","block").animate({left:"+="+self.img_w},self.speed)}break;case"from_down":$(a).css("top",self.img_h+"px").css("display","block").animate({top:"-="+self.textheight},self.speed);if(c=="in"){$(self.text_courtain).css("top",self.img_h+"px").css("display","block").animate({top:"-="+self.textheight},self.speed)}break;case"xfade":$(a).css("display","none").fadeIn(self.speed);if(c=="in"){$(self.text_courtain).css("display","none").fadeIn(self.speed)}break}switch(self.textanim_out){case"xfade":$(b).fadeOut(self.speed);if(c=="out"){$(self.text_courtain).fadeOut(self.speed)}break;case"to_right":$(b).animate({left:"+="+self.img_w},self.speed,function(){$(b).css("display","none").css("left","0px")});if(c=="out"){$(self.text_courtain).animate({left:"+="+self.img_w},self.speed,function(){$(self.text_courtain).css("display","none").css("left","0px")})}break;case"to_left":$(b).animate({left:"-="+self.img_w},self.speed,function(){$(b).css("display","none").css("left","0px")});if(c=="out"){$(self.text_courtain).animate({left:"-="+self.img_w},self.speed,function(){$(self.text_courtain).css("display","none").css("left","0px")})}break;case"to_down":$(b).animate({top:"+="+self.textheight},self.speed,function(){$(b).css("display","none").css("top",self.img_h-self.textheight+"px")});if(c=="out"){$(self.text_courtain).animate({top:"+="+self.textheight},self.speed,function(){$(self.text_courtain).css("display","none").css("top",self.img_h-self.textheight+"px")})}break}};self.anim_random=function(i,o){if(self.queue.length<1){self.queue=self.clone_array(self.animscycle)}var rn=0;if(self.queuetype=="random"){rn=Math.floor(Math.random()*self.queue.length)}var aa=self.queue[rn];if(self.animstartcb!=null){self.animstartcb({event:"animstart",currimg:self.curdisp,anim:aa})}self.queue.splice(rn,1);eval("self.anim_"+aa+"('"+i+"','"+o+"');")};self.anim_xfade=function(a,b){$(a).fadeIn(self.speed);$(b).fadeOut(self.speed,function(){self.anim_finish()})};self.anim_push_left=function(a,b){$(a).css("left",self.img_w+"px").css("display","block").animate({left:"-="+self.img_w},self.speed);$(b).animate({left:"-="+self.img_w},self.speed,function(){$(this).css("display","none").css("left","0px");self.anim_finish()})};self.anim_push_right=function(a,b){$(a).css("left","-"+self.img_w+"px").css("display","block").animate({left:"+="+self.img_w},self.speed);$(b).animate({left:"+="+self.img_w},self.speed,function(){$(this).css("display","none").css("left","0px");self.anim_finish()})};self.anim_push_up=function(a,b){$(a).css("top",self.img_h+"px").css("display","block").animate({top:"-="+self.img_h},self.speed);$(b).animate({top:"-="+self.img_h},self.speed,function(){$(this).css("display","none").css("top","0px");self.anim_finish()})};self.anim_push_down=function(a,b){$(a).css("top","-"+self.img_h+"px").css("display","block").animate({top:"+="+self.img_h},self.speed);$(b).animate({top:"+="+self.img_h},self.speed,function(){$(this).css("display","none").css("top","0px");self.anim_finish()})};self.anim_squeeze_right=function(a,b){$(a).css("width","0px").css("display","block").animate({width:"+="+self.img_w},self.speed);$(b).animate({width:"-="+self.img_w,left:"+="+self.img_w},self.speed,function(){$(this).css("display","none").css("width",self.img_w+"px").css("left","0px");self.anim_finish()})};self.anim_squeeze_left=function(a,b){$(a).css("width","0px").css("left",self.img_w+"px").css("display","block").animate({width:"+="+self.img_w,left:"-="+self.img_w},self.speed);$(b).animate({width:"-="+self.img_w},self.speed,function(){$(this).css("display","none").css("width",self.img_w+"px");self.anim_finish()})};self.anim_squeeze_up=function(a,b){$(a).css("top",self.img_h+"px").css("height","0px").css("display","block").animate({top:"-="+self.img_h,height:"+="+self.img_h},self.speed);$(b).animate({height:"-="+self.img_h},self.speed,function(){$(this).css("display","none").css("height",self.img_h+"px");self.anim_finish()})};self.anim_squeeze_down=function(a,b){$(a).css("top","0px").css("height","0px").css("display","block").animate({height:"+="+self.img_h},self.speed);$(b).animate({height:"-="+self.img_h,top:"+="+self.img_h},self.speed,function(){$(this).css("display","none").css("top","0px").css("height",self.img_h+"px");self.anim_finish()})};self.anim_close_vert=function(a,b){var c=Math.ceil(self.img_h/2);var d=$(a).attr("id")+"_pcs";var e='<div id="'+d+'1" style="width:'+self.img_w+"px; height:"+c+"px; overflow:hidden; position:absolute; top:-"+c+'px; left:0px;"><img src="'+$(a).attr("src")+'" style="position:absolute; top:0px; left:0px; width:'+self.img_w+"px; height:"+self.img_h+'px;"></div>';var f='<div id="'+d+'2" style="width:'+self.img_w+"px; height:"+c+"px; overflow:hidden; position:absolute; top:"+self.img_h+'px; left:0px;"><img src="'+$(a).attr("src")+'" style="position:absolute; top:-'+c+"px; left:0px; width:"+self.img_w+"px; height:"+self.img_h+'px;"></div>';$(self.img_container).append(e).append(f);$("#"+d+"1").animate({top:"+="+c},self.speed);$("#"+d+"2").animate({top:"-="+c},self.speed,function(){$(a).css("display","block");$(b).css("display","none");$("#"+d+"1").css("display","none").remove();$("#"+d+"2").css("display","none").remove();self.anim_finish()})};self.anim_close_horiz=function(a,b){var c=Math.ceil(self.img_w/2);var d=$(a).attr("id")+"_pcs";var e='<div id="'+d+'1" style="width:'+c+"px; height:"+self.img_h+"px; overflow:hidden; position:absolute; top:0px; left:-"+c+'px;"><img src="'+$(a).attr("src")+'" style="position:absolute; top:0px; left:0px; width:'+self.img_w+"px; height:"+self.img_h+'px;"></div>';var f='<div id="'+d+'2" style="width:'+c+"px; height:"+self.img_h+"px; overflow:hidden; position:absolute; top:0px; left:"+self.img_w+'px;"><img src="'+$(a).attr("src")+'" style="position:absolute; top:0px; left:-'+c+"px; width:"+self.img_w+"px; height:"+self.img_h+'px;"></div>';$(self.img_container).append(e).append(f);$("#"+d+"1").animate({left:"+="+c},self.speed);$("#"+d+"2").animate({left:"-="+c},self.speed,function(){$(a).css("display","block");$(b).css("display","none");$("#"+d+"1").css("display","none").remove();$("#"+d+"2").css("display","none").remove();self.anim_finish()})};self.anim_open_vert=function(a,b){var c=Math.ceil(self.img_h/2);var d=$(b).attr("id")+"_pcs";var e='<div id="'+d+'1" style="width:'+self.img_w+"px; height:"+c+'px; overflow:hidden; position:absolute; top:0px; left:0px;"><img src="'+$(b).attr("src")+'" style="position:absolute; top:0px; left:0px; width:'+self.img_w+"px; height:"+self.img_h+'px;"></div>';var f='<div id="'+d+'2" style="width:'+self.img_w+"px; height:"+c+"px; overflow:hidden; position:absolute; top:"+c+'px; left:0px;"><img src="'+$(b).attr("src")+'" style="position:absolute; top:-'+c+"px; left:0px; width:"+self.img_w+"px; height:"+self.img_h+'px;"></div>';$(self.img_container).append(e).append(f);$(b).css("display","none");$(a).css("display","block");$("#"+d+"1").animate({top:"-="+c},self.speed);$("#"+d+"2").animate({top:"+="+c},self.speed,function(){$("#"+d+"1").css("display","none").remove();$("#"+d+"2").css("display","none").remove();self.anim_finish()})};self.anim_open_horiz=function(a,b){var c=Math.ceil(self.img_w/2);var d=$(b).attr("id")+"_pcs";var e='<div id="'+d+'1" style="width:'+c+"px; height:"+self.img_h+'px; overflow:hidden; position:absolute; top:0px; left:0px;"><img src="'+$(b).attr("src")+'" style="position:absolute; top:0px; left:0px; width:'+self.img_w+"px; height:"+self.img_h+'px;"></div>';var f='<div id="'+d+'2" style="width:'+c+"px; height:"+self.img_h+"px; overflow:hidden; position:absolute; top:0px; left:"+c+'px;"><img src="'+$(b).attr("src")+'" style="position:absolute; top:0px; left:-'+c+"px; width:"+self.img_w+"px; height:"+self.img_h+'px;"></div>';$(self.img_container).append(e).append(f);$(b).css("display","none");$(a).css("display","block");$("#"+d+"1").animate({left:"-="+c},self.speed);$("#"+d+"2").animate({left:"+="+c},self.speed,function(){$("#"+d+"1").css("display","none").remove();$("#"+d+"2").css("display","none").remove();self.anim_finish()})};self.anim_stripe_horiz=function(a,b){var c=Math.ceil(self.img_h/self.slice_h);var d=$(b).attr("id")+"_pcs";var e="";for(var f=0;f<self.slice_h;f++){$(self.img_container).append('<div id="'+d+f+'" style="width:'+self.img_w+"px; height:"+c+"px; overflow:hidden; position:absolute; top:"+c*f+'px; left:0px;"><img src="'+$(b).attr("src")+'" style="position:absolute; top:-'+c*f+"px; left:0px; width:"+self.img_w+"px; height:"+self.img_h+'px;"></div>')}$(b).css("display","none");$(a).css("display","block");for(f=0;f<self.slice_h;f++){if(f%2==0){e="+="}else{e="-="}if(f<self.slice_h-1){$("#"+d+f).delay(self.speed/2/self.slice_h*f).animate({left:e+self.img_w},self.speed/2)}else{$("#"+d+f).delay(self.speed/2/self.slice_h*f).animate({left:e+self.img_w},self.speed/2,function(){for(var a=0;a<self.slice_h;a++){$("#"+d+a).css("display","none").remove()}self.anim_finish()})}}};self.anim_stripe_vert=function(a,b){var c=Math.ceil(self.img_w/self.slice_w);var d=$(b).attr("id")+"_pcs";var e="";for(var f=0;f<self.slice_w;f++){$(self.img_container).append('<div id="'+d+f+'" style="width:'+c+"px; height:"+self.img_h+"px; overflow:hidden; position:absolute; top:0px; left:"+c*f+'px;"><img src="'+$(b).attr("src")+'" style="position:absolute; top:0px; left:-'+c*f+"px; width:"+self.img_w+"px; height:"+self.img_h+'px;"></div>')}$(b).css("display","none");$(a).css("display","block");for(f=0;f<self.slice_w;f++){if(f%2==0){e="+="}else{e="-="}if(f<self.slice_w-1){$("#"+d+f).delay(self.speed/2/self.slice_h*f).animate({top:e+self.img_h},self.speed/2)}else{$("#"+d+f).delay(self.speed/2/self.slice_h*f).animate({top:e+self.img_h},self.speed/2,function(){for(var a=0;a<self.slice_w;a++){$("#"+d+a).css("display","none").remove()}self.anim_finish()})}}};self.anim_cubize_zoomin=function(a,b){var c=Math.ceil(self.img_w/self.slice_w);var d=Math.ceil(self.img_h/self.slice_h);var e=$(a).attr("id")+"_pcs";var f=0;var g;var h;for(g=0;g<self.slice_w;g++){for(h=0;h<self.slice_h;h++){$(self.img_container).append('<div id="'+e+f+'" style="width:0px; height:0px; overflow:hidden; position:absolute; top:'+(d*h+d/2)+"px; left:"+(c*g+c/2)+'px;"><img id="'+e+"IM_"+f+'" src="'+$(a).attr("src")+'" style="position:absolute; top:-'+(d*h+d/2)+"px; left:-"+(c*g+c/2)+"px; width:"+self.img_w+"px; height:"+self.img_h+'px;"></div>');f++}}$(b).css("display","block");$(a).css("display","none");for(g=0;g<f;g++){if(g<f-1){$("#"+e+g).animate({width:"+="+c,height:"+="+d,top:"-="+d/2,left:"-="+c/2},self.speed);$("#"+e+"IM_"+g).animate({top:"+="+d/2,left:"+="+c/2},self.speed)}else{$("#"+e+"IM_"+g).animate({top:"+="+d/2,left:"+="+c/2},self.speed);$("#"+e+g).animate({width:"+="+c,height:"+="+d,top:"-="+d/2,left:"-="+c/2},self.speed,function(){$(b).css("display","none");$(a).css("display","block");for(g=0;g<f;g++){$("#"+e+g).css("display","none").remove()}self.anim_finish()})}}};self.anim_cubize_zoomout=function(a,b){var c=Math.ceil(self.img_w/self.slice_w);var d=Math.ceil(self.img_h/self.slice_h);var e=$(b).attr("id")+"_pcs";var f=0;var g;var h;for(g=0;g<self.slice_w;g++){for(h=0;h<self.slice_h;h++){$(self.img_container).append('<div id="'+e+f+'" style="width:'+c+"px; height:"+d+"px; overflow:hidden; position:absolute; top:"+d*h+"px; left:"+c*g+'px;"><img id="'+e+"IM_"+f+'" src="'+$(b).attr("src")+'" style="position:absolute; top:-'+d*h+"px; left:-"+c*g+"px; width:"+self.img_w+"px; height:"+self.img_h+'px;"></div>');f++}}$(b).css("display","none");$(a).css("display","block");for(g=0;g<f;g++){if(g<f-1){$("#"+e+g).animate({width:"-="+c,height:"-="+d,top:"+="+d/2,left:"+="+c/2},self.speed);$("#"+e+"IM_"+g).animate({top:"-="+d/2,left:"-="+c/2},self.speed)}else{$("#"+e+g).animate({width:"-="+c,height:"-="+d,top:"+="+d/2,left:"+="+c/2},self.speed,function(){for(g=0;g<f;g++){$("#"+e+g).css("display","none").remove()}self.anim_finish()})}}};self.anim_cubize_fade_horiz=function(a,b){var c=Math.ceil(self.img_w/self.slice_w);var d=Math.ceil(self.img_h/self.slice_h);var e=$(b).attr("id")+"_pcs";var f=0;var g;var h;for(h=0;h<self.slice_h;h++){for(g=0;g<self.slice_w;g++){$(self.img_container).append('<div id="'+e+f+'" style="width:'+c+"px; height:"+d+"px; overflow:hidden; position:absolute; top:"+d*h+"px; left:"+c*g+'px;"><img src="'+$(b).attr("src")+'" style="position:absolute; top:-'+d*h+"px; left:-"+c*g+"px; width:"+self.img_w+"px; height:"+self.img_h+'px;"></div>');f++}}$(b).css("display","none");$(a).css("display","block");var i=self.speed/4*3/f;for(g=0;g<f;g++){if(g<f-1){$("#"+e+g).delay(i*g).fadeOut(self.speed/4)}else{$("#"+e+g).delay(i*g).fadeOut(self.speed/4,function(){for(g=0;g<f;g++){$("#"+e+g).css("display","none").remove()}self.anim_finish()})}}};self.anim_cubize_fade_vert=function(a,b){var c=Math.ceil(self.img_w/self.slice_w);var d=Math.ceil(self.img_h/self.slice_h);var e=$(b).attr("id")+"_pcs";var f=0;var g;var h;for(g=0;g<self.slice_w;g++){for(h=0;h<self.slice_h;h++){$(self.img_container).append('<div id="'+e+f+'" style="width:'+c+"px; height:"+d+"px; overflow:hidden; position:absolute; top:"+d*h+"px; left:"+c*g+'px;"><img src="'+$(b).attr("src")+'" style="position:absolute; top:-'+d*h+"px; left:-"+c*g+"px; width:"+self.img_w+"px; height:"+self.img_h+'px;"></div>');f++}}$(b).css("display","none");$(a).css("display","block");var i=self.speed/4*3/f;for(g=0;g<f;g++){if(g<f-1){$("#"+e+g).delay(i*g).fadeOut(self.speed/4)}else{$("#"+e+g).delay(i*g).fadeOut(self.speed/4,function(){for(g=0;g<f;g++){$("#"+e+g).css("display","none").remove()}self.anim_finish()})}}};self.anim_cubize_fade_rand=function(a,b){var c=Math.ceil(self.img_w/self.slice_w);var d=Math.ceil(self.img_h/self.slice_h);var e=$(b).attr("id")+"_pcs";var f=[];var g=0;var h;var i;var j="";var k="";for(i=0;i<self.slice_h;i++){for(h=0;h<self.slice_w;h++){$(self.img_container).append('<div id="'+e+g+'" style="width:'+c+"px; height:"+d+"px; overflow:hidden; position:absolute; top:"+d*i+"px; left:"+c*h+'px;"><img src="'+$(b).attr("src")+'" style="position:absolute; top:-'+d*i+"px; left:-"+c*h+"px; width:"+self.img_w+"px; height:"+self.img_h+'px;"></div>');g++}}$(b).css("display","none");$(a).css("display","block");for(h=0;h<g;h++){f[h]=h}for(h=0;h<g;h++){j=Math.floor(Math.random()*f.length);k=f[j];f.splice(j,1);if(h<g-1){$("#"+e+k).delay(self.speed/4*3/g*h).fadeOut(self.speed/4)}else{$("#"+e+k).delay(self.speed/4*3/g*h).fadeOut(self.speed/4,function(){for(h=0;h<g;h++){$("#"+e+h).css("display","none").remove()}self.anim_finish()})}}};self.anim_veneziana_vert=function(a,b){var c=Math.ceil(self.img_w/self.slice_w);var d=$(b).attr("id")+"_pcs";for(var e=0;e<self.slice_w;e++){$(self.img_container).append('<div id="'+d+e+'" style="width:'+c+"px; height:"+self.img_h+"px; overflow:hidden; position:absolute; top:0px; left:"+c*e+'px;"><img src="'+$(b).attr("src")+'" style="position:absolute; top:0px; left:-'+c*e+"px; width:"+self.img_w+"px; height:"+self.img_h+'px;"></div>')}$(b).css("display","none");$(a).css("display","block");for(e=0;e<self.slice_w;e++){if(e<self.slice_w-1){$("#"+d+e).animate({width:"-="+c,left:"+="+c/2},self.speed)}else{$("#"+d+e).animate({width:"-="+c,left:"+="+c/2},self.speed,function(){for(var a=0;a<self.slice_w;a++){$("#"+d+a).css("display","none").remove()}self.anim_finish()})}}};self.anim_veneziana_horiz=function(a,b){var c=Math.ceil(self.img_h/self.slice_h);var d=$(b).attr("id")+"_pcs";for(var e=0;e<self.slice_h;e++){$(self.img_container).append('<div id="'+d+e+'" style="width:'+self.img_w+"px; height:"+c+"px; overflow:hidden; position:absolute; top:"+c*e+'px; left:0px;"><img src="'+$(b).attr("src")+'" style="position:absolute; top:-'+c*e+"px; left:0px; width:"+self.img_w+"px; height:"+self.img_h+'px;"></div>')}$(b).css("display","none");$(a).css("display","block");for(e=0;e<self.slice_h;e++){if(e<self.slice_h-1){$("#"+d+e).animate({height:"-="+c,top:"+="+c},self.speed)}else{$("#"+d+e).animate({height:"-="+c,top:"+="+c},self.speed,function(){for(var a=0;a<self.slice_h;a++){$("#"+d+a).css("display","none").remove()}self.anim_finish()})}}};self.anim_quad_open=function(a,b){var c=Math.ceil(self.img_w/2);var d=Math.ceil(self.img_h/2);var e=$(b).attr("id")+"_pcs";var f='<div id="'+e+'1" style="width:'+c+"px; height:"+d+'px; overflow:hidden; position:absolute; top:0px; left:0px;"><img src="'+$(b).attr("src")+'" style="position:absolute; top:0px; left:0px; width:'+self.img_w+"px; height:"+self.img_h+'px;"></div>';var g='<div id="'+e+'2" style="width:'+c+"px; height:"+d+"px; overflow:hidden; position:absolute; top:0px; left:"+c+'px;"><img src="'+$(b).attr("src")+'" style="position:absolute; top:0px; left:-'+c+"px; width:"+self.img_w+"px; height:"+self.img_h+'px;"></div>';var h='<div id="'+e+'3" style="width:'+c+"px; height:"+d+"px; overflow:hidden; position:absolute; top:"+d+'px; left:0px;"><img src="'+$(b).attr("src")+'" style="position:absolute; top:-'+d+"px; left:0px; width:"+self.img_w+"px; height:"+self.img_h+'px;"></div>';var i='<div id="'+e+'4" style="width:'+c+"px; height:"+d+"px; overflow:hidden; position:absolute; top:"+d+"px; left:"+c+'px;"><img src="'+$(b).attr("src")+'" style="position:absolute; top:-'+d+"px; left:-"+c+"px; width:"+self.img_w+"px; height:"+self.img_h+'px;"></div>';$(self.img_container).append(f).append(g).append(h).append(i);$(a).css("display","block");$(b).css("display","none");$("#"+e+"1").animate({top:"-="+d,left:"-="+c},self.speed);$("#"+e+"2").animate({top:"-="+d,left:"+="+c},self.speed);$("#"+e+"3").animate({top:"+="+d,left:"-="+c},self.speed);$("#"+e+"4").animate({top:"+="+d,left:"+="+c},self.speed,function(){$("#"+e+"1").css("display","none").remove();$("#"+e+"2").css("display","none").remove();$("#"+e+"3").css("display","none").remove();$("#"+e+"4").css("display","none").remove();self.anim_finish()})};self.anim_quad_close=function(a,b){var c=Math.ceil(self.img_w/2);var d=Math.ceil(self.img_h/2);var e=$(a).attr("id")+"_pcs";var f='<div id="'+e+'1" style="width:'+c+"px; height:"+d+"px; overflow:hidden; position:absolute; top:-"+d+"px; left:-"+c+'px;"><img src="'+$(a).attr("src")+'" style="position:absolute; top:0px; left:0px; width:'+self.img_w+"px; height:"+self.img_h+'px;"></div>';var g='<div id="'+e+'2" style="width:'+c+"px; height:"+d+"px; overflow:hidden; position:absolute; top:-"+d+"px; left:"+self.img_w+'px;"><img src="'+$(a).attr("src")+'" style="position:absolute; top:0px; left:-'+c+"px; width:"+self.img_w+"px; height:"+self.img_h+'px;"></div>';var h='<div id="'+e+'3" style="width:'+c+"px; height:"+d+"px; overflow:hidden; position:absolute; top:"+self.img_h+"px; left:-"+c+'px;"><img src="'+$(a).attr("src")+'" style="position:absolute; top:-'+d+"px; left:0px; width:"+self.img_w+"px; height:"+self.img_h+'px;"></div>';var i='<div id="'+e+'4" style="width:'+c+"px; height:"+d+"px; overflow:hidden; position:absolute; top:"+self.img_h+"px; left:"+self.img_w+'px;"><img src="'+$(a).attr("src")+'" style="position:absolute; top:-'+d+"px; left:-"+c+"px; width:"+self.img_w+"px; height:"+self.img_h+'px;"></div>';$(self.img_container).append(f).append(g).append(h).append(i);$("#"+e+"1").animate({top:"+="+d,left:"+="+c},self.speed);$("#"+e+"2").animate({top:"+="+d,left:"-="+c},self.speed);$("#"+e+"3").animate({top:"-="+d,left:"+="+c},self.speed);$("#"+e+"4").animate({top:"-="+d,left:"-="+c},self.speed,function(){$(a).css("display","block");$(b).css("display","none");$("#"+e+"1").css("display","none").remove();$("#"+e+"2").css("display","none").remove();$("#"+e+"3").css("display","none").remove();$("#"+e+"4").css("display","none").remove();self.anim_finish()})};self.anim_zoom_in=function(a,b){var c=$(a).attr("id")+"_pcs";var d='<div id="'+c+'1" style="width:0px; height:0px; overflow:hidden; position:absolute; top:'+self.img_h/2+"px; left:"+self.img_w/2+'px;"><img id="'+c+'2" src="'+$(a).attr("src")+'" style="position:absolute; top:-'+self.img_h/2+"px; left:-"+self.img_w/2+"px; width:"+self.img_w+"px; height:"+self.img_h+'px;"></div>';$(self.img_container).append(d);$("#"+c+"2").animate({top:"+="+self.img_h/2,left:"+="+self.img_w/2},self.speed);$("#"+c+"1").animate({top:"-="+self.img_h/2,left:"-="+self.img_w/2,width:"+="+self.img_w,height:"+="+self.img_h},self.speed,function(){$(a).css("display","block");$(b).css("display","none");$("#"+c+"1").css("display","none").remove();$("#"+c+"2").css("display","none").remove();self.anim_finish()})};self.anim_zoom_out=function(a,b){var c=$(b).attr("id")+"_pcs";var d='<div id="'+c+'1" style="width:'+self.img_w+"px; height:"+self.img_h+'px; overflow:hidden; position:absolute; top:0px; left:0px;"><img id="'+c+'2" src="'+$(b).attr("src")+'" style="position:absolute; top:0px; left:0px; width:'+self.img_w+"px; height:"+self.img_h+'px;"></div>';$(self.img_container).append(d);$(a).css("display","block");$(b).css("display","none");$("#"+c+"2").animate({top:"-="+self.img_h/2,left:"-="+self.img_w/2},self.speed);$("#"+c+"1").animate({top:"+="+self.img_h/2,left:"+="+self.img_w/2,width:"-="+self.img_w,height:"-="+self.img_h},self.speed,function(){$("#"+c+"1").css("display","none").remove();$("#"+c+"2").css("display","none").remove();self.anim_finish()})}}})(jQuery);

