{

            function getURLParameter(name) {
                return decodeURIComponent((RegExp('[?|&]' + name + '=' + '(.+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null;
            }

            var mode = getURLParameter('mode') || 'auto';

            stage = new twod.Stage();
            var $twod = $('.twod');
            $twod.css({width: width*scaling, height: height*scaling});
            stage.init($twod, {
                mode: mode,
                width: width,
 