function Set_Cookie( name, value, expires, path, domain, secure )
{
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );

/*
if the expires variable is set, make the correct
expires time, the current script below will set
it for x number of days, to make it for hours,
delete * 24, for minutes, delete * 60 * 24
*/
if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );
//domain=document.location.href;

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}
	

$(function(){

	$('.show-swd-ui-message').animate({
		opacity: 1.0,
		backgroundColor:'yellow'
		}, 2000, function() {
			$(this).css({'background-color':'#FFFFFF'});				
		});
		
	$('.swd-ui-message-off').live('click',function(){
		// turn off the ui message temporarily
		var id=$(this).attr('data');
		$('#' + id + 'message').remove();
	});
	
	$('.swd-ui-message-no-display').live('click',function(){
		// turn off and set a cookie to disable for the rest of the session
		var id=$(this).attr('data');
		$('#' + id + 'message').remove();
		Set_Cookie(id + '-message-no-display','nodisplay');					
	});

});// end of jquery functions
