/*
function showFlashVideo(strUnid) {
	// Besorgen aller Parameter für das zu spielende Video und Hit Logging
	initHTTPRequest();
	var sURL = strDBPathVideoWeb + "/WebAjaxVideo?OpenAgent&unid=" + strUnid;
	http_request.onreadystatechange = showFlashVideoStart;
	http_request.open('GET', sURL, true);
	http_request.send(null);
}


javascript:showFlashVideo('')

/WebAjaxVideo?OpenAgent&unid=5DA8B0BD9EC88958C12574AC0031001C

showFlashVideoStart(strUnid)strUnid = "ok###Path###Height###Width###Ttitle"
*/

function showFlashVideoStart(strUnid) {
/*
	var strResponse = "";
	if (http_request.readyState == 4) {
	     if (http_request.status == 200) {
			// Antwort der Ajax Abfrage
         		strResponse = http_request.responseText;
		}
	} else {
		// Antwort ist noch nicht vollständig (Kein Fehler)
		return;
	}
*/
	strResponse = strUnid;

	// Parameter ermitteln
	var arrResponse = strResponse.split("###");
	if (arrResponse[0] != "ok") {
		alert("Beim Laden des Videos ist ein Fehler aufgetreten:\n\n" + strResponse);
		return;
	}
	var videoUrl = arrResponse[1];
	var videoWidth = arrResponse[2];
	var videoHeight = arrResponse[3];
	var videoTitle = arrResponse[4];
	var videoText = arrResponse[5];
	var videoButtons = "";

	var popupWidth = Number(videoWidth);
	if (popupWidth < 400) {popupWidth = 400;}

	var flashParams = 'filetype=swf';
	var shadeborder = 8;
	var divWidth = popupWidth + 40;
	var divHeight = Number(videoHeight) + 62 + 120;
	var shadeWidth = divWidth + 16;
	var shadeHeight = divHeight + 16;

	var elmIFrame = document.getElementById("popupDivIFrame");
	var elmShade = document.getElementById("popupDivShade");
	var elmPopup = document.getElementById("popupDiv");
	var elmContent = document.getElementById("popupDivContent");
	var elmTitle = document.getElementById("popupDivTitle");
	var elmText = document.getElementById("popupDivText");
	var elmButtons = document.getElementById("popupDivButtons");

	var divX = viewportGetWidth() / 2 - divWidth / 2;
	var divY = Math.round( (viewportGetHeight() - divHeight)/3 ) + viewportGetScrollY();

	if (divX < 0) {divX = 0;}
	if (divY < 0) {divY = 0;}

	elmIFrame.style.left = (divX - 0) + "px";
	elmIFrame.style.top = (divY - 0) + "px";
	elmIFrame.style.width = (divWidth + 2) + "px";
	elmIFrame.style.height = (divHeight + 2) + "px";

	elmShade.style.left = (divX - shadeborder) + "px";
	elmShade.style.top = (divY - shadeborder) + "px";
	elmShade.style.width = shadeWidth + "px";
	elmShade.style.height = shadeHeight + "px";

	elmPopup.style.left = divX + "px";
	elmPopup.style.top = divY + "px";
	elmPopup.style.width = divWidth + "px";
	elmPopup.style.height = divHeight + "px";

	document.getElementById("closeButtonPopupDiv").style.left = (divWidth - 18) + "px";
	elmTitle.style.width = divWidth + "px";
	elmTitle.innerHTML = "<div style=\"padding:4px;padding-left:10px;\">" + videoTitle + "</div>";
	elmText.innerHTML = videoText;
	elmButtons.innerHTML = videoButtons;

	elmIFrame.style.display = "block";
	elmPopup.style.display = "block";
	elmShade.style.display = "block";
	elmContent.style.display = "block";

	// Flow Player Aufruffunktion
	 flashembed("popupDivContent",

		/*
			first argument supplies standard Flash parameters. See full list:
			http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701
		*/
		{
			src: '/style/flow_player/FlowPlayerLight.swf',
			width: Number(videoWidth),
			height: Number(videoHeight),
			/* flash player version error handling */
			version: [9,115],
			onFail: function(version)  {
				var strVersion = "";
				if (version = "0,0") {
					strVersion = "You have no Adobe Flash Player installed.";
				} else {
				 	strVersion = "You have version " + version + " installed.";
				}
				return "<div class=\"ErrorMessage\">Adobe Flash Player version " + this.version + " is required.<br><br>" + strVersion + "<br><br><a href=\"http://www.macromedia.com/go/getflashplayer/\">Get the latest flash player here.</a></div>";
			}
			/* flash player version error handling */
		},

		/*
			second argument is Flowplayer specific configuration. See full list:
			http://flowplayer.org/player/configuration.html
		*/
		{config: {
			autoPlay: true,
			showMenu: false,
			controlsOverVideo: 'no',
			controlBarBackgroundColor:'0xe6e6e6',
			initialScale: 'scale',
			videoFile: videoUrl
		}}
	);


}

function closePopupDiv()
{
	document.getElementById("popupDivContent").innerHTML = "<p>&nbsp;</p>";
	document.getElementById("popupDivIFrame").style.display = "none";
	document.getElementById("popupDiv").style.display = "none";
	document.getElementById("popupDivShade").style.display = "none";
}

function viewportGetHeight() {
    var retval = 0;

    if (window.innerHeight)
        retval = window.innerHeight - 18;
    else if (document.documentElement && document.documentElement.clientHeight)
        retval = document.documentElement.clientHeight;
    else if (document.body && document.body.clientHeight)
        retval = document.body.clientHeight;

    return retval;
}

function viewportGetWidth()
{
    var retval = 0;

    if (window.innerWidth)
        retval = window.innerWidth - 18;
    else if (document.documentElement && document.documentElement.clientWidth)
        retval = document.documentElement.clientWidth;
    else if (document.body && document.body.clientWidth)
        retval = document.body.clientWidth;

    return retval;
}

function viewportGetScrollY() {
    var retval = 0;

    if (typeof window.pageYOffset == "number")
        retval = window.pageYOffset;
    else if (document.documentElement && document.documentElement.scrollTop)
        retval = document.documentElement.scrollTop;
    else if (document.body && document.body.scrollTop)
        retval = document.body.scrollTop;
    else if (window.scrollY)
        retval = window.scrollY;

    return retval;
}