<!DOCTYPE html>
<html lang="nl">
<head>
	<meta charset="UTF-8" />
	<title>Mooiste geluid van Nederland</title>

	<meta name="description" content="Mooiste geluid van Nederland" />
	<meta name="author" content="Yes2web BV" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

	<link rel="stylesheet" href="/css/stdv1.2.css" />
	<link rel="stylesheet" href="/css/site.css" />
	<link rel="stylesheet" href="/css/main.css" media="screen" />
	<link rel="stylesheet" href="/css/fileuploader.css" />
	<link rel="stylesheet" href="/css/jquery.fancybox-1.3.4.css" />
	<script src="/js/swfobject.js" type="text/javascript"></script>
	<link rel="shortcut icon" href="/images/icons/favicon.ico" />    
	
	<meta property="og:type" content="article"/>
	<meta property="og:url" content="http://hetmooistegeluidvannederland.nl/"/>
	<meta property="og:site_name" content="http://hetmooistegeluidvannederland.nl" />
	<meta id="meta-img" property="og:image" content="http://hetmooistegeluidvannederland.nl/images/logo/logo_nl.png" />
	<meta id="meta-title" property="og:title" content="Het mooiste geluid van Nederland" />
	<meta id="meta-desc" property="og:description" content="Wij houden van geluid. Upload of omschrijf jouw geluid en zorg ervoor dat jouw geluid zoveel mogelijk stemmen krijgt. Wie weet wordt jouw geluid het mooiste van Nederland én win je een iPad 2!" />
</head>	

<body id="nl">
	<a id="loadingdiva" href="#loadingdiv" class="hide"></a>
	<div id="loadingdiv" class="hide"><p style="text-align:left;margin:0;"><img style="float:left;margin:0 5px 20px;" src="/images/icons/loading.gif"/>Even geduld alsjeblieft. Op dit moment wordt het filmpje gedownload en halen we het geluid eruit.<br/>Dit kan een paar minuten duren. Straks kun je het beste stukje uit het geluidsfragment selecteren. 
	</p></div>
	<div id="loadingdivb" class="hide"><p style="text-align:left;margin:0;"><img style="float:left;margin:0 5px 20px;" src="/images/icons/loading.gif"/>Even geduld alsjeblieft. Op dit moment wordt het geluid opgeslagen.
	</p></div>
	<header class="container header">

		<h1><a href="/"><img id="logo" src="/images/logo/logo_nl.png" alt="Mooiste geluid van Nederland" /></a></h1>
		
		<form method="get" action="/#!/zoek-inzending/1/" class="search">
			<label for="q">Zoeken</label>
			<input id="q" name="q" type="text" placeholder="op naam of trefwoord" title="op naam of trefwoord" />
			<button id="searchsubmit" type="submit">Zoek</button>
		</form>

		<nav id="nav">
			<ul>
				<li><a href="/">Home</a></li>
				<li class="last"><a class="modal" href="/hoewerkthet/">Hoe werkt het?</a></li>
			</ul>
		</nav>
		
	</header>
	<h2 class="main">Klik op een beeld en beluister!</h2>
	<div class="container" id="gallerycontainer">		<div class="wrapper">
			<article class="content">

				<form method="get" action="#" id="filter">
					<label for="sortGallery">Laat alleen inzendingen zien</label>
					<select name="sort" id="sortGallery">
						<option value="-2" selected="selected">die het laatst zijn toegevoegd: deze zijn niet gefilterd</option>
						<option value="-3">met de meeste stemmen</option>
						<option value="-1">met geluid</option>
						<option value="0">met thema De magie van de natuur</option><option value="1">met thema De sound van je grote passie</option><option value="2">met thema Het geluid van vroeger</option><option value="3">met thema De klank van gezelligheid</option><option value="4">met thema Het geruis van het alledaagse</option><option value="5">met thema Het ritme van de stad</option>					</select>
				</form>
				<div id="gallery" class="dynamiccontent">
				</div>
			</article>
		</div>

		<aside class="sidebar">
			<h3 class="hide">Top 5</h3>
			<p>Dit waren de geluiden met de meeste stemmen. Klik op het betreffende geluid om het te beluisteren.</p>
			<ul id="top5"><li id="t364">
			<img title="Het 1e levensteken" src="/user/thumb/364.jpg" /><h4>Het 1e levensteken</h4>
			<p>Mieke van de Wiel</p><span class="number">1</span>
		</li><li id="t372">
			<img title="De zee" src="/user/thumb/372.jpg" /><h4>De zee</h4>
			<p>Inge de Bruin</p><span class="number">2</span>
		</li><li id="t287">
			<img title="Wakker worden in mijn ..." src="/user/thumb/287.jpg" /><h4>Wakker worden in mijn ...</h4>
			<p>Lenny Elst</p><span class="number">3</span>
		</li><li id="t298">
			<img title="Fyra trein komt aan in..." src="/user/thumb/298.jpg" /><h4>Fyra trein komt aan in...</h4>
			<p>Fiona Rademakers</p><span class="number">4</span>
		</li><li id="t425">
			<img title="De eerste scheet van d..." src="/user/thumb/425.jpg" /><h4>De eerste scheet van d...</h4>
			<p>Ferdi</p><span class="number">5</span>
		</li></ul>
		</aside>
		<br class="break" />
	</div>
	<h2 id="sendin" class="stuurinbar main" showed="false"><a href="#sendin" class="sendin">Het mooiste geluid van Nederland!</a></h2>
	<div class="container">

		<div class="wrapper">
			<article class="content2">
				<p>Wij houden van geluid. Daarom zijn we op zoek naar het mooiste geluid van Nederland.<br />Jullie hebben gestemd en het 1e levensteken, ingezonden door Mieke van de Wiel, is het geluid met de meeste stemmen. <strong>Wij danken Mieke voor haar mooie inzending en feliciteren haar met het winnen van een iPad2!<br/><br/>Ook Thom de Boer heeft een iPad2 gewonnen door te stemmen op het mooiste geluid. Gefeliciteerd!</strong> <a href="#sendin" class="sendin"><img id="win" src="/images/content/winipad2_nl.png" /></a></p>
			</article>
		</div>

		<aside class="sidebar2">
			<a href="http://www.schoonenberg.nl/" target="_blank"><img src="/images/logo/sponsor_nl.png" /></a>
		</aside>
		<div id="insturen">
			<form class="insturen-form" action="#" method="post" id="insturenform">
			<div id="form1" class="insturen-div">
		<div class="wrapper">
		<div class="rightcolumn">
		
					<p class="extra-info">
		Helaas, je kunt niet meer inzenden. De actie is afgelopen.		</p>
				</div>
	</div>
	
	<div class="leftcolumn">
		<h2>Vertel ons wat jouw mooiste geluid is.</h2>
	</div>
	<br class="break" />
	</div>
<div id="form2" class="insturen-div hide">
	<ul class="steps">
		<li><a href="#" class="viewform" rel="1">stap 1.</a></li>
		<li><span class="selected">stap 2.</span></li>
		<li><a href="#" class="viewform" rel="3">stap 3.</a></li>
	</ul>
	
	<div class="wrapper">
		<div class="rightcolumn">
			<p>Upload hier je iegen mp3 of vul een Youtube url in. Klik vervolgens op <em>inzending plaatsen</em> om verder te gaan.</p>

			<label>MP3</label>
			<div id="mp3-file-uploader"></div><br />
			
			<label for="sYoutubeUrl">Youtube Url</label>
			<input type="text" name="sYoutubeUrl" id="sYoutubeUrl" />
			<span id="youtubefeedback"></span>

			<div id="soundselector">
			</div>
		</div>
	</div>

	<div class="leftcolumn">
		<h2>Upload jouw mooiste geluid of kies er één uit onze geluidsbibliotheek.</h2>
		<p>We hebben alvast een aantal mooie geluiden verzameld in onze geluidsbibliotheek. Bekijk of jouw geluid erbij zit. Biedt de geluidsbibliotheek geen uitkomst en heb je ook geen mp3-bestand of Youtube-filmpje? Je kunt deze stap ook overslaan.</p>
	</div><br class="break" />
	
	<p class="left">
		<a href="#" class="viewform" rel="1">&lt; naar vorige stap</a>
	</p>
	<p class="right">
		<a href="#" class="viewform" rel="3">sla deze stap over ></a> <button id="form2submit" class="formsubmit" type="submit">inzending plaatsen ></button>
	</p><br class="break" />
</div><div id="form3" class="insturen-div hide">
	<ul class="steps">
		<li><a href="#" class="viewform" rel="1">stap 1.</a></li>
		<li><a href="#" class="viewform" rel="2">stap 2.</a></li>
		<li><span class="selected">stap 3.</span></li>
	</ul>
	
	<div class="wrapper">
		<div class="rightcolumn">
	
			<label for="sFullName">Je (volledige) naam</label>
			<input type="text" name="sFullName" id="sFullName"><br/>

			<label for="sEmail">Je e-mailadres</label>
			<input type="text" name="sEmail" id="sEmail" /><br/>
			
			
			<label class="inline indent" for="iTAC"><input type="checkbox" id="iTAC" name="iTAC" value="1">Ja, ik ga akkoord met de algemene &nbsp;<a class="modal" href="/actievoorwaarden/">actievoorwaarden</a></label><br />
			<label class="inline indent" for="iNewsletter"><input type="checkbox" name="iNewsletter" id="iNewsletter" value="1" />Hou me op de hoogte</label><br />

		</div>
	</div>
	
	<div class="leftcolumn">
		<h2>Je bent bijna klaar.</h2>
		<p>Vul je persoonlijke gegevens in en controleer je inzending om jouw geluid te plaatsen.</p>
	</div><br class="break" />
	
	<div id="pv-soundpreview" class="sound-details">
		<div class="wrapper">
			<section class="sound-content">
<!--				<p class="author">Ingestuurd door <strong id="pv-name"></strong></p>-->
				<h1 id="pv-title"></h1>
				<p id="pv-description"></p>
			</section>
		</div>
		<aside class="avatar">
			<img id="pv-img" src="/user/image/10.jpg" />
			<a href="#" id="preview-sound" class="green-sprite" alt="/preview-mp3/1-11.mp3"></a>
		</aside>
		<br class="break" />
	</div>
	
	<div id="upload-img">
		<p>Heb je een afbeelding die perfect bij jouw geluid past?<br/>Voeg het dan hier toe.</p>
		<div id="file-uploader"></div>
	</div>
	<br class="break" />
	<p class="left">
		<a id="vorigestapinform3" href="#" class="viewform" rel="2">&lt; naar vorige stap</a>
	</p>
	<p class="right">
		<button type="submit" id="form3submit" class="formsubmit">inzending plaatsen ></button>
	</p><br class="break" />
</div>
			</form>
			<div id="form4" class="insturen-div hide"></div>
		</div>
	</div>
	<div id="CentralAudioPlayer" style="position:absolute;"></div>
	<script type="text/javascript">
		swfobject.embedSWF("/flash/audioplayer2.swf", "CentralAudioPlayer", "0", "0", "9.0.0", "expressInstall.swf", {}, {"allowScriptAccess":"always"},{"styleclass":"hasFlash"});
	</script>
	<h2 class="send-in"><a id="librarybar" href="#">Inspiratie nodig? Beluister de geluidsbibliotheek.</a></h2>
<div class="sound-lib" id="library">
	<p>Klik op de afbeeldingen om het geluid te beluisteren. Is het precies het geluid dat jij het mooiste vindt? Klik dan 'kiezen'.</p>
	<div id="library-wrap">
		<div id="lib-selector">
			<ul id="jcarousel">
				<li class="lib-item green">
			<p class="title">Wandelen in de sneeuw</p>
			<div class="theme">
				<a class="gallery-item-l icon green-sprite play-lib" id="g193" href="#">
					<img title="" src="/library/image/193.jpg" width="100" height="100" />
					<em class="gallery-item-em">193</em>
				</a>
			</div>
			
		</li><li class="lib-item green">
			<p class="title">Moeras (kikkers en insecten)</p>
			<div class="theme">
				<a class="gallery-item-l icon green-sprite play-lib" id="g194" href="#">
					<img title="" src="/library/image/194.jpg" width="100" height="100" />
					<em class="gallery-item-em">194</em>
				</a>
			</div>
			
		</li><li class="lib-item green">
			<p class="title">Merel</p>
			<div class="theme">
				<a class="gallery-item-l icon green-sprite play-lib" id="g195" href="#">
					<img title="" src="/library/image/195.jpg" width="100" height="100" />
					<em class="gallery-item-em">195</em>
				</a>
			</div>
			
		</li><li class="lib-item green">
			<p class="title">Krekels</p>
			<div class="theme">
				<a class="gallery-item-l icon green-sprite play-lib" id="g196" href="#">
					<img title="" src="/library/image/196.jpg" width="100" height="100" />
					<em class="gallery-item-em">196</em>
				</a>
			</div>
			
		</li><li class="lib-item green">
			<p class="title">Koeienbel</p>
			<div class="theme">
				<a class="gallery-item-l icon green-sprite play-lib" id="g197" href="#">
					<img title="" src="/library/image/197.jpg" width="100" height="100" />
					<em class="gallery-item-em">197</em>
				</a>
			</div>
			
		</li><li class="lib-item green">
			<p class="title">Boerderij</p>
			<div class="theme">
				<a class="gallery-item-l icon green-sprite play-lib" id="g198" href="#">
					<img title="" src="/library/image/198.jpg" width="100" height="100" />
					<em class="gallery-item-em">198</em>
				</a>
			</div>
			
		</li><li class="lib-item green">
			<p class="title">Golven</p>
			<div class="theme">
				<a class="gallery-item-l icon green-sprite play-lib" id="g199" href="#">
					<img title="" src="/library/image/199.jpg" width="100" height="100" />
					<em class="gallery-item-em">199</em>
				</a>
			</div>
			
		</li><li class="lib-item green">
			<p class="title">Tropisch regenwoud</p>
			<div class="theme">
				<a class="gallery-item-l icon green-sprite play-lib" id="g200" href="#">
					<img title="" src="/library/image/200.jpg" width="100" height="100" />
					<em class="gallery-item-em">200</em>
				</a>
			</div>
			
		</li><li class="lib-item green">
			<p class="title">Regen</p>
			<div class="theme">
				<a class="gallery-item-l icon green-sprite play-lib" id="g201" href="#">
					<img title="" src="/library/image/201.jpg" width="100" height="100" />
					<em class="gallery-item-em">201</em>
				</a>
			</div>
			
		</li><li class="lib-item green">
			<p class="title">Leeuw</p>
			<div class="theme">
				<a class="gallery-item-l icon green-sprite play-lib" id="g202" href="#">
					<img title="" src="/library/image/202.jpg" width="100" height="100" />
					<em class="gallery-item-em">202</em>
				</a>
			</div>
			
		</li><li class="lib-item brown">
			<p class="title">Roltrap</p>
			<div class="theme">
				<a class="gallery-item-l icon brown-sprite play-lib" id="g203" href="#">
					<img title="" src="/library/image/203.jpg" width="100" height="100" />
					<em class="gallery-item-em">203</em>
				</a>
			</div>
			
		</li><li class="lib-item brown">
			<p class="title">Lift</p>
			<div class="theme">
				<a class="gallery-item-l icon brown-sprite play-lib" id="g204" href="#">
					<img title="" src="/library/image/204.jpg" width="100" height="100" />
					<em class="gallery-item-em">204</em>
				</a>
			</div>
			
		</li><li class="lib-item brown">
			<p class="title">Metro</p>
			<div class="theme">
				<a class="gallery-item-l icon brown-sprite play-lib" id="g205" href="#">
					<img title="" src="/library/image/205.jpg" width="100" height="100" />
					<em class="gallery-item-em">205</em>
				</a>
			</div>
			
		</li><li class="lib-item brown">
			<p class="title">Helikopter</p>
			<div class="theme">
				<a class="gallery-item-l icon brown-sprite play-lib" id="g206" href="#">
					<img title="" src="/library/image/206.jpg" width="100" height="100" />
					<em class="gallery-item-em">206</em>
				</a>
			</div>
			
		</li><li class="lib-item brown">
			<p class="title">Opstijgen vliegtuig</p>
			<div class="theme">
				<a class="gallery-item-l icon brown-sprite play-lib" id="g207" href="#">
					<img title="" src="/library/image/207.jpg" width="100" height="100" />
					<em class="gallery-item-em">207</em>
				</a>
			</div>
			
		</li><li class="lib-item brown">
			<p class="title">Misthoorn</p>
			<div class="theme">
				<a class="gallery-item-l icon brown-sprite play-lib" id="g208" href="#">
					<img title="" src="/library/image/208.jpg" width="100" height="100" />
					<em class="gallery-item-em">208</em>
				</a>
			</div>
			
		</li><li class="lib-item brown">
			<p class="title">Verkeer</p>
			<div class="theme">
				<a class="gallery-item-l icon brown-sprite play-lib" id="g209" href="#">
					<img title="" src="/library/image/209.jpg" width="100" height="100" />
					<em class="gallery-item-em">209</em>
				</a>
			</div>
			
		</li><li class="lib-item brown">
			<p class="title">Vuilniswagen</p>
			<div class="theme">
				<a class="gallery-item-l icon brown-sprite play-lib" id="g210" href="#">
					<img title="" src="/library/image/210.jpg" width="100" height="100" />
					<em class="gallery-item-em">210</em>
				</a>
			</div>
			
		</li><li class="lib-item brown">
			<p class="title">Markt</p>
			<div class="theme">
				<a class="gallery-item-l icon brown-sprite play-lib" id="g211" href="#">
					<img title="" src="/library/image/211.jpg" width="100" height="100" />
					<em class="gallery-item-em">211</em>
				</a>
			</div>
			
		</li><li class="lib-item brown">
			<p class="title">Klokgeluid</p>
			<div class="theme">
				<a class="gallery-item-l icon brown-sprite play-lib" id="g212" href="#">
					<img title="" src="/library/image/212.jpg" width="100" height="100" />
					<em class="gallery-item-em">212</em>
				</a>
			</div>
			
		</li><li class="lib-item purple">
			<p class="title">Gorgelen</p>
			<div class="theme">
				<a class="gallery-item-l icon purple-sprite play-lib" id="g213" href="#">
					<img title="" src="/library/image/213.jpg" width="100" height="100" />
					<em class="gallery-item-em">213</em>
				</a>
			</div>
			
		</li><li class="lib-item purple">
			<p class="title">Popcorn</p>
			<div class="theme">
				<a class="gallery-item-l icon purple-sprite play-lib" id="g214" href="#">
					<img title="" src="/library/image/214.jpg" width="100" height="100" />
					<em class="gallery-item-em">214</em>
				</a>
			</div>
			
		</li><li class="lib-item purple">
			<p class="title">Vlees braden</p>
			<div class="theme">
				<a class="gallery-item-l icon purple-sprite play-lib" id="g215" href="#">
					<img title="" src="/library/image/215.jpg" width="100" height="100" />
					<em class="gallery-item-em">215</em>
				</a>
			</div>
			
		</li><li class="lib-item purple">
			<p class="title">Windmobiel</p>
			<div class="theme">
				<a class="gallery-item-l icon purple-sprite play-lib" id="g216" href="#">
					<img title="" src="/library/image/216.jpg" width="100" height="100" />
					<em class="gallery-item-em">216</em>
				</a>
			</div>
			
		</li><li class="lib-item purple">
			<p class="title">Weerklinkende voetstappen</p>
			<div class="theme">
				<a class="gallery-item-l icon purple-sprite play-lib" id="g217" href="#">
					<img title="" src="/library/image/217.jpg" width="100" height="100" />
					<em class="gallery-item-em">217</em>
				</a>
			</div>
			
		</li><li class="lib-item purple">
			<p class="title">In appel bijten</p>
			<div class="theme">
				<a class="gallery-item-l icon purple-sprite play-lib" id="g218" href="#">
					<img title="" src="/library/image/218.jpg" width="100" height="100" />
					<em class="gallery-item-em">218</em>
				</a>
			</div>
			
		</li><li class="lib-item purple">
			<p class="title">Rits</p>
			<div class="theme">
				<a class="gallery-item-l icon purple-sprite play-lib" id="g219" href="#">
					<img title="" src="/library/image/219.jpg" width="100" height="100" />
					<em class="gallery-item-em">219</em>
				</a>
			</div>
			
		</li><li class="lib-item purple">
			<p class="title">Fietsbel</p>
			<div class="theme">
				<a class="gallery-item-l icon purple-sprite play-lib" id="g220" href="#">
					<img title="" src="/library/image/220.jpg" width="100" height="100" />
					<em class="gallery-item-em">220</em>
				</a>
			</div>
			
		</li><li class="lib-item purple">
			<p class="title">Voeten vegen</p>
			<div class="theme">
				<a class="gallery-item-l icon purple-sprite play-lib" id="g221" href="#">
					<img title="" src="/library/image/221.jpg" width="100" height="100" />
					<em class="gallery-item-em">221</em>
				</a>
			</div>
			
		</li><li class="lib-item purple">
			<p class="title">Kusje</p>
			<div class="theme">
				<a class="gallery-item-l icon purple-sprite play-lib" id="g222" href="#">
					<img title="" src="/library/image/222.jpg" width="100" height="100" />
					<em class="gallery-item-em">222</em>
				</a>
			</div>
			
		</li><li class="lib-item orange">
			<p class="title">Lachende kinderen</p>
			<div class="theme">
				<a class="gallery-item-l icon orange-sprite play-lib" id="g223" href="#">
					<img title="" src="/library/image/223.jpg" width="100" height="100" />
					<em class="gallery-item-em">223</em>
				</a>
			</div>
			
		</li><li class="lib-item orange">
			<p class="title">Restaurant</p>
			<div class="theme">
				<a class="gallery-item-l icon orange-sprite play-lib" id="g224" href="#">
					<img title="" src="/library/image/224.jpg" width="100" height="100" />
					<em class="gallery-item-em">224</em>
				</a>
			</div>
			
		</li><li class="lib-item orange">
			<p class="title">Ontkurken van champagne</p>
			<div class="theme">
				<a class="gallery-item-l icon orange-sprite play-lib" id="g225" href="#">
					<img title="" src="/library/image/225.jpg" width="100" height="100" />
					<em class="gallery-item-em">225</em>
				</a>
			</div>
			
		</li><li class="lib-item orange">
			<p class="title">Pruttelende koffie</p>
			<div class="theme">
				<a class="gallery-item-l icon orange-sprite play-lib" id="g226" href="#">
					<img title="" src="/library/image/226.jpg" width="100" height="100" />
					<em class="gallery-item-em">226</em>
				</a>
			</div>
			
		</li><li class="lib-item orange">
			<p class="title">Spinnende kat</p>
			<div class="theme">
				<a class="gallery-item-l icon orange-sprite play-lib" id="g227" href="#">
					<img title="" src="/library/image/227.jpg" width="100" height="100" />
					<em class="gallery-item-em">227</em>
				</a>
			</div>
			
		</li><li class="lib-item orange">
			<p class="title">Klinkende glazen</p>
			<div class="theme">
				<a class="gallery-item-l icon orange-sprite play-lib" id="g228" href="#">
					<img title="" src="/library/image/228.jpg" width="100" height="100" />
					<em class="gallery-item-em">228</em>
				</a>
			</div>
			
		</li><li class="lib-item orange">
			<p class="title">Kampvuur</p>
			<div class="theme">
				<a class="gallery-item-l icon orange-sprite play-lib" id="g229" href="#">
					<img title="" src="/library/image/229.jpg" width="100" height="100" />
					<em class="gallery-item-em">229</em>
				</a>
			</div>
			
		</li><li class="lib-item orange">
			<p class="title">Lachende mensen</p>
			<div class="theme">
				<a class="gallery-item-l icon orange-sprite play-lib" id="g230" href="#">
					<img title="" src="/library/image/230.jpg" width="100" height="100" />
					<em class="gallery-item-em">230</em>
				</a>
			</div>
			
		</li><li class="lib-item orange">
			<p class="title">Barbecue</p>
			<div class="theme">
				<a class="gallery-item-l icon orange-sprite play-lib" id="g231" href="#">
					<img title="" src="/library/image/231.jpg" width="100" height="100" />
					<em class="gallery-item-em">231</em>
				</a>
			</div>
			
		</li><li class="lib-item orange">
			<p class="title">Feest met vuurwerk</p>
			<div class="theme">
				<a class="gallery-item-l icon orange-sprite play-lib" id="g232" href="#">
					<img title="" src="/library/image/232.jpg" width="100" height="100" />
					<em class="gallery-item-em">232</em>
				</a>
			</div>
			
		</li><li class="lib-item blue">
			<p class="title">Treinfluit</p>
			<div class="theme">
				<a class="gallery-item-l icon blue-sprite play-lib" id="g233" href="#">
					<img title="" src="/library/image/233.jpg" width="100" height="100" />
					<em class="gallery-item-em">233</em>
				</a>
			</div>
			
		</li><li class="lib-item blue">
			<p class="title">Filmprojector</p>
			<div class="theme">
				<a class="gallery-item-l icon blue-sprite play-lib" id="g234" href="#">
					<img title="" src="/library/image/234.jpg" width="100" height="100" />
					<em class="gallery-item-em">234</em>
				</a>
			</div>
			
		</li><li class="lib-item blue">
			<p class="title">Typemachine</p>
			<div class="theme">
				<a class="gallery-item-l icon blue-sprite play-lib" id="g235" href="#">
					<img title="" src="/library/image/235.jpg" width="100" height="100" />
					<em class="gallery-item-em">235</em>
				</a>
			</div>
			
		</li><li class="lib-item blue">
			<p class="title">Oude auto</p>
			<div class="theme">
				<a class="gallery-item-l icon blue-sprite play-lib" id="g236" href="#">
					<img title="" src="/library/image/236.jpg" width="100" height="100" />
					<em class="gallery-item-em">236</em>
				</a>
			</div>
			
		</li><li class="lib-item blue">
			<p class="title">LP</p>
			<div class="theme">
				<a class="gallery-item-l icon blue-sprite play-lib" id="g237" href="#">
					<img title="" src="/library/image/237.jpg" width="100" height="100" />
					<em class="gallery-item-em">237</em>
				</a>
			</div>
			
		</li><li class="lib-item blue">
			<p class="title">Telefoon</p>
			<div class="theme">
				<a class="gallery-item-l icon blue-sprite play-lib" id="g238" href="#">
					<img title="" src="/library/image/238.jpg" width="100" height="100" />
					<em class="gallery-item-em">238</em>
				</a>
			</div>
			
		</li><li class="lib-item blue">
			<p class="title">Klok</p>
			<div class="theme">
				<a class="gallery-item-l icon blue-sprite play-lib" id="g239" href="#">
					<img title="" src="/library/image/239.jpg" width="100" height="100" />
					<em class="gallery-item-em">239</em>
				</a>
			</div>
			
		</li><li class="lib-item blue">
			<p class="title">Computer</p>
			<div class="theme">
				<a class="gallery-item-l icon blue-sprite play-lib" id="g240" href="#">
					<img title="" src="/library/image/240.jpg" width="100" height="100" />
					<em class="gallery-item-em">240</em>
				</a>
			</div>
			
		</li><li class="lib-item blue">
			<p class="title">Flipperkast</p>
			<div class="theme">
				<a class="gallery-item-l icon blue-sprite play-lib" id="g241" href="#">
					<img title="" src="/library/image/241.jpg" width="100" height="100" />
					<em class="gallery-item-em">241</em>
				</a>
			</div>
			
		</li><li class="lib-item blue">
			<p class="title">Oude naaimachine</p>
			<div class="theme">
				<a class="gallery-item-l icon blue-sprite play-lib" id="g242" href="#">
					<img title="" src="/library/image/242.jpg" width="100" height="100" />
					<em class="gallery-item-em">242</em>
				</a>
			</div>
			
		</li><li class="lib-item red">
			<p class="title">Graffiti</p>
			<div class="theme">
				<a class="gallery-item-l icon red-sprite play-lib" id="g243" href="#">
					<img title="" src="/library/image/243.jpg" width="100" height="100" />
					<em class="gallery-item-em">243</em>
				</a>
			</div>
			
		</li><li class="lib-item red">
			<p class="title">Duiken</p>
			<div class="theme">
				<a class="gallery-item-l icon red-sprite play-lib" id="g244" href="#">
					<img title="" src="/library/image/244.jpg" width="100" height="100" />
					<em class="gallery-item-em">244</em>
				</a>
			</div>
			
		</li><li class="lib-item red">
			<p class="title">Voetbal</p>
			<div class="theme">
				<a class="gallery-item-l icon red-sprite play-lib" id="g245" href="#">
					<img title="" src="/library/image/245.jpg" width="100" height="100" />
					<em class="gallery-item-em">245</em>
				</a>
			</div>
			
		</li><li class="lib-item red">
			<p class="title">Motoren</p>
			<div class="theme">
				<a class="gallery-item-l icon red-sprite play-lib" id="g246" href="#">
					<img title="" src="/library/image/246.jpg" width="100" height="100" />
					<em class="gallery-item-em">246</em>
				</a>
			</div>
			
		</li><li class="lib-item red">
			<p class="title">Poker</p>
			<div class="theme">
				<a class="gallery-item-l icon red-sprite play-lib" id="g247" href="#">
					<img title="" src="/library/image/247.jpg" width="100" height="100" />
					<em class="gallery-item-em">247</em>
				</a>
			</div>
			
		</li><li class="lib-item red">
			<p class="title">Fotografie</p>
			<div class="theme">
				<a class="gallery-item-l icon red-sprite play-lib" id="g248" href="#">
					<img title="" src="/library/image/248.jpg" width="100" height="100" />
					<em class="gallery-item-em">248</em>
				</a>
			</div>
			
		</li><li class="lib-item red">
			<p class="title">Vissen</p>
			<div class="theme">
				<a class="gallery-item-l icon red-sprite play-lib" id="g249" href="#">
					<img title="" src="/library/image/249.jpg" width="100" height="100" />
					<em class="gallery-item-em">249</em>
				</a>
			</div>
			
		</li><li class="lib-item red">
			<p class="title">Tekenen</p>
			<div class="theme">
				<a class="gallery-item-l icon red-sprite play-lib" id="g250" href="#">
					<img title="" src="/library/image/250.jpg" width="100" height="100" />
					<em class="gallery-item-em">250</em>
				</a>
			</div>
			
		</li><li class="lib-item red">
			<p class="title">Schrijven</p>
			<div class="theme">
				<a class="gallery-item-l icon red-sprite play-lib" id="g251" href="#">
					<img title="" src="/library/image/251.jpg" width="100" height="100" />
					<em class="gallery-item-em">251</em>
				</a>
			</div>
			
		</li><li class="lib-item red">
			<p class="title">Koken (mes slijpen)</p>
			<div class="theme">
				<a class="gallery-item-l icon red-sprite play-lib" id="g252" href="#">
					<img title="" src="/library/image/252.jpg" width="100" height="100" />
					<em class="gallery-item-em">252</em>
				</a>
			</div>
			
		</li>			</ul>
		</div>
<!--		<button class="sprite lprev">vorige</button>
		<button class="sprite lnext">volgende</button>-->
	</div>
</div>
<div id="theme" class="hide">Het ritme van de stad</div>

		<footer class="footer">
			<div class="container">
				<div class="footer-share">
											<a target="_blank" class="sprite twitter left" href="http://twitter.com/#!/mooistegeluidNL">Twitter</a>
										<a target="_blank" class="sprite facebook left" href="http://www.facebook.com/hetmooistegeluidvannederland">Facebook</a><!-- a target="_blank" class="sprite hyves left" href="http://www.hyves-share.nl/button/tip/?tipcategoryid=12&rating=5&title=&body=http%3A%2F%2Fhetmooistegeluidvannederland.nl.'">Hyves</a -->
					<iframe src="http://www.facebook.com/plugins/like.php?locale=en_US&amp;href=http://hetmooistegeluidvannederland.nl&amp;send=false&amp;layout=button_count&amp;width=90&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe>
				</div>
				&copy; 2012 Audionova&nbsp;&nbsp;|&nbsp;&nbsp;<a href="/actievoorwaarden/" class="modal">Actievoorwaarden</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#" class="modal">Algemene voorwaarden</a>			</div>
		</footer>

	</div>
	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
	<script type="text/javascript">
		if(typeof jQuery == 'undefined'){
		   document.write(unescape('%3Cscript type="text/javascript" src="http://cdn.publer.com/js/jquery.min.js"%3E%3C/script%3E'));
		}
	</script>
	<script src="/js/jquery.validate.min.js" type="text/javascript"></script>
	<script src="/js/jquery.history.js" type="text/javascript"></script>
	<script src="/js/fileuploader.js" type="text/javascript"></script>
<!--	<script src="/js/jcarousellite.pack.js" type="text/javascript"></script>-->
	<script src="/js/jquery.jcarousel.min.js" type="text/javascript"></script>
	<script src="/js/jquery.fancybox-1.3.4.pack.js" type="text/javascript"></script>
	<script src="/js/jquery.scrollTo-min.js" type="text/javascript"></script>
	<script src="/js/jquery.ba-resize.min.js" type="text/javascript"></script>
		<script type="text/javascript">

	  var _gaq = _gaq || [];
	  _gaq.push(['_setAccount', 'UA-22995306-1']);
	  _gaq.push(['_trackPageview']);

	  (function() {
		var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
		ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
		var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
	  })();

	</script>
	<script type="text/javascript">
	
// the soundselector flash object connects to this function.
// this function is obsolete. There is no button on the flashobject anymore.
// when the user submits form2, the javascript will ask for the pauseposition from 
// the flashobject.
//function getFromFlash(returndata) {
//	if (returndata == "1") {
//		jQuery("div#form2").fadeOut("300", function() {
//			jQuery("div#form3").fadeIn();
//		});
//	}
//}
var $filteredliblis;
function mycarousel_itemLoadCallback(carousel, state) {
	var l = $filteredliblis.length,
		e = Math.min(carousel.first + 6, carousel.last);
//	for (var i = carousel.first; i <= carousel.last; i++) {
	for (var i = carousel.first; i <= e; i++) {
		if (carousel.has(i)) {
			continue;
		}
		if (i > $filteredliblis.length) {
			break;
		}
		carousel.add(i, $filteredliblis[i-1]);
	}
};

(function ($) {
	var mp3uploader = new qq.FileUploader({
			element: document.getElementById("mp3-file-uploader"),
			multiple: false,
			allowedExtensions: ["mp3","wav"],
			template: "<div class=\"qq-uploader\">" + 
                "<div class=\"qq-upload-drop-area\"><span></span></div>" +
                "<div class=\"qq-upload-button\">Bladeren...</div>" +
                "<ul class=\"qq-upload-list\"></ul>" + 
             "</div>",
			fileTemplate: "<li>" +
                "<span class=\"qq-upload-file\"></span>" +
                "<span class=\"qq-upload-spinner\"></span>" +
                "<span class=\"qq-upload-size\"></span>" +
                "<a class=\"qq-upload-cancel\" href=\"#\">Annuleren</a>" +
                "<span class=\"qq-upload-failed-text\">Mislukt</span>" +
            "</li>",
			action: "/upload-mp3/",
			singleFile: true,
			sizeLimit: 10 * 1024 * 1024, // each file size limit in bytes
			debug: false,
			onComplete: function(id, fileName, responseJSON){
				$("button#form2submit").click();
			}
		}),
		// image uploader
		uploader = new qq.FileUploader({
			element: document.getElementById("file-uploader"),
			multiple: false,
			allowedExtensions: ["gif","jpg","jpeg","png"],
			template: "<div class=\"qq-uploader\">" + 
                "<div class=\"qq-upload-drop-area\"><span></span></div>" +
                "<div class=\"qq-upload-button\">Bladeren...</div>" +
                "<ul class=\"qq-upload-list\"></ul>" + 
             "</div>",
			fileTemplate: "<li>" +
                "<span class=\"qq-upload-file\"></span>" +
                "<span class=\"qq-upload-spinner\"></span>" +
                "<span class=\"qq-upload-size\"></span>" +
                "<a class=\"qq-upload-cancel\" href=\"#\">Annuleren</a>" +
                "<span class=\"qq-upload-failed-text\">Mislukt</span>" +
            "</li>",
			action: "/upload-image/",
			singleFile: true,
			sizeLimit: 10 * 1024 * 1024, // each file size limit in bytes
			debug: false,
			onComplete: function(id, fileName, responseJSON){
				$("#pv-img").attr("src", "/preview-image/"+responseJSON.newfilename);
			}
		}),
		getCatClass = function(icat) {
			var cat = ["green","red","blue","orange","purple","brown"];
			return cat[icat];
		},
		getCatTitle = function(icat) {
			var cat = ["De magie van de natuur","De sound van je grote passie","Het geluid van vroeger","De klank van gezelligheid","Het geruis van het alledaagse","Het ritme van de stad"];
			return cat[icat];
		},
		galleryheight = 800,
		currentForm = 1,
		bWindowRefresh = 1,
		loadinggallery = false,
		numberofcolumns = 7,
		numberofrows = 3,
		firstid = 1,
		lastid = 607,
		iFullgalleryFrom = 0,
		bSoundDetailIsVisible = false,
		sortSelector = $("select#sortGallery"),
		user,
		undefined,
		oplichtInterval,
		rand = function(e) {
			return Math.floor(Math.random() * e + 1);
		},
		// the functions that start/stop the flashing of the sounds (oplichterij)
		startOplichterij = function() {
			oplichtInterval = setInterval(function() {
				var num = $("#slider ul li").length,
					$li = $($("#slider ul li")[rand(num - 1)]);
				$("#slider ul li").removeClass("selected");
				$li.addClass("selected");
			}, 4000);
		},
		stopOplichterij = function() {
			clearInterval(oplichtInterval);
			$("#slider ul li").removeClass("selected");
		},
		getUser = function() {
			if (user == undefined) {
				$.ajax({
					"async":false,
					"url":"/search-user/",
					"success":function(data) {
						user = data;
					},
					"dataType":"json"
				});
			}
			return user;
		},
		getUserFullName = function() {
			var us = getUser();
			return us.firstname + " " + us.lastname;
		},
		getUserMail = function() {
			var us = getUser();
			return us.email;
		},
		getFromFlash = function(returndata) {
			if (returndata == "1") {
				submitForm($("div#form3"));
			}
		},
		getSoundIdFrom = function($el) {
			return $el.attr("id").split("-")[1];
		},
		playingAudio = false,
		playingAudioId = -1,
		audioelement,
		audioplaytimeout,
		// The site has a central audioplayer swf instance. This swf object is inserted
		// by swfobject.js unless the browser does not understand flash, like iPad. Then
		// it will leave an <audio> object. Whatever remains, this playAudio function will 
		// handle it correctly. (id could be an id of a sound-object, or a filename (when previewing)
		playAudio = function(id, library) {
			var	shouldloadaudio = playingAudioId != id,
				soundtype = library? "/library/":"/user/",
				filenamemp3, filenamewav, filenameogg;
			if (parseInt(id) == id) {
				filenamemp3 = soundtype+"sound/"+id+".mp3";
				filenameogg = soundtype+"sound/"+id+".ogg";
				filenamewav = soundtype+"sound/"+id+".wav";
			}
			else {
				filenamemp3 = "/preview-mp3/"+id+".mp3";
				filenameogg = "/preview-mp3/"+id+".ogg";
				filenamewav = "/preview-mp3/"+id+".wav";
			}
			playingAudioId = id;
			if ($("#CentralAudioPlayer").is(".hasFlash")) {
				// we have a flash audioplayer available
				var cap = document.getElementById("CentralAudioPlayer");
				try {
					if (shouldloadaudio && cap.loadsound !== "") cap.loadsound(filenamemp3, true); //will auto-play
					else if (cap.toggle !== "") cap.toggle();
				}
				catch(err) {
				}
			}
			else {
				// we need to create an audio element and play (toggle) that. Used by iPhone/iPad.
				if (shouldloadaudio) {
					var audioTagSupport = !!(document.createElement("audio").canPlayType),
						basicAudioSupport,
						audioObjSupport,
						canPlayMp3,
						canPlayOgg,
						canPlayWav;
					try {
						var myAudio = new Audio("");
						audioObjSupport = !!(myAudio.canPlayType);
						basicAudioSupport = !!(!audioObjSupport ? myAudio.play : false);
					}
					catch (e) {
						audioObjSupport = false;
						basicAudioSupport = false;
					}
					if (audioObjSupport) {
						// Currently canPlayType(type) returns: "no", "maybe" or "probably"
						canPlayMp3 = ("no" != myAudio.canPlayType("audio/mpeg")) && ("" != myAudio.canPlayType("audio/mpeg"));
						canPlayOgg = ("no" != myAudio.canPlayType("audio/ogg; codecs=\"vorbis\"")) && ("" != myAudio.canPlayType("audio/ogg; codecs=\"vorbis\""));
						canPlayWav = ("no" != myAudio.canPlayType("audio/wav")) && ("" != myAudio.canPlayType("audio/wav"));
					}
					if (canPlayMp3)			audioelement = new Audio("http://hetmooistegeluidvannederland.nl"+filenamemp3);
					else if (canPlayOgg)	audioelement = new Audio("http://hetmooistegeluidvannederland.nl"+filenameogg);
					else if (canPlayWav)	audioelement = new Audio("http://hetmooistegeluidvannederland.nl"+filenamewav);
				}
//				console.log(audioelement);
				if (audioelement) {
					if (playingAudio) {
						playingAudio = false;
						audioelement.pause();
						audioelement.currentTime = 0;
						clearTimeout(audioplaytimeout);
					}
					else {
						playingAudio = true;
						audioelement.play();
						audioplaytimeout = setTimeout(function() {
							playingAudio = false;
//							console.log("audioplaytimeout: playing:"+playingAudio);
						}, 3000);
					}
				}
				else if ($audio.play) {// try it anyway
					if (playingAudio) {
						playingAudio = false;
						$audio.pause();
					}
					else {
						playingAudio = true;
						$audio.play();
					}
				}
			}
		},
		// function that fills the gallery with sounds and maybe loads the details of a specific sound.
		// @var int num					Total number of sounds to be displayed (rows * cols)
		// @var int cols				Total number of sounds in one row
		// @var int id					The id of the sound to be loaded (or 0, when no sound)
		// @var bool bGalleryOnly		Indicates whether or not we need to load a sound
		// @var int from				The startof point, from where we want to show items in the gallery (prev/next page)
		// @var int iDoSoundClickFor	The id of the action to "click" after the sound has been loaded. (ie. reacties-bekijken)
		// @var bool bNotHideAction		Indicates whether or not we should hide the actions div
		// @var string searchfor		The string with which the results should be filtered
		// @var bool bDoNotPlayAudio	Indicates whether or not we should play the audio, defaults to YES, play!
		//		
		getGallery = function(num, cols, id, bGalleryOnly, from, iDoSoundClickFor, sortby, bNotHideActions, searchfor, bDoNotPlayAudio) {
			var soundid = id||0,
				bGalOnly = bGalleryOnly||0,
				iFrom = from||0,
				iDoClick = iDoSoundClickFor||0,
				sort = sortby||-2,
				search = searchfor,
				nothideactions = bNotHideActions||0,
				notplayaudio = bDoNotPlayAudio||0;
			loadinggallery = true;
			if (search == "undefined" || $.trim(search) == "") search = -1;
			// first we get the html for the gallery items to be displayed
			$.get(
				"/p/gallery/"+id+"/",
				{"iNumber": num, "iCols": cols, "iFrom": iFrom, "sort": sort, "search": search},
				function (html) {
					//var ulexists = ($("#slider ul").length > 0);
					stopOplichterij();
					$("#gallery").html(html);
					// when requested, we load the html for the sound-details.
					if (bGalOnly == 0 && soundid > 0) {
						var prevId = $("a.previndex").length == 0? soundid:getSoundIdFrom($("a.previndex"));
						var nextId = $("a.nextindex").length == 0? soundid:getSoundIdFrom($("a.nextindex"));
						$.get(
							"/p/view-sound/"+soundid+"/",
							{
								"previd": prevId,
								"nextid": nextId
							},
							function (html2) {
								var $sidebaritem = $("#t"+soundid);
								$(".sidebar li").removeClass("selected");
								if ($sidebaritem != "undefined") $sidebaritem.addClass("selected");
								var id;
								bSoundDetailIsVisible = true;
								if (nothideactions == 0) {
									$("div#actions").hide();
								}
								var $sounddetails = $("#sounddetails");
								$sounddetails.html(html2).show();
								$("#meta-img").attr("content",		"http://hetmooistegeluidvannederland.nl" + $sounddetails.find("div.avatar img").attr("src"));
								$("#meta-title").attr("content",	$sounddetails.find("div.sound-content h1").text());
								$("#meta-desc").attr("content",		$sounddetails.find("div.sound-content p").text());
								if (iDoClick > 0) {
									handleSoundDetailClickFor(iDoClick, soundid);
								}
								else {
									setGalleryHeight();
								}
								if (notplayaudio == 0) playAudio(soundid);
								loadinggallery = false;
							},
							"html"
						);
					}
					else {
						setGalleryHeight();
						loadinggallery = false;
						bSoundDetailIsVisible = false;
						startOplichterij(num);
					}
				},
				"html"
			);
		},
		closebox = function() {
			clint = setInterval(function() {
				if ($.fancybox.close) {
					$.fancybox.close();
					clearInterval(clint);
				}
			}, 500);
		},
		// The submission of a new sound is done in 3 steps. Although there is just one big
		// form in the html, every step is a little form in itself, with it`s own validation.
		// Sometimes users switch steps by submitting a form, sometimes by going 
		// forward/backward, sometimes by selecting a "step".
		// See the click/submit-handlers further on for more info.
		submitForm = function($thisdiv) {
			var formid = parseInt($thisdiv.attr("id").substr(4)),
				nextformid = formid + 1,
				$nextdiv = $("div#form" + nextformid),
				formvalues,
				icat = $("#iCategory").find("option:selected").val(),
				sCatClass = getCatClass(icat);
			currentForm = nextformid;
			switch (formid) {
				case 1:
					// pre-fill the sound-preview and continue to show form2
					$("#pv-soundpreview").addClass(sCatClass);
					$("#theme").addClass(sCatClass).html(getCatTitle(icat));
					$("a#preview-sound").removeClass().addClass(sCatClass+"-sprite").show();
					$("#pv-img").attr("src", "/user/image/" + (10 + parseInt(icat)) + ".jpg");
					$("#pv-title").html($("#sSoundTitle").val());
					$("#pv-description").html($("#sSoundDescription").val());
					$thisdiv.hide();
					if (bWindowRefresh == 1) {
						bWindowRefresh = 0;
						$.get("/cache-refresh/", function() {
							$nextdiv.show();
							$.scrollTo($nextdiv);
						});
					}
					else {
						$nextdiv.show();
						$.scrollTo($nextdiv);
					}
					break;
				case 2:
					// in form 2, a user has uploaded a sound file, or entered a youtube url.
					// in both cases we need to show the selector-swf, so that the user
					// can select 5 seconds of the uploaded sound.
					// After that, we can proceed to show form 3.
					//
					// When we need to handle a youtube url, the process could take a
					// little while, so we show a loading-div.
					// It could also be that a 5 sec. piece has been selected, so we 
					// request the position.
					if ($("#sYoutubeUrl").is(":visible") && $("#sYoutubeUrl").val() == "" && $(".qq-upload-file").html() == "") {
						$thisdiv.hide();
						$nextdiv.show();
						$.scrollTo($nextdiv);
						break;
					}
					var pos = 0;
					if ($("#soundSelectorContent").length > 0) {
						// the soundSelector flash was loaded, so a piece was selected, so we 
						// can request the position from the flash and post it to the session.
						$.fancybox.open($("#loadingdivb").html());
						pos = document.getElementById("soundSelectorContent").getPausePosition();
						$.get("/setsoundpointer/"+parseInt(pos)+"/",
							{},
							function(json) {
								$("a#preview-sound").attr("alt", json.filename);
								$("div#form2").hide();
								closebox();
								$("div#form3").show();
							},
							"json"
						);
						break;
					}
					//when we get here, we need to handle a youtube link
					$("#form2submit").attr("disabled", "disabled");
					$.fancybox.open($("#loadingdiv").html());
					$.get(
						"/p/verify-form2/",
						{
							"sYoutubeUrl": $("input#sYoutubeUrl").val()
						},
						function (html) {
							if ($("<div>"+html+"</div>").find("div#youtube-error").length == 0) {
								$("input#sYoutubeUrl").hide().prev().hide();
							}
							$("#form2submit").removeAttr("disabled");
							$("div#soundselector").html(html);
							closebox();
						},
						"html"
					);
					break;
				case 3:
					// the user has filled out all necessary fields and wants to submit
					// them. We ajax-submit the form values and fill the form4 div
					// with the result of those actions.
					$.fancybox.open($("#loadingdivb").html());
					$("#form3submit").attr("disabled", "disabled");
					formvalues = $("form#insturenform").serialize();
					$.get(
						"/p/view-form/"+nextformid+"/",
						formvalues,
						function (html) {
							// hide the library when we don't need it
							if ($("#library").is(":visible")) {
								$("a#librarybar").click(); // hides the library
							}
							$nextdiv.html(html);
							closebox();
							$("#form3submit").removeAttr("disabled");
							$thisdiv.hide();
							$nextdiv.show();
							$.scrollTo($nextdiv);
						},
						"html"
					);
					break;
			}
		},
		// every sounds has actions attached to it, like vote, react, etc. When a user
		// clicks such a link, this function will get the information from the server.
		handleSoundDetailClickFor = function(id, soundid) {
			$.get(
				"/p/view-action/"+id+"/",
				{
					"iSoundId": soundid
				},
				function (html) {
					var $actions = $("div#actions");
					iShowingActionId = id;
					$("div#library").hide();
					$actions.html(html).show();
					setGalleryHeight();
					$.scrollTo($actions, 800);
				},
				"html"
			);
		},
		shareFormSubmit = function($form, divprefix) {
			var prefix = divprefix || "";
			$.validator.addMethod("maxTenFriends", function (val, el){
				var asval = val.split(",");
				return asval.length < 10;
			});
			$form.validate({
				"rules": {
					"sSenderEmail":	{"required": true, "email": true},
					"sFriendEmail":	{"required": true, "maxTenFriends": true}
				},
				"messages": {
					"sSenderEmail":	{
                                        required: "Vul je e-mail adres in.",
                                        email: "Vul een geldig e-mail adres in."
                                    },
					"sFriendEmail":	{"required": "Vul e-mail adres(sen) van je vrienden in.",
									"maxTenFriends": "U kunt maximaal 10 vrienden invullen."}
				}
			});
			if ($form.valid()) {
				$.post($form.attr("action"),
					$form.serialize(),
					function (data) {
						$("div#"+prefix+"mail-door").hide();
						switch(data.errorcode) {
							case 0:	$("div#"+prefix+"mail-door-verified").show(); break;
							default:$("div#"+prefix+"mail-door-denied").show();
						}
					}, "json"
				);
			}
		},
		handleClick = function ($tar) {
			if ($tar.is(".gallery-item, .gallery-item-img, .gallery-item-em")) {
				var sortBy = sortSelector.find("option:selected").val();
				$item = $tar.is(".gallery-item")? $tar : $tar.closest(".gallery-item");
				getGallery(numberofcolumns * numberofrows, numberofcolumns, getSoundIdFrom($item), 0, 0, 0, sortBy);
			}
			else if ($tar.is("#previous-sound")) {
				var id = parseInt(getSoundIdFrom($tar.closest("div.sound-details"))) - 1; //parseInt($tar.closest("div.sound-details").attr("id").substr(1)) - 1;
				if (id < firstid) id = lastid;
				getGallery(numberofcolumns * numberofrows, numberofcolumns, id);
			}
			else if ($tar.is("#next-sound")) {
				var id = parseInt(getSoundIdFrom($tar.closest("div.sound-details"))) + 1; //parseInt($tar.closest("div.sound-details").attr("id").substr(1)) + 1;
				if (id > lastid) id = firstid;
				getGallery(numberofcolumns * numberofrows, numberofcolumns, id);
			}
			else if ($tar.is("#close-sound")) {
				var sortBy = sortSelector.find("option:selected").val();
				$("#sounddetails").html("").hide();
				getGallery(numberofcolumns * numberofrows, numberofcolumns, 0, 1, 0, 0, sortBy);
			}
		},
		getSize = function(){
			var margin = 0,
				w = ((window.innerWidth != null? window.innerWidth: document.documentElement.clientWidth > 0? document.documentElement.clientWidth:document.body.clientWidth) - (margin * 2)),
				h = ((window.innerHeight != null? window.innerHeight: document.documentElement.clientHeight > 0? document.documentElement.clientHeight:document.body.clientHeight) - (margin * 2));
			return [h, w, margin];
		},
		determineColumns = function() {
			var $body = $("body"),
				size = getSize();
			numberofcolumns = 7;
			if (size[1] < 1160)							{numberofcolumns = 7;$body.removeClass();}
			if (size[1] >= 1160 && size[1] < 1260)		{numberofcolumns = 8;$body.removeClass().addClass("wide");}
			else if (size[1] >= 1260)					{numberofcolumns = 9;$body.removeClass().addClass("wide2");}
		},
		// return the height in pixels for the gallerycontainer-div. It also determines 
		// the number of rows in the gallery to show.
		determineRows = function() {
			var $body = $("body"),
				size = getSize(),
				restheight = 301;
			numberofrows = Math.max(3, Math.floor((size[0] - restheight - 48) / 100));
			return size[0] - restheight;
		},
		// central place where size changes of the main window are handled. Seperated 
		// commands based on the visibility of a sounddetail.
		setGalleryHeight = function() {
			var newHeight,
				calcheight;
			// if we are showing a sound and an action is shown, we need to do some
			// special calculations.
			if (iShowingSoundId !== -1 && iShowingActionId !== 0) {
				var $actiondiv = $("div#actions"),
					icounter = 0;
				// the reacties div takes a while to load (content is pulled in by javascript)
				if (iShowingActionId == 4) {
					calcheight = setInterval(
						function() {
							var divhtml = $("#disqus_thread").html();
							icounter++;
							if (icounter == 25 || divhtml.length > 4000) {
								clearInterval(calcheight);
								newHeight = Math.max(galleryheight, $actiondiv.innerHeight() + 400);
								$("#gallerycontainer").css("height", newHeight+"px");
							}
						}, 200);
				}
				else {
					newHeight = Math.max(galleryheight, $actiondiv.innerHeight() + 400); // 200 for the sounddetail + 100 for the toprow
					$("#gallerycontainer").css("height", newHeight+"px");
				}
			}
			else {
				// just the gallery is shown, we can use the global height
				$("#gallerycontainer").css("height", Math.max(358, galleryheight)+"px");
			}
		},
		forceRefresh = false,
		iShowingSoundId = -1,
		iShowingActionId = 0;

	$.fancybox.init();
	$.fancybox.open = function (html) {
		var a = $("<a/>");
		a.fancybox({
			"hideOnOverlayClick" : false, 
			"showCloseButton": false, 
			"content": html,
			"width": 300,
			"height": 200,
			"padding": 25
		});
		a.click();
	};

	$(window).resize(function() {
		var oldcols = numberofcolumns,
			oldrows = numberofrows,
			sortBy = $(this).find("option:selected").val();
			
		galleryheight = determineRows();
		determineColumns();
		// when the number of items to be displayed changes, we need to call in the from
		// getgallery.
		if (forceRefresh || numberofcolumns != oldcols || numberofrows != oldrows) {
			forceRefresh = false;
			if (iShowingSoundId !== -1) {
				// a sounddetail is currently visible, maybe even with an action attached.
				getGallery(
					numberofcolumns * numberofrows, 
					numberofcolumns, 
					iShowingSoundId, 
					0,
					iFullgalleryFrom, 
					iShowingActionId, 
					sortBy,
					0,
					-1,
					true //do not play audio
				);
			}
			else {
				// no sound-details visible, just show the gallery.
				getGallery(
					numberofcolumns * numberofrows, 
					numberofcolumns, 
					0,
					1, 
					iFullgalleryFrom, 
					0, 
					sortBy,
					0,
					-1,
					true
				);
			}
		}
		else setGalleryHeight(); // the gallery is fine, just make sure the footer is placed at the bottom.
	});
	
	forceRefresh = true;
	$(window).resize();
//	$("div#actions").resize(function(ev) {
//		var newHeight = Math.max(galleryheight, $(this).innerHeight() + 400);
//		$("#gallerycontainer").css("height", newHeight+"px");		
//	});

	// alle clicks gaan via de url. Elke wijziging op de url wordt afgevangen door de
	// history plugin. Deze bepaald op basis van de url wat er moet gebeuren met de content.
	$.history.init(
		function(hash) {
			var hashtype, request, asCommand, view, sid, $tar, $sidebaritem, bHandle = true, galleryloader,
				soundDetailClicks = ["stem-op","mail-door","reacties-op","niet-ok","bedankt-inzending","bedankt-stem"],
				sortBy = sortSelector.find("option:selected").val();
			iShowingSoundId = -1;
			iShowingActionId = 0;
			if (_gaq && _gaq.push) {
				var utmp = hash.substr(0,1) == "!"? hash.substr(1):hash;
				_gaq.push(["_trackPageview", utmp]);
			}
			if (hash == "sendin") {
				$.scrollTo($("#sendin"), 800);
			}
			else if (hash == "") {
				forceRefresh = true;
//				$(window).resize();
			}
			else {
				determineColumns();
				galleryheight = determineRows();
				hashtype = hash.substr(0,1) == "!"? "page":"anchor";
				if (hashtype == "page") {
					request = hash.substr(2);
					asCommand = request.split("/");
					view = asCommand[0];
					sid = asCommand[1];
					if ($.inArray(view, soundDetailClicks) >= 0) {
						iShowingSoundId = sid;
						if (false === bSoundDetailIsVisible) getGallery(numberofcolumns * numberofrows, numberofcolumns, sid, 0, 0, 0, sortBy, 1);
						galleryloader = setInterval(function() {
							if (loadinggallery == false) {
								clearInterval(galleryloader);
								switch(view) {
									case "stem-op":					handleSoundDetailClickFor(1, sid);				break;
									case "mail-door":				handleSoundDetailClickFor(2, sid);			break;
									case "reacties-op":				handleSoundDetailClickFor(4, sid);			break;
									case "niet-ok":					handleSoundDetailClickFor(7, sid);				break;
									case "bedankt-inzending":		handleSoundDetailClickFor(6, sid);	break;
									case "bedankt-stem":			handleSoundDetailClickFor(5, sid);			break;
								}
							}
						}, 100);
					}
					else if (view == "bekijk-inzending")	{getGallery(numberofcolumns * numberofrows, numberofcolumns, sid, 0, 0, 0, sortBy, 0);iShowingSoundId = sid;}
					else if (view == "zoek-inzending")		getGallery(numberofcolumns * numberofrows, numberofcolumns, 0, 0, 0, 0, sortBy, 0, sid);
					else if (view == "sorteer-op")			getGallery(numberofcolumns * numberofrows, numberofcolumns, 0, 0, 0, 0, sortBy);
					else {
						//header naar page-not-found
					}
				}
			}
		},
		{ unescape: ",/" }
	);
	// clicks for elemens coming in by ajax, that do not need to pass the
	// history plugin, are handled here.
	$("#gallery").click(function (ev) {
		$tar = $(ev.target);
		if ($tar.is(".play-again")) { // library items are handled in another clickhandler!
			var id = $("div.sound-details").attr("id").substr(1);
			playAudio(id);
			ev.preventDefault();
		}
		else if ($tar.is("#slider a.prev")) {
			var sortBy = sortSelector.find("option:selected").val();
			iFullgalleryFrom -= numberofcolumns * numberofrows;
			getGallery(numberofcolumns * numberofrows, numberofcolumns, 0, 1, iFullgalleryFrom, 0, sortBy, 0, $("#q").val());
			ev.preventDefault();
		}
		else if ($tar.is("#slider a.next")) {
			var sortBy = sortSelector.find("option:selected").val();
			iFullgalleryFrom += numberofcolumns * numberofrows;
			getGallery(numberofcolumns * numberofrows, numberofcolumns, 0, 1, iFullgalleryFrom, 0, sortBy, 0, $("#q").val());
			ev.preventDefault();
		}
	});
	// Almost every action-page has a form that needs handling. This is done here. 
	// Each form has it`s own handler who submits by ajax and displays feedback
	// based on return error-codes (json)
	$("#gallery").submit(function (ev) {
		var $form = $(ev.target);
		if (false == $form.is("form")) {
			$form = $form.closest("form");
		}
		// VOTE SUBMIT
		if ($form.is("#not-ok-form")) {
			$form.validate({
				"rules": {
					"email":	{"required": true, "email": true},
					"reason":	"required"
				},
				"messages": {
					"email":	{
                                    required: "Vul je e-mail adres in.",
                                    email: "Vul een geldig e-mail adres in."
                                },
					"reason":	"Vul de reden in waarom je dit geluid niet ok vindt."
				}
			});
			if ($form.valid()) {
				$.post($form.attr("action"),
					$form.serialize(),
					function (data) {
						$("div#niet-ok").hide();
						switch(data.errorcode) {
							case 0:	$("div#niet-ok-verified").show(); break;
							default:$("div#niet-ok-denied").show();
						}
					}, "json"
				);
			}
			ev.preventDefault();
		}
		else if ($form.is("#share-form")) {
			shareFormSubmit($form);
			ev.preventDefault();
		}
		else if ($form.is("#vote-form")) {
			$form.validate({
				"rules": {
					"sVoterFirstName":	"required",
					"sVoterLastName":	"required",
					"iTAC":				"required",
					"sVoterEmail":		{"required":true, "email":true}
				},
				"messages": {
					"sVoterFirstName":	"Vul je voornaam in.",
					"sVoterLastName":	"Vul je achternaam in.",
					"iTAC":				"Je moet akkoord gaan met de voorwaarden om te kunnen stemmen.",
					"sVoterEmail":      {
                                            required: "Vul je e-mail adres in.",
                                            email: "Vul een geldig e-mail adres in."
                                        }
				}
			});
			if ($form.valid()) {
				$.post($form.attr("action"),
					$form.serialize(),
					function (data) {
						$("div#vote-submit").hide();
						switch(data.errorcode) {
							case 0:
								if (data.verified == 1) {
									$("div#vote-confirm-verified").show();
								}
								else {
									$("span#mailresult").html(data.email);
									$("div#vote-confirm").show();
								}
								break;
							case 1:
							case 2:
								$("div#vote-denied").show();
						}
					},
					"json"
				);
			}
			ev.preventDefault();
		}
	});

	// GALLERY (SORTING)
	sortSelector.change(function(ev) {
		var sortBy = $(this).find("option:selected").val();
		$.history.load("!/sorteer-op/"+sortBy+"/");
		ev.preventDefault();
	});

	// GELUID INSTUREN FORMULIEREN
		// volgende / vorige / selecteer een stap
	$("a#preview-sound").click(function(ev) {
		var filename = $(this).attr("alt");
		playAudio(filename, true);
		ev.preventDefault();
	});
	$("a.viewform").click(function (ev) {
		var id = $(this).attr("rel");
		$(this).closest("div.insturen-div").hide();
		$("div#form" + id).show();
		ev.preventDefault();
	});
	$.validator.addMethod("required-visible", function (val, el){
		if ($(el).is("input:checkbox")) {
			return ($(el).is(":not(:visible)") || $(el).is(":checked"));
		}
		return ($(el).is(":not(:visible)") || val != "");
	});
	$.validator.addMethod("theme-selected", function (val, el){
		return ($(el).is(":not(:visible)") || val != -1);
	});
	$("form#insturenform").validate({
		"rules": {
			"iCategory":			{"theme-selected": "required"},
			"sSoundTitle":			{"required-visible": "required"},
			"sSoundDescription":	{"required-visible": "required"},
			"sFullName":			{"required-visible": "required"},
			"sEmail":				{"required-visible": "required", "email": true},
			"iTAC":					{"required-visible": "required"}
		},
		"messages": {
			"iCategory":			{"theme-selected": "Kies een thema."},
			"sSoundTitle":			{"required-visible": "Vul een titel voor je geluid in."},
			"sSoundDescription":	{"required-visible": "Vul een omschrijving voor je geluid in."},
			"sFullName":			{"required-visible": "Vul je naam in."},
			"sEmail":				{   "required-visible": "Vul je e-mail adres in.",
                                        "email":            "Vul een geldig e-mail adres in."
                                    },
			"iTAC":					{"required-visible": "Je moet akkoord gaan met de voorwaarden om een geluid in te kunnen sturen."}
		}
	});
	$("a.formsubmit").click(function(ev) {
		// hier kom je alleen als je op inzenden zonder geluid klikt bij stap 1.
		var $div,
			icat = $("#iCategory").find("option:selected").val(),
			sCatClass = getCatClass(icat);
		if ($("form#insturenform").valid()) {
			if ($("input#sSoundTitle").is(":visible")) {
				// we are in form 1 and want to skip step 2.
				$("#pv-soundpreview").addClass(sCatClass);
				$("#theme").removeClass().addClass(sCatClass).html(getCatTitle(icat));
				$("#pv-name").html("Library");
				$("a#preview-sound").hide(); //removeClass().addClass(sCatClass+"-sprite");
				$("#pv-img").attr("src", "/user/image/" + (10 + parseInt(icat)) + ".jpg");
				$("#pv-title").html($("#sSoundTitle").val());
				$("#pv-description").html($("#sSoundDescription").val());
				$("div#form1").hide();
				$("#sFullName").val(getUserFullName());
				$("#sEmail").val(getUserMail());
				$("a#vorigestapinform3").attr("rel", 1);
				$("div#form3").show();
			}
			else $div = $("div#form3");
			//submitForm($div);
		}
		ev.preventDefault();
	});
	$("form#insturenform").submit(function(ev) {
		var $div;
		if ($("div#form2").is(":visible")) {
			submitForm($("div#form2"));
		}
		else if ($(this).valid()) {
			if ($("input#sSoundTitle").is(":visible")) {
				$("a#vorigestapinform3").attr("rel", 2);
				$div = $("div#form1");
			}
			else $div = $("div#form3");
			submitForm($div);
		}
		ev.preventDefault();
	});
	$(".sendin").click(function(ev) {
		$.scrollTo($("#sendin"), 800);
	});
	$("#sSoundDescription").keyup(function() {
		$(this).val($(this).val().substr(0, 200));
	});
	$("#form4").submit(function(ev) {
		$tar = $(ev.target);
		if (false == $tar.is("form")) {
			$tar = $tar.closest("form");
		}
		if ($tar.is("form#lowershareform")) {
			shareFormSubmit($tar, "lower-");
			ev.preventDefault();
		}
	});

	// SIDEBAR TOP 5 GELUIDEN
	$(".sidebar li").click(function(ev) {
		var id = $(this).attr("id").substr(1);
		$.history.load("!/bekijk-inzending/"+id+"/");
		ev.preventDefault();
	});
	$("button#searchsubmit").click(function (ev) {
		$.history.load("!/zoek-inzending/"+$("#q").val()+"/");
		ev.preventDefault();
	});

	// THEMA WIJZIGING IN FORM 1
	var $liblis = $("#lib-selector ul li");
	$("#iCategory").change(function() {
		var id = $(this).find("option:selected").val(),
			theme = getCatClass(id),
			$libselector = $("#lib-selector");
		$("#theme").removeClass().addClass(theme).html(getCatTitle(id));
		$libselector.empty().append("<ul id=\"jcarousel\"></ul>");
		$filteredliblis = id == -1? $liblis:$liblis.filter("."+theme);
		$("#jcarousel").jcarousel({
			"size": $filteredliblis.length,
			"itemLoadCallback": {onBeforeAnimation: mycarousel_itemLoadCallback},
			"visible": 6,
			"scroll": 6,
			"wrap": "circular"
		});
	});

	// GELUID BIBLIOTHEEK ONDERAAN PAGINA
	// Catch the click on a libraryitem and use it as sound for the submission
	$("div#lib-selector").click(function(ev) {
		var $tar = $(ev.target);
		if ($tar.is("a.play-lib, em.gallery-item-em")) {
			var id = $tar.is("a.play-lib")? $tar.attr("id").substr(1):$tar.closest("a").attr("id").substr(1);
			playAudio(id, true);
			ev.preventDefault();
		}
		else if ($tar.is("button.submitlibraryitem")) {
			var id = $tar.attr("id").substr(1);
			$.get("/select-libraryitem/"+id+"/",
				function(data) {
					if (data.errorcode == 0) {
						var sCatClass = getCatClass(data.iCategory);
						$("#pv-soundpreview").removeClass().addClass("sound-details "+sCatClass);
						$("a#preview-sound").removeClass().addClass(sCatClass+"-sprite").show();
						$("a#preview-sound").attr("alt", id);
						$("#theme").removeClass().addClass(sCatClass).html(getCatTitle(data.iCategory));
						$("#pv-name").html("Library");
						$("#pv-img").attr("src", data.sImageUrl);
						$("#pv-title").html($("#sSoundTitle").val());
						$("#pv-description").html($("#sSoundDescription").val());
						if ($("form#insturenform").valid()) {
							$("div.insturen-div:visible").hide();
							$("div#form3").show();
							$("div#library").hide();
						}
					}
					else {
						//die silently
					}
				},
				"json"
			);
			ev.preventDefault();
		}
	});
	$("a#librarybar").click(function (ev) {
		var $div = $("#library");
		if ($div.is(":visible")){
			$div.animate({"height": "toggle"}, "normal");
			$("#theme").hide();
		}
		else {
			$div.animate({"height": "toggle"}, "normal", function() {
				$("#theme").show();
				$.scrollTo($div, 800);
			});
		}
		ev.preventDefault();
	});
	$("#library").animate({"height": "toggle"}, "fast");

	$(".modal").fancybox({
		"padding" : 0
	});

   $("#lib-selector ul").jcarousel({
		"size": $liblis.length,
		"visible": 6,
		"scroll": 6,
		"wrap": "circular"
    });
}(jQuery));
	</script>
	<!--
		-->
</body>
</html>

