// Shows big image in a new window
function ShowImage(pImagefile, pHeight, pWidth){
	var iHeight = screen.availHeight * .9;
	var iWidth = screen.availWidth * .8;
	var iLeft = (screen.availWidth/2) - (iWidth/2);
	var iTop = (screen.availHeight/2) - (iHeight/2);
	var sURL = '../Bild.aspx?Image=' + pImagefile + '&Height=' + pHeight + '&Width=' + pWidth;
	winImg = window.open(sURL,'Bild',"width=" + iWidth + ",height=" + iHeight + ",left=" + iLeft + ",top=" + iTop + ",resizable=yes,scrollbars=yes");
	return false;
}

// MaxLength for TextAreas
function MaxLen(pTextArea, pMaxChars){
	if(pTextArea.value.length>=(pMaxChars-1)){
		pTextArea.value=pTextArea.value.substr(0,pMaxChars-1);
	}
}

// Max Image Display Size
function Autosize(pImage, pMaxSize){
	if(pImage.height>pImage.width){
		if(pImage.height>pMaxSize){
			pImage.height=pMaxSize;
		}
	}
	else{
		if(pImage.width>pMaxSize){
			pImage.width=pMaxSize;
		}
	}
}



