$(document).ready(function() {
$("#dateDiv").load("datetime.php?date=1");
$("#timeDiv").load("datetime.php?time=1");
setInterval(function() {$("#dateDiv").load("datetime.php?date=1");}, 10000);
setInterval(function() {$("#timeDiv").load("datetime.php?time=1");}, 10000);
$.ajaxSetup({ cache: false });
});
function setDataLink() {
$("#last_data_time").load("lastdatatime.php");
$("#graph1Div").load("graph.php?graph=1");
$("#graph2Div").load("graph.php?graph=2");
$("#graph3Div").load("graph.php?graph=3");
$("#graph4Div").load("graph.php?graph=4");
$("#graph5Div").load("graph.php?graph=5");
$("#graph6Div").load("graph.php?graph=6");
$("#graph7Div").load("graph.php?graph=7");
$("#graph8Div").load("graph.php?graph=8");
setInterval(function() {$("#last_data_time").load("lastdatatime.php");}, 600000);
setInterval(function() {$("#graph1Div").load("graph.php?graph=1");}, 600000);
setInterval(function() {$("#graph2Div").load("graph.php?graph=2");}, 600000);
setInterval(function() {$("#graph3Div").load("graph.php?graph=3");}, 600000);
setInterval(function() {$("#graph4Div").load("graph.php?graph=4");}, 600000);
setInterval(function() {$("#graph5Div").load("graph.php?graph=5");}, 600000);
setInterval(function() {$("#graph6Div").load("graph.php?graph=6");}, 600000);
setInterval(function() {$("#graph7Div").load("graph.php?graph=7");}, 600000);
setInterval(function() {$("#graph8Div").load("graph.php?graph=8");}, 600000);
}
function setDefaults() {
mapsControls();
setDataLink();
}
function mapsControls(disable) {
if(disable) {
mapsControl1();
mapsControl2(true);
mapsControl3();
} else {
mapsControl1(true);
mapsControl2();
mapsControl3(true);
}
}
function mapsControl1(disable) {
if(disable) {
$("#maps_control1").html("");
} else {
$("#maps_control1").html("");
}
}
function mapsControl2(disable) {
if(disable) {
$("#maps_control2").html("");
} else {
$("#maps_control2").html("");
}
}
function mapsControl3(disable) {
if(disable) {
$("#maps_control3").html("");
} else {
$("#maps_control3").html("");
}
}
// graph description on main page
var descStatus=new Array();
descriptionClear();
function descriptionClear() {
for(i = 0; i<=8; i++) {
descStatus[i] = false;
}
}
function describe(graphId) {
if(descStatus[graphId] == false) {
document.getElementById("describe"+graphId).style.display="block";
descStatus[graphId] = true;
} else {
document.getElementById("describe"+graphId).style.display="none";
descStatus[graphId] = false;
}
}
// news on main page
//function newsShow(newsId) {
// document.getElementById("news"+newsId).style.display="block";
//}
//function newsRemove(newsId) {
// document.getElementById("news"+newsId).style.display="none";
//}
// ----------------------------
var cX = 0; var cY = 0; var rX = 0; var rY = 0;
function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}
function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}
if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }
else { document.onmousemove = UpdateCursorPosition; }
function AssignPosition(d) {
if(self.pageYOffset) {
rX = self.pageXOffset;
rY = self.pageYOffset;
}
else if(document.documentElement && document.documentElement.scrollTop) {
rX = document.documentElement.scrollLeft;
rY = document.documentElement.scrollTop;
}
else if(document.body) {
rX = document.body.scrollLeft;
rY = document.body.scrollTop;
}
if(document.all) {
cX += rX;
cY += rY;
}
d.style.left = (cX+10) + "px";
d.style.top = (cY+10) + "px";
d.style.top = "85px";
}
function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
dd.style.display = "block";
}