var plugin = null; var v3dBox = null; var v3dIsInit = false; var infoBox = null; var infoshowbx = null; var infolinkbx = null; var chatbx = null; var chattype = "public"; var chatreceiver = null; var userlistbx = null; var appbx = null; var messagebx = null; var forumbx = null; var menubx = null; VTC_OK = 0x0000; VTC_ERROR = 0x0001; VTC_USERALREADYPRESENT = 0x0100; VTC_NOSESSION = 0x0109; VTC_USERNOTREGISTERED = 0x010a; VTC_BADNAME = 0x010b; VTC_NAMENOTRESERVED = 0x010c; VTC_AUTHFAILED = 0x010d; var g_username = ""; var g_password = ""; var g_avatar = ""; var g_virtuocity_session_id = ""; var cp = new cpaint(); cp.set_response_type('text'); cp.set_persistent_connection(true); cp.set_debug(0); function response(result) { // alert("we have a response: "+result); } function storeVirtuocitySessionId(sid) { cp.call('ajax_server.php', 'storeVirtuocitySessionId_wf', response, g_virtuocity_session_id); } function createxmlhttp() { var xmlhttp=false; try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp = new XMLHttpRequest(); } return xmlhttp; } function globalEval(code) { if(dojo.isIE) window.execScript(code, "javascript"); else window.eval(code); } function include(scriptname) { var xhr = createxmlhttp(); xhr.open("GET", scriptname, false); xhr.send(null); if (xhr.readyState!=4 || xhr.status!=200) { s = "Couldn't include scriptname"; throw s; } globalEval(xhr.responseText); } include("includes/js/xmlrpc_decoder.js"); include("includes/js/xmlrpc.js"); function js2py_async() { var msg = new XMLRPCMessage(arguments[0]); for (var k=1; k maxChatHistoryLength) chatHistory.shift(); } function PublicChat() { chattype = "public"; SetChat(); } function PrivateChat(receiver) { chattype = "private"; chatreceiver = receiver; SetChat(); } //------ Chat box interface -------- //------ UserList box interface -------- function RegisterUserList(b) { userlistbx = b; SetChat(); } function UnregisterUserList(b) { userlistbx = null; } //------ uses ------ function ChatToUser(user) { PrivateChat(user); } function ChatToAll() { PublicChat(); } function JumpToUser(user) { if (plugin) plugin.jumpTo(user); else no_v3dbox_complain(); } //------ UserList box interface -------- //------ uses ------ function MapElementClicked(cat, elem) { switch(cat) { case "users": PrivateChat(elem); if (userlistbx) userlistbx.TargetChatUser(elem); break; case "links": if (infolinkbx && infoshowbx) { url = infolinkbx.GetMapElementURL(cat, elem); if (url) infoshowbx.ShowURL(url.location,url.target); } break; case "cameras": jumpTo(elem); break; case "forum": if (infolinkbx && forumbx) { topic_id = infolinkbx.GetMapElementTopicID(cat, elem); if (topic_id) forumbx.ShowTopic(topic_id); } } } //------ V3D box interface -------- function RegisterV3D(b, p) { v3dBox = b; plugin = p; } function UnregisterV3D(b) { v3dbox = null; } function no_v3dbox_complain() { alert("no v3d box registerd"); } //------ provides ------ function setViewType(viewType) { if (plugin) plugin.setViewType(viewType); else no_v3dbox_complain(); } function enterGameMode() { if (plugin) plugin.enterGameMode() else no_v3dbox_complain(); } function jumpTo(location) { if (plugin) plugin.jumpTo(location); else no_v3dbox_complain(); } function sayToAll(text) { if (plugin) plugin.sayToAll(text); else no_v3dbox_complain(); } function sayTo(receiver,text) { if (plugin) plugin.sayTo(receiver,text); else no_v3dbox_complain(); } function WhoIsHere() { if (plugin) return plugin.whoIsHere(); else return ""; } function whoAmI() { if (plugin) return plugin.whoAmI(); else no_v3dbox_complain(); } function clientToServerEvent(param) { if (plugin) plugin.clientToServerEvent(param); else no_v3dbox_complain(); } function getAttention(who) { if (plugin) plugin.getAttention(who); else no_v3dbox_complain(); } function whereAmI() { if (plugin) return plugin.whereAmI(); else no_v3dbox_complain(); } function logout(keep) { if (plugin) return plugin.logout(keep); else no_v3dbox_complain(); } function setOSDChat(en) { if (plugin) return plugin.OSDChat = en; else no_v3dbox_complain(); } function UserExistsError() { top.document.location = "login.php?nameExists="; } function ResetToLogin() { top.document.location = "login.php?nameExists="; } // ----- event handler ----- handlerList = new Array(); function addPickedObjectHandler(functionName) { handlerList.push(functionName); } function removePickedObjectHandler(functionName) { for (i = 0; i0) { plugin.resumeRequest(g_username, g_virtuocity_session_id); } else { plugin.loginRequest(g_username, g_password, g_avatar); } } function addMaps() { plugin.addMap("overzichtTilburg.jpg",-7670.9,-4692.4,-500,16837.7,13086.3,5000,0,0); plugin.addMap("overzichtTilburgBinnenring.jpg",-1210,-3130.6,-500,5162.16,4011.36,3600,0,0); plugin.addMap("overzichtTilburgCityring_Sm.jpg",1277.22,-2097.44,-500,1542.34,1200.29,3600,0,0); plugin.addMap("overzichtTilburgCityring_Lg.jpg",1277.22,-2097.44,-500,1542.34,1200.29,3600,0,0); plugin.addMap("tilburg_kruidenbuurt.jpg",30.048,-151.168,-500,242.074,182.028,5000,75,0); plugin.addMap("tilburg_groeseind.jpg",2117.1,-105.975,-500,360,555,5000,15.781,0); plugin.addMap("tilburg_vossenberg.jpg",-5775.43,2417.79,-500,2082.65,2082.65,5000,0,0); plugin.addMap("wilh_sluizen.jpg",-5546.98,3272.13,-500,5908.63,1034.01,5000,-31.07,0); plugin.addMap("masterplan_spoorzone.jpg",1373.93,-1122.19,-500,1221.1,439.208,5000,-7.735,0); plugin.add("cameras","Stadhuisplein_Heuvelstraat",2222,-1657,21,0.35); plugin.add("cameras","Spoorlaan",1923,-1131,21,0.001); plugin.add("cameras","PieterVreedeplein",2257,-1435,21,0.1); plugin.add("cameras","Heuvel_Heuvelstraat",2368,-1505,21,10); plugin.add("cameras","Stadhuisplein",2056,-1826,21,0.001); plugin.add("cameras","Paleisring",2342,-1720,21,0.35); plugin.add("cameras","Heuvel_Heuvelring",2471,-1499,21,10); plugin.add("cameras","Heuvel",2440,-1415,21,0.001); plugin.add("cameras","Koningsplein",2281,-1918,21,0.35); plugin.add("cameras","Monumentstraat",2077,-1708,21,0.35); plugin.add("cameras","Spoorlaan_Heuvelring",2487.56,-1200.54,21,0.35); plugin.add("cameras","Spoorlaan_Noordhoekring",1559,-1145.5,21,0.35); plugin.add("cameras","Spoorlaan_Willem_II_straat",2172,-1201,21,0.35); plugin.add("cameras","Heuvelstraat",2268.11,-1531.29,21,0.35); plugin.add("cameras","lage_witsiebaan",73.626,56.449,-3.764,1); plugin.add("cameras","sepiastraat",-74.839,-25.399,-3.764,0.01); plugin.add("cameras","birdv_flycam01",2009.26,-1216.91,21.43,0.001); plugin.setElementIcon("cameras","birdv_flycam01","i_ballon-blauw.png"); plugin.add("cameras","birdv_flycam02",1515.95,-734.874,21.43,0.001); plugin.setElementIcon("cameras","birdv_flycam02","i_ballon-blauw.png"); plugin.add("cameras","birdv_flycam03",2544.33,-1539.14,21.43,0.001); plugin.setElementIcon("cameras","birdv_flycam03","i_ballon-blauw.png"); plugin.add("cameras","wagenwerkplaats_draaischijf",1863.76,-1049.99,21,0.001); plugin.add("cameras","wagenwerkplaats",2327.16,-1023.75,21,0.001); plugin.add("cameras","entree_wwp",2516.25,-1010.27,19.154,0.001); plugin.add("cameras","spoorzone_02",1520.03,-976.15,19.154,0.001); plugin.add("cameras","jump_piushaven",3100.47,-2008.31,15.935,0.001); plugin.add("cameras","cam_groeseind",2248.1,74.574,2,0.001); plugin.add("cameras","cam_wilhelminakanaal_sluizen",-1535.2,1261.43,26.5558,0.001); plugin.add("cameras","sluis_situaties_02",-1919.74,1365.3,26.556,0.001); plugin.add("cameras","sluis_situaties_01",-2822.58,1880.65,26.556,0.001); plugin.add("cameras","sluis_situaties_03",-3708.33,2525.54,26.556,0.001); plugin.add("cameras","sluis_situaties_04",-4347.41,2810.02,26.556,0.001); plugin.add("cameras","bv_wilhelminakanaal_sluis",-2628.66,2622.44,67.94,0.001); plugin.setElementIcon("cameras","bv_wilhelminakanaal_sluis","i_ballon-blauw.png"); plugin.add("cameras","jump_veemarktkwartier",2761.94,-1351.86,19.0547,0.001); plugin.add("cameras","jump_ttuin_5str",1801.31,-1460.82,16.5753,0.001); plugin.add("cameras","jump_stationstraat",1974.47,-1598.92,16.0811,0.001); plugin.add("cameras","jump_piushaven_begin",2586.43,-2004.42,15.8705,0.001); plugin.add("cameras","jump_noordhoekring",1524.92,-1431.77,16.3037,0.001); plugin.add("cameras","jump_vvgrt_zomerstr",1726.14,-1722.99,17,0.001); plugin.add("cameras","jump_vvgrt_lievevrouweplein",1632.61,-1928.26,15.83,0.001); plugin.add("cameras","wilhelminakanaal_cam",-5454.29,3465.46,16.721,0.001); plugin.add("cameras","birdview_vossenberg",-5654.24,3159.19,207.92,0.001); plugin.setElementIcon("cameras","birdview_vossenberg","i_ballon-blauw.png"); plugin.add("cameras","cam_koepelhal",2508.33,-1149.76,15.335,0.001); plugin.add("cameras","cam_wagenwerkplaats",2026.12,-928.467,5.335,0.001); plugin.add("cameras","leeuwerik_03",-5182.37,2755.03,4.427,0.001); plugin.setElementIcon("cameras","leeuwerik_03","i_voetjes-blauw.png"); plugin.add("cameras","leeuwerik_02",-5082.21,2943.08,4.427,0.001); plugin.setElementIcon("cameras","leeuwerik_02","i_voetjes-blauw.png"); plugin.add("cameras","leeuwerik_01",-5002.16,3097.72,4.427,0.001); plugin.setElementIcon("cameras","leeuwerik_01","i_voetjes-blauw.png"); plugin.add("cameras","bv_wilhelminakanaal_havengebied02",-5247.97,3633.45,77,0.001); plugin.setElementIcon("cameras","bv_wilhelminakanaal_havengebied02","i_ballon-blauw.png"); plugin.add("cameras","bv_wilhelminakanaal_havengebied01",-5413.78,3288.32,103.45,0.001); plugin.setElementIcon("cameras","bv_wilhelminakanaal_havengebied01","i_ballon-blauw.png"); plugin.add("links","NS website",1917.31,-1125.7,13.8721,0.16663); plugin.add("links","interpolis",2724.08,-1312.08,13.8762,0.400041); // Set forum icon plugin.setIcon("forum", "i_forum.png"); plugin.setIcon("links", "i_info.png"); plugin.setIcon("users", "i_users.png"); plugin.setIcon("cameras", "i_camera.png"); plugin.setIcon("user", "i_user.png"); } function loginAccept(sessionId, id) { g_virtuocity_session_id = sessionId; storeVirtuocitySessionId(g_virtuocity_session_id); addMaps(); if (userlistbx) userlistbx.Rebuild(); if (appbx) appbx.Start(); v3dIsInit = true; } function resumeAccept(sessionId, id) { g_virtuocity_session_id = sessionId; storeVirtuocitySessionId(g_virtuocity_session_id); addMaps(); if (userlistbx) userlistbx.Rebuild(); if (appbx) appbx.Resume(); v3dIsInit = true; } function PickedObject(node) { // fire handlers for (i=0; i