function new_win(Cartolina,Orientamento) {
	Cartolina = "../../kards/"+Path+"/"+Cartolina+".jpg"
	if (Orientamento==1){
    	id = window.open(Cartolina,
							'new_win',
							'scrollbars=no,resizable=no,width=300,height=450,status=no,location=no,toolbar=no')
	}else{
    	id = window.open(Cartolina,
							'new_win',
							'scrollbars=no,resizable=yes,width=450,height=350,status=no,location=no,toolbar=no');
	}
	id.focus()
}



function win_send(Cartolina) {
	msg=open("","schermo","toolbar=no,menubar=no,width=650,height=400,resizable=no");
	html = '<head><script language="JavaScript">'
	/*
	html = html +	'var supportsKeys = false'
	html = html +	' function onLoad() {'
	html = html +		' tick()'
	html = html +	' }'
	html = html +	' function tick() {'
	html = html +		' calcCharLeft(document.forms[0]);'
	html = html +		' if(!supportsKeys) {'
	html = html + 			' timerID = setTimeout("tick()",500)'
	html = html +		' }'
	html = html +	' }'
	html = html +	' function calcCharLeft(f) {'
	html = html +		' maxLength = (159 - 14);'
	html = html +       ' if(f.msgText.value.length > maxLength) {'
	html = html +	    	' f.msgText.value = f.msgText.value.substring(0,maxLength)'
	html = html +			' charleft = 0'
	html = html +		' } else {'
	html = html +			' charleft = maxLength - f.msgText.value.length'
	html = html +		' }'
	html = html +		' f.msgCL.value = charleft'
	html = html +	' }'
	html = html +	' function textKey (f) {'
	html = html +		' supportsKeys = true'
	html = html +		' calcCharLeft (f)'
	html = html +	' }'
	*/
	html = html +	'</script> </head>'
	html = html +	'<body bgcolor="#ff9900"><form method="post" action="http://194.184.39.27/cgi-bin/SendHtml.pl">'
	html = html +   '<div align="center">'
	html = html +   '<table width="95%" border="0" height="66">'
	html = html +     '<tr>'
	html = html +       '<td rowspan="3" valign="middle" width="22%">'
	html = html +        "<img src='../../kardmin/t_"+Path+'/'+Cartolina+".jpg'></td>"
	html = html +       '<td width="43%" height="52" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>Per&nbsp;'
	html = html +         'inviare questa cartolina e associare un messaggio, segui questi semplici'
	html = html +        ' passi:</b></font></td>'
	html = html +       '<td width="2%" height="52">&nbsp;</td>'
	html = html +       '<td width="33%" height="52" align="right"><img src="../../kardmin/kardlog.gif" width="129" height="50"></td>'
	html = html +     '</tr>'
	html = html +     '<tr>'
	html = html +       '<td width="43%" height="52"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">1)'
	html = html +         'Scrivi la tua e-mail (per farti rispondere!!):</font></td>'
	html = html +       '<td width="2%" height="52">&nbsp;</td>'
	html = html +       '<td width="33%" height="52">'
	html = html +         '<input type="text" name="EmailMit" size="40" maxlength="40">'
	html = html +      '</td>'
	html = html +    '</tr>'
	html = html +     '<tr> '
	html = html +      '<td width="43%" height="2"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">2)'
	html = html +        'Scrivi la e-mail del ricevente:</font></td>'
	html = html +       '<td width="2%" height="2">&nbsp;</td>'
	html = html +       '<td width="33%" height="2">'
	html = html +         '<input type="text" name="EmailRic" size="40" maxlength="40">'
	html = html +       '</td>'
	html = html +     '</tr>'
	html = html +   '</table><br>'
	html = html +	'<font face="Verdana, Arial, Helvetica, sans-serif" size="2">'
	html = html +   'Scrivi un breve messaggio da inviare insieme alla cartolina: </font><BR><BR>'
	html = html +	'<TEXTAREA NAME="TestoMail" ROWS="5" COLS="25" WRAP="soft" onKeyUp="textKey(this.form)"></TEXTAREA>'
	/*
	html = html +	'<input type="text" name="msgCL" size="3" value="145"><BR><BR>'
	*/
	html = html +     '<BR><BR><input type="submit" name="Submit" value="INVIA">&nbsp;&nbsp;&nbsp;&nbsp;'
	html = html +     '<input type="button" name="close" value="Chiudi questa finestra" OnMouseDown="window.close()">'
	html = html +     '<input type="hidden" name="Cartolina" value="'+Cartolina+'">'
	html = html +     '<input type="hidden" name="Path" value="'+Path+'">'
	html = html +     '<input type="hidden" name="TemplateMail" value="MailHtml.tmpl">'
	html = html +   '</div>'
	html = html +  '</form></body></html>'
	msg.document.write(html)
	msg.focus()
}
