function pop (url,w,h,s,f) {
LeftPosition =(screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
window.open(url,'new','width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+s+',fullscreen='+f+'')
}

function showLay(layId) {
eval("styleUsed="+layId+".style.display;");
if (styleUsed=="none") { eval(""+layId+".style.display='block';"); } 
else { eval(""+layId+".style.display='none';"); }
}

function ControllaTextArea(form_name,campo,ta_max_digit)
{
	ta_n_digit = document.forms[form_name].elements[campo.name].value.length;
	document.forms[form_name].elements[campo.name +'_len'].value = ta_max_digit - ta_n_digit;
	if (document.forms[form_name].elements[campo.name +'_len'].value < 0)
	{
		document.forms[form_name].elements[campo.name].value = document.forms[form_name].elements[campo.name].value.substring(0,ta_max_digit);
		document.forms[form_name].elements[campo.name +'_len'].value = '0';
	}
}

function checkParent(figlio,check)
{
parente = document.forms['frmask'].elements[figlio]
if (parente){
if (check){
parente.checked=check;

if (figlio.substring(0,6)=='nodi_2'){
figli = document.forms['frmask'].elements['nodi_3_'+parente.value]
if (figli){
figli.checked = check;
for (i=0 ; i<figli.length ; i++)
figli[i].checked=check;}
}

for (i=0 ; i<parente.length ; i++){
parente[i].checked=check;

if (figlio.substring(0,6)=='nodi_2'){
figli = document.forms['frmask'].elements['nodi_3_'+parente[i].value]
if (figli){
figli.checked = check;
for (ii=0 ; ii<figli.length ; ii++)
figli[ii].checked=check;}
}

}

}
}
}


function linkEst(url) {
	if (window.confirm("State abbandonando il sito www.spmsd.it. Le informazioni contenute nel sito a cui state per accedere potrebbero non essere conformi al D.L.vo 219/06, e successive modifiche ed integrazioni, che regola la pubblicità sui medicinali per uso umano. Inoltre, le opinioni riportate potrebbero non necessariamente riflettere le posizioni di SPMSD e potrebbero inoltre non essere condivise. Cliccare Ok per procedere, Annulla per annullare.")) 
	{
		window.open (url);
	}
}
