var user_click = false
function TogglePartition(id)
{
	HideAll()
	user_click = true
	p = $('partition_'+id)
	if (p.style.visibility == 'visible') p.style.visibility = 'hidden'
	else
	{				
		p.style.left = 18 + 49 - p.scrollWidth / 2 
		p.style.visibility = 'visible'
	}
	
}

function ShowPartition(id)
{
	HideAll()
	p = $('partition_'+id)			
	p.style.left = 18 + 49 - p.scrollWidth / 2 
	p.style.visibility = 'visible'	
}

function HideAll()
{
	if (user_click)
	{
		user_click = false
		return
	} 
	i = 0
	while(i < 4)
	{
		p = $('partition_'+i)
		if (!p) {
			i++;
			continue;
		}
		$('trg'+i++).src='/img/trg.gif'
		p.style.visibility = 'hidden'
	}
}

function TrgOff(i){
	if ($('partition_' + i)) {
  	if ($('partition_' + i).style.visibility == 'hidden') {
  		$('trg' + i).src = '/img/trg.gif'
  	}
  }
  else 
  	$('trg' + i).src = '/img/trg.gif'
}
function OpenWin(p,w,h){var s='/x-photo.php?pic='+p; var neww=w+20; var newh=h+50;swh='width='+neww+',height='+newh; window.open(s, '_blank',swh)}
