var jsReady = false; function isJsReady() { return jsReady; } function pageInit() { jsReady = true; } function thisMovie(movieName) { return document.getElementById(movieName); } function changeSceneOnLoad(){ var search = window.location.search; var s = search.substring(1); var arr = s.split("&"); var json = {}; for(var i = 0 ; i < arr.length; i++){ var str = arr[i]; var key=str.split("=")[0]; var value=str.split("=")[1]; json[key.toLowerCase()] = value; } var firstValue = json['firstscene']; var panoid = decodeURI(firstValue); if (panoid !="undefined") { if (thisMovie("sotester").twAPI) { setTimeout(function () {thisMovie("sotester").twAPI("switchToScene", panoid); }, 500); } else { setTimeout(changeSceneOnLoad,1000); } } }