$(document).ready(function(){

if(document.getElementById('slider') != null) {	

var ct = $('#sliding-content > img').length;
$('#count').text(ct);
if(ct === 0) {
			$('#count').text("0 / " + ct);		
			} else {$('#count').text("1 / " + ct);}
	window.api = $("#slider").scrollable({ size:1, items: '#sliding-content', clickable: false, speed: 400, loop:true}).circular().navigator({ navi: "#thumbnails", naviItem: 'a',
		
    api: true 
});

$('.items a:first').addClass('current');
 $('a.full-screen').click(function() {
$(".items a.current").trigger('click'); 
});
api.onSeek(function() { 
 
    // inside callbacks the "this" variable is a reference to the API 
    var current = this.getPageIndex();
    var cur = current + 1;
   $('#count').text(cur + " / " + this.getPageAmount())
});
}

$('#footer #footer-right ul li:first').addClass('first');
$("#portfolio div:nth-child(3n)").addClass("project-right");
$("#projects .project:eq(0)").addClass("no-bg");
$('#sidebar li:first').addClass('extra');
$('form textarea').resetDefaultValue();

$("a#legal").overlay({ 
 target: '#popup',
 close: '#close',
    // some expose tweaks suitable for modal dialogs 
    expose: { 
        color: '#1e1e1e', 
        loadSpeed: 200, 
        zIndex:1000,
        opacity: 0.9 
    }
});

$("a#order").overlay({ 
 target: '#popLearn',
 close: '#close',
    // some expose tweaks suitable for modal dialogs 
    expose: { 
        color: '#1e1e1e', 
        loadSpeed: 200, 
        zIndex:1000,
        opacity: 0.9 
    }
});

});

Cufon.replace('#nav li', {fontFamily: "Avenir Heavy", hover:true});
Cufon.replace('#tagline', {fontFamily: "Avenir Light"});
Cufon.replace('#latest-project h1', {fontFamily: "Avenir Light", hover:true});
Cufon.replace('#bottom-bar h3', {fontFamily: "Avenir Roman", hover:true});
Cufon.replace('#content h2', {fontFamily: "Avenir Roman", hover:true});
Cufon.replace('#content h1', {fontFamily: "Avenir Roman", hover:true});
Cufon.replace('#sidebar h3', {fontFamily: "Avenir Roman", hover:true});
Cufon.replace('#respond h2', {fontFamily: "Avenir Heavy", hover:true});
Cufon.replace('#precision-hosting h1', {fontFamily: "Avenir Roman", hover:true});
Cufon.replace('#comments_wrap h2', {fontFamily: "Avenir Heavy", hover:true});
Cufon.replace('#about h3', {fontFamily: "Avenir Heavy"});

