var IsPopUp = false;
var InMultiline = false;

function CatchKeyPress(KeyCode, Sender)
{ 
	if (event.keyCode == 27)
		event.returnValue = false;
	else if ((event.keyCode == 13) && !InMultiline) {
		if (Sender.id == "myHeaderWithPath_txtPassword") {
			myHeaderWithPath_btnLogin_lnkCenter.click();
		} else {
			event.keyCode = 9;
		}
	}
}

var ImageWidth
var ImageHeight
var ImageTitle
var ImageURL

function ShowLargeImage() {
	window.open("DisplayPicture.aspx?PicTitle=" + ImageTitle.replace("'","\'") + "&PicURL=" + ImageURL,"","width=" + ImageWidth + ",height=" + ImageHeight);	
}

function DisplayPicture(PicTitle,PicURL,picWidth,picHeight) {
	if (IsPopUp) {
		window.open("DisplayPicture.aspx?PicTitle=" + PicTitle.replace("'","\'") + "&PicURL=" + PicURL,"","width=" + picWidth + ",height=" + picHeight);
	} else {
		ImageWidth = picWidth;
		ImageHeight = picHeight;
		ImageTitle = PicTitle;
		ImageURL = PicURL;
		document.getElementById('trPictureRow').height = Math.floor(300*picHeight/picWidth);
		document.getElementById('imageArea').innerHTML = "<IMG border='0' src='.element/2.1/lindehoeve/Afbeeldingen-lindehoeve/patience.gif' alt='Even geduld ...' width='107' height='25'>"
		imagetoload = new Image();
		imagetoload.src = PicURL;
		var NewHTML = "document.getElementById('imageArea').innerHTML = \"<a href='javascript:ShowLargeImage()'><IMG border='0' src='" + PicURL + "' alt='" + PicTitle + "' width='300' height='" + Math.floor(300*picHeight/picWidth) + "'></a>\"";
		setTimeout(NewHTML,500);
	}
}