conta1 = ""
conta2 = ""
conta3 = ""
conta4 = ""
conta5 = ""
conta6 = ""
conta7 = ""
mappa = 0
myFPosition = 0

function CKLogin(pathFile) {
    openTickbox("inputData.asp?pathFile=" + pathFile, "700", "400", 0)
}

function FocusOn() {
    quanto = 80
    myTempObjZO = document.getElementById("lyrZoomOpacity")
    myTempObjZO.style.filter = "alpha(opacity=" + quanto + ")"
    myTempObjZO.style.opacity = "0." + (quanto)
    myTempObjZO.style.MozOpacity = "0." + (quanto)
    myTempObjZO.style.display = "block"
    document.getElementById("lyrZoomContent").style.display = "block"
    var foHead = new FlashObject("/flash/FocusOn09.swf", "FlashHead", "1000", "380", "8", "#000000");
    foHead.addParam("wmode", "transparent");
    foHead.write("focusOnFlash");
    document.getElementById("popFrame").style.display = "none"
    document.getElementById("frameFlash").style.display = "block"
    fFocusOn.location = "/focusOn.asp"
}

function goToPage(myPage) {
    myPage = myPage.replace(".asp?",".asp?focusOn=true&")
    document.location = globalPrePath + myPage
}

function showZoomImg(pathFile) {
    openTickbox("zoomImg.asp?pathFile=" + pathFile, "700", "400", 0)
}

function checkImgSize() {
    getIt = false
    
    myImg = document.getElementById("myImgZoom")
    if (myImg) getIt = true

    myWidth = 0;
    myHeight = 0;
    myWidth = myImg.width;
    myHeight = myImg.height;

    if (myWidth != 0 && myHeight != 0) {
        getIt = true
    } else {
        getIt = false
    }

    if (getIt) {
        myParentObj = parent.document.getElementById("outerPopFrame")
        if (myParentObj) {
            myParentObj.style.width = (myWidth+50) + "px"
            myParentObj.style.height = (myHeight + 100) + "px"
            parent.clearTimeout(parent.myFPosition)
            parent.myFPosition = setTimeout("parent.setPosition('" + (myHeight + 100) + "')", 100)
        }
    } else {
        setTimeout("checkImgSize()",100)
    }
}

function closeFromPopup() {
    closeTickBox();
    parent.clearTimeout(parent.myFPosition)
}

function showFCKEditor(id,idLingua,myData,showData) {
    myTextLyr = document.getElementById("myDetText")
    //myWholeHeight = myTextLyr.offsetHeight
    myWholeText = myTextLyr.innerHTML
    myIndex = myWholeText.indexOf("<!--START-->")
    myIndex += "<!--START-->".length

    myDateToHide = myWholeText.substring(0, myIndex)
    
    if (myWholeText.indexOf('postFCKText') < 0) {
        myString = "<form name='postFCKText' method='post' action='/saveContentText.asp' target='frameSaveContent'>"
        myString += "<input type='hidden' name='id' value='" + id + "'>"
        myString += "<input type='hidden' name='myAction' value='save'>"
        myString += "<input type='hidden' name='idLingua' value='" + idLingua + "'>"
        myString += "<input type='hidden' name='idTipoTesto' value='7'>"
        myString += "<input type='hidden' name='idArea' value='66'>"
        myString += "<input type='hidden' name='myData' value='" + myData + "'>"
        myString += "<input type='hidden' name='showData' value='" + showData + "'>"
        myString += "<input type='hidden' name='strData' value='" + myDateToHide + "'>"
        myString += "<textarea name='myDetTextarea' id='myDetTextarea' class='fckTextarea' style='height: 350px; width: 100%'>" + myTextLyr.innerHTML.replace(myDateToHide,"") + "</textarea>"
        myString += "</form>"
        myString += "<br><a href='#save' onclick='document.postFCKText.submit()' class='tastoverde5' style='float: left; width: auto; margin-left: 1px;'>Save</a>"
        myString += "<iframe name='frameSaveContent' style='display: none;'></iframe>"
        myTextLyr.innerHTML = myString
        FCKeditor.BasePath = "/staff/fckeditor/";

        FCKeditor.ReplaceAllTextareas('fckTextarea');
    }
}

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.getElementsByName("caricaNRP")[0].src="/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()
}

function modTxtFromViewMode(quale,myLingua){
	parent.topFrame.location="../gestViewMode.asp?idTipoTesto="+quale+"&idLingua="+myLingua
	return false;
}

myIdGalleryT = 0
function loadGallery(tickPage){

		var fo = new SWFObject("/viewer.swf", "viewer", "100%", "100%", "8", "#000000");

		// SIMPLEVIEWER CONFIGURATION OPTIONS
		// To use an option, uncomment it by removing the "//" at the start of the line
		// For a description of config options, go to: 
		// http://www.airtightinteractive.com/simpleviewer/options.html
		myIdGalleryT = tickPage
		fo.addVariable("xmlDataPath", "/gallery.asp?id="+tickPage);

		//fo.addVariable("firstImageIndex", "5");	
		//fo.addVariable("langOpenImage", "Open Image in New Window");
		//fo.addVariable("langAbout", "About");	
		//fo.addVariable("preloaderColor", "0xFFFFFF");
		
		fo.write("flashRassegna");	
}

/*################################################################################*/
/*###############       Script per la gestione della tickbox       ###############*/
/*################################################################################*/
myTime = 0
unitaDiMisura = 40 //definisce lo spostamento di pixel per volta
unitaDiTempo = 1 //definisce l'intervallo di tempo in millisecondi tra uno spostamento e l'altro

function faiFade(tickPage,quanto){
	myTime = 1
	if(quanto<70){
		quanto += 5
		myTempObjZO = getTBObj(3)
		myTempObjZO.style.filter = "alpha(opacity="+quanto+")"
		myTempObjZO.style.opacity = "0."+(quanto)
		myTempObjZO.style.MozOpacity = "0."+(quanto)
		setTimeout("faiFade('"+tickPage+"',"+quanto+")",10)
	}else{
		myTime = 0
		openTickbox(tickPage,'','',1)
	}
}

function openTickbox(tickPage,myWidth,myHeight,step){
	showLoadingImage(1)
	myTempObjParent = getTBObj(1)
	myTempFrame = getTBObj(2)
	myTempObjZO = getTBObj(3)
	myTempObjZC = getTBObj(4)
	myTempObjOPF = getTBObj(5)
	myTempObj = getTBObj(6)
	myTempObjTop = getTBObj(7)
	
	if(step==0){
		myFPosition = setTimeout("setPosition('"+myHeight+"')",100)
		myTempObjZO.style.filter = "alpha(opacity=0)"
		myTempObjZO.style.opacity = "0"
		myTempObjZO.style.MozOpacity = "0"
		myTempObjZO.style.display = "block"
		myTempObjZC.style.display = "block"
		myTempFrame.location = tickPage
		myTempObjOPF.style.width = myWidth+"px"
		myTempObjOPF.style.height = myHeight+"px"
		faiFade(tickPage,0)
	}else{
		myTempObjParent.style.display="block"
	}
}

function setTickboxSize(){
	myParentBox = parent.document.getElementById("outerPopFrame")
	if(myParentBox){
		myParentBox.style.background = "none"
	}
}

function closeTickBox(){
	myTempObjParent = getTBObj(1)
	myTempFrame = getTBObj(2)
	myTempObjZO = getTBObj(3)
	myTempObjZC = getTBObj(4)
	
	myTempFrame.location = "about:blank"
	myTempObjParent.style.display="none"
	myTempObjZO.style.display = "none"
	myTempObjZC.style.display = "none"

	clearTimeout(myFPosition)
}

function getTBObj(myType){
	//Type: 1
	myObjParent = parent.document.getElementById("popFrame")
	//Type: 2
	myFrame = parent.popFrame
	//Type: 3
	myObjZO = parent.document.getElementById("lyrZoomOpacity")
	//Type: 4
	myObjZC = parent.document.getElementById("lyrZoomContent")
	//Type: 5
	myObjOPF = parent.document.getElementById("outerPopFrame")
	//Type: 6
	myObj = parent.document.getElementById
	//Type: 7
	myObjTop = parent.document.getElementById("myTop")
	
	myParentStr = ""
	parentNumber = 0
	counter = 0
	while(!myObjParent){
		counter = counter + 1
		if(counter > 10){
			return false;
		}
		parentNumber = parentNumber + 1
		for(i=0;i<parentNumber;i++){
			myParentStr += "parent."
		}
		//Type: 1
		eval("myObjParent = "+myParentStr+"document.getElementById('popFrame')")
		//Type: 2
		eval("myFrame = "+myParentStr+"popFrame")
		//Type: 3
		eval("myObjZO = "+myParentStr+"document.getElementById('lyrZoomOpacity')")
		//Type: 4
		eval("myObjZC = "+myParentStr+"document.getElementById('lyrZoomContent')")
		//Type: 5
		eval("myObjOPF = "+myParentStr+"document.getElementById('outerPopFrame')")
		//Type: 6
		eval("myObj = "+myParentStr+"document.getElementById")
		//Type: 7
		eval("myObjTop = "+myParentStr+"document.getElementById('myTop')")
	}
	switch (myType){
		case 1:
			return myObjParent
		case 2:
			//Type: 2
			return myFrame
		case 3:
			//Type: 3
			return myObjZO
		case 4:
			//Type: 4
			return myObjZC
		case 5:
			//Type: 5
			return myObjOPF
		case 6:
			//Type: 6
			return myObj
		case 7:
			//Type: 7
			return myObjTop
	}
}

function loadResizeFrame(){
	if(parent.myTime == 0){
		myInternalObjHeight = document.getElementById("myHeight")
		myInternalObjWidth = document.getElementById("myWidth")
		if(myInternalObjHeight){
			myTotHeight = ""
			myTotWidth = ""
			myInternalObjHeight.style.display="block"
			myTotHeight = myInternalObjHeight.offsetHeight
			if(myInternalObjWidth){
				myTotWidth = myInternalObjWidth.offsetWidth+32 //pił 32 a causa del padding e bordo destro e sinistro
			}
			myInternalObjHeight.style.display="none"
		}
		showLoadingImage(0)
		runToSize(myTotWidth,myTotHeight,'Height')
	}else{
		setTimeout("loadResizeFrame()",10)
	}
}

function runToSize(myTotWidth,myTotHeight,whichSize){
	myTempOPF = getTBObj(5)
	eval("myTotVar = myTot"+whichSize)
	eval("myTempSize = myTempOPF.offset"+whichSize)
	if(myTempSize > 0){
		segno = "-"
		if(myTempSize < myTotVar){
			segno = "+"
		}
		eval("myTempSize = myTempSize "+segno+" "+unitaDiMisura)
		if(segno == "+"){
			if(myTempSize > myTotVar){
				myTempSize = myTotVar
			}
		}else{
			if(myTempSize < myTotVar){
				myTempSize = myTotVar
			}
		}
		if(whichSize=="Height"){
			myTempOPF.style.height = myTempSize+"px"
		}else{
			myTempOPF.style.width = myTempSize+"px"
		}
		if(myTempSize == myTotVar){
			if(whichSize=="Height"){
				runToSize(myTotWidth,myTotHeight,'Width')
			}else{
				document.getElementById("myHeight").style.display="block"
				myMain = document.getElementById("main")
				myContent = document.getElementById("content")
				if(myMain && myContent) repeatFunc()
				if(mappa == 1) caricaMappa()
			}
		}else{
			setTimeout("runToSize("+myTotWidth+","+myTotHeight+",'"+whichSize+"')",unitaDiTempo)
		}
	}
}

function showLoadingImage(come){
	myTempZC = getTBObj(4)
	bgText = "none"
	if(come==1) bgText = "url(images/loadingAnim.gif)"
	myTempZC.style.background = bgText
	if(come==1){
		myTempZC.style.backgroundPosition = "center center"
		myTempZC.style.backgroundRepeat = "no-repeat"
	}
}

function getPageSizeWithScroll(){
	if (window.innerHeight && window.scrollMaxY) {
		// Firefox
		yWithScroll = window.innerHeight + window.scrollMaxY;
		xWithScroll = window.innerWidth + window.scrollMaxX;
	} else if (document.body.scrollHeight > document.body.offsetHeight){
		// all but Explorer Mac
		yWithScroll = document.body.scrollHeight;
		xWithScroll = document.body.scrollWidth;
	} else {
		// works in Explorer 6 Strict, Mozilla (not FF) and Safari
		yWithScroll = document.body.offsetHeight;
		xWithScroll = document.body.offsetWidth;
	}
	arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);
	//alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );
	return arrayPageSizeWithScroll;
} 


function getScreenScroll(){
	var _x = 0;
	var _y = 0;
	var offsetX = 0;
	var offsetY = 0;

	//IE
	if(!window.pageYOffset)
	{
		//strict mode
		if(!(document.documentElement.scrollTop == 0))
		{
			offsetY = document.documentElement.scrollTop;
			offsetX = document.documentElement.scrollLeft;
		}
		//quirks mode
		else
		{
			offsetY = document.body.scrollTop;
			offsetX = document.body.scrollLeft;
		}
	}
	//w3c
	else
	{
		offsetX = window.pageXOffset;
		offsetY = window.pageYOffset;
	}
	return offsetY
}

function getScreenHeight(){
	var w = 0;
	var h = 0;

	//IE
	if(!window.innerWidth)
	{
		//strict mode
		if(!(document.documentElement.clientWidth == 0))
		{
			w = document.documentElement.clientWidth;
			h = document.documentElement.clientHeight;
		}
		//quirks mode
		else
		{
			w = document.body.clientWidth;
			h = document.body.clientHeight;
		}
	}
	//w3c
	else
	{
		w = window.innerWidth;
		h = window.innerHeight;
	}

	return h
}

function setPosition(myHeight){
	myTempObjZO = getTBObj(3)
	myTempObjZC = getTBObj(4)
	myTempObjOPF = getTBObj(5)
	myTempObjTop = getTBObj(7)
	
	myArrSizes = getPageSizeWithScroll()
	myTempObjZO.style.height = myArrSizes[1]+"px"
	myTempObjZC.style.height = myArrSizes[1]+"px"
	
	
	myScreenHeight = getScreenHeight()
	myScreenScroll = getScreenScroll()
	
	
	/*
	alert("pageHeight = "+myArrSizes[1])
	alert("myScreenScroll = "+myScreenScroll)
	alert("myScreenHeight = "+myScreenHeight)
	*/
	
	
	myTopVar = parseInt( myScreenScroll + (myScreenHeight/2) )
	//alert(parseInt( myTopVar ))
	
	myTempObjTop.style.top = parseInt( myTopVar - (myHeight/2) ) + "px"
	myFPosition = setTimeout("setPosition('"+myHeight+"')",100)
}
/*################################################################################*/
/*###############       Script per la gestione della tickbox       ###############*/
/*################################################################################*/

function attLbl(myObj,status1,status2){
	myObjs= document.getElementsByName("linklbl")
	for(i=0;i<myObjs.length;i++){
		myObjs[i].className = "lbllinks"
	}
	myObj.className = "lbllinksOn"
	document.getElementById("flashRassegna").style.display = status1
	document.getElementById("Panoramiche").style.display = status2
	if(status2 == "block") fPanoramiche.location = "panoramiche.asp?id="+myIdGalleryT
}

function restartGallery(){
	attLbl(document.getElementsByName('linklbl')[0],'block','none')
}


function setSubMenuHeight(thisOne) {
    myObj = document.getElementById('lyrMenu_' + thisOne)
    if(myObj) document.getElementById('lyrMenu_' + thisOne + '_1').style.height = document.getElementById('lyrMenu_' + thisOne + '_2').offsetHeight + 'px'
}
