$(document).ready(function(){
						   
	$("#comment").elastic();
	$("#comment").blur(function(){
		if (this.value == '') {
			$(this).animate({"height": "23px"}, "fast");
		}
	});
	
	$("a[rel^='prettyPhoto']").prettyPhoto({
		animationSpeed: 'normal', /* fast/slow/normal */
		padding: 40, /* padding for each side of the picture */
		opacity: 0.55, /* Value betwee 0 and 1 */
		showTitle: true, /* true/false */
		allowresize: false, /* true/false */
		counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
		theme: 'dark_rounded' /* light_rounded / dark_rounded / light_square / dark_square */
	});

	nanotabs({c:"idTabs", e:"click", s:"selected", d:0, f:false});
	
	$("ul.navigation-top-ul").superfish();
	$("ul.navigation-top-ul ul li:last-child a").addClass("no-border");
	$("ul.sidebar-subpages > ul > li:last-child a").addClass("no-border");
	
	// Portfolio Hover Sliders
	$("#featured").hover(function(){
		$(this).find(".top-slide").animate({top:"0"},{queue:false,duration:350,easing:'easeOutExpo'});
		$(this).find(".bottom-slide").animate({bottom:"0"},{queue:false,duration:350,easing:'easeOutExpo'});
		$(this).find(".bottom-slide2").animate({bottom:"0"},{queue:false,duration:350,easing:'easeOutExpo'});
		$(this).find(".arrow-prev").animate({left:"0"},{queue:false,duration:350,easing:'easeOutExpo'});
		$(this).find(".arrow-next").animate({right:"0"},{queue:false,duration:350,easing:'easeOutExpo'});
	}, function(){
		$(this).find(".top-slide").animate({top:"-65px"},{queue:false,duration:350,easing:'easeOutExpo'});
		$(this).find(".bottom-slide").animate({bottom:"-61px"},{queue:false,duration:350,easing:'easeOutExpo'});
		$(this).find(".bottom-slide2").animate({bottom:"-61px"},{queue:false,duration:350,easing:'easeOutExpo'});	
		$(this).find(".arrow-prev").animate({left:"-40px"},{queue:false,duration:350,easing:'easeOutExpo'});
		$(this).find(".arrow-next").animate({right:"-40px"},{queue:false,duration:350,easing:'easeOutExpo'});
	});
	
	
	
	
	
	
	
	
	// Portfolio Page Arrows
	var currentFeatureSlide = 1;
	var currentFeatureLocation = 0;
	$("a.arrow-prev").fadeTo(0,0.2);
	
	var totalFeatureSlides = Math.ceil( ($(".featured-entry > div").size()) );
	var animationOn = false;
	
	$("a.arrow-next").click(function(event){
									 
		if (currentFeatureSlide != totalFeatureSlides) {
				
			if (currentFeatureSlide == 1) {
				newFeatureLocation = (currentFeatureLocation + 620);
				$("a.arrow-prev").fadeTo(300,0.95);
			} else {
				newFeatureLocation = (currentFeatureLocation + 620);
			}
			$(".featured-entry").animate({left:"-"+newFeatureLocation},{queue:false,duration:450,easing:'easeInOutExpo'});
			if (currentFeatureSlide + 1 == totalFeatureSlides) {
				$("a.arrow-next").fadeTo(300,0.2); }
			currentFeatureLocation = newFeatureLocation;
			currentFeatureSlide = currentFeatureSlide + 1;
				
		}
		
	});
	
	$("a.arrow-prev").click(function(event){
								   
		if (currentFeatureSlide != 1) {
			
			if (currentFeatureSlide == totalFeatureSlides) {
				$("a.arrow-next").fadeTo(300,0.95); }
				
			if (currentFeatureSlide == 2) {
				newFeatureLocation = (currentFeatureLocation - 620);
			} else {
				newFeatureLocation = (currentFeatureLocation - 620);
			}
			
			if (currentFeatureSlide > 2) {
				newFeatureLocationNum = "-"+newFeatureLocation; } else {
				newFeatureLocationNum = newFeatureLocation; }
			$(".featured-entry").animate({left:newFeatureLocationNum},{queue:false,duration:450,easing:'easeInOutExpo'});
			if (currentFeatureSlide - 1 == 1) {
				$("a.arrow-prev").fadeTo(300,0.2); }
			currentFeatureLocation = newFeatureLocation;
			currentFeatureSlide = currentFeatureSlide - 1;
				
		}
		
	});
	
	
	
	
	
	
	
	
	
	// Regular Portfolio Entries
	$(".portfolio-entry").hover(function(){
		$(this).find(".top-slide").animate({top:"0"},{queue:false,duration:350,easing:'easeOutExpo'});
		$(this).find(".bottom-slide").animate({bottom:"0"},{queue:false,duration:350,easing:'easeOutExpo'});
		$(this).find(".bottom-slide2").animate({bottom:"0"},{queue:false,duration:350,easing:'easeOutExpo'});
	}, function(){
		$(this).find(".top-slide").animate({top:"-53px"},{queue:false,duration:350,easing:'easeOutExpo'});
		$(this).find(".bottom-slide").animate({bottom:"-46px"},{queue:false,duration:350,easing:'easeOutExpo'});
		$(this).find(".bottom-slide2").animate({bottom:"-46px"},{queue:false,duration:350,easing:'easeOutExpo'});
	});
	
	// Blog Pagination
	$("#blog").hover(function(){
		$(this).find("a.next").animate({top:"0"},{queue:false,duration:350,easing:'easeOutExpo'});
		$(this).find("a.previous").animate({top:"0"},{queue:false,duration:350,easing:'easeOutExpo'});
	}, function(){
		$(this).find("a.next").animate({top:"-25px"},{queue:false,duration:350,easing:'easeOutExpo'});
		$(this).find("a.previous").animate({top:"-25px"},{queue:false,duration:350,easing:'easeOutExpo'});
	});
	
	var currentBlogSlide = 1;
	var currentBlogLocation = 20;
	
	var totalBlogSlides = Math.ceil( ($(".blog-holder > div").size()) / 2 );
	var BloganimationOn = false;
	
	$("a.previous").fadeTo(0,0.25);
	if (totalBlogSlides > 1) {
		$("a.next").fadeTo(0,1);
	} else {
		$("a.next").fadeTo(0,0.25);
	}
	
	$("a.next").click(function(event){
									 
		if (currentBlogSlide != totalBlogSlides) {
				
			if (currentBlogSlide == 1) {
				newBlogLocation = (currentBlogLocation + 274) - 20;
				$("a.previous").fadeTo(300,1); } else {
				newBlogLocation = (currentBlogLocation + 314) - 20; }
			$(".blog-holder").animate({top:"-"+newBlogLocation},{queue:false,duration:450,easing:'easeInOutExpo'});
			if (currentBlogSlide + 1 == totalBlogSlides) {
				$("a.next").fadeTo(300,0.25); }
			currentBlogLocation = newBlogLocation;
			currentBlogSlide = currentBlogSlide + 1;
				
		}
		
	});
	
	$("a.previous").click(function(event){
								   
		if (currentBlogSlide != 1) {
			
			if (currentBlogSlide == totalBlogSlides) {
				$("a.next").fadeTo(300,1.0); }
			if (currentBlogSlide == 2) {
				newBlogLocation = (currentBlogLocation - 274) + 20; } else {
				newBlogLocation = (currentBlogLocation - 314) + 20; }
			if (currentBlogSlide > 2) {
				newBlogLocationNum = "-"+newBlogLocation; } else {
				newBlogLocationNum = newBlogLocation; }
			$(".blog-holder").animate({top:newBlogLocationNum},{queue:false,duration:450,easing:'easeInOutExpo'});
			if (currentBlogSlide - 1 == 1) {
				$("a.previous").fadeTo(300,0.25); }
			currenBlogtLocation = newBlogLocation;
			currentBlogSlide = currentBlogSlide - 1;
				
		}
		
	});
	
	// travel Pagination
	$("#travel").hover(function(){
		$(this).find("a.next2").animate({top:"0"},{queue:false,duration:350,easing:'easeOutExpo'});
		$(this).find("a.previous2").animate({top:"0"},{queue:false,duration:350,easing:'easeOutExpo'});
	}, function(){
		$(this).find("a.next2").animate({top:"-25px"},{queue:false,duration:350,easing:'easeOutExpo'});
		$(this).find("a.previous2").animate({top:"-25px"},{queue:false,duration:350,easing:'easeOutExpo'});
	});
	
	var currenttravelSlide = 1;
	var currenttravelLocation = 20;
	
	var totaltravelSlides = Math.ceil( ($(".travel-holder > div").size()) / 2 );
	var travelanimationOn = false;
	
	$("a.previous2").fadeTo(0,0.25);
	if (totaltravelSlides > 1) {
		$("a.next2").fadeTo(0,1);
	} else {
		$("a.next2").fadeTo(0,0.25);
	}
	
	$("a.next2").click(function(event){
									 
		if (currenttravelSlide != totaltravelSlides) {
				
			if (currenttravelSlide == 1) {
				newtravelLocation = (currenttravelLocation + 274) - 20;
				$("a.previous2").fadeTo(300,1); } else {
				newtravelLocation = (currenttravelLocation + 314) - 20; }
			$(".travel-holder").animate({top:"-"+newtravelLocation},{queue:false,duration:450,easing:'easeInOutExpo'});
			if (currenttravelSlide + 1 == totaltravelSlides) {
				$("a.next2").fadeTo(300,0.25); }
			currenttravelLocation = newtravelLocation;
			currenttravelSlide = currenttravelSlide + 1;
				
		}
		
	});
	
	$("a.previous2").click(function(event){
								   
		if (currenttravelSlide != 1) {
			
			if (currenttravelSlide == totaltravelSlides) {
				$("a.next2").fadeTo(300,1.0); }
			if (currenttravelSlide == 2) {
				newtravelLocation = (currenttravelLocation - 274) + 20; } else {
				newtravelLocation = (currenttravelLocation - 314) + 20; }
			if (currenttravelSlide > 2) {
				newtravelLocationNum = "-"+newtravelLocation; } else {
				newtravelLocationNum = newtravelLocation; }
			$(".travel-holder").animate({top:newtravelLocationNum},{queue:false,duration:450,easing:'easeInOutExpo'});
			if (currenttravelSlide - 1 == 1) {
				$("a.previous2").fadeTo(300,0.25); }
			currenttravelLocation = newtravelLocation;
			currenttravelSlide = currenttravelSlide - 1;
				
		}
		
	});

	// press Pagination
	$("#press").hover(function(){
		$(this).find("a.next3").animate({top:"0"},{queue:false,duration:350,easing:'easeOutExpo'});
		$(this).find("a.previous3").animate({top:"0"},{queue:false,duration:350,easing:'easeOutExpo'});
	}, function(){
		$(this).find("a.next3").animate({top:"-25px"},{queue:false,duration:350,easing:'easeOutExpo'});
		$(this).find("a.previous3").animate({top:"-25px"},{queue:false,duration:350,easing:'easeOutExpo'});
	});
	
	var currentpressSlide = 1;
	var currentpressLocation = 20;
	
	var totalpressSlides = Math.ceil( ($(".press-holder > div").size()) / 2 );
	var pressanimationOn = false;
	
	$("a.previous3").fadeTo(0,0.25);
	if (totalpressSlides > 1) {
		$("a.next3").fadeTo(0,1);
	} else {
		$("a.next3").fadeTo(0,0.25);
	}
	
	$("a.next3").click(function(event){
									 
		if (currentpressSlide != totalpressSlides) {
				
			if (currentpressSlide == 1) {
				newpressLocation = (currentpressLocation + 274) - 20;
				$("a.previous3").fadeTo(300,1); } else {
				newpressLocation = (currentpressLocation + 314) - 20; }
			$(".press-holder").animate({top:"-"+newpressLocation},{queue:false,duration:450,easing:'easeInOutExpo'});
			if (currentpressSlide + 1 == totalpressSlides) {
				$("a.next3").fadeTo(300,0.25); }
			currentpressLocation = newpressLocation;
			currentpressSlide = currentpressSlide + 1;
				
		}
		
	});
	
	$("a.previous3").click(function(event){
								   
		if (currentpressSlide != 1) {
			
			if (currentpressSlide == totalpressSlides) {
				$("a.next3").fadeTo(300,1.0); }
			if (currentpressSlide == 2) {
				newpressLocation = (currentpressLocation - 274) + 20; } else {
				newpressLocation = (currentpressLocation - 314) + 20; }
			if (currentpressSlide > 2) {
				newpressLocationNum = "-"+newpressLocation; } else {
				newpressLocationNum = newpressLocation; }
			$(".press-holder").animate({top:newpressLocationNum},{queue:false,duration:450,easing:'easeInOutExpo'});
			if (currentpressSlide - 1 == 1) {
				$("a.previous3").fadeTo(300,0.25); }
			currentpressLocation = newpressLocation;
			currentpressSlide = currentpressSlide - 1;
				
		}
		
	});

	// Howto Pagination
	$("#howto").hover(function(){
		$(this).find("a.next4").animate({top:"0"},{queue:false,duration:350,easing:'easeOutExpo'});
		$(this).find("a.previous4").animate({top:"0"},{queue:false,duration:350,easing:'easeOutExpo'});
	}, function(){
		$(this).find("a.next4").animate({top:"-25px"},{queue:false,duration:350,easing:'easeOutExpo'});
		$(this).find("a.previous4").animate({top:"-25px"},{queue:false,duration:350,easing:'easeOutExpo'});
	});
	
	var currenthowtoSlide = 1;
	var currenthowtoLocation = 20;
	
	var totalhowtoSlides = Math.ceil( ($(".howto-holder > div").size()) / 2 );
	var howtoanimationOn = false;
	
	$("a.previous4").fadeTo(0,0.25);
	if (totalhowtoSlides > 1) {
		$("a.next4").fadeTo(0,1);
	} else {
		$("a.next4").fadeTo(0,0.25);
	}
	
	$("a.next4").click(function(event){
									 
		if (currenthowtoSlide != totalhowtoSlides) {
				
			if (currenthowtoSlide == 1) {
				newhowtoLocation = (currenthowtoLocation + 274) - 20;
				$("a.previous4").fadeTo(300,1); } else {
				newhowtoLocation = (currenthowtoLocation + 314) - 20; }
			$(".howto-holder").animate({top:"-"+newhowtoLocation},{queue:false,duration:450,easing:'easeInOutExpo'});
			if (currenthowtoSlide + 1 == totalhowtoSlides) {
				$("a.next4").fadeTo(300,0.25); }
			currenthowtoLocation = newhowtoLocation;
			currenthowtoSlide = currenthowtoSlide + 1;
				
		}
		
	});
	
	$("a.previous4").click(function(event){
								   
		if (currenthowtoSlide != 1) {
			
			if (currenthowtoSlide == totalhowtoSlides) {
				$("a.next4").fadeTo(300,1.0); }
			if (currenthowtoSlide == 2) {
				newhowtoLocation = (currenthowtoLocation - 274) + 20; } else {
				newhowtoLocation = (currenthowtoLocation - 314) + 20; }
			if (currenthowtoSlide > 2) {
				newhowtoLocationNum = "-"+newhowtoLocation; } else {
				newhowtoLocationNum = newhowtoLocation; }
			$(".howto-holder").animate({top:newhowtoLocationNum},{queue:false,duration:450,easing:'easeInOutExpo'});
			if (currenthowtoSlide - 1 == 1) {
				$("a.previous4").fadeTo(300,0.25); }
			currenthowtoLocation = newhowtoLocation;
			currenthowtoSlide = currenthowtoSlide - 1;
				
		}
		
	});

	// Reviews Pagination
	$("#reviews").hover(function(){
		$(this).find("a.next5").animate({top:"0"},{queue:false,duration:350,easing:'easeOutExpo'});
		$(this).find("a.previous5").animate({top:"0"},{queue:false,duration:350,easing:'easeOutExpo'});
	}, function(){
		$(this).find("a.next5").animate({top:"-25px"},{queue:false,duration:350,easing:'easeOutExpo'});
		$(this).find("a.previous5").animate({top:"-25px"},{queue:false,duration:350,easing:'easeOutExpo'});
	});
	
	var currentreviewsSlide = 1;
	var currentreviewsLocation = 20;
	
	var totalreviewsSlides = Math.ceil( ($(".reviews-holder > div").size()) / 2 );
	var reviewsanimationOn = false;
	
	$("a.previous5").fadeTo(0,0.25);
	if (totalreviewsSlides > 1) {
		$("a.next5").fadeTo(0,1);
	} else {
		$("a.next5").fadeTo(0,0.25);
	}
	
	$("a.next5").click(function(event){
									 
		if (currentreviewsSlide != totalreviewsSlides) {
				
			if (currentreviewsSlide == 1) {
				newreviewsLocation = (currentreviewsLocation + 274) - 20;
				$("a.previous5").fadeTo(300,1); } else {
				newreviewsLocation = (currentreviewsLocation + 314) - 20; }
			$(".reviews-holder").animate({top:"-"+newreviewsLocation},{queue:false,duration:450,easing:'easeInOutExpo'});
			if (currentreviewsSlide + 1 == totalreviewsSlides) {
				$("a.next5").fadeTo(300,0.25); }
			currentreviewsLocation = newreviewsLocation;
			currentreviewsSlide = currentreviewsSlide + 1;
				
		}
		
	});
	
	$("a.previous5").click(function(event){
								   
		if (currentreviewsSlide != 1) others
		
	});
	
	// Others Pagination
	$("#others").hover(function(){
		$(this).find("a.next6").animate({top:"0"},{queue:false,duration:350,easing:'easeOutExpo'});
		$(this).find("a.previous6").animate({top:"0"},{queue:false,duration:350,easing:'easeOutExpo'});
	}, function(){
		$(this).find("a.next6").animate({top:"-25px"},{queue:false,duration:350,easing:'easeOutExpo'});
		$(this).find("a.previous6").animate({top:"-25px"},{queue:false,duration:350,easing:'easeOutExpo'});
	});
	
	var currentothersSlide = 1;
	var currentothersLocation = 20;
	
	var totalothersSlides = Math.ceil( ($(".others-holder > div").size()) / 2 );
	var othersanimationOn = false;
	
	$("a.previous6").fadeTo(0,0.25);
	if (totalothersSlides > 1) {
		$("a.next6").fadeTo(0,1);
	} else {
		$("a.next6").fadeTo(0,0.25);
	}
	
	$("a.next6").click(function(event){
									 
		if (currentothersSlide != totalothersSlides) {
				
			if (currentothersSlide == 1) {
				newothersLocation = (currentothersLocation + 274) - 20;
				$("a.previous6").fadeTo(300,1); } else {
				newothersLocation = (currentothersLocation + 314) - 20; }
			$(".others-holder").animate({top:"-"+newothersLocation},{queue:false,duration:450,easing:'easeInOutExpo'});
			if (currentothersSlide + 1 == totalothersSlides) {
				$("a.next6").fadeTo(300,0.25); }
			currentothersLocation = newothersLocation;
			currentothersSlide = currentothersSlide + 1;
				
		}
		
	});
	
	$("a.previous6").click(function(event){
								   
		if (currentothersSlide != 1) {
			
			if (currentothersSlide == totalothersSlides) {
				$("a.next6").fadeTo(300,1.0); }
			if (currentothersSlide == 2) {
				newothersLocation = (currentothersLocation - 274) + 20; } else {
				newothersLocation = (currentothersLocation - 314) + 20; }
			if (currentothersSlide > 2) {
				newothersLocationNum = "-"+newothersLocation; } else {
				newothersLocationNum = newothersLocation; }
			$(".others-holder").animate({top:newothersLocationNum},{queue:false,duration:450,easing:'easeInOutExpo'});
			if (currentothersSlide - 1 == 1) {
				$("a.previous6").fadeTo(300,0.25); }
			currentothersLocation = newothersLocation;
			currentothersSlide = currentothersSlide - 1;
				
		}
		
	});

});