function showPublicAnnounce(announce_id){
	
	if(announce_id = parseInt(announce_id)){
		
		$.get('/announce/details', {'announce_id':announce_id}, function(data){
			
			if(data.indexOf('INVALID_ANNOUNCE_ID') >= 0 || data.indexOf('DB_PROBLEM') >= 0){
				return false;
			}
			else{
				
				winDimensions = getWindowDimensions();
				
				left_margin = winDimensions[0] > 615?parseInt((winDimensions[0]-615)/2):0;
				top_margin = winDimensions[1] > 150?parseInt((winDimensions[1]-380)/2):0;
								
				$('body').append('<div id="transparent_background"></div>');
				$('#transparent_background').css({'position':'fixed', 'top':'0px', 'left':'0px', 'width':winDimensions[0]+'px', 'height':'100%','z-index':'100','background-color':'#666', 'filter':'alpha(opacity=50)', 'opacity':'0.5', '-moz-opacity':'0.5'});
				
				$('body').append('<div id="public-announce-container"></div>');
				$('#public-announce-container').css({'position':'fixed', 'top':top_margin+'px', 'left':left_margin+'px', 'width':'617px', 'z-index':'101'});
				
				$('#public-announce-container').html(data);
				
			}
			
		});
		
	}
	else{
		return false;
	}
	
}

function closeDetailsWindow(){
	
	$('#transparent_background').remove();
	$('#public-announce-container').remove();
	
}

function getWindowDimensions(){
	
	var viewportwidth;
	var viewportheight;

	 if (typeof window.innerWidth != 'undefined'){

	      viewportwidth = window.innerWidth,
	      viewportheight = window.innerHeight

	 }
	 else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0){

	       viewportwidth = document.documentElement.clientWidth,
	       viewportheight = document.documentElement.clientHeight

	 }
	 else{

	       viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
	       viewportheight = document.getElementsByTagName('body')[0].clientHeight

	 }	
	 
	 return new Array(viewportwidth, viewportheight);
	
}
