﻿//##############################################
//# Function qui fait apparaitre le formulaire #
//##############################################
function ExpressFormShowPopUp(ID_hdnStock,ID_hdnID,ID_lblMMAV,ID_hdnModel,Stock,ID,MMAV,URL_GoogleAnalytics)
{
document.getElementById(ID_hdnStock).value = Stock;
document.getElementById(ID_hdnID).value = ID;
document.getElementById(ID_lblMMAV).innerHTML = MMAV;
document.getElementById(ID_hdnModel).value = MMAV;

_gaq.push(['_trackEvent', 'ExpressForm', 'Demande de prix _Open',URL_GoogleAnalytics]);


var bodyHeight = $("body").height();
var bodyWidth = $("body").width();
var screenHeight = $(window).height();


$("#ExpressFormCover").show();
$("#ExpressFormCover").height(bodyHeight);
$("#ExpressFormCover").width(bodyWidth);

var tipWidth = $("#ExpressFormTip").width()
var tipCenterWidth = (bodyWidth / 2) - (tipWidth / 2);

var tipHeight = $("#ExpressFormTip").height()
var tipCenterHeight = $(window).scrollTop() + (screenHeight / 2) - (tipHeight / 2);

$("#ExpressFormTip").show();
$("#ExpressFormTip").css({top: tipCenterHeight, left: tipCenterWidth});

$(window).scroll( function(){
  var tipCenterHeightTemp = $(window).scrollTop() + (screenHeight / 2) - (tipHeight / 2);
  $("#ExpressFormTip").css({top: tipCenterHeightTemp, left: tipCenterWidth});
});
}
//###############################################
//# Function qui fait disparaitre le formulaire #
//###############################################
function ExpressFormClosePopUp()
{
$("#ExpressFormTip").hide();
$("#ExpressFormCover").hide();
}

//#############################################################
//# Function qui run le google analytic si la page est valide #
//#############################################################

function ExpressFormValidateSend(URL_GoogleAnalytics)
{
  if (Page_ClientValidate("ExpressForm_Group") == true)
  {
    _gaq.push(['_trackEvent', 'ExpressForm', 'Demande de prix _Send',URL_GoogleAnalytics]);
  }
}



