function init() {
    var pn = 0;
    $('.issues .articles .position').each( function(i) {
       pn++;
    });
    $('.issues .container').css('width', (pn * 273) + 'px');
    $('a.wpGallery').fancybox();
}

function loadCalendar( monthVal, yearVal ) {
     $.ajax({
       url: BASE_URL + "ajax.php",
       type: "GET",
       global: false,
       data: ({action: 'calendar', month: monthVal, year: yearVal}),
       dataType: 'html',
       success: function(msg){
         $('#calendar').html( msg );
       },
       error: function(msg) {

       }
     });
}

function selectIssueArticle( an, el ) {
    leftPos = ( an * 273 - 273) * -1;
    $('.articles .buttons a').removeClass( 'active' );
    el.addClass( 'active' );
	$('.issues .container').css('left',leftPos);
//    $('.issues .container').animate({
//        left: leftPos + 'px'
//    }, 400, function() {
//  });
}

$(document).ready(function(){
    init();
});
