
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		bt_03_over = newImage("images/bt_03-over.gif");
		bt_04_over = newImage("images/bt_04-over.gif");
		bt_05_over = newImage("images/bt_05-over.gif");
		bt_06_over = newImage("images/bt_06-over.gif");
		index_10_ImageMap_01_over = newImage("images/index_10-ImageMap_01_over.gif");
		index_11_ImageMap_01_over = newImage("images/index_11-ImageMap_01_over.gif");
		index_11_ImageMap_04_over = newImage("images/index_11-ImageMap_04_over.gif");
		index_12_ImageMap_01_over = newImage("images/index_12-ImageMap_01_over.gif");
		index_12_ImageMap_04_over = newImage("images/index_12-ImageMap_04_over.gif");
		index_12_ImageMap_02_over = newImage("images/index_12-ImageMap_02_over.gif");
		ts_02_ImageMap_01_over = newImage("images/ts_02-ImageMap_01_over.gif");
		ts_02_ImageMap_04_over = newImage("images/ts_02-ImageMap_04_over.gif");
		preloadFlag = true;
	}
}



	function open_window(link,w,h)
	 {  
	 var win = "width="+w+",height="+h+",menubar=no,location=no,resizable=no,scrollbars=no,top=200,left=200";
	 newWin = window.open(link,'newWin',win);
	 };
	function open_window2(link,w,h)
	 {  
	 var win = "width="+w+",height="+h+",menubar=yes,location=no,resizable=no,scrollbars=yes,top=20,left=20";
	 newWin = window.open(link,'newWin',win);
	 };

function SetTopNavSiteMapLinkBorder(strTdId, fIsHover)
{
        if (!document.getElementById ||
		'undefined' == typeof(document.getElementById))
		return;

	var tdCell = document.getElementById(strTdId);
	if ('undefined' == typeof(tdCell) ||
		null == tdCell ||
		'undefined' == typeof(tdCell.className))
		return;
	if (fIsHover)
		tdCell.className = 'TopNavCellLinkHover';
	else
		tdCell.className = 'TopNavCellLink';
}
function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}

function popupShoppingCart(url) {
  window.open(url,'shoppingCart','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=800,height=500,screenX=150,screenY=150,top=150,left=150')
}

ns = window.navigator.appName == "Netscape"

if (ns) {
  window.captureEvents(Event.MOUSEMOVE);
  window.onmousemove=updateIt;
}

function updateIt(e) {
  mouseX = e.pageX - (window.innerWidth - 768)/2;
  mouseY = e.pageY;
}

function OpenIt(xx) {
  if (document.all){
	x = window.event.x + 15;
	y = window.event.y;
  } else {
	x = mouseX + 25;
	y = mouseY;
  }
  var showBox = document.getElementById(xx);
  showBox.style.top = y;
  showBox.style.left = x;
  showBox.style.visibility = 'visible';
  showBox.visibility = 'show';
}

function CloseIt(xx) {
  var showBox = document.getElementById(xx);
  showBox.style.visibility = 'hidden';
  showBox.visibility = 'hide';
}


/*

Скрипт, изменяющий теги title и alt

*/


window.onerror = null;

tooltip = {

attr_name: "tooltip",
blank_text: "",
newline_entity: "  ",
max_width: 0,
delay: 100,


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");
if (tooltip_title && typeof tooltip_title != "string") tooltip_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.target;
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';", tooltip.delay);
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);
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 = oCanvas.clientWidth ? oCanvas.clientWidth + oCanvas.scrollLeft : window.innerWidth + window.pageXOffset;
w_height = window.innerHeight ? window.innerHeight + window.pageYOffset : oCanvas.clientHeight + oCanvas.scrollTop; // should be vice verca since Opera 7 is crazy!

tooltip.t.style.width = ((tooltip.max_width) && (tooltip.t.offsetWidth > tooltip.max_width)) ? tooltip.max_width + "px" : "auto";

t_width = tooltip.t.offsetWidth;
t_height = tooltip.t.offsetHeight;

tooltip.t.style.left = x + 8 + "px";
tooltip.t.style.top = y + 8 + "px";

if (x + t_width > w_width) tooltip.t.style.left = w_width - t_width + "px";
if (y + t_height > w_height) tooltip.t.style.top = w_height - t_height + "px";
}
}

var root = window.addEventListener || window.attachEvent ? window : document.addEventListener ? document : null;
if (root){
if (root.addEventListener) root.addEventListener("load", tooltip.d, false);
else if (root.attachEvent) root.attachEvent("onload", tooltip.d);
}

