document.write("<script type='text/javascript' src='../js/animatedcollapse.js'></scr"+"ipt>");
document.write("<script type='text/javascript' src='../js/bookmarkscroll.js'></scr"+"ipt>");
document.write("<script type='text/javascript' src='../js/jquery.tipsy.js'></scr"+"ipt>");
document.write("<script type='text/javascript' src='../js/jquery.fancybox.js'></scr"+"ipt>");
document.write("<script type='text/javascript' src='../js/jquery.mousewheel.pack.js'></scr"+"ipt>");
document.write("<script type='text/javascript' src='../js/jquery.pngFix.js'></scr"+"ipt>");
document.write("<script type='text/javascript' src='../js/plusone.js'></scr"+"ipt>");

$(document).ready(function() {
		$(".dintorni #content .toggle_content").hide();
		$("#prezzi .toggle_content").hide();
		$(".c_prezzi .toggle_content").hide();
		
		$(".toggle").toggle(function(){
			$(this).addClass("tactive");
		}, function () {
			$(this).removeClass("tactive");
		});
		$(".toggle").click(function(){
			$(this).next(".toggle_content").slideToggle();
		});
		$(".dove a").click(function(){
		   	$('.dove a').each( function() { $(this).removeClass('d_active'); });
		   	$(this).addClass('d_active');
		});
		$(".goog").fancybox({
						'width'				: 655,
						'height'			: 455,
						'autoScale'     	: false,
				        'transitionIn'		: 'none',
						'transitionOut'		: 'none',
						'type'				: 'iframe'
					});
		$(".infoleg").fancybox({
						'width'				: 650,
						'height'			: 650,
						'autoScale'     	: false,
				        'transitionIn'		: 'none',
						'transitionOut'		: 'none',
						'type'				: 'iframe'
					});
		$(".contacts").fancybox({
						'width'				: 650,
						'height'			: 450,
						'transitionIn'		: 'none',
						'transitionOut'		: 'none',
						'type'				: 'iframe'
					});
		$("a[rel=booking]").fancybox({
						'width'				: 650,
						'height'			: 650,
						'scrolling'			: 'no',
				        'transitionIn'		: 'none',
						'transitionOut'		: 'none',
						'type'				: 'iframe'
					});
		$("a[rel=w4]").fancybox({
						'cyclic'			:	false,
						'transitionIn'		: 'none',
						'transitionOut'		: 'none',
						'titlePosition' 	: 'over',
						'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
						    return '<span id="fancybox-title-over">RESIDENCE CELESTE - Come Eravamo ' +  (currentIndex + 1) + ' / ' + currentArray.length + '</span>';
						}
					});
		$("a[rel=w5]").fancybox({
						'cyclic'			:	false,
						'transitionIn'		: 'none',
						'transitionOut'		: 'none',
						'titlePosition' 	: 'over',
						'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
						    return '<span id="fancybox-title-over">RESIDENCE CELESTE - Cosa Dicono di Noi ' +  (currentIndex + 1) + ' / ' + currentArray.length + '</span>';
						}
					});			
		$("a[rel=w6]").fancybox({
						'cyclic'			:	false,
						'transitionIn'		: 'none',
						'transitionOut'		: 'none',
						'titlePosition' 	: 'over',
						'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
						    return '<span id="fancybox-title-over">RESIDENCE CELESTE - Visita Virtuale ' +  (currentIndex + 1) + ' / ' + currentArray.length + '</span>';
						}
					});
		$('a.tipTip').tipsy();
		$('.tipTip').tipsy();
		$('#risorse a').tipsy({gravity: 'e'});
		$('a#logo').tipsy();
		$('#flags a').tipsy();
		$('#footer a').tipsy({gravity: 's'});
		
		$("a.zoom").fancybox();
		
		animatedcollapse.addDiv('CDC', 'fade=1,speed=500,group=RC')
		animatedcollapse.addDiv('APT', 'fade=1,speed=500,group=RC')
		animatedcollapse.addDiv('SRV', 'fade=1,speed=500,group=RC')
		
		animatedcollapse.addDiv('T1', 'fade=1,speed=500,group=4T')
		animatedcollapse.addDiv('T2', 'fade=1,speed=500,group=4T')
		animatedcollapse.addDiv('T3', 'fade=1,speed=500,group=4T')
		animatedcollapse.addDiv('T4', 'fade=1,speed=500,group=4T')
		animatedcollapse.addDiv('T5', 'fade=1,speed=500,group=4T')
		
		animatedcollapse.addDiv('DSlago', 'fade=1,speed=500,group=w2')
		animatedcollapse.addDiv('DSsatellite', 'fade=1,speed=500,group=w2')
		animatedcollapse.addDiv('DSgmap', 'fade=1,speed=500,group=w2')
		
		animatedcollapse.addDiv('musei', 'fade=1,speed=500,group=w7')
		animatedcollapse.addDiv('ville', 'fade=1,speed=500,group=w7')
		animatedcollapse.addDiv('chiese', 'fade=1,speed=500,group=w7')
		animatedcollapse.addDiv('sport', 'fade=1,speed=500,group=w7')
		animatedcollapse.addDiv('localita', 'fade=1,speed=500,group=w7')
		
		
		animatedcollapse.ontoggle=function($, divobj, state){ //fires each time a DIV is expanded/contracted
			//$: Access to jQuery
			//divobj: DOM reference to DIV being expanded/ collapsed. Use "divobj.id" to get its ID
			//state: "block" or "none", depending on state
		}
		animatedcollapse.init()
		
	});

