$(document).ready(function(){
	
	// Colorbox
	
	var id;
	
	$("a[rel='gallery']").colorbox({transition:'none', current:'foto {current} van {total}'});
	$(".example5").colorbox();
	$("a.inline").click(function(event){
		id = 'div#i'+$(this).attr('id');
	});
	$("a.inline").colorbox(
			{onOpen:function(){
				$("div.inline div").removeClass("popup");
				$("div#_"+$(this).attr('id')).addClass("popup");
			}, width:"670px", inline:true, href:"div.popup" } 
	);
		
	
	// jQuery Cycle
	
	$('div#gallery')
		.before('<div class="slideshowNav">')
		.cycle({ 
			fx:     'fade', 
			//fx: 'scrollDown',
			speed:  '500',
			timeout: '10000',
			containerResize: false,
			pauseOnPagerHover: true,
			pause: true,
			pager: '.slideshowNav'
		});
		
	// TIMER
				
	$("#countdown_banner").everyTime(1000,function(i) {
			// subtract second
			if (seconds > 0)
			{
				seconds--;
			}
			else
			{
				if (minutes > 0)
				{
					seconds = 59;
					minutes--;
				}
				else
				{
					if (hours > 0)
					{
						hours--;
						minutes = 59;
						seconds = 59;
					}
					else 
					{
						if (days > 0)
						{
							days--;
							hours = 23;
							minutes = 59;
							seconds = 59;
						}
						else
						{
							// einde!
						}
					}
				}
			}
			var days_text = (days == 1) ? "DAG" : "DAGEN";
			var hours_text = (hours == 1) ? "UUR" : "UREN";
			var minutes_text = (minutes == 1) ? "MINUUT" : "MINUTEN";
			$(this).html('<p>'+ days + ' ' + days_text + ',<br />' + hours + ' ' + hours_text + ' &amp;<br />' + minutes + ' ' + minutes_text + '</p>');
		});
		
	// MORE / LESS

 	$("ul.faq li a").click(function (event) {	
       event.preventDefault();
       var $li = $(this).parent();
       $li.toggleClass("open");
       $li.next("ul").toggle();
   });
   
	//
	// MORE / LESS
	//
   $("a.showmore").click(function () {
	$(this).toggleClass("less").html("LEES MEER >");
	$("a.less").html("< VERBERG");
	$(this).prev("div.more").toggle();
   });
   
   
  $("iframe").attr('frameBorder', '0');
  
  
    //
	// FORM CLEAR INPUT
	//
	$('form input:not(.button)').click(function () {
		if (($(this).val() == 'Naam') || ($(this).val() == 'E-mail') || ($(this).val() == 'Zoekterm')) { 
			$(this).val('');
		}
	}); 
	
	
});


// Cufon

	Cufon.replace('h1', { fontFamily: 'ayitapro_semibold' });
	Cufon.replace('h2', { fontFamily: 'ayitapro_semibold' });
	Cufon.replace('div#menu ul li a', { hover:true, fontFamily:'ayitapro_semibold' });

