function popup (html_code) {
	html_code = "<div id='popup'>" + html_code + "</div>";
	i = new Insertion.Before($('supercontainer'),html_code);
}
function popdown () {
	new Effect.Fade('popup',{duration: 0.1});
	$('popup').remove();
}
function to_center ( center_obj, center_cont ) {
	container_w = $(center_cont).width;
	container_h = $(center_cont).height;
	alert(container_w);
	//$(obj) 
}
function picture_popup( url,html ) {
	if (html == '' || html == undefined) html = "<a id='popup_loading' onclick='popdown()'>Loading...</a><a id='popup_close' onclick='popdown()'><img id='popup_image' src='" + url + "'/></a>";
	popup(html);
	
	$('popup').hide()
	$('popup_close').hide();
	Event.observe( $('popup_image'), 'load',
		function () {
			Position.Center ($('popup_close'));
			new Effect.Appear('popup_close',{duration: 0.3});
			$('popup_loading').hide();
		}
	);
	$('popup').show();
}

function zoom(photo_id) {
	$('flash_bar').hide();
	html = "<a id='popup_loading' onclick='zoomdown()'>Loading...</a><a id='popup_close' onclick='zoomdown()'><img id='popup_image' src='" + images[photo_id][0] + "'/></a>";
	if (!$('popup')) picture_popup('',html);
}
function picture_zoom( url ) {
	$('flash_bar').hide();
  html = "<a id='popup_loading' onclick='zoomdown()'>Loading...</a><a id='popup_close' onclick='zoomdown()'><img id='popup_image' src='" + url + "'/></a>";
  if (!$('popup')) picture_popup('',html);	
}
function zoomdown() {
	new Effect.Fade('popup',{duration: 0.1});
	$('flash_bar').show();
	$('popup').remove();
}
