function displayWebCallBack() {
	if ($('#web_call_back').css("display") == "none") {
		var minHeightOverlay = $(document).height() - 20;
        $('#gbx_overlay').css( {
                  display : "block",
                  'min-height' : minHeightOverlay + "px",
                  'height' : minHeightOverlay + "px",
                  'z-index' : 56
          })
          $("#web_call_back").vCenter();

          if($("#web_call_back").css("top").charAt(0) == '-' )
          {
                  $("#web_call_back").css( {
                          top : "5px"
                  })
          }

          $("#web_call_back").gbxShow();
	}
        else
        {
          $("#web_call_back").gbxHide();
          $('#gbx_overlay').css( {
                  display : "none"
          });
	}
	
    // tentative pour cacher les input et select en dessous de la popup (bug IE6)
	//$('input[name="profil[departement]"]').css("visibility", "hidden");

	return false;
}


function closePopUp()
{
    $("#web_call_back").gbxHide();
    $('#gbx_overlay').css({
      display : "none"
    })
    $('#popup_wcb').css({
      display : "none"
    })
    $('#popup_wcb').empty();
    $("#ui-datepicker-div").css("display", "none");
    
    // tentative pour montrer les input et select en dessous de la popup (bug IE6)
    //$('input[name^="profil"]').css("visibility", "visible");
}

function config_mrh()
{
 $('.background_1').css({'background':'url(/vhWebCallBackPlugin/images/fond-wcb-noVisio-noDiff.jpg) no-repeat left top'});
}

function configWCBWindowTabsWithParams(noVisio, noDiff)
{
	if (noVisio && !noDiff) {
		// background par défaut
		$('.LnkWcbForm-container').css({'background':'url(/vhWebCallBackPlugin/images/fond-wcb-noVisio1.jpg) no-repeat left top'});		
		
		$('.lnkWcbLinkContent_1').live('click',function(){
			if (!$(this).hasClass('inActive')) {
				$('.LnkWcbForm-container').css({'background':'url(/vhWebCallBackPlugin/images/fond-wcb-noVisio1.jpg) no-repeat left top'});
			}
		});
		
		$('.lnkWcbLinkContent_2').live('click',function(){
			if (!$(this).hasClass('inActive')) {
				$('.LnkWcbForm-container').css({'background':'url(/vhWebCallBackPlugin/images/fond-wcb-noVisio2.jpg) no-repeat left top'});
			}
		});
		
		setTimeout("placeBGInactive()", 500);
	}
	
	if (noVisio && noDiff) {
		$('.LnkWcbForm-container').css({'background':'url(/vhWebCallBackPlugin/images/fond-wcb-noVisio-noDiff.jpg) no-repeat left top'});		
	}
}

function placeBGInactive() {
	// si nous sommes hors horaires d'ouverture, 
	// le premier onglet (rappel immediat) est desactive.
	// Il faut placer le background sur le deuxieme onglet
	if ($('.lnkWcbLinkContent_1').hasClass('inActive')) {
		$('.LnkWcbForm-container').css({'background':'url(/vhWebCallBackPlugin/images/fond-wcb-noVisio2.jpg) no-repeat left top'});		
	}
}

$(document).ready(function() {

    $('.bouton_fermer').live( 'click', function(event) {
    event.preventDefault();
    closePopUp();
  });



});
