
$(document).ready(function() {

  var $aCondTopM =  $("#mobilBox").height() - $("#mobilBox .condBox").height() - 3;

  $("#mobilBox a.cond").click(function() {	
    if ($('#mobilBox .condBox').is(':hidden')) {
      $("#mobilBox .condBox").slideToggle("slow");
	  $("#mobilBox a.cond").animate({top: $aCondTopM}, "slow"); 
    } else {
      $("#mobilBox .condBox").slideToggle("slow");
	  $(this).animate({top: "398px"}, "slow"); 
	};
	return false;
  });

  var $aCondTopT =  $("#tariffBox").height() - $("#tariffBox .condBox").height() - 3;

  $("#tariffBox a.cond").click(function() {	
    if ($('#tariffBox .condBox').is(':hidden')) {
      $("#tariffBox .condBox").slideToggle("slow");
	  $("#tariffBox a.cond").animate({top: $aCondTopT}, "slow"); 
    } else {
      $("#tariffBox .condBox").slideToggle("slow");
	  $(this).animate({top: "446px"}, "slow"); 
	};
	return false;
  });

  $(".overlay a.close").click(function(){	
	$(".overlay").hide("slow");
	$("#shadowLayer").hide();
	return false;
  });

  Cufon.replace('h2');
  Cufon.replace('h3');
  Cufon.replace('h4');
  Cufon.replace('h5');
  Cufon.replace('.overlay .content strong');
  Cufon.replace('.overlay .content span');

});


function showLayer( id ) {
	$("#shadowLayer").show();
	$("#shadowLayer").height($(document).height());
    $("#shadowLayer").fadeTo(0,0.7);
	$( id ).css("top",$(window).scrollTop()+100);
	$( id ).show("slow");
	return false;
};
