var DNN_COL_DELIMITER=String.fromCharCode(16);var DNN_ROW_DELIMITER=String.fromCharCode(15);var __dnn_m_bPageLoaded=false;window.onload=__dnn_Page_OnLoad;function __dnn_ClientAPIEnabled(){return typeof (dnn)!="undefined"}function __dnn_Page_OnLoad(){if(__dnn_ClientAPIEnabled()){var sLoadHandlers=dnn.getVar("__dnn_pageload");if(sLoadHandlers!=null){eval(sLoadHandlers)}dnn.dom.attachEvent(window,"onscroll",__dnn_bodyscroll)}__dnn_m_bPageLoaded=true}function __dnn_KeyDown(iKeyCode,sFunc,e){if(e==null){e=window.event}if(e.keyCode==iKeyCode){eval(unescape(sFunc));return false}}function __dnn_bodyscroll(){var A=document.forms[0];if(__dnn_ClientAPIEnabled()&&__dnn_m_bPageLoaded){A.ScrollTop.value=document.documentElement.scrollTop?document.documentElement.scrollTop:dnn.dom.getByTagName("body")[0].scrollTop}}function __dnn_setScrollTop(C){if(__dnn_ClientAPIEnabled()){if(C==null){C=document.forms[0].ScrollTop.value}var A=dnn.getVar("ScrollToControl");if(A!=null&&A.length>0){var B=dnn.dom.getById(A);if(B!=null){C=dnn.dom.positioning.elementTop(B);dnn.setVar("ScrollToControl","")}}window.scrollTo(0,C)}}function __dnn_SetInitialFocus(A){var B=dnn.dom.getById(A);if(B!=null&&__dnn_CanReceiveFocus(B)){B.focus()}}function __dnn_CanReceiveFocus(B){if(B.style.display!="none"&&B.tabIndex>-1&&B.disabled==false&&B.style.visible!="hidden"){var A=B.parentElement;while(A!=null&&A.tagName!="BODY"){if(A.style.display=="none"||A.disabled||A.style.visible=="hidden"){return false}A=A.parentElement}return true}else{return false}}function __dnn_ContainerMaxMin_OnClick(H,B){var F=dnn.dom.getById(B);if(F!=null){var E=H.childNodes[0];var K=H.getAttribute("containerid");var I=H.getAttribute("cookieid");var D=E.src.toLowerCase().substr(E.src.lastIndexOf("/"));var A;var G;var J;if(dnn.getVar("min_icon_"+K)){J=dnn.getVar("min_icon_"+K)}else{J=dnn.getVar("min_icon")}if(dnn.getVar("max_icon_"+K)){G=dnn.getVar("max_icon_"+K)}else{G=dnn.getVar("max_icon")}A=G.toLowerCase().substr(G.lastIndexOf("/"));var C=5;if(H.getAttribute("animf")!=null){C=new Number(H.getAttribute("animf"))}if(D==A){E.src=J;dnn.dom.expandElement(F,C);E.title=dnn.getVar("min_text");if(I!=null){if(dnn.getVar("__dnn_"+K+":defminimized")=="true"){dnn.dom.setCookie(I,"true",365)}else{dnn.dom.deleteCookie(I)}}else{dnn.setVar("__dnn_"+K+"_Visible","true")}}else{E.src=G;dnn.dom.collapseElement(F,C);E.title=dnn.getVar("max_text");if(I!=null){if(dnn.getVar("__dnn_"+K+":defminimized")=="true"){dnn.dom.deleteCookie(I)}else{dnn.dom.setCookie(I,"false",365)}}else{dnn.setVar("__dnn_"+K+"_Visible","false")}}return true}return false}function __dnn_Help_OnClick(A){var B=dnn.dom.getById(A);if(B!=null){if(B.style.display=="none"){B.style.display=""}else{B.style.display="none"}return true}return false}function __dnn_SectionMaxMin(F,C){var D=dnn.dom.getById(C);if(D!=null){var G=F.getAttribute("max_icon");var E=F.getAttribute("min_icon");var A=F.getAttribute("userctr")!=null;var B;if(D.style.display=="none"){F.src=E;D.style.display="";if(A){B="True"}else{dnn.setVar(F.id+":exp",1)}}else{F.src=G;D.style.display="none";if(A){B="False"}else{dnn.setVar(F.id+":exp",0)}}if(A){dnncore.setUserProp(F.getAttribute("userctr"),F.getAttribute("userkey"),B,null)}return true}return false}function __dnn_enableDragDrop(){var B=dnn.getVar("__dnn_dragDrop").split(";");var E;for(var C=0;C<B.length;C++){E=B[C].split(" ");if(E[0].length>0){var A=dnn.dom.getById(E[0]);var D=dnn.dom.getById(E[1]);if(A!=null&&D!=null){A.setAttribute("moduleid",E[2]);dnn.dom.positioning.enableDragAndDrop(A,D,"__dnn_dragComplete()","__dnn_dragOver()")}}}}var __dnn_oPrevSelPane;var __dnn_oPrevSelModule;var __dnn_dragEventCount=0;function __dnn_dragOver(){__dnn_dragEventCount++;if(__dnn_dragEventCount%75!=0){return }var C=dnn.dom.getById(dnn.dom.positioning.dragCtr.contID);var A=__dnn_getMostSelectedPane(dnn.dom.positioning.dragCtr);if(__dnn_oPrevSelPane!=null){__dnn_oPrevSelPane.pane.style.border=__dnn_oPrevSelPane.origBorder}if(A!=null){__dnn_oPrevSelPane=A;A.pane.style.border="4px double "+DNN_HIGHLIGHT_COLOR;var E=__dnn_getPaneControlIndex(C,A);var B;var F;for(var D=0;D<A.controls.length;D++){if(E>D&&A.controls[D].id!=C.id){B=A.controls[D]}if(E<=D&&A.controls[D].id!=C.id){F=A.controls[D];break}}if(__dnn_oPrevSelModule!=null){dnn.dom.getNonTextNode(__dnn_oPrevSelModule.control).style.border=__dnn_oPrevSelModule.origBorder}if(F!=null){__dnn_oPrevSelModule=F;dnn.dom.getNonTextNode(F.control).style.borderTop="5px groove "+DNN_HIGHLIGHT_COLOR}else{if(B!=null){__dnn_oPrevSelModule=B;dnn.dom.getNonTextNode(B.control).style.borderBottom="5px groove "+DNN_HIGHLIGHT_COLOR}}}}function __dnn_dragComplete(){var F=dnn.dom.getById(dnn.dom.positioning.dragCtr.contID);var D=F.getAttribute("moduleid");if(__dnn_oPrevSelPane!=null){__dnn_oPrevSelPane.pane.style.border=__dnn_oPrevSelPane.origBorder}if(__dnn_oPrevSelModule!=null){dnn.dom.getNonTextNode(__dnn_oPrevSelModule.control).style.border=__dnn_oPrevSelModule.origBorder}var B=__dnn_getMostSelectedPane(dnn.dom.positioning.dragCtr);var E;if(B==null){var A=__dnn_Panes();for(var C=0;C<A.length;C++){if(A[C].id==F.parentNode.id){B=A[C]}}}if(B!=null){E=__dnn_getPaneControlIndex(F,B);__dnn_MoveToPane(B,F,E);dnn.callPostBack("MoveToPane","moduleid="+D,"pane="+B.paneName,"order="+E*2)}}function __dnn_MoveToPane(A,E,D){if(A!=null){var C=new Array();for(var B=D;B<A.controls.length;B++){if(A.controls[B].control.id!=E.id){C[C.length]=A.controls[B].control}dnn.dom.removeChild(A.controls[B].control)}dnn.dom.appendChild(A.pane,E);E.style.top=0;E.style.left=0;E.style.position="relative";for(var B=0;B<C.length;B++){dnn.dom.appendChild(A.pane,C[B])}__dnn_RefreshPanes()}else{E.style.top=0;E.style.left=0;E.style.position="relative"}}function __dnn_RefreshPanes(){var B=dnn.getVar("__dnn_Panes").split(";");var A=dnn.getVar("__dnn_PaneNames").split(";");__dnn_m_aryPanes=new Array();for(var C=0;C<B.length;C++){if(B[C].length>0){__dnn_m_aryPanes[__dnn_m_aryPanes.length]=new __dnn_Pane(dnn.dom.getById(B[C]),A[C])}}}var __dnn_m_aryPanes;var __dnn_m_aryModules;function __dnn_Panes(){if(__dnn_m_aryPanes==null){__dnn_m_aryPanes=new Array();__dnn_RefreshPanes()}return __dnn_m_aryPanes}function __dnn_Modules(A){if(__dnn_m_aryModules==null){__dnn_RefreshPanes()}return __dnn_m_aryModules[A]}function __dnn_getMostSelectedPane(G){var C=new dnn.dom.positioning.dims(G);var F=0;var A;var H;for(var E=0;E<__dnn_Panes().length;E++){var B=__dnn_Panes()[E];var D=new dnn.dom.positioning.dims(B.pane);A=dnn.dom.positioning.elementOverlapScore(D,C);if(A>F){F=A;H=B}}return H}function __dnn_getPaneControlIndex(F,B){if(B==null){return }var A=new dnn.dom.positioning.dims(F);var E;if(B.controls.length==0){return 0}for(var C=0;C<B.controls.length;C++){E=B.controls[C];var D=new dnn.dom.positioning.dims(E.control);if(A.t<D.t){return E.index}}if(E!=null){return E.index+1}else{return 0}}function __dnn_Pane(A,B){this.pane=A;this.id=A.id;this.controls=new Array();this.origBorder=A.style.border;this.paneName=B;var F=0;var E="";for(var D=0;D<A.childNodes.length;D++){var G=A.childNodes[D];if(dnn.dom.isNonTextNode(G)){if(__dnn_m_aryModules==null){__dnn_m_aryModules=new Array()}var C=G.getAttribute("moduleid");if(C!=null&&C.length>0){E+=C+"~";this.controls[this.controls.length]=new __dnn_PaneControl(G,F);__dnn_m_aryModules[C]=G.id;F+=1}}}this.moduleOrder=E}function __dnn_PaneControl(A,B){this.control=A;this.id=A.id;this.index=B;this.origBorder=A.style.border}function __dnncore(){this.GetUserVal=0;this.SetUserVal=1}__dnncore.prototype={getUserProp:function(B,C,A){this._doUserCallBack(dnncore.GetUserVal,B,C,null,new dnncore.UserPropArgs(B,C,A))},setUserProp:function(C,D,A,B){this._doUserCallBack(dnncore.SetUserVal,C,D,A,new dnncore.UserPropArgs(C,D,B))},_doUserCallBack:function(C,D,E,A,B){if(dnn&&dnn.xmlhttp){var F=C+COL_DELIMITER+D+COL_DELIMITER+E+COL_DELIMITER+A;dnn.xmlhttp.doCallBack("__Page",F,dnncore._callBackSuccess,B,dnncore._callBackFail,null,true,null,0)}else{alert("Client Personalization not enabled")}},_callBackSuccess:function(A,B,C){if(B.pFunc){B.pFunc(B.namingCtr,B.key,A)}},_callBackFail:function(A,B){window.status=A}};__dnncore.prototype.UserPropArgs=function(B,C,A){this.namingCtr=B;this.key=C;this.pFunc=A};var dnncore=new __dnncore();
Type.registerNamespace("ArcadiaWeb");ArcadiaWeb.SkinPref=function(){ArcadiaWeb.SkinPref.initializeBase(this);this.layoutID="";this.curSettings={layout:"SkinPref_SmallLayout",text:"SkinPref_SmallText"};this._onLoadDelegate=Function.createDelegate(this,this._onLoad);Sys.Application.add_load(this._onLoadDelegate)};ArcadiaWeb.SkinPref.prototype={get_ns:function(){return this.get_id()+"_"},get_layoutID:function(){return this.layoutID},set_layoutID:function(A){this.layoutID=A},initialize:function(){ArcadiaWeb.SkinPref.callBaseMethod(this,"initialize")},_onLoad:function(D,A){var C=this.getSkinPrefCookie();if(C){this.curSettings=C}for(var B=0;B<3;B++){this._SetButtonBeahvoir("ly",B,{click:this._onChangeLayout,mouseover:this._onButtonOver,mouseout:this._onButtonOut},"Layout");this._SetButtonBeahvoir("tx",B,{click:this._onChangeTextSize,mouseover:this._onButtonOver,mouseout:this._onButtonOut},"Text")}},_SetButtonBeahvoir:function(A,C,F,B){var E=$get(this.get_ns()+A+C);var G="SkinPref_";var D;switch(C){case 0:D="Small";break;case 1:D="Medium";break;case 2:D="Large";break}E.buttonClass=G+D+B;E.buttonOver=G+"Button "+G+A+C+"_on";if(this.curSettings.layout==E.buttonClass||this.curSettings.text==E.buttonClass){E.className=G+"Button "+G+A+C+"_on";E.buttonOut=E.className}else{E.className=G+"Button "+G+A+C;E.buttonOut=E.className}if(!(F==null)){$addHandlers(E,F,this)}},_onChangeLayout:function(C){var B=C.target;this.curSettings.layout=B.buttonClass;this.SetSkinPref();for(var A=0;A<3;A++){this._SetButtonBeahvoir("ly",A,null,"Layout")}},_onChangeTextSize:function(C){var B=C.target;this.curSettings.text=B.buttonClass;this.SetSkinPref();for(var A=0;A<3;A++){this._SetButtonBeahvoir("tx",A,null,"Text")}},_onButtonOver:function(A){A.target.className=A.target.buttonOver},_onButtonOut:function(A){A.target.className=A.target.buttonOut},SetSkinPref:function(){var A=$get(this.layoutID);A.className=this.curSettings.layout+" "+this.curSettings.text;this.setSkinPrefCookie(this.curSettings)},getSkinPrefCookie:function(){var C="SkinPref_Settings=";var A=document.cookie.split(";");for(var B=0;B<A.length;B++){var D=A[B];while(D.charAt(0)==" "){D=D.substring(1,D.length)}if(D.indexOf(C)==0){return Sys.Serialization.JavaScriptSerializer.deserialize(D.substring(C.length,D.length))}}return null},setSkinPrefCookie:function(A){var B=Sys.Serialization.JavaScriptSerializer.serialize(A);document.cookie="SkinPref_Settings="+B+";expires="+new Date("December 31, 2020 23:59:59").toGMTString()+";path=/"},dispose:function(){this._onLoadDelegate=null}};ArcadiaWeb.SkinPref.registerClass("ArcadiaWeb.SkinPref",Sys.Component);
Type.registerNamespace("ArcadiaWeb");ArcadiaWeb.EventPreview=function(){ArcadiaWeb.EventPreview.initializeBase(this);this._EventInfo={};this._Element=null;this.el=null;this._EventIndex=0;this._TotalEvents=0;this._Events=[];this._ExtScriptsLoaded=false;this._ExtWindowScripts=[];this._window=null;this._MaxImageWidth=100;this._MaxImageHeight=100;this._ApplicationPath="";this._PortalID="-1";this.isPaused=false;this._disableCallBack=false;this._onGetEventSuccessDelegate=null;this._onGetEventFailDelegate=null;this._onLoadDelegate=Function.createDelegate(this,this._onLoad);Sys.Application.add_load(this._onLoadDelegate)};ArcadiaWeb.EventPreview.prototype={get_ns:function(){return this.get_id()+"_"},get_Element:function(){return this._Element},set_Element:function(A){this._Element=A},get_ApplicationPath:function(){return this._ApplicationPath},set_ApplicationPath:function(A){this._ApplicationPath=A},get_PortalID:function(){return this._PortalID},set_PortalID:function(A){this._PortalID=A},get_MaxImageWidth:function(){return this._MaxImageWidth},set_MaxImageWidth:function(A){this._MaxImageWidth=A},get_MaxImageHeight:function(){return this._MaxImageHeight},set_MaxImageHeight:function(A){this._MaxImageHeight=A},get_TotalEvents:function(){return this._TotalEvents},set_TotalEvents:function(A){this._TotalEvents=A},get_EventInfo:function(){return this._EventInfo},set_EventInfo:function(A){this._EventInfo=Sys.Serialization.JavaScriptSerializer.deserialize(A)},get_ExtWindowScripts:function(){return this._ExtWindowScripts},set_ExtWindowScripts:function(A){this._ExtWindowScripts=Sys.Serialization.JavaScriptSerializer.deserialize(A)},initialize:function(){ArcadiaWeb.EventPreview.callBaseMethod(this,"initialize")},GetHandlerImageUrl:function(C,B,A){return this._ApplicationPath+"/ImageStreamHandler.ashx?w="+A+"&h="+A+"&fileid="+C+"&portalid="+this._PortalID},_onLoad:function(C,A){var B=this.get_Element();this.el=Ext.get(B);this._onGetEventSuccessDelegate=Function.createDelegate(this,this._onGetEventSuccess);this._onGetEventFailDelegate=Function.createDelegate(this,this._onGetEventFail);this.el.hover(this._hoverOver,this._hoverOut,this);this.tpl=new Ext.XTemplate('<div class="center_top">','    <div class="left_top">&nbsp;</div>','       <div class="title">','         <span>{EventTime}</span><span class="state"></span>',"	    </div>",'       <div class="right_top">&nbsp;</div>',"    </div>",'    <div class="Container">','	    <table  cellSpacing="0" cellPadding="0" width="100%">',"		    <tr>",'               <td class="Logo_Ma">',"				    <a  href={MembeAreaHomeUrl}>",'					    <img src="{LogoUrl}" border="0"></img>',"				    </a>","			    </td>","			    <td>",'	                <div style="width:200px;line-height:18px;">','		                <span class="subhead">{MemberAreaFullName}</span><br/>','		                <span class="Normal">{MemberAreaAddress}</span>','		                <a href="{EventUrl}" ToolTip="Vedi Dettaglio" class="CommandButton">{EventTitle}</a><br/>','		                <span class="subsubhead">{EventDate} &nbsp; {EventHours}</span>',"	                </div>","			    </td>","		    </tr>","		</table>",'	        <div class="NewsPaper  Content" style="height:130px;overflow:hidden;">','               <img class="Zoom" border="0"/>','		        <span class="normal">{EventDescription}</span>',"	        </div>",'	        <div style="text-align:center;margin-top:5px;">','	            <a href="{ShowEventsUrl}" class="CommandButton">Visualizza altri Eventi</a>',"            </div>","   </div>",'    <div class="center_bottom">','       <div class="left_bottom">&nbsp;</div>','       <div class="right_bottom">&nbsp;</div>',"   </div>");if(this._EventInfo){Array.add(this._Events,this._EventInfo);this._EventIndex++;this.renderEvent()}},_hoverOver:function(B){var A=this.el.child("span.state",true);A.innerHTML=" (pausa)";this.isPaused=true;this.el.stopFx();B.stopEvent()},_hoverOut:function(B){var A=this.el.child("span.state",true);A.innerHTML=" (play...)";this.isPaused=false;var C=new Ext.util.DelayedTask();C.delay(1000,this._onSwitchEvent,this);B.stopEvent()},_onSwitchEvent:function(){if(!this.isPaused){if(this._EventIndex<this._TotalEvents&&!this._disableCallBack){var D="GetEventInfo";var B=this._EventIndex;var A={EventID:this._EventIndex};var C=Sys.Serialization.JavaScriptSerializer.serialize({method:D,args:A});dnn.xmlhttp.callControlMethod("ArcadiaWeb.MemberArea.Events.EventsPreview."+this.get_id(),D,A,this._onGetEventSuccessDelegate,this._onGetEventFailDelegate)}else{this._disableCallBack=true;this._EventIndex<(this._TotalEvents-1)?this._EventIndex++:this._EventIndex=0;this._EventInfo=this._Events[this._EventIndex];this.renderEvent()}}},_onGetEventSuccess:function(B,A,C){if(B){this._EventIndex++;this._EventInfo=Sys.Serialization.JavaScriptSerializer.deserialize(B);Array.add(this._Events,this._EventInfo);this.renderEvent()}},_onGetEventFail:function(C,A,B){alert("error: "+C)},renderEvent:function(){if(this.el.dom.className=="EventSpot_Blue"){this.el.dom.className="EventSpot_Gray"}else{this.el.dom.className="EventSpot_Blue"}this.tpl.overwrite(this.el,this._EventInfo);var A=this.el.child("img.Zoom",false);A.dom.src=this.GetHandlerImageUrl(this._EventInfo.EventImageID,this._MaxImageWidth,this._MaxImageHeight);A.dom.title="Zoom";A.dom.style.cursor="pointer";A.on("click",this.ZoomImage,this);this.el.fadeIn({endOpacity:1,duration:10,callback:this._onSwitchEvent,scope:this})},initZoom:function(){if(Ext.Window){this._window=new Ext.Window({layout:"fit",width:10,height:10,closeAction:"hide",plain:true});var A=new Ext.BoxComponent({id:"zoom_box",autoEl:{tag:"img",src:Ext.BLANK_IMAGE_URL}});this._window.add(A);this._window.img=A.autoEl;this.SetZoomImage(A.autoEl);this._window.show()}else{var B=new arc.loader();var C=B.getDependencies(this._ExtWindowScripts);dnn.dom.loadScripts(C,"",dnn.createDelegate(this,this.initZoom))}},ZoomImage:function(){if(this._window){this.SetZoomImage(this._window.findById("zoom_box").getEl().dom);this._window.show()}else{this.initZoom()}},SetZoomImage:function(A){var C=this._EventInfo;var B=this.GetHandlerImageUrl(C.EventImageID,C.EventImageWidth,C.EventImageHeight);A.src=B;A.height=C.EventImageHeight;A.width=C.EventImageWidth;this._window.setSize(C.EventImageWidth,C.EventImageHeight);this._window.setTitle(this._EventInfo.EventTitle,"")},dispose:function(){this._onLoadDelegate=null;this._onGetEventSuccessDelegate=null;this._onGetEventFailDelegate=null}};ArcadiaWeb.EventPreview.registerClass("ArcadiaWeb.EventPreview",Sys.Component);
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
(function() {var fn = function() {$get('ScriptManager_HiddenField').value += ';;DotNetNuke.WebUtility:it:63177d6a-e2d4-4367-bf81-6f770f3c1812:5716ea8b;Arcadia.Dnn.Framework:it:bfbdfdfa-e9aa-4965-8142-506a9539732a:d820bc4e;ArcadiaWeb.MemberArea.Events:it:35ccebd0-a5ff-4e04-a23c-c52880e01de9:598a473b';Sys.Application.remove_load(fn);};Sys.Application.add_load(fn);})();
