conta1 = ""
conta2 = ""
conta3 = ""
conta4 = ""
conta5 = ""
conta6 = ""
conta7 = ""
mappa = 0
myFPosition = 0
lyrPartenza = ""

var so

function initPage() {
    showIntroImg()
    showInspirationMenuLyrs()
    setDescrLyrHeight()
}

function showIntroImg() {
    mIntroImg = document.getElementById("IntroImg")
    if (mIntroImg) {
        mIntroImg.style.display = "block"
        showStdImg()
    }
}

function showInspirationMenuLyrs() {
    mObjParent = document.getElementById(lyrPartenza)
    if (mObjParent) {
        while (mObjParent.id != "allInspirationLyr") {
            if (mObjParent.id != "") mObjParent.style.display = "block"
            mObjParent = mObjParent.parentNode
        }
    }
}

function setDescrLyrHeight(){
    objOut = document.getElementById("divCheckHeight")
    objIn = document.getElementById("divDescrizione")

    if (objOut && objIn) {
        if (objOut.offsetHeight > 480) {
            objIn.style.height = (480-(objOut.offsetHeight-480))+"px" 
        }
    }
}

function showProdList(idProd, idLang) {
    MyObj = document.getElementById("lyrProds")
    if (MyObj) MyObj.innerHTML = "Loading..."
    fProdList.location = "/LoadProdList.asp?idProd="+idProd+"&idLang="+idLang
}

function hideSameLevel(livello) {
    mainLyr = document.getElementById("allInspirationLyr")
    mLyrs = mainLyr.getElementsByTagName("DIV")
    for (i = 0; i < mLyrs.length; i++) {
        mName = mLyrs[i].id
        if (mName != "") {
            if (mName.split("_")[0] == "lyrMInsp" && mName.split("_")[1] == livello) {
                mLyrs[i].style.display = "none"
            }
        }
    }
}

function changeLabelTitle(myTitle) {
    MyObj = document.getElementById("prodGroupName")
    if (MyObj) MyObj.innerHTML = myTitle

    myLNL = document.getElementById("lyrNewLayout")
    if (myLNL) {
        myLNL.style.display = "block"
    }
}

function apriSottoMenu(livello, quale, pathOggetto) {
    mainLyr = document.getElementById("allInspirationLyr")
    mLyrs = mainLyr.getElementsByTagName("DIV")
    
    hideSameLevel(livello)

    if (quale == 294) {
        hideSameLevel(2)
        hideSameLevel(3)
    }

    if (quale == 294 || quale == 297) {
        myLNL = document.getElementById("lyrNewLayout")
        if (myLNL) myLNL.style.display = "none"
    }
    
    myObj = document.getElementById("lyrMInsp_" + livello + "_" + quale)
    if (myObj) myObj.style.display = "block"

    myLyrNews = document.getElementById("lyrNews")
    if (myLyrNews) myLyrNews.style.display = "none"
    
    myLyrRis = document.getElementById("lyrRiservata")
    if (myLyrRis) myLyrRis.style.display = "block"

    myLyrRis = document.getElementById("lyrNewsTitolo")
    if (myLyrRis) myLyrRis.style.display = "none"

    changeProdBkg(pathOggetto)
}

function changeProdBkg(pathOggetto) {
    MyImgBkg = document.getElementById("lyrBkgProdList")
    if (MyImgBkg) {
        //if (pathOggetto != "") {
            MyImgBkg.style.display = "block"
            MyImgInside = MyImgBkg.getElementsByTagName("IMG")[0]
            if (MyImgInside && pathOggetto != "") {
                MyImgInside.src = "/public/img/gestionesezioni/" + pathOggetto
            }
        /*} else {
            MyImgBkg.style.display = "none"
        }*/
    }

    MyObj = document.getElementById("lyrProds")
    if (MyObj) {
        if (MyObj.innerHTML != "Loading...") {
            MyObj.innerHTML = ""
        }
    }
}

function showSolution(quale) {
    myImg = document.getElementById("myPixelHeight")
    switch (quale) {
        case 1:
            myImg.style.height = "60"
            break;
        case 2:
            myImg.style.height = "90"
            break;
        case 3:
            myImg.style.height = "124"
            break;
    }
    myImg.style.display = "block"
    myImg.style.borderBottom = "1px solid #EEE"
    document.getElementById("solRightCol").style.borderLeft = "1px solid #EEE"
    document.getElementById("lyrSol"+quale).style.display = "block"
    document.getElementById("rett" + quale).style.display = "block"
}

function hideSolution(quale) {
    myImg = document.getElementById("myPixelHeight")
    myImg.style.display = "none"
    myImg.style.borderborderBottom = "none"
    document.getElementById("solRightCol").style.borderLeft = "none"
    document.getElementById("lyrSol" + quale).style.display = "none"
    document.getElementById("rett"+quale).style.display="none"
}

function CKLogin(pathFile) {
    openTickbox("inputData.asp?pathFile=" + pathFile, "700", "400", 0)
}

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");	
}

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'
}

function openRss(myObj) {
    myObjs = document.getElementsByName("rssLinks")
    for (i = 0; i < myObjs.length; i++) {
        mId = myObjs[i].id.replace("myRSSLink_", "")
        myObjs[i].className = "rssLinks linkAll"
        myTempObj = document.getElementById("myRss_" + mId)
        if (myTempObj) myTempObj.style.display = "none"
        myTempObj = document.getElementById("outerFrame_" + mId)
        if (myTempObj) myTempObj.style.display = "block"
    }
    myObj.className = "rssLinksOn linkAll"
    mId = myObj.id.replace("myRSSLink_", "")
    myTempObj = document.getElementById("myRss_" + mId)
    if (myTempObj) {
        myTempObj.style.display = "block"
        myFrame = eval("iFrameRss_" + mId)
        myFrame.location = "/loadRSSWidget.asp?id=" + mId
    }
}

function ShowGMap() {
    mDesc = document.getElementById("divDescrizione")
    if (mDesc) {
        if (mDesc && mDesc.offsetHeight > 0 && checkedHeight == true) {
            mHtml = mDesc.innerHTML
            mDesc.innerHTML = ""
            mDesc.innerHTML = mHtml
        } else {
            setTimeout("ShowGMap()", 300)
        }
    }
}

checkedHeight = false
function checkHeight(myObjId,JustHeight) {
    myObj = document.getElementById("" + myObjId)
    myObj.style.display = "block"
    mDD = document.getElementById("divDescrizione")
    if (mDD) mDD.style.height = "auto"
    
    mWidth = myObj.offsetWidth
    if (mWidth > 1000) mWidth = 1000

    mHeight = myObj.offsetHeight + 3
    if (mHeight > 500) {
        if (legalInfo == true) {
            mHeight = 300
        } else {
            mHeight = 500
        }
        if (mDD) mDD.style.height = "480px"
    }
    myObj.style.display = "none"
    if (mWidth < 100 || mHeight < 100) {
        setTimeout("checkHeight('" + myObjId + "'," + JustHeight + ")", 10)
    } else {
        myObj.style.display = "block"
        resizeTickbox(mWidth, mHeight, JustHeight)
    }
}

function resizeTickbox(mWidth, mHeight, JustHeight) {
    mTB = parent.document.getElementById("TB_window")

    if ("" + JustHeight == "0") {
        mTB.style.width = mWidth + "px"
        mTB.style.marginLeft = "-" + (mWidth / 2) + "px"
    }

    mTB.style.marginTop = "-" + (mHeight / 2) + "px"

    mIF = parent.document.getElementById("TB_iframeContent")
    if ("" + JustHeight == "0") {
        mIF.style.width = mWidth + "px"
    }
    mIF.style.height = mHeight + "px"

    mTT = parent.document.getElementById("TB_title")
    if ("" + JustHeight == "0") {
        mTT.style.width = (mWidth + 1) + "px"
    }

    checkedHeight = true
}
