<!--
// **** popup centrata
var win = null;
function aprialcentro(url,name,w,h,scroll){
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
win = window.open(url,name,'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=no')
if(win.window.focus){win.window.focus();}
}

//Popup normale
function openWindow(url, name, w, h,scroll ) {
  popupWin = window.open(url, name, 'menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars='+scroll+',resizable=no,width='+ w + ',height='+ h + ',top=10,left=10')
}

//Popup per immagini
function ingrandisci(immagine,descrizione,larghezza,altezza)
{ 
eval("NewWin=window.open('','popup','resizable=no,scrollbars=no,status=no,width='+larghezza+',height='+altezza+',left=5,top=5');"); 
NewWin.document.write ("<HTML><HEAD><TITLE>");
NewWin.document.write (".:: NOME AZIENDA ::. ");
NewWin.document.write (descrizione + "</TITLE>");
NewWin.document.write ("</HEAD>\n"); 
NewWin.document.write ("<BODY Onload='top.window.focus()' MARGINWIDTH='0' MARGINHEIGHT='0' TOPMARGIN='0' LEFTMARGIN='0'>\n"); 
NewWin.document.write ("<a href='javascript:this.close();'><IMG SRC='");
NewWin.document.write (immagine);
NewWin.document.write ("' WIDTH='");
NewWin.document.write (larghezza);
NewWin.document.write ("' HEIGHT='");
NewWin.document.write (altezza);
NewWin.document.write ("' BORDER='0'  ALT='Clicca per chiudere' STYLE=position:absolute;left=0px;top=0px></a>"); 
NewWin.document.write ("</BODY></HTML>"); 
NewWin.document.close();
} 




var checkobj
function accetta(el){
checkobj=el
	if (document.all||document.getElementById){
		for (i=0;i<checkobj.form.length;i++){  
var tempobj=checkobj.form.elements[i]
	if(tempobj.type.toLowerCase()=="submit")
tempobj.disabled=!checkobj.checked
							}
						}
					}

function disabilita(el){
	if (!document.all&&!document.getElementById){
			if (window.checkobj&&checkobj.checked)
return true
		else{
alert("Per favore accetta i termini del contratto")
return false
						}
					}
				}

 
function clearFocus() 
{ 
no_bordo = function(){this.blur()} 
for(i=0;i<document.links.length;i++) 
{ 
document.links[i].onfocus=no_bordo; 
} 
} 
onload=clearFocus; 
// --> 

function richiamaOnload() {
clearFocus();
}
onload=richiamaOnload;


<!--
// Form Validation JavaScript

function EW_onError(form_object, input_object, object_type, error_message)
    {
		alert(error_message);
	if (object_type == "RADIO" || object_type == "CHECKBOX") {
		if (input_object[0])
				input_object[0].focus();
			else
				input_object.focus();
		}
		else
			input_object.focus();
		if (object_type == "TEXT" || object_type == "PASSWORD")
			input_object.select();		
	return false;	
    }


function EW_checknumber(object_value)
    {
    if (object_value.length == 0)
	return true;

	var start_format = " .+-0123456789";
	var number_format = " .0123456789";
	var check_char;
	var decimal = false;
	var trailing_blank = false;
	var digits = false;

	check_char = start_format.indexOf(object_value.charAt(0))
	if (check_char == 1)
	    decimal = true;
	else if (check_char < 1)
		return false;
	
	for (var i = 1; i < object_value.length; i++)
	{
		check_char = number_format.indexOf(object_value.charAt(i))
		if (check_char < 0)
			return false;
		else if (check_char == 1)
		{
			if (decimal)
				return false;
			else
				decimal = true;
		}
		else if (check_char == 0)
		{
			if (decimal || digits)	
				trailing_blank = true;
		}
	    else if (trailing_blank)
			return false;
		else
			digits = true;
	}	

    return true
    }
    
function CarrelloAdd(MyUrl,pID,IdEl) {
  document.location.href = MyUrl+'?act=add&prod='+pID+'&qt='+document.getElementById(IdEl).value;
  return true;
	}
	
function CarrelloAdd1(pID,IdEl) {
  document.write("<a href=\"carrello_act.asp?act=add&prod="+pID+"&qt=" + document.getElementById(IdEl).value + "\"><img border=\"0\" src=\"images/e-commerce.gif\" width=\"19\" height=\"16\"></a>");
  return true;
	}	
	
function checknumberIMP1(obj){
	v = obj.value;
	if (v.length > 0) {
		carattere = v.substr(v.length-1);
		if (carattere<"0" || carattere>"9") {
			if (carattere!="," && carattere!="-") {
				obj.value = 1;
			}
		}
	}		
	if (obj.value=="0") {
		obj.value = 1;
	}
}

/***********************************************
* Funzione per testo espandibile
***********************************************/

var enablepersist="on" //Enable saving state of content structure using session cookies? (on/off)
var collapseprevious="yes" //Collapse previously open content when opening present? (yes/no)

		function toggleAll()
		{
		    var sa = document.getElementById("chkViewAll");
		    var ch = sa.checked;
		    toggleQuestions(ch);
		}



if (document.getElementById){
document.write('<style type="text/css">')
document.write('.switchcontent{display:none;}')
document.write('</style>')
}

function getElementbyClass(classname){
ccollect=new Array()
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
ccollect[inc++]=alltags[i]
}
}

function contractcontent(omit){
var inc=0
while (ccollect[inc]){
if (ccollect[inc].id!=omit)
ccollect[inc].style.display="none"
inc++
}
}

function expandcontent(cid){
if (typeof ccollect!="undefined"){
if (collapseprevious=="yes")
contractcontent(cid)
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
}
}

function revivecontent(){
contractcontent("omitnothing")
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
for (i=0; i<selectedComponents.length-1; i++)
document.getElementById(selectedComponents[i]).style.display="block"
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function getselectedItem(){
if (get_cookie(window.location.pathname) != ""){
selectedItem=get_cookie(window.location.pathname)
return selectedItem
}
else
return ""
}

function saveswitchstate(){
var inc=0, selectedItem=""
while (ccollect[inc]){
if (ccollect[inc].style.display=="block")
selectedItem+=ccollect[inc].id+"|"
inc++
}

document.cookie=window.location.pathname+"="+selectedItem
}

function do_onload(){
getElementbyClass("switchcontent")
if (enablepersist=="on" && typeof ccollect!="undefined")
revivecontent()
}


if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload

if (enablepersist=="on" && document.getElementById)
window.onunload=saveswitchstate