$(document).ready(function(){
  $('.node .content').find('img').css('float','left');
  $('.node .content').find('img').css('clear','both');
  $('.node .content').find('img').css('margin','10px');
  var i=0;
  $('.node .content').find('img').each(function(){
    var width = $(this).width();
    var height = $(this).height();
    var coef = width / height;
    var new_width = 170;
    $(this).width(new_width);
    $(this).height(new_width/coef);
    $(this).attr('rel','lightbox');
    $(this).css('cursor','pointer');
  });
  
 
  
  jQuery('#delivery').click(function(e){
    jQuery('.TB_overlayBG_new').width('100%');
    jQuery('.TB_overlayBG_new').height('100%');    
    jQuery('.TB_overlayBG_new').show();
    jQuery('#preloader').show();
    

    		var url = 'http://obshegitie.org.ua/feedback.html.php';
     		jQuery('#modal_window').load(url,function(){
     		   jQuery('#preloader').hide();
     		   jQuery('#modal_window').show(); 
      		 elementClick = '#spec';
           destination = $(elementClick).offset().top;
           $("html").animate({ scrollTop: destination}, 1100 );
        });
  	
    var width1 = jQuery(document).width()/2-670/2;
    var height1 = jQuery(window).height()/2-200;

    jQuery('#modal_window').css('top',height1+'px');
    jQuery('#modal_window').css('left',width1+'px');   
                   	
  });

/*
  jQuery('.shapka1 li').animate({
    opacity: 0.4
  }, 150 );
  
  
  jQuery('.shapka1 li').bind('mouseover',function(){
      jQuery(this).animate({
        opacity: 1.0,
      }, 150 );
  });
  jQuery('.shapka1 li').bind('mouseleave',function(){
      jQuery(this).animate({
        opacity: 0.4
      }, 700 );
  });


  
  jQuery('#delivery').animate({
    opacity: 0.4
  }, 150 );
  jQuery('#delivery').bind('mouseover',function(){
      jQuery(this).animate({
        opacity: 1.0,
      }, 500 );
  });
  jQuery('#delivery').bind('mouseleave',function(){
      jQuery(this).animate({
        opacity: 0.4,
      }, 700 );
  });
*/  
  
  
}); 

