MAP = {
	loadStandhouder: function( id )
	{		
		MAP.showData( MAP.getStandhouderByID(id) );
	},
	getStandhouderByID: function( id ) 
	{
		for(var i=0; i<MAP.data.length; i++) 
		{
			if( MAP.data[i].standhouder_id==id ) return MAP.data[i];
		}
		return null;
	},	
	showMap: function()
	{
		$('standhouder_content').style.display = "none";
		$('standhouder_kaart').style.display = "block";
	},
	showData: function( standhouder )
	{
		var el = $('standhouder_content');
		if( ! el ) { return; }
		el.innerHTML = "<div style='position: relative; width:100%; height:100%'>"+
			"<div style='width:265px;'><b>Standhouder:</b> "+standhouder.standhouder_naam+"<br/>"+
		    "<b>Adres:</b> "+standhouder.standhouder_straatnaam+" "+
		    standhouder.standhouder_straatnummer+"<br/>"+
		    "<b>Postcode:</b> "+standhouder.standhouder_postcode+"<br/>"+
		    "<b>Plaats:</b> "+standhouder.standhouder_plaats+"<br/><br/>"+
		    "<b>Telefoon:</b> "+standhouder.standhouder_telefoon+"</div>"+
		    "<b>Email:</b> <a href='mailto:"+standhouder.standhouder_email+"'>"+standhouder.standhouder_email+"</a><br/>"+
		    "<b>Website:</b> <a target='new' href='http://"+standhouder.standhouder_website+"'>"+standhouder.standhouder_website+"</a><br/>"+
		    "<b>Opmerkingen:</b><br/> "+standhouder.standhouder_commentaar_html;
		if( standhouder.standhouder_image.length>0 ) {
		  el.innerHTML += "<div style='position:absolute; right:0; top:0;margin-top:10px;margin-right:10px;'><img alt='"+standhouder.standhouder_naam+"' src='"+standhouder.standhouder_image+"' width=100></div>";
		}
		el.innerHTML += "<div style='text-align: center; margin-bottom:10px;position:absolute; left:27%; bottom:0;'>"+
				"<a nohref onclick='MAP.showMap();'>Klik hier voor de plattegrond.</a></div>"+
		"</div>";
		$('standhouder_kaart').style.display = "none";
		el.style.display = "block";
	},	
	init: function()
	{	
		
	}
}

var carrousel;
var lijst;

function moveCarrousel( offset ) {
	// alert(offset);
	alert( $$('#standhouder_carrousel div.container div.cont').scrollLeft );
	//if( carrousel==null ) { return; }
	//carrousel.toRight();
}

function moveLijst( offset ) {
	alert(offset);
	// lijst.toTop();
	lijst.toBottom();
}

window.addEvent("domready", function() {
	MAP.init();
	
	carrousel = new Fx.Scroll( $$('#standhouder_carrousel div.container div.cont') );
    lijst = new Fx.Scroll( $$('#standhouder_lijst div.container div.cont') );
    
});
