/* String playSound = (String)session.getAttribute("PLAY_SOUND"); if (playSound == null || playSound == "null" || playSound.equals("")){ playSound = "no"; } */ var langSlideAction = "open"; function selectLanguage() { var mySlide3 = new Fx.Slide('bottom-language', {mode: 'vertical'}); mySlide3.hide(); if (langSlideAction == "open") { document.getElementById("box-wrapper-2").style.visibility ="visible"; mySlide3.slideIn(); langSlideAction ="close"; } else { mySlide3.slideOut(); langSlideAction ="open"; } } /* var popupWin; function sound(){ var tt = "< % = playSound % > "; if(tt == "no"){ popupWin = window.open("/hotel/service/sound.jsp","audio","width=470,height=100,scrollbar=no,dependent=yes"); } return true; } */ function checkLeftTextLenght(h,div,bottonClose) { var tObj = document.getElementById('ltext'); var tHeight = tObj.offsetHeight; if (tHeight > h) { createTagImg(div,bottonClose); } } var divList = new Array(); function scrollDown(divId,step,imgDownId,imgUpId) { if (divList[divId]===undefined || divList[divId]===null) { divList[divId] = 0; } var currentDiv = document.getElementById(divId); currentDiv.scrollTop += step; switch(currentDiv.scrollTop) { case 0: //document.getElementById(imgDownId).style.visibility = "visible"; //document.getElementById(imgUpId).style.visibility = "hidden"; divList[divId]=setTimeout("scrollDown('"+divId+"','"+imgDownId+"','"+imgUpId+"')",1); break; case currentDiv.scrollHeight-parseInt(currentDiv.style.height,10): //document.getElementById(imgDownId).style.visibility = "hidden"; //document.getElementById(imgUpId).style.visibility = "visible"; break; default: //document.getElementById(imgDownId).style.visibility = "visible"; //document.getElementById(imgUpId).style.visibility = "visible"; divList[divId]=setTimeout("scrollDown('"+divId+"',"+step+",'"+imgDownId+"','"+imgUpId+"')",1); } } function stopScroll(divId,imgUpObj,imgDownObj) { if (divList[divId]!==undefined && divList[divId]!==null) { clearTimeout(divList[divId]); } } function scrollUp(divId,step,imgDownId,imgUpId) { if (divList[divId]===undefined || divList[divId]===null) { divList[divId] = 0; } var currentDiv = document.getElementById(divId); currentDiv.scrollTop -= step; switch(currentDiv.scrollTop) { case 0: //document.getElementById(imgDownId).style.visibility = "visible"; //document.getElementById(imgUpId).style.visibility = "hidden"; break; case currentDiv.scrollHeight-parseInt(currentDiv.style.height,10): //document.getElementById(imgDownId).style.visibility = "hidden"; //document.getElementById(imgUpId).style.visibility = "visible"; divList[divId]=setTimeout("scrollUp('"+divId+"',"+step+",'"+imgDownId+"','"+imgUpId+"')",1); break; default: //document.getElementById(imgDownId).style.visibility = "visible"; //document.getElementById(imgUpId).style.visibility = "visible"; divList[divId]=setTimeout("scrollUp('"+divId+"',"+step+",'"+imgDownId+"','"+imgUpId+"')",1); } } function stopScrollWrapper(evt){ var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false; var ie_var = "srcElement"; var moz_var = "target"; var prop_var = "myflag"; if (isIE){ var div = evt[ie_var][prop_var]; } else{ var div = evt[moz_var][prop_var]; } stopScroll(div); } function scrollDownWrapper(evt){ var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false; var ie_var = "srcElement"; var moz_var = "target"; var prop_var = "myflag"; if (isIE){ var div = evt[ie_var][prop_var]; } else{ var div = evt[moz_var][prop_var]; } scrollDown(div,2,'scroll_down','scroll_up'); } function scrollUpWrapper(evt){ var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false; var ie_var = "srcElement"; var moz_var = "target"; var prop_var = "myflag"; if (isIE){ var div = evt[ie_var][prop_var]; } else{ var div = evt[moz_var][prop_var]; } scrollUp(div,2,'scroll_down','scroll_up'); } function createTagImg(div,bottonClose) { var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false; var divTag = document.createElement("div"); var imgTag = document.createElement("img"); if (bottonClose == "S"){ divTag.id ="scroller-left"; } else{ divTag.id ="scroller"; } imgTag.id = "scroll_down"; imgTag.setAttribute("src","/hotel/images/down.png"); if (isIE) { imgTag.attachEvent('onmouseup', stopScrollWrapper); imgTag.attachEvent('onmousedown', scrollDownWrapper); imgTag.myflag = div; } else{ imgTag.addEventListener('mouseup', stopScrollWrapper, false); imgTag.addEventListener('mousedown', scrollDownWrapper, false); imgTag.myflag = div; } /*imgTag.className = "scroller";*/ //imgTag.setAttribute("hspace","8"); document.getElementById("pulsantiera").appendChild(divTag); divTag.appendChild(imgTag); var imgTag13x9 = document.createElement("img"); imgTag13x9.setAttribute("src","/hotel/images/13x9.gif"); imgTag13x9.id = "blank"; imgTag13x9.setAttribute("width","13px"); divTag.appendChild(imgTag13x9); var imgTag2 = document.createElement("img"); imgTag2.setAttribute("src","/hotel/images/up.png"); if (isIE) { imgTag2.attachEvent('onmouseup', stopScrollWrapper); imgTag2.attachEvent('onmousedown', scrollUpWrapper); imgTag2.myflag = div; } else{ imgTag2.addEventListener('mouseup', stopScrollWrapper, false); imgTag2.addEventListener('mousedown', scrollUpWrapper, false); imgTag2.myflag = div; } /*imgTag2.className = "scroller";*/ imgTag2.id = "scroll_up"; //imgTag2.setAttribute("hspace","8"); /*document.getElementById("pulsantiera").appendChild(imgTag2);*/ divTag.appendChild(imgTag2); } function mettiFocus(campo){ document.getElementById(campo).focus(); } function openInNewWindow() { var newWindow = window.open(this.getAttribute('href'), '_blank'); newWindow.focus(); return false; } function animateHome() { var advList = { "size": "3","adv":[ {"link": "/hotel/jsp/offerte_speciali/GestPacchettiOfferteServletController?az=list&subaz=content&articleId=135&STR_MAIN_SECTION_TITLE=OFFERTE%20SPECIALI&nodeId=147&copId=13", "target": "_self", "titolo": "Spring Ahead", "imgUrl": "/framework/CMSPublicServlet?action=get&id=415&filename=spring_en.jpg" },{"link": "/hotel/jsp/offerte_speciali/GestPacchettiOfferteServletController?az=list&subaz=content&articleId=135&STR_MAIN_SECTION_TITLE=OFFERTE%20SPECIALI&nodeId=147&copId=15", "target": "_self", "titolo": "May of Monuments", "imgUrl": "/framework/CMSPublicServlet?action=get&id=418&filename=art_monuments_en.jpg" },{"link": "/hotel/public/cms/en/181/Home_page/Dining/Awards/Guida_de_L_Espresso_I_Ristoranti_dItalia_2010.html", "target": "_self", "titolo": "Il Comandante Gourmet - L'Espresso", "imgUrl": "/framework/CMSPublicServlet?action=get&id=401&filename=guida-espresso.jpg" }]} var slideDiv = document.getElementById('newsSlide'); if (advList.size==0){ document.getElementById('newsSlide').style.display = 'none'; }else { if (currentOfferId > (advList.size)-1) { currentOfferId = 0; } var slideDiv = document.getElementById('newsSlide'); if (status == 'open') { newsBoxSlider.slideOut(); status = 'close'; } else { linkCond= false ; if (advList.adv[currentOfferId].link!='null'){ linkCond= true ; var linkElement = document.createElement('a'); linkElement.setAttribute('title',advList.adv[currentOfferId].titolo); linkElement.setAttribute('href',advList.adv[currentOfferId].link); if (advList.adv[currentOfferId].target!='_self'){ linkElement.setAttribute('target','_blank'); }else { linkElement.setAttribute('target','_self'); } } if (advList.adv[currentOfferId].imgUrl!='null'){ var imgElement = document.createElement('img'); imgElement.setAttribute('title',advList.adv[currentOfferId].titolo); imgElement.setAttribute('src','/hotel'+advList.adv[currentOfferId].imgUrl); } if (linkCond){ linkElement.appendChild(imgElement); slideDiv.replaceChild(linkElement,slideDiv.firstChild); }else { slideDiv.replaceChild(imgElement,slideDiv.firstChild); } currentOfferId++; newsBoxSlider.slideIn(); status = 'open'; } setTimeout('animateHome()', 3000); } } function setImage(thumbObject,id,altText) { blendimage('center_','center',imgSrc[id],800,altText); idAcceso = id; } function setImageOverTh(thumbObject,id,countImages) { //var indice = 0; for (i=0;i < countImages ;i++){ if(i!=idAcceso){ var nomeFileCompleto = imgArray[i]; document.getElementById(nomeFileCompleto).src= thumb_offSrc[i]; } } thumbObject.src= thumb_onSrc[id]; } function setImageOutTh(thumbObject,countImages) { for (i=0;i < countImages;i++){ var nomeFileCompleto = imgArray[i]; document.getElementById(nomeFileCompleto).src=thumb_offSrc[i]; } //alert("idAcceso "+idAcceso); var nomeFileCompleto2 = imgArray[idAcceso]; document.getElementById(nomeFileCompleto2).src= thumb_onSrc[idAcceso]; }