(function($){	$.fn.blink = function(options)	{		var defaults = { delay:500 };		var options = $.extend(defaults, options);				return this.each(function()		{			var obj = $(this);			setInterval(function()			{				if($(obj).css("visibility") == "visible")				{					$(obj).css('visibility','hidden');				}				else				{					$(obj).css('visibility','visible');				}			}, options.delay);		});	}}(jQuery))var state = 0;$('script').each(function() {	if (this.src.match(/default\.js\?state=([0-9])$/)) {		var matches = this.src.match(/default\.js\?state=([0-9])$/);		state = matches[1];	}});function calculateAmount(inputElement, amount, brancheId){	$.post('/ajax_server.php?action=calculate&value=' + inputElement.value + '&amount=' + amount + '&brancheId=' + brancheId,	  	function(data){	  		if (data) {	  			var objectData = eval('(' + data + ')');	  			if (inputElement.parentNode.nextSibling.innerHTML.match(/-/)) {					// do nothing				} else {		  			jQuery('#total_amount_value').html(objectData.totalAmount);		  			inputElement.parentNode.nextSibling.innerHTML = '&#8364 ' + objectData.specSubtotal;		  			try {						jQuery('span#event_school_amount_id').text((parseFloat(objectData.totalAmount)*0.20).toFixed(2));  					} catch (error) {										}		  		}		  		if (objectData.totalAmount.match(/^0/)) {					// remove the required field taq bankaccount field					jQuery('input#f_id_201').attr('className','text');  					jQuery('input#f_id_201').parent().hide();										jQuery('input#f_id_101').attr('className','text');					jQuery('input#f_id_101').parent().hide();				} else {					jQuery('input#f_id_201').parent().show();					jQuery('input#f_id_101').parent().show();										jQuery('input#f_id_101').attr('className','text required');					jQuery('input#f_id_101').css('width','auto');						jQuery('input#f_id_201').attr('className','text required');				}	  		};	  	}	);}function calculateSponsorshipAmount(inputElement, amount, brancheId){	$.post('/ajax_server.php?action=calculateSponsorship&value=' + inputElement.value+ '&brancheId=' + brancheId,	  	function(data){	  		if (data) {	  			var objectData = eval('(' + data + ')');		  		jQuery('#total_amount_value').html(objectData.totalAmount);  	  		};	  	}	);}var player;function startTracker(obj){}function playerReady(obj) {	player = document.getElementById(obj['id']); 	if(obj.id.match(/^in_text_player/i)) {		player.addModelListener("STATE", "stateListener");		}};function stateListener(obj) { //IDLE, BUFFERING, PLAYING, PAUSED, COMPLETED	currentState = obj.newstate; 	if (obj.id.match(/^in_text_player_http$/)) {		if (currentState.match(/^completed$/i)) {			location.href = 'http://www.canadareis.com/p/201/Introduction.html';			return;		}		} else {		if (currentState.match(/^playing$/i)) {			try {				var target = document.getElementById('mpl');					target.sendEvent("STOP","true");			} catch (error) {			}		} else {			try {				var target = document.getElementById('mpl');					target.sendEvent("PLAY","true");			} catch (error) {			}		}	}}var Webshop = {		init		: function()	{		// get all order buttons and add the Webshop Add event		/*jQuery('button.order_button').bind('click', function() {		   	Webshop.add(this.form.order_id.value, this.form.amount.value);		   	return false;		});*/    	},		add			: function(id, amount)	{	  	$.post('/ajax_server.php?action=webshop',	  	{ 	  		action : 'order',		  	order_id: id, 			amount: amount 		},	  	function(data){	  		if (data) {	  			location.href = '/webshop/winkelmandje.html';	  			return false;	  		};	  	}	);	},		del			: function()	{		}}$(window).load(function() { 	$('#links_info_block > ul > li').each(function() {		$(this).bind('mouseover', function() {			this.className += 'hover';		});		$(this).bind('mouseout', function() {			this.className = '';		});	});	 try {		$("ul.sf-menu").superfish({ 	        animation: {height:'show'},   // slide-down effect without fade-in 	        delay:     1200               // 1.2 second delay on mouseout 	    }); 	} catch (error) {}    // fix min-height content    setHeight();    	   	$('div.top_images a img').each(function() {		$(this).bind('mouseover', function() {			this.src = this.src.replace('up','over');		});		$(this).bind('mouseout', function() {			this.src = this.src.replace('over','up');		});   	});	   	Webshop.init(); });function setHeight(){	var maxHeight = 0;    try {		maxHeight = $('div.banner_pos_left').height();	} catch (error) {	}	if ($('div#content').height()+90 > maxHeight)		maxHeight = $('div#content').height()+90;	if ($(window).height() > maxHeight)		maxHeight = $(window).height();	if ($('#content_element_right').height() > maxHeight)		maxHeight = $('#content_element_right').height();	try {			$('div.banner_pos_left').css({'height':maxHeight + 'px'});	} catch (error) {}	  	$('div#content').css({'height':maxHeight + 'px'});  	  	try {  		$('div#content_element_right').css({'height':maxHeight + 'px'});  	} catch (error) {}}function checkShopForm(obj){	var error = false;	var items = new Array('lastname','address','zipcode','town','email','email_confirm');	if (obj.incasso.checked) {		items.push('accountnumber');	}	for (var i=0; i < items.length; i++) {		element = eval('obj.' + items[i]); 		if (element.value == '') { 			element.style.border = '2px solid red'; 			element.nextSibling.nextSibling.style.color = 'red'; 			error = true; 		} else {			element.style.border = '1px solid black'; 			element.nextSibling.nextSibling.style.color = 'black';	   		}		}	if ((obj.email.value != '') && !obj.email.value.match(/^[A-Za-z0-9_-]+([\.]{1}[A-Za-z0-9_-]+)*@[A-Za-z0-9-]+([\.]{1}[A-Za-z0-9-]+)+$/)) {		obj.email.style.border = '2px solid red';		obj.email.nextSibling.nextSibling.style.color = 'red';		error = true;	}	if ((obj.email_confirm.value != '') && !obj.email_confirm.value.match(/^[A-Za-z0-9_-]+([\.]{1}[A-Za-z0-9_-]+)*@[A-Za-z0-9-]+([\.]{1}[A-Za-z0-9-]+)+$/)) {		obj.email_confirm.style.border = '2px solid red';		obj.email_confirm.nextSibling.nextSibling.style.color = 'red';		error = true;	}	if ((obj.email.value != "" && obj.email_confirm.value != "") && obj.email.value != obj.email_confirm.value) {          obj.email.style.border = '2px solid red';		obj.email.nextSibling.nextSibling.style.color = 'red';		obj.email_confirm.style.border = '2px solid red';		obj.email_confirm.nextSibling.nextSibling.style.color = 'red';		// create warning		if (obj.email.parentNode.firstChild.id != 'email_not_equal') {   			var divElement = document.createElement('div');   			divElement.id = 'email_not_equal';   			divElement.appendChild(document.createTextNode('E-mailadressen zijn niet identiek'));   			obj.email.parentNode.insertBefore(divElement, obj.email);   		}		error = true;       } else {        if (obj.email.parentNode.firstChild.id == 'email_not_equal') {            obj.email.parentNode.removeChild(obj.email.parentNode.firstChild);        }    }	if (error)		return false;	return true;}function suggest(inputString, suggestionsDivId, inputFieldId, ajaxUrl){	if(inputString.length == 0) {		jQuery(suggestionsDivId).fadeOut();	} else {		jQuery(inputFieldId).addClass('load');		jQuery.post(ajaxUrl, {queryString: ""+inputString+""}, function(data){			if(data.length >0 ) {				jQuery(suggestionsDivId).fadeIn();				jQuery(suggestionsDivId + ' div').html(data);				jQuery(inputFieldId).removeClass('load');			}		});	}}var maxUsers = 9;function suggest_fill(id, thisValue, targetInputFieldName, targetInputFieldId, divTargetListId) {	var addedUsers = [];	if (divTargetListId != '') {	    jQuery('#'+targetInputFieldName).val("");	} else {		jQuery('#'+targetInputFieldName).val(thisValue);		jQuery('#'+targetInputFieldId).val(id);	}	if (divTargetListId != '') {		if (jQuery('#'+divTargetListId + ' ul li').size() > 0) {       			jQuery('#'+divTargetListId + ' ul li').each(function() {				if (this.getAttribute('id') && this.getAttribute('id').match(/^wrapper_user_li_[0-9]+$/)) {					var userId = this.getAttribute('id').replace('wrapper_user_li_', '');					addedUsers.push(userId);				}			});		}		// other list with users which have added this user to his list		if (jQuery('div#in_house_user_list_rel ul li').size() > 0) {       			jQuery('div#in_house_user_list_rel ul li').each(function() {				if (this.getAttribute('id') && this.getAttribute('id').match(/^wrapper_user_li_[0-9]+$/)) {					var userId = this.getAttribute('id').replace('wrapper_user_li_', '');					addedUsers.push(userId);				}			});		}		var found = false;		if (addedUsers.length > 0) {			for (var i=0; i < addedUsers.length; i++) {				if(addedUsers[i] == id) {					found = true;					break;				}			}		}		if (found) {		   	jQuery('li#wrapper_user_li_'+id+' a').css({'color': 'red'});		} else {			if (addedUsers.length < maxUsers) {				jQuery('#'+divTargetListId + ' ul').append('<li id="wrapper_user_li_'+id+'"><a rel="user_'+id+'" id="user_'+id+'" href="#">'+thisValue+'</a>&nbsp;<a href="" onclick="return suggest_del('+id+', \''+targetInputFieldId+'\');">[ x ] </a></li>');				// set the id in the hidden input field				try {					var currentFieldValue = document.getElementById(targetInputFieldId).value;				    if (currentFieldValue == 0) {						jQuery('#'+targetInputFieldId).val(id);					} else {						var currentFieldValueArray = currentFieldValue.split(',');						currentFieldValueArray.push(id);						jQuery('#'+targetInputFieldId).val(currentFieldValueArray.join(','));					}				} catch (error) {				    				}			} else {				jQuery('div#in_house_list_warning').show();			}		}	}	setTimeout("jQuery('div.suggestionsBox').fadeOut();", 200);}function suggest_del(id, hiddenInputId){	jQuery('li#wrapper_user_li_' + id).remove();	// remove the id from the hidden input		var currentFieldValue = document.getElementById(hiddenInputId).value;    if (currentFieldValue != 0) {		var currentFieldValueArray = currentFieldValue.split(',');		var newArray = [];		for (var i=0; i < currentFieldValueArray.length; i++) {			if (currentFieldValueArray[i] != id) {				newArray.push(id);			}		}		jQuery('#'+hiddenInputId).val(newArray.join(','));	}	return false;}