﻿//##############################################
//# Function qui fait apparaitre le formulaire #
//##############################################
function AlbiChercheFormShowPopUp(URL_GoogleAnalytics)
{
var bodyHeight = $("body").height();
var bodyWidth = $("body").width();
var screenHeight = $(window).height();

_gaq.push(['_trackEvent', 'On cherche pour vous', 'On cherche pour vous _Open',URL_GoogleAnalytics]);

$("#AlbiChercheFormCover").show();
$("#AlbiChercheFormCover").height(bodyHeight);
$("#AlbiChercheFormCover").width(bodyWidth);

var tipWidth = $("#AlbiChercheFormTip").width()
var tipCenterWidth = (bodyWidth / 2) - (tipWidth / 2);

var tipHeight = $("#AlbiChercheFormTip").height()
var tipCenterHeight = $(window).scrollTop() + (screenHeight / 2) - (tipHeight / 2);

$("#AlbiChercheFormTip").show();
$("#AlbiChercheFormTip").css({top: tipCenterHeight, left: tipCenterWidth});

$(window).scroll( function(){
  var tipCenterHeightTemp = $(window).scrollTop() + (screenHeight / 2) - (tipHeight / 2);
  $("#AlbiChercheFormTip").css({top: tipCenterHeightTemp, left: tipCenterWidth});
});
}
//###############################################
//# Function qui fait disparaitre le formulaire #
//###############################################
function AlbiChercheFormClosePopUp()
{
$("#AlbiChercheFormTip").hide();
$("#AlbiChercheFormCover").hide();
}

//#############################################################
//# Function qui run le google analytic si la page est valide #
//#############################################################

function AlbiChercheFormValidateSend(URL_GoogleAnalytics)
{


  if (Page_ClientValidate("AlbiChercheForm_Group") == true)
  {
    _gaq.push(['_trackEvent', 'On cherche pour vous', 'On cherche pour vous _Send',URL_GoogleAnalytics]);
  }
}



