/* ASPItalia.com BlackAthena Javascript Library codename 'squizzy' - Copyright 2006-08 ASPItalia.com - All rights reserved */  var ASPItalia = new Object();  ASPItalia.TabLayers = function(Layers, firstPanel) { this.lastPanelId = firstPanel; this.layers = Layers;  this.ShowPanel = function (id) { for (var i = 0; i< this.layers.length; i++) { if (this.layers[i][0] == id) { this.show(id); this.layers[i][2] = 1; if (this.layers[i][1] != null) this.LoadPanel(id, this.layers[i][1]); } else { this.hide(this.layers[i][0]); this.layers[i][2] = 1; } }  this.lastPanelId = id; };  this.RestorePanel = function () { this.ShowPanel(this.lastPanelId); };  this.show = function (id) { document.getElementById(id).style.display = 'block'; document.getElementById(id + '_button').className = id + '_button_active'; };  this.hide = function (id) { document.getElementById(id).style.display = 'none'; document.getElementById(id + '_button').className = ''; };  this.LoadPanel = function (id, url) { try { this.SendRequest(id, url); } catch (er) { this.OnError(id, er);     } };  this.SendRequest = function (id, url) { var request; var data = null;  if (window.ActiveXObject) { request = new ActiveXObject("Microsoft.XMLHTTP"); request.Open("GET", url + "&dt=" + new Date().getDate(), true); } else { request = new XMLHttpRequest(); request.open('GET', url + "&dt=" + new Date().getDate(), true, null, null); }  request.onreadystatechange = function() { if (request.readyState == 4) {     try {         document.getElementById(id).innerHTML = request.responseText;     }     catch (er) {         OnError(id, er);     }     } }; request.send(data); };  this.OnError = function (id, er) { document.getElementById(id).innerHTML = er.message; }; }