var siteUrl = null;
var sid = null;

// Open a new popup with the specific width and height
function openPopUp(url, width, height)
{
	// Open the new window
	newwindow = window.open(url, 'popup','height='+height+',width='+width+',scrollbars=yes');
	
	// The main-window have the focus => change it
	if (window.focus == true)
	{
		newwindow.focus()
	}
	
	return false;
}

// Show the original image
function showOriginal(url, ourl)
{
	if(document.getElementById("image").src.indexOf(url) != -1)
	{
		document.getElementById("image").src = ourl;
		document.getElementById("originalLink").innerHTML = "(Verfälschtes Bild anzeigen)";
	}
	
	else
	{
		document.getElementById("image").src = url;
		document.getElementById("originalLink").innerHTML = "(Original Bild anzeigen)";
	}
}

// Open an url in the opener window
function loadInOpener(url)
{
	if (window.opener && !window.opener.closed)
	{
		window.opener.document.location.href = url;
		
		return false;
	}
	
	return false;
}