
if(navigator.appName != "Microsoft Internet Explorer")
{

	 // full image template
	function WriteFullImageTemplate(strImageSrc)
	 {
		document.write("<div id=\"full_size_img\" style=\"top:0; left:0; width:100%; overflow:hidden; height:100%; overflow:hidden; text-align:center; position:absolute; vertical-align:middle; background-color:");
		
		if(navigator.appName == "Microsoft Internet Explorer")
			document.write("#003456");
		else
			document.write("rgba(0,25,50,0.6)");
		
		document.write(";display:none\"><a href=\"javascript:HideObject('full_size_img')\"><img src=\""
		+	strImageSrc
		+	"\" border=\"0\" id=\"full_size_img_img\" />"
		+	"<br /><span style=\"font:normal normal normal 10pt arial,sans-serif; color:#fff\">(click to close)</span></a></div>");
	 }

	function ShowFullImage(iID)
	{
		if (res_img_srcs[iID])
		{
			fsizeimg.style.marginTop = (GetPageOffsetY() + 100) + "px";
			
			fsizeimg.src = preload_img.src;
			SetImgSize(preload_img.width, preload_img.height);
			
			document.getElementById("full_size_img").style.display = "block";
			
			img = new Image();
			img.src = res_img_srcs[iID];
			img.onload = ImgLoaded;
			
		}
	}

	// Resizable images
	var res_img_links = document.getElementsByClassName("res_img_link");
	var res_imgs = document.getElementsByClassName("res_img");
	var res_img_srcs = new Array(res_img_links.length);

	var img;
	var fsizeimg;
	var preload_img;

	if ((res_img_links.length > 0) && (res_imgs.length == res_img_links.length))
	{
		preload_img = new Image();
		preload_img.src = "./fileadmin/Images/preload.gif";

		for(var i = 0; i < res_img_links.length; i++)
		{
			res_img_srcs[i] = res_img_links[i].href;
			res_img_links[i].target = "_top";
			res_img_links[i].href = "javascript:ShowFullImage(" + i + ")";
		}
		WriteFullImageTemplate(res_imgs[0].src);
		document.getElementById("full_size_img").style.height = (document.height + 30) + "px";
		fsizeimg = document.getElementById("full_size_img_img");
	}


	function ImgLoaded()
	{
		if (SetImgSize(img.width, img.height))
		{
			fsizeimg.src = img.src;
		}
	}

	 
	function GetPageOffsetY()
	{
		if( typeof( window.pageYOffset ) == 'number' ) {
			return window.pageYOffset;
		} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
			return document.body.scrollTop;
		} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
			return document.documentElement.scrollTop;
		}
	}

	function SetImgSize(iWidth, iHeight)
	{
		var client = GetClientSize();

		var img_width = iWidth;
		var img_height = iHeight;
		var img_tmp;
		
		if ((client[0] - 100) < img_width)
		{
			img_tmp = img_width;
			img_width = (client[0] - 100);
			img_height = img_height / (img_tmp / img_width);
		}
		if ((client[1] - 100) < img_height)
		{
			img_tmp = img_height;
			img_height = (client[1] - 100);
			img_width = img_width / (img_tmp / img_height);
		}
		
		if (img_height == 0 || img_width == 0)
			return false;
		
		fsizeimg.style.width = Math.round(img_width) + "px";
		fsizeimg.style.height = Math.round(img_height) + "px";
		
		return true;
	}

	function GetClientSize() {
		var myWidth = 0, myHeight = 0;
		if( typeof( window.innerWidth ) == 'number' ) {
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
		}
		return new Array(myWidth, myHeight);
	}



	// Lang vis / hide

	// <a href="html.php?modul=HTMLPages&pid=234#current_lang" id="current_link">English</a>
	// <a href="html.php?modul=HTMLPages&pid=234#foreign_lang" id="foreign_link">Another lang</a>
	// (href will be replaced with "javascript:SetLang(true / false);")

	// <a name="current_lang">Hello</a>
	// <a name="foreign_lang">Aloha</a>

	var forlink = document.getElementById("foreign_link");
	var curlink = document.getElementById("current_link");

	
	function SetLang(bPolska)
	{
		if (bPolska)
		{
			document.getElementById(foreign).style.display = "block";
			document.getElementById(current).style.display = "none";
		}
		else
		{
			document.getElementById(foreign).style.display = "none";
			document.getElementById(current).style.display = "block";
		}
	}
	
	if ((forlink != null) || (forlink != null))
	{
		// Anchor names
		var foreign = "foreign_lang"; 
		var current = "current_lang";

		// href replacement
		forlink.href = "javascript:SetLang(false);";
		curlink.href = "javascript:SetLang(true);";

		SetLang(true);
	}


	function MakeVisible(strObject)
	{
		document.getElementById(strObject).style.display = "block";
	}

	function HideObject(strObject)
	{
		document.getElementById(strObject).style.display = "none";
	}

}
