$(document).ready(function(){

	var $prj = $('.prj'),
		//$left_w = $('.left_w'),
		//$right_w = $('.right_w'),
		$conteiner = $('.conteiner'),
		$this = $(this);

	var constructor = function(){
		$prj.css({'width': width_prj+'%'});
		//$left_w.css({'width': width_prj+'%'});
		//$right_w.css({'width': width_prj+'%'});
		$conteiner.css({'margin': '0 '+ width_c +'%'});
		};

	var sizer_w = function() {
		//$('.logotype').html(document.documentElement.clientWidth)
		widthThis = document.documentElement.clientWidth;
		
		/* if (widthThis <= 615) {
			width_prj = 100;
			width_c = 10;
			constructor();
			} else if (widthThis <= 910) {
				width_prj = 50;
				width_c = 10;
				constructor();
				} else if (widthThis <= 1230) {
					width_prj = 33.3;
					width_c = 10;
					constructor();
					} else if (widthThis <= 1550) {
						width_prj = 25;
						width_c = 8;
						constructor();
						} else if (widthThis <= 1860) {
							width_prj = 20;
							width_c = 6;
							constructor();
							} else if (widthThis >= 1870) {
								width_prj = 16.6;
								width_c = 4;
								constructor();
								} */
				

        if (widthThis <= 615) {
            width_prj = 100;
            width_c = 10;
            constructor();
            } else if (widthThis <= 910) {
                width_prj = 50;
                width_c = 10;
                constructor();
                } else if (widthThis <= 1230) {
                    width_prj = 33.3;
                    width_c = 10;
                    constructor();
                    } else if (widthThis <= 1550) {
                        width_prj = 25;
                        width_c = 5;
                        constructor();
                        } else if (widthThis >= 1550) {
                            width_prj = 20;
                            width_c = 4;
                            constructor();
                            }		
		
		
				
				/* else if (widthThis <= 900) {
					width_prj = 33.3;
					constructor();
				} */
		
	}; sizer_w();
	
    $(window).resize(function() {
      sizer_w();
    });
	
yScroll = 0;
	
$(window).scroll(function(){	
	getscroll();	
	if($.browser.msie && $.browser.version == 6) {
		$('.line_navigation').css('position','relative');
	} else {
		if (yScroll > 80) 
		{$('.line_navigation').css('position','fixed').css('top','0px')} else 
		{$('.line_navigation').css('position','relative')}	
	}
});
	
function getscroll(){
	if (self.pageYOffset){
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){
		yScroll = document.documentElement.scrollTop;
	} else if (document.body){
		yScroll = document.body.scrollTop;	
	}
};
	
/*
$('body').append('<div class="conteiner_np" style="display: none;"></div>');
$('.conteiner_np').load('/ .prj p', function(){
  
  lengthP = $('.conteiner_np p').length;
  url = "http://"+ location.hostname;
  for (var i=0; i<lengthP; i++){
    //alert($('.conteiner_np p a').eq(i).attr('href'));
    if (location.href == url + $('.conteiner_np p a').eq(i).attr('href')){
      NumberA = i;
    };
    
    //alert(url + $('.conteiner_np p a').eq(i).attr('href'))
    
  };
  //alert(NumberA); 
  
  $('.right_button .text').html($('.conteiner_np p').eq(NumberA + 1).html());
  $('.left_button .text').html($('.conteiner_np p').eq(NumberA - 1).html());
  
  //$('.right_button .number').html(lengthP - NumberA);
  
  if (NumberA <= 0) {
    $('.left_button').hide();
  } else {
    $('.left_button .number').html(NumberA);
    $('.left_button').show().css({'cursor':'pointer'});
   };
   
  if (NumberA >= lengthP-1) {
    $('.right_button').hide();
  } else {
    $('.right_button .number').html(lengthP - NumberA - 1);
    $('.right_button').show().css({'cursor':'pointer'});;
   };   
   
  
   
});*/

  $('.right_nav').click(function(){
      location.href = $(this).find('a').attr('href')
      //alert($(this).find('a').attr('href'));
  });
   $('.left_nav').click(function(){
      location.href = $(this).find('a').attr('href')
      //alert($(this).find('a').attr('href'));
  });

		
});
















