 function checker(){
    $bh = $(window).height();
    if ($bh < 810){
    $('.bottom').removeClass('bottomlg').addClass('bottomsm');
    }
    else {
        $('.bottom').removeClass('bottomsm').addClass('bottomlg');

    
    }
    
    
    }


    $(document).ready(function() {
    
   
    
    var current_panel = "1";
        var photo_shown = "0";

$(".home").click(function(){

current_panel = "1";
	check_current();
	$(".s-marble").animate({
	top: '0px'
	}, 500, function() {// Animation complete.
	
  });
return false;
});


	$(".s-about").click(function(){
	 current_panel = "2";
	 $('.npn').fadeTo("slow", 1.00);

	 if(photo_shown == 1){
	 photo_shown=0;
	 $('.photoframe').fadeTo("slow", 0.00);
}

  check_current();
	$(".marble").animate({
	top: '-506px'
    
  }, 500, function() {
 
 
	// Animation complete.
  });
return false;
});


	$(".s-contact").click(function(){
	 current_panel = "5";
	 $('.npn').fadeTo("slow", 1.00);

	 if(photo_shown == 1){
	 photo_shown=0;
	 $('.photoframe').fadeTo("slow", 0.00);
}

  check_current();
	$(".marble").animate({
	top: '-2024px'
    
  }, 500, function() {
 
 
	// Animation complete.
  });
return false;
});


$(".s-stylepreview").click(function(){
current_panel = "4";
$('.npn').fadeTo("slow", 1.00);

	check_current();
	$(".marble").animate({
	top: '-1518px'
    
	}, 500, function() {
	
    // Animation complete.
	});
return false;
});



$(".s-services").click(function(){
 current_panel = "3";
 $('.npn').fadeTo("slow", 1.00);

  check_current();
 		$(".marble").animate({
   top: '-1012px'
    
  }, 500, function() {
 
  
    // Animation complete.
  });
  return false;
});



$(".next").click(function(){



if (current_panel== "1"){
current_panel=2;
$('.npn').fadeTo("slow", 1.00);
	check_current();
$(".marble").animate({
	top: '-506px'
	}, 500, function() {// Animation complete.
	
  });
return false;

}

if (current_panel== "2"){
current_panel=3;
	check_current();
	

$(".marble").animate({
	top: '-1012px'
	}, 500, function() {// Animation complete.
	
  });
return false;

}

if (current_panel== "3"){
current_panel=4;
	check_current();
	
$(".marble").animate({
	top: '-1518px'
	}, 500, function() {// Animation complete.
	
  });
return false;

}

if (current_panel== "4"){
current_panel=5;
	check_current();
	 $('.photoframe').fadeTo("slow", 0.00);
photo_shown=0;
$(".marble").animate({
	top: '-2024px'
	}, 500, function() {// Animation complete.
	
  });
return false;

}


if (current_panel== "5"){


return false;

}




});




$(".prev").click(function(){



if (current_panel== "1"){
return false;
}

if (current_panel== "2"){
current_panel=1;
	check_current();
$('.npn').fadeTo("slow", 0.00);
$(".marble").animate({
	top: '0px'
	}, 500, function() {// Animation complete.
	
  });
return false;

}

if (current_panel== "3"){
current_panel=2;
	check_current();
	
$(".marble").animate({
	top: '-506px'
	}, 500, function() {// Animation complete.
	
  });
return false;

}

if (current_panel== "4"){
	current_panel=3;
	check_current();
photo_shown=0;
	 $('.photoframe').fadeTo("slow", 0.00);

$(".marble").animate({
	top: '-1012px'
	}, 500, function() {// Animation complete.

  });
return false;

}


if (current_panel== "5"){
	current_panel=4;
	check_current();

$(".marble").animate({
	top: '-1518px'
	}, 500, function() {// Animation complete.

  });
return false;

}

});


function check_current(){



}



   
    
    checker();
    
    $(window).resize(function() {
  checker();
  });
  
    
  $('.h').click(function(){ 
  
  $bw = $(window).width();
  alert($bw);
  });
  
  
  $('.thumb').click(function(){
   var eq = $('.thumb').index(this);
  eq ++;
  if (photo_shown==0){
  photo_shown =1;
 $('.photoframe').fadeTo("slow", 1.00);
 

  $("#thephoto").attr("src", "img/photos/" + eq + ".jpg").stop(true,true).hide().fadeIn();
 return false;
 }
 else if(photo_shown==1){

  $("#thephoto").attr("src", "img/photos/" + eq + ".jpg").stop(true,true).hide().fadeIn();
  return false;
 }
 
 
  
  });
  
  
              });
    
    



  
