function GetData(act)
	{       xmlHttp=GetXmlHttpObject()
			if (xmlHttp==null)
			{
				alert ("Браузер не поддерживает запросы HTTP")
				return
			}
var url="getrubinfo.php"
var pausekol=0;
url=url+"?rub="+act
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function GetXmlHttpObject()
{
	var objXMLHttp=null
	if (window.XMLHttpRequest)
	{
		objXMLHttp=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
return objXMLHttp;
}

function stateChanged()
{

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{

	var old_content = document.getElementById('documentation');
    var new_content = xmlHttp.responseText;
    var newEl = old_content.cloneNode(true); //делаем «клон» всего, что было внутри элемента, //информацию в которой надо дополнить пришедшей от сервера
    newEl.innerHTML = new_content; //Дополняем новым контентом
    old_content.parentNode.replaceChild(newEl, old_content); //Заменяем старый контент – новым.
     sh();
	}
}
function sh(){
Lightview.show({
    href: '#documentation',

	  inline: {
        width: 400,
        height: 500,
        menubar: 'top',
        scrolling: true,
        closeButton: 'large'
      }

  });

}
function setmarginright(obj, marg, css) {
	var item = document.getElementById(obj);
	item.style.cssText=css+'margin-right:'+marg+'px;';
}
function showPlace(obj) {
	var item = $(obj);
	item.style.display = ((item.style.display=="block")?"none":"block");
}
function showPlace2(obj) {
	var item = document.getElementById(obj);
	item.style.display = ((item.style.display=="block")?"none":"block");
}
function setmarginright(obj, marg) {
	var item = $(obj);
	item.style.cssText='margin-right:'+marg+'px;';
}
function setmarginright2(obj, marg) {
	var item = document.getElementById(obj);
	item.style.cssText='margin-right:'+marg+'px;';
}
function selectPlace(name,value){
	$(name).value = value;
	$(name+'_sel_value').innerHTML = value;
}
function checkboxSet(itemobj,inputid) {
	itemobj.firstChild.className = ((itemobj.firstChild.className=="")?"active":"");
	var inputobj = $(inputid);
	if (inputobj) inputobj.value = (itemobj.firstChild.className=="active")?1:0;
}
function radioButtonSet(itemobj,inputid) {
	var inputobj = $(inputid);
	if (inputobj){
		if (inputobj.value==1) return false;
		inputobj.value = 1;
		var list = document.getElementsByTagName('INPUT');
		for (var i=0; i<list.length; i++) if ((list[i].type=="hidden") && (list[i].className==itemobj.className)) list[i].value = 0;
		list = document.getElementsByTagName('SPAN');
		for (var i=0; i<list.length; i++) if (list[i].className==itemobj.className) list[i].firstChild.className = "";
		itemobj.firstChild.className = "active";
		var inputobj = $(inputid);
		if (inputobj) inputobj.value = 1;
	}
}
function questionSet(itemobj) {
	itemobj.parentNode.className = ((itemobj.parentNode.className=="")?"active":"");
}
function mShow(menu) {
	menuID = $(menu);
	menuID.style.display = "block";
}
function mHide(menu) {
	menuID = $(menu);
	menuID.style.display = "none";
}
function loadPubCalendar(id,section,d,m,y){
	section = parseInt(section); if (isNaN(section)) section = 0;
	var request = new ajaxInit('/inc/ajax/calendar.php?section='+section+'&y='+y+'&m='+m+'&d='+d+'&id='+id,'$("'+id+'").innerHTML = response;');
	$(id).innerHTML = '';
	request.sendPost('');
}
function checkConsultForm(obj){
	if (trim(obj.consultname.value)=='') { alert('Представьтесь, пожалуйста'); return false; }
	if (trim(obj.consultquestion.value)=='') { alert('Укажите ваш вопрос'); return false; }
	obj.submit();
}
function changeMainFastSearch(num){
	var pc = $('mainfsnav');
	if (!pc) return;
	for (var i=0; i<pc.childNodes.length; i++){
		if (pc.childNodes[i].tagName=="SPAN"){
			if (pc.childNodes[i].id==num) pc.childNodes[i].className = 'active';
			else pc.childNodes[i].className = '';
		}
	}
	var divs = document.getElementsByTagName('DIV');
	for (i=0; i<divs.length; i++){
		if (divs[i].id=="form"){
			if (divs[i].className==num) divs[i].style.display = '';
			else divs[i].style.display = 'none';
		}
	}
}

function  search_save(count, url) {
     new Ajax.Request('/ajax/search.php',
       {
         method:'post', parameters: {q: location.search, count:count, url:url},
         onSuccess: function(transport){
           
           alert("Поиск сохранен!" );
         },
         onFailure: function(){ alert('') }
       });     
}

window.onload = function () {
     if(typeof jQuery  == 'undefined') return;
    var left = jQuery('#left') .height();
    var right = jQuery('#right') .height();


    if (left > right) {
        document.getElementById('right').style.height = left+'px';
    }
}