//
//
// Nothin' but jQuery love in here!
//
//
//

function dothisnow(){
	$('a[href=#tanthemoon], a[href=#specials]').click(function(){
		$('html, body').animate({scrollTop:$('.galleryCon').position().top}, 1500, 'easeInOutExpo');
		return false;
	});
	$('a[href=#profile]').click(function(){
		$('html, body').animate({scrollTop:$('#profileCon').position().top - 110}, 1500, 'easeInOutExpo');
		return false;
	});
	$('a[href=#services]').click(function(){
		$('html, body').animate({scrollTop:$('#servicesCon').position().top - 110}, 1500, 'easeInOutExpo');
		return false;
	});
	$('a[href=#products]').click(function(){
		$('html, body').animate({scrollTop:$('#productsCon').position().top - 110}, 1500, 'easeInOutExpo');
		return false;
	});
	$('a[href=#reviews]').click(function(){
		$('html, body').animate({scrollTop:$('#reviewsCon').position().top - 110}, 1500, 'easeInOutExpo');
		return false;
	});
	$('a[href=#cases]').click(function(){
		$('html, body').animate({scrollTop:$('#casesCon').position().top - 110}, 1500, 'easeInOutExpo');
		return false;
	});
	$('a[href=#contact]').click(function(){
		$('html, body').animate({scrollTop:$('#contactCon').position().top - 110}, 1500, 'easeInOutExpo');
		return false;
	});
	
	
	$('a[href=#oh1]').click(function(){
		$('.pageWrap').animate({'margin-left':'-4200px'}, 1500, 'easeInOutExpo');
		$('.galleryWrap').animate({'margin-left':'0px'}, 1500, 'easeInOutExpo');
		$('.specialCon img').fadeTo(600, "0", 'easeInExpo');
		$('.specialCon img').delay(800).fadeTo(800, "1", 'easeInOutExpo');
		$('html, body').delay(1000).animate({scrollTop:$('.galleryCon').position().top}, 2000, 'easeInOutExpo');
		return false;
	});
	$('a[href=#oh2]').click(function(){
		$('.pageWrap').animate({'margin-left':'-2800px'}, 1500, 'easeInOutExpo');
		$('.galleryWrap').animate({'margin-left':'-1400px'}, 1500, 'easeInOutExpo');
		$('.specialCon img').fadeTo(600, "0", 'easeInExpo');
		$('.specialCon img').delay(800).fadeTo(800, "1", 'easeInOutExpo');
		$('html, body').delay(1000).animate({scrollTop:$('.galleryCon').position().top}, 2000, 'easeInOutExpo');
		return false;
	});
	$('a[href=#oh3]').click(function(){
		$('.pageWrap').animate({'margin-left':'-1400px'}, 1500, 'easeInOutExpo');
		$('.galleryWrap').animate({'margin-left':'-2800px'}, 1500, 'easeInOutExpo');
		$('.specialCon img').fadeTo(600, "0", 'easeInExpo');
		$('.specialCon img').delay(800).fadeTo(800, "1", 'easeInOutExpo');
		$('html, body').delay(1000).animate({scrollTop:$('.galleryCon').position().top}, 2000, 'easeInOutExpo');
		return false;
	});
	$('a[href=#oh4]').click(function(){
		$('.pageWrap').animate({'margin-left':'0'}, 1500, 'easeInOutExpo');
		$('.galleryWrap').animate({'margin-left':'-4200px'}, 1500, 'easeInOutExpo');
		$('.specialCon img').fadeTo(600, "0", 'easeInExpo');
		$('.specialCon img').delay(800).fadeTo(800, "1", 'easeInOutExpo');
		$('html, body').delay(1000).animate({scrollTop:$('.galleryCon').position().top}, 2000, 'easeInOutExpo');
		return false;
	});
	
	$('.infoBar').hover(function(){
		$('.infoBar').stop().animate({'bottom' : '-26px'}, 200);				 
	}, function(){
		$('.infoBar').stop().animate({'bottom' : '-80px'}, 200);		 
	});
	
	
	$('.pageCon li a').hover(function(){
		$(this).stop().animate({color: '#000000'}, 400);				 
	}, function(){
		$(this).stop().animate({color: '#eaeaea'}, 400);		 
	});
	
	$('.shadowOver img a').hover(function(){
		$(this).css({'border': '#f9ec00 6px solid'}, 400);				 
	}, function(){
		$(this).css({'border': '#ffffff 6px solid'}, 400);		 
	});
	
	$('input, textarea').focus(function(){
		$(this).css({'background-color':'#f9ec00'});								
	});
	$('input, textarea').blur(function(){
		$(this).css({'background-color':'#eaeaea'});								
	});
};

$(window).scroll(fixThis);
function fixThis(){
	var top = 0;
	top = $(window).scrollTop();
	profile = $('#profileCon').position().top - 164;
	services = $('#servicesCon').position().top - 164;
	products = $('#productsCon').position().top - 164;
	reviews = $('#reviewsCon').position().top - 164;
	cases = $('#casesCon').position().top - 164;
	contact = $('#contactCon').position().top - 164;
	
	if((top >= 0) && (top < profile)){
	  $('a[href=#specials]').parent().addClass("current");
	  $('a[href=#specials]').parent().siblings().removeClass("current");
	  //alert('specials');
	}
	if((top >= profile) && (top < services)){
	  $('a[href=#profile]').parent().addClass("current");
	  $('a[href=#profile]').parent().siblings().removeClass("current");
	  //alert('profile');
	}    
	if((top >= services) && (top < products)){      
	  $('a[href=#services]').parent().addClass("current");
	  $('a[href=#services]').parent().siblings().removeClass("current");
	  //alert('services');
	}
	if((top >= products) && (top < reviews)){      
	  $('a[href=#products]').parent().addClass("current");
	  $('a[href=#products]').parent().siblings().removeClass("current");
	  //alert('products');
	}
	if((top >= reviews) && (top < cases)){      
	  $('a[href=#reviews]').parent().addClass("current");
	  $('a[href=#reviews]').parent().siblings().removeClass("current");
	  //alert('reviews');
	}
	if((top >= cases) && (top < contact)){      
	  $('a[href=#cases]').parent().addClass("current");
	  $('a[href=#cases]').parent().siblings().removeClass("current");
	  //alert('cases');
	}
	if(top >= contact){      
	  $('a[href=#contact]').parent().addClass("current");
	  $('a[href=#contact]').parent().siblings().removeClass("current");
	  //alert('contact');
	}
}
