{"id":734,"date":"2015-10-01T12:06:11","date_gmt":"2015-10-01T12:06:11","guid":{"rendered":"http:\/\/www.cagliarimeteo.it\/?page_id=734"},"modified":"2015-10-01T12:17:11","modified_gmt":"2015-10-01T12:17:11","slug":"webcam2","status":"publish","type":"page","link":"https:\/\/www.cagliarimeteo.it\/?page_id=734","title":{"rendered":"webcam2"},"content":{"rendered":"<p><script type=\"text\/javascript\">\/\/ <![CDATA[\n  var height_array = new Array();\n  var width_array = new Array();\n  width_array[1] = 640;\n  height_array[1] = 400;\n\/\/ ]]><\/script><\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" id=\"webcam1\" class=\"webcam\" src=\"https:\/\/i0.wp.com\/www.cagliarimeteo.it\/loading.jpg?resize=474%2C296\" alt=\"Live Stream\" width=\"474\" height=\"296\" \/><\/p>\n<p><script type=\"text\/javascript\">\/\/ <![CDATA[\ncurrentCamera1= 1;\nerrorimg1= 0;\nDoIt1();\ndocument.images.webcam1.onload = DoIt1();\ndocument.images.webcam1.onerror = ErrorImage1();\nfunction LoadImage1()\n{\n        uniq1 = Math.random();\n        document.images.webcam1.src = \"http:\/\/www.cagliarimeteo.it:8080\/cam_\" + currentCamera1 + \".jpg?uniq=\"+uniq1;\n        document.images.webcam1.onload = DoIt1;\n}\nfunction PTZMouseDown1(e)\n{\n        var IE = document.all?true:false;\n        var x,y;\n        var myx,myy;\n        var myifr = document.getElementById(\"_iframe-ptz\");\n        tp = getElPos1();\n        myx = tp[0];\n        myy = tp[1];\n        if(IE){\n        var scrollX = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft;\n        var scrollY = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;\n        x = event.clientX - myx + scrollX;\n        y = event.clientY - myy + scrollY;\n        } else {\n        x = e.pageX - myx;\n        y = e.pageY - myy;\n        }\n        if ((width_array[currentCamera1] != null) &#038;&#038; (width_array[currentCamera1] > 0)) x = Math.round((x * 400) \/ width_array[currentCamera1]);\n        if ((height_array[currentCamera1] != null) && (height_array[currentCamera1] > 0)) y = Math.round((y * 300) \/ height_array[currentCamera1]);\n        if (x > 400) x = 400;\n        if (y > 300) y = 300;\n        if (myifr != null) myifr.src = \"http:\/\/www.cagliarimeteo.it:8080\/ptz?src=\" + currentCamera1 + \"&moveto_x=\" + x + \"&moveto_y=\" + y +\"\";\n        return true;\n}\nfunction getElPos1()\n{\n            el = document.images.webcam1;\n            x = el.offsetLeft;\n            y = el.offsetTop;\n            elp = el.offsetParent;\n            while(elp!=null)\n              { x+=elp.offsetLeft;\n                y+=elp.offsetTop;\n                elp=elp.offsetParent;\n              }\n            return new Array(x,y);\n}\nfunction ErrorImage1()\n{\n        errorimg1++;\n        if (errorimg1>3){\n              document.images.webcam1.onload = \"\";\n              document.images.webcam1.onerror = \"\";\n              document.images.webcam1.src = \"offline.jpg\";\n              }else{\n                uniq1 = Math.random();\n            document.images.webcam1.src = \"http:\/\/www.cagliarimeteo.it:8080\/cam_\" + currentCamera1 + \".jpg?uniq=\"+uniq1;\n              }\n}\nfunction DoIt1()\n{\n        errorimg1=0;\n        window.setTimeout(\"LoadImage1();\", 40);\n}\n\/\/ ]]><\/script><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"jetpack_post_was_ever_published":false,"footnotes":""},"class_list":["post-734","page","type-page","status-publish","hentry"],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/P4FBQG-bQ","jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.cagliarimeteo.it\/index.php?rest_route=\/wp\/v2\/pages\/734","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cagliarimeteo.it\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.cagliarimeteo.it\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.cagliarimeteo.it\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cagliarimeteo.it\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=734"}],"version-history":[{"count":4,"href":"https:\/\/www.cagliarimeteo.it\/index.php?rest_route=\/wp\/v2\/pages\/734\/revisions"}],"predecessor-version":[{"id":738,"href":"https:\/\/www.cagliarimeteo.it\/index.php?rest_route=\/wp\/v2\/pages\/734\/revisions\/738"}],"wp:attachment":[{"href":"https:\/\/www.cagliarimeteo.it\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}