
var ie_version;
var ie = navigator.userAgent.toLowerCase().indexOf("msie")>-1 && navigator.userAgent.toLowerCase().indexOf("opera")< 0;
var ie7 = navigator.userAgent.toLowerCase().indexOf("msie 7.")>-1;
if (ie) { ie_version = parseInt (navigator.userAgent.toLowerCase().substr (navigator.userAgent.toLowerCase().indexOf("msie") + 5, 1)); }

/* ---------------------------------------------------------------------------------------------------------------------------------------- */

$(document).ready (function()
{
	$('img.selfbig').each(function()
	{
		$(this).attr ("longdesc", $(this).attr ("src"));
//		$(this).attr ("title",  $("#copyright").html());
	})

	$("img").fullsize(); 
})


/* ---------------------------------------------------------------------------------------------------------------------------------------- */

function OpenWindow (win_href, win_title, win_width, win_height, win_center, with_scrollbars, win_resizable, with_bar)
{

	if (win_height > screen.availHeight - 50)
		win_height = screen.availHeight - 50;

	win_width = win_width - 0;
	if (with_scrollbars == 'true')
	{
		win_width += 20;
	}
	
	var win_flags = "width=" + win_width + ",height=" + win_height;
	win_flags += ",resizable=yes,dependent=yes";
	
	if (with_scrollbars == 'true')
	{
		win_flags += ",scrollbars=yes";
	}
	
	if (win_center)
	{
		var win_left = Math.ceil ((screen.availWidth - win_width) / 2);
		var win_top  = Math.ceil ((screen.availHeight - win_height) / 3);
		win_flags	+= ",left=" + win_left + ",top=" + win_top;
	}
	
	win_flags += ",resizable=" + ((win_resizable == "true") ? "yes" : "no");
	win_flags += ",location=" + ((with_bar == "true") ? "yes" : "no");
	win_flags += ",menubar=" + ((with_bar == "true") ? "yes" : "no");
	win_flags += ",toolbar=" + ((with_bar == "true") ? "yes" : "no");

	window.open (win_href, win_title, win_flags);
}

/* ---------------------------------------------------------------------------------------------------------------------------------------- */

function ImagePopup (image_src, xdim, ydim)
{
	if (!xdim) xdim = 1050;
	if (!ydim) ydim = 550;
	OpenWindow (image_src, "_blank", xdim, ydim, 1, 0, 0, 0);
}