(function ($, Drupal, window, document, undefined) {


// To understand behaviors, see https://drupal.org/node/756722#behaviors
Drupal.behaviors.my_custom_behavior = {
  attach: function(context, settings) {



/*********   scroll  *******/

$(document).ready(function(){       
      $scroll_pos = 0;
      $(document).scroll(function() { 
        $scroll_pos = $(this).scrollTop();
        if($scroll_pos > 20) {
            $("body").addClass('scroll');
        }
        else {
            $("body").removeClass('scroll');
        }
      });
});

/********  button ********/

  $('.contact-scroll').click(function(){
    $("html, body").animate({ scrollTop: $("#block-webform-client-block-17").offset().top -70}, 1000);
    return false;
  });

  $('.down_arrow .hang').click(function(){
    $("html, body").animate({ scrollTop: $("#page").offset().top -70}, 1000);
    return false;
  });

  $('.container_button a').click(function(){
    $("html, body").animate({ scrollTop: $("#page").offset().top -70}, 1000);
    return false;
  });


/*********  height of the #top area  ************/

$height = $(window).height() +30;
$("#top").css("height", $height);
$("section.module.parallax").css("height", $height);

$(window).resize(function() {
	$height = $(window).height() +30;
	$("#top").css("height", $height);
	$("section.module.parallax").css("height", $height);
});

/******   add place to views row  **********/

if ($("div").hasClass("view-customer-for-land-page")) {
   $i = 1;
   $(".view-customer-for-land-page .views-row").each(function(){
     $class = "place"+$i++;
     $(this).addClass($class); 
     if ($i>4) { $i=1;}
    });
};


  }
};




})(jQuery, Drupal, this, this.document);