if (s.length == 1) s = "0" + s;
return s;
}
+
+function center_element(e) {
+ var c_width = document.body.clientWidth;
+ var c_height = document.body.clientHeight;
+
+ var c_scroll = document.body.scrollTop;
+
+ var e_width = e.clientWidth;
+ var e_height = e.clientHeight;
+
+ var set_y = (c_height / 2) + c_scroll - (e_height / 2);
+ var set_x = (c_width / 2) - (e_width / 2);
+
+ e.style.top = set_y + "px";
+ e.style.left = set_x + "px";
+
+}
if (xmlhttp.readyState == 4) {
var box = document.getElementById('infoBox');
var shadow = document.getElementById('infoBoxShadow');
-
- if (box) {
- box.innerHTML=xmlhttp.responseText;
+ if (box) {
+ box.innerHTML=xmlhttp.responseText;
if (shadow) {
shadow.style.display = "block";
+ center_element(shadow);
} else {
box.style.display = "block";
}