var main_host;
var img_array = new Array();
var swap_img = "";
var debug = false;

$().ready(function() {

	hReplace();

	preloadImages();

	main_host = $('base').attr('href');

	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;
	});
	
	if($('.gmaps').length > 0) {
		$('.gmaps').jMapping();
	}
	
	$('#headBanner').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		speed: '3000', 
		timeout : '9000'
	});
	

});

$(window).load(function() {
	$('.rollover').hover(function() { rolloverimg(this) },function() { rolloutimg(this) });
});







