$=jQuery;

$(document).ready( function() {

	$('.custom-tabs.href-tabs').tabs();
	$('.jcarousel-control').show();
	$('select.custom').selectbox({animationSpeed: "fast"});
	$('#banner-carousel').jcarousel({
		scroll:1,
		auto:10,
		wrap:"both",
		initCallback: carousel_initCallback,
		itemVisibleInCallback: markPoint,
		buttonNextHTML: null,
		buttonPrevHTML: null 
	});

});



function carousel_initCallback(carousel) {
	$('.jcarousel-control .pager a').each(function(id,el){
	
		$(this).bind('click', function() {
			carousel.scroll(jQuery.jcarousel.intval(id+1));
			return false;
		});
	});
		
	$('#banner-carousel-next').bind('click', function() {
		carousel.next();
		return false;
	});
		
	$('#banner-carousel-prev').bind('click', function() {
		carousel.prev();
		return false;
	}); 
};
	
function markPoint(carousel, li, index, state){
	$('.jcarousel-control .pager a').removeClass('selected');
	$('.jcarousel-control .pager a:eq('+(index-1)+')').addClass('selected');
}

function printWithPreview(content){
	printWindow=window.open('','','status=0,toolbar=0,location=0,resizable=yes,scrollbars=yes,width=800, height=600');
	printWindow.document.write('<html><head><title>Raiffeisen Bank</title>'
							+'<link type="text/css" rel="stylesheet" href="/raiffeisen-bank-portal-theme/css/print.css">'
							+'</head><body>'
							+getPrintHeader()
							+content
							+'</body></html>');
	printWindow.document.close();
	printWindow.focus();
	printWindow.print();
	printWindow.close();
}

function getPrintHeader(){
	return '<div id="logo"><img alt="Raiffeisen Bank" src="/raiffeisen-bank-portal-theme/images/raiffeisen.gif"/></div>';
}

