/**
* v. 1.2.2
*/

function windowNew( sAdres, iWidth, iHeight, sTitle, iReturn ){
  if ( !sTitle )
    sTitle = '';
  if( !iReturn )
    iReturn = false;

	if( !iWidth )
		var iWidth = 750;
	if( !iHeight )
		var iHeight = 530;

	if( +iWidth > 750 )
		iWidth = 750;
	else
		iWidth = +iWidth + 40;

	if( +iHeight > 530 )
		iHeight = 530
	else
		iHeight = +iHeight + 40;

	var iX = ( screen.availWidth - iWidth ) / 2;
	var iY = ( screen.availHeight - iHeight ) / 2;

  var refOpen = window.open( sAdres, sTitle, "height="+iHeight+",width="+iWidth+",top="+iY+",left="+iX+",resizable=yes,scrollbars=yes,status=0;" );
  
  if( iReturn == true )
  	return refOpen
} // end function windowNew

function windowFoto( ){};
// windowPhoto2 funkcja dla e-kartek
function windowPhoto2( sPhotoAdres, sTitle, sPageUrl, iReturn ){
	if( !sTitle )
		sTitle = 'Photo';
  if( !iReturn )
    iReturn = false;
  if( !sPageUrl )
    sPageUrl = '';

  var refFoto = window.open( sPageUrl + "window2.php?p=showPhoto&adresFoto=" + sPhotoAdres + "&sPageTitle=" + sTitle, 'Photo', "height=70,width=80,top=20,left=20,resizable=yes,scrollbars=yes,status=0;" );

  if( iReturn == true )
  	return refOpen
} // end function windowPhoto

// stara windoPhoto
function windowPhoto( sPhotoAdres, sTitle, sPageUrl, iReturn ){
	if( !sTitle )
		sTitle = 'Photo';
  if( !iReturn )
    iReturn = false;
  if( !sPageUrl )
    sPageUrl = '';

  var refFoto = window.open( sPageUrl + "window.php?p=showPhoto&adresFoto=" + sPhotoAdres + "&sPageTitle=" + sTitle, 'Photo', "heigth=500,width=500,top=20,left=20,resizable=yes,scrollbars=yes,status=0;" );

  if( iReturn == true )
  	return refOpen
} // end function windowPhoto


function windowGallery( iId, iIdLink, iType ){
  var refFoto = window.open( "index.php?p=galleryGalleryShow&amp;iId=" + iId + "&amp;iIdLink="+ iIdLink +"&amp;iType=" + iType, 'Photo', "heigth=500,width=700,top=20,left=20,resizable=yes,scrollbars=yes,status=0;" );
} // end function windowGallery


// <![CDATA[
function flash(id, kolor, czas, kolor2, czas2)
{
	document.getElementById(id).style.color = kolor;
	setTimeout('flash("' + id + '","' + kolor2 + '",' + czas2 + ',"' + kolor + '",' + czas + ')', czas);
}
// ]]>
