	$(document).ready( function(){

		jQuery.fn.fadeToggle = function(speed, easing, callback) {
		    return this.animate({opacity: 'toggle'}, speed, easing, callback);
		};

	//	per i bottoni a larghezza variabile
	    $("p.ut-bt").mouseup(function(){
			$(this).removeClass('ut-bt-click');
	    }).mousedown(function(){
			$(this).addClass('ut-bt-click');
	    });
	    $("button").mouseup(function(){
			$(this).removeClass('button-click');
	    }).mousedown(function(){
			$(this).addClass('button-click');
	    });

	//	png24 fix ie
		$('body').supersleight({shim: '/static/js/x.gif'});
		
	//	workaraund userbar per safari
		$('#userbar form#ub-credenziali #ub-pin-wrap .jNiceInputWrapper').ready(function(){
			$(this).css("position","absolute");
			$(this).css("left","142px");
			$(this).css("top","-3px");
		});

	//	inserisce codice per pezzetto di linea #ccc top right in #rightcol
		$tr_ccc = $('<div id="tr-ccc"></div>');
		$('body#p-hp-poker-loggato #rightcol').append($tr_ccc);
		$('body#p-hp-poker-non-loggato #rightcol').append($tr_ccc);
		$('body#p-interna #rightcol').append($tr_ccc);
		$('body#p-gratta-vinci #midcol').append($tr_ccc);
		$('body#p-hp-scommesse #rightcol').append($tr_ccc);

	//	inserisce codice per pezzetto di linea in alto a sinistra in #midcol
		$tr_ff7400 = $('<div id="tr-ff7400"></div>');
		$('body#p-hp-scommesse #midcol').append($tr_ff7400);

	//	a.disable
		$("a.disable").click(function() {
			return false;
		});

	//	toglie il value a tutti gli input al click, lascia solo se ne � gi� stato inserito uno
		$('input.text').focus(function(){
			$input_val = $(this).val();
			if (!($(this).hasClass('edited')))
				$(this).val('');
		}).blur(function(){
		if ( $(this).val() == '' )
			$(this).val($input_val);
		else
			$(this).addClass('edited');
		})

	//	inserisce codice per l'arrotondamento del #sez-menu
		$sez_menu_tr_corner = $('<div class="rounded"></div>');
		$('#sez-menu').append($sez_menu_tr_corner);
				
	/*	applica la classe "hover" a <button>, <li>, <p> e a qualche altro elemento particolare
		$('button').hover(function(){
			$(this).addClass('hover');
		}, function(){
			$(this).removeClass('hover');
		});
		$('li').hover(function(){
			$(this).addClass('hover');
		}, function(){
			$(this).removeClass('hover');
		});
		$('p').hover(function(){
			$(this).addClass('hover');
		}, function(){
			$(this).removeClass('hover');
		});
		$('p.ut-bt').hover(function(){
			$(this).removeClass('hover');
			$(this).addClass('hover-ut-bt');
		}, function(){
			$(this).removeClass('hover-ut-bt');
		});
		$('#userbar p.userbar-drop').hover(function(){
			$(this).removeClass('hover');
			$(this).addClass('hover-userbar-drop');
		}, function(){
			$(this).removeClass('hover-userbar-drop');
		});
	*/
		/* $('a').hover(function(){
			$(this).addClass('hover');
		}, function(){
			$(this).removeClass('hover');
		}); */

	/*
		$('input.submit').hover(function(){
			$(this).addClass('hover');
		}, function(){
			$(this).removeClass('hover');
		});
	*/


	//	per il comportamenro degli avvisi nella userbar
		$('div.userbar-drop-wrap p').addClass('closed');

       



       

	//	pseudo selectors per <p> <ul> e <li>
	//	$('p:last-child').addClass('last-child');
	//	$('p:first-child').addClass('first-child');
	//	$('ul:last-child').addClass('last-child');
	//	$('ul:first-child').addClass('first-child');
	//	$('li:last-child').addClass('last-child');
	//	$('li:first-child').addClass('first-child');
	//	$('tr:last-child').addClass('last-child');
	//	$('tr:first-child').addClass('first-child');
	//	$('td:last-child').addClass('last-child');
	//	$('td:first-child').addClass('first-child');

	/*	per il comportamento del menu di sinistra
		$('.toggle-sport a').addClass('open')
		$('div#leftmenu h2 a').click(function(){
			toClose = $(this).hasClass('contrai');
			toOpen = $(this).hasClass('espandi');
			if ( toClose ){
				$(this).removeClass('contrai');
				$(this).addClass('espandi');
				$(this).attr('title', 'espandi');
				$('.toggle-sport a').removeClass('open');
				$('.sport-section').css('display','none');
			}
			if ( toOpen ){
				$(this).removeClass('espandi');
				$(this).addClass('contrai');
				$(this).attr('title', 'contrai');
				$('.toggle-sport a').addClass('open');
				$('.sport-section').css('display','block');
			}
//			action = ( $('.sport-section').css('display') == 'none' ? true : false );
//			$('.sport-section').toggle(action);
			return false;
		});
		$('.toggle-sport a').click(function(){
			$(this).parent().find('ul').toggle();
			$(this).toggleClass('open');
			return false;
		});

		*/

		// per la navigazione a tab
//		$('ul.tab li a').click(function(){
//			$(this).parent().parent().children().children().removeClass('active');
//			$(this).toggleClass('active');
//		});

	});


  
 
