function mediabox(obj) { // shadowboxInitVideoJS
    
    var request = window.XMLHttpRequest ? new XMLHttpRequest : new ActiveXObject('Microsoft.XMLHTTP'); //new ActiveXObject('Msxml2.XMLHTTP'); // try () catch (e) {}
    
    request.onreadystatechange = function() {
        
        if (request.readyState == 4 && request.status == 200) {
            
            var width = 1;
            var height = 1;
            
            //- player set into htmlelement autolaunches on chrome and ie (even if it's disables or hidded) so instead string match used
            //- html element may be used here and width and height set on shadowbox init or used in onfinish and width and height set there
            //- width and/or height may be access by style and/or property
            //- htmlObject.childNodes.item(x).getAttribute('width'); // value or null
            //- htmlObject.childNodes.item(x).style.width; // value or ''
            /*var htmlElement = document.createElement('div');
            htmlElement.innerHTML = request.responseText;
            if (htmlElement.childNodes.length == 1 && htmlElement.childNodes.item(0).nodeName == 'DIV' && htmlElement.childNodes.item(0).id == 'mediabox')
                if (htmlElement.childNodes.item(0).style.width !== '' && htmlElement.childNodes.item(0).style.height !== '') {
                    width = parseFloat(htmlElement.childNodes.item(0).style.width);
                    height = parseFloat(htmlElement.childNodes.item(0).style.height);
                }*/
            
            var matches = request.responseText.match(/id="mediabox"\s*style="([^"]+)"/i);
            if (matches !== null) {
                var widthMatches = matches[1].match(/width:\s*([0-9]+)\s*px/i);
                if (widthMatches !== null)
                    width = parseFloat(widthMatches[1]);
                var heightMatches = matches[1].match(/height:\s*([0-9]+)\s*px/i);
                if (heightMatches !== null)
                    height = parseFloat(heightMatches[1]);
            }
            
            Shadowbox.init({
                skipSetup: true,
                //modal: true,
                //handleOversize: 'none',
                initialWidth: 1, //- can't be 0 otherwise incorrect width on safari/chrome (ie)
                initialHeight: 1 //- can be 0
            });
                    
            Shadowbox.open({
                content: '', //request.responseText,
                player: 'html', //'iframe'
                width: width, //- can't be 0 otherwise initialWidth will be used
                height: height, //- can't be 0 otherwise initialHeight will be used
                options: {
                    onFinish: function() {
                        try {
                            VideoJS.setup('All'); //- required on firefox and opera
                            
                            //- when creating htmlobject with player in innerHTML on chrome it auto launches (even if it's disabled or hidden)
                            document.getElementById('sb-player').innerHTML = request.responseText;
                            
                            VideoJS.setup('All'); //- required on firefox and opera
                            
                            //- VideoJS element isn't rendered as it should on Opera
                            //- changing sizes, visibility, adding dummy div el - doesn't help
                            //- temporary solution but not working on safari is resetting innerHTML (not fault of shadowbox)
                            if (navigator !== undefined && navigator.userAgent !== undefined && navigator.userAgent.match(/opera/i) !== null)
                                document.getElementById('sb-player').innerHTML = document.getElementById('sb-player').innerHTML;
                            
                            //- other way to change dimensions (after shadowbox open and before VideoJS setup):
                            /*Shadowbox.player.width = width;
                            Shadowbox.player.height = height;
                            Shadowbox.skin.onWindowResize(); //- required*/
                            
                        } catch (e) {
                            //alert(e);
                        }
                    }
                }
                 
            });
            //Shadowbox.setup(); //- no needed
        }
        
    };
    
    request.open('GET', obj.href, true);
    request.send();
    /*request.open('POST', 'http://www.halsundbeinbruch.ch/en/mediabox.php', true); // change to dynamic // self.locaiton
    request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');  
    request.send('href=' + escape(obj.href));*/
}
