function DeCryptUrl(s)
{
	var n = 0;
	var r = "";
	for (var i=0; i<s.length; i++)
	{
		n = s.charCodeAt(i);
		r += String.fromCharCode(n-3);
	}
	return r;
}
function doDeCryptMail(s)
{
	location.href = DeCryptUrl(s);
}

function imgviewer(url,width,height)
{
	window_height = (height + 140);
	window_width = width;
	window_options = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,left=0,top=0,height='+window_height+',width='+window_width;
	/*window_options = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,left=0,top=0,height=600,width=800';*/
	new_window = window.open(url,'',window_options);
	new_window.focus();
}

/**
* Fenstergröße ändern und Position daran anpassen
*/
function PopupDimensions()
{
	this.resizeTo = function(popup_width, popup_height)
	{
		// Wenn Bildansicht in neuem Tab geöffnet wurde, Größe nicht ändern
		if (typeof window.toolbar != 'undefined' && window.toolbar.visible)
		{
			return false;
		}

		// Fensterrahmen muss bei resizeTo berücksichtigt werden
		if (typeof window.innerWidth != 'undefined')
		{
			popup_width += window.outerWidth - window.innerWidth;
			popup_height += window.outerHeight - window.innerHeight;
		}
		else
		{
			// Schätzung: Internet Explorer mit Windows-XP-Theme
			popup_width += 12;
			popup_height += 82;
		}

		var pos_x = Math.round((screen.availWidth - popup_width) / 2);
		var pos_y = Math.round((screen.availHeight - popup_height) / 4);
		window.moveTo(pos_x, pos_y);

		popup_width = Math.min(screen.availWidth, popup_width);
		popup_height = Math.min(screen.availHeight, popup_height);
		window.resizeTo(popup_width, popup_height);

		// Das Fenster war beim ersten Verschieben vielleicht noch zu groß
		window.moveTo(pos_x, pos_y);
	}

	/**
	* Fenstergröße auf Basis der Bildgröße bestimmen
	*/
	this.resizeToPictureDimensions = function(pic_width, pic_height)
	{
		var popup_width = Math.min(screen.availWidth, Math.max(600, pic_width + 60));
		var popup_height = Math.min(screen.availHeight, pic_height + 20);
		self.resizeTo(popup_width, popup_height);
	}

	var self = this;
}