window.onerror = null; var tooltip_attr_name = "tooltip"; //DOM style switcher originally written by paul sowden function ss(){ if (document.getElementsByTagName && document.documentElement) document.write('


'); } //after onLoad the prop's called TEXT not TITLE! (due to DOM tooltip) -- tooltip_attr_name!! function setActiveStyleSheet(title){ var i, a; for (i = 0; (a = document.getElementsByTagName("link")[i]); i++){ if (a.getAttribute("rel").indexOf("style") != -1 && (a.getAttribute("title") || a.getAttribute(tooltip_attr_name))){ a.disabled = true; if (a.getAttribute("title") == title || a.getAttribute(tooltip_attr_name) == title) a.disabled = false; } } } function getActiveStyleSheet() { var i, a; for (i = 0; (a = document.getElementsByTagName("link")[i]); i++){ if (a.getAttribute("rel").indexOf("style") != -1 && (a.getAttribute("title") || a.getAttribute(tooltip_attr_name)) && !a.disabled) return a.getAttribute("title") || a.getAttribute(tooltip_attr_name); } return null; } function getPreferredStyleSheet() { var i, a; for (i = 0; (a = document.getElementsByTagName("link")[i]); i++){ if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("rel").indexOf("alt") == -1 && (a.getAttribute("title") || a.getAttribute(tooltip_attr_name))) return a.getAttribute("title") || a.getAttribute(tooltip_attr_name); } return null; } function createCookie(name, value, days) { if (days){ var date = new Date(); date.setTime(date.getTime() + (days*24*60*60*1000)); var expires = "; expires = " + date.toGMTString(); } else expires = ""; document.cookie = name + "=" + value + expires + "; path=/"; } function readCookie(name){ var nameEQ = name + "="; var ca = document.cookie.split(';'); for (var i = 0; i < ca.length; i++){ var c = ca[i]; while (c.charAt(0) == ' ') c = c.substring(1, c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); } return null; } window.onunload = function(e){ var title = getActiveStyleSheet(); createCookie("style", title, 365); } var cookie = readCookie("style"); var title = cookie && cookie != "null" ? cookie : getPreferredStyleSheet(); setActiveStyleSheet(title); //DOM TD hover function Hover(e){ if (!e) var e = window.event; var it = e.target ? e.target : e.srcElement; isover = e.type == "mouseover"; if (it.className == "nav" && isover && it.parentNode){ it.parentNode.style.borderColor = "#ADC1CE"; return; } if (it.className == "navcurressay" || it.className == "nav1" || it.className == "nav2" && it.firstChild){ a = it.firstChild; //it.text = a.text;//!!! it.style.cursor = isover ? e.target ? "pointer" : "hand" : "default"; if (it.className != "navcurressay") it.style.borderColor = isover ? "#ADC1CE" : "#AAAAAA"; window.status = isover ? a.href : "";//Opera7--NO if (e.type == "click") location.href = a.href; } } document.onmouseover = document.onmouseout = document.onclick = Hover; //DOM tooltip originally written by paul sowden window.onload = function(e){ if (document.createElement) tooltip.d(); } tooltip = { t: document.createElement("DIV"), c: null, g: false, m: function(e){ if (tooltip.g){ //x = window.event ? event.clientX + document.body.scrollLeft : e.pageX; //y = window.event ? event.clientY + document.body.scrollTop : e.pageY; oCanvas = document.getElementsByTagName( (document.compatMode && document.compatMode == "CSS1Compat") ? "HTML" : "BODY" )[0]; x = window.event ? event.clientX + oCanvas.scrollLeft : e.pageX; // !!! y = window.event ? event.clientY + oCanvas.scrollTop : e.pageY; // !!! tooltip.a(x, y); } }, d: function(){ tooltip.t.setAttribute("id", "tooltip"); //tooltip.t.style.filter = "alpha(opacity=85)"; document.body.appendChild(tooltip.t); a = document.all ? document.all : document.getElementsByTagName("*"); aLength = a.length; for (var i = 0; i < aLength; i++){ if (a[i].getAttribute("title")){ a[i].setAttribute(tooltip_attr_name, a[i].getAttribute("title")); if (a[i].getAttribute(tooltip_attr_name)){ a[i].removeAttribute("title"); if (a[i].getAttribute("alt") && a[i].complete) a[i].removeAttribute("alt"); tooltip.l(a[i], "mouseover", tooltip.s); tooltip.l(a[i], "mouseout", tooltip.h); } }else if (a[i].getAttribute("alt") && a[i].complete){ a[i].setAttribute(tooltip_attr_name, a[i].getAttribute("alt")); if (a[i].getAttribute(tooltip_attr_name)){ a[i].removeAttribute("alt"); tooltip.l(a[i], "mouseover", tooltip.s); tooltip.l(a[i], "mouseout", tooltip.h); } //alert(a[i].getAttribute(tooltip_attr_name)); //alert(a[i].outerHTML); } } document.onmousemove = tooltip.m; window.onscroll = tooltip.h; // !!! }, s: function(e){ d = window.event ? window.event.srcElement : e.currentTarget; if (!d.getAttribute(tooltip_attr_name)) return; // !!! if (tooltip.t.firstChild) tooltip.t.removeChild(tooltip.t.firstChild); // !!! tooltip.t.appendChild(document.createTextNode(d.getAttribute(tooltip_attr_name))); tooltip.c = setTimeout("tooltip.t.style.visibility = 'visible';", 100); tooltip.g = true; }, h: function(e){ tooltip.t.style.visibility = "hidden"; if (tooltip.t.firstChild) tooltip.t.removeChild(tooltip.t.firstChild); clearTimeout(tooltip.c); tooltip.g = false; tooltip.a(-99, -99); }, l: function(o, e, a){ if (o.addEventListener) o.addEventListener(e, a, false); // was true--Opera7 workaround! else if (o.attachEvent) o.attachEvent("on" + e, a); else return null; }, a: function(x, y){ oCanvas = document.getElementsByTagName( (document.compatMode && document.compatMode == "CSS1Compat") ? "HTML" : "BODY" )[0]; w_width = window.event ? oCanvas.clientWidth : window.innerWidth; t_width = window.event ? tooltip.t.clientWidth : tooltip.t.innerWidth; t_extra_width = 7; // padding + borderWidth; tooltip.t.style.top = y + 25 + "px"; tooltip.t.style.left = x + 8 + "px"; while (x + t_width + t_extra_width > w_width){ --x; tooltip.t.style.left = x + "px"; t_width = window.event ? tooltip.t.clientWidth : tooltip.t.innerWidth; } } }