function sh() {
	var bRef = $('#shbutton');
	if (act) {
		bRef.attr('src',"typo3conf/ext/reea_slider/res/down.PNG");
		act = 0;
		$('#display').slideUp(250);
	} else {
		bRef.attr('src',"typo3conf/ext/reea_slider/res/up.PNG");	
		act = 1;
		$('#display').slideDown('slow');		
	}
}

$(function() {
    $(".scroller").jCarouselLite({
        btnNext: ".next",
        btnPrev: ".prev",
        circular: carouselCircular,
        visible: visibleThumbs
        //scroll: 3
    });
});

function getRecord(recId) {
	recId = parseInt(recId);
	
	if (recId) {
		var callArgs = new Array();
		callArgs['recId'] = recId;
		
		tx_reeaslider_pi1getRecord(callArgs);
	}
}

function getDirectoryImage(recId) {
	cI = recId;
	
	var rqImg = dirImgs[recId];
	if (rqImg) {
		var callArgs = new Array();
		callArgs['recSign'] = rqImg;

		tx_reeaslider_pi1getDirectoryRecord(callArgs);
	}
}

function r() {
	if (cI < dirImgs.length) {
		getDirectoryImage(++cI);
	}
}

function l() {
	if (0 < cI) {
		getDirectoryImage(--cI);
	}
}

function changeRec(returnValue) {
//	if ($('#display').css('display') == 'none') {
	if ($('#display:hidden')) {
		$('#shbutton').attr('src', upArrow);
		act = 1;
		$('#display').slideDown('slow');
    		$('#display').css('display','block');
	}
	$('#rec_title').html(returnValue['title']);
	$('#rec_subtitle').html(returnValue['subtitle']);
	$('#rec_description').html(returnValue['description']);
	$('#rec_link').html(returnValue['link']);
	$('#display').css('background-image', 'url("'+returnValue['image']+'")');
}

function changeDirRec(returnValue) {
	$('#image').attr('src', returnValue['image']);
	$('#rec_description').html(returnValue['description']);
}
