//<![CDATA[
style = 'easeOutQuart';

// Effetto slider
$.easing.custom = function (x, t, b, c, d) {
  var s = 1.70158;
  if ((t /= d / 2) < 1) return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;
  return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;
}


var PrgObj = {

  // Utilizzare una variabile per fare riferimento al file SWF incorporato.

  DOMready: function () {
    if ($("p[rel*='traccia-contatti']").length > 0) { PrgObj.TracciamentoAnalytics('inviata-modulo-contatti-' + lingua + '.html') };
    if ($("p[rel*='traccia-invia-candidatura']").length > 0) { PrgObj.TracciamentoAnalytics('inviata-modulo-invia-candidatura-' + lingua + '.html') };
    if ($("p[rel*='traccia-proponi-candidatura']").length > 0) { PrgObj.TracciamentoAnalytics('inviata-modulo-proponi-candidatura-' + lingua + '.html') };
    if ($("p[rel*='traccia-segnala-candidatura']").length > 0) { PrgObj.TracciamentoAnalytics('inviata-modulo-segnala-candidatura-' + lingua + '.html') };
    if ($('.photo').length > 0) { PrgObj.PhotoHover() };
    if ($('div.scrollable').length > 0) { PrgObj.Slider() };
    if ($('.boxed').length > 0) { PrgObj.Boxed() };
    if ($('.boxed-segnala').length > 0) { PrgObj.BoxedSegnala() };

  }, // fine DOMReady


  PhotoHover: function () {
    $('.photo').hover(
								function () {
								  //mostro
								  $(this).children('.sfondo').stop(false, true).animate({ bottom: 0 }, { duration: 200, easing: style });
								  $(this).children('.titolo').stop(false, true).animate({ top: 100 }, { duration: 200, easing: style });
								  $(this).children('.testo').stop(false, true).animate({ top: 130 }, { duration: 200, easing: style });
								},

								function () {
								  //nascondo
								  $(this).children('.sfondo').stop(false, true).animate({ bottom: -176 }, { duration: 200, easing: style });
								  $(this).children('.titolo').stop(false, true).animate({ top: -176 }, { duration: 200, easing: style });
								  $(this).children('.testo').stop(false, true).animate({ top: -176 }, { duration: 200, easing: style });
								}
							);
  }, /* fine PhotoHover */


  Slider: function () {
    // Impostazioni slider
    $("div.scrollable").scrollable({ easing: 'custom', speed: 1300, circular: true });

  }, // fine Slider

  Boxed: function () {    
    $(".boxed").fancybox(
				{
				  'width': 550,
				  'height': 630,
				  'padding': 0,
				  'titleShow': true,
				  'autoDimensions': false,
				  'type': 'iframe'
				}
			);

  }, // fine Boxed

  BoxedSegnala: function () {
    $(".boxed-segnala").fancybox(
				{
				  'width': 880,
				  'height': 630,
				  'padding': 0,
				  'titleShow': true,
				  'autoDimensions': false,
				  'type': 'iframe'
				}
			);
  }, // fine BoxedSegnala


  TracciamentoAnalytics: function (pagina) {
    try {
      var pageTracker = _gat._getTracker('UA-1769249-26');
      pageTracker._trackPageview(pagina);
    }
    catch (err) { }
  }

} // chiusura classe PrgObj

$(document).ready(function() { PrgObj.DOMready() });
//]]>
