function js_checkMailto(jqValue,jqError,jqLines) {
	var mailto=jqValue.val().split("\n");
	error=false;
	errorLines='';
	for (i=0;i<mailto.length;i++) {
		if (mailto[i].indexOf('<')>-1 && mailto[i].indexOf('>')>0) {
			email=mailto[i].substr(mailto[i].indexOf('<')+1)
			email=email.substr(0,email.indexOf('>'))
			if (!/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(email)) {error=true;errorLines+=(i+1)+' ';}
		} else {
			error=true;errorLines+=(i+1)+' ';
		}
	}
	if (error) {
		jqError.show();
		jqLines.html('Line(s): '+errorLines);
	} else {
		jqLines.html('');
		jqError.hide();
	}
}

jQuery.fn.dataTableExt.aTypes.unshift(
	// force a 'euro_date' sorting on cells containing dates in euro format (25.12.2011)
	function ( sData ) {
		if (sData.match(/^[0-9]{2}\.[0-9]{2}\.[0-9]{4}$/)) {
			return 'euro_date';
		}
		return null;
	} 
);

jQuery.fn.dataTableExt.oSort['euro_date-asc']  = function(a,b) {
	var x = a.split(".");
	var y = b.split(".");
	x = parseInt( x[2]+x[1]+x[0] );
	y = parseInt( y[2]+y[1]+y[0] );
	return ((x < y) ? -1 : ((x > y) ?  1 : 0));
};

jQuery.fn.dataTableExt.oSort['euro_date-desc'] = function(a,b) {
	var x = a.split(".");
	var y = b.split(".");
	x = parseInt( x[2]+x[1]+x[0] );
	y = parseInt( y[2]+y[1]+y[0] );
	return ((x < y) ?  1 : ((x > y) ? -1 : 0));
};
