current ="";

/**
 * jQuery.fullBg
 * Version 1.0
 * Copyright (c) 2010 c.bavota - http://bavotasan.com
 * Dual licensed under MIT and GPL.
 * Date: 02/23/2010
**/
(function($) {
  $.fn.fullBg = function(){
    var bgImg = $(this);		
 
    function resizeImg() {
      var imgwidth = bgImg.width();
      var imgheight = bgImg.height();
 
      var winwidth = $(window).width();
      var winheight = $(window).height();
 
      var widthratio = winwidth / imgwidth;
      var heightratio = winheight / imgheight;
 
      var widthdiff = heightratio * imgwidth;
      var heightdiff = widthratio * imgheight;
 
      if(heightdiff>winheight) {
        bgImg.css({
          width: winwidth+'px',
          height: heightdiff+'px'
        });
      } else {
        bgImg.css({
          width: widthdiff+'px',
          height: winheight+'px'
        });		
      }
    } 
    resizeImg();
    $(window).resize(function() {
      resizeImg();
    }); 
  };
})(jQuery)

$(window).load(function() {
	$("#background").fullBg();
	$("#background-div").css("visibility","visible");
});

var credits_open = false;

function show_credits() {
	if (credits_open) {
		credits_open = false;
		$('#credits').stop().fadeOut('slow');
	} else {
		credits_open = true;
		$('#credits').stop().fadeIn('slow');	
	}
}

function evo_send_mail() {
	document.getElementById('modulo').action = '../java/inviamail.php'; 
	submit();	
}

function set_current(id) {
		num = id - 1;
		current = current_artista + " - " + $('#dettagli .panel:eq(' + num + ')').children('.titolo-opera').text();
}
