var pad, inlogval, val, noslide, sliding;
window.addEvent('domready', function() {
	leegmelding.delay(300);
	
	$('sluiten').setStyle("opacity", "0.3");
	
	$('sluiten').addEvent('mouseover', function(event){
	$('sluiten').setStyle("opacity", "1");
	});
	
	$('sluiten').addEvent('mouseout', function(event){
	$('sluiten').setStyle("opacity", "0.3");
	});
	
	$('sluiten').addEvent('click', function(event){
	closePopup();
	});
	
	/*	  
	
	$('taal_uit').addEvent('click', function(){     
	toonmelding('changing language', 10000);
	Cookie.write('taal', $('taal_uit').className, {path: '/', duration: 2});
	document.location.reload();
	})	
	*/
	
if(noslide!=1){	
	var data = {
		'IMG_2308.jpg': { caption: '' }, 
		'IMG_2434.jpg': { caption: '' }, 
		'IMG_2493.jpg': { caption: '' }, 
		'IMG_2570.jpg': { caption: '' },		
		'IMG_2454.jpg': { caption: '' }, 
		'IMG_2462.jpg': { caption: '' }, 
		'IMG_2522.jpg': { caption: '' }, 
		'IMG_2540.jpg': { caption: '' }, 
		'IMG_2543.jpg': { caption: '' }, 
		'floris-leeuwenberg-2-5.jpg': { caption: '' }, 
		'DSC08215.jpg': { caption: '' }, 
		'P1000312.jpg': { caption: '' }, 
		'DSC08226.jpg': { caption: '' }, 
		'DSC08245.jpg': { caption: '' }, 
		'DSC08305.jpg': { caption: '' }, 
		'grotebeer.jpg': { caption: '' }, 
		'DSC08495.jpg': { caption: '' }, 
		'DSC08421.jpg': { caption: '' }, 
		'floris-leeuwenberg-2-60.jpg': { caption: '' },
		'floris-leeuwenberg-2-4.jpg': { caption: '' }, 
		'floris-leeuwenberg-2-4.jpg': { caption: '' }	   
	    };
	//var myShow = new Slideshow('slideshow', data, {duration: 1750, captions: false, controller: false, height: 200, hu: 'images/slideshow/', width: 950});
	var zoom	= 60;
    var pana		= 80;
	var myShow 	= new Slideshow.KenBurns('slideshow', data, {pan: pana, zoom: zoom, duration: 6750, captions: true, controller: false, height: 200, hu: '/images/slideshow/', width: 950});
	}else{	
	$('slideshow').morph({height: 0});
	}
    
    (function(){
        if(($('rechter_kolom').getHeight()-237)>($('wrapper').getHeight()) ){
        	$('basis').setStyle('height', $('rechter_kolom').getHeight()+237);
        	$('wrapper').setStyle('height', $('rechter_kolom').getHeight()+237);
        }
        }).delay(1000);
	
});

function fotos(){
	showPopup(900, 745, 0.91);
	var jsonRequest = new Request.JSON({url: "/index.php", onSuccess: function(fotos){
	
	//alert(fotos.data);
	sliding= new Slideshow('floatcontent', fotos.data, {duration: 1750, captions: true, controller: true,  width: 900, height: 675, thumbnails: true, hu: 'images/fotos/'});

	}}).post({ajaxrequest:'1', f:'fotos', m_id:2});	
	
	/*var data = {
			'IMG_2447.jpg': { caption: 'aap' }, 
			'IMG_2482.jpg': { caption: 'beer' }, 
			'IMG_2488.jpg': { caption: 'tijger' }, 
			'IMG_2493.jpg': { caption: 'leeuw' },
			'DSCN0121.jpg': { caption: 's' },
			'DSCN0128.jpg': { caption: 'leeuw' },
			'DSCN0189.jpg': { caption: 'leeuw' },
			'DSCN0680.jpg': { caption: 'leeuw' },
			'Floris-leeuwenberg-2-19.jpg': { caption: ' ' },
			'Floris-leeuwenberg-2-25.jpg': { caption: ' ' },
			'Floris-leeuwenberg-2-27.jpg': { caption: ' ' },
			'Floris-leeuwenberg-2-29.jpg': { caption: ' ' },
			'Floris-leeuwenberg-2-58.jpg': { caption: ' ' },
			'Floris-leeuwenberg-2-60.jpg': { caption: ' ' },
			'Floris-leeuwenberg-2-62.jpg': { caption: ' ' },
			'Floris-leeuwenberg-2-63.jpg': { caption: ' ' },
			'hogelucht.jpg': { caption: ' ' },
			'IMG_2308.jpg': { caption: ' ' },			
			'IMG_2309.jpg': { caption: ' ' }			
			};
			
			{"data":[
	{"DSCN0128.jpg":"{caption: 'qqq'}"},
	{"IMG_2434.jpg":"{caption: 'caption'}"},
	{"Floris-leeuwenberg-2-60.jpg":"{caption: 'captionssssss'}"},
	{"Floris-leeuwenberg-2-62.jpg":"{caption: 'caption'}"},
	{"IMG_2738.jpg":"{caption: 'caption'}"},
	{"Floris-leeuwenberg-2-19.jpg":"{caption: 'caption'}"},
	{"DSCN0121.jpg":"{caption: 'caption'}"},
	{"P1000312.jpg":"{caption: 'caption'}"},
	{"IMG_2724.jpg":"{caption: 'caption'}"},
	{"hogelucht.jpg":"{caption: 'caption'}"},
	{"IMG_2679.jpg":"{caption: 'caption'}"},
	{"IMG_2308.jpg":"{caption: 'caption'}"},
	{"IMG_2952.jpg":"{caption: 'caption'}"},
	{"IMG_2960.jpg":"{caption: 'caption'}"},
	{"Floris-leeuwenberg-2-58.jpg":"{caption: 'caption'}"},
	{"IMG_2493.jpg":"{caption: 'caption'}"},
	{"IMG_2566.jpg":"{caption: 'caption'}"},
	{"IMG_2590.jpg":"{caption: 'caption'}"},
	{"Floris-leeuwenberg-2-27.jpg":"{caption: 'caption'}"},
	{"Floris-leeuwenberg-2-25.jpg":"{caption: 'caption'}"},
	{"IMG_2314.jpg":"{caption: 'caption'}"},
	{"IMG_2309.jpg":"{caption: 'caption'}"},
	{"P1170878.jpg":"{caption: 'caption'}"},
	{"Floris-leeuwenberg-2-63.jpg":"{caption: 'caption'}"},
	{"DSCN0680.jpg":"{caption: 'caption'}"},
	{"IMG_2482.jpg":"{caption: 'caption'}"},
	{"IMG_2488.jpg":"{caption: 'caption'}"},
	{"Floris-leeuwenberg-2-29.jpg":"{caption: 'caption'}"},
	{"DSCN0189.jpg":"{caption: 'caption'}"},
	{"IMG_2447.jpg":"{caption: 'caption'}"},
	]}
			
			*/
	//sliding= new Slideshow('floatcontent', data, {duration: 1750, captions: true, controller: true,  width: 900, height: 675, thumbnails: true, hu: 'images/fotos/'});
	
	
}

function showPopup(w, h, bgtrans){
	$('bgdiv').style.display='block';
	winDims		= window.getCoordinates();
	new Fx.Morph('bgdiv', {duration: 'long', transition: Fx.Transitions.Sine.easeOut}).set({
	    'height': winDims.height,
	    'width': winDims.width,
	    'background-color': '#000',
	    'opacity': bgtrans
	});

	
	new Fx.Morph('floatwindow', {duration: 'long', transition: Fx.Transitions.Sine.easeOut}).set({
		'top': (winDims.height/2)-(h/2),
		'left': (winDims.width/2)-(w/2),
	    'height': h,
	    'width': w,
	    'display':'block',
	    'background-color': '#fff',
	    'opacity': 1
	});

	
}

function closePopup(rreset){
	//$('floatcontent').innerHTML='';
	new Fx.Morph('bgdiv', {duration: 'long', transition: Fx.Transitions.Sine.easeOut}).set({
	    'height': 0,
	    'width': 0,
	    'background-color': '#fff',
	    'opacity': 0
	});
	
	new Fx.Morph('floatwindow', {duration: 'long', transition: Fx.Transitions.Sine.easeOut}).set({
		'top': 0,
		'left': 0,
	    'height': 0,
	    'width': 0,
	    'background-color': '#000',
	    'opacity': 0
	});
$clear(sliding);
}	


function leegmelding(){
	$('loader').removeClass('ajax-loading').set('text','');
	$('load').style.display='none';
}


function toonmelding(txt, tijd){
	$('loader').addClass('ajax-loading').set('text',txt);
	$('load').style.display='block';
	leegmelding.delay(tijd);
}

var player = null;
function createPlayer(theContainer, theFile, go) {
	var cnt = $(theContainer);
	var src = "/wmvplayer/wmvplayer.xaml";
	var cfg = {height:"450", width:"600", file:theFile, autostart:go};
	player = new jeroenwijering.Player(cnt,src,cfg);
}


function mediteren() {
	//createPlayer("content", "mms://mms.omropfryslan.nl/tv", "false");
	createPlayer('content', 'http://hwcdn.net/b7y3y7j9/wms/examples/videos/ed_656x368.wmv.asx', 'true');
}

function enabled(staat){
	$('submit').disabled=(staat)? true : true;	

}

