3 include("includes.php");
4 include("xml2array.php");
9 <script type="text/javascript" src="/include/java/prototype.js"></script>
10 <script type="text/javascript" src="/include/java/scriptaculous.js?load=effects"></script>
11 <script type="text/javascript" src="/include/java/lightbox.js"></script>
13 <link rel="stylesheet" href="/include/css/lightbox.css" type="text/css" media="screen" />
15 <script type="text/javascript">
17 /***********************************************
18 * Dynamic Ajax Content- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
19 * This notice MUST stay intact for legal use
20 * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
21 ***********************************************/
23 var bustcachevar=0 //bust potential caching of external pages after initial request? (1=yes, 0=no)
25 var rootdomain="http://"+window.location.hostname
26 var bustcacheparameter=""
28 function ajaxpage(url, containerid){
29 //alert("updating page");
30 var page_request = false
31 if (window.XMLHttpRequest) // if Mozilla, Safari etc
32 page_request = new XMLHttpRequest()
33 else if (window.ActiveXObject){ // if IE
35 page_request = new ActiveXObject("Msxml2.XMLHTTP")
39 page_request = new ActiveXObject("Microsoft.XMLHTTP")
46 page_request.onreadystatechange=function(){
47 loadpage(page_request, containerid)
49 if (bustcachevar) //if bust caching of external page
50 bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
51 page_request.open('GET', url+bustcacheparameter, true)
52 page_request.send(null)
55 function resize(which, max) {
56 var elem = document.getElementById(which);
57 if (elem == undefined || elem == null) return false;
58 if (max == undefined) max = 100;
59 if (elem.width > elem.height) {
60 if (elem.width > max) elem.width = max;
62 if (elem.height > max) elem.height = max;
67 function getPixelsFromTop(obj){
68 objFromTop = obj.offsetTop;
69 while(obj.offsetParent!=null) {
70 objParent = obj.offsetParent;
71 objFromTop += objParent.offsetTop;
78 function resizeheight(height,width) {
79 screen_title=parseInt(title.offsetHeight);
81 full_height=parseInt(fullheight.offsetHeight);
82 screen_height=screen_title+screen_menubar+parseInt(height);
83 if (screen_height>full_height) {
84 //newheight=(full_height-(screen_title+screen_menubar));
85 contentTopDiv = document.getElementById("contenttop")
86 contentBotDiv = document.getElementById("contentbottom")
87 contentTop = getPixelsFromTop(contentTopDiv);
88 contentBottom = getPixelsFromTop(contentBotDiv);
89 contentHeight = contentBottom - contentTop;
91 //alert("The cell height is " + contentHeight);
93 newheight=contentHeight;
95 percentage=newheight/height;
96 newwidth=parseInt(width*percentage);
97 var security = document.getElementById('security');
98 security.style.width=newheight+"px";
99 security.style.height=newwidth+"px";
100 //security.style.width=newheight;
101 //security.style.height=newwidth;
102 //alert(newwidth+" "+newheight);
104 //alert("not resizing height");
110 function insteon(url) {
111 var page_request = false
112 if (window.XMLHttpRequest) // if Mozilla, Safari etc
113 page_request = new XMLHttpRequest()
114 else if (window.ActiveXObject){ // if IE
116 page_request = new ActiveXObject("Msxml2.XMLHTTP")
120 page_request = new ActiveXObject("Microsoft.XMLHTTP")
127 if (bustcachevar) //if bust caching of external page
128 bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
129 page_request.open('GET', url+bustcacheparameter, true)
130 page_request.send(null)
134 function sillytimeout() {
135 ajaxpage('check_isy99i_status.php', 'contentarea');
138 function update_isy99() {
139 var t=setTimeout("sillytimeout()", 10000);
142 function loadpage(page_request, containerid){
143 if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
144 document.getElementById(containerid).innerHTML=page_request.responseText;
148 if (!document.getElementById)
150 for (i=0; i<arguments.length; i++){
151 var file=arguments[i]
153 if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
154 if (file.indexOf(".js")!=-1){ //If object is a js file
155 fileref=document.createElement('script')
156 fileref.setAttribute("type","text/javascript");
157 fileref.setAttribute("src", file);
159 else if (file.indexOf(".css")!=-1){ //If object is a css file
160 fileref=document.createElement("link")
161 fileref.setAttribute("rel", "stylesheet");
162 fileref.setAttribute("type", "text/css");
163 fileref.setAttribute("href", file);
167 document.getElementsByTagName("head").item(0).appendChild(fileref)
168 loadedobjects+=file+" " //Remember this object as being already added to page
173 function chkObject(theVal) {
174 if (document.getElementById(theVal) != null) {
181 function title_status() {
182 ajaxpage("title_status.php","title_status");
183 setTimeout("title_status()", 60000);
186 function alert_status() {
187 ajaxpage("alert_status.php","alert_status");
188 setTimeout("alert_status()", 1000);
191 function securityStatus() {
192 ajaxpage('check_isy99i_occupancy_status.php','contentarea');
193 t=setTimeout('securityStatus()', 10000);
196 function lightingStatus() {
197 ajaxpage('check_isy99i_status.php', 'contentarea');
198 t=setTimeout('lightingStatus()', 10000);
201 var weatherpages=new Array();
202 weatherpages[0]="weather1.php";
203 weatherpages[1]="weather2.php";
204 weatherpages[2]="weather3.php";
205 weatherpages[3]="weather4.php";
206 weatherpages[4]="weather5.php";
207 weatherpages[5]="weather6.php";
212 function weatherpageChange() {
213 ajaxpage(weatherpages[i],'contentarea');
215 if (i==weatherpages.length) {
218 t=setTimeout("weatherpageChange()",10000);
221 function imageHeaderChange(imgUrl) {
222 var div1 = document.getElementById('imgHeader');
223 div1.innerHTML='<img src=" '+imgUrl + ' ">'
226 function stopchanges(t) {
231 function changeIcon(icon) {
232 var icons=new Array();
234 foreach ($menuitems as $key=>$icon) {
235 echo " icons[$key]='$icon';\n";
238 for ( var i=icons.length-1; i>=0; --i ){
239 if (icons[i] == icon) {
240 document.getElementById(icon).src = "images/"+icon+"-on.png";
242 document.getElementById(icons[i]).src = "images/"+icons[i]+"-off.png";
247 function changepage() {
248 ajaxpage("cameras.php",'contentarea');
251 function mediacenterSelect(ip) {
252 ajaxpage("jukebox.php?ip="+ip, 'contentarea');
255 function thermostatMode(modeId) {
259 function thermostatFan(fanId) {
266 body {overflow-y:hidden;
268 background-color: #000000;
269 background-image: url('images/bg.jpg');
270 background-repeat:repeat-x;
273 #menubar {font-family:arial, helvetica; font-size:12px; font-weight:bold;}
275 #fullheight{height: 100%;}
284 vertical-align:text-top;
290 <table border="0" width=100% id="fullheight">
293 <table border=0 align=center cellspacing=0 cellpadding=0 width=100%>
294 <tr style="background-image: url('images/header-repeater.png'); background-repeat: repeat-x;">
296 <canvas id="canvas3" height="62" width="420"> </canvas>
297 <script language="JavaScript">
298 function testDrawText3(canvas)
300 var context=canvas.getContext('2d');
302 context.strokeStyle="#3c3c3c";
303 context.shadowOffsetX=2;
304 context.shadowOffsetY=-2;
305 context.shadowColor="#3c3c3c";
307 context.font="22pt ariel";
308 context.fillStyle="#aaaaaa";
309 context.shadowOffsetX=5;
310 context.shadowOffsetY=5;
311 context.shadowBlur=10;
312 context.fillText("<?php echo $housename; ?>", 10, 35);
313 context.strokeText("<?php echo $housename; ?>", 10, 35);
315 testDrawText3(document.getElementById('canvas3'));
317 <!-- <img align="left" src="images/header.png"> -->
318 </td><td><div id="alert_status" style="font-family: Arial;position: relative; top: -6px;">
319 <script language="javascript">
321 </script></td><td align="right">
322 <div id="title_status" style="font-family: Arial;position: relative; top: -6px;">
323 <script language="javascript">
327 <td width=20% align="right" valign="middle">
328 <div id="js_clock" style="font-size:x-large;font-family: Arial;position: relative; top: -6px;">
329 <script language="javascript">function js_clock(){var clock_time = new Date();var clock_hours = clock_time.getHours();var clock_minutes = clock_time.getMinutes();var clock_seconds = clock_time.getSeconds();var clock_suffix = "AM ";if (clock_hours > 11){clock_suffix = "PM ";clock_hours = clock_hours - 12;}if (clock_hours == 0){clock_hours = 12;}if (clock_hours < 10){clock_hours = "0" + clock_hours;}if (clock_minutes < 10){clock_minutes = "0" + clock_minutes;}if (clock_seconds < 10){clock_seconds = "0" + clock_seconds;}var clock_div = document.getElementById('js_clock');clock_div.innerHTML = clock_hours + ":" + clock_minutes + ":" + clock_seconds + " " + clock_suffix;setTimeout("js_clock()", 1000);}js_clock();</script>
338 <tr height="100%" valign="top"><td>
339 <div id="contenttop"></div>
342 <div id="imgHeader" align="center"></div>
345 <div id="contentarea" align="center">
348 # if(isset($_GET['page']) {
349 # switch($_GET['page']) {
360 <div id="contentbottom"></div>
365 <table border=0 ALIGN=center cellpadding=0 cellspacing =0 width=100%>
366 <tr style="background-image: url('images/bottom-controls-repeatablebar.jpg'); background-repeat: repeat-x;">
368 <table border=0 align=center cellpadding=0 cellspacing=0>
369 <tr style="background-image: url('images/bottom-controls-repeatablebar.jpg'); background-repeat: repeat-x;">
371 foreach($menuitems as $menu) {
372 echo "<td ALIGN=center>";
376 <a href="javascript:stopchanges(t);weatherpageChange();imageHeaderChange('images/header-weather.png');changeIcon('weather');"><img src="./images/weather-off.png" onMouseover="" border=0 id="weather"></a>
381 <a href="javascript:stopchanges(t);lightingStatus();imageHeaderChange('images/header-lighting.png');changeIcon('lighting');"><img src="./images/lighting-off.png" onMouseover="" border=0 id="lighting"></a>
386 <a href="javascript:stopchanges(t);changepage('cameras');imageHeaderChange('images/header-camera.png');changeIcon('cameras');"><img src="./images/cameras-off.png" onMouseover="" border=0 id="cameras"></a>
391 <a href="javascript:stopchanges(t);securityStatus();imageHeaderChange('images/header-security.png');changeIcon('security');"><img src="./images/security-off.png" onMouseover="" border=0 id="security"></a>
396 <a href="javascript:stopchanges(t);ajaxpage('check_climate_status.php', 'contentarea');imageHeaderChange('images/header-climate.png');changeIcon('climate');"><img src="./images/climate-off.png" onMouseover="" border=0 id="climate"></a>
401 <a href="javascript:stopchanges(t);ajaxpage('check_power_status.php', 'contentarea');imageHeaderChange('images/header-power.png');changeIcon('power');"><img src="./images/power-off.png" onMouseover="" border=0 id="power"></a>
406 <a href="javascript:stopchanges(t);weatherpageChange();imageHeaderChange('images/header-recipes.png');changeIcon('receipes');"><img src="./images/receipes-off.png" onMouseover="" border=0 id="receipes"></a>
411 <a href="javascript:stopchanges(t);;ajaxpage('traffic.html', 'contentarea');imageHeaderChange('images/header-traffic.png');changeIcon('traffic');"><img src="./images/traffic-off.png" onMouseover="" border=0 id="traffic"></a>
416 <a href="javascript:stopchanges(t);ajaxpage('news.php', 'contentarea');imageHeaderChange('images/header-news.png');changeIcon('news');"><img src="./images/news-off.png" onMouseover="" border=0 id="news"></a>
421 <a href="javascript:stopchanges(t);ajaxpage('jukebox.php', 'contentarea');imageHeaderChange('images/header-thejukebox.png');changeIcon('music');"><img src="./images/music-off.png" onMouseover="" border=0 id="music"></a>