﻿/*
    js/misc.js                  2007-10-25  (c) e.sens.e GmbH
*/


function elementIsClass(e, className)
{
    if (e.className)
        return (e.className.search(
            new RegExp("\\b" + className + "\\b")) != -1);
    return false;
}

function elementAddClass(e, className)
{
    if (!elementIsClass(e, className))
        e.className += (" " + className);
}

function elementRemoveClass(e, className)
{
    e.className = e.className.replace(new RegExp("(\\b|\\s+)" + className +
        "(\\b|\\s+)"), "");
}

function elementGetChildNodesByClassName(e, className)
{
    var children = Array();
    for (i = 0; i < e.childNodes.length; i++)
        if (elementIsClass(e.childNodes[i], className))
            children[children.length] = e.childNodes[i];
    return children;
}



function xxl_popup(url)
{

window.scrollTo(0, 0);

element = document.getElementById('xxl_popup');
element.style.display = 'block';

element2 = document.getElementById('xxl_popup_inner');
element2.innerHTML = '<object classid="CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000" id="videoplayer" width="700" height="594"><param name="allowScriptAccess" value="sameDomain" /><param name="swliveconnect" value="true" /><param name="movie" value="'+url+'&shdow=../img/media/9c96639953ebe17e35ea14b8627dbd4e.swf" /><embed src="'+url+'&shdow=../img/media/9c96639953ebe17e35ea14b8627dbd4e.swf" type="application/x-shockwave-flash" width="700" height="594" id="videoplayer" name="videoplayer" swLiveConnect="true" allowScriptAccess="sameDomain"></embed></object>';

}


function xxl_popup_close(url)
{

element = document.getElementById('xxl_popup');
element.style.display = 'none';

}


var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
//alert (isInternetExplorer);
// Verarbeiten aller FSCommand-Meldungen in einem Flash-Film
function videoplayer_DoFSCommand(command, args) {
	var videoplayerObj = isInternetExplorer ? document.all.videoplayer : document.videoplayer;
	if (command=="xxl_popup") {
		alert(args);
	}
}
// Hook für Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub videoplayer_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call videoplayer_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}
