 function showPanorama(flash_name){
	var str='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100%" height="100%" id="panorama" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="./img/'+flash_name+'.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><embed src="./img/'+flash_name+'.swf" quality="high" bgcolor="#ffffff" width="100%" height="100%" name="panorama" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
	//alert(str);
	document.writeln(str);
}

	function fillTables(contentBlockId,headerNeed,reCellBordered) {
		if(document.getElementsByTagName){
			var items = document.getElementById(contentBlockId).getElementsByTagName("TABLE");
			for(var i=0;i<items.length; i++){
				if (!reCellBordered || (items[i].getAttribute(classFix) && (items[i].getAttribute(classFix)).indexOf("reCellBordered")>0)){
					var nodes = items[i].getElementsByTagName("TR");
					var start = 0;
					if (headerNeed && (nodes[0].getAttribute(classFix)==""  || nodes[0].getAttribute(classFix)==null)){
						nodes[0].setAttribute(classFix,"color_2");
						start = 1;
					}
					for(var j=start;j<nodes.length; j++){
						if (nodes[j].getAttribute(classFix)=="" || nodes[j].getAttribute(classFix)==null){
							nodes[j].setAttribute(classFix,"color_"+(j%2));
						}
					}
				}
			}
		}
	}



 function ScaleBlank(){
	var content_div = document.getElementById("content_div");
	var bodyHeight = document.body.clientHeight - 422;
	var menu_div = document.getElementById("left_column_div");
	var newHeight = Math.max((menu_div.offsetHeight),bodyHeight);
	content_div.style.height = newHeight+"px";
}

cit = new Array;
var st = 0;

function show() {
	clearTimeout(st);
	hide();
	for (i=0; i<show.arguments.length; i++) {

		if (!document.all) {
			document.getElementById(show.arguments[i]).style.visibility='visible';
		} else {
			document.all[show.arguments[i]].style.visibility='visible';
		}
	}
	cit = show.arguments;
}

function hide() {
	for  (i=0; i<cit.length; i++) {
		if (!document.all) {
			document.getElementById(cit[i]).style.visibility='hidden';
		} else {
			document.all[cit[i]].style.visibility='hidden';
		}
	}
}

function selectDistincts(select){
	var oDdistrict = document.getElementById('district');
	if (oDdistrict){
		var cnt = oDdistrict.options.length;
		for (var i=0;i < cnt;i++){
			oDdistrict.options[0] = null;
		}
	}

	var data1 = {action:'getDistincts','rid':select.value};
	(new DEC_HttpRequest()).send(base+'js.php', data1, function (data){addOptions(data);});
}

function addOptions(data){
	var item;
	var items;
	var i;
	for (selectId in data){
		var oSelect=document.getElementById(selectId);
		if (oSelect){
			items=data[selectId];
			i=1;
			for (item in items){
				oSelect.options[i] = new Option(items[item].name,items[item].value);
				i++;
			}
		}
	}
}

function radio_value(radio){
	for(var i=0;i<radio.length;i++){
		if(radio[i].checked) return radio[i].value;
	}
	return 0;
}
// расширяем встроенный объект дата
Date.prototype.lastDay = function() {
  return (new Date(this.getFullYear(), this.getMonth()+1, 0)).getDate();
};
Date.prototype.ruDayNames=['Понедельник','Вторник','Среда','Четверг','Пятница','Субота','Воскресенье'];
Date.prototype.ruMonthNames=['Январь','Февраль','Март','Апрель','Май','Июнь','Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'];
Date.prototype.getFullDayRu = function() {return this.ruDayNames[this.getDay()];};
Date.prototype.getDayAbbrRu = function() {return this.getFullDayRu().slice(0, 3);};
Date.prototype.getFullMonthRu = function() {return this.ruMonthNames[this.getMonth()];};
Date.prototype.getMonthAbbr = function() {return this.getFullMonthRu().slice(0, 3);};

