
//Slideshow
var ar_images = Array();

var mp3s = Array();
mp3s[mp3s.length] = 'mp3/12 Lilac Wine.mp3';
mp3s[mp3s.length] ='mp3/2-11 See You When I Get There.mp3';
mp3s[mp3s.length] ='mp3/12 Feel So High.mp3';
mp3s[mp3s.length] = 'mp3/09 Le petit oiseau de toutes les cou.mp3';
mp3s[mp3s.length] = 'mp3/06 I\'ve Got a Crush On You.mp3';


mp3s.sort(randOrd);



function randOrd()
{	
	return (Math.round(Math.random())-0.5); 
} 

function getImagesSlide()
{
	document.getElementById('slideshow').style.display='none';
	
	var i = 0;
	var rn = Math.round(Math.random()*ar_images.length);
	while(ar_images.length > i)
	{
		document.writeln('<img id="slideimage_'+i+'" src="'+ ar_images[i] +'" alt="Restaurant Don Quichotte"/>\n');
		i++;
	}
	
	
	
	document.getElementById('slideimage_' + rn).className = 'active';
	document.getElementById('slideshow').style.display='block';

}

function showFotoAlbum()
{
var content  = "";
content +='<h2>Fotoalbum</h2>\n';
content +='<p>Klik op &egrave;&egrave;n van de foto\'s om naar het fotoalbum te gaan.</p>\n';
content +='<p>\n';
content +='<a href="images/fotoalbum/groot_1.jpg" class="pirobox_gall" title="&nbsp;"><img  src="images/fotoalbum/klein_1.jpg" border="0" /></a>\n';
content +='<a href="images/fotoalbum/groot_2.jpg" class="pirobox_gall" title="&nbsp;"><img src="images/fotoalbum/klein_2.jpg" border="0" /></a>\n';
content +='<a href="images/fotoalbum/groot_3.jpg" class="pirobox_gall" title="&nbsp;"><img src="images/fotoalbum/klein_3.jpg" border="0" /></a>\n';
content +='<a href="images/fotoalbum/groot_4.jpg" class="pirobox_gall" title="&nbsp;"></a>\n';
content +='<a href="images/fotoalbum/groot_5.jpg" class="pirobox_gall" title="&nbsp;"></a>\n';
content +='<a href="images/fotoalbum/groot_6.jpg" class="pirobox_gall" title="&nbsp;"></a>\n';
content +='<a href="images/fotoalbum/groot_7.jpg" class="pirobox_gall" title="&nbsp;"></a>\n';
content +='<a href="images/fotoalbum/groot_8.jpg" class="pirobox_gall" title="&nbsp;"></a>\n';
content +='<a href="images/fotoalbum/groot_9.jpg" class="pirobox_gall" title="&nbsp;"></a>\n';
content +='</p>\n';
document.writeln(content);
}

function showLogos()
{
var content  = "";
content +=' <h2>Logovariaties</h2>';
content +='<p>In de loop der jaren zijn er heel wat ontwerpen geweest en hebben we een aantal gadgets laten maken (<a href="http://www.kleurendruk.nl" target="_top">www.kleurendruk.nl</a>) waarin ons logo een rol heeft gespeeld; hier vindt u een aantal daarvan op een rij. <br />';
content +='  <br />';
content += ' Klik op &egrave;&egrave;n van de logo\'s om de gadgets te zien.</p> \n';
content +='<p>\n';
content +='<a href="images/logos/tweejaar.jpg" class="pirobox_gall_one" title="Logo 2 jaar"><img src="images/logos/tweejaarklein.jpg" border="0" /></a>\n';
content +='<a href="images/logos/logo_5jaar.jpg" class="pirobox_gall_one" title="Logo 5 jaar"><img src="images/logos/logo_5jaar_klein.jpg" border="0" /></a>\n';
content +='<a href="images/logos/logo_10jaar.jpg" class="pirobox_gall_one" title="Logo 10 jaar"><img  src="images/logos/logo_10jaar_klein.jpg" border="0" /></a>\n';
content +='<a href="images/logos/logo_6jaar.jpg" class="pirobox_gall_one" title="Logo 6 jaar"></a>\n';
content +='<a href="images/logos/logo_7jaar.jpg" class="pirobox_gall_one" title="Logo 7 jaar"></a>\n';
content +='<a href="images/logos/logo_8jaar.jpg" class="pirobox_gall_one" title="Logo 8 jaar"></a>\n';
content +='<a href="images/logos/logo_9jaar.jpg" class="pirobox_gall_one" title="Logo 9 jaar"></a>\n';

content +='</p>\n';
document.writeln(content);
}

function showRariteiten()
{

var content  = "";
content +='	<h2>Rariteitenkabinet</h2>\n';
content +='<p>Restaurant Don Quichotte wordt wel eens een rariteitenkabinet genoemd, omdat het gedecoreerd is met een groot aantal speciale objecten en schilderijen. Hier vindt u een aantal van die typische items op een rij. Klik op &egrave;&egrave;n van de foto\'s om dit te aanschouwen.</p> \n';
content +='<p>\n';
content +='<a href="/images/rariteitenkabinet/groot_1.jpg" class="pirobox_gall_two" title="&nbsp;"><img src="/images/rariteitenkabinet/klein_1.jpg" border="0" /></a>\n';
content +='<a href="/images/rariteitenkabinet/groot_2.jpg" class="pirobox_gall_two" title="&nbsp;"><img src="/images/rariteitenkabinet/klein_2.jpg" border="0" /></a>\n';
content +='<a href="/images/rariteitenkabinet/groot_3.jpg" class="pirobox_gall_two" title="&nbsp;"><img src="/images/rariteitenkabinet/klein_3.jpg" border="0" /></a>\n';
content +='</p>\n';
document.writeln(content);
}

function showHide(show,hide)
{	
var ar = Array();
ar = hide.split('|');

	document.getElementById(show).style.display = 'block';
	
	i = 0;
	while(ar.length > i)
	{
		document.getElementById(ar[i]).style.display = 'none';
	i++;
	}

}

$(document).ready(function(){
						   
$().piroBox({
      my_speed: 300, //animation speed
      bg_alpha: 0.5, //background opacity
      radius: 4, //caption rounded corner
      pirobox_next : 'piro_next', // Nav buttons -> piro_next == inside piroBox , piro_next_out == outside piroBox
      pirobox_prev : 'piro_prev',// Nav buttons -> piro_prev == inside piroBox , piro_prev_out == outside piroBox
      close_all : '.piro_close',// add class .piro_overlay(with comma)if you want overlay click close piroBox
      slideShow : 'slideshow', // just delete slideshow between '' if you don't want it.
      slideSpeed : 3 //slideshow duration in seconds(3 to 6 Recommended)
      });


		
		
var playItem = 0;
 
		var myPlayList = [
		{name:"Lentement",mp3:"mp3/12 Feel So High.mp3"},
		{name:"Lilac Wine",mp3:"mp3/12 Lilac Wine.mp3"},
		{name:"See You When I Get There",mp3:"mp3/2-11 See You When I Get There.mp3"},
		{name:"Le petit oiseau de toutes les cou",mp3:"mp3/09 Le petit oiseau de toutes les cou.mp3"},
		{name:"Got a Crush On You",mp3:"mp3/06 I\'ve Got a Crush On You.mp3"},
		];
		
		
 
 
	$("#jquery_jplayer").jPlayer({
		ready: function() {
			demoInstanceInfo($(this), $("#jplayer_info"));
		},
		oggSupport:false
	})
	.jPlayerId("play", "player_play")
	.jPlayerId("pause", "player_pause")
	.jPlayerId("stop", "player_stop")
	.jPlayerId("loadBar", "player_progress_load_bar")
	.jPlayerId("playBar", "player_progress_play_bar")
	.jPlayerId("volumeMin", "player_volume_min")
	.jPlayerId("volumeMax", "player_volume_max")
	.jPlayerId("volumeBar", "player_volume_bar")
	.jPlayerId("volumeBarValue", "player_volume_bar_value")
	.onProgressChange( function(loadPercent, playedPercentRelative, playedPercentAbsolute, playedTime, totalTime) {
		var myPlayedTime = new Date(playedTime);
		var ptMin = (myPlayedTime.getUTCMinutes() < 10) ? "0" + myPlayedTime.getUTCMinutes() : myPlayedTime.getUTCMinutes();
		var ptSec = (myPlayedTime.getUTCSeconds() < 10) ? "0" + myPlayedTime.getUTCSeconds() : myPlayedTime.getUTCSeconds();
		$("#play_time").text(ptMin+":"+ptSec);
 
		var myTotalTime = new Date(totalTime);
		var ttMin = (myTotalTime.getUTCMinutes() < 10) ? "0" + myTotalTime.getUTCMinutes() : myTotalTime.getUTCMinutes();
		var ttSec = (myTotalTime.getUTCSeconds() < 10) ? "0" + myTotalTime.getUTCSeconds() : myTotalTime.getUTCSeconds();
		$("#total_time").text(ttMin+":"+ttSec);
	})
	.onSoundComplete( function() {
		playListNext();
	});
	
	$("#pause").hide();
 
	function showPauseBtn()
	{
		$("#play").fadeOut(function(){
			$("#pause").fadeIn();
		});
	}	
	
	function showPlayBtn()
	{
		$("#pause").fadeOut(function(){
			$("#play").fadeIn();
		});
	}
	
	
	$("#play").click(function() 
	{
		playListRand()
		$("#jquery_jplayer").play();
		showPauseBtn();
		return false;
	});	
	
	$("#pause").click(function() {
		$("#jquery_jplayer").pause();
		showPlayBtn();
		return false;
	});	
 
	$("#ctrl_prev").click( function() {
		playListPrev();
		return false;
	});
 
	$("#ctrl_next").click( function() {
		playListNext();
		return false;
	});
 
	function displayPlayList() {
		for (i=0; i < myPlayList.length; i++) {
			$("#playlist_list ul").append("<li id='playlist_item_"+i+"'>"+ myPlayList[i].name +"</li>");
			$("#playlist_item_"+i).data( "index", i ).hover(
				function() {
					if (playItem != $(this).data("index")) {
						$(this).addClass("playlist_hover");
					}
				},
				function() {
					$(this).removeClass("playlist_hover");
				}
			).click( function() {
				var index = $(this).data("index");
				if (playItem != index) {
					playListChange( index );
				} else {
					$("#jquery_jplayer").play();
				}
			});
		}
	}
 
	function playListInit(autoplay) {
		if(autoplay) {
			playListChange( playItem );
		} else {
			playListConfig( playItem );
		}
	}
 
	function playListConfig( index ) {
		$("#playlist_item_"+playItem).removeClass("playlist_current");
		$("#playlist_item_"+index).addClass("playlist_current");
		playItem = index;
		$("#jquery_jplayer").setFile(myPlayList[playItem].mp3);
	}
 
	function playListChange( index ) {
		playListConfig( index );
		$("#jquery_jplayer").play();
	}
	
	
	
	function playListRand() {
		var index = Math.floor(Math.random()*(myPlayList.length-1))
		playListChange( index );
	}
 
	function playListNext() {
		var index = (playItem+1 < myPlayList.length) ? playItem+1 : 0;
		playListChange( index );
	}
 
	function playListPrev() {
		var index = (playItem-1 >= 0) ? playItem-1 : myPlayList.length-1;
		playListChange( index );
	}
	
 
});


