function BrowserCheck() 
{
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.version = navigator.appVersion
	this.v = parseInt(this.version)
	this.ns = (this.b=="ns" && this.v>=4)
	this.ns4 = (this.b=="ns" && this.v==4)
	this.ns5 = (this.b=="ns" && this.v==5)
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (this.version.indexOf('MSIE 4')>0)
	this.ie5 = (this.version.indexOf('MSIE 5')>0)
	this.min = (this.ns||this.ie)
}

is = new BrowserCheck() 

function mouseMove(e) 
{
	var x = (is.ns)? e.pageX : event.clientX+document.body.scrollLeft;
	var y = (is.ns)? e.pageY : event.clientY+document.body.scrollTop;

	return true;
}

function Initialize() 
{
	document.onmousemove = mouseMove;
	if (is.ns4) document.captureEvents(Event.MOUSEMOVE)	
	if (!document.all) return;
	
	function tagover() 
	{
		this.style.borderColor = "#FFFFFF";
		this.style.cursor = "hand";
	}
	function tagout() 
	{
		this.style.borderColor = "#626262";
	}
	function tagclick() 
	{
		this.style.borderColor = "#626262";
	}
	
	tags = document.all.tags("IMG");

	for (var i=0; i<tags.length; i++) 
	{
		if (tags[i].className == "foto") 
		{
			tags[i].onmouseover = tagover;
			tags[i].onmouseout  = tagout;
		}
	}
}

function openWindow(plik, szerokosc, wysokosc)
{	
	okno = window.open("", "", "left=0,top=0,menubar=no,toolbar=no,location=no,directories=no,status=no,resizable=no,scrollbars=no,width=" + szerokosc +	",height=" + wysokosc + "");
	okno.document.open();

	okno.document.write('<!DOC'+'TYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n' +
	'<HTML>\n<HEAD>\n' +    
	'<META HTTP-EQUIV="Content-type" CONTENT="text/html; char'+'set=iso-8859-2">\n' +
	'<TITLE>Galeria</TITLE>\n' +
	'</HEAD>\n' +
	'<BODY style="margin: 0">\n' +
	'<TABLE BORDER="0" WIDTH="100%" HEIGHT="100%" CELLPADDING="0" CELLSPACING="0">\n' +
	'<TR><TD ALIGN="center" VALIGN="center">\n' +
	'<a href="javascript:window.close()" title="Zamknij">'+
	'<IMG SRC="' + plik + '" BORDER="1">\n' +    
	'</a></TD></TR>\n' +
	'</TABLE>\n' +
	'</BODY>\n' +
	'</HTML>');
	okno.document.close();
}

function showPictures()
{
	document.writeln((document.layers)?"<link rel=\"stylesheet\" href=\"defs-nn.css\" type=\"text/css\">":"<link rel=\"stylesheet\" href=\"defs-ie.css\" type=\"text/css\">");
	
	var docout='';
	for (i = 0; i < Images.length; i++) 
	{	
		docout += '<br>';
		docout += '<div class="galtxt">' + Images[i].alias + '</div>';
		docout += '<div id="galphoto ' + i + 'body">';
		for (x = 0; x < Images[i].photos.length; x++) 
		{
		photoF    = 'gfx/' + Images[i].htmlcode + Images[i].photos[x] + '.png';
		photoFile = 'gfx/mini/' + Images[i].htmlcode + Images[i].photos[x] + '.jpg';

		ww = Images[i].width;
		hh = Images[i].height;
		docout += '<a href=javascript:openWindow("' + photoF + '",ww,hh)>';		
		docout += '<img src="' + photoFile + '" border="1" alt="' + Images[i].alias + '" class="foto"></a>';
docout +=' ';
		}
		docout += '</div>';
		docout += '</div>';
	}
	document.writeln(docout);		
}


function showPictures2()
{
	document.writeln((document.layers)?"<link rel=\"stylesheet\" href=\"defs-nn.css\" type=\"text/css\">":"<link rel=\"stylesheet\" href=\"defs-ie.css\" type=\"text/css\">");
	
	var docout='';
	for (i = 0; i < Images.length; i++) 
	{	
		docout += '<br>';
		docout += '<h4>' + Images[i].alias + '</h4>';
		for (x = 0; x < Images[i].photos.length; x++) 
		{
		photoF    = 'gfx/' + Images[i].htmlcode + Images[i].photos[x] + '.png';
		photoFile = 'gfx/mini/' + Images[i].htmlcode + Images[i].photos[x] + '.jpg';

		ww = Images[i].width;
		hh = Images[i].height;
		docout += '<a href=javascript:openWindow("' + photoF + '",ww,hh)>';		
		docout += '<img src="' + photoFile + '" border="1" alt="' + Images[i].alias + '" class="foto"></a>';
docout +=' ';
		}
	}
	document.writeln(docout);		
}

