function pict(file_name, alt_text, comment_text){
	this.file_name		= file_name;
	this.alt_text		= alt_text;
	this.comment_text 	= comment_text;
}

function rollover_(n_tol,n_ig){
	
	/* szamitott segedvaltozok */
	if (visible_pic_num>n_ig-n_tol){
		visible_pic_num = n_ig-n_tol;
	}

	if (!view_comment){int_tb_h_plus=0;}
	if (!visible_pic_last){
		var n_cor = 1;
		}
	else{
		var n_cor = 0;
	}

	var int_td_width  	= small_pic_width+(cella_space*2);
	var int_tbl_width 	= int_td_width*visible_pic_num;
	var int_tbl_height	= small_pic_height+int_tb_h_plus;
	var ext_tbl_width	= int_tbl_width  + 50;
	var ext_tbl_height	= int_tbl_height + 10;
	var c_width 	  	= int_tbl_width;
	var c_height	  	= int_tbl_height;	
	var n_pic			= n_ig-n_tol + n_cor;
	var scroll_max		= n_pic*(small_pic_width+cella_space)+(4*cella_space);
	/* szamitott segedvaltozok vege */

	document.writeln("<table border=0 cellpadding=0 cellspacing=0 height=" +ext_tbl_height+ " width=" +ext_tbl_width+ "name='kulso'>");
	document.writeln("<tbody>");
	document.writeln("<tr>");
	document.writeln("<td align=center width=" +arrows_cell_w+ " valign='middle'><img border=0  src='" +arrows_back+ "' width=" +arrows_width+ " height=" +arrows_height+ " onMouseOut=stop() onMouseOver=scrollen(0," +scroll_max+ ") class='arrow'></td>");
	document.writeln("<td>");

    if (document.layers){
   	   	document.write("<ILAYER id='l_fenster'  width='" +c_width+ "' height='" +c_height+ "' z-index='1'" +c_width+ "," +c_height+ "'>");
		document.write("<LAYER  id='l_gallerie' width='" +c_width+ "' height='" +c_height+ "' z-index='1'>");
	}
	else {
		document.write("<DIV id=fenster  style='HEIGHT:" +c_height+ "px; OVERFLOW: hidden; POSITION: relative; WIDTH:" +c_width+ "px'>");
		document.write("<DIV id=gallerie style='HEIGHT:" +c_height+ "px; LEFT: 0px; POSITION: absolute;        WIDTH:" +c_width+ "px'>");
	}

	document.writeln("<table border=0 cellpadding=0 cellspacing=" +cella_space+ " width=" +int_tbl_width);
   	document.writeln("<tbody>");
	document.writeln("<tr valign='middle'>");

	var i = n_tol;
	var k = n_ig
	for (i=n_tol;i<=n_ig;i++) {
		if (datab[i].file_name!= ""){
			document.writeln("<td align='center' valign='middle' class='comment'>");
			if (popup_view){document.writeln("<a href='javascript:viewpic_(" +i+ ")' onfocus=this.blur()>");}
			document.writeln("<img src=" +small_path+datab[i].file_name+ " border=0 height=" +small_pic_height+ "width=" +small_pic_width);
			document.writeln(" alt='"    +datab[i].alt_text+ "'>");
			document.writeln("</a>");
			if (view_comment){document.writeln(datab[i].comment_text);}
			document.writeln("</td>");
		   }
		}

	document.writeln("</tr>");
   	document.writeln("</tbody>");
	document.writeln("</table>");

	if (document.layers){
		document.writeln("</LAYER></ILAYER>");
	}
	else{
	   document.writeln("</DIV></DIV>");
	}

	document.writeln("</td>");
	document.writeln("<td align=center width=" +arrows_cell_w+ " valign='middle'><img border=0  src='" +arrows_next+ "' width=" +arrows_width+ " height=" +arrows_height+ " onMouseOut=stop() onMouseOver=scrollen(1," +scroll_max+ ") class='arrow'></td>");
	document.writeln("</tr>");
	document.writeln("</tbody>");
	document.writeln("</table>");
}

function viewpic_(i){

	var c_image		= pic_path + datab[i].file_name;
	var c_comment	= datab[i].comment_text;
	var c_alt		= datab[i].alt_text;
	var n_height_m	= 0;
	if (popup_button){n_height_m = popup_btn_cellh;}
	var n_width 	= pic_width  + popup_width;					// a popup  szelessege
	var n_height	= pic_height + popup_height + n_height_m;	// a popup magassaga

	new_win=window.open("","view","width=" +n_width+ ",height=" +n_height+ ",scrollbars=0,resizable=0,top=5,left=5");
	view=new_win.document;
	view.open();
	view.writeln("<html>");
	view.writeln("<head>");
	view.writeln("<title>DiaNet:" +c_comment+ "</title>");
	view.writeln("</head>");
	view.writeln("<body bgcolor='#FFFFFF' leftmargin=0 topmargin=0 onkeypress='if (event.keyCode==27){window.close();}'>");
	view.writeln("<table width=" + pic_width+ " border=0 cellspacing=0 cellpadding=0 align='center'>");
	view.writeln("<tr>");
	view.writeln("<td><img src='" +c_image+ "' width='" +pic_width+ "' height='" +pic_height+ "' title='" +c_alt+ "' onclick='window.close()'></td>");
	view.writeln("</tr>");
	if (popup_button){
		view.writeln("<tr>"); 
		view.writeln("<td align='center' valign='middle' height='" +popup_btn_cellh+ "'><a href='#' onclick='window.close()'><img src='" +popup_btn_name+ "' width='" +popup_btn_w+ "' height='" +popup_btn_h+ "' title='" +popup_btn_title+ "' border=0></a></td>");
		view.writeln("</tr>");
	}
	view.writeln("</table>");
	view.writeln("</body>");
	view.writeln("</html>");
	view.close();
}

