function startDemo() {
	//window.open("/onlinedemo/deutsch/demostart.htm", "OnlineDemo", "width=1024,height=768,hotkeys=no,menubar=no,statusbar=no,toolbar=no,resizable=yes,directories=no,location=no", true);
	window.open("/onlinedemo/deutsch/demostart.htm", "OnlineDemo", "width=860,height=580,hotkeys=no,menubar=no,statusbar=no,toolbar=no,resizable=yes,directories=no,location=no", true);
}
function startVideo(videofile) {
	window.open("/media/files/demo-videos/VideoFlex.html?videosource="+videofile.toString(), "OnlineDemo", "width=1024,height=576,hotkeys=no,menubar=no,statusbar=no,toolbar=no,resizeable=yes,directories=no,location=no", true);
}

function imagePopup(callingId, imgSrc, imgWidth, imgHeight, offsetX, offsetY) {
	if (typeof(offsetX) == 'undefined') { offsetX = 20; }
	if (typeof(offsetY) == 'undefined') { offsetY = -40; }
	if (typeof(imgWidth) == 'undefined') { imgWidth = 0; }
	if (typeof(imgHeight) == 'undefined') { imgHeight = 0; }
	popupImageId = 'popupImage'+callingId;
	if (document.getElementById(popupImageId)) {
		document.getElementById(popupImageId).style.display = 'block';
		return false;
	}
	// find position of calling element
	callingElem = document.getElementById(callingId);
    var obj = callingElem;
    var curleft = curtop = 0;
    if (obj.offsetParent) {
        curleft = obj.offsetLeft
        curtop = obj.offsetTop
        //alert(obj.tagName+": offsetLeft="+obj.offsetLeft+", offsetTop="+obj.offsetTop);
        while (obj = obj.offsetParent) {
            curleft += obj.offsetLeft
            curtop += obj.offsetTop
            //alert(obj.tagName+": offsetLeft="+obj.offsetLeft+", offsetTop="+obj.offsetTop);
        }
    }
    //alert("curleft="+curleft+", curtop="+curtop+", offsetX="+offsetX+", offsetY="+offsetY);
	divleft = curleft + offsetX;
	if (divleft < 0) { divleft = 0; }
	divtop = curtop + offsetY;
	if (divtop < 0) { divtop = 0; }

	var newdiv = document.createElement("div");
	newdiv.id = popupImageId;
	newdiv.style.position = 'absolute';
	newdiv.style.left = divleft+'px';
	newdiv.style.top = (divtop-imgHeight)+'px';
	newdiv.style.background = '#ffffff';
	newdiv.style.border = '1px solid #dddddd';
	newdiv.style.padding = '10px';
	newdiv.style.zIndex = '199';
	newdiv.style.display = 'block';
	//html = '<div id="'+popupImageId+'" style="position:absolute; left:'+divleft+'px; top:'+(divtop-imgHeight)+'px; ';
	//html += 'background:#ffffff; border:1px solid #dddddd; padding:10px; z-index: 199; display:block;">';
	html = '<img src="'+imgSrc+'" id="'+popupImageId+'Image" border="0"';
	if (imgWidth > 0) { html += ' width="'+imgWidth+'"'; }
	if (imgHeight > 0) { html += ' height="'+imgHeight+'"'; }
	html += ' onclick="document.getElementById(\''+popupImageId+'\').style.display=\'none\';">';
	//html += '</div>';
	newdiv.innerHTML = html;
	//callingElem.parentNode.innerHTML = callingElem.parentNode.innerHTML + html;
	callingElem.parentNode.appendChild(newdiv);

	return false;
}

function infoPopup(url) {
	if (url.indexOf("?") > -1) { url = url + "&layout=popup"; }
	else { url = url + "?layout=popup"; }
	popupwin = window.open(url,"_blank","width=696,height=740,status=no,scrollbars=yes,resizable=no,menubar=no");
	popupwin.focus();
	return false;
}
