function showBigImage(url, txt) {
	var div = document.createElement("div");

	var img = new Image();
	img.id = "galleryimgsrc";
	img.src = url;
	div.appendChild(gui.galleryBigImage(img, "gallerybigimagesrc"));

	var textdiv = document.createElement("div");
	textdiv.id = "galleryimgdescription";
	textdiv.className = "GalleryPictureDescription";
	textdiv.innerHTML = txt;
	div.appendChild(textdiv);

	new Layer().showContentAsLayer(div, true, ' ', 'bgc_neutral_verlauf_3', null);

}

function BigImageLayer()
{
	var thisObject = this;
	this.pictures = new Array();
	this.index = 0;
	this.picturebrowser = false;
	this.absoluteWidth = true;
	this.type = 1;
	
	this.setAbsoluteWidth = function(_absoluteWidth)
	{
		thisObject.absoluteWidth = _absoluteWidth;
	}
	
	this.setType = function(_type)
	{
		thisObject.type = _type;
	}
	
	this.setPicturebrowser = function(browser)
	{
		thisObject.picturebrowser = browser;
	}
	
	this.addPicture = function(url, text, oid)
	{
		if(url && url.length > 0)
		{
			thisObject.pictures[thisObject.pictures.length] = new Picture(url, text, oid);
	
		}
	}
	
	this.show = function(picture)
	{
		if(picture < thisObject.pictures.length)
		{
			thisObject.index = picture;
			
			if(thisObject.type == 2)
				showTypeTwo();
			else
				showTypeOne();
		}
	}
	
	this.next = function(subtitle)
	{
		thisObject.index++;
		
		var description = thisObject.pictures[thisObject.index].getDescription();
		
		if(description.length > 0)
		{
			document.getElementById("galleryimgdescription").innerHTML = thisObject.pictures[thisObject.index].getDescription();
			document.getElementById("galleryimgdescription").style.display = "block";
		}
		else
		{
			document.getElementById("galleryimgdescription").style.display = "none";
		}
		
		document.getElementById("galleryimgsrc").src = thisObject.pictures[thisObject.index].getUrl();
		
		if(thisObject.picturebrowser)
		{
			var parent = document.getElementById("layerimagepagebrowser").parentNode;
			parent.removeChild(document.getElementById("layerimagepagebrowser"));
			parent.appendChild(thisObject.getPagebrowser(subtitle));
		}
	}
	
	this.previous = function(subtitle)
	{
		thisObject.index--;
		
		var description = thisObject.pictures[thisObject.index].getDescription();
		
		if(description.length > 0)
		{
			document.getElementById("galleryimgdescription").innerHTML = thisObject.pictures[thisObject.index].getDescription();
			document.getElementById("galleryimgdescription").style.display = "block";
		}
		else
		{
			document.getElementById("galleryimgdescription").style.display = "none";
		}
		
		document.getElementById("galleryimgsrc").src = thisObject.pictures[thisObject.index].getUrl();
		
		if(thisObject.picturebrowser)
		{
			var parent = document.getElementById("layerimagepagebrowser").parentNode;
			parent.removeChild(document.getElementById("layerimagepagebrowser"));
			parent.appendChild(thisObject.getPagebrowser(subtitle));
		}
	}
	
	this.getPagebrowser = function(subtitle)
	{
		var result = document.createElement("div");
		result.id = "layerimagepagebrowser";
		
		var tmpdiv = document.createElement("div");
		tmpdiv.id = "line_top_grey_abschluss";
		
		if(ie6())
			tmpdiv.style.marginBottom = "-4px";
		
		result.appendChild(tmpdiv);
		
		var browsercontent = document.createElement("div");
		browsercontent.id = "pageBrowserContent";
		browsercontent.name = "pageBrowserContent";
		
		var scrollbox = document.createElement("div");
		scrollbox.id = "scrollBoxright";
		scrollbox.name = "scrollBoxright";
		
		var tmpbrowser = document.createElement("a");	
		
		if(thisObject.index < 1)
		{
			tmpbrowser.onclick = function(){return false;};
			tmpbrowser.className = "buttonleftgrey";
		}
		else
		{
			tmpbrowser.href = "#";
			tmpbrowser.onclick = function(){thisObject.previous(subtitle); return false;};
			tmpbrowser.className = "buttonleft";
		}
		
		
		scrollbox.appendChild(tmpbrowser);
		
		tmpbrowser = document.createElement("div");
		tmpbrowser.id = "scrollTxtPos";
		tmpbrowser.name = "scrollTxtPos";
		tmpbrowser.className = "navimodultxt1";
		tmpbrowser.appendChild(document.createTextNode("Seite "));
		
		var span = document.createElement("span")
		span.className = "navimodultxt3";
		if(thisObject.index < 9)
			span.appendChild(document.createTextNode("0" + (thisObject.index+1)));
		else
			span.appendChild(document.createTextNode((thisObject.index+1)));
		
		tmpbrowser.appendChild(span);
		tmpbrowser.appendChild(document.createTextNode(" von "));
		
		span = document.createElement("span")
		span.className = "navimodultxt2";
		if(thisObject.pictures.length < 9)
			span.appendChild(document.createTextNode("0" + thisObject.pictures.length));
		else
			span.appendChild(document.createTextNode(thisObject.pictures.length));
		
		tmpbrowser.appendChild(span);
		scrollbox.appendChild(tmpbrowser);
		
		tmpbrowser = document.createElement("a");		
		
		if(thisObject.index == (thisObject.pictures.length - 1))
		{
			tmpbrowser.onclick = function(){return false;};
			tmpbrowser.className = "buttonrightgrey";
		}
		else
		{
			tmpbrowser.href = "#";
			tmpbrowser.onclick = function(){thisObject.next(subtitle); return false;};
			tmpbrowser.className = "buttonright";
		}
		
		scrollbox.appendChild(tmpbrowser);
		
		//svog2407: Wenn ein Titel als Argument übergeben wurde
		if (subtitle != null) {  
			var boxleft = document.createElement("div");
			boxleft.className = "navimodultxt1";
			boxleft.style.paddingTop = "4px";
			boxleft.style.width = "300px";
			boxleft.style.verticalAlign = "middle";
			boxleft.style.cssFloat = "left";
			boxleft.style.styleFloat = "left";
			boxleft.appendChild(document.createTextNode(arguments[0]));
			browsercontent.appendChild(boxleft);
		}
		
		browsercontent.appendChild(scrollbox);
		
		tmpdiv = document.createElement("div");
		tmpdiv.id = "galleryPageBrowser";
		tmpdiv.className = "pageBrowser";
		tmpdiv.style.width = "auto";
		tmpdiv.appendChild(browsercontent);
		result.appendChild(tmpdiv);
		
		tmpdiv = document.createElement("div");
		tmpdiv.id = "line_red_footer";
		tmpdiv.style.width = "auto";
		result.appendChild(tmpdiv);
		
		return result;
	}
	
	var showTypeOne = function()
	{
		var div = document.createElement("div");
		
		if(thisObject.absoluteWidth)
		{
			div.style.width = "542px";		
			div.style.overflow = "hidden";
		}
		
		var img = new Image();
		img.id = "galleryimgsrc";
		img.src = thisObject.pictures[thisObject.index].getUrl();
		div.appendChild(gui.galleryBigImage(img, "gallerybigimagesrc"));

		var textdiv = document.createElement("div");
		textdiv.className = "GalleryPictureDescription";
		
		var textspan = document.createElement("span");
		textspan.id = "galleryimgdescription";
		textspan.innerHTML = thisObject.pictures[thisObject.index].getDescription();			
		textdiv.appendChild(textspan);
		
		div.appendChild(textdiv);
		
		if(thisObject.picturebrowser)
			div.appendChild(thisObject.getPagebrowser());
		
		var layer = new Layer();
		if(thisObject.picturebrowser)
			layer.setRedline(false);
		layer.showContentAsLayer(div, true, ' ', 'bgc_neutral_verlauf_3', null);
	}
	
	var showTypeTwo = function()
	{
		var layer = new Layer();
		layer.setFading(false);
		
		var div = document.createElement("div");
		div.style.position = "relative";
		
		var img = new Image();
		img.id = "galleryimgsrc";
		img.src = thisObject.pictures[thisObject.index].getUrl();
		img.onclick = layer.close;
		img.style.cursor = "pointer";
		div.appendChild(img);
		
		img = new Image();
		img.id = "close";
		img.src = /*VIPURL*/ "/Global/Pictures/btn_close.gif";
		img.style.position = "absolute";
		img.style.cursor = "pointer";
		img.style.top = "10px";
		img.style.left = "10px";
		img.onclick = layer.close;
		div.appendChild(img);
		
		layer.showContentAsLayer(div, false, null, 'bgc_neutral_verlauf_3', null);
	}
}

function Picture(urll, descriptionl, oidl)
{
	var url = urll;
	var description = descriptionl;
	var oid = oidl
	
	this.getUrl = function()
	{
		return url;
	}
	
	this.getDescription = function()
	{
		return description;
	}
	
	this.getOid = function()
	{
		return oid;
	}
}