$(document).ready(function() {
    $('#container').ascensor({
        AscensorName:'wrapper',
        WindowsFocus:true,
        WindowsOn:0,
	  
        NavigationDirection:'xy',
        Direction: 'y',
        Navig:true,
        Link:false,
        ReturnURL:true,
        PrevNext:false,
        CSSstyles:true,
	  
        KeyArrow:true,
        keySwitch:true,
        ReturnCode:false,
	  
        ChocolateAscensor:true,
        AscensorMap: '3|1',
        ContentCoord: '1|1 & 1|2 & 1|3'
    });
});
$(document).ready(function() {
    var theInt = null;
    var $crosslink, $navthumb;
    var curclicked = 0;

    theInterval = function(cur){
        clearInterval(theInt);
	
        if( typeof cur != 'undefined' )
            curclicked = cur;
	
        $crosslink.removeClass("active-thumb");
        $navthumb.eq(curclicked).parent().addClass("active-thumb");
        $(".stripNav ul li a").eq(curclicked).trigger('click');
	
        theInt = setInterval(function(){
            $crosslink.removeClass("active-thumb");
            $navthumb.eq(curclicked).parent().addClass("active-thumb");
            $(".stripNav ul li a").eq(curclicked).trigger('click');
            curclicked++;
            if( 6 == curclicked )
                curclicked = 0;
		
        }, 3000);
    };

    $(function(){
	
        //Rzuca error, skip
        //$("#main-photo-slider").codaSlider(); 
	
        $navthumb = $(".nav-thumb");
        $crosslink = $(".cross-link");
	
        $navthumb
        .click(function() {
            var $this = $(this);
            theInterval($this.parent().attr('href').slice(1) - 1);
            return false;
        });
	
        theInterval();
    });
});

var meh = (function(){
    return {
        vcenter: function(){
            var t = ($(window).height() - $('.about_me').height()) /2;
            if(t < 0) t = 0;
            $('.about_me').css({'top': t});
        }
    }
})();
$(function(){meh.vcenter();});
$(window).resize(function(){
    meh.vcenter();
});
