$(document).ready(function(){
	







// ----------------------- Width Gen ----------------------- //
var n_numTabs = $(".post").size();
var win = n_numTabs*250+83;
$(".fff").css("width", win);



// ----------------------- Toggle ----------------------- //

function handler() {
	$(".entry-title-head").unbind();

        $this = $(this);
        var $content = $this.next(".entry-content");
		
	
	
		
        if (!$(".mainimage_large").is(':animated')) {

    $(".sidebar-social").hide();
	$(".tags2").hide();
    $(".entry-content:visible").slideToggle("slow", 		function(){
	});
	
	
	
	
	$(".entry-content").css({"width" : "230px"});
           
			
	$("#nav").fadeOut();
   $(".sliderz").hide();
   $(".tags1").delay(1000).fadeIn();
   $(".mainimage_large").fadeIn();
   $(".post").css({"width" : "250px"});
   $(".entry-title-head").css({"cursor" : "pointer"});
			
			
			$this.prev(".sliderz").prev(".mainimage_large").fadeOut(		function(){
			$this.prev(".sliderz").prev(".mainimage_large").parent(".post").animate({"width" : "780px"});
			$this.prev(".sliderz").fadeIn(									function(){
			$("#main").scrollTo( $(this), 700, 								function(){
			$("#main").scrollTo( {top:'-=0', left:'-=110'}, 800,			function(){
			$content.slideToggle("slow",									function(){
			$this.children(".tags2").fadeIn(								function(){
			$this.next(".entry-content").next(".sidebar-social").fadeIn(	function(){
		$(".entry-title-head").not($this).click(handler);
		$("#nav").fadeIn();
			$this.css({"cursor" : "default"},								function(){
				
			});
			});
			});
			});
			});
			});
			});
			});
			
			
			
	
		
		
			

$content.css({"width" : "570px"});
$(".fff").css("width", win + 530);
$this.children(".tags1").fadeOut();	



        }
		
 }
 $(".entry-title-head").click(handler);
	
// ----------------------- Click to scrollTo right ----------------------- //
$('.right').click(function() {
  $("#main").scrollTo( {top:'-=0', left:'+=250'}, 800 );
   $(".entry-content").slideUp('slow', function() {
	   
  });
  
   $(".mainimage_large").hide();
   $(".mainimage").css({"width" : "230px", "height" : "190px"}).show();
   $(".post").css({"width" : "250px"});
   $(".entry-content").css({"width" : "230px"});
});



// ----------------------- Click to scroll left ----------------------- //
$('.left').click(function() {
  $("#main").scrollTo( {top:'-=0', left:'-=250'}, 800 );
  
  $(".entry-content").slideUp('slow', function() {
  });
  
  $(".mainimage_large").hide();
   $(".mainimage").css({"width" : "230px", "height" : "190px"}).show();
   $(".post").css({"width" : "250px"});
   $(".entry-content").css({"width" : "230px"});
  
});


/*----  Emal Protection ----*/	
var namemail = 'hei';
var domainmail = 'netron.no';
$(".infomation p:first-child").append(''  + namemail + '@' + domainmail + ' •  Tel: (+47) 452 22 128');

 




// ----------------------- End ----------------------- //
});


