Cufon.replace('h1,h2,h3,h4,h5,h6, #footer, #content blockquote p, .button-normal, .button-large, .button, #top-bar ul li a, #top-bar ul.sub li a', { fontFamily: 'Museo500', hover: true });
Cufon.replace('#content h1, .step-describer ul li div small', { fontFamily: 'Museo700', hover: true });
Cufon.replace('.step-describer ul li div big', { fontFamily: 'Museo700', hover: true, textShadow: '-1px -1px 1px #e4e4e4' });

$(document).ready(function () {
/* some extra selectors passed by jquery due to IE "cant handle the reality" problems & other */
$("#top-bar ul li:last-child").addClass("last-child");
$(".list-item ul li:nth-child(3n+1), .list-item ul li:first-child").addClass("shade-left");
$(".list-item ul li:nth-child(3n)").addClass("shade-right");
$(".sub-menu.blog ul li:last-child").addClass("last-child");
$("#blog-posts ul li:odd").addClass("selected curved");

/* applying shadows */
$(".apply-shadows-normal, .apply-shadows-large, .apply-shadows-small").append("<span class='shadow-left'></span><span class='shadow-right'></span>");
$(".apply-fake-curves").append("<span class='rounded tl'></span><span class='rounded tr'></span><span class='rounded bl'></span><span class='rounded br'></span>");


/* top menu */
$("#top-bar > ul > li").mouseover(function(){
	$(this).addClass("current-dynamic");
	$(this).find(".sub").animate({
							   height: "show"
							   }, 0)
	
}).mouseleave(function(){
	$(this).removeClass("current-dynamic");
	$(this).find(".sub").animate({
							   height: "hide"
							   }, 0)
Cufon.replace('#top-bar ul li a', { fontFamily: 'Museo500', hover: true });
});
// end



/* testimonials module */
$("#testimonials .list li a").click(function() {
	var curList = $("#testimonials .list li a.current").attr("rel");
	var curListHeight = $("#testimonials .full-list").height();
	$("#testimonials li a").removeClass("current");
	$(this).addClass("current");
	var listID = $(this).attr("rel");
	if (listID != curList) {
		$("#"+curList).fadeOut(0, function() {
			$("#"+listID).fadeIn();
			var newHeight = $("#"+listID).height();
		});
	}        
	return false;
});
//end 


/* portfolio filtering & pagination usage, pagination plugin is also in js/jquery.paginate.js */
var activeFiltersList = $("#filters ul li a").text();
var filterDefault = document.location.hash.replace("#","");

// checking each element in filters list, and if they match then add class current so they can be highlighted on page load
if (filterDefault) {
	$("#filters ul li a").each(function() {
		if($(this).attr("rel") == filterDefault) {
						 $(this).addClass("current");
		}
	});
}

// checking each element in project list, and if they match with the filter, if yes then show them
if (filterDefault) {
$(".project-list .list-contents li").each(function() {
	if(!$(this).hasClass(filterDefault)) {
		$(this).hide();
	}
	else {
		$(this).show();
	}
});
}
else {
	var filterDefault = "all";
}


// filter choosen elements
$("#filters ul li a").click(function() {

	$("#filters ul li a.current").removeClass("current");
	Cufon.replace('.button-normal', { fontFamily: 'Museo500', hover: true });	
	$(this).addClass("current");
	
	var filterBy = $(this).attr("href").replace("#","");

	
	$(".project-list").hide().fadeIn(400);
	$(".project-list li").each(function() {
		if(!$(this).hasClass(filterBy)) {
			$(this).hide();
		}
		else {
			$(this).fadeIn(400);
		}
		
	});
	$('.project-list').pajinate({items_per_page : external_pajinate_items_number});

});

// project list v4 data hovering
$(".project-list.photo-only li").mouseenter(function() {
	
	$(this).find(".data").fadeIn(200);
}).mouseleave(function() {
	$(this).find(".data").fadeOut(100);
	});



/* autoclear function for inputs */
$('.autoclear').click(function() {
if (this.value == this.defaultValue) {
this.value = '';
}
});
$('.autoclear').blur(function() {
if (this.value == '') {
this.value = this.defaultValue;
}
});

$('#gotop').click(function(){
	$('html, body').animate({scrollTop:0}, 'slow');
	return false;
});

});


