fQuery(document).ready(function(){
						   
	fQuery("#comment").elastic();
	fQuery("#comment").blur(function(){
		if (this.value == '') {
			fQuery(this).animate({"height": "23px"}, "fast");
		}
	});
	
	fQuery("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});
	
	fQuery("ul.navigation-top-ul").superfish();
	fQuery("ul.navigation-top-ul ul li:last-child a").addClass("no-border");
	fQuery("ul.sidebar-subpages > ul > li:last-child a").addClass("no-border");
	
	// Portfolio Hover Sliders
	fQuery("#featured").hover(function(){
		fQuery(this).find(".top-slide").animate({top:"0"},{queue:false,duration:350,easing:'easeOutExpo'});
		fQuery(this).find(".bottom-slide").animate({bottom:"0"},{queue:false,duration:350,easing:'easeOutExpo'});
		fQuery(this).find(".arrow-prev").animate({left:"0"},{queue:false,duration:350,easing:'easeOutExpo'});
		fQuery(this).find(".arrow-next").animate({right:"0"},{queue:false,duration:350,easing:'easeOutExpo'});
	}, function(){
		fQuery(this).find(".top-slide").animate({top:"-65px"},{queue:false,duration:350,easing:'easeOutExpo'});
		fQuery(this).find(".bottom-slide").animate({bottom:"-61px"},{queue:false,duration:350,easing:'easeOutExpo'});
		fQuery(this).find(".arrow-prev").animate({left:"-40px"},{queue:false,duration:350,easing:'easeOutExpo'});
		fQuery(this).find(".arrow-next").animate({right:"-40px"},{queue:false,duration:350,easing:'easeOutExpo'});
	});
	
	
	
	
	
	
	
	
	// Portfolio Page Arrows
	var currentFeatureSlide = 1;
	var currentFeatureLocation = 0;
	fQuery("a.arrow-prev").fadeTo(0,0.2);
	
	var totalFeatureSlides = Math.ceil( (fQuery(".featured-entry > div").size()) );
	var animationOn = false;
	
	fQuery("a.arrow-next").click(function(event){
									 
		if (currentFeatureSlide != totalFeatureSlides) {
				
			if (currentFeatureSlide == 1) {
				newFeatureLocation = (currentFeatureLocation + 620);
				fQuery("a.arrow-prev").fadeTo(300,0.95);
			} else {
				newFeatureLocation = (currentFeatureLocation + 620);
			}
			fQuery(".featured-entry").animate({left:"-"+newFeatureLocation},{queue:false,duration:450,easing:'easeInOutExpo'});
			if (currentFeatureSlide + 1 == totalFeatureSlides) {
				fQuery("a.arrow-next").fadeTo(300,0.2); }
			currentFeatureLocation = newFeatureLocation;
			currentFeatureSlide = currentFeatureSlide + 1;
				
		}
		
	});
	
	fQuery("a.arrow-prev").click(function(event){
								   
		if (currentFeatureSlide != 1) {
			
			if (currentFeatureSlide == totalFeatureSlides) {
				fQuery("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; }
			fQuery(".featured-entry").animate({left:newFeatureLocationNum},{queue:false,duration:450,easing:'easeInOutExpo'});
			if (currentFeatureSlide - 1 == 1) {
				fQuery("a.arrow-prev").fadeTo(300,0.2); }
			currentFeatureLocation = newFeatureLocation;
			currentFeatureSlide = currentFeatureSlide - 1;
				
		}
		
	});
	
	
	
	
	
	
	
	
	
	// Regular Portfolio Entries
	fQuery(".portfolio-entry").hover(function(){
		fQuery(this).find(".top-slide").animate({top:"0"},{queue:false,duration:350,easing:'easeOutExpo'});
		fQuery(this).find(".bottom-slide").animate({bottom:"0"},{queue:false,duration:350,easing:'easeOutExpo'});
	}, function(){
		fQuery(this).find(".top-slide").animate({top:"-53px"},{queue:false,duration:350,easing:'easeOutExpo'});
		fQuery(this).find(".bottom-slide").animate({bottom:"-46px"},{queue:false,duration:350,easing:'easeOutExpo'});
	});
	
	// Blog Pagination
	fQuery("#blog").hover(function(){
		fQuery(this).find("a.next").animate({top:"0"},{queue:false,duration:350,easing:'easeOutExpo'});
		fQuery(this).find("a.previous").animate({top:"0"},{queue:false,duration:350,easing:'easeOutExpo'});
	}, function(){
		fQuery(this).find("a.next").animate({top:"-25px"},{queue:false,duration:350,easing:'easeOutExpo'});
		fQuery(this).find("a.previous").animate({top:"-25px"},{queue:false,duration:350,easing:'easeOutExpo'});
	});
	
	var currentBlogSlide = 1;
	var currentLocation = 20;
	
	var totalBlogSlides = Math.ceil( (fQuery(".blog-holder > div").size()) / 2 );
	var animationOn = false;
	
	fQuery("a.previous").fadeTo(0,0.25);
	if (totalBlogSlides > 1) {
		fQuery("a.next").fadeTo(0,1);
	} else {
		fQuery("a.next").fadeTo(0,0.25);
	}
	
	fQuery("a.next").click(function(event){
									 
		if (currentBlogSlide != totalBlogSlides) {
				
			if (currentBlogSlide == 1) {
				newLocation = (currentLocation + 274) - 20;
				fQuery("a.previous").fadeTo(300,1); } else {
				newLocation = (currentLocation + 314) - 20; }
			fQuery(".blog-holder").animate({top:"-"+newLocation},{queue:false,duration:450,easing:'easeInOutExpo'});
			if (currentBlogSlide + 1 == totalBlogSlides) {
				fQuery("a.next").fadeTo(300,0.25); }
			currentLocation = newLocation;
			currentBlogSlide = currentBlogSlide + 1;
				
		}
		
	});
	
	fQuery("a.previous").click(function(event){
								   
		if (currentBlogSlide != 1) {
			
			if (currentBlogSlide == totalBlogSlides) {
				fQuery("a.next").fadeTo(300,1.0); }
			if (currentBlogSlide == 2) {
				newLocation = (currentLocation - 274) + 20; } else {
				newLocation = (currentLocation - 314) + 20; }
			if (currentBlogSlide > 2) {
				newLocationNum = "-"+newLocation; } else {
				newLocationNum = newLocation; }
			fQuery(".blog-holder").animate({top:newLocationNum},{queue:false,duration:450,easing:'easeInOutExpo'});
			if (currentBlogSlide - 1 == 1) {
				fQuery("a.previous").fadeTo(300,0.25); }
			currentLocation = newLocation;
			currentBlogSlide = currentBlogSlide - 1;
				
		}
		
	});

});