var mailregex = /^[0-9a-zA-Z][0-9a-zA-Z\._-]*@([0-9a-zA-Z-_]+\.)+([a-z]{2,6})$/;
var dateregex = /^[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{4}$/;
var numregex = /^[0-9]+$/;

function popupNormal(sUrl, sWidth, sHeight)
{
	var popup;

	popup = window.open(sUrl, 'PressRelease','toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars=yes,screenX=10,screenY=10,resizable=yes,width=' + sWidth + ',height=' + sHeight, true);
	if(navigator.appName.indexOf('Netscape') != -1)
		popup.focus();
}

function popupHelp(sUrl, sWidth, sHeight)
{
	var popup;

	popup = window.open(sUrl, 'PressRelease','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,screenX=10,screenY=10,resizable=yes,width=' + sWidth + ',height=' + sHeight, true);
	if(navigator.appName.indexOf('Netscape') != -1)
		popup.focus();
}

function popupPicture(sUrl, sWidth, sHeight)
{
	var popup;
	//var sWidth=sWidth+10;
	//var sHeight=sHeight+10;
	
	popup = window.open(sUrl, 'PictureViewer','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,screenX=10,screenY=10,resizable=yes,width=' + sWidth + ',height=' + sHeight, true);
	if(navigator.appName.indexOf('Netscape') != -1)
		popup.focus();
}

function printpage() {
	if (window.print)
		window.print();
	else
		alert("Leider unterstützt Ihr Browser diese Funktion nicht. Bitte aktivieren Sie die Druckfunktion Ihres Browsers manuell.");
}

function hide_selfreferring() {
	link = document.getElementById('self_referring_link');
	if (link) {
		link.parentNode.innerHTML = link.innerHTML;
	}
}

function centerScroller(href) {
	tmp = $('#scrolltable td');
	if (tmp.length < 8) return;
	// center active image
	img = $('#scroll_content a[href*='+href+']');
	v = (img.position().left+img.width()/2-$('#scroll_container').width()/2) *-1; // value
	cV = ($('#scroll_content').width()-$('#scroll_container').width()) *-1; // checkValue - stay within borders
	v=(v>0)?0:(v<cV)?cV:v;
	objScroller.MoveArea(v,0);	
}
