
function noaccess_notify( options )
{

	var bgcolor;

	if( typeof(options) == 'undefined' )
	{
		options = [];
	}

	if( typeof(options.message) == 'undefined' )
	{
		message = "Cette page est en cours<br>d'élaboration.";
	}

	message = '<span class="notification">' + message + '</span';

	if( typeof(options.obj) != 'undefined' )
	{
		var x = options.obj.getPosition().x + options.obj.getWidth() + 10;
		var y = options.obj.getPosition().y;
	}
	else
	{
		var x = null;
		var y = null;
	}


	if( typeof(options.bgcolor) == 'undefined' )
	{
		bgcolor = [255, 255, 255];
	}
	else
	{
		bgcolor = [options.bgcolor.substring(1,2), options.bgcolor.substring(3,4), options.bgcolor.substring(5,6)].hexToRgb(true);
	}

	if( typeof(message) == 'array' ) message = message.toString();

	new MochaUI.Window({
		loadMethod: 'html',
		closeAfter: 2000,
		type: 'notification',
		addClass: 'notification',
		content: message,
		width: 200,
		height: 48,
		x: x,
		y: y,
		padding:  { top: 10, right: 12, bottom: 10, left: 12 },
		shadowBlur: 8,
		bodyBgColor: bgcolor,
		onContentLoaded: function(){
											//this.windowEl.fade(.8);
										}
	});
}

function navigate( PAGE )
{
	/*
	$('overall_contents').setStyle('display', 'none');
	$('overall_bg').setStyle('display', 'block');
	*/
	$('modalOverlay').setStyle('display', 'block');
	window.location.href = PAGE;
}

function check_links()
{
	$each( $$('a'), function(link){
		if( link.rel )
		{
			switch( link.rel )
			{
				case 'navigate':
					link.addEvent('click', function(event){
						if( link.rel )
						{
							event.stop();
							eval( link.rel + "('" + link.href + "');" );
						}
					});
				break;
				default:
					if( link.rel.substring(0, 9) == 'load_show' )
					{
						var href = link.rel.split('|');
						link.addEvent('click', function(event){
							event.stop();
							eval( href[0] + "(" + href[1] + "," + href[2] + ");" );
						});
					}
					if( link.rel.substring(0, 12) == 'load_contest' )
					{
						var href = link.rel;
						link.addEvent('click', function(event){
							event.stop();
							eval( href + "();" );
						});
					}
				break;
			}
		}
	});
}
