// JavaScript Document


//menu dropdown
$(function () {
	$('.dropdown').each(function () {
		$(this).parent().eq(0).hover(function () {
			$('.dropdown:eq(0)', this).show();
		}, function () {
			$('.dropdown:eq(0)', this).hide();
		});
	});
});



//colortip

	//aggiunge una tooltip colorata alle icone di errore del form di attivazione
	$(document).ready(function(){
		$('.errore[title]').colorTip({color:'red'});
		$('.help[title]').colorTip({color:'blue'});
	});

		

//rollover immagini
		
		$(
				function()
				{
					// set up rollover
					$("img.rollover").hover(
						function()
						{
							this.src = this.src.replace(".jpg","-roll.jpg");
						},
						function()
						{
							this.src = this.src.replace("-roll.jpg",".jpg");
						}
					);
				}
			)
		
		
		
//fade buste estensioni	
		$(document).ready(function(){
			$(".busta").fadeTo("fast", 0.6);
			
			$(".busta").hover(function(){
					$(this).fadeTo("slow", 1.0);
				},function(){
					$(this).fadeTo("fast", 0.6);
			});
		});
		
		function colora (id) {
			$("#" + id).fadeTo("slow", 1.0);
			//$("#2").fadeTo("slow", 1.0);
		}
		
		function decolora (id) {
			$("#" + id).fadeTo("fast", 0.6);
			//$("#2").fadeTo("slow", 1.0);
		}
		
		
		
//facebox		
		jQuery(document).ready(function($) {
			$('a[rel*=facebox]').facebox({
				loading_image:	'loading.gif',
				close_image:	'closelabel.gif'
			});
		});
		
		
//cycle lite		
			$(document).ready(function() {
				$('#fade').cycle({
					delay:  0, 
					speed:  1500,
					timeout: 4000
				});
				
				$('#fade_buste').cycle({
					delay:  0, 
					speed:  500,
					timeout: 1000
				});
			});
			
			
			
//popup
	var win = null;
	function NewWindow(mypage,myname,w,h,scroll){
		LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
		TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
		settings =
		'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
		win = window.open(mypage,myname,settings)
	}
		

	
		
//swf object		
	swfobject.registerObject("myFlashContent", "8.0.0");
	swfobject.registerObject("myFlashContent_gingle", "8.0.0");
	swfobject.registerObject("myFlashContent_video", "8.0.0");
