var myLeft = (screen.width) / 2 - 400;
var myTop = (screen.height) / 2 - 300;
function openMap(param)
{ 
	window.open('/location/map.asp?viewPoint='+param,'Ñõåìà ïðîåçäà ê Poiser Studio','toolbar=0,location=0,directories=0,menuBar=0,resizable=0,scrollbars=no,width=800,height=600,left='+myLeft+',top='+myTop); 
	window.name='ps_location';
}

function text_show(pd) {
		var list_text = document.getElementById(pd+'_block');

		list_text.style.display = list_text.style.display == 'block' ? 'none' : 'block';
		
		var list_img = document.getElementById(pd+'_img');
		if (list_img.src == '/img/lb/off_down.png')	{
			list_img.setAttribute('src','/img/lb/off_up.png');
		}


}

function img_mous_over(pd) {
	var list_img = document.getElementById(pd+'_img');
	
	if (list_img.src == '/img/lb/off_down.png') {
		list_img.setAttribute('src','/img/lb/on_down.png');
	}
	
	if (list_img.src == '/img/lb/off_up.png') {
		list_img.setAttribute('src','/img/lb/on_up.png');
	}
}
	
function img_mous_out(pd) {
	var list_img = document.getElementById(pd+'_img');
	
	if (list_img.src == '/img/lb/on_down.png') {
		list_img.setAttribute('src','/img/lb/off_down.png');
	}
	if (list_img.src == '/img/lb/on_up.png') {
		list_img.setAttribute('src','/img/lb/off_up.png');
	}
}

function zoom(el, grow, k) {
 if (typeof(el) == 'string') el = document.getElementById(el);
 if (grow == undefined)
  grow = ('grow' in el ? (el.grow == '+' ? '-' : '+') 
                       : (el.offsetHeight > 0 ? '-' : '+'));
 el.grow = grow;
 el.zoomStep = k || 2;
 el.style.overflow = 'hidden';
 if (grow == '+') {
  if (!('zoomCurValue' in el) || el.zoomCurValue == 0) el.zoomCurValue = 1;
  el.style.display = '';
  if ('zoomMaxHeight' in el) el.zoomNewValue = el.zoomMaxHeight;
  else {
    el.style.height = '';
    el.zoomNewValue = el.offsetHeight;
  }
 } else {
  if (!('zoomCurValue' in el)) el.zoomCurValue = el.offsetHeight;
  if (!('zoomMaxHeight' in el)) el.zoomMaxHeight = el.offsetHeight;
  el.zoomNewValue = 0;
 }
 el.style.height = el.zoomCurValue+'px';
 if (!el.zoomIntervalId) el.zoomIntervalId = setInterval('stepZooming("'+el.id+'")', 50);
}

function stepZooming(id) {
 var el = document.getElementById(id);
 var d = (el.grow == '+' ? el.zoomCurValue * el.zoomStep : el.zoomCurValue / el.zoomStep);
 var finished = false;
 if (el.grow == '+' && d > el.zoomNewValue) {
  d = el.zoomNewValue;
  finished = true;
 } else if (el.grow != '+' && d < 1) {
  d = 0;
  finished = true;
 }
 el.zoomCurValue = d;
 el.style.height = d+'px';
 if (finished) {
  clearInterval(el.zoomIntervalId);
  el.zoomIntervalId = null;
  if (d == 0) el.style.display = 'none';
  else {
    el.style.overflow = '';
    el.style.height = '';
  }
  if (el.afterZoom) el.afterZoom();
 }
}
