<!--


function goToLink(el){
    var sel = el.parentNode.getElementsByTagName("select")[0];
    if (sel.options[sel.selectedIndex].value != "none") {
        location = sel.options[sel.selectedIndex].value;
    }
}

function goToLinkMap(el){
    var sel = document.getElementById("cad_num"); 
    var url = document.URL;
	
    if (sel.value.length != 0) 
    {
        if (url.indexOf("mirror.") > -1) 
	    {
            location = "http://map.mirror.kadastr.ru/land.mapextra.web/default.aspx?cad_num=" + sel.value;	
	    }
	    else
	    {
	        location = "http://map.kadastr.ru/land.mapextra.web/default.aspx?cad_num=" + sel.value;	
	    }
    
    }
}


function goToLinkReq(el)
{
el.disabled= true;
 var ddl1 = document.getElementById("ddlType_0"); 
 var ddl2 = document.getElementById("ddlType_1"); 
 var SelectDdl;
 if (ddl1.checked)
 {
   SelectDdl = ddl1.value;
 }
 else
 {
   SelectDdl = ddl2.value;
 }
  
 var sel = document.getElementById("tbReq"); 
    if (sel.value != '') {
        location = "/online?num=" + escape(sel.value) + "&state=" + SelectDdl;
    }
else
{
  el.disabled= false;
}

}

function goToLinkReqWWW(el)
{

el.disabled= true;

 var ddl1 = document.getElementById("ddlType_0"); 
 var ddl2 = document.getElementById("ddlType_1"); 
  var FddlRegion = document.getElementById("_ctl10_FddlRegion"); 

 var SelectDdl;
 
 if (ddl1.checked)
 {
   SelectDdl = ddl1.value;
 }
 else
 {
   SelectDdl = ddl2.value;
 }

 
 var sel = document.getElementById("tbReq"); 

    if (sel.value != '' && FddlRegion.selectedIndex != 0) {  
        location = "/online?num=" + escape(sel.value) + "&state=" + SelectDdl + "&ko=" + FddlRegion.options[FddlRegion.selectedIndex].value;
    } 
else
{
  el.disabled= false;
} 

}




function openWin(popup_url,popup_name,popup_with,popup_height)
{	
if(!popup_name) {popup_name = 'foto';}
if(!popup_with) {popup_with = 396;}
if(!popup_height) {popup_height = 300;}
	var popup_left = (window.screen.width/2)  - (popup_with/2 - 23);
	var popup_top  = (window.screen.height/2) - (popup_height/2 - 15);
	var fenster = window.open(popup_url,popup_name,"toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=" + popup_with + ",height=" + popup_height + ",left=" + popup_left + ",top=" + popup_top + ",screenX=" + popup_left + ",screenY=" + popup_top);
	fenster.focus();
}

var eventKey;

function registerSubmitHandlers() {

}

function doLinkSubmit(linkID) {
	if ( document.all )
		document.getElementById(linkID).click();
	else
		document.location.href = document.getElementById(linkID).href;
}
function GetCurrentObject(e) {
	if (navigator.userAgent.indexOf("Firefox") > -1) {
		return e.target.tagName;
	}
	else {
		return window.event.srcElement.tagName;
	}
}
function doSubmit(e) {
	if (eval(eventKey) == 13 && GetCurrentObject(e) != "TEXTAREA") {
		for(i=0; i < autoSubmitNames.length; i++) {
			if (autoSubmitNames[i]==this.id) {
				eval(autoSubmit[i]);
				return false;
			}
		}
	}
}
/* версия для печати */
function OpenPrint() {
	window.open("d_roseestr/t/www/print.htm", "_blank");
}

function OpenRequestBlank()
{
  window.open("d_roseestr/t/www/request_blank.htm", "_blank");
}

function SetRequestBlank()
{
    var wo = window.opener;
		
	var el = wo.document.getElementById('mainContent');
	

	var body = document.getElementById("body");
	body.innerHTML += el.innerHTML;
	
	var tables = document.getElementsByTagName("table");
	for (var i = 0; i < tables.length; i++) {
		var table = tables[i];
		if (table.className == "data") {
			table.className = "data_print";
		}
	}
	var divs = document.getElementsByTagName("div");
	for (var i = 0; i < divs.length; i++) {
		var d = divs[i];
		if (d.className.indexOf("print_false") > -1) {
			d.style.display = "none";
		}
	}
	
	var VerPrint = document.getElementById('VerPrint');  
      if (VerPrint != null)
      {        
	      VerPrint.style.display = "none"; 
	  }
}

function SetPrint() {
	var wo = window.opener;
	var title = wo.document.getElementsByTagName('title')[0].innerHTML;
	
	var el = wo.document.getElementById('mainContent');
	
	var section = document.getElementById("section");
	
	var aTitle = title.split(" - ").reverse();
	section.innerText = aTitle.join(" > ");
	
	var url = document.getElementById("url");
	url.innerText = wo.location;
	
	var body = document.getElementById("body");
	body.innerHTML += el.innerHTML;
	
	var tables = document.getElementsByTagName("table");
	for (var i = 0; i < tables.length; i++) {
		var table = tables[i];
		if (table.className == "data") {
			table.className = "data_print";
		}
	}
	var divs = document.getElementsByTagName("div");
	for (var i = 0; i < divs.length; i++) {
		var d = divs[i];
		if (d.className.indexOf("print_false") > -1) {
			d.style.display = "none";
		}
	}
}

/* Бланки */
function OpenBlank() {
	window.open("d_roseestr/t/www/blank.htm", "_blank");
}

function SetBlank() {
	var wo = window.opener;
	var title = wo.document.getElementsByTagName('title')[0].innerHTML;
	      
	var el = wo.document.getElementById('mainContent');	
	var body = document.getElementById("body");
	body.innerHTML += el.innerHTML;
	
	var tables = document.getElementsByTagName("table");	
	for (var i = 0; i < tables.length; i++) {
		var table = tables[i];	  
  
		if (table.className == "data") {
			table.className = "data_print";			
		}
	}
	var divs = document.getElementsByTagName("div");
	for (var i = 0; i < divs.length; i++) {
		var d = divs[i];
		if (d.className.indexOf("print_false") > -1) {
			d.style.display = "none";
		}
		
		if (d.className.indexOf("print_true") > -1) {			
			d.style.visibility = "visible";
		}
	} 
     
      var VerPrint = document.getElementById('VerPrint');  
      if (VerPrint != null)
      {        
	      VerPrint.style.display = "none"; 
	  }
		 
        var NumSelector;        
        var texts = wo.document.getElementsByTagName("input");   // Берем поля из родительского окна
        var textsNew = document.getElementsByTagName("input");        
        var spans = document.getElementsByTagName("span"); 
        var tables = document.getElementsByTagName("table");         
     
        var CountTables = new Array();
        var sum=0;       
        var sumTab = 0;
      
        for (var i=0; i < tables.length; i++)
        {
              var t = tables[i];            
              if (t.id.indexOf("Tables") > 0)
              {              
                CountTables[sumTab] = i;
                sumTab = sumTab + 1;                
              }              
        }     
  
  
        for (var i = 0; i < spans.length; i++) {         
		     var s = spans[i];                       		 
		      
		      if (s.id.indexOf("del") > 0)
		      {
		         s.style.display = "none"; 
		         s.style.visibility = "hidden";	
		      }
		      
		      if (s.id.indexOf("selector") > 0)	
		      {
		          NumSelector = i;
		      }			      
     	}             
       
    var n = 0;
	for (var i = 0; i < texts.length; i++) {
		 var d = texts[i];		
		
		 if (d.id.indexOf("tf") > 0 )
		 {	   
		     textsNew[n].value = d.value;
		     textsNew[n].style.border = 0;
		     n=n+1;
		 }		 
	}

	// Убераем с экрана незаполненные поля
	for (var i = 0; i < textsNew.length; i++) {
		 var d = textsNew[i]; 
		 var t = tables[CountTables[i]];		   	 				       
	
	     if (d.value == "") 
	     {	    
		        if (t != null)
		        {			        
		        t.style.display = "none";
		        t.style.visibility = "hidden";
		        }
	     }
	}
	
	 var number;
	 var numberNew;
     var selects = wo.document.getElementsByTagName("select");
     var selectsNew = document.getElementsByTagName("select");
     for (var i = 0; i < selects.length; i++) {         
		     var s = selects[i];                       		 
		     if (s.id.indexOf("ddl") > 0)
		      {			          
	            number = i;	           
		      }		 
     	}      
     
      for (var i = 0; i < selectsNew.length; i++) {         
		     var s = selectsNew[i];                       		 
		     if (s.id.indexOf("ddl") > 0)
		      {			          
	            numberNew = i;	           
		      }		 
     	}     
     	
      if (NumSelector != null)
      {
      spans[NumSelector].innerText = selects[number].options[selects[number].selectedIndex].text;       
      spans[NumSelector].style.display = "inline";
      spans[NumSelector].style.visibility = "visible";
      selectsNew[numberNew].style.display = "none"; 
      selectsNew[numberNew].style.visibility = "hidden";                
      }

}

function OpenImage(url) {
	window.open(url, "_blank", "menubar=no, status=no, scrollbars=no, height=400, width=400, resizable=yes");
}

function Switch(id, el) {
	var d = document.getElementById(id);
	if (d.className == "hidden") {
		d.className = "";
		d.style.display = "block";
		d.style.visibility = "visible";
		el.className = "term2";
	}
	else {
		d.className = "hidden";
		d.style.display = "none";
		d.style.visibility = "hidden";
		el.className = "term";
	}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * *
// Сообщение
// * * * * * * * * * * * * * * * * * * * * * * * * * *
function ShowMessage (str, sec) {
	if (isNaN(sec)) 
		sec = 120;
	var d = document.getElementById("div_show_status");
	if (d == null) {
		d = window.document.createElement("DIV");
	}
	ShowStatus(str, false);
	setTimeout("HideMessage()", sec*1000);
}
function HideMessage() {
	var d = document.getElementById("div_show_status");
	d.style.display = "none";
}
// * * * * * * * * * * * * * * * * * * * * * * * * * *
// Статус
// * * * * * * * * * * * * * * * * * * * * * * * * * *
if (navigator.userAgent.toLowerCase().indexOf('gecko') != -1) {
	HTMLElement.prototype.attachEvent = function(eventName, delegate) {
		this.addEventListener(eventName.substring(2), delegate, false);
	}
}
function ShowStatus (str, play) {
	var d = document.getElementById("div_show_status");
	if (d == null) {
		d = window.document.createElement("DIV");
	}
	d.style.display = "none";
    d.style.top = document.body.scrollTop + document.body.clientHeight / 2 - 100 / 2;
    d.style.left = document.body.scrollLeft + document.body.clientWidth / 2 - 200 / 2;
	d.id = "div_show_status";
	d.innerHTML = str;
	d.className = "show_status";
	window.document.body.appendChild(d);
	if (play != false) {
		var valid = true;
		try {
			valid = Page_ClientValidate();
		}
		catch(e) {
		}
		if (valid) {
			setTimeout("DisplayDivShowStatus()",1500); // таймаут до показа статуса
			setTimeout("playDivShowStatus()",4500);
		}
	}
	else {
		DisplayDivShowStatus();
		d.attachEvent("onclick", HideMessage);
	}
}
function DisplayDivShowStatus() {
	var d = document.getElementById("div_show_status");
	d.style.display = "block";
}
function ShowStatusBackBorder() {
	var d = document.getElementById("div_show_status");
	d.style.borderColor = "#000000";
	d.style.borderWidth = "1px";
}
var playCount = 0;

function playDivShowStatus() {
	var d = document.getElementById("div_show_status");
	
    d.style.top = document.body.scrollTop + document.body.clientHeight / 2 - 100 / 2 + (Math.random() - 0.5) * 5;
    d.style.left = document.body.scrollLeft + document.body.clientWidth / 2 - 200 / 2 + (Math.random() - 0.5) * 5;
    if (playCount < 30) {
		playCount++;
		setTimeout("playDivShowStatus()",40);
    } else {
		playCount = 0;
		setTimeout("playDivShowStatus()",6000);
    }
}
function showNetscape(e) {
	var card = document.getElementById("card");

  	var clientX = e.clientX;
  	var clientY = e.clientY;

  	var h = window.pageXOffset + window.innerWidth - card.offsetWidth - 20; 
  	var v = window.pageYOffset + window.innerHeight - card.offsetHeight - 20; 

  	var x = window.pageXOffset + clientX + 10; 
  	var y = window.pageYOffset + clientY + 10; 
  	
  	var x2 = window.pageXOffset + clientX - card.offsetWidth - 5; 
  	var y2 = window.pageYOffset + clientY - card.offsetHeight - 5;

   	if (x2 < 0) x2 = 0;
   	if (y < v)
   		card.style.top = y
   	else 
   		card.style.top = y2
   	if (x < h) 
   		card.style.left = x
   	else 
   		card.style.left = x2

}
function showCard(card_title, card_body) {
SwitchSelects(false);
	var card = document.getElementById("card");
	if (card == null) {
		card = window.document.createElement("DIV");
	}
	card.style.visibility = "hidden";
	card.id = "card";
	card.className = "card";
	document.body.appendChild(card);

	var card_table = "";
	if (card_title != "") 
		card_table = card_table + "<div class=card_title>" + card_title + "</div>";
	card_table = card_table + "<div class=card_body>" + card_body + "</div>";	
	card.innerHTML = card_table;


	if (navigator.appName == "Netscape") {
		//document.captureEvents(Event.MOUSEOVER);
		//document.captureEvents(Event.MOUSEOUT);
		document.onmouseover = showNetscape;
		document.onmouseout = hideNetscape;
		card.style.visibility = "visible";
	}
	else {
		var clientX = event.clientX;
		var clientY = event.clientY;

    	var h = document.body.clientWidth - card.offsetWidth;
	    var v = document.body.clientHeight + document.body.scrollTop - card.offsetHeight;

    	var x2 = document.body.scrollLeft + clientX - card.offsetWidth - 5;
    	var y2 = document.body.scrollTop + clientY - card.offsetHeight - 5;

    	var x = document.body.scrollLeft + clientX + 10; 
    	var y = document.body.scrollTop + clientY + 10; 

       	if (x2 < 0) x2 = 0;
       	if (y < v)
       		card.style.posTop = y
       	else 
       		card.style.posTop = y2
       	if (x < h) 
       		card.style.posLeft = x
       	else 
       		card.style.posLeft = x2

    	card.style.visibility = "visible";
	} 
}

function hideCard() {
SwitchSelects(true);
	if (navigator.appName != "Netscape") {
		var card = document.getElementById("card");
		card.style.visibility = "hidden";
	}
}
function hideNetscape(e) {
	if (navigator.appName == "Netscape") {
		var card = document.getElementById("card");
		card.style.visibility = "hidden";
		document.releaseEvents(Event.MOUSEOVER); 
		document.releaseEvents(Event.MOUSEOUT); 
	}
}
function ShowLogin () {
	try {
		var div_auth = document.getElementById("floating_auth");
		if (div_auth.style.visibility == "visible") {
		    SwitchSelects(true);
			div_auth.style.visibility = "hidden";
			div_auth.style.display = "none";
		}
		else {
		    SwitchSelects(false);
			div_auth.style.visibility = "visible";
			div_auth.style.display = "block";
			
			div_auth.getElementsByTagName("input")[0].focus();
		}
	}
	catch(e) {
		return false;
	}
	return true;
}

// Скрипт проверки орфографии сделан на основе скрипта Дмитрия Котерова http://orphus.ru/ru/
var orfo = {   
    email:      "matrixnet@bk.ru", // dynamically filled  
    seltag1:    "-!!!-",
    seltag2:    "-!!!-",
    contlen:    60, 
    lng: {
badbrowser: "Ваш браузер не поддерживает данной функции",
toobig:     "Выделенный текст слишком длинный" 
    },
    init: function() { with (this) {
        var th = this;    
            document.onkeypress = function() { th.onkeypress(this); };   
     
    }},  

   
   thanks: function(){         
        ShowMessage("Ошибка отправлена. Спасибо за помощь.",3);          
   }, 
   
   
      sendEmail: function(url, context) {with (this) {       
        var params = new Array();           
        params[0] = new Param("url",url);    
        params[1] = new Param("text",escape(context[1]));                      
        params[2] = new Param("mode", "sendEmail");        
        SendRequest(params);      
                
        }},

    stripSlashn: function(text) {
        return (""+text).replace(/[\r\n]+/g, ' ').replace(/^\s+|\s+$/g, "");
    },

    doSend: function(recurrent) { with (this) {
        var text = null;
        if (!email || navigator.appName.indexOf("Netscape")!=-1 && eval(navigator.appVersion.substring(0,1))<5) {
            alert(lng.badbrowser);
            return;
        }
        var w = parent;
        var selection = null;
        if (w.getSelection) {
            selection = w.getSelection();
        } else if (w.document.getSelection) {
            selection = w.document.getSelection();
        } else {
            selection = w.document.selection;
        }
        var context = null;
        if (selection != null) {
            var pre="", text=null, suf="", pos=-1;
            if (selection.getRangeAt) { // Mozilla
                var r = selection.getRangeAt(0);
                text = r.toString();
                var rngA = w.document.createRange();
                rngA.setStartBefore(r.startContainer.ownerDocument.body);
                rngA.setEnd(r.startContainer, r.startOffset);
                pre = rngA.toString();
                var rngB = r.cloneRange();
                rngB.setStart(r.endContainer, r.endOffset);
                rngB.setEndAfter(r.endContainer.ownerDocument.body);
                suf = rngB.toString();
            } else if (selection.createRange) { // MSIE
                var r = selection.createRange();
                text = r.text;
                var rngA = selection.createRange();
                rngA.moveStart("character", -contlen);
                rngA.moveEnd("character", -text.length);
                pre = rngA.text;
                var rngB = selection.createRange();
                rngB.moveEnd("character", contlen);
                rngB.moveStart("character", text.length);
                suf = rngB.text;
            } else {
                text = "" + selection;
            }
            // Move lead/trail spaces from the selection to pre/suf.          
            var p;
            var s = (p = text.match(/^(\s*)/)) && p[0].length;
            var e = (p = text.match(/(\s*)$/)) && p[0].length;
            pre = pre + text.substring(0, s); // Предыдущий контекст                      
            suf = text.substring(text.length - e, text.length) + suf; // Последующий контекст
            text = text.substring(s, text.length - e); // Выделенное слово
           
        } else { 
            alert(lng.badbrowser); 
            return; 
        }
        if (text == "") {
            return;
        }
        context = [
            pre.substring(pre.length - contlen, pre.length).replace(/^\S{1,10}\s+/, ''),  
            text,  
            suf.substring(0, contlen).replace(/\s+\S{1,10}$/, ''), 
            pos
        ];
        var visCont = stripSlashn(context[0]+seltag1+context[1]+seltag2+context[2]);         
   
        var url = w.document.location.href;
        var ts = new Date().getTime();      
          this.sendEmail(url,context); 
          this.thanks();     
    }},

    onkeypress: function(e) { with (this) {
        var pressed=0;
        var we = (window.event && window.event) || (parent && parent.event);
        if (we) {
            // IE & Opera
            pressed = 
                we.keyCode==10 ||  // IE
                (we.keyCode == 13 && we.ctrlKey); // Opera
        } else if (e) {
            pressed = 
                (e.which==10 && e.modifiers==2) || // NN4
                (e.keyCode==0 && e.charCode==106 && e.ctrlKey) ||
                (e.keyCode==13 && e.ctrlKey) // Mozilla
        }
        if (pressed) {            
            this.doSend();             
            return false;
        }
    }}   
    
}
orfo.init();

function SendRequest(params) {
	try {	
	  	ShowStatus('Выполняется отправка...');   		  
		var qs = "";
		for (var i = 0; i < params.length; i++) {
			qs += params[i].key + "=" + params[i].value + "&";
		}      		
		var oHttp = createXmlHttpRequestObject();
		//var oHttp = new ActiveXObject("MSXML2.XMLHTTP");					
		//oHttp.open('POST', '/sendemail/?' + qs, true);
		oHttp.open('POST', 'sendemail/index.html', true);	
		oHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");			
		oHttp.send(qs);
	
		
		var oList = oHttp.responseXML;
		var result = oList.xml;
//		if (result.indexOf("<q>0</q>") == 0) {
//			return true;
//		}
//		else {
//			var message = result;
//			message = message.replace("<q>", "");
//			message = message.replace("</q>", "");
//			if (message != "") {
//				ShowMessage(message);
//			}
//			return false;
//		}
	}
	catch (e) {
		return false;
	}
}

function Param(k, v) {
	this.key = k;
	this.value = v;
}

function SetPhoto() {
    var qs = location.search;
    qs = qs.replace("?","");
	var wo = window.opener;
	var spanTitle = wo.document.getElementById("title_" + qs);
  	document.getElementById("comment").innerText = spanTitle.innerText;
	var image = wo.document.getElementById("pict_" + qs);
	var image_src = image.src;      
	image_src = image_src.replace("type=preview", "type=original");

	var photo = document.getElementById("photo");
	photo.src = image_src;
}
function SwitchSelects (vis) {
    var sels = document.getElementsByTagName("SELECT");
    for (var i = 0; i < sels.length; i++) {
        if (vis) {
			sels[i].style.display = "inline";
        }
        else {
			var replaceElement = document.createElement("input");
			replaceElement.name = "replace_element";
			replaceElement.className = "replace_element";
			replaceElement.readOnly = "true";
			replaceElement.style.width = sels[i].offsetWidth;
			replaceElement.value = sels[i].options[sels[i].selectedIndex].text;
			sels[i].parentNode.insertBefore(replaceElement, sels[i]);
			sels[i].style.display = "none";
        }
    }
    if (vis) {
		var elems = window.document.getElementsByTagName("input");
		for (var i = 0; i < elems.length; i++) {
			if (elems[i].name == "replace_element") {
				elems[i].style.display = "none";
			}
		}
    }
}
function openPhoto(t, width, height) {
    SwitchSelects(false);
	var d = document.getElementById("photo_big");
	
	var image = document.getElementById("pict_" + t);
	var image_src = image.src;
	
	var image_title = image.title;
	if (image_title == "") {
	    image_title = "Фотография";
	}
	var d_image;
	var d_subtitle;
	
	image_src = image_src.replace("type=preview", "type=original");
	if (d != null) {
        var parent = d.parentNode;
        parent.removeChild(d);
	}

    d = window.document.createElement("div");
    d.onclick = closePhoto;
    d.id = "photo_big";
    d.className = "photo_big";
    d_subtitle = window.document.createElement("DIV");
    d_subtitle.className = "subttl";
    d.appendChild(d_subtitle);
    d_image = window.document.createElement("IMG");
    d.appendChild(d_image);

	d_subtitle = d.getElementsByTagName("DIV")[0];
	d_subtitle.innerHTML = "<img src=\"/d_roseestr/i/close.gif\" class=close /><div class=\"li\">" + image_title + "</div>";
	
	d_image = d.getElementsByTagName("IMG")[1];
	
	d_image.src = image_src;	
	
    
    if (document.documentElement.scrollTop < 129)
    {
       d.style.top = document.documentElement.scrollTop + 180 + "px" ; 
    }
    else
    {
    d.style.top = document.documentElement.scrollTop + 100 + "px" ;    
    }
    d.style.left = document.body.scrollLeft + document.body.clientWidth / 2 - 800 / 2  + "px";
  //  alert(document.documentElement.scrollTop + " - " +  document.body.clientHeight + " - " + d.style.top)
    
	window.document.body.appendChild(d);
}
function closePhoto() {
    SwitchSelects(true);
    var d = document.getElementById("photo_big");
    var parent = d.parentNode;
    parent.removeChild(d);
}
function SetPreviewImage(el) {
	var image = window.document.createElement("IMG");
	image.className = "ico_zoom";
	image.title = el.title;
	el.parentElement.insertBefore(image, el);
    if (el.width != 0 && el.height != 0) {
		image.src = "/d_roseestr/i/zoom_" + el.width + "x" + el.height + ".gif";
    }
    else {
		image.src = "d_roseestr/i/ico_zoom.gif";
    }
}
function SwitchService(d, s) { 

    var OldValue = d.className;
	var ss = document.getElementById("services").getElementsByTagName("DIV");
	for (i = 0; i < ss.length; i++) {
		if (ss[i].className == "on") {
			ss[i].className = "title";
		}
		if (ss[i].className == "service") {
			ss[i].style.display = "none";
		}
	}
	
	if (OldValue != 'on')
	    {
	    if (d.className == "title") {
		    d.className = "on";
		    document.getElementById(s).style.display = "block";
	    }
	    else {
		    d.className = "title";
		    document.getElementById(s).style.display = "none";
	    }
	}
}

function createXmlHttpRequestObject() 
{ 
  // will store the reference to the XMLHttpRequest object 
  var xmlHttp; 
  // this should work for all browsers except IE6 and older 
  try 
  { 
    // try to create XMLHttpRequest object 
    xmlHttp = new XMLHttpRequest();     
  } 
  catch(e) 
  { 
    // assume IE6 or older 
    var XmlHttpVersions = new Array("MSXML2.XMLHTTP.6.0", 
                                    "MSXML2.XMLHTTP.5.0", 
                                    "MSXML2.XMLHTTP.4.0", 
                                    "MSXML2.XMLHTTP.3.0", 
                                    "MSXML2.XMLHTTP", 
                                    "Microsoft.XMLHTTP"); 
    // try every prog id until one works 

    for (var i=0; i<XmlHttpVersions.length && !xmlHttp; i++) 
    { 
      try 
      { 
        // try to create XMLHttpRequest object 
        xmlHttp = new ActiveXObject(XmlHttpVersions[i]); 
      } 
      catch (e) {} 
    } 
  } 
  // return the created object or display an error message 
  if (!xmlHttp) 
    alert("Error creating the XMLHttpRequest object."); 
  else 
    return xmlHttp; 
}



//-->



function showStruct(card_title, card_body,image) {
hideCard();
SwitchSelects(false);

	var card = document.getElementById("card");
	if (card == null) {
		card = window.document.createElement("DIV");
	}
	card.style.visibility = "hidden";
	card.id = "card";
	card.className = "card";
	document.body.appendChild(card);

	var card_table = "";
	if (card_title != "") 
	
	if (image.length > 2)
	{
		card_table = card_table + "<table><tr><td><img src=" +  image + "/></td>";		
	}
	else	
	{
	    card_table = card_table + "<table><tr><td></td>";	
	}
		card_table = card_table + "<td style=padding:5px;><div class=card_title>" + card_title + "</div>";
	card_table = card_table + "<div class=card_body>" + card_body + " <br><br><a onclick=hideCard() style=text-decoration:underline;cursor:pointer;>Закрыть</a></div></td></tr></table>";	
	
	card.innerHTML = card_table;


	if (navigator.appName == "Netscape") {
		//document.captureEvents(Event.MOUSEOVER);
		//document.captureEvents(Event.MOUSEOUT);
		document.onmouseover = showNetscape;
		document.onmouseout = hideNetscape;
		card.style.visibility = "visible";
	}
	else {
		var clientX = event.clientX;
		var clientY = event.clientY;


    	var h = document.body.clientWidth - card.offsetWidth;
	    var v = document.body.clientHeight + document.documentElement.scrollTop - card.offsetHeight;

    	var x2 = document.body.scrollLeft + clientX - card.offsetWidth - 5;
    	var y2 = document.documentElement.scrollTop + clientY - card.offsetHeight - 5;

    	var x = document.body.scrollLeft + clientX + 10; 
    	var y = document.documentElement.scrollTop + clientY + 10; 

       	if (x2 < 0) x2 = 0;
       	if (y < v)
       	{
      		card.style.posTop = y

       		}
       	else 
       		card.style.posTop = y2
       	if (x < h) 
       	{
       		card.style.posLeft = x       		
       		}
       	else 
       		card.style.posLeft = x2

    	card.style.visibility = "visible";
	} 
}