function ChangePicture(what,where)
{
	temp = document.getElementById(where);
	if (temp) { temp.src = what; }
}

function newWindow(url, width, height, winname) {
  var screen_width  = screen.width;
  var screen_height = screen.height;
  var left = screen_width/2-width/2;
  var top  = screen_height/2-height/2;
	if(screen_width > width && screen_height > height) var scrollbars = 'scrollbars=no';
  else var scrollbars = 'scrollbars=yes';
  var Win = window.open('large.php?img=' + url, winname, 'width=' + width + ', height=' + height + ', resizable=no, ' + scrollbars + ', menubar=no' + ', top=' + top + ', left=' + left);
}

function ShowFlash(url, width, height, winname) {
  var screen_width  = screen.width;
  var screen_height = screen.height;
  var left = screen_width/2-width/2;
  var top  = screen_height/2-height/2;
	if(screen_width > width && screen_height > height) var scrollbars = 'scrollbars=no';
  else var scrollbars = 'scrollbars=yes';
  var Win = window.open('flash.php?flash=' + url, winname, 'width=' + width + ', height=' + height + ', resizable=no, ' + scrollbars + ', menubar=no' + ', top=' + top + ', left=' + left);
}

function showTab(tabID) {
  if(document.getElementById(tabID).style.display=='none')
  {
    document.getElementById(tabID).style.display=''
  }
  else
  {
    document.getElementById(tabID).style.display='none'
  }
}

function maleOkno(url, width, height, okno) {
	var Win = window.open(url,okno,'width=' + width + ',height=' + height + ',resizable=no,scrollbars=no,menubar=no');
}

function ShowAt(obj, x, y)
{	
  if (x && y)
	{
		document.getElementById(obj).style.left = x + 'px';
		document.getElementById(obj).style.top = y + 'px';
	}
	document.getElementById(obj).style.display = '';
}

function Hide(obj)
{
	document.getElementById(obj).style.display = 'none';
}

function Refresher()
{
	if (document.getElementById('main'))
	{
		setInterval("document.getElementById('main').src='main.php'", 10000);
	}
	if (document.getElementById('inside'))
	{
		setInterval("document.getElementById('inside').src='inside.php'", 10000);
	}
}


//------------------------
//Ankieta
//------------------------
function ankieta_select(par,val,input)
{
	tds=document.getElementById(par).getElementsByTagName('td');
	for (i=1;i<tds.length;i++)
	{
		if ((tds[i].className=='button active') && (i==val))
		{
			tds[i].className='button';
			input.value='';
		}
		else if (i==val)
		{
			tds[i].className='button active';
			input.value=i;
		}
		else
		{
			tds[i].className='button';
		}
	}
	
}

function LoadExtendBody(node)
{
	var paramsSpecial = {
		helperClass: 'helperspecial',
		helperElementClass: 'helpboxspecial',
		helperElementId: 'helperidspecial',
		helperTrackClass: 'helperspecial'
	};
	if (document.getElementById('menubox_content'))
	{
		FSite2.extendForm(document.getElementById('menubox_content'),paramsSpecial);
	}
	
	var params = {
		helperClass: 'helper',
		helperElementClass: 'helpbox',
		helperElementId: 'helperid',
		helperTrackClass: 'helper'
	};
	if (!node)
		node=document.body;
	FSite2.extendForm(node,params);
}
