function set_cookie(name, value, expires, path, domain, secure){
	var today = new Date();
	today.setTime( today.getTime() );
	if ( expires )
	{
	/*expires = expires * 1000 * 60 * 60 * 24;*/
	expires = expires * 1000 * 60 * 60 * 168;
	}
	var expires_date = new Date( today.getTime() + (expires) );
	
	document.cookie = name + "=" +escape( value ) +
	( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
	( ( path ) ? ";path=" + path : "" ) +
	( ( domain ) ? ";domain=" + domain : "" ) +
	( ( secure ) ? ";secure" : "" );
}

function get_cookie(cookie_name) {
  var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );

  if ( results )
    return ( unescape ( results[2] ) );
  else
    return null;
}

if(window.location.hostname=="nl.elle.be" || window.location.hostname=="fr.elle.be"){
	$('#splash').ready(function() {
		if(get_cookie('splash')==null){
			set_cookie('splash',1,1,'/','elle.be');
			$.blockUI.defaults.css.width='630px';
			$.blockUI.defaults.css.height='340px';
			$.blockUI.defaults.css.top='25%';
			$.blockUI.defaults.css.left='30%';
			$.blockUI.defaults.css.cursor=null;
			$.blockUI({ message: $('#splash') });
			$('#close_splash').click(function(e) {
				var $t = $(e.target);
				if ( $t.is('#close_splash') && ! $t.is('.blockMsg'))
					$.unblockUI();
			}).attr('title','Click to close');
			/*setTimeout($.unblockUI, 25000);*/
		}
	});
}
