var objects = Array (), objectsLength = 0;
var xFull, yFull, xAll, yAll, wHouse, hHouse, xMolbert, yMolbert, startX, startY, endX, endY, kX, kY;
var houseBlue, houseBlueDouble, houseBlueTripple;
var isSafari = navigator.userAgent.indexOf ("Safari") > 0;
var textLesser = document.getElementById ("text-lesser");

function getImage(image)
{
  if ($.browser.opera) {
      image += '?' + Math.random();
  }
  
  return image;
}



function bodyResize ()
{
	for (var i = 0; i < objectsLength; i++)
		objects [i].higher.removeChild (objects [i].node);
	objectsLength = 0;
	document.getElementById ("room-projects").style.fontSize = "18px";
	document.getElementById ("room-services").style.fontSize = "18px";
	document.getElementById ("room-reference").style.fontSize = "18px";
	document.getElementById ("room-team").style.fontSize = "18px";
	document.getElementById ("contact").style.fontSize = "18px";
	document.getElementById ("room-blog").style.fontSize = "18px";
	document.getElementById ("room-search").style.fontSize = "18px";
	document.getElementById ("contact").style.fontSize = "18px";
	document.getElementById ("links").style.fontSize = "12px";
	document.body.style.overflow = "hidden";

	//sysVars
	xFull = (window.innerWidth ? window.innerWidth : (document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.offsetWidth));
    yFull = (window.innerHeight ? window.innerHeight : (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.offsetHeight));
	if (yFull < 600)
	{
		yFull = 600;
		document.body.style.overflow = "auto";
	}
	
	xAll = document.getElementById ("pics").offsetWidth;
	hHouse = yAll = yFull - document.getElementById ("pics").offsetTop;
	wHouse = yAll / 756 *1013;
	if (xFull < xAll)
		document.body.style.overflow = "auto";

	// functions
	function disableSelection (obj)
	{
		obj.onselectstart = new Function ("return false");
		obj.disabled = true;
		obj.onmousemove = function (e)
		{
			try { obj.focus() }
			catch (e)
			{
				obj.disabled = false;
				obj.focus();
				obj.disabled = true;
			}
		}
	}

	function boo () { return null; }

	function openField ()
	{
		textLesser.style.visibility = "visible";
		if (isSafari)
		{
			var it = this.parentNode.parentNode.parentNode;
			var spans = it.getElementsByTagName ("div");
			var div = document.createElement ("div");
			div.style.position = "absolute";
			div.style.top = "-100px";
			div.innerHTML = spans [3].innerHTML;
			document.body.appendChild (div);
			var size = div.offsetWidth;
			document.body.removeChild (div);
			this.onmouseover = boo;
			spans [1].style.paddingRight = "3px";
			spans [2].style.display = "none";
			spans [3].style.display = "block";
			spans [3].style.width = size - 13 + "px";
			spans [1].style.width = size - 25 + "px";
			spans [0].style.width = size - 22 + "px";
			it.style.width = size - 14 + "px";
			it.style.marginLeft = -(size - 10) / 2 + "px";
			spans [3].onmouseout = closeField;
		}
		else
		{
			var spans = this.getElementsByTagName ("div");
			this.onmouseover = boo;
			spans [1].style.paddingRight = "3px";
			spans [2].style.display = "none";
			spans [3].style.display = "block";
			this.style.marginLeft = -(spans [3].offsetWidth - 10) / 2 + "px";
			this.onmouseout = closeField;
		}
	}

	function closeField ()
	{
		textLesser.style.visibility = "hidden";
		if (isSafari)
		{
			var it = this.parentNode.parentNode.parentNode;
			var spans = it.getElementsByTagName ("div");
			this.onmouseout = boo;
			spans [1].style.paddingRight = "0";
			spans [2].style.display = "block";
			spans [3].style.display = "none";
			it.style.marginLeft = "0";
			spans [2].onmouseover = openField;
			spans [1].style.width = 0;
			spans [0].style.width = 0;
			it.style.width = "8px";
		}
		else
		{
			var spans = this.getElementsByTagName ("div");
			this.onmouseout = boo;
			spans [1].style.paddingRight = "0";
			spans [2].style.display = "block";
			spans [3].style.display = "none";
			this.style.marginLeft = "0";
			this.onmouseover = openField;
		}
	}

	//	MAIN:
	//		house
	var houseMainBg = document.getElementById ("house-main-bg");
	houseMainBg.style.height = yAll + "px";
	houseMainBg.style.width = Math.round (1013 * yAll / 756) + "px";
	houseMainBg.style.marginLeft = (houseMainBg.parentNode.offsetWidth - wHouse) / 2 + "px";
	disableSelection (houseMainBg);
	transparent (houseMainBg);

	houseBlue = document.getElementById ("house-blue");
	houseBlue.style.height = yAll + "px";
	houseBlue.style.width = Math.round (1013 * yAll / 756) + "px";
	houseBlue.style.marginLeft = (houseBlue.parentNode.offsetWidth - wHouse) / 2 + "px";
	disableSelection (houseBlue);
	transparent (houseBlue);

	houseBlueDouble = document.getElementById ("house-blue-double");
	houseBlueDouble.style.height = yAll + "px";
	houseBlueDouble.style.width = Math.round (1013 * yAll / 756) + "px";
	houseBlueDouble.style.marginLeft = (houseBlueDouble.parentNode.offsetWidth - wHouse) / 2 + "px";
	disableSelection (houseBlueDouble);
	transparent (houseBlueDouble);

	houseBlueTripple = document.getElementById ("house-blue-tripple");
	houseBlueTripple.style.height = yAll + "px";
	houseBlueTripple.style.width = Math.round (1013 * yAll / 756) + "px";
	houseBlueTripple.style.marginLeft = (houseBlueTripple.parentNode.offsetWidth - wHouse) / 2 + "px";
	disableSelection (houseBlueTripple);
	transparent (houseBlueTripple);

	//		ground
	var ch, ground = document.getElementById ("ground"), groundImage;
	if ("\v" != "v")
	{
		groundImage = new Image ();
		groundImage.src = getImage("/images/ground.png");
		groundImage.onload = function ()
		{
			var offset = 0, kOffset = Math.ceil (yAll / 756 * 112)
			while (offset <= xAll + 200)
			{
				ch = document.createElement ("img");
				ch.src = this.src;
				ch.className = "ground-image";
				ch.style.height = kOffset + "px";
				ch.style.marginLeft = offset + "px";
				offset += ch.width * kOffset / ch.height;
				ground.appendChild (ch);
			}
			ground.style.width = offset + "px";
			ground.style.left = - offset + xAll + "px";
			ground.style.marginTop = - ch.height + "px";
			ground.style.height = ch.height + "px";
			ground.style.top = yFull + "px";
		}
	}
	else
	{
		var offset = 0, kOffset = Math.ceil (yAll / 756 * 112)
		while (offset <= xAll + 200)
		{
			ch = document.createElement ("img");
			ch.src = getImage("/images/ground.png");
			ch.className = "ground-image";
			ch.style.height = kOffset + "px";
			ch.style.marginLeft = offset + "px";
			offset += ch.width * kOffset / ch.height;
			ground.appendChild (ch);
		}
		ground.style.width = offset + "px";
		ground.style.left = - offset + xAll + "px";
		ground.style.marginTop = - ch.height + "px";
		ground.style.height = ch.height + "px";
		ground.style.top = yFull + "px";
	}

	//		3D ants and pics
	var letters = new Array (), letter;
	if ('\v' != 'v') //not IE. made for KHTML browsers but works on others
	{
		var ants, antsImage, antsHeight;
		antsImage = new Image ();
		antsImage.src = getImage("/images/ant-at-roof.png");
		antsImage.onload = function ()
		{
			ants = document.createElement ("img");
			ants.src = this.src;
			ants.id = "ant-at-roof";
			ants.className = "ants";
			ants.style.left = Math.ceil ((houseMainBg.parentNode.offsetWidth - wHouse) / 2 + wHouse * 232 / 1013) + "px";
			antsHeight = ants.height;
			if (yAll < 720)
			{
				antsHeight = Math.round (ants.height * yAll / 756);
				ants.style.height = antsHeight + "px";
				ants.style.width = Math.round (ants.width * yAll / 756) + "px";
			}
			ants.style.top = yFull - antsHeight - Math.ceil (yAll / 756 * 558) + "px";
			transparent (ants);
			document.getElementById ("ants").appendChild (ants);
			objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};
		}

		antsImage = new Image ();
		antsImage.src = getImage("/images/stones-and-pencil.png");
		antsImage.onload = function ()
		{
			ants = document.createElement ("img");
			ants.src = this.src;
			ants.id = "stones-and-pencil";
			ants.className = "ants";
			ants.style.left = Math.ceil ((houseMainBg.parentNode.offsetWidth - wHouse) / 2 + wHouse * 781 / 1013) + "px";
			antsHeight = ants.height;
			if (yAll < 720)
			{
				antsHeight = Math.round (ants.height * yAll / 756);
				ants.style.height = antsHeight + "px";
				ants.style.width = Math.round (ants.width * yAll / 756) + "px";
			}
			ants.style.top = yFull - antsHeight - Math.ceil (yAll / 756 * 112) + 1 + "px";
			transparent (ants);
			document.getElementById ("ants").appendChild (ants);
			objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};
		}

		antsImage = new Image ();
		antsImage.src = getImage("/images/ant-blog.png");
		antsImage.onload = function ()
		{
			ants = document.createElement ("img");
			ants.src = this.src;
			ants.id = "ant-blog";
			ants.className = "ants";
			ants.style.left = Math.ceil ((houseMainBg.parentNode.offsetWidth - wHouse) / 2 + wHouse * 932 / 1013) + "px";
			antsHeight = ants.height;
			if (yAll < 720)
			{
				antsHeight = Math.round (ants.height * yAll / 756);
				ants.style.height = antsHeight + "px";
				ants.style.width = Math.round (ants.width * yAll / 756) + "px";
			}
			ants.style.top = yFull - antsHeight - Math.ceil (yAll / 756 * 112) + 1 + "px";
			transparent (ants);
			document.getElementById ("ants").appendChild (ants);
			objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};
		}

		antsImage = new Image ();
		antsImage.src = getImage("/images/ant-search.png");
		antsImage.onload = function ()
		{
			ants = document.createElement ("img");
			ants.src = this.src;
			ants.id = "ant-search";
			ants.className = "ants";
			ants.style.left = Math.ceil ((houseMainBg.parentNode.offsetWidth - wHouse) / 2 + wHouse * 36 / 1013) + "px";
			antsHeight = ants.height;
			if (yAll < 720)
			{
				antsHeight = Math.round (ants.height * yAll / 756);
				ants.style.height = antsHeight + "px";
				ants.style.width = Math.round (ants.width * yAll / 756) + "px";
			}
			ants.style.top = yFull - antsHeight - Math.ceil (yAll / 756 * 112) + 1 + "px";
			transparent (ants);
			document.getElementById ("ants").appendChild (ants);
			objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};
		}

		antsImage = new Image ();
		antsImage.src = getImage("/images/grass.png");
		antsImage.onload = function ()
		{
			ants = document.createElement ("img");
			ants.src = this.src;
			ants.id = "grass";
			ants.className = "ants";
			ants.style.left = Math.ceil ((houseMainBg.parentNode.offsetWidth - wHouse) / 2 + wHouse * 29 / 1013) - 107 + "px";
			antsHeight = ants.height;
			if (yAll < 720)
			{
				antsHeight = Math.round (ants.height * yAll / 756);
				ants.style.height = antsHeight + "px";
				ants.style.width = Math.round (ants.width * yAll / 756) + "px";
			}
			ants.style.top = yFull - antsHeight - Math.ceil (yAll / 756 * 112) + 2 + "px";
			transparent (ants);
			document.getElementById ("ants").appendChild (ants);
			objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};
		}
	}
	else
	{
		ants = document.createElement ("img");
		ants.src = getImage("/images/ant-at-roof.png");
		ants.id = "ant-at-roof";
		ants.className = "ants";
		ants.style.left = Math.ceil ((houseMainBg.parentNode.offsetWidth - wHouse) / 2 + wHouse * 232 / 1013) + "px";
		antsHeight = ants.height;
		if (yAll < 720)
		{
			antsHeight = Math.round (ants.height * yAll / 756);
			ants.style.height = antsHeight + "px";
			ants.style.width = Math.round (ants.width * yAll / 756) + "px";
		}
		ants.style.top = yFull - antsHeight - Math.ceil (yAll / 756 * 558) + "px";
		transparent (ants);
		document.getElementById ("ants").appendChild (ants);
		objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};

		ants = document.createElement ("img");
		ants.src = getImage("/images/stones-and-pencil.png");
		ants.id = "stones-and-pencil";
		ants.className = "ants";
		ants.style.left = Math.ceil ((houseMainBg.parentNode.offsetWidth - wHouse) / 2 + wHouse * 781 / 1013) + "px";
		antsHeight = ants.height;
		if (yAll < 720)
		{
			antsHeight = Math.round (ants.height * yAll / 756);
			ants.style.height = antsHeight + "px";
			ants.style.width = Math.round (ants.width * yAll / 756) + "px";
		}
		ants.style.top = yFull - antsHeight - Math.ceil (yAll / 756 * 112) + 1 + "px";
		transparent (ants);
		document.getElementById ("ants").appendChild (ants);
		objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};

		ants = document.createElement ("img");
		ants.src = getImage("/images/ant-blog.png");
		ants.id = "ant-blog";
		ants.className = "ants";
		ants.style.left = Math.ceil ((houseMainBg.parentNode.offsetWidth - wHouse) / 2 + wHouse * 932 / 1013) + "px";
		antsHeight = ants.height;
		if (yAll < 720)
		{
			antsHeight = Math.round (ants.height * yAll / 756);
			ants.style.height = antsHeight + "px";
			ants.style.width = Math.round (ants.width * yAll / 756) + "px";
		}
		ants.style.top = yFull - antsHeight - Math.ceil (yAll / 756 * 112) + 1 + "px";
		transparent (ants);
		document.getElementById ("ants").appendChild (ants);
		objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};

		ants = document.createElement ("img");
		ants.src = getImage("/images/ant-search.png");
		ants.id = "ant-search";
		ants.className = "ants";
		ants.style.left = Math.ceil ((houseMainBg.parentNode.offsetWidth - wHouse) / 2 + wHouse * 36 / 1013) + "px";
		antsHeight = ants.height;
		if (yAll < 720)
		{
			antsHeight = Math.round (ants.height * yAll / 756);
			ants.style.height = antsHeight + "px";
			ants.style.width = Math.round (ants.width * yAll / 756) + "px";
		}
		ants.style.top = yFull - antsHeight - Math.ceil (yAll / 756 * 112) + 1 + "px";
		transparent (ants);
		document.getElementById ("ants").appendChild (ants);
		objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};

		ants = document.createElement ("img");
		ants.src = getImage("/images/grass.png");
		ants.id = "grass";
		ants.className = "ants";
		ants.style.left = Math.ceil ((houseMainBg.parentNode.offsetWidth - wHouse) / 2 + wHouse * 29 / 1013) - 107 + "px";
		antsHeight = ants.height;
		if (yAll < 720)
		{
			antsHeight = Math.round (ants.height * yAll / 756);
			ants.style.height = antsHeight + "px";
			ants.style.width = Math.round (ants.width * yAll / 756) + "px";
		}
		ants.style.top = yFull - antsHeight - Math.ceil (yAll / 756 * 112) + 1 + "px";
		transparent (ants);
		document.getElementById ("ants").appendChild (ants);
		objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};
	}

	//		inner lines
	kX = wHouse / 1013;
	kY = yAll / 756;
	startX = Math.ceil (houseMainBg.parentNode.offsetWidth - wHouse) / 2 + kX * 179;
	startY = yFull - Math.ceil (kY * 672);
	endX = Math.ceil (houseMainBg.parentNode.offsetWidth - wHouse) / 2 + kX * 818;
	endY = yFull - Math.ceil (kY * 18);
	var	lines = document.getElementById ("lines");
	function lineX (origX, origY, dY, dStart, dEnd, length)
	{
		var line = document.createElement ("img");
		line.src = getImage("/images/horiz.gif");
		line.className = "white-line";
		line.style.height = "1px";
		line.style.width = Math.ceil (length * kX) + dEnd - dStart + "px";
		line.style.left = startX + Math.ceil (origX * kX) + dStart + "px";
		line.style.top = startY + Math.ceil (origY * kY) + dY + "px";
		lines.appendChild (line);
		objects [objectsLength++] = { higher: lines, node: line};
		return startY + Math.ceil (origY * kY) + dY;
	}
	function lineY (origX, origY, dX, dStart, dEnd, length)
	{
		var line = document.createElement ("img");
		line.src = getImage("/images/vert.gif");
		line.className = "white-line";
		line.style.height = Math.ceil (length * kY) + dEnd - dStart + "px";
		line.style.width = "1px";
		line.style.left = startX + Math.ceil (origX * kX) + dX + "px";
		line.style.top = startY + Math.ceil (origY * kY) + dStart + "px";
		lines.appendChild (line);
		objects [objectsLength++] = { higher: lines, node: line};
		return startX + Math.ceil (origX * kX) + dX;
	}
	function lineRealX (origX, realY, dY, dStart, dEnd, length)
	{
		var line = document.createElement ("img");
		line.src = getImage("/images/horiz.gif");
		line.className = "white-line";
		line.style.height = "1px";
		line.style.width = Math.ceil (length * kX) + dEnd - dStart + "px";
		line.style.left = startX + Math.ceil (origX * kX) + dStart + "px";
		line.style.top = realY + dY + "px";
		lines.appendChild (line);
		objects [objectsLength++] = { higher: lines, node: line};
		return realY + dY;
	}

	lines.style.width = xAll + "px";
	lines.style.height = yAll + "px";

	var upperStairs, lowerStairs, basicStairs;
	//			rooms
	lineX (243, 193, 0, 0, -2, 21);
	lineX (264, 193, 0, 2, -2, 35);
	lineX (299, 193, 0, 2, 0, 322);

	lineX (243, 193, 15, 0, -2, 21);
	lineX (264, 193, 15, 2, -2, 35); //also stairs part
	lineX (299, 193, 15, 2, 0, 17);
	lineX (316, 193, 15, 15, 0, 309);

	lineY (243, 193, 0, 0, 15, 0);
	lineY (316, 193, 0, 15, 0, 183);
	lineY (316, 193, 15, 15, 0, 183);
	
	lowerStairs = lineX (0, 376, 0, 0, 0, 317);
	lineX (316, 376, 0, 15, 0, 312);
	lineX (0, 376, 15, 0, 0, 134);
	lineX (134, 376, 15, 15, 0, 491);
	lineY (134, 376, 0, 15, 0, 184);
	lineY (134, 376, 15, 15, 0, 184);
	lineX (68, 560, 0, 0, 0, 66);
	lineX (134, 560, 0, 15, 0, 388);
	var dx = yAll > 782 ? 0 : (yAll > 729 ? 1 : (yAll > 700 ? 2 : (yAll > 629 ? 3 : (yAll > 611 ? 4 : (yAll > 545 ? 5 : 6)))))
	lineX (80, 560, 15, dx, -dx, 427);

	//			stairs
	lineY (264, 174, -2, 0, 0, 202);
	lineY (264, 174, 2, 0, 0, 202);
	lineY (299, 174, -2, 0, 0, 202);
	lineY (299, 174, 2, 0, 0, 202);
	upperStairs = lineX (264, 174, 0, -2, 2, 0);
	lineX (299, 174, 0, -2, 2, 0);

	basicStairs = lineX (264, 201, 3, 2, -2, 35);

	for (var y = basicStairs - (Math.floor ((basicStairs - upperStairs) / 17) - 1) * 17; y < lowerStairs - 5; y += 17)
	{
		lineRealX (264, y, 0, 2, -2, 35);
		lineRealX (264, y, 4, 2, -2, 35);
	}

	//rectangle (134, 376, 15, 0, 71, 30, 0, 0);
	//rectangle (316, 193, 15, 0, 152, 30, 0, 0);
	
	var d = Math.round (89 * kY - 16) -
			document.getElementById ("contact").offsetHeight - 
			document.getElementById ("little-links").offsetHeight - 
			document.getElementById ("copy").offsetHeight - 
			document.getElementById ("contact").offsetTop;


	document.getElementById ("contact").style.top = Math.round (d / 4) + "px";
	document.getElementById ("little-links").style.top = Math.round (d / 2) + "px";
	document.getElementById ("copy").style.top = Math.round (3 * d / 4) + "px";

	if (yAll < 720)
	{
		document.getElementById ("room-projects").style.fontSize = Math.round ((yAll - 456) / 264 * 6) + 12 + "px";
		document.getElementById ("room-services").style.fontSize = Math.round ((yAll - 456) / 264 * 6) + 12 + "px";
		document.getElementById ("room-reference").style.fontSize = Math.round ((yAll - 456) / 264 * 6) + 12 + "px";
		document.getElementById ("room-team").style.fontSize = Math.round ((yAll - 456) / 264 * 6) + 12 + "px";
		document.getElementById ("room-blog").style.fontSize = Math.round ((yAll - 456) / 264 * 6) + 12 + "px";
		document.getElementById ("room-search").style.fontSize = Math.round ((yAll - 456) / 264 * 6) + 12 + "px";
		document.getElementById ("contact").style.fontSize = Math.round ((yAll - 456) / 264 * 6) + 12 + "px";
		document.getElementById ("links").style.fontSize = Math.round ((yAll - 456) / 264 * 2) + 10 + "px";
		document.getElementById ("copy").style.paddingTop = Math.round ((yAll - 456) / 264 * 1) + 1 + "px"
		document.getElementById ("contact").style.top = Math.round ((yAll - 456) / 264 * 1) - 1 + "px"
		document.getElementById ("little-links").style.top = Math.round ((yAll - 456) / 264 * 3) - 3 + "px"
		document.getElementById ("copy").style.top = Math.round ((yAll - 456) / 264 * 5) - 5 + "px"
	}
	
	var caption = document.getElementById ("room-projects");
	caption.style.left = startX + 293 * kX + (118 * kX - caption.offsetWidth) / 2 - 1 + "px";
	caption.style.top = startY + Math.ceil (3 * kY + (31 * kY - caption.offsetHeight) / 2) + "px";

	caption = document.getElementById ("room-services");
	//caption.style.left = startX + 16 + 316 * kX + (113 * kX - caption.offsetWidth) / 2 - 1 + "px";
    caption.style.left = startX + 32 + 310 * kX + (130 * kX - caption.offsetWidth - 5) / 2 + "px";
	caption.style.top = startY + Math.ceil (193 * kY + (31 * kY - caption.offsetHeight) / 2) + "px";

	caption = document.getElementById ("room-reference");
	caption.style.left = startX + 3 * kX + (132 * kX - caption.offsetWidth) / 2 - 1 + "px";
	caption.style.top = startY + Math.ceil (376 * kY + (31 * kY - caption.offsetHeight) / 2) + "px";

	caption = document.getElementById ("room-team");
	caption.style.left = startX + 16 + 134 * kX + (71 * kX - caption.offsetWidth) / 2 - 1 + "px";
	caption.style.top = startY + Math.ceil (376 * kY + (31 * kY - caption.offsetHeight) / 2) + "px";

	caption = document.getElementById ("room-blog");
	caption.style.left = Math.ceil ((houseMainBg.parentNode.offsetWidth - wHouse) / 2 + wHouse * 781 / 1013) + 183 + "px";
	caption.style.top = yFull - 113 * kY - 327 + "px";
	if (yAll < 720)
	{
		caption.style.left = Math.ceil ((houseMainBg.parentNode.offsetWidth - wHouse) / 2 + wHouse * 781 / 1013) + 183 * kX + "px";
		caption.style.top = yFull - 113 * kY - 327 * kY + "px";
	}

	caption = document.getElementById ("room-search");
	caption.style.left = Math.ceil ((houseMainBg.parentNode.offsetWidth - wHouse) / 2 + wHouse * 29 / 1013) - 107 + "px";
	var searchTop = yFull - 113 * kY - 141;
	if (yAll < 720)
		searchTop = yFull - 113 * kY - 141 * kY;
	caption.style.top = searchTop + "px";

	var input = document.getElementById ("search-word");
	input.style.left = Math.ceil ((houseMainBg.parentNode.offsetWidth - wHouse) / 2 + wHouse * 29 / 1013) - 107 + "px";
	input.style.top = searchTop + caption.offsetHeight - 3 + "px";
	input.style.width = 107 * kX + "px";

    var ssOffset = parseFloat(input.style.width) + 4;
    
    var searchSubmit = document.getElementById ("search-submit");
    searchSubmit.style.left = Math.ceil ((houseMainBg.parentNode.offsetWidth - wHouse) / 2 + wHouse * 29 / 1013) - (107 - ssOffset) + "px";
    searchSubmit.style.top = searchTop + caption.offsetHeight - 3 + "px";
    //searchSubmit.style.width = 107 * kX + "px";

	document.getElementById ("room-captions").style.visibility = "visible";

	var links = document.getElementById ("links");
	links.style.top = startY + 560 * kY + 16 + "px";
	links.style.height = 95 * kY - 16 + "px";
	links.style.left = startX + 139 * kY + "px";
	links.style.width = 308 * kX + "px";

	document.getElementById ("links").style.visibility = "visible";

	var text = document.getElementById ("text-main"), textLeft, textWidth;
	textLeft = Math.ceil ((houseMainBg.parentNode.offsetWidth - wHouse) / 2 + wHouse * 29 / 1013) - 107;
	text.style.left = textLeft + "px";
	text.style.top = yFull - yAll + "px";
	textWidth = startX - textLeft;
	text.style.width = textWidth + "px";

	text = document.getElementById ("text-lesser");
	text.style.left = endX + "px";
	text.style.top = yFull - yAll + 20 + "px";
	text.style.width = textWidth + "px";

	//		2D ants
	if ("\v" != "v")
	{
		antsImage = new Image ();
		antsImage.src = getImage("/images/reference.png");
		antsImage.onload = function ()
		{
			ants = document.createElement ("img");
			ants.src = this.src;
			ants.id = "reference";
			ants.className = "ants";
			ants.style.left = startX + wHouse * 50 / 1013 - 18 + "px";
			antsHeight = ants.height;
			if (yAll < 720)
			{
				antsHeight = Math.round (ants.height * yAll / 756);
				ants.style.height = antsHeight + "px";
				ants.style.width = Math.round (ants.width * yAll / 756) + "px";
				ants.style.left = startX + wHouse * 50 / 1013 - 18 * yAll / 756 + "px";
			}
			ants.style.top = yFull - antsHeight - Math.ceil (yAll / 756 * 112) + 1 + "px";
			transparent (ants);
			document.getElementById ("ants").appendChild (ants);
			objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};
		}

		antsImage = new Image ();
		antsImage.src = getImage("/images/team-ant.png");
		antsImage.onload = function ()
		{
			ants = document.createElement ("img");
			ants.src = this.src;
			ants.id = "team-ant";
			ants.className = "ants";
			ants.style.left = startX + wHouse * 134 / 1013 + 16 + "px";
			antsHeight = ants.height;
			if (yAll < 720)
			{
				antsHeight = Math.round (ants.height * yAll / 756);
				ants.style.height = antsHeight + "px";
				ants.style.width = Math.round (ants.width * yAll / 756) + "px";
			}
			ants.style.top = yFull - antsHeight - Math.ceil (yAll / 756 * 112) + 1 + "px";
			transparent (ants);
			document.getElementById ("ants").appendChild (ants);
			objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};
		}

		antsImage = new Image ();
		antsImage.src = getImage("/images/team-main.png");
		antsImage.onload = function ()
		{
			ants = document.createElement ("img");
			ants.src = this.src;
			ants.id = "team-main";
			ants.className = "ants";
			ants.style.left = startX + wHouse * 528 / 1013 - 342 + "px";
			antsHeight = ants.height;
			if (yAll < 720)
			{
				antsHeight = Math.round (ants.height * yAll / 756);
				ants.style.height = antsHeight + "px";
				ants.style.width = Math.round (ants.width * yAll / 756) + "px";
				ants.style.left = startX + wHouse * 528 / 1013 - 342 * yAll / 756 + "px";
			}
			ants.style.top = yFull - antsHeight - Math.ceil (yAll / 756 * 112) + 1 + "px";
			transparent (ants);
			document.getElementById ("ants").appendChild (ants);
			objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};
		}

		antsImage = new Image ();
		antsImage.src = getImage("/images/services-beatle.png");
		antsImage.onload = function ()
		{
			ants = document.createElement ("img");
			ants.src = this.src;
			ants.id = "services-beatle";
			ants.className = "ants";
			ants.style.left = endX - 124 + "px";
			antsHeight = ants.height;
			if (yAll < 720)
			{
				antsHeight = Math.round (ants.height * yAll / 756);
				ants.style.height = antsHeight + "px";
				ants.style.width = Math.round (ants.width * yAll / 756) + "px";
				ants.style.left = endX - 124 * yAll / 756 + "px";
			}
			ants.style.top = yFull - antsHeight - Math.ceil (yAll / 756 * 296) + 1 + "px";
			transparent (ants);
			document.getElementById ("ants").appendChild (ants);
			objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};
		}

		antsImage = new Image ();
		antsImage.src = getImage("/images/services-ant.png");
		antsImage.onload = function ()
		{
			ants = document.createElement ("img");
			ants.src = this.src;
			ants.id = "services-ant";
			ants.className = "ants";
			ants.style.left = startX + wHouse * 324 / 1013 + 27 + "px";
			antsHeight = ants.height;
			if (yAll < 720)
			{
				antsHeight = Math.round (ants.height * yAll / 756);
				ants.style.height = antsHeight + "px";
				ants.style.width = Math.round (ants.width * yAll / 756) + "px";
				ants.style.left = startX + wHouse * 324 / 1013 + 27 * yAll / 756 + "px";
			}
			ants.style.top = yFull - antsHeight - Math.ceil (yAll / 756 * 296) + 1 + "px";
			transparent (ants);
			document.getElementById ("ants").appendChild (ants);
			objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};
		}

		antsImage = new Image ();
		antsImage.src = getImage("/images/projects-fikus.png");
		antsImage.onload = function ()
		{
			ants = document.createElement ("img");
			ants.src = this.src;
			ants.id = "projects-fikus";
			ants.className = "ants";
			ants.style.left = startX + 23 + "px";
			antsHeight = ants.height;
			if (yAll < 720)
			{
				antsHeight = Math.round (ants.height * yAll / 756);
				ants.style.height = antsHeight + "px";
				ants.style.width = Math.round (ants.width * yAll / 756) + "px";
				ants.style.left = startX + 23 * yAll / 756 + "px";
			}
			ants.style.top = yFull - antsHeight - Math.ceil (yAll / 756 * 296) + 1 + "px";
			transparent (ants);
			document.getElementById ("ants").appendChild (ants);
			objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};
		}

		antsImage = new Image ();
		antsImage.src = getImage("/images/projects-molbert.png");
		antsImage.onload = function ()
		{
			ants = document.createElement ("img");
			ants.src = this.src;
			ants.id = "projects-molbert";
			ants.className = "ants";
			ants.style.left = startX + wHouse * 264 / 1013 - 111 + "px";
			antsHeight = ants.height;
			if (yAll < 720)
			{
				antsHeight = Math.round (ants.height * yAll / 756);
				ants.style.height = antsHeight + "px";
				ants.style.width = Math.round (ants.width * yAll / 756) + "px";
				ants.style.left = startX + wHouse * 264 / 1013 - 111 * yAll / 756 + "px";
			}
			ants.style.top = yFull - antsHeight - Math.ceil (yAll / 756 * 296) + 1 + "px";
			transparent (ants);
			document.getElementById ("ants").appendChild (ants);
			objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};
		}

		antsImage = new Image ();
		antsImage.src = getImage("/images/projects-chair.png");
		antsImage.onload = function ()
		{
			ants = document.createElement ("img");
			ants.src = this.src;
			ants.id = "projects-chair";
			ants.className = "ants";
			ants.style.left = startX + wHouse * 264 / 1013 - 185 + "px";
			antsHeight = ants.height;
			if (yAll < 720)
			{
				antsHeight = Math.round (ants.height * yAll / 756);
				ants.style.height = antsHeight + "px";
				ants.style.width = Math.round (ants.width * yAll / 756) + "px";
				ants.style.left = startX + wHouse * 264 / 1013 - 185 * yAll / 756 + "px";
			}
			ants.style.top = yFull - antsHeight - Math.ceil (yAll / 756 * 296) + 1 + "px";
			transparent (ants);
			document.getElementById ("ants").appendChild (ants);
			objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};
		}

		antsImage = new Image ();
		antsImage.src = getImage("/images/projects-picture.png");
		antsImage.onload = function ()
		{
			ants = document.createElement ("img");
			ants.src = this.src;
			ants.id = "r2";
			ants.className = "ants";
			ants.style.left = startX + wHouse * 122 / 1013 - 37 + "px";
			ants.style.top = startY + Math.ceil (yAll / 756 * 180) - 28 + "px";
			antsHeight = ants.height;
			if (yAll < 720)
			{
				antsHeight = Math.round (ants.height * yAll / 756);
				ants.style.height = antsHeight + "px";
				ants.style.width = Math.round (ants.width * yAll / 756) + "px";
				ants.style.top = startY + Math.ceil (yAll / 756 * 180) - 28 * yAll / 756 + "px";
				ants.style.left = startX + wHouse * 122 / 1013 - 37 * yAll / 756 + "px";
			}
			transparent (ants);
			document.getElementById ("ants").appendChild (ants);
			objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};
		}

		antsImage = new Image ();
		antsImage.src = getImage("/images/projects-picture.png");
		antsImage.onload = function ()
		{
			ants = document.createElement ("img");
			ants.src = this.src;
			ants.id = "r3";
			ants.className = "ants";
			ants.style.left = startX + wHouse * 215 / 1013 - 37 + "px";
			ants.style.top = yFull - Math.ceil (yAll / 756 * 471) - 150 + "px"
			antsHeight = ants.height;
			if (yAll < 720)
			{
				antsHeight = Math.round (ants.height * yAll / 756);
				ants.style.height = antsHeight + "px";
				ants.style.width = Math.round (ants.width * yAll / 756) + "px";
				ants.style.top = yFull - Math.ceil (yAll / 756 * 471) - 150 * yAll / 756 + "px";
				ants.style.left = startX + wHouse * 215 / 1013 - 37 * yAll / 756 + "px";
			}
			transparent (ants);
			document.getElementById ("ants").appendChild (ants);
			objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};
		}

		antsImage = new Image ();
		antsImage.src = getImage("/images/projects-picture.png");
		antsImage.onload = function ()
		{
			ants = document.createElement ("img");
			ants.src = this.src;
			ants.id = "r4";
			ants.className = "ants";
			ants.style.left = startX + wHouse * 304 / 1013 - 37 + "px";
			ants.style.top = yFull - Math.ceil (yAll / 756 * 471) - 150 + "px"
			antsHeight = ants.height;
			if (yAll < 720)
			{
				antsHeight = Math.round (ants.height * yAll / 756);
				ants.style.height = antsHeight + "px";
				ants.style.width = Math.round (ants.width * yAll / 756) + "px";
				ants.style.top = yFull - Math.ceil (yAll / 756 * 471) - 150 * yAll / 756 + "px";
				ants.style.left = startX + wHouse * 304 / 1013 - 37 * yAll / 756 + "px";
			}
			transparent (ants);
			document.getElementById ("ants").appendChild (ants);
			objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};
		}

		antsImage = new Image ();
		antsImage.src = getImage("/images/projects-picture.png");
		antsImage.onload = function ()
		{
			ants = document.createElement ("img");
			ants.src = this.src;
			ants.id = "r5";
			ants.className = "ants";
			ants.style.left = startX + wHouse * 393 / 1013 - 37 + "px";
			ants.style.top = yFull - Math.ceil (yAll / 756 * 471) - 150 + "px"
			antsHeight = ants.height;
			if (yAll < 720)
			{
				antsHeight = Math.round (ants.height * yAll / 756);
				ants.style.height = antsHeight + "px";
				ants.style.width = Math.round (ants.width * yAll / 756) + "px";
				ants.style.top = yFull - Math.ceil (yAll / 756 * 471) - 150 * yAll / 756 + "px";
				ants.style.left = startX + wHouse * 393 / 1013 - 37 * yAll / 756 + "px";
			}
			transparent (ants);
			document.getElementById ("ants").appendChild (ants);
			objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};
		}

		antsImage = new Image ();
		antsImage.src = getImage("/images/projects-picture.png");
		antsImage.onload = function ()
		{
			ants = document.createElement ("img");
			ants.src = this.src;
			ants.id = "r6";
			ants.className = "ants";
			ants.style.left = startX + wHouse * 482 / 1013 - 37 + "px";
			ants.style.top = yFull - Math.ceil (yAll / 756 * 471) - 150 + "px"
			antsHeight = ants.height;
			if (yAll < 720)
			{
				antsHeight = Math.round (ants.height * yAll / 756);
				ants.style.height = antsHeight + "px";
				ants.style.width = Math.round (ants.width * yAll / 756) + "px";
				ants.style.top = yFull - Math.ceil (yAll / 756 * 471) - 150 * yAll / 756 + "px";
				ants.style.left = startX + wHouse * 482 / 1013 - 37 * yAll / 756 + "px";
			}
			transparent (ants);
			document.getElementById ("ants").appendChild (ants);
			objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};
		}
	}
	else
	{
		ants = document.createElement ("img");
		ants.src = getImage("/images/team-ant.png");
		ants.id = "team-ant";
		ants.className = "ants";
		ants.style.left = startX + wHouse * 142 / 1013 + 8 + "px";
		antsHeight = ants.height;
		if (yAll < 720)
		{
			antsHeight = Math.round (ants.height * yAll / 756);
			ants.style.height = antsHeight + "px";
			ants.style.width = Math.round (ants.width * yAll / 756) + "px";
		}
		ants.style.top = yFull - antsHeight - Math.ceil (yAll / 756 * 112) + 1 + "px";
		transparent (ants);
		document.getElementById ("ants").appendChild (ants);
		objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};

		ants = document.createElement ("img");
		ants.src = getImage("/images/reference.png");
		ants.id = "reference";
		ants.className = "ants";
		ants.style.left = startX + wHouse * 50 / 1013 - 18 + "px";
		antsHeight = ants.height;
		if (yAll < 720)
		{
			antsHeight = Math.round (ants.height * yAll / 756);
			ants.style.height = antsHeight + "px";
			ants.style.width = Math.round (ants.width * yAll / 756) + "px";
			ants.style.left = startX + wHouse * 50 / 1013 - 18 * yAll / 756 + "px";
		}
		ants.style.top = yFull - antsHeight - Math.ceil (yAll / 756 * 112) + 1 + "px";
		transparent (ants);
		document.getElementById ("ants").appendChild (ants);
		objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};

		ants = document.createElement ("img");
		ants.src = getImage("/images/team-main.png");
		ants.id = "team-main";
		ants.className = "ants";
		ants.style.left = startX + wHouse * 528 / 1013 - 342 + "px";
		antsHeight = ants.height;
		if (yAll < 720)
		{
			antsHeight = Math.round (ants.height * yAll / 756);
			ants.style.height = antsHeight + "px";
			ants.style.width = Math.round (ants.width * yAll / 756) + "px";
			ants.style.left = startX + wHouse * 528 / 1013 - 342 * yAll / 756 + "px";
		}
		ants.style.top = yFull - antsHeight - Math.ceil (yAll / 756 * 112) + 1 + "px";
		transparent (ants);
		document.getElementById ("ants").appendChild (ants);
		objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};

		ants = document.createElement ("img");
		ants.src = getImage("/images/services-beatle.png");
		ants.id = "services-beatle";
		ants.className = "ants";
		ants.style.left = endX - 124 + "px";
		antsHeight = ants.height;
		if (yAll < 720)
		{
			antsHeight = Math.round (ants.height * yAll / 756);
			ants.style.height = antsHeight + "px";
			ants.style.width = Math.round (ants.width * yAll / 756) + "px";
			ants.style.left = endX - 124 * yAll / 756 + "px";
		}
		ants.style.top = yFull - antsHeight - Math.ceil (yAll / 756 * 296) + 1 + "px";
		transparent (ants);
		document.getElementById ("ants").appendChild (ants);
		objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};

		ants = document.createElement ("img");
		ants.src = getImage("/images/services-ant.png");
		ants.id = "services-ant";
		ants.className = "ants";
		ants.style.left = startX + wHouse * 324 / 1013 + 27 + "px";
		antsHeight = ants.height;
		if (yAll < 720)
		{
			antsHeight = Math.round (ants.height * yAll / 756);
			ants.style.height = antsHeight + "px";
			ants.style.width = Math.round (ants.width * yAll / 756) + "px";
			ants.style.left = startX + wHouse * 324 / 1013 + 27 * yAll / 756 + "px";
		}
		ants.style.top = yFull - antsHeight - Math.ceil (yAll / 756 * 296) + 1 + "px";
		transparent (ants);
		document.getElementById ("ants").appendChild (ants);
		objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};

		ants = document.createElement ("img");
		ants.src = getImage("/images/projects-fikus.png");
		ants.id = "projects-fikus";
		ants.className = "ants";
		ants.style.left = startX + 23 + "px";
		antsHeight = ants.height;
		if (yAll < 720)
		{
			antsHeight = Math.round (ants.height * yAll / 756);
			ants.style.height = antsHeight + "px";
			ants.style.width = Math.round (ants.width * yAll / 756) + "px";
			ants.style.left = startX + 23 * yAll / 756 + "px";
		}
		ants.style.top = yFull - antsHeight - Math.ceil (yAll / 756 * 296) + 1 + "px";
		transparent (ants);
		document.getElementById ("ants").appendChild (ants);
		objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};

		ants = document.createElement ("img");
		ants.src = getImage("/images/projects-molbert.png");
		ants.id = "projects-molbert";
		ants.className = "ants";
		ants.style.left = startX + wHouse * 264 / 1013 - 111 + "px";
		antsHeight = ants.height;
		if (yAll < 720)
		{
			antsHeight = Math.round (ants.height * yAll / 756);
			ants.style.height = antsHeight + "px";
			ants.style.width = Math.round (ants.width * yAll / 756) + "px";
			ants.style.left = startX + wHouse * 264 / 1013 - 111 * yAll / 756 + "px";
		}
		ants.style.top = yFull - antsHeight - Math.ceil (yAll / 756 * 296) + 1 + "px";
		transparent (ants);
		document.getElementById ("ants").appendChild (ants);
		objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};

		ants = document.createElement ("img");
		ants.src = getImage("/images/projects-chair.png");
		ants.id = "projects-chair";
		ants.className = "ants";
		ants.style.left = startX + wHouse * 264 / 1013 - 185 + "px";
		antsHeight = ants.height;
		if (yAll < 720)
		{
			antsHeight = Math.round (ants.height * yAll / 756);
			ants.style.height = antsHeight + "px";
			ants.style.width = Math.round (ants.width * yAll / 756) + "px";
			ants.style.left = startX + wHouse * 264 / 1013 - 185 * yAll / 756 + "px";
		}
		ants.style.top = yFull - antsHeight - Math.ceil (yAll / 756 * 296) + 1 + "px";
		transparent (ants);
		document.getElementById ("ants").appendChild (ants);
		objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};

		ants = document.createElement ("img");
		ants.src = getImage("/images/projects-picture.png");
		ants.id = "r2";
		ants.className = "ants";
		ants.style.left = startX + wHouse * 122 / 1013 - 37 + "px";
		ants.style.top = startY + Math.ceil (yAll / 756 * 180) - 28 + "px";
		antsHeight = ants.height;
		if (yAll < 720)
		{
			antsHeight = Math.round (ants.height * yAll / 756);
			ants.style.height = antsHeight + "px";
			ants.style.width = Math.round (ants.width * yAll / 756) + "px";
			ants.style.top = startY + Math.ceil (yAll / 756 * 180) - 28 * yAll / 756 + "px";
			ants.style.left = startX + wHouse * 122 / 1013 - 37 * yAll / 756 + "px";
		}
		transparent (ants);
		document.getElementById ("ants").appendChild (ants);
		objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};

		ants = document.createElement ("img");
		ants.src = getImage("/images/projects-picture.png");
		ants.id = "r3";
		ants.className = "ants";
		ants.style.left = startX + wHouse * 215 / 1013 - 37 + "px";
		ants.style.top = yFull - Math.ceil (yAll / 756 * 471) - 150 + "px"
		antsHeight = ants.height;
		if (yAll < 720)
		{
			antsHeight = Math.round (ants.height * yAll / 756);
			ants.style.height = antsHeight + "px";
			ants.style.width = Math.round (ants.width * yAll / 756) + "px";
			ants.style.top = yFull - Math.ceil (yAll / 756 * 471) - 150 * yAll / 756 + "px";
			ants.style.left = startX + wHouse * 215 / 1013 - 37 * yAll / 756 + "px";
		}
		transparent (ants);
		document.getElementById ("ants").appendChild (ants);
		objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};

		ants = document.createElement ("img");
		ants.src = getImage("/images/projects-picture.png");
		ants.id = "r4";
		ants.className = "ants";
		ants.style.left = startX + wHouse * 304 / 1013 - 37 + "px";
		ants.style.top = yFull - Math.ceil (yAll / 756 * 471) - 150 + "px"
		antsHeight = ants.height;
		if (yAll < 720)
		{
			antsHeight = Math.round (ants.height * yAll / 756);
			ants.style.height = antsHeight + "px";
			ants.style.width = Math.round (ants.width * yAll / 756) + "px";
			ants.style.top = yFull - Math.ceil (yAll / 756 * 471) - 150 * yAll / 756 + "px";
			ants.style.left = startX + wHouse * 304 / 1013 - 37 * yAll / 756 + "px";
		}
		transparent (ants);
		document.getElementById ("ants").appendChild (ants);
		objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};

		ants = document.createElement ("img");
		ants.src = getImage("/images/projects-picture.png");
		ants.id = "r5";
		ants.className = "ants";
		ants.style.left = startX + wHouse * 393 / 1013 - 37 + "px";
		ants.style.top = yFull - Math.ceil (yAll / 756 * 471) - 150 + "px"
		antsHeight = ants.height;
		if (yAll < 720)
		{
			antsHeight = Math.round (ants.height * yAll / 756);
			ants.style.height = antsHeight + "px";
			ants.style.width = Math.round (ants.width * yAll / 756) + "px";
			ants.style.top = yFull - Math.ceil (yAll / 756 * 471) - 150 * yAll / 756 + "px";
			ants.style.left = startX + wHouse * 393 / 1013 - 37 * yAll / 756 + "px";
		}
		transparent (ants);
		document.getElementById ("ants").appendChild (ants);
		objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};

		ants = document.createElement ("img");
		ants.src = getImage("/images/projects-picture.png");
		ants.id = "r6";
		ants.className = "ants";
		ants.style.left = startX + wHouse * 482 / 1013 - 37 + "px";
		ants.style.top = yFull - Math.ceil (yAll / 756 * 471) - 150 + "px"
		antsHeight = ants.height;
		if (yAll < 720)
		{
			antsHeight = Math.round (ants.height * yAll / 756);
			ants.style.height = antsHeight + "px";
			ants.style.width = Math.round (ants.width * yAll / 756) + "px";
			ants.style.top = yFull - Math.ceil (yAll / 756 * 471) - 150 * yAll / 756 + "px";
			ants.style.left = startX + wHouse * 482 / 1013 - 37 * yAll / 756 + "px";
		}
		transparent (ants);
		document.getElementById ("ants").appendChild (ants);
		objects [objectsLength++] = { higher: document.getElementById ("ants"), node: ants};
	}

	function lineX (origX, origY, dY, dStart, dEnd, length)
	{
        var line = document.createElement ("img");
		line.src = getImage("/images/horiz.gif");
		line.className = "white-line";
		line.style.height = "1px";
		line.style.width = Math.ceil (length * kX) + dEnd - dStart + "px";
		line.style.left = startX + Math.ceil (origX * kX) + dStart + "px";
		line.style.top = startY + Math.ceil (origY * kY) + dY + "px";
		lines.appendChild (line);
		objects [objectsLength++] = { higher: lines, node: line};
		return startY + Math.ceil (origY * kY) + dY;
	}

	function letterStart (id, baseX, addX, dX, baseY, addY)
	{
        try {
            letter = document.getElementById (id);
            letter.style.left = startX + wHouse * baseX / 1013 + addX + dX - 9 + "px";
            letter.style.top = yFull - Math.ceil (yAll / 756 * baseY) - addY - 9 + "px";
            if (yAll < 720)
            {
                letter.style.left = startX + wHouse * baseX / 1013 + addX * yAll / 756 + dX - 9 + "px";
                letter.style.top = yFull - Math.ceil (yAll / 756 * baseY) - addY * yAll / 756 - 9 + "px";
            }
            
            if (isSafari)
                letter.getElementsByTagName ("div") [2].onmouseover = openField;
            else
                letter.onmouseover = openField;            
        } catch(e) {
            
        }

	}
	function letterEnd (id, addX, baseY, addY)
	{
        letter = document.getElementById (id);
		letter.style.left = endX - addX - 9 + "px";
		letter.style.top = yFull - Math.ceil (yAll / 756 * baseY) - addY - 9 + "px";
		if (yAll < 720)
		{
			letter.style.left = endX - addX * yAll / 756 - 9 + "px";
			letter.style.top = yFull - Math.ceil (yAll / 756 * baseY) - addY * yAll / 756 - 9 + "px";
		}
        
		if (isSafari)
			letter.getElementsByTagName ("div") [2].onmouseover = openField;
		else
			letter.onmouseover = openField;
	}

	function rectangle (origX, origY, dX, dY, origWidth, origHeight, dWidth, dHeight)
	{
		var rect = document.createElement ("img");
		rect.src = getImage("/images/white.gif");
		rect.className = "white-rectangle";
		rect.style.width = Math.ceil (origWidth * kX) + dWidth + "px";
		rect.style.height = Math.ceil (origHeight * kY) + dHeight + "px";
		rect.style.left = startX + Math.ceil (origX * kX) + dX + "px";
		rect.style.top = startY + Math.ceil (origY * kY) + dY + "px";
		lines.appendChild (rect);
		objects [objectsLength++] = { higher: lines, node: rect };
		return startY + Math.ceil (origY * kY) + dY;
	}
	letterStart ("letter-consulting", 324, 182, 0, 296, 105);
	letterStart ("letter-convertion", 324, 101, 0, 296, 121);
	letterStart ("letter-development", 324, 69, 0, 296, 74);
	letterStart ("letter-1", 134, 30, 16, 113, 137);
	letterStart ("letter-2", 528, -297, 0, 113, 83);
	letterStart ("letter-3", 528, -239, 0, 113, 119);
	letterStart ("letter-4", 528, -186, 0, 113, 86);
	letterStart ("letter-5", 528, -129, 0, 113, 108);
	letterStart ("letter-6", 528, -59, 0, 113, 136);
	letterStart ("letter-7", 528, 0, 0, 113, 104);
	letterEnd ("letter-advertising", 58, 296, 130);
	letterEnd ("letter-outsource", 47, 296, 58);

	//		�������� �� ���������
	function project (id, baseX, addX, baseY, addY)
	{
		try {
            ants = document.getElementById(id);
            ants.style.left = startX + wHouse * baseX / 1013 - addX + "px";
            ants.style.top = yFull - Math.ceil(yAll / 756 * baseY) - addY + "px";
            ants.style.width = "75px";
            if (yAll < 720) {
                ants.style.width = 75 * yAll / 756 + "px";
                ants.style.top = yFull - Math.ceil(yAll / 756 * baseY) - addY * yAll / 756 + "px";
                ants.style.left = startX + wHouse * baseX / 1013 - addX * yAll / 756 + "px";
            }
        } catch(e) {
            
        }
	}

	//		�������� �� ���������
	project ("p1", 264, 98, 296, 125);
	//		������ ������ (����� �������)
	project ("p2", 122, 37, 491, 14);
	//		������� ��� ��������
	project ("p3", 215, 37, 471, 136);
	project ("p4", 304, 37, 471, 136);
	project ("p5", 393, 37, 471, 136);
	project ("p6", 482, 37, 471, 136);

	document.getElementById ("projects").style.visibility = "visible";
	document.getElementById ("letters").style.visibility = "visible";
}

window.onresize = bodyResize;
bodyResize ();

