function mycarousel_initCallback(carousel) {
    jQuery('.verder').bind('click', function() {
        carousel.next();
        return false;
    });
    jQuery('.terug').bind('click', function() {
        carousel.prev();
        return false;
    });
};
$(document).ready(function() {
	$(document).pngFix();
	if(document.getElementById('imagescroller')) {
			jQuery("#mycarousel").jcarousel({
			scroll: 1,
					visible: 5,
			initCallback: mycarousel_initCallback
		});
		  jQuery('#imagescroller a').lightBox(
					{
						overlayBgColor: '#000',
						overlayOpacity: 0.6,
						imageLoading: '/layout/popup_loading.gif',
						imageBtnClose: '/layout/popup_close.gif',
						imageBtnPrev: '/layout/popup_prev.gif',
						imageBtnNext: '/layout/popup_next.gif',
						fixedNavigation:true
					});
	}

	if (!getCookie("domovisieBanner")){
		if($("#banner").length > 0){
			$("#banner").show();//fadeIn(1000);
			setCookie('domovisieBanner', 1, 1);		
			//$("#banner").click(function(){closeBanner();});
		}
	}
});

function closeBanner(){
	/*if($("#banner").length > 0){
		$("#banner").fadeOut(1000);
	}*/
	$("#banner").hide();
}

function setCookie(c_name,value,expiredays){
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+
	((expiredays==null) ? "" : ";expires="+exdate.toUTCString());
}

function getCookie(cookie_name){
	var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );
	return ((results) ? unescape(results[2]) : null);
}

function deleteCookie(cookie_name){
  var cookie_date = new Date();
  cookie_date.setTime ( cookie_date.getTime() - 1 );
  document.cookie = cookie_name += "=; expires=" + cookie_date.toGMTString();
}

