// Global onready event
jQuery(document).ready(function() {



	if(jQuery.cluetip){
		jQuery('a.jt').cluetip({
			width:352,
			cluetipClass: 'jtip',
			arrows: true,
			dropShadow: true,
			hoverIntent: false,
			sticky: true,
			mouseOutClose: true,
			fx: {
				open:       'fadeIn', // can be 'show' or 'slideDown' or 'fadeIn'
				openSpeed:  '800'
			},
			closePosition: 'title',
			closeText: '<img src="' + ASAP.CORE.URL +'/administrator/js/jquery/cluetip/images/close.png" alt="Chiudi" />'
		});


		jQuery('a.jt-local').cluetip({
			width:440,
			cluetipClass: 'jtip',
			arrows: true,
			dropShadow: true,
			hoverIntent: false,
			sticky: false,
			mouseOutClose: true,
			fx: {
				open:       'fadeIn', // can be 'show' or 'slideDown' or 'fadeIn'
				openSpeed:  '800'
			},
			closePosition: 'title',
			closeText: '<img src="' + ASAP.CORE.URL +'/administrator/js/jquery/cluetip/images/close.png" alt="Chiudi" />'
		});


		jQuery('a.jt-text').cluetip({
			width:200,
			cluetipClass: 'jtip',
			arrows: true,
			dropShadow: true,
			hoverIntent: false,
			splitTitle: '|',
			sticky: false,
			mouseOutClose: true,
			fx: {
				open:       'fadeIn', // can be 'show' or 'slideDown' or 'fadeIn'
				openSpeed:  '800'
			},
			closePosition: 'title',
			closeText: '<img src="' + ASAP.CORE.URL +'/administrator/js/jquery/cluetip/images/close.png" alt="Chiudi" />'
		});
	}

	

	// SEXY SCROLL TO TOP
	if (document.getElementById('goup')){
		jQuery("#goup").click(function(){
			var h = jQuery("body").height();

			jQuery("body,html").animate({ scrollTop: 0 }, 1000);
			return false;
		});
	}




	//Page Flip on hover
	if (document.getElementById('pageflip')){
		jQuery("#pageflip").hover(function() {
			jQuery("#pageflip img , .msg_block").stop()
			.animate({
				width: '307px',
				height: '319px'
			}, 500);
		} , function() {
			jQuery("#pageflip img").stop()
			.animate({
				width: '50px',
				height: '52px'
			}, 220);
			jQuery(".msg_block").stop()
			.animate({
				width: '50px',
				height: '50px'
			}, 200);
		});
	}

	if (document.getElementById('nav-bar-list')){

		 jQuery(document).ready(function(){ 
		        jQuery("ul.sf-menu").superfish({ 
		            pathClass:  'current' ,		      
		            animation:   {opacity:'show',height:'show'},     
					delay:     2000               // 1.2 second delay on mouseout
		        }); 
		    }); 

	}


	jQuery('a.zoom').fancybox({
	'zoomOpacity'			: true,
	'overlayShow'			: false,
	'frameWidth' : jQuery(window).width() - 250,
	'frameHeight' : jQuery(window).height() - 250,
	'zoomSpeedIn'			: 500,
	'zoomSpeedOut'			: 500,
	'hideOnContentClick': true
	});
	
	/*
	jQuery("body").append("<div id=\"icoa-tip\">&nbsp;</div><div id=\"icoa-big-tip\">&nbsp;</div>");
	
	jQuery(".hasTip[rel]").tooltip({
		tip: "#icoa-tip",
		fadeInSpeed : 250,
		effect : 'fade',
		source: "rel"
	});
	
	jQuery(".hasBigTip[rel]").tooltip({
		tip: "#icoa-big-tip",
		fadeInSpeed : 250,
		effect : 'fade',
		source: "rel"
	});
	
	*/



});