

jQuery(document).ready(function(){
	
		    jQuery(".spotwrapper img.thumb, .spotwrapper a,.spotwrapper2 img.thumb, .spotwrapper2 a").tooltip({ 
		        tip: '#tip',  
		        offset: [10, 2], 
		        effect: 'slide',
		        delay:1000
		    }).dynamic( { 
		        bottom: { 
		            direction: 'down', 
		            bounce: true 
		        } 
		    }); 
		    
		   
		    
		    jQuery("#actrigger").bind('click',function(){
		    	if(jQuery(this).parents('#areaclienti').css('width')=="680px"){
		    			jQuery(".hiddenform").fadeOut(300,function(){
		    				jQuery("#areaclienti").animate({width: '300', height:'30'});		    				
		    				jQuery("#areaclienti div.bg").animate({opacity: '0.5'});
		    			});   			
		    		}else{
		    			jQuery("#areaclienti").animate({width: '680', height:'85'}, function(){
		    			   jQuery("#areaclienti div.bg").animate({opacity: '1'});
		    				jQuery(".hiddenform").fadeIn(300);
		    				
		    			}); 
			    		
			    	} 
		    	});
		    
		    jQuery("#areaclienti input,#search input").focus(function(){
		    	if(jQuery(this).val()==jQuery(this).attr('rel')){
		    		jQuery(this).val('');
		    	}		    	
		    	return false;
		    });

		    jQuery("#areaclienti input, #search input").blur(function(){		    
		    	if(jQuery(this).val()==""){
		    		jQuery(this).val(jQuery(this).attr('rel'));
		    	}
		    });	    	
		    //jQuery("#areaclienti input[type=text]").click(function(){return false;});
		    

       
		    jQuery('#areaclienti').click(function(e)
			{
				e.stopPropagation();
			});

		    jQuery(document).click(function()
			{
		    	if(jQuery("#areaclienti").css('width')=="680px"){
	    			jQuery(".hiddenform").fadeOut(300,function(){
		    				jQuery("#areaclienti").animate({width: '300', height:'30'});		    				
		    				jQuery("#areaclienti div.bg").animate({opacity: '0.5'});	    				
	    			});   			
	    		}
			});

		    $("div.scrollable").scrollable({ 
		        vertical:true,  
		        size: 1 
		    });     

		    
});