
var sos	= new Array();
var so	= '';
var Mediaplayer= new Class( { ////bij opstarten alle blokken automatisch een mouseover geven met de coordinaten naar centered
initialize: function(options){
	this.options = Object.extend({
		update_id: 0,
		width: 320,		
		height: 0,
		delay: 0,
		file: 'media_player/playlist.xml',
		background: 'media_player/preview.jpg',
		lightcolor:'ffffff',
		showvolume: true,
		autostart: true
		}, options || {});
	
	this.update_id	=this.options.update_id;	
	this.width	= this.options.width;	
	this.height	= this.options.height;	
	this.delay	= this.options.delay;	
	this.file		= this.options.file;	
	this.lightcolor	= this.options.lightcolor;
	this.showvolume= this.options.showvolume;
	this.autostart	= this.options.autostart;
	this.background= this.options.background;

	/*
	var so = new SWFObject('mediaplayer.swf','mpl','320','340','7');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addVariable('displayheight','240');
so.addVariable('file','http://www.jeroenwijering.com/upload/mediaplayer.xml');
so.addVariable('height','340');
so.addVariable('width','320');
so.write('player');
	*/
	this.so = new SWFObject('media_player/mediaplayer.swf', this.update_id ,this.width,this.height,'7');
	
	this.so.addParam("allowfullscreen","true");
	this.so.addVariable("file", this.file);
 	
	this.so.addVariable("backcolor","0xffffff");
	//alert(this.file);
	//this.so.addVariable("image",this.background);
	this.so.addVariable("frontcolor","0x000000");
	this.so.addVariable("lightcolor","0x6637f7");
	this.so.addVariable("backcolor","0xffffff");
	//this.so.addVariable("showicons", "true");
	//this.so.addVariable("showdigits", "false");
	//this.so.addVariable("showvolume", this.showvolume);
	
	//this.so.addVariable("enablejs","true");
	this.so.addParam('allowscriptaccess','always');
	this.so.addVariable("javascriptid","mpl");
	this.so.addVariable('displayheight','240');
	this.so.addVariable("width",320);
	this.so.addVariable("height",590);
	
	this.so.addVariable("autostart", this.autostart);
	this.so.write(this.update_id);
	//this.Write.delay(this.delay, '', new Array(this.update_id, this));
	},
	
Write: function(update_id, ob){

	
	
	if(ob.update_id=="floatcontent"){
	showPopup(460, 359, 0.8);
	ob.Write2.delay(760, '', new Array(update_id, ob));
	
	}else{
	//alert();
	ob.so.write(update_id);	
	}


	},
	
Write2: function(update_id, ob){	
	ob.so.write(update_id);	
	//$('floatwindow').innerHTML="<span style='color:#e4106d;font-weight:bold;cursor:pointer;float:right' onclick='closePopup()'>x</span><br>"+$('floatwindow').innerHTML;
	//alert('sss');
	}
	
})


function tips(){

new Tips($$('.tip_img'), {
	initialize:function(){
		this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 50, wait: false}).set(0);
	},
	onShow: function(toolTip) {
		this.fx.start(1);
	},
	onHide: function(toolTip) {
		this.fx.start(0);
	},
	offsets: {'x': -100, 'y': 20},
	maxTitleChars: 100
});	
	
}

function accordion(){

	var nr="aa";
	var txt="meer lezen &rsaquo;";
	var accordion = new Accordion('h1', 'h2', {
		show: 0,		
		onActive: function(toggler, element){
		
		toggler.setStyle('color', '#000;');
		toggler.childNodes[1].innerHTML='';
		},
 
		onBackground: function(toggler, element){
		toggler.setStyle('color', '#4e4c47');		
		//alert(toggler.childNodes[0].innerHTML);
		toggler.childNodes[1].innerHTML=txt;
		toggler.childNodes[1].style.zIndex=0;
		}
		}, $('content'));
	
}


var mformulier= "";
var stappen	= new Array();
var cstap	= 0;
var Ajaxform= new Class( { ////bij opstarten alle blokken automatisch een mouseover geven met de coordinaten naar centered
initialize: function(formid, options){
	this.options = Object.extend({
		update_id: 0,
		formulier: 0,
		to_Hide: 0
		}, options || {});
		this.formulier=$(formid);
		this.to_Update	= $(this.options.update_id);
		
	//alert("ss");
	
	
	stappen.extend([this]);

	this.formulier.addEvent('submit', function(e) {
	
	new Event(e).stop();
	});

	},
	
checkFields: function(stap){
var velden=this.formulier.elements;

//var velden = $$('#orderformulier select', '#orderformulier input') //an array of all anchor tags with theclass "myClass"
var velden = $$('#formulier select', '#formulier input') //an array of all anchor tags with theclass "myClass"

//alert(velden);


for(i=0; i<velden.length; i++){
            var field = velden[i];
	 var isReq = (field.name.charAt(0)=="R") ? true : false

	 if(isReq && field.value==""){
           	var veldnaam = field.name.substring(1,27);
		var veldnaam = veldnaam.replace(/_/, " ");
           	alert("U bent vergeten '"+veldnaam+"' in te vullen.");
		field.focus();
		return false;	
		break;
		
	}
	
	if(field.name=="Remail"){
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
        	if (!filter.test(field.value)){
        	alert("Het door u ingevulde emailadres is onjuist");
        	return false;
        	break
        	}
	
		
	}
	
};


return true;	
},
	
	
Verzend: function(functie){
	
	//if(functie!=""){
	//$('f').value=functie;	
	//}
	
	//alert(1);
	if(this.checkFields()){
	
	this.formulier.send({
		update: stappen[0].to_Update,
		evalScripts: true
		//,onComplete: this.OK
	});
	
	}
	
	}

});


