Shadowbox.loadSkin('classic', 'lib/js/shadowbox');
Shadowbox.loadLanguage('it', 'lib/js/shadowbox/lang');
Shadowbox.loadPlayer(['flv', 'html', 'iframe', 'img', 'qt', 'swf', 'wmp'], 'lib/js/shadowbox/player');

$(document).ready(function(){

	$('#container').css('background', 'transparent url(lib/img/site/bkg_body.gif) repeat-x left bottom');
  //shadowbox
  Shadowbox.init();

  $('#boxes a').mouseover(function(){
    var elem = $(this).attr('rel');
    tmp = elem.substr(0, elem.length - 3);
    $('#'+tmp).show();
 
    if (elem == "quote_en") $('#quote_el').css("background", "url(lib/img/site/quote_en_h.gif)");
    if (elem == "contacts_en") $('#contacts_el').css("background", "url(lib/img/site/contacts_en_h.gif)");
    if (elem == "quote_it") $('#quote_el').css("background", "url(lib/img/site/quote_it_h.gif)");
    if (elem == "contacts_it") $('#contacts_el').css("background", "url(lib/img/site/contacts_it_h.gif)");
  });

  $('#boxes a').mouseout(function(){
    var elem = $(this).attr('rel');
     tmp = elem.substr(0, elem.length - 3);
    $('#'+tmp).hide();
    
    if (elem == "quote_en") $('#quote_el').css("background", "url(lib/img/site/quote_en.gif)");
    if (elem == "contacts_en") $('#contacts_el').css("background", "url(lib/img/site/contacts_en.gif)");
    if (elem == "quote_it") $('#quote_el').css("background", "url(lib/img/site/quote_it.gif)");
    if (elem == "contacts_it") $('#contacts_el').css("background", "url(lib/img/site/contacts_it.gif)");
       
  });
  
  $('#quote').mouseover(function(){
    $('#quote').show();
    var elem = $(this).attr('rel');
    if (elem == "it")
      $('#quote_el').css("background", "url(lib/img/site/quote_it_h.gif)");
    else
      $('#quote_el').css("background", "url(lib/img/site/quote_en_h.gif)");
  });

  $('#quote').mouseout(function(){
    $('#quote').hide();
    var elem = $(this).attr('rel');
    if (elem == "it")
      $('#quote_el').css("background", "url(lib/img/site/quote_it.gif)");
    else
      $('#quote_el').css("background", "url(lib/img/site/quote_en.gif)");
  });
  
   $('#contacts').mouseover(function(){
    $('#contacts').show();
    var elem = $(this).attr('rel');
    if (elem == "it")
      $('#contacts_el').css("background", "url(lib/img/site/contacts_it_h.gif)");
    else
      $('#contacts_el').css("background", "url(lib/img/site/contacts_en_h.gif)");
  });

  $('#contacts').mouseout(function(){
    $('#contacts').hide();
    var elem = $(this).attr('rel');
    if (elem == "it")
      $('#contacts_el').css("background", "url(lib/img/site/contacts_it.gif)");
    else
      $('#contacts_el').css("background", "url(lib/img/site/contacts_en.gif)");
  });  
});