$(document).ready(function(){
// 	$('a[@rel*=lightbox]').lightBox(
// 	{
// 		imageLoading: 'img/lightbox-ico-loading.gif',
// 		imageBtnClose: 'img/lightbox-btn-close.gif',
// 		imageBtnPrev: 'img/lightbox-btn-prev.gif',
// 		imageBtnNext: 'img/lightbox-btn-next.gif',
// 		fixedNavigation : true
// 	});
	
    $('#advertentie_preview a').lightBox();
    $('#advertentie_afbeelding a').lightBox();
    $('#grote_afbeelding a').lightBox();
    //$('#advertentie_afbeelding a').lightBox();
	
	$('#advertentie_cycle')
		.cycle({ 
		    fx:     'fade',
		    speed:   300, 
		    timeout: 3000,
		    pause: 1,
		    next: '#advertentie_cycle'
		});
		
	init_formulieren();
});

function onBefore() {
	$('#advertentie_preview').load('ajax/laad_advertentie.ajax.php', {ad_id: this.id});
}

function onAfter() {
	$('#advertentie_preview').load('ajax/laad_advertentie.ajax.php', {ad_id: this.id});
}

function toonAfbeelding(ad_num) {
	$('#advertentie_cycle').cycle('pause');
	$('#advertentie_cycle').cycle(ad_num);
}

function verbergAfbeelding() {
	$('#advertentie_cycle').cycle('resume');
}

function display_vestiging_select(state) {
	var vestiging_holder = document.getElementById('vestiging_holder');
	
	if (state == 'aan') {
		if (vestiging_holder) {
			vestiging_holder.style.display = 'block';
		}
	} else {
		if (vestiging_holder) {
			vestiging_holder.style.display = 'none';
		}
	}
	
}

function show_element(id) {	
	var element_object = document.getElementById(id);
	if (element_object) {
		element_object.style.display = 'block';
	} 
}



