var main_host;
var img_array = new Array();
var swap_img = "";
var debug = true;

$().ready(function() {

	hReplace();

	preloadImages();

	main_host = $('base').attr('href');
	
	afterCSS3('req', ' *');

	log('Campi restricted: '+$('.restricted').size());
	$('.restricted').bind('keypress', function(e) {
		return restricted(e, $(this).attr('rel'));
	});

	/**
	 * Gestione degli helptip.
	 */
	$('.helptip').hover(function() { showhelptip(this);}, function () {hidehelptip()});
	$('.helptip').bind('click', function() { return false; });

	$('.newwindow').each(function() {
		$(this).attr({'title' : $(this).attr('title')+' '+getLang('base', 'NEW_WINDOW')});
	});

	$('.newwindow').bind('click', function() {
		href = $(this).attr('href');
		height = $(window).height()-30;
		width = $(window).width()-30;
		window.open(href, '', 'width='+width+',height='+height);
		return false;
	});

	$('#audiorecaptcha').bind('click', function() {
		recaptchaAudio();
		return false;
	});

	$('#textrecaptcha').bind('click', function() {
		recaptchaText();
		return false;
	});
	
	$('.menu_centrale a').html('');

	$('.popupmap').click(function() {
		openModalBenessere(this);
		return false;
	});
	
	winref = false;
	
	$("a[href$='disponibilita/']").click(function() {
		if(winref !== false) {
			winref.focus();
		} 
		winref = window.open($(this).attr('href'), 'disponibilita', 'width=700,height=300');
		return false;
	});

});

$(window).load(function() {
	$('.rollover').hover(function() { rolloverimg(this) },function() { rolloutimg(this) });
});







