function showPhotos(page,eid) {
	params = 'eid='+eid+"&pageindex="+page;
	handler = 'site/gallery_detail.php';
	//new Effect.SlideUp('gallery_window');	
	new Ajax.Updater(
		'gallery_window',
		'ajax.php',
		{
			method : 'post',
			parameters : 'page='+handler+"&"+params,
			requestHeaders: ['Expires', 'Thu, 17 May 2001 10:17:17 GMT', 'Cache-Control', 'no-cache, must-revalidate', 'Pragma', 'no-cache'],
			evalScripts: true,
			onSuccess : function(request) {
				if ($('gallery_window').style.display != "none") return;
				new Effect.BlindDown('gallery_window');	
				new Effect.BlindUp('gallery_loader');	
			}
		}
	);
}

function showGalleries(page) {
	params = "parentpageindex="+page;
	handler = 'site/gallery.php';
	//new Effect.SlideUp('gallery_window');	
	new Ajax.Updater(
		'gallery_parent_window',
		'ajax.php',
		{
			method : 'post',
			parameters : 'page='+handler+"&"+params,
			requestHeaders: ['Expires', 'Thu, 17 May 2001 10:17:17 GMT', 'Cache-Control', 'no-cache, must-revalidate', 'Pragma', 'no-cache'],
			evalScripts: true,
			onSuccess : function(request) {	}
		}
	);
}

function showMusics(page) {
	params = "pid="+page;
	handler = 'site/music_detail.php';
	//new Effect.SlideUp('gallery_window');	
	new Ajax.Updater(
		'music_window',
		'ajax.php',
		{
			method : 'post',
			parameters : 'page='+handler+"&"+params,
			requestHeaders: ['Expires', 'Thu, 17 May 2001 10:17:17 GMT', 'Cache-Control', 'no-cache, must-revalidate', 'Pragma', 'no-cache'],
			evalScripts: true,
			onSuccess : function(request) {	}
		}
	);
}


function showMedias(page,eid) {
	params = 'eid='+eid+"&pageindex="+page;
	handler = 'site/media_detail.php';
	//new Effect.SlideUp('gallery_window');	
	new Ajax.Updater(
		'media_window',
		'ajax.php',
		{
			method : 'post',
			parameters : 'page='+handler+"&"+params,
			requestHeaders: ['Expires', 'Thu, 17 May 2001 10:17:17 GMT', 'Cache-Control', 'no-cache, must-revalidate', 'Pragma', 'no-cache'],
			evalScripts: true,
			onSuccess : function(request) {
				if ($('media_window').style.display != "none") return;
				new Effect.BlindDown('media_window');		
			}
		}
	);
}

function showMediaPlayer(eid) {
	flashProxy.call('closePlayer');
	params = 'eid='+eid;
	handler = 'site/media_player.php';
	//new Effect.SlideUp('gallery_window');	
	new Ajax.Updater(
		'media_player',
		'ajax.php',
		{
			method : 'post',
			parameters : 'page='+handler+"&"+params,
			requestHeaders: ['Expires', 'Thu, 17 May 2001 10:17:17 GMT', 'Cache-Control', 'no-cache, must-revalidate', 'Pragma', 'no-cache'],
			evalScripts: true,
			onSuccess : function(request) {
				if ($('media_player').style.display != "none") {$("youtube_player").style.display = "";return;}
				new Effect.Appear('media_player', {
					afterFinish : function() {}
				});
								
			}
		}
	);
}

function showNews(page) {
	params = "pageindex="+page;
	handler = 'site/home.php';
	//new Effect.SlideUp('gallery_window');	
	new Ajax.Updater(
		'main_content',
		'ajax.php',
		{
			method : 'post',
			parameters : 'page='+handler+"&"+params,
			requestHeaders: ['Expires', 'Thu, 17 May 2001 10:17:17 GMT', 'Cache-Control', 'no-cache, must-revalidate', 'Pragma', 'no-cache'],
			evalScripts: true,
			onSuccess : function(request) {
				if ($('main_content').style.display != "none") return;
				new Effect.BlindDown('main_content');		
			}
		}
	);
}


function showAbouts(page) {
	params = "pageindex="+page;
	handler = 'site/about.php';
	//new Effect.SlideUp('gallery_window');	
	new Ajax.Updater(
		'main_content',
		'ajax.php',
		{
			method : 'post',
			parameters : 'page='+handler+"&"+params,
			requestHeaders: ['Expires', 'Thu, 17 May 2001 10:17:17 GMT', 'Cache-Control', 'no-cache, must-revalidate', 'Pragma', 'no-cache'],
			evalScripts: true,
			onSuccess : function(request) {
				if ($('main_content').style.display != "none") return;
				new Effect.BlindDown('main_content');		
			}
		}
	);
}


function showAgendas(page,year) {
	var params = "pageindex="+page+"&year="+year;
	var handler = 'site/agenda.php';
	//new Effect.SlideUp('gallery_window');	
	new Ajax.Updater(
		'main_content',
		'ajax.php',
		{
			method : 'post',
			parameters : 'page='+handler+"&"+params,
			requestHeaders: ['Expires', 'Thu, 17 May 2001 10:17:17 GMT', 'Cache-Control', 'no-cache, must-revalidate', 'Pragma', 'no-cache'],
			evalScripts: true,
			onSuccess : function(request) {
				if ($('main_content').style.display != "none") return;
				new Effect.BlindDown('main_content');		
			}
		}
	);
}

function wait() {
	setTimeout("void(0)",2500)
}

function ajaxUpdater(divOut, handler, params) {
	new Ajax.Updater(
		divOut,
		'ajax.php',
		{
			method : 'post',
			parameters : 'page='+handler+"&"+params,
			requestHeaders: ['Expires', 'Thu, 17 May 2001 10:17:17 GMT', 'Cache-Control', 'no-cache, must-revalidate', 'Pragma', 'no-cache'],
			evalScripts: true
		}
	);
}


function showFoto(foto) {
	flashProxy.call('showFoto',foto);
}

function showVideo(video) {
	closeYoutube();
	flashProxy.call('showVideo',video);	
}

function closeYoutube() {
	if ($("media_player").style.display != "none" && $("youtube_player") != null) {
		$("youtube_player").innerHTML = "";
		new Effect.SlideUp("media_player");
	}
	
}

function showMusic(music) {
	closeYoutube();
	flashProxy.call('showMusic',music);	
}

function toggleDisplayNews(itemId) {
	if ($('news_header_'+itemId).style.display != 'none') {
		new Effect.Appear('news_complete_'+itemId, {duration : 1});
		new Effect.Fade('news_header_'+itemId, {duration : 1});			
	} else {
		$('news_complete_'+itemId).style.display = "none";
		new Effect.Appear('news_header_'+itemId, {duration : 1});	
	}

	/*if ($('news_header_'+itemId).style.display != 'none') {
		Effect.toggle('news_header_'+itemId,'slide',{
			duration : 0.2,
			afterFinish : function() {
				Effect.toggle('news_complete_'+itemId,'slide', {duration : 0.8})
			} 
			});
	} else {
		Effect.toggle('news_complete_'+itemId,'slide',{
			duration : 0.2,
			afterFinish : function() {
				Effect.toggle('news_header_'+itemId,'slide', {duration : 0.8})
			} 
			});
	}*/
}


nieuwsbrief_submitting = false;
function nieuwsbrief_submit() {
	$('street_kb').submit();
	nieuwsbrief_submitting = true;
	$('street_kb').innerHTML = '<br/>Aanmelding wordt verwerkt...';
}

function nieuwsbrief_posted() {
	if (nieuwsbrief_submitting) nieuwsbrief_submitted();
}

function nieuwsbrief_submitted() {
	$('street_kb').innerHTML = '<br/>Je hebt je aangemeld voor de <br>nieuwsbrief van Divinity!';
}


function showDialog(title) {
	Effect.Appear("overlay",{from : 0,to : 0.5});
	params = "title="+title;
	handler = 'site/textloader.php';
	new Ajax.Updater(
		'lightbox_content',
		'ajax.php',
		{
			method : 'post',
			parameters : 'page='+handler+"&"+params,
			requestHeaders: ['Expires', 'Thu, 17 May 2001 10:17:17 GMT', 'Cache-Control', 'no-cache, must-revalidate', 'Pragma', 'no-cache'],
			evalScripts: true,
			onSuccess : function(request) {
				Effect.Appear("lightbox",{duration : 1.3});
			}
		}
	);
	
}

function closeDialog() {
	Effect.Fade("lightbox",{duration : 1});
	Effect.Fade("overlay",{from : 0.5,to : 0});
}

function showDialogPaylogic() {
	Effect.Appear("overlay",{from : 0,to : 0.8});
	Effect.Appear("lightbox_paylogic",{duration : 1});
	$('body').style.overflow = "hidden";
}

function closeDialogPaylogic() {
	Effect.Fade("lightbox_paylogic",{duration : 1.3});
	Effect.Fade("overlay",{from : 0.8,to : 0});
	$('body').style.overflow = "auto";
}



