// @(#) $Id: main.js,v 1.1.1.1 2004/05/07 09:14:29 tom Exp $

function WOpen(name,url,w,h,s,r)
{
	return(window.open(url,name,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+s+",resizable="+r+",fullscreen=no,channelmode=no,width="+w+",height="+h));
}

function WOpenCenter(name, url, width, height)
{

 var left = (screen.width  - width)/2;
 var top  = (screen.height - height)/2;

 var params = 'width='+width+',height='+height;
 params += ',top='+top+',left='+left;
 params += ',directories=no';
 params += ',location=no';
 params += ',menubar=no';
 params += ',resizable=no';
 params += ',scrollbars=no';
 params += ',status=no';
 params += ',toolbar=no';

 newwin=window.open(url, '_blank' , params);
 //if (window.focus) {newwin.focus()}
 return false;
}


function hiddenEm(name,domain) {
	window.location.href="mailto"+":"+name+"@"+domain;
}

function hiddenTx( str )
{
	str = str.replace( "*", "@" );
	var str_array = str.split("..");

	for(i=0;i<str_array.length;i++) document.write( str_array[i]+"<font><\/font>" );
}

var win=null;
function imgzoom(w,h,imgurl) {
	// Detect browser
	NN=(document.layers)? true:false;
	IE=(document.all)? true:false;

	if (win!=null)
		if (!win.closed) { win.window.close(); }
	win=window.open('','win','status=no,scrollbars=no,width='+w+',height='+h+',left=20,top=20');

	Code="<HTML>\n"
		+"<HEAD>\n"
		+"<TITLE>Zoom</TITLE>\n"
		+"<script>resizeTo("+w+"+50,"+h+"+90)</script>"
		+"</HEAD>\n"
		+"<BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 STYLE='background-color:white'>\n"
		+"<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN='center' HEIGHT='100%'>"
		+"<TR>"
		+"<TD onClick='window.close()' STYLE='cursor:hand' VALIGN='middle'>"
		+"<IMG SRC='"+imgurl+"' NAME='obrazek'>"
		+"</TD></TR></TABLE>\n"
		+"</BODY>\n"
		+"</HTML>";
	win.document.write(Code);
	//win.location.reload();
}


function artists_list( img_dir )
{
	res_lista = "";
	for( rekord_no = 0; rekord_no < arr_lista.length; rekord_no++ )
	{
		if( !arr_lista[rekord_no]['name'] ) arr_lista[rekord_no]['name'] = arr_lista[rekord_no]["photos"][0];
		if( !arr_lista[rekord_no]['country'] ) arr_lista[rekord_no]['country'] = "?";

		res_lista += "<tr>";
		//res_lista += "<a name='lista"+rekord_no+"'></a>";
		res_lista += "<td><p><a name='lista"+(rekord_no+1)+"'></a>"+(rekord_no+1)+".</p></td>";
		res_lista += "<td style='text-indent: 0px; text-align: left; width: 100%; text-transform: uppercase;'><p>"+arr_lista[rekord_no]['name']+"</p></td>";
		res_lista += "<td style='text-align: center; text-transform: uppercase;'><p>"+arr_lista[rekord_no]['country']+"</p></td>";
		res_lista += "<td style='text-align: ce;'>";
		var photos_arr = arr_lista[rekord_no]["photos"];
		for( photo_no = 0; photo_no < photos_arr.length; photo_no++ )
		{
			res_lista += "<table style=\"width: 118px; height: 118px; border: solid 5px #96B3C3; margin: 4px; background-color: white;\"><tr valign=\"middle\"><td align=\"center\">";
			//res_lista += "<a href='#lista"+rekord_no+"' onClick=\"imgzoom(440,440,'"+img_dir+"440/"+photos_arr[photo_no]+".jpg')\">";
			res_lista += "<a href=\""+img_dir+"440/"+photos_arr[photo_no]+".jpg\" rel=\"clearbox\" title=\""+arr_lista[rekord_no]['name']+"<br/>"+arr_lista[rekord_no]['country']+"\">";
			res_lista += "<img src='"+img_dir+"100/"+photos_arr[photo_no]+".jpg' border='0'>";
			res_lista += "</a>";
			res_lista += "</td></tr></table>";
		}
		res_lista += "</td>";
		res_lista += "</tr>";
	}
	res_html = "<table border='1' width='100%' style='margin-bottom:10px'><tr>";
	res_html += "<td><p><b>No.</p></td>";
	res_html += "<td><p><b>Name</p></td>";
	res_html += "<td><p><b>Country</p></td>";
	res_html += "<td><p><b>Photo</p></td>";
	res_html += "</tr>";
	res_html += res_lista;
	res_html += "</table>";
	document.write( res_html );
}
