/*
Copyright (c) 2004-2009 Ylab, www.ylab.nl
*/

var debugging = true;
var isOpera = (navigator.userAgent.indexOf("Opera") > -1);
var isNav = ((!isOpera) && (navigator.appName == "Netscape"));
var isIE  = ((!isOpera) && (navigator.appName.indexOf("Explorer") > -1 ));
var hasFirebug = (window.console && console.firebug);

//trap error
if(!debugging){
	window.onerror = function(msg, url, line){
		window.status = "Er is een fout opgetreden. Meld dit a.u.b. aan de webmaster. " + line + ":" + msg;
		return true;
	};
}

Array.prototype.in_array = function(element){
	for(var values in this){
		if(this[values] == element){
			return true;
		}
	}
	return false;
};

//DEBUGGING
function debugAlert(){
	if(!debugging){return;}
	var code = "";
	for(var i=0; i < arguments.length; i++){
		code += arguments[i] + "\n";
	}
	code += '\nKlik op Annuleren om verdere meldingen te onderdrukken.';
	debugging = confirm(code);
}

function debugConfirm(){
	if(!debugging){return;}
	var code = "";
	for(var i=0; i < arguments.length; i++){
		code += arguments[i] + "\n";
	}
	return confirm(code);
}

//
jQuery(document).ready(function($){
	$('dfn').each(function(){
		//expected format: <dfn>info at ylab.nl | contact us</dfn>
		var parts = $(this).html().split(' | ');
		var mailaddress = parts[0];
		mailaddress = mailaddress.replace(' at ','@');
		var label = parts.length > 1 ? parts[1] : mailaddress;
		$(this).html('<a href="mailto:' + mailaddress + '">' + label + '<\/a>');
	});
	$('#message').hide().slideDown('normal',function(){window.setTimeout("$('#message').slideUp('slow')", 5000)}).click(function(){$(this).slideUp('fast')});
});

