var win=null;

	var good = false;

	function NewWindow(mypage, myname, w, h, scroll, pos){

		if(pos == "random"){

			LeftPosition = (screen.width) ? Math.floor(Math.random() * (screen.width-w)) : 100;

			TopPosition = (screen.height) ? Math.floor(Math.random() * ((screen.height-h)-75)) : 100;

		} else if(pos == "center"){

			LeftPosition = (screen.width) ? (screen.width-w)/2 : 100;

			TopPosition=(screen.height)?(screen.height-h)/2:100;

		} else {

			LeftPosition = 0;

			TopPosition = 20

		}
		settings = 'width = ' + w + ',height = ' + h + ',top = ' + TopPosition + ',left=' + LeftPosition + ',scrollbars = ' + scroll + ',location = no,directories = no,status = yes,menubar = no,toolbar = no,resizable = yes';

		win = window.open(mypage, myname, settings);

	}

	function checkSend() {

		reg = /(.*)@(.*)\.\w{2,4}/i;

		comp = document.send.email.value.match(reg);

		if(document.send.name.value == '') {
alert("Введите Ваше имя!");
document.send.name.focus();
} else if(document.send.email.value == '' || comp == null) {
alert("Введите e-mail!");
document.send.email.focus();

} else if(document.send.question.value == '') {
alert("Введите вопрос!");
document.send.question.focus();
} else {
good = true;
}
return good;

	}


	function checkSendInfo() {

		reg = /(.*)@(.*)\.\w{2,4}/i;

		comp = document.send.email.value.match(reg);

		if(document.send.name.value == '') {
alert("Введите Ваше имя!");
document.send.name.focus();
} else if(document.send.email.value == '' || comp == null) {
alert("Введите e-mail!");
document.send.email.focus();

} else {
good = true;
}
return good;

	}

function queCheck() {

	if(document.que.city.value == '') {

		alert("Введите город!");

		document.que.city.focus();

	} else if(document.que.question.value == '') {

		alert("Введите вопрос!");

		document.que.question.focus();

	} else if(document.que.email.value == '') {

		alert("Введите E-mail!");

		document.que.email.focus();

	} else {

		good = true;
	}

return good;

	}



function check_subs() {

	if(document.subs.email.value == '') {

		alert("Введите E-mail!");

		document.subs.email.focus();

	} else {

		good = true;
	}

return good;

	}

	function doit(header) {

		var answer = "a" + header;

		var question = "b" + header;

		if(document.all[answer].style.display == "none") {

			document.all[answer].style.display = "";

			document.all[question].style.display = "";

		} else {

			document.all[answer].style.display = "none";

			document.all[question].style.display = "none";

		}

	}

	window.onerror = null;

	var tooltip_attr_name = "tooltip";

	var tooltip_blank_text = "(откроется в новом окне)";

	var tooltip_newline_entity = "#";

	var tooltip_max_width = 0;

	window.onload = function(e){

		if (document.createElement) tooltip.d();
	}

	tooltip = {

		t: document.createElement("DIV"),

		c: null,

		g: false,

		m: function(e){

			if (tooltip.g){
				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");

			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]) continue;

				tooltip_title = a[i].getAttribute("title");

				tooltip_alt = a[i].getAttribute("alt");

				tooltip_blank = a[i].getAttribute("target") && a[i].getAttribute("target") == "_blank" && tooltip_blank_text;

				if (tooltip_title || tooltip_blank){

					a[i].setAttribute(tooltip_attr_name, tooltip_blank ? (tooltip_title ? tooltip_title + " " + tooltip_blank_text : tooltip_blank_text) : tooltip_title);

					if (a[i].getAttribute(tooltip_attr_name)){
					a[i].removeAttribute("title");

						if (tooltip_alt && a[i].complete) a[i].removeAttribute("alt");

							tooltip.l(a[i], "mouseover", tooltip.s);

							tooltip.l(a[i], "mouseout", tooltip.h);

						}

					} else if (tooltip_alt && a[i].complete){

						a[i].setAttribute(tooltip_attr_name, tooltip_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);
						}

					}
			if (!a[i].getAttribute(tooltip_attr_name) && tooltip_blank){
			}
		}
		document.onmousemove = tooltip.m;
		window.onscroll = tooltip.h;
		tooltip.a(-99, -99);
	},

	s: function(e){
		d = window.event ? window.event.srcElement : e.currentTarget;
		if (!d.getAttribute(tooltip_attr_name)) return;
		s = d.getAttribute(tooltip_attr_name);
		if (tooltip_newline_entity){
			s = s.replace(/\&/g,"&amp;");
			s = s.replace(/\</g,"&lt;");
			s = s.replace(/\>/g,"&gt;");
			s = s.replace(eval("/" + tooltip_newline_entity + "/g"), "<br />");
			tooltip.t.innerHTML = s;
		}else{
			if (tooltip.t.firstChild) tooltip.t.removeChild(tooltip.t.firstChild);
			tooltip.t.appendChild(document.createTextNode(s));
		}
		tooltip.c = setTimeout("tooltip.t.style.visibility = 'visible';", 500);
		tooltip.g = true;
	},

	h: function(e){
		tooltip.t.style.visibility = "hidden";
		if (!tooltip_newline_entity && 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--Opera7b 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.innerWidth ? window.innerWidth + window.pageXOffset : oCanvas.clientWidth + oCanvas.scrollLeft;
		w_height = window.innerHeight ? window.innerHeight + window.pageYOffset : oCanvas.clientHeight + oCanvas.scrollTop;

		tooltip.t.style.width = "auto";

		t_width = window.event ? tooltip.t.clientWidth : tooltip.t.offsetWidth;
		t_height = window.event ? tooltip.t.clientHeight : tooltip.t.offsetHeight;

		if ((tooltip_max_width) && (t_width > tooltip_max_width)){
			tooltip.t.style.width = tooltip_max_width + "px";
			t_width = window.event ? tooltip.t.clientWidth : tooltip.t.offsetWidth;
		}

		t_extra_width = 7;
		t_extra_height = 5;

		tooltip.t.style.left = x + 8 + "px";
		tooltip.t.style.top = y + 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.offsetWidth;
		}

		while (y + t_height + t_extra_height > w_height){
			--y;
			tooltip.t.style.top = y + "px";
			t_height = window.event ? tooltip.t.clientHeight : tooltip.t.offsetHeight;
		}
	}
}
