$(function(){
	var hash = window.location.hash;
	if(hash.length && $(hash).is(":visible")) {
		scrollTo({
			"elm": $(hash)
		});
	}
	
/*	$("nav a").click(function(e) {
		e.preventDefault();
		
		var elm, href = $(this).attr("href");
		
		if(strpos(href, "#") >= 0) {
			elm = $(href);
			
			if(href == "#pagefoot") {
				scrollTo({
					"elm": elm
				});
				setTimeout(function() {
					$("#email").animate({"color": "#A8CEF2"}, 700, function() {
						$("#email").animate({"color": "#4E9DED"}, 700, function() {
							$("#email").animate({"color": "#A8CEF2"}, 700, function() {
								$("#email").animate({"color": "#4E9DED"}, 700);
							});
						});
					});
				}, $(elm).offset().top*0.8);
			} else {
				scrollTo({
					"elm": elm
				});
			}
		}
	}); */
	
	
	$("#profiles a").hover(function(e) {
		e.preventDefault();
		
		var elm, href = $(this).attr("href"), speed = 0;
		
		if(strpos(href, "#") >= 0) {
			elm = $(href);
			
			if(elm.hasClass("active")) {
				$(".aboutdetes:visible").fadeOut(speed).removeClass("active");
				$(".aboutdetes-holder").animate({
					"height": $("#company").height()
				}, speed);
				$("#company").fadeIn(speed).addClass("active");
			} else {
				$(".aboutdetes-holder").height($(".aboutdetes:visible").height()).addClass("absolute");
				
				$(".aboutdetes:visible").fadeOut(speed).removeClass("active");
				$(elm).fadeIn(speed).addClass("active");
				$(".aboutdetes-holder").animate({
					"height": $(elm).height()
				}, speed);
			}
		}
	});
});
