﻿function fnImg ( pstrImg, pstrLink, pstrTarget)
	{
	pstrLink	= isNull(pstrLink,		"");
	pstrTarget	= isNull(pstrTarget,	"");

	var strOUT =  "	<table cellpadding=0 cellspacing=0 width=100% border=0>"
				+ "	<tr>"
				+ "		<td width=99% valign=top bgcolor=#b2b2b2 >"
				+ "			<table cellpadding=1 cellspacing=0 width=100% border=0>";
	
	if (pstrLink == "")
		strOUT	+="				<tr><td><img src=images/" + pstrImg + " border=0></td></tr>";
	else
		strOUT	+="				<tr><td><a href=\"" + pstrLink + "\" " + ((pstrTarget == "") ? "" : "target='" + pstrTarget + "'" ) + "><img src=images/" + pstrImg + " border=0></a></td></tr>";
	
	strOUT		+="			</table>"
				+ "		</td>"
				+ "		<td valign=top background=images/bkgombravert.gif>"
				+ "			<table cellpadding=0 cellspacing=0 width=100% border=0>"
				+ "				<tr><td><img src=images/ombras.gif border=0></td></tr>"
				+ "				<tr><td><img src=images/dummy.gif width=1 height=1 border=0></td>"
				+ "			</table>"
				+ "		</td>"
				+ "	</tr>"
				+ "	<tr>"
				+ "		<td colspan=2>"
				+ "			<table cellpadding=0 cellspacing=0 width=100% border=0>"
				+ "				<tr>"
				+ "					<td><img src=images/inombratit.gif border=0></td>"
				+ "					<td background=images/bkgombratit.gif width=99% ><img src=images/dummy.gif width=1 height=1 border=0></td>"
				+ "					<td><img src=images/endombratit.gif border=0></td>"
				+ "				</tr>"
				+ "			</table>"
				+ "		</td>"
				+ "	</tr>"
				+ "</table>";
				
		document.write(strOUT);
		}
	
	function fnImgOpenPop ( pstrImg, pstrPop, pstrTit, pstrW, pstrH )
	{
	var strOUT =  "	<table cellpadding=0 cellspacing=0 width=100% border=0>"
				+ "	<tr>"
				+ "		<td width=99% valign=top bgcolor=#b2b2b2 >"
				+ "			<table cellpadding=1 cellspacing=0 width=100% border=0>"
				+ "				<tr><td><a href='javascript:windowOpen(\"" + pstrPop + "\", \"" + pstrTit + "\", " + pstrW + ", " + pstrH + " );'><img src=images/" + pstrImg + " border=0></a></td></tr>"
				+ "			</table>"
				+ "		</td>"
				+ "		<td valign=top background=images/bkgombravert.gif>"
				+ "			<table cellpadding=0 cellspacing=0 width=100% border=0>"
				+ "				<tr><td><img src=images/ombras.gif border=0></td></tr>"
				+ "				<tr><td><img src=images/dummy.gif width=1 height=1 border=0></td>"
				+ "			</table>"
				+ "		</td>"
				+ "	</tr>"
				+ "	<tr>"
				+ "		<td colspan=2>"
				+ "			<table cellpadding=0 cellspacing=0 width=100% border=0>"
				+ "				<tr>"
				+ "					<td><img src=images/inombratit.gif border=0></td>"
				+ "					<td background=images/bkgombratit.gif width=99% ><img src=images/dummy.gif width=1 height=1 border=0></td>"
				+ "					<td><img src=images/endombratit.gif border=0></td>"
				+ "				</tr>"
				+ "			</table>"
				+ "		</td>"
				+ "	</tr>"
				+ "</table>";
				
		document.write(strOUT);
		}
		
//costruzione per schede--------------------------------------

	var GstrColor1	= "fafafa";
	var GstrColor2	= "e7e7e7";
	var GstrColor	= "";
	
	function fnSchedaAnagrafica( pstrParametro, pstrIn )
		{	
		
		GstrColor = ( GstrColor == GstrColor2 ) ? GstrColor1 : GstrColor2;
		
		var strOUT =  "<tr bgcolor=#" + GstrColor + ">"
					+ "  <td valign=top>"
					+ "		<table cellpadding=1 cellspacing=0 width=100% border=0>"
					+ "			<tr>"
					+ "	 			<td><img src=images/dummy.gif width=4 height=1 border=0></td>"
					+ "	 			<td class=nero10b width=99% valign=top >" + pstrParametro + "</td>"
					+ "			</tr>"
					+ "		</table>"
					+ " </td>"
					+ "  <td width=70% valign=top >"
					+ "		<table cellpadding=1 cellspacing=0 width=100% border=0>"
					+ "			<tr>"
					+ "	 			<td><img src=images/dummy.gif width=4 height=1 border=0></td>"
					+ "	 			<td class=nero10b width=99% valign=top >" + pstrIn + "</td>"
					+ "			</tr>"
					+ "		</table>"
					+ " </td></tr>";
		document.write(strOUT);
		}

	function fnApplicazioni_OLD( pstrIco, pstrIcoTxt, pstrIco2, pstrIcoTxt2, pstrTxt, pstrLink, pbooIsSchedaProdotto )
	{
		pbooIsSchedaProdotto = isNull ( pbooIsSchedaProdotto, true );
		
		var strOUT =  "<table cellpadding=0 cellspacing=0 border=0 width=100% >"
					+ "		<tr>"
					+ "			<td bgcolor=#c9c9c9 valign=top>"
					+ "				<table cellpadding=0 cellspacing=1 border=0 width=100% >"
					+ "					<tr bgcolor=#ffffff>"
					+ "						<td bgcolor=#ffffff valign=top>"
					+ "							<table cellpadding=0 cellspacing=3 border=0 width=100% >"
					+ "								<td valign=top><a href='" + pstrLink + "'><img src=images/frecciaapp.gif border=0></a></td>"
					+ "								<td background=images/bkgLineLeft.gif width=99% align=center class=nero10b ><a href='" + pstrLink + "'>" + pstrTxt + "</a></td>"
					+ "								<td><img src=images/dummy.gif width=1 height=" + ( ( pbooIsSchedaProdotto ) ? 30 : 1 ) + " border=0></td>"
					+ "							</table>"
					+ "						</td>"
					+ "					</tr>"
					+ "				</table>"
					+ "			</td>"
					+ "		</tr>"
					+ "		<tr><td><img src=images/dummy.gif width=1 height=3 border=0></td></tr>"
					+ "		<tr>"
					+ "			<td>"
					+ "				<table cellpadding=0 cellspacing=0 border=0 width=100% >"
					+ "					<tr>"
					+ "						<td width=50% >"
					+ "							<table cellpadding=0 cellspacing=0 border=0 width=100% >"
					+ "								<tr><td bgcolor=#e6e6e6 colspan=4><img src=images/upicoapp.gif border=0></td></tr>"
					+ "								<tr>"
					+ "									<td background=images/bkgIcoApp.gif><img src='" + pstrIco + "' border=0></td>"
					+ "									<td><img src=images/dummy.gif width=3 height=1 border=0></td>"
					+ "									<td width=99% ><table cellpadding=1 cellspacing=0 border=0 width=100% ><tr><td class=grigioscuro10n bgcolor=#efefef>" + pstrIcoTxt + "</td></tr></table></td>"
					+ "									<td bgcolor=#999999><img src=images/dummy.gif width=1 height=1 border=0></td>"
					+ "								</tr>"
					+ "								<tr><td bgcolor=#999999 colspan=4><img src=images/downicoapp.gif border=0></td></tr>"
					+ "							</table>"
					+ "						</td>"
					+ "						<td><img src=images/dummy.gif width=10 height=1 border=0></td>"
					+ "						<td width=50% >"
					+ "							<table cellpadding=0 cellspacing=0 border=0 width=100% >"
					+ "								<tr><td bgcolor=#e6e6e6 colspan=4><img src=images/upicoapp.gif border=0></td></tr>"
					+ "								<tr>"
					+ "									<td background=images/bkgIcoApp.gif><img src='" + pstrIco2 + "' border=0></td>"
					+ "									<td><img src=images/dummy.gif width=3 height=1 border=0></td>"
					+ "									<td width=99% ><table cellpadding=1 cellspacing=0 border=0 width=100% ><tr><td class=grigioscuro10n bgcolor=#efefef>" + pstrIcoTxt2 + "</td></tr></table></td>"
					+ "									<td bgcolor=#999999><img src=images/dummy.gif width=1 height=1 border=0></td>"
					+ "								</tr>"
					+ "								<tr><td bgcolor=#999999 colspan=4><img src=images/downicoapp.gif border=0></td></tr>"
					+ "							</table>"
					+ "						</td>"
					+ "					</tr>"
					+ "				</table>"
					+ "			</td>"
					+ "		</tr>"
					+ "	</table>";
					
		document.write(strOUT);
		}
		
	function fnApplicazioni( pstrIco, pstrIcoTxt, pstrIco2, pstrIcoTxt2, pstrTxt, pstrLink, pbooIsSchedaProdotto )
	{
		pbooIsSchedaProdotto = isNull ( pbooIsSchedaProdotto, true );
		
		var strOUT =  "<table cellpadding=0 cellspacing=0 border=0 width=100% >"
					+ "		<tr>"
					+ "			<td bgcolor=#c9c9c9 valign=top>"
					+ "				<table cellpadding=0 cellspacing=1 border=0 width=100% >"
					+ "					<tr bgcolor=#ffffff>"
					+ "						<td bgcolor=#ffffff valign=top>"
					+ "							<table cellpadding=0 cellspacing=3 border=0 width=100% >"
					+ "								<td background=images/bkgIcoApp.gif><a href='" + pstrLink + "'><img src='" + pstrIco + "' border=0 alt=\"" + pstrIcoTxt + "\" title=\"" + pstrIcoTxt + "\"></a></td>"
					+ "								<td background=images/bkgIcoApp.gif><a href='" + pstrLink + "'><img src='" + pstrIco2 + "' border=0 alt=\"" + pstrIcoTxt2 + "\" title=\"" + pstrIcoTxt2 + "\"></a></td>"
					+ "								<td background=images/bkgLineLeft.gif width=99% align=center class=nero10b ><a href='" + pstrLink + "'>" + pstrTxt + "</a></td>"
					+ "							</table>"
					+ "						</td>"
					+ "					</tr>"
					+ "				</table>"
					+ "			</td>"
					+ "		</tr>"
					+ "	</table>";
					
		document.write(strOUT);
		}
	
	function fnIcoApplicazioni( pstrIco, pstrIcoTxt )
		{	
		var strOUT =  "<table cellpadding=0 cellspacing=0 border=0 width=100% >"
					+ "	<tr><td bgcolor=#e6e6e6 colspan=4 align=right><img src=images/upicoapp2.gif border=0></td></tr>"
					+ "	<tr>"
					+ "		<td bgcolor=#999999><img src=images/dummy.gif width=1 height=45 border=0></td>"
					+ "		<td width=99% ><table cellpadding=1 cellspacing=0 border=0 width=100% ><tr><td class=grigioscuro10n bgcolor=#efefef>" + pstrIcoTxt + "</td></tr></table></td>"
					+ "		<td><img src=images/dummy.gif width=3 height=1 border=0></td>"
					+ "		<td background=images/bkgIcoApp.gif><img src='" + pstrIco + "' border=0></td>"
					+ "	</tr>"
					+ "	<tr><td bgcolor=#999999 colspan=4 align=right><img src=images/downicoapp2.gif border=0></td></tr>"
					+ "	</table>";
					
		document.write(strOUT);
		}
		
	
	function fnReferenze ( pstrImg, pstrTit, pstrDesc, pintIDReferenza )
	{	
		var strOUT =  "	<tr>"
					+ "		<td bgcolor=#ffffff >"
					+ "			<table cellpadding=0 cellspacing=0 width=100% border=0>"
					+ "				<tr><td><img src=images/dummy.gif width=1 height=3 border=0></td></tr>"
					+ "				<tr>"
					+ "					<td bgcolor=#ffffff >"
					+ "						<table cellpadding=0 cellspacing=0 width=100% border=0>"
					+ "							<tr><td><img src=images/dummy.gif width=1 height=3 border=0></td></tr>"
					+ "							<tr>"
					+ "								<td valign=top>"
					+ "									<table cellpadding=0 cellspacing=0 width=100% border=0>"
					+ "										<tr>"
					+ "											<td><img src=images/dummy.gif width=5 height=1 border=0></td>";
		
		if ( pstrImg.indexOf("dummy.gif") == -1 )
		{
			strOUT	+="											<td valign=top>"
					+ "												<table cellpadding=0 cellspacing=0 width=100% border=0>"
					+ "													<tr><td bgcolor=#aeaead>"
					+ "														<table cellpadding=1 cellspacing=0 border=0><tr><td><a href='SchedaReferenze.asp?IDReferenza=" + pintIDReferenza + "'><img src='" + pstrImg + "' width=115 border=0></a></td></tr></table>"
					+ "													</td></tr>"
					+ "												</table>"
					+ "											</td>"
		}
		else
		{
			strOUT	+="											<td><img src=images/dummy.gif width=117 height=1 border=0</td>"
		}			
		
		strOUT		+="											<td width=99% height=100% valign=top >"
					+ "												<table cellpadding=0 cellspacing=0 width=100% height=100% border=0>"
					+ "													<tr>"
					+ "														<td align=center valign=top height=100% >"
					+ "															<table cellpadding=7 cellspacing=0 width=100% height=100% border=0>"
					+ "																<tr>"
					+ "																	<td><img src=images/dummy.gif width=1 height=1 border=0></td>"
					+ "																	<td class=grigio10b valign=top width=99% ><a href='SchedaReferenze.asp?IDReferenza=" + pintIDReferenza + "'><font class=grigio11b>" + pstrTit + "</font><br>" + pstrDesc + "</a></td>"
					+ "																	<td><img src=images/dummy.gif width=1 height=1 border=0></td>"
					+ "																</tr>"
					+ "															</table>"
					+ "														</td>"
					+ "													</tr>"
					+ "													<tr>"
					+ "														<td>"
					+ "															<table cellpadding=0 cellspacing=0 width=100% border=0>"
					+ "																<tr>"
					+ "																	<td background=images/bkgPallini2.gif align=right width=100% ><a href='SchedaReferenze.asp?IDReferenza=" + pintIDReferenza + "'><img src=images/botfrecciablu.gif border=0></a></td>"
					+ "																	<td><img src=images/dummy.gif width=3 height=1 border=0></td>"
					+ "																</tr>"
					+ "															</table>"
					+ "														</td>"
					+ "													</tr>"
					+ "												</table>"
					+ "											</td>"
					+ "										</tr>"
					+ "									</table>"
					+ "								</td>"
					+ "							</tr>"
					+ "							<tr><td><img src=images/dummy.gif width=1 height=3 border=0></td></tr>"
					+ "						</table>"
					+ "					</td>"
					+ "				</tr>"
					+ "				<tr><td><img src=images/dummy.gif width=1 height=3 border=0></td></tr>"
					+ "			</table>"
					+ "		</td>"
					+ "	</tr>";
		
		document.write(strOUT);
	}