var pages_string = new String(); // usata in caso di paginazioni ( 1- 2 -3 - ... )
var pages_string2 = new String(); // usata in caso di paginazioni ( << indietro  avanti >> )
pages_string = "";
pages_string2 = "";

function showImage(pictName,imgWidth,imgHeight,text) {
	proiettore = window.open(site_root+"site_images/proiettore.aspx?img="+pictName+"&text="+escape(text), "proiettore_pop", "toolbar=no,scrollbars=no,directories=no,menubar=no,width="+imgWidth+",height="+imgHeight+",resizable=no");
};
	
function page_maker(first_of_series_name, act_page, num_pages) {
// utilizzato per "paginare" un documento
	var page_name = new String();
	var page_extension = new String();
	var temp = new String();
	page_name = first_of_series_name.substring(0,first_of_series_name.indexOf("."));
	page_extension = first_of_series_name.substring(first_of_series_name.indexOf("."),first_of_series_name.length);
	// costruisce pages_string
	for (var i=1; i<= num_pages; i++) {
		if (i==1) temp = ""
		else temp = i.toString();
		if (i==act_page) pages_string += i.toString() +"\n";
		else pages_string += "<a href=\""+page_name+temp+page_extension+"\">"+i.toString()+"</a> \n";
		if (i<num_pages) pages_string += "-\n";
	};
	// costruisce pages_string_2
	if (act_page==2) temp = ""
	else temp = (act_page-1).toString();
	pages_string2 += "<p></p> \n";
	pages_string2 += "<table border=\"0\" width=\"475\"> \n";
	pages_string2 += "<td class=\"titoloBlu\" align=\"left\"> \n";
	if (act_page>1) pages_string2 += "<a href=\""+page_name+temp+page_extension+"\"><< Precedente</a> \n";
	else pages_string2 += "&nbsp; \n";
	pages_string2 += "</td>"
	pages_string2 += "<td class=\"titoloBlu\" align=\"right\"> \n";
	if (act_page<num_pages) pages_string2 += "<a href=\""+page_name+(act_page+1).toString()+page_extension+"\">Successiva >></a> \n";
	else pages_string2 += "&nbsp; \n";
	pages_string2 += "</td>"
	pages_string2 += "</table>"
};

function call_header(area) {
	var header_string = new String();
	header_string += "";
	header_string += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" height=\"100%\"> \n";
	header_string += "<tr> \n";
	header_string += "<td align=\"center\" valign=\"top\"> \n";
	header_string += "	<p>&nbsp;</p><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"577\"> \n";
	header_string += "	<tr> \n";
	header_string += "	<td width=\"218\" height=\"182\"> \n";
	if (area=="storia") header_string += "	<img src=\""+site_root+"images/main_title_storia.gif\" width=\"218\" height=\"182\"></td> \n"
	else if (area=="filatelia")  header_string += "	<img src=\""+site_root+"images/main_title_filatelia.gif\"  width=\"218\" height=\"182\"></td> \n"
	else if (area=="statuto")    header_string += "	<img src=\""+site_root+"images/main_title_statuto.gif\"    width=\"218\" height=\"182\"></td> \n"
	else if (area=="programma")  header_string += "	<img src=\""+site_root+"images/main_title_programma.gif\"  width=\"218\" height=\"182\"></td> \n"
	else if (area=="contatti")   header_string += "	<img src=\""+site_root+"images/main_title_contatti.gif\"   width=\"218\" height=\"182\"></td> \n"
	else if (area=="news")       header_string += "	<img src=\""+site_root+"images/main_title_news.gif\"       width=\"218\" height=\"182\"></td> \n"
	else if (area=="newsletter") header_string += "	<img src=\""+site_root+"images/main_title_newsletter.gif\" width=\"218\" height=\"182\"></td> \n"
	else if (area=="galleria")  header_string += "	<img src=\""+site_root+"images/main_title_galleria.gif\"  width=\"218\" height=\"182\"></td> \n"
	header_string += "	<td width=\"225\" height=\"182\"> \n";
	header_string += "		<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"225\" height=\"182\"> \n";
	header_string += "		<tr> \n";
	header_string += "		<td valign=\"top\"> \n";
	// ** Spazio libero per organigramma **
	header_string += "			<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> \n";
	header_string += "			<tr> \n";
	header_string += "				<td valign=\"top\"><div class=\"smallText\"><!--Presidente:--></div></td> \n";
	header_string += "				<td valign=\"top\"><div class=\"smallText\">&nbsp;&nbsp;</div></td> \n";
	header_string += "				<td valign=\"top\"><div class=\"smallText\"><!--Andrea Pacini--></div></td> \n";
	header_string += "			</tr> \n";
	header_string += "			<tr> \n";
	header_string += "				<td valign=\"top\"><div class=\"smallText\"><!--Vicepresidente:--></div></td> \n";
	header_string += "				<td valign=\"top\"><div class=\"smallText\">&nbsp;&nbsp;</div></td> \n";
	header_string += "				<td valign=\"top\"><div class=\"smallText\"><!--Alessandro Pastacaldi--></div></td> \n";
	header_string += "			</tr> \n";
	header_string += "			<tr> \n";
	header_string += "				<td valign=\"top\"><div class=\"smallText\"><!--Segretario:--></div></td> \n";
	header_string += "				<td valign=\"top\"><div class=\"smallText\">&nbsp;&nbsp;</div></td> \n";
	header_string += "				<td valign=\"top\"><div class=\"smallText\"><!--Giuliano Montagnani--></div></td> \n";
	header_string += "			</tr> \n";
	header_string += "			<tr> \n";
	header_string += "				<td valign=\"top\"><div class=\"smallText\"><!--Economato e Novit&agrave;:--></div></td> \n";
	header_string += "				<td valign=\"top\"><div class=\"smallText\">&nbsp;&nbsp;</div></td> \n";
	header_string += "				<td valign=\"top\"><div class=\"smallText\"><!--Paolo Mazzoncini--></div></td> \n";
	header_string += "			</tr> \n";
	header_string += "			<tr> \n";
	header_string += "				<td valign=\"top\"><div class=\"smallText\"><!--Addetto Segreteria:--></div></td> \n";
	header_string += "				<td valign=\"top\"><div class=\"smallText\">&nbsp;&nbsp;</div></td> \n";
	header_string += "				<td valign=\"top\"><div class=\"smallText\"><!--Maurizio Fredianelli--></div></td> \n";
	header_string += "			</tr> \n";
	header_string += "			<tr> \n";
	header_string += "				<td valign=\"top\"><div class=\"smallText\"><!--Consigliere:--></div></td> \n";
	header_string += "				<td valign=\"top\"><div class=\"smallText\">&nbsp;&nbsp;</div></td> \n";
	header_string += "				<td valign=\"top\"><div class=\"smallText\"><!--Sergio Ferrini--></div></td> \n";
	header_string += "			</tr> \n";
	header_string += "			<tr> \n";
	header_string += "				<td valign=\"top\"><div class=\"smallText\"><!--Consigliere:--></div></td> \n";
	header_string += "				<td valign=\"top\"><div class=\"smallText\">&nbsp;&nbsp;</div></td> \n";
	header_string += "				<td valign=\"top\"><div class=\"smallText\"><!--Massimo Simoncini--></div></td> \n";
	header_string += "			</tr> \n";
	header_string += "			<tr> \n";
	header_string += "				<td colspan=\"3\"><div class=\"simpleText\">&nbsp;</div></td> \n";
	header_string += "			</tr> \n";
	header_string += "			<tr> \n";
	header_string += "				<td valign=\"top\"><div class=\"smallText\"><!--Sindaci Revisori Conti:--></div></td> \n";
	header_string += "				<td valign=\"top\"><div class=\"smallText\">&nbsp;&nbsp;</div></td> \n";
	header_string += "				<td valign=\"top\"><div class=\"smallText\"><!--Giuliano Toncelli<br>Luciano Picchio--></div></td> \n";
	header_string += "			</tr> \n";
	header_string += "			<tr> \n";
	header_string += "				<td colspan=\"3\"><div class=\"simpleText\">&nbsp;</div></td> \n";
	header_string += "			</tr> \n";
	header_string += "			<tr> \n";
	header_string += "				<td valign=\"top\"><div class=\"smallText\"><!--Provibiri:--></div></td> \n";
	header_string += "				<td valign=\"top\"><div class=\"smallText\">&nbsp;&nbsp;</div></td> \n";
	header_string += "				<td valign=\"top\"><div class=\"smallText\"><!--Francesco Papotto<br>Giacomo Sforzini--></div></td> \n";
	header_string += "			</tr> \n";
	header_string += "			</table> \n";
	header_string += "		</td> \n";
	header_string += "		</tr> \n";
	header_string += "		</table> \n";
	header_string += "	</td> \n";
	header_string += "	<td width=\"134\" height=\"182\"> \n";
	header_string += "		<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"134\" height=\"182\"> \n";
	header_string += "		<tr> \n";
	header_string += "		<td width=\"134\" height=\"81\" align=\"right\"> \n";
	header_string += "		<a href=\""+site_root+"index.aspx\"><img src=\""+site_root+"images/omino_di_ferro2_mail.gif\" width=\"59\" height=\"81\" border=\"0\"></a> \n";
	header_string += "		</td> \n";
	header_string += "		</tr> \n";
	header_string += "		<tr> \n";
	header_string += "		<td width=\"134\" height=\"101\"> \n";
	header_string += "		<img src=\""+site_root+"images/cfn.gif\" width=\"134\" height=\"101\"></td> \n";
	header_string += "		</tr> \n";
	header_string += "		</table> \n";
	header_string += "	</td> \n";
	header_string += "	</tr> \n";
	header_string += "	</table> \n";
	header_string += "	<div class=\"simpleText\" style=\"text-align:center\"> \n"; 
	header_string += "	<hr width=\"50%\" noshade color=\"#F7D600\">";
	if (pages_string!="") header_string += pages_string + " \n";
	header_string += "	<br>&nbsp; \n";
	header_string += "	</div> \n"; 
	header_string += "		<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"577\"> \n";
	header_string += "					<tr> \n";
	header_string += "						<td width=\"475\" valign=\"top\" align=\"center\"> \n";
	document.writeln(header_string);
};

function call_footer(arg) {
	var footer_string = new String();
	footer_string = "";
	if (pages_string2 != "") footer_string += pages_string2 + "\n";
	footer_string += "				<p></p> \n";
	footer_string += "				</td> \n";
	footer_string += "	<td width=\"102\" align=\"right\" valign=\"bottom\"> \n";
	footer_string += "	<a href=\"../index.aspx\"><img src=\""+site_root+"images/cfn_small_logo.gif\" width=\"97\" height=\"86\" border=\"0\"></a></td> \n";
	footer_string += "	</tr> \n";
	footer_string += "	</table> \n";
	footer_string += "	<hr width=\"50%\" noshade color=\"#F7D600\"> \n";
	footer_string += "	<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> \n";
	footer_string += "	<tr> \n";
	if (arg=="storia") footer_string += "	<td class=\"titoloBlu\">Storia</td> \n";
	if (arg!="storia") footer_string += "	<td class=\"titoloBlu\"><a href=\""+site_root+"storia/index.aspx\">Storia</a></td> \n";
	footer_string += "	<td class=\"titoloBlu\">&nbsp;-&nbsp;</td> \n";
	if (arg=="filatelia") footer_string += "	<td class=\"titoloBlu\">Filatelia</td> \n";
	if (arg!="filatelia") footer_string += "	<td class=\"titoloBlu\"><a href=\""+site_root+"filatelia/index.aspx\">Filatelia</a></td> \n";
	footer_string += "	<td class=\"titoloBlu\">&nbsp;-&nbsp;</td> \n";
	if (arg=="statuto") footer_string += "	<td class=\"titoloBlu\">Statuto</td> \n";
	if (arg!="statuto") footer_string += "	<td class=\"titoloBlu\"><a href=\""+site_root+"statuto/index.aspx\">Statuto</a></td> \n";
	footer_string += "	<td class=\"titoloBlu\">&nbsp;-&nbsp;</td> \n";
	if (arg=="programma") footer_string += "	<td class=\"titoloBlu\">Programma Attivit&agrave;</td> \n";
	if (arg!="programma") footer_string += "	<td class=\"titoloBlu\"><a href=\""+site_root+"programma/index.aspx\">Programma Attivit&agrave;</a></td> \n";
	footer_string += "	<td class=\"titoloBlu\">&nbsp;-&nbsp;</td> \n";
	if (arg=="galleria") footer_string += "	<td class=\"titoloBlu\">Galleria</td> \n";
	if (arg!="galleria") footer_string += "	<td class=\"titoloBlu\"><a href=\""+site_root+"galleria/index.aspx\">Galleria</a></td> \n";
	footer_string += "	<td class=\"titoloBlu\">&nbsp;-&nbsp;</td> \n";
	if (arg=="news") footer_string += "	<td class=\"titoloBlu\">News</td> \n";
	if (arg!="news") footer_string += "	<td class=\"titoloBlu\"><a href=\""+site_root+"news/index.aspx\">News</a></td> \n";
	footer_string += "	<td class=\"titoloBlu\">&nbsp;-&nbsp;</td> \n";
	if (arg=="newsletter") footer_string += "	<td class=\"titoloBlu\">newsletter</td> \n";
	if (arg!="newsletter") footer_string += "	<td class=\"titoloBlu\"><a href=\""+site_root+"newsletter/index.aspx\">Newsletter</a></td> \n";
	footer_string += "	<td class=\"titoloBlu\">&nbsp;-&nbsp;</td> \n";
	if (arg=="contatti") footer_string += "	<td class=\"titoloBlu\">Contatti</td> \n";
	if (arg!="contatti") footer_string += "	<td class=\"titoloBlu\"><a href=\""+site_root+"contatti/index.aspx\">Contatti</a></td> \n";
	footer_string += "	</tr> \n";
	footer_string += "	</table> \n";
	footer_string += "	<br> \n";
	footer_string += "</td> \n";
	footer_string += "</tr> \n";
	footer_string += "</table> \n";
	document.writeln(footer_string);
};
