function $(id) { return document.getElementById(id); } function Foundation() { this.load = $('loaded'); this.loaded = 0; this.root = ""; this.screen = []; this.items = []; this.time = new Array(3,(1*12),(1*12),'am'); // hour, minute, second, meridiem } function foundation_initialize() { with (this) { load = $('loaded'); if (load) { loaded = 1; root = "http://www.sharperimage.ca/"; Site.Align(null,0,0,'',''); } else { window.setTimeout('Site.Initialize()',10); } } } function foundation_screensize() { with (this) { if (loaded == 1) { if (document.body) { screen['width'] = document.body.clientWidth; screen['height'] = document.body.clientHeight; } else { window.setTimeout('Site.Initialize()',10); } } } } function foundation_align(d,y,x,v,h) { with (this) { if (loaded == 1) { Site.ScreenSize(); items['pclogo'] = new Array(6,14,'top','left'); if (d) { if (!items[d.id]) { items[d.id] = new Array(y,x,v,h); } d.style.top = 0; d.style.left = 0; d.style.top = (v == "bottom" ? (screen['height']-y) : (v == "middle" ? ((screen['height']/2)+y) : y)); d.style.left = (h == "right" ? (screen['width']-x) : (h == "center" ? ((screen['width']/2)+x) : x)); } else { for (i in items) { if ($(i)) { $(i).style.top = 0; $(i).style.left = 0; $(i).style.top = (items[i][2] == "bottom" ? (screen['height']-items[i][0]) : (items[i][2] == "middle" ? ((screen['height']/2)+items[i][0]) : items[i][0])); $(i).style.left = (items[i][3] == "right" ? (screen['width']-items[i][1]) : (items[i][3] == "center" ? ((screen['width']/2)+items[i][1]) : items[i][1])); } } } } } } function foundation_clock(go) { var orig_hour = 0; var orig_minute = 0; var result = ""; with (this) { if (loaded == 1) { if ($('pcclock')) { if (go == 1) { orig_hour = time[0]; orig_minute = time[1]; time[2] = (time[2]+1 == 60 ? 0 : time[2]+1); time[1] = (time[2] == 0 ? (time[1]+1 == 60 ? 0 : time[1]+1) : time[1]); time[0] = (time[1] == 0 && orig_minute != time[1] ? (time[0]+1 == 13 ? 1 : time[0]+1) : time[0]); time[3] = (time[0] == 12 && orig_hour == 11 ? (time[3] == "am" ? "pm" : "am") : time[3]); $('pcclock').innerHTML = (time[0] < 10 ? " "+time[0] : time[0])+":"+(time[1] < 10 ? "0"+time[1] : time[1])+":"+(time[2] < 10 ? "0"+time[2] : time[2])+" "+time[3]; window.setTimeout('Site.Clock(1)',999); } else { window.setTimeout('Site.Clock(1)',999); } } } else { window.setTimeout('Site.Clock(0)',999); } } } Foundation.prototype.Initialize = foundation_initialize; Foundation.prototype.ScreenSize = foundation_screensize; Foundation.prototype.Align = foundation_align; Foundation.prototype.Clock = foundation_clock; var Site = new Foundation(); Site.Initialize(); Site.Clock(0);