function preloader() 
{
     // counter
     var i = 0;

     // create object
     imageObj = new Image();

     // set image list
     images = new Array();
     images[0]="http://advb.it/wp-content/themes/advboucle/images/innovate-big.png"
     images[1]="http://advb.it/wp-content/themes/advboucle/images/startup-big.png"

     // start preloading
     for(i=0; i<=1; i++) 
     {
          imageObj.src=images[i];
     }
}

$(document).ready(function(){

  $(".it_lang").hover(
    function () {
      $(this).attr("src","http://www.advboucle.com/wp-content/themes/advboucle/images/it_over.gif")
    }, 
    function () {
      $(this).attr("src","http://www.advboucle.com/wp-content/themes/advboucle/images/it.gif")
    }
  );
  
  $(".us_lang").hover(
    function () {
      $(this).attr("src","http://www.advboucle.com/wp-content/themes/advboucle/images/us_over.gif")
    }, 
    function () {
      $(this).attr("src","http://www.advboucle.com/wp-content/themes/advboucle/images/us.gif")
    }
  );

  $("div.question1").hover(
    function () {
      $("div.question1").addClass("hover");
      $("h1.question-standard").hide();
      $("h1.question-1").show();
    }, 
    function () {
      $("div.question1").removeClass("hover");
      $("h1.question-standard").show();
      $("h1.question-1").hide();
    }
  );
  
  $("div.question2").hover(
    function () {
      $("div.question2").addClass("hover");
      $("h1.question-standard").hide();
      $("h1.question-2").show();
    }, 
    function () {
      $("div.question2").removeClass("hover");
      $("h1.question-standard").show();
      $("h1.question-2").hide();
    }
  );
  
  
  
  $(".formhide").hide();
  
  $(".formopener").click(function(){
    $(".formhide").slideToggle();
  });
    

  $("#masonry-wrap").masonry({});

  //$("#tec-content .entry p").append("</p><h2><br />Acquista i biglietti</h2>");

  
  $("tr.fsRowTop, td.fsRowOpen, td.fsRowClose, .fsRowBottom").hide();
  $("tr.fsSpacerRow").hide();
  $("label.fsLabel").attr("style","font-size:12px;font-weight:normal;float:left");
  $("#digest label.fsLabel").attr("style","font-size:12px;font-weight:bold;float:right");
  $("input.fsField").attr("style","font-size:12px;font-weight:normal;padding:3px;width:180px;float:right");
  $("#digest input.fsField").attr("style","font-size:12px;font-weight:normal;padding:3px;width:160px;float:left;border:1px solid #cbcbcb;background:#fff");
  $("select.fsField").attr("style","font-size:12px;font-weight:normal;padding:0;width:320px");
  $("#digest select.fsField").attr("style","font-size:12px;font-weight:normal;padding:0;width:250px");
  $("#fsPage1031552-1 select#field10487241").attr("style","font-size:12px;font-weight:normal;padding:0;width:180px;float:right");
  $("#field10487243").attr("style","font-size:12px;font-weight:normal;padding:3px;width:320px;");
  $("textarea").attr("style","font-size:12px;font-weight:normal;padding:3px;width:320px;height:200px;float:right");
  $(".fsForm .fsCell").attr("style","padding:2px 0");
  $("#fsCell10487243").attr("style","padding:20px 0");
  $("#fsCell10487243 label, #fsCell10487245 label, #fsCell10487249 label, #fsCell10487255 label, #fsCell10487258 label, #fsCell10487259 label").attr("style","font-size:12px;font-weight:bold;float:none;display:block");
  $(".fsRequiredLabel span").attr("style","color:#000;font-size:14px");
  $("#digest .fsRequiredLabel span").attr("style","display:none");
  $("#fsCell10486050, #fsCell10487245, #fsCell10487249, #fsCell10487255, #fsCell10487258, #fsCell10487259").attr("style","padding:10px 0");
  $(".fsSubmitButton").attr("style","background:#000;color:#fff;border:0;font-size:12px;cursor:pointer;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px");
  $(".fsPagination").attr("style","margin:10px 0;margin-bottom:0");
  
  $("#fsSubmitButton1031528").attr("value","Iscriviti");
  
  $(".fsOptionLabel").attr("style","");
  $("input[type=radio], input[type=checkbox]").attr("style","");
  $("label[for=field10487245_2], label[for=field10487255_3]").append("<br />")
  
  $("#field10487259").attr("style","width:320px")
  
  
  
  $("#field10558251").attr("value",window.location);
  $("#fsRow1031528-1").hide();
  
  
  
  $(".youtube-video").click(function() {
  	$.fancybox({
  			'padding'		: 0,
  			'autoScale'		: false,
  			'transitionIn'	: 'none',
  			'transitionOut'	: 'none',
  			'title'			: this.title,
  			'width'		: 680,
  			'height'		: 495,
  			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
  			'type'			: 'swf',
  			'swf'			: {
  			   	 'wmode'		: 'transparent',
  				'allowfullscreen'	: 'true'
  			}
  		});
  
  	return false;
  });
  
  $("a[href$=.jpg],a[href$=.JPG],a[href$=.png],a[href$=.gif]").fancybox();
  
  $(".trick a[href$=.pdf]").addClass("pdf");
  $(".trick a[href$=.xls]").addClass("xls");
  $(".trick a[href$=.doc]").addClass("doc");
  $(".trick a[href$=.doc]").addClass("ppt");
  $(".trick a[href$=.doc],.trick a[href$=.rar]").addClass("zip");
  $(".trick a[href$=.keynote]").addClass("keynote");
  
});
