﻿
function deleteConfirm()
{
	return confirm( "Vai tiešām vēlaties dzēst šo ierakstu?" );
}

function confirmation( text )
{
	return confirm( text );
}

function openWindow( url, params )
{
	return window.open( url, "_blank", params );
}

function openCenteredWindow(url, width, height)
{
	var left = ((window.top.screen.width - width) / 2);
	var top = ((window.top.screen.height - height) / 2);
	
	window.open(url, '', 'height=' + height + ',width=' + width + ',left=' + left + ',top=' + top + ',menubar=no,resizable=no,toolbar=no,directories=no');
}	

function openCenteredWindowEx(url, width, height, scrollbars)
{
	var left = ((window.top.screen.width - width) / 2);
	var top = ((window.top.screen.height - height) / 2);
	
	
	if ( scrollbars )
		window.open(url, '', 'height=' + height + ',width=' + width + ',left=' + left + ',top=' + top + ',menubar=no,resizable=no,toolbar=no,directories=no,scrollbars=yes');
	else
		window.open(url, '', 'height=' + height + ',width=' + width + ',left=' + left + ',top=' + top + ',menubar=no,resizable=no,toolbar=no,directories=no');	
}
function openCenteredWindowRes(url, width, height, resizable)
{
	var left = ((window.top.screen.width - width) / 2);
	var top = ((window.top.screen.height - height) / 2);
	
	
	if ( resizable )
		window.open(url, '', 'height=' + height + ',width=' + width + ',left=' + left + ',top=' + top + ',menubar=no,resizable=yes,toolbar=no,directories=no,scrollbars=yes');
	else
		window.open(url, '', 'height=' + height + ',width=' + width + ',left=' + left + ',top=' + top + ',menubar=no,resizable=no,toolbar=no,directories=no,scrollbars=yes');	
}	

function returnToOpener( url, reloadOpener )
{
  if (opener)
  {
    if (opener.closed)
    {
      window.open(url, "");
    }
    else if (opener.location.href.toLowerCase() != url.toLowerCase() || reloadOpener )
	{
      opener.location.href = url;
	}
  }
  else
  {
	window.open(url, "");
  }
  window.close();
  return false;
}

function clickButton( buttonID )
{
	var button = document.getElementById( buttonID );
	if ( button )
	{
		button.focus();
		button.click();
	}
}

function RotateImages(Start)
  {
  	var a = eval("ImageArr");
  	var b = eval("ImageHolder");
  	if(Start >=a.length)
  		Start=0;
  	b.src = a[Start];
  	window.setTimeout("RotateImages("+(Start+1)+")",15000);
  }