var main_host;
var img_array = new Array();
var swap_img = "";
var debug = true;

$().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;
  });

});

$(window).load(function() {
  $('.rollover').hover(function() { rolloverimg(this) },function() { rolloutimg(this) });
});






