var lr="";
function ls(tt) {
var ttt = document.getElementById(tt);
    if (ttt.style.display=="")
    {ttt.style.display="none";}
    else {ttt.style.display="";}
}

function ons(t) {
var t1 = document.getElementById(t);
if (lr!="")
{
var t2 = document.getElementById(lr);
t2.style.display="none";
}
    t1.style.display="";
    lr=t;
}

var hinttip = {

	/* On edit */
	options: {
		attr_name: "hinttip", 
		blank_text: "(Страница откроется в новом окне)", 
		newline_entity: " . , ", 
		max_width: 0, 
		delay: 180, 
		skip_tags: ["link", "style"] 
	},
	/* Off edit */

	j: document.createElement("DIV"),
	c: null,
	g: false,
	canvas: null,

	m: function(e){
		if (hinttip.g){
			var z = window.event ? event.clientX + hinttip.canvas.scrollLeft : e.pageX;
			var u = window.event ? event.clientY + hinttip.canvas.scrollTop : e.pageY;
			hinttip.a(z, u);
		}
	},

	d: function(){
		hinttip.canvas = document.getElementsByTagName(document.compatMode && document.compatMode == "CSS1Compat" ? "HTML" : "BODY")[0];
		hinttip.j.setAttribute("id", "hinttip");
		document.body.appendChild(hinttip.j);
		if (hinttip.options.max_width) hinttip.j.style.maxWidth = hinttip.options.max_width + "px"; // all but ie
		var a = document.all && !window.opera ? document.all : document.getElementsByTagName("*"); // in opera 9 document.all produces type mismatch error
		var l = a.length;
		for (var i = 0; i < l; i++){

			if (!a[i] || hinttip.options.skip_tags.in_array(a[i].tagName.toLowerCase())) continue;

			var hinttip_title = a[i].getAttribute("title"); // returns form object if IE & name="title"; then IE crashes; so...
			if (hinttip_title && typeof hinttip_title != "string") hinttip_title = "";

			var hinttip_alt = a[i].getAttribute("alt");
			var hinttip_blank = a[i].getAttribute("target") && a[i].getAttribute("target") == "_blank" && hinttip.options.blank_text;
			if (hinttip_title || hinttip_blank){
				a[i].setAttribute(hinttip.options.attr_name, hinttip_blank ? (hinttip_title ? hinttip_title + " " + hinttip.options.blank_text : hinttip.options.blank_text) : hinttip_title);
				if (a[i].getAttribute(hinttip.options.attr_name)){
					a[i].removeAttribute("title");
					if (hinttip_alt && a[i].complete) a[i].removeAttribute("alt");
					hinttip.l(a[i], "mouseover", hinttip.w);
					hinttip.l(a[i], "mouseout", hinttip.h);
				}
			}else if (hinttip_alt && a[i].complete){
				a[i].setAttribute(hinttip.options.attr_name, hinttip_alt);
				if (a[i].getAttribute(hinttip.options.attr_name)){
					a[i].removeAttribute("alt");
					hinttip.l(a[i], "mouseover", hinttip.w);
					hinttip.l(a[i], "mouseout", hinttip.h);
				}
			}
			if (!a[i].getAttribute(hinttip.options.attr_name) && hinttip_blank){
				//
			}
		}
		document.onmousemove = hinttip.m;
		window.onscroll = hinttip.h;
		hinttip.a(-99, -99);
	},
	
	_: function(w){
		w = w.replace(/\&/g,"&amp;");
		w = w.replace(/\</g,"&lt;");
		w = w.replace(/\>/g,"&gt;");
		return w;
	},

	w: function(e){
		if (typeof hinttip == "undefined") return;
		var d = window.event ? window.event.srcElement : e.target;
		if (!d.getAttribute(hinttip.options.attr_name)) return;
		var w = d.getAttribute(hinttip.options.attr_name);
		if (hinttip.options.newline_entity){
			var w = hinttip._(w);
			w = w.replace(eval("/" + hinttip._(hinttip.options.newline_entity) + "/g"), "<br>");
			hinttip.j.innerHTML = w;
		}else{
			if (hinttip.j.firstChild) hinttip.j.removeChild(hinttip.j.firstChild);
			hinttip.j.appendChild(document.createTextNode(w));
		}
		hinttip.c = setTimeout("hinttip.j.style.visibility = 'visible'", hinttip.options.delay);
		hinttip.g = true;
	},

	h: function(e){
		if (typeof hinttip == "undefined") return;
		hinttip.j.style.visibility = "hidden";
		if (!hinttip.options.newline_entity && hinttip.j.firstChild) hinttip.j.removeChild(hinttip.j.firstChild);
		clearTimeout(hinttip.c);
		hinttip.g = false;
		hinttip.a(-99, -99);
	},

	l: function(o, e, a){
		if (o.addEventListener) o.addEventListener(e, a, false); // was true--Opera 7b workaround!
		else if (o.attachEvent) o.attachEvent("on" + e, a);
			else return null;
	},

	a: function(z, u){
		var w_width = hinttip.canvas.clientWidth ? hinttip.canvas.clientWidth + hinttip.canvas.scrollLeft : window.innerWidth + window.pageXOffset;
		var w_height = window.innerHeight ? window.innerHeight + window.pageYOffset : hinttip.canvas.clientHeight + hinttip.canvas.scrollTop; // should be vice verca since Opera 7 is crazy!

		if (document.all && document.all.item && !window.opera) hinttip.j.style.width = hinttip.options.max_width && hinttip.j.offsetWidth > hinttip.options.max_width ? hinttip.options.max_width + "px" : "auto";
		
		var t_width = hinttip.j.offsetWidth;
		var t_height = hinttip.j.offsetHeight;

		hinttip.j.style.left = z + 0 + "px";
		hinttip.j.style.top = u + 20 + "px";
		
		if (z + t_width > w_width) hinttip.j.style.left = w_width - t_width + "px";
		if (u + t_height > w_height) hinttip.j.style.top = w_height - t_height + "px";
	}
}
  //if(typeof(hinttip.j.style.MozOpacity)!="undefined"){
  hinttip.j.style.opacity = '.70';
  hinttip.j.style.filter = "alpha(opacity:70)";
  //}
  hinttip.j.style.visibility = 'visible';



Array.prototype.in_array = function(value){
	var l = this.length;
	for (var i = 0; i < l; i++)
		if (this[i] === value) return true;
	return false;
};

var root = window.addEventListener || window.attachEvent ? window : document.addEventListener ? document : null;
if (root){
	if (root.addEventListener) root.addEventListener("load", hinttip.d, false);
	else if (root.attachEvent) root.attachEvent("onload", hinttip.d);
}