$(document).ready(function(){
//    $("a.imagegallery").fancybox({
//        'titlePosition' : 'inside',
//        'transitionIn'  : 'elastic',
//        'transitionOut' : 'elastic',
//        'speedIn'   : 600, 
//        'speedOut'    : 200, 
//        'overlayShow' : false
//    });

	  $('.topslider:first').show();
	  if($('.topslider').length>1) {
		  setInterval( "slideSwitch('.topslider')", 5000);
	  }
	
});

function decimalNL(str) {
	str = String(str);
	str = str.replace(',','.'); 
	str = parseFloat(str).toFixed(2).toString();
//	str = str.replace('.',',');
	if(isNaN(str)) str = '';
	return str;
}

function slideSwitch(item) {
  $(item).each(function(index) {
	    if($(this).is(':visible')==true) {
	    	$(this).fadeOut(1000)
	    	var next = $(this).next();
	    	if(next.length==0) {
	    		next = $(item+':first');
	    	}
	      next.fadeIn(1000);
	      return false;
	    }
	});
}
