conta1 = ""
conta2 = ""
conta3 = ""
conta4 = ""
conta5 = ""
conta6 = ""
conta7 = ""
conta8 = ""
conta9 = ""
conta10 = ""

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
	caricato=true
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function colorabordo(quale){
	if(quale.style.border=="#000 1px solid"){
		quale.style.border="#AAA 1px solid"
	}else{
		quale.style.border="#000 1px solid"
	}
}


function controlla_1step(questo){
	var mio = document.getElementById("lyr_form")
	if(questo.checked){
		if(letto == false){
			alert(eval("step1_"+document.req.lingua))
		}
		mio.style.display="block"
		if(questo.dove=="popup"){
			parent.window.resizeTo(536,495)
		}
		if(questo.dove=="stampa"){
			parent.window.resizeTo(480,500)
		}
		parent.topzero.location="../carica.asp?caricaora=1"
	}else{
		mio.style.display="none"
		if(questo.dove=="popup"){
			parent.window.resizeTo(520,232)
		}
		if(questo.dove=="stampa"){
			parent.window.resizeTo(480,368)
		}
	}
}


function controlla_2step(questo){
	if(questo.value=="si"){
		if(letto2 == false){
			//alert("Prima di procedere con la compilazione del modulo, vi consigliamo di leggere\nla nota informativa sul trattamento e l'invio dei dati personali")
			alert(eval("step2_"+document.req.lingua))
		}
		parent.topzero.location="../carica.asp?caricaora=3"
	}
}

function copiamail(questo){
	document.req.mlist.value=questo.value
}

function clearMenu(myMenuItem, myMenuItem2){
	var subMenuItems = parent.myFrame.document.getElementsByName(''+ myMenuItem +'');
	var subMenuItems2 = parent.myFrame.document.getElementsByName(''+ myMenuItem2 +'');
	for (i = 0; i < subMenuItems.length; i++) {
        subMenuItems[i].style.fontWeight='normal';
    }
	for (j = 0; j < subMenuItems2.length; j++) {
        subMenuItems2[j].style.fontWeight='normal';
    }
}

function checkLeftMenu(menuId, myMenuItem) {
    var subMenuItems = document.getElementsByName(''+ myMenuItem +'');
    for (i = 0; i < subMenuItems.length; i++) {
        subMenuItems[i].style.fontWeight='normal';
    }
    subMenuItems[menuId].style.fontWeight='bold';
}

function checkLeftMenu2(menuId, myMenuItem){
	var menuLast = document.req.lastChecked.value;
	if (menuLast != null && menuLast != '')
	{
		var oldVar = document.getElementsByName(''+ menuLast +'')
		for (i = 0; i<oldVar.length;i++){
			oldVar[i].style.fontWeight='normal'
		}
	}
	//alert (menuLast)
	var newVar = document.getElementsByName(''+ myMenuItem +'')

	for (i = 0; i<newVar.length;i++){
		newVar[i].style.fontWeight='normal'
	}
	newVar[menuId].style.fontWeight='bold'
	
	if (document.req.lastChecked.value != null
		&& document.req.lastChecked.value != '')
		{
		document.req.lastChecked.value = myMenuItem;
		}
		
}

function checkTopMenu(menuId, myMenuItem){
	var newVar = document.getElementsByName(''+ myMenuItem +'')
	for (i = 0; i<newVar.length;i++){
		newVar[i].className='top_menu' 
	}
	newVar[menuId].className='top_menu_on'
}

function checkBottomMenu(menuId, myMenuItem){
	var newVar = document.getElementsByName(''+ myMenuItem +'')
	for (i = 0; i<newVar.length;i++){
		newVar[i].className='bottom_menu' 
	}
	newVar[menuId].className='bottom_menu_on'
}

function resizeFrame(myFrame, myDiv){
	//alert (myFrame)
	//alert (myDiv)
	var myObj = parent.document.getElementById(''+ myFrame +'')
	//alert (myObj)
	if(myObj){
	   myObj.style.height = document.getElementById(''+ myDiv +'').offsetHeight
	}
	//alert (myObj.style.height)
}

function setLanguage(quale){
	myForm = document.formLanguage
	if(myForm){
		myField = myForm.langWebSite
		if(myField){
			myField.value = quale
			myForm.submit()
		}
	}
}

function checkSearch(messaggio){
	myForm = document.searchForm
	if(myForm){
		myField = myForm.searchField
		if(myField){
			quale = myField.value
			if(quale.length < 3){
				alert(messaggio)
				myField.focus()
				return false;
			}
			myForm.submit()
		}
	}
}

function impostaLogoDefault(questo){
	questo.src = "../staff/images/logo.gif"
}

function SH_Coming(myStatusComing,myTopComing){
	var myLyrComing = document.getElementById("lyrComing")
	if(myLyrComing){
		if(myTopComing!=""){
			myLyrComing.style.top = myTopComing
		}else{
			myLyrComing.style.top = "50%"
		}
		myLyrComing.style.display=myStatusComing
	}
}

function cambiapagina(operation,messerrore){
	var myForm = eval("document.formPaging")
	switch(operation){
		case "back":
			myForm.numPage.value--
		break    
		case "next":
			myForm.numPage.value++
		break
		case "ricerca":
			if(myForm.page_field.value==0 || isNaN(myForm.page_field.value)){
				alert(messerrore)
				myForm.page_field.focus()
				return false;
			}
			myForm.numPage.value = myForm.page_field.value
		break
		default:
			if(operation!=""){
				myForm.numPage.value = operation
			}else{
				return false;
			}
	}
	myForm.submit()
}

function cambiapaginaCatalogue(operation,messerrore){
	var myFormPaging = eval("document.formPaging")
	var myForm = eval("document.searchProducts")
	switch(operation){
		case "back":
			myForm.numPage.value--
		break    
		case "next":
			myForm.numPage.value++
		break
		case "ricerca":
			if(myFormPaging.page_field.value==0 || isNaN(myFormPaging.page_field.value)){
				alert(messerrore)
				myFormPaging.page_field.focus()
				return false;
			}
			myForm.numPage.value = myFormPaging.page_field.value
		break
		default:
			if(operation!=""){
				myForm.numPage.value = operation
			}else{
				return false;
			}
	}
	myForm.submit()
}

var myScrollPageTimeout
var going = 0
function scrollaPaging(come){
	if(going == 1){
		var myObj = document.getElementById("scrollPaging")
		if(come=="next"){
			var myObjInsideWidth = document.getElementById("scrollPagingIn").offsetWidth-3
			if(myObj.scrollLeft < myObjInsideWidth){
				myObj.scrollLeft = myObj.scrollLeft + 3
				myScrollPageTimeout = setTimeout("scrollaPaging('"+come+"')",1)
			}else{
				myObj.scrollLeft = myObjInsideWidth -3
				clearTimeout(myScrollPageTimeout)
			}
		}else{
			if(myObj.scrollLeft > 3){
				myObj.scrollLeft = myObj.scrollLeft - 3
				myScrollPageTimeout = setTimeout("scrollaPaging('"+come+"')",1)
			}else{
				myObj.scrollLeft = 0
				clearTimeout(myScrollPageTimeout)
			}
		}
	}
}

function SHAltSim(quale){
	myObjAlt = document.getElementById("lyrPhoto_"+quale)
	if(myObjAlt){
		if(myObjAlt.style.display=="" || myObjAlt.style.display=="none"){
			myObjAlt.style.display="block"
		}else{
			myObjAlt.style.display="none"
		}
	}
}

function stopScrollaPaging(){
	clearTimeout(myScrollPageTimeout)
	going = 0
}

function caricaDefault(questo){
	questo.src="images/1pixel.gif"
	questo.style.background = "url(images/imgdefault.jpg)"
	questo.style.backgroundPosition = "center center"
	questo.style.backgroundRepeat = "no-repeat"
}

function zoomImmagini(pagina,titolo,varLink_2,varTipoOggetto_2,varTipoLink_2,varImg_2,varTesto_2,myActualId){
	myObjVar = eval(myActualId)
	myVar = ""
	if(myObjVar) myVar = myObjVar
	window.open(pagina+'?titolo='+titolo+'&varLink_2='+varLink_2+'&varTipoOggetto_2='+varTipoOggetto_2+'&varTipoLink_2='+varTipoLink_2+'&varImg_2='+varImg_2+'&varTesto_2='+varTesto_2+'&myActualId='+myVar,'zoom','scrollbars=yes,resizable=yes,width=800,height=600')
}

function ricercaNews(testoTitAlmeno,testoTitVuoto,testoSelAzienda,testoSelTipo){
	var myForm = document.searchNews
	/*
	if(myForm.newssearchField.value.length < 3){
		alert(testoTitAlmeno)
		myForm.newssearchField.focus()
		return false;
	}
	
	if(myForm.newssearchField.value == ""){
		alert(testoTitVuoto)
		myForm.newssearchField.focus()
		return false;
	}
	*/
	if(myForm.newssearchAzienda.selectedIndex==0){
		alert(testoSelAzienda)
		myForm.newssearchAzienda.focus()
		return false;
	}
	if(myForm.newssearchTipologia.selectedIndex==0){
		alert(testoSelTipo)
		myForm.newssearchTipologia.focus()
		return false;
	}
	myForm.nomeAziendaSearchNews.value = myForm.newssearchAzienda.options[myForm.newssearchAzienda.selectedIndex].text
	myForm.submit()
}

function cambiaPaginaDaLink(myStrTipoLink,myStrLink){
	myPrevAddress = ""+document.location
	myPrevAddress = myPrevAddress.replace("http://","")
	var myArrString = myPrevAddress.split("/")
	myAddress = ""
	for(i=0;i<myArrString.length-1;i++){
		myAddress = myAddress + myArrString[i] + "/"
	}
	if(myStrTipoLink==0){
		document.location = "http://"+myAddress+myStrLink
	}else{
		window.open(myStrLink,'','')
	}
}

function accendimenu(quale){
	var myObj = document.getElementsByName("top_menu")[quale]
	if(myObj) myObj.className = myObj.className+"_on"
}

function accendimenusotto(quale){
	var myObj = document.getElementsByName("bottom_menu")[quale]
	if(myObj) myObj.className = myObj.className+"_on"
}

function searchJob(myError){
	if(document.jobSearch.categoria.selectedIndex==0 && document.jobSearch.azienda.selectedIndex==0){
		alert(myError)
		document.jobSearch.categoria.focus()
		return false;
	}
	document.jobSearch.submit()
}

function cambiaNRP(questo,fieldToUpdate,secondField){
	var myValue = questo.options[questo.selectedIndex].value
	if(myValue!=""){
		document.caricaNRP.location="caricaNRP.asp?id="+myValue+"&fieldToUpdate="+fieldToUpdate
	}else{
		var myObj = eval("document.req."+fieldToUpdate)
		for (i=myObj.options.length;i>=1;i--){
			myObj.options[i]=null
		}
		if(secondField!=""){
			var myObj = eval("document.req."+secondField)
			for (i=myObj.options.length;i>=1;i--){
				myObj.options[i]=null
			}
		}
	}
}

function mostraaltroconosciuti(questo){
	var myValue = questo.options[questo.selectedIndex].value
	myStatus = "none"
	if(myValue=="0"){
		myStatus = "block"
	}
	document.getElementById("lyraltroconosciuti").style.display=myStatus
	document.req.altroconosciuti.value=""
}

function controllaSettore(questo){
	var myValue = questo.options[questo.selectedIndex].value
	var myBackground = "#EEE"
	var myDisabled = true
	if(myValue==0){
		myBackground = "#FFF"
		myDisabled = false
	}
	document.req.sector_specify.style.background = myBackground
	document.req.sector_specify.disabled = myDisabled
	if(!document.req.sector_specify.disabled) document.req.sector_specify.focus()
}

function goToProd(quale){
	document.searchProducts.action = "catalogue_visua.asp"
	document.searchProducts.method = "get"
	document.searchProducts.id.value = quale
	document.searchProducts.submit()
}

function goBack(){
	if(document.searchProducts.length > 1){
		document.searchProducts[1].submit()
	}else{
		document.searchProducts.submit()
	}
}

function addToYourCat(whichOne, operazione, message) {
	proceed = "ok"
	opType = ""
	if(whichOne!=""){
		myFrame = document.getElementById("frameMyCatalogue")
		if(myFrame){
			if(!document.cookie){
				alert(message)
			}else{
				if(operazione=="togli"){
					if(window.confirm(message)){
						opType="&opType=togli"
					}else{
						proceed = "no"
					}
				}
				if(proceed == "ok") myFrame.src = "addToMyCatalogue.asp?id="+whichOne+opType
			}
		}
	}
}

function addToCompare(whichOne,whichCols,operazione,message){
	proceed = "ok"
	opType = ""
	if(whichOne!=""){
		myFrame = document.getElementById("frameMyCatalogue")
		if(myFrame){
			if(!document.cookie){
				alert(message)
			}else{
				if(operazione=="togli"){
					if(window.confirm(message)){
						opType="&opType=togli"
						document.getElementById("contentTable").rows[0].deleteCell(whichCols)
						
					}else{
						proceed = "no"
					}
				}
				if(proceed == "ok") myFrame.src = "addToCompare.asp?id="+whichOne+opType
			}
		}
	}
}

function openCompare(){
	try {
		window.open("compare.asp","compare","scrollbars=yes,resizable=yes,top=10,left=10,width="+(screen.width-30)+",height="+(screen.height-100)) // IE only
	}catch(ex){
		window.open("compare.asp","compare","scrollbars=yes,resizable=yes,top=10,left=10,width=800,height=500") // standards compliant; doesn't work in IE
	}
}

function selArts(whichOne,myStatus){
	document.getElementById("lyrCompare_"+whichOne).style.display=myStatus
	document.getElementById("myFrameCompare_"+whichOne).src = "compareArticles.asp?id="+whichOne
}

function confirmArticles(whichOne,operazione,message){
	builtAssociation = ""
	myObjForm = document.req.addArticle
	for(i=0;i<myObjForm.length;i++){
		if(myObjForm[i].checked){
			builtAssociation = builtAssociation + whichOne + "[code]" + myObjForm[i].value + ","
		}
	}
	if(builtAssociation!="") builtAssociation = builtAssociation.substring(0,(builtAssociation.length-1))
	myFrame = parent.document.getElementById("frameMyCatalogue")
	if(myFrame) myFrame.src = "addToCompare.asp?id="+builtAssociation
	myDivOut = parent.document.getElementById("lyrCompare_"+whichOne)
	if(myDivOut) myDivOut.style.display="none"
}

function SH_BenefitsCategory(whichCat){
	var myObj = document.getElementById("lyrCatBenefits_"+whichCat)
	if(myObj.style.display=="" || myObj.style.display=="none"){
		myObj.style.display="block"
	}else{
		myObj.style.display="none"
	}
}

function checkGlobalSearch(messaggio){
	myForm = document.searchForm
	if(myForm.searchField.value=="" || myForm.searchField.value.length<3){
		alert(messaggio)
		myForm.searchField.focus()
		return false;
	}
	myForm.submit()
}
