function getHTTPRequestObject()  {var xmlHttpRequest; if (typeof ActiveXObject != 'undefined') {xmlHttpRequest = new ActiveXObject('Microsoft.XMLHTTP');} else if (typeof XMLHttpRequest != 'undefined') {xmlHttpRequest = new XMLHttpRequest();} else {xmlHttpRequest = false;} return xmlHttpRequest;}
function elementIn (id) {var element = document.getElementById(id); 	for (var i=0; i<element.childNodes.length; i++) {		var node = element.childNodes[i]; if (node.className && node.className=="in")  { return node; } } return null; }
function load_g(id) {LoadIt("rightFrame.php?id="+encodeURIComponent(id),elementIn("right"));}
function load_l(id) {LoadIt("leftFrame.php?id="+encodeURIComponent(id),elementIn("left")); LoadIt("mainFrame.php?id="+encodeURIComponent(id),elementIn("center")); return false;}
function load_t(id) {str_div(138);LoadIt2("topFrame.php?id="+encodeURIComponent(id),document.getElementById("forheader"));}
function load_b(id) {str_div(68);LoadIt2("bottomFrame.php?id="+encodeURIComponent(id),elementIn("bottom"));}
function LoadIt(url, element){ var request = getHTTPRequestObject(); var loading="<span class=\"loading\">Загрузка</span>"; request.onreadystatechange = function() { if (request.readyState == 1) {element.innerHTML=loading;}    if (request.readyState == 4)  { if (request.status == 200)   element.innerHTML =  request.responseText + "<hr/>"; res();      }}; request.open("GET", url); request.send(null);}
function LoadIt2(url, element){ var request = getHTTPRequestObject(); request.onreadystatechange = function() {     if (request.readyState == 4)  { if (request.status == 200)   element.innerHTML =  request.responseText + "<hr/>"; res();      }}; request.open("GET", url); request.send(null);}
var Geometry = {};
if (window.innerWidth) {  Geometry.getViewportHeight = function( ) { return window.innerHeight; };} else if (document.documentElement && document.documentElement.clientWidth) { Geometry.getViewportHeight = function( ) { return document.documentElement.clientHeight; };} else if (document.body.clientWidth) { Geometry.getViewportHeight = function( ) { return document.body.clientHeight; };}
function  res () { var h, h_top, h_center, h_bottom, h_side; h=Geometry.getViewportHeight(); if (document.getElementById("top")){h_top=document.getElementById("top").clientHeight;} else {h_top=0;}  if (document.getElementById("center")) 	{h_center=document.getElementById("center").clientHeight;} else 	{h_center=0;}  if (document.getElementById("bottom")) 	{h_bottom=document.getElementById("bottom").clientHeight;} else 	{h_bottom=0;}  if (h_top+h_center+h_bottom<h) {h_side=h-h_top-h_bottom;} else {h_side=h-h_top;}  if (document.getElementById("left")) {document.getElementById("left").style.height=h_side + 'px';}  if (document.getElementById("right")) {document.getElementById("right").style.height=h_side + 'px';}}
function  res_m () { var h, h_top, h_center, h_bottom; h=Geometry.getViewportHeight(); if (document.getElementById("top")){h_top=document.getElementById("top").clientHeight;} else {h_top=0;} if (document.getElementById("center")){h_center=document.getElementById("center").clientHeight;} else {h_center=0;}if (document.getElementById("bottom")) 	{h_bottom=document.getElementById("bottom").clientHeight;} else 	{h_bottom=0;} if (h-h_top-h_bottom-h_center>0) {h_center=h-h_top-h_bottom-1;if (document.getElementById("center")) {document.getElementById("center").style.height=h_center+ 'px';}}  }
function  res_c () {var h, h_top, h_center, h_bottom, h_side; h=Geometry.getViewportHeight(); if (document.getElementById("top")) {h_top=document.getElementById("top").clientHeight;} else {h_top=0;} if (document.getElementById("bottom")) {h_bottom=document.getElementById("bottom").clientHeight;} else {h_bottom=0;} if (document.getElementById("center")) 	{h_center=h-h_top-h_bottom} if (document.getElementById("center")) {document.getElementById("center").style.height=h_center + 'px';} if (h_top+h_center+h_bottom<h) {h_side=h-h_top-h_bottom;} else {h_side=h-h_top;} h_side=h-h_top-h_bottom; if (document.getElementById("left")) {document.getElementById("left").style.height=h_side + 'px';} if (document.getElementById("right")) {document.getElementById("right").style.height=h_side + 'px';}}  
function popup(path, name, width, height) {var left_; var top_; left_=Math.round((screen.width/2-(width)/2)-20); top_=Math.round((screen.height/2 - (height)/2)-20); var popupit = window.open (path, name, "height="+height+", width="+width+", left="+left_+", top="+top_+",  scrollbars=4, resizable=1 status=none");     if (popupit) {popupit.focus();}}
function str_main() {document.write("<div style=\"padding:0 0 17px 0;\"><img src=\"/img/logo_11.gif\" alt=\"Архитектурная\"></div>"); document.write("<div style=\"padding:0 0 17px 0;\"><img src=\"/img/logo_12.gif\" alt=\"мастерская\"></div>"); document.write("<div style=\"padding:0 0 30px 0;\"><img src=\"/img/logo_132.gif\" alt=\"Олега Климова\"></div>"); document.write("<div><img src=\"/img/logo_2.gif\" alt=\"Arch. Bureau of O.E. Klimov\"></div>");}
function str_div(h) {document.write("<div style=\"height:"+h+"px;\"> </div>");}
function clear_alt(id) {if (id.alt) {id.alt="Увеличить изображение в новом окне";}}
function clear_alt2(id) {if (id.alt) {id.alt="Закрыть окно";}}
function samedomain () { if (document.referrer && document.domain) {if (document.referrer == "" || document.referrer.indexOf(document.domain) == -1 || document.referrer.indexOf(document.domain) > 10) {return false;} else {return true;} } else {return true;}}
function closeit() {if (samedomain ()) {self.close();}}

