var AM_TIMES_OFFSET=0;var AM_SESSIONS_OFFSET=102;var PM_TIMES_OFFSET=-860;var PM_SESSIONS_OFFSET=-758;var TIME_WIDTH=86;var TIMES=["8:30 AM","9:00 AM","9:30 AM","10:00 AM","10:30 AM","11:00 AM","11:30 AM","12:00 PM","12:30 PM","1:00 PM","1:30 PM","2:00 PM","2:30 PM","3:00 PM","3:30 PM","4:00 PM","4:30 PM","5:00 PM","5:30 PM","6:00 PM"];var DAY_NAMES=["SUN","MON","TUE","WED"];var NUM_DAYS=DAY_NAMES.length;var NO_SCHEDULE_DAY=0;var NO_SCHEDULE_MESSAGE="Pre-event labs must be scheduled through the MAX Registration site.";var BLOCK_INTERVAL=30;var dayviewScheduler;var trackMenu;var scheduleMenu;var sessionIdHash=new Hash();var roomCount=new Hash();var roomsLoaded=0;var sessionsLoadedTimer=false;var SessionData=false;var loader=false;var originalWindowHeight=0;var scheduleWidth=853;var listHeight=0;var removeSessionFromScheduleCallback=false;var soldOut=false;var slider;var expireTimer=false;Event.onDOMReady(function(){Prototype.Browser.IE6=(navigator.appVersion.indexOf("MSIE 6")>0);Prototype.Browser.IE7=(navigator.appVersion.indexOf("MSIE 7")>0);Prototype.Browser.Firefox2Mac=((navigator.userAgent.indexOf("Firefox/2")>0)&&(navigator.userAgent.indexOf("Mac")>0));Prototype.Browser.Firefox2=((navigator.userAgent.indexOf("Firefox/2")>0));Prototype.Browser.Safari2=((navigator.userAgent.indexOf("WebKit/3")>0)&&(navigator.userAgent.indexOf("Mac")>0));originalWindowHeight=document.documentElement.clientHeight;listHeight=$("portal").getDimensions().height;calculateWidths();loader=new FancyLoader();new Ajax.Request("/"+urlPrefix+"/json/getEventInfo/",{method:"get",evalJSON:"force",onSuccess:function(F){if(F.responseJSON==null){alert("error!");return }var B=F.responseText.evalJSON();DAY_NAMES=B.days;NUM_DAYS=B.days.length;TIMES=B.times;NO_SCHEDULE_DAY=B.noScheduleDay;NO_SCHEDULE_DAY_MESSAGE=B.noScheduleDayMessage;BLOCK_INTERVAL=B.blockInterval;var A=$("daySelector");var E=A.getElementsByTagName("tr")[0];for(var D=0;D<NUM_DAYS;D++){E.appendChild(new Element("td").update(DAY_NAMES[D]))}dayviewScheduler=new DayViewScheduler();trackMenu=new TrackMenu();scheduleMenu=new ScheduleMenu();popupService=new PopupService("popup");bCardPopupService=new PopupService("bCardPopup");popupServiceShower=popupService.show.bind(popupService);loginService=new ByDayLoginService();soldOut=new Element("span",{"class":"sold-out"});soldOut.appendChild(document.createTextNode("(sold out)"));removeSessionFromScheduleCallback=dayviewScheduler.removeSessionFromSchedule.bind(dayviewScheduler);if(Prototype.Browser.Firefox2Mac){$("dayviewRoomHeading").setStyle({paddingTop:"1px",height:"19px"})}if(Prototype.Browser.Firefox2){var C=$("login").getElementsByTagName("span");for(var D=0;D<C.length;D++){$(C[D]).setStyle({overflow:"auto"})}}new Ajax.Request("/"+urlPrefix+"/json/getSessions/0/",{method:"get",evalJSON:"force",onSuccess:preloadRooms});Event.observe(window,"resize",dayviewScheduler.handleResize.bind(dayviewScheduler));if(Prototype.Browser.IE7){Event.observe(window,"scroll",function(){window.scrollTop=0})}if(Prototype.Browser.Safari2){$("portal").setStyle({overflow:"hidden"});$("safari2-slider").setStyle({display:"block"});slider=new Control.Slider($("slider"),$("slider-track"),{axis:"vertical",sliderValue:0,increment:1,range:$R(0,100),maximum:95,values:$R(0,100),onSlide:function(G){$("portal").scrollTop=Math.floor((parseInt($(dayviewScheduler.sessionsContainer[dayviewScheduler.currentDay]).getHeight())-435)*G/100)}})}dayviewScheduler.handleResize()}})});var ByDayLoginService=Class.create(LoginService,{initializeCallback:function(){$("save").observe("click",dayviewScheduler.saveSchedule.bind(dayviewScheduler))},logoutCallback:function(){dayviewScheduler.disableSchedule();var A=window.location.toString();setTimeout(function(){window.location=A+"logout/"},100)},_checkLogin:function(){},_loginCallback:function(D){if(!dayviewScheduler.hasScheduleChanged()){$("save").setOpacity(0.25)}var L=new Array();for(var H=0;H<D.sessions.length;H++){if(D.checksums[H]!=hex_md5(D.sessions[H].join(","))){popupService.manualShow(Math.floor((document.documentElement.clientWidth-popupService.getWidth())/2),Math.floor(document.documentElement.clientHeight/2)+50,"Error Loading Sessions","There was an error loading sessions for which you previously registered because of a browser error. Please reload before editing your schedule.",true)}var M=dayviewScheduler.sessionsContainer[H].getElementsByClassName("session");for(var G=0;G<M.length;G++){for(var E=0;E<D.sessions[H].length;E++){if(M[G].getAttribute("instance_id")==D.sessions[H][E]||M[G].hasClassName("general")){var C=parseInt(M[G].getAttribute("duration"));var B=parseInt(M[G].getAttribute("startTime"));if(dayviewScheduler.savedSchedule[H].addSession(D.sessions[H][E],B,C)){var J=M[G].cloneNode(true);Event.stopObserving(J,"click",popupServiceShower);J.observe("click",popupServiceShower);J.setStyle({top:0});J.setOpacity(1);J.addClassName("mine");J.removeClassName("drag");var I=J.firstChild.getElementsByTagName("span");for(var O=I.length-1;O>=0;O--){J.firstChild.removeChild(I[O])}if(Prototype.Browser.IE){if(J.hasClassName("general")){$(J.firstChild).setStyle({paddingTop:"8px"})}var N=J.firstChild.getDimensions().height;if(Prototype.Browser.IE){dayviewScheduler.sessionsContainer[dayviewScheduler.currentDay].firstChild.appendChild(J);N=J.firstChild.getDimensions().height}if(N){var F=Math.floor((81-N)/2);J.setStyle({paddingTop:F+"px",height:(80-F)+"px"})}}if(!J.hasClassName("pre")&&!J.hasClassName("general")){var A=new Element("a",{"class":"close",href:"javascript:__click()"});var K=$("close").cloneNode(true);K.id="close"+M[G].getAttribute("instance_id");if(Prototype.Browser.IE){K.setStyle({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/close.png',sizingMethod='scale')"})}$(K).setStyle({visibility:"visible"});A.observe("click",removeSessionFromScheduleCallback);A.appendChild(K);J.appendChild(A)}else{if(!Prototype.Browser.IE){J.setStyle({height:"80px"})}}if(Prototype.Browser.IE6){if(M[G].hasClassName("general")){J.setStyle({backgroundImage:"images/session-general-myschedule-background.gif"})}else{J.setStyle({backgroundImage:J.getStyle("backgroundImage").replace("-background","-myschedule-background")})}}$("my-schedule"+H).firstChild.appendChild(J);$("my-schedule-help").setOpacity(0)}else{L.push("Couldn't add "+D.sessions[H][E]);log("Couldn't add "+D.sessions[H][E])}}}}}dayviewScheduler.setHelp();this.hideLogin(dayviewScheduler.enableSchedule.bind(dayviewScheduler),D.suppress);if(!popupService.isVisible()){if(Prototype.Browser.Safari2&&!getCookie("safari2")){popupService.manualShow(Math.floor((document.documentElement.clientWidth-popupService.getWidth())/2),Math.floor(document.documentElement.clientHeight/2)+50,"Browser Warning",'Safari 2 is unfortunately not mature enough to support the intended functionality of this scheduler. Most everything will work, though we cannot guarantee that your experience will be smooth or error-free. We highly recommend you <a href="http://apple.com/safari/download/" target="_blank" style="color:red;text-decoration:underline">upgrade to Safari 3</a>.',true);setCookie("safari2",1)}else{if(loginService.isLoggedIn()&&!getCookie("first-time")){popupService.manualShow(Math.floor((document.documentElement.clientWidth-popupService.getWidth())/2),Math.floor(document.documentElement.clientHeight/2)+50,"Welcome to the MAX 2008 Schedule Builder","Please use the Schedule Builder to choose the sessions and labs you would like to attend by clicking and dragging the session (or lab) into the <b>My Schedule</b> area at the bottom of the page. You can view all sessions and labs by clicking through the tabs at the top of the page, including sorting by track, day and time of day. Click on a session to see its description. You'll notice sessions are identified in orange and labs are in green for easy reference. You can also view sessions in a list view by clicking on the <b>By Session</b> tab in the upper right corner. There, you can filter through sessions by track, type, product, audience, and speaker. Be sure to <b>SAVE</b> your schedule when you are done or your sessions and labs will not be yours.",true,function(){if(urlPrefix=="na"){bCardPopupService.manualShow(Math.floor((document.documentElement.clientWidth-popupService.getWidth())/2),Math.floor(document.documentElement.clientHeight/2)+50,"IMPORTANT NOTICE","After you finish updating your schedule, you MUST go to an on-site MAX Badge Update Station (located at Moscone West and the San Francisco Marriott) so that your latest schedule can be saved to your badge.",true)}});setCookie("first-time",1)}else{if(!getCookie("first-time")&&!getCookie("tip")){popupService.manualShow(Math.floor((document.documentElement.clientWidth-popupService.getWidth())/2),Math.floor(document.documentElement.clientHeight/2)+50,"Tip","To see a session or lab description, click on its title.",true,function(){if(urlPrefix=="na"){bCardPopupService.manualShow(Math.floor((document.documentElement.clientWidth-popupService.getWidth())/2),Math.floor(document.documentElement.clientHeight/2)+50,"IMPORTANT NOTICE","After you finish updating your schedule, you MUST go to an on-site MAX Badge Update Station (located at Moscone West and the San Francisco Marriott) so that your latest schedule can be saved to your badge.",true)}});setCookie("tip",1)}else{if(loginService.isLoggedIn()){setTimeout(function(){if(urlPrefix=="na"){bCardPopupService.manualShow(Math.floor((document.documentElement.clientWidth-popupService.getWidth())/2),Math.floor(document.documentElement.clientHeight/2)+50,"IMPORTANT NOTICE","After you finish updating your schedule, you MUST go to an on-site MAX Badge Update Station (located at Moscone West and the San Francisco Marriott) so that your latest schedule can be saved to your badge.",true)}},2000)}}}}}}});var Schedule=Class.create({initialize:function(A){this.day=A;this.sessions=new Hash();this.slots=new Array(TIMES.length);for(var B=0;B<this.slots.length;B++){this.slots[B]=false}},addSession:function(E,D,F){var C=F/BLOCK_INTERVAL;var G=[];var A=false;D=parseInt(D);for(var B=D;B<(D+C);B++){if(this.slots[B]){A=true}else{G.push(B);this.slots[B]=true}}if(A){for(var B=0;B<G.length;B++){this.slots[G[B]]=false}}else{this.sessions.set(parseInt(E),true)}return !A},removeSession:function(D,C,E){var B=E/BLOCK_INTERVAL;for(var A=C;A<(C+B);A++){this.slots[A]=false}this.sessions.unset(D)},getSessions:function(){return this.sessions.keys()},hasSessions:function(){return this.sessions.values().length}});var DayViewScheduler=Class.create({initialize:function(){this.roomColumn=[$("rooms0"),$("rooms1"),$("rooms2"),$("rooms3")];this.timesRow=$("times");this.sessionsContainer=[$("sessions0"),$("sessions1"),$("sessions2"),$("sessions3")];this.daySelector=$("daySelector");this.timeSelector=$("timeSelector");this.days=this.daySelector.getElementsByTagName("td");this.times=this.timeSelector.getElementsByTagName("td");this.currentDay=getCookie("day");if(!this.currentDay){this.currentDay=1}this.dirty=false;this.savedSchedule=[];this.draggables=[];for(var A=0;A<this.days.length;A++){if(A==this.currentDay){$(this.days[A]).addClassName("on");this.sessionsContainer[A].setStyle({display:"block"});this.sessionsContainer[A].setOpacity(1);this.roomColumn[A].setStyle({display:"block"});this.roomColumn[A].setOpacity(1)}else{this.sessionsContainer[A].setStyle({display:"none"});this.sessionsContainer[A].setOpacity(0);this.roomColumn[A].setStyle({display:"none"});this.roomColumn[A].setOpacity(0)}$(this.days[A]).observe("click",new Function("dayviewScheduler.setDay("+A+")"));this.savedSchedule[A]=new Schedule(A);if(Prototype.Browser.Firefox2Mac){$(this.days[A]).setStyle({paddingTop:"3px"});$(this.days[A].parentNode.parentNode).setStyle({height:"19px"})}}this.timeBlock=getCookie("time");if(!this.timeBlock){this.timeBlock=0}$(this.times[this.timeBlock]).addClassName("on");$(this.times[0]).observe("click",new Function("dayviewScheduler.setAM()"));$(this.times[1]).observe("click",new Function("dayviewScheduler.setPM()"));if(Prototype.Browser.Firefox2Mac){for(var A=0;A<this.times.length;A++){$(this.times[A]).setStyle({paddingTop:"3px"});$(this.times[A].parentNode.parentNode).setStyle({height:"19px"})}}for(var A=0;A<TIMES.length;A++){this.addTime(TIMES[A],false,((A+1==TIMES.length)?true:false))}if(this.timeBlock==0){this.setAM()}else{this.setPM()}},hasScheduleChanged:function(){return this.dirty},setScheduleChanged:function(){if(!this.dirty&&!getCookie("reminder")){popupService.manualShow(x-popupService.getWidth()/2,y,"Reminder","Don't forget to click on the Save button after you have completed your schedule.");setCookie("reminder",1)}this.dirty=true;$("save").setOpacity(1)},handleResize:function(){calculateWidths();var B=document.documentElement.clientHeight-200;if(loginService.isLoggedIn()){B-=82}var A=$("portal");A.setStyle({height:B+"px"});$("roomsShadow").setStyle({height:(B+20)+"px"});if(Prototype.Browser.Safari2){$("safari2-slider").setStyle({height:B+"px"});slider.trackLength=slider.maximumOffset()-slider.minimumOffset()}if(Prototype.Browser.IE){var C=$("content");var D=C.getDimensions().height;if(document.documentElement.clientHeight-D<136){C.setStyle({height:(document.documentElement.clientHeight-136)+"px"})}}$("timesContainer").setStyle({width:(scheduleWidth-1)+"px"});$("portal").setStyle({width:(scheduleWidth+102)+"px"});if(this.isPM()){this.setPM(true)}if(loginService.isLoggedIn()){$("my-schedule"+this.currentDay).setStyle({width:(A.getDimensions().width-118)+"px",left:"126px",top:(A.getDimensions().height+157)+"px"});$("my-schedule-room").setStyle({top:$("my-schedule"+this.currentDay).getStyle("top")});$("my-schedule-help").setStyle({top:(A.getDimensions().height+190)+"px"})}},setAM:function(){this.timeBlock=0;setCookie("time",this.timeBlock);$(this.times[0]).addClassName("on");$(this.times[1]).removeClassName("on");for(var A=0;A<this.days.length;A++){if(A==this.currentDay){new Effect.Morph(this.timesRow,{style:{left:AM_TIMES_OFFSET+"px"},duration:0.5});new Effect.Morph(this.sessionsContainer[A],{style:{left:AM_SESSIONS_OFFSET+"px"},duration:0.5});new Effect.Morph($("my-schedule"+A).firstChild,{style:{left:"0px"},duration:0.5})}else{this.sessionsContainer[A].setStyle({left:AM_SESSIONS_OFFSET+"px"});$($("my-schedule"+A).firstChild).setStyle({left:"0px"})}}},setPM:function(B){this.timeBlock=1;setCookie("time",this.timeBlock);$(this.times[0]).removeClassName("on");$(this.times[1]).addClassName("on");for(var A=0;A<this.days.length;A++){if(A==this.currentDay){if(B){this.timesRow.setStyle({left:PM_TIMES_OFFSET+"px"});this.sessionsContainer[A].setStyle({left:PM_SESSIONS_OFFSET+"px"});$($("my-schedule"+A).firstChild).setStyle({left:(PM_SESSIONS_OFFSET-102)+"px"})}else{new Effect.Morph(this.timesRow,{style:{left:PM_TIMES_OFFSET+"px"},duration:0.5});new Effect.Morph(this.sessionsContainer[A],{style:{left:PM_SESSIONS_OFFSET+"px"},duration:0.5});new Effect.Morph($("my-schedule"+A).firstChild,{style:{left:(PM_SESSIONS_OFFSET-102)+"px"},duration:0.5})}}else{this.sessionsContainer[A].setStyle({left:PM_SESSIONS_OFFSET+"px"});$($("my-schedule"+A).firstChild).setStyle({left:(PM_SESSIONS_OFFSET-102)+"px"})}}},isPM:function(){return this.timeBlock==1},setDay:function(B){if(B==this.currentDay){return }setCookie("day",B);$(this.days[this.currentDay]).removeClassName("on");this.sessionsContainer[this.currentDay].fade({duration:0.2});this.roomColumn[this.currentDay].fade({duration:0.2});this.currentDay=B;if(loginService.isLoggedIn()){this.setHelp()}$(this.days[B]).addClassName("on");this.sessionsContainer[B].appear({duration:0.2});this.roomColumn[B].appear({to:1,duration:0.2});if(Prototype.Browser.Safari2){slider.setValue(0)}else{$("portal").scrollTop=0}this.setAM();if(loginService.isLoggedIn()){var A=$("portal");for(var C=0;C<this.days.length;C++){var D=$("my-schedule"+C);if(this.currentDay==C){D.setStyle({width:(A.getDimensions().width-118)+"px",left:"126px",top:(A.getDimensions().height+82+75)+"px",display:"block"});D.appear({duration:0.3})}else{D.fade({duration:0.2,onFinish:function(){this.setStyle({top:"-1978px"})}.bind(D)})}}}},setHelp:function(){var A=$("my-schedule-help");if(this.savedSchedule[this.currentDay].hasSessions()){A.setOpacity(0)}else{if(this.currentDay==NO_SCHEDULE_DAY){A.innerHTML=NO_SCHEDULE_DAY_MESSAGE}else{if(loginService.user.dayEnabled(this.currentDay)){A.innerHTML=A.getAttribute("title")}else{A.innerHTML=A.getAttribute("sorry")}}$("my-schedule-help").setOpacity(1)}},addTime:function(D,A,C){var B=new Element("div",{"class":"time"});if(A){B.addClassName("pm")}if(C){B.addClassName("last")}if(Prototype.Browser.Firefox2Mac){$(B).setStyle({paddingTop:"1px",height:"19px"})}B.appendChild(document.createTextNode(D));B.setStyle({width:TIME_WIDTH+"px",left:((this.timesRow.childNodes.length)*TIME_WIDTH)+"px"});this.timesRow.appendChild(B)},addRoom:function(B,D,C,A){var F=new Element("div",{"class":"room"});F.setAttribute("numRooms",A);if(Prototype.Browser.Gecko||Prototype.Browser.IE){F.setStyle({height:"80px"})}var E=new Element("div",{"class":D});E.update(B);F.appendChild(E);if(Prototype.Browser.IE){this.roomColumn[C].setStyle({height:"auto"})}this.roomColumn[C].appendChild(F);if(Prototype.Browser.IE){if(E.getDimensions().height){var G=((81-E.getDimensions().height)/2);F.setStyle({paddingTop:G+"px",height:(81-G)+"px"})}}},addSession:function(M,J,A,B,F,N,I,K,H){var L=new Element("div",{"class":"session"});L.addClassName(N);if(K){L.setAttribute("tracks",K)}L.setAttribute("sessionId",F);L.setAttribute("startTime",A);L.setAttribute("duration",B);L.setAttribute("instance_id",I);L.id="i"+I;if(H){L.setAttribute("full",true)}L.observe("click",popupServiceShower);var G;var E=TIME_WIDTH;G=E*B/BLOCK_INTERVAL+1;if(Prototype.Browser.IE||Prototype.Browser.Gecko){G-=2}L.setStyle({width:G+"px"});L.setStyle({left:(Math.floor((A*E))-1)+"px"});if(N=="general"){L.setStyle({top:"0px",height:((roomCount.get(M))*81-6)+"px"})}else{L.setStyle({top:(J*81)+"px"})}var D=new Element("div",{"class":"info"});D.appendChild(document.createTextNode(SessionData[sessionIdHash.get(F)][1]));if(L.hasAttribute("full")){D.appendChild(soldOut.cloneNode(true))}L.appendChild(D);this.sessionsContainer[M].firstChild.appendChild(L);if(Prototype.Browser.IE){var O=D.getDimensions().height;if(Prototype.Browser.IE){this.sessionsContainer[this.currentDay].firstChild.appendChild(L);O=D.getDimensions().height;this.sessionsContainer[M].firstChild.appendChild(L)}if(O){var C=Math.floor((81-O)/2);if(N!="general"){L.setStyle({paddingTop:C+"px",height:(80-C)+"px"})}}}},makeDraggable:function(){this.draggables=[];for(var C=0;C<this.sessionsContainer.length;C++){if(loginService.user.dayEnabled(C)&&(C!=NO_SCHEDULE_DAY)){var D=this.sessionsContainer[C].getElementsByClassName("session");for(var B=0;B<D.length;B++){if(!D[B].hasClassName("pre")&&!D[B].hasClassName("general")&&!D[B].hasAttribute("full")){Event.stopObserving(D[B],"click",popupServiceShower);D[B].addClassName("drag");var A=new Draggable(D[B],{zindex:3000,revert:true,constraint:"vertical",onStart:function(E){dragging=true;this.originalContainer=E.element.parentNode;$("content").appendChild(E.element);E.element.setStyle({left:(parseInt(E.element.getStyle("left"))+(dayviewScheduler.isPM()?PM_SESSIONS_OFFSET+25:127))+"px"})}.bind(A),onDrag:function(E){dragging=true;E.element.setStyle({top:(y-41)+"px"})}.bind(A),onEnd:function(E){dragging=true;E.element.setStyle({left:(parseInt(E.element.getStyle("left"))-(dayviewScheduler.isPM()?PM_SESSIONS_OFFSET-25:127))+"px"});this.originalContainer.appendChild(E.element);setTimeout(resetDragging,500)}.bind(A)});this.draggables.push(A)}D[B].observe("click",popupServiceShower)}}}for(var C=0;C<this.days.length;C++){if(this.currentDay==C){$("my-schedule"+C).setOpacity(1)}else{$("my-schedule"+C).setOpacity(0);$("my-schedule"+C).setStyle({top:"-1978px"})}if(loginService.user.dayEnabled(C)){Droppables.add($("my-schedule"+C),{hoverclass:"hover",onDrop:this.addSessionToSchedule.bind(this)})}}},unmakeDraggable:function(){for(var A=0;A<this.draggables.length;A++){this.draggables[A].element.removeClassName("drag");this.draggables[A].destroy()}this.draggables=[]},addSessionToSchedule:function(C){var E;if(Prototype.Browser.IE){E=$(document.createElement("div"));E.innerHTML=C.innerHTML;E.className=C.className;E.setAttribute("instance_id",C.getAttribute("instance_id"));E.setAttribute("sessionId",C.getAttribute("sessionId"));E.setAttribute("startTime",C.getAttribute("startTime"));E.setAttribute("duration",C.getAttribute("duration"));E.setAttribute("tracks",C.getAttribute("tracks"));E.setAttribute("style",C.getAttribute("style"));E.setStyle({width:C.getStyle("width"),left:C.getStyle("left"),paddingTop:$(C).getStyle("paddingTop"),backgroundImage:$(C).getStyle("backgroundImage")});if(C.hasAttribute("full")){E.setAttribute("full",C.getAttribute("full"))}}else{E=C.cloneNode(true)}E.setStyle({top:0,left:(parseInt(E.getStyle("left"))-(this.isPM()?PM_SESSIONS_OFFSET+25:127))+"px"});E.setOpacity(1);E.addClassName("mine");E.removeClassName("drag");if(Prototype.Browser.IE6&&E.hasClassName("dim")){var B=E.getStyle("backgroundImage");E.setStyle({backgroundImage:B.replace("background-dim.gif","background.gif")});E.removeClassName("dim")}E.observe("click",popupServiceShower);if(!E.hasClassName("pre")&&!E.hasClassName("general")){var A=new Element("a",{"class":"close",href:"javascript:__click()"});var D=$("close").cloneNode(true);D.id="close"+C.getAttribute("instance_id");if(Prototype.Browser.IE){D.setStyle({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/close.png',sizingMethod='scale')"})}$(D).setStyle({visibility:"visible"});A.observe("click",removeSessionFromScheduleCallback);A.appendChild(D);E.appendChild(A)}else{E.setStyle({height:"80px"})}if(Prototype.Browser.IE6){if(E.hasClassName("general")){E.setStyle({backgroundImage:"images/session-general-myschedule-background.gif"})}else{E.setStyle({backgroundImage:E.getStyle("backgroundImage").replace("-background","-myschedule-background")})}}$("my-schedule"+this.currentDay).firstChild.appendChild(E);$("my-schedule-help").setOpacity(0);if(!this.savedSchedule[this.currentDay].addSession(parseInt(C.getAttribute("instance_id")),parseInt(C.getAttribute("startTime")),parseInt(C.getAttribute("duration")))){E.setOpacity(0.5);popupService.manualShow(x-Math.floor(popupService.popup.getDimensions().width/2),y,"Time Conflict","Sorry, you already have something scheduled in this time slot. Remove the session already there and try again.");Effect.DropOut(E,{duration:0.6,afterFinish:function(){$("my-schedule"+this.currentDay).firstChild.removeChild(E)}.bind(this)})}else{this.setScheduleChanged()}},removeSessionFromSchedule:function(B){var A=B.element();if(A.tagName=="IMG"){A=A.parentNode}this.savedSchedule[this.currentDay].removeSession(parseInt(A.parentNode.getAttribute("instance_id")),parseInt(A.parentNode.getAttribute("startTime")),parseInt(A.parentNode.getAttribute("duration")));Effect.DropOut(A.parentNode,{duration:0.6,afterFinish:function(){A.parentNode.parentNode.removeChild(A.parentNode)}});this.setScheduleChanged()},setTrack:function(C){for(var E=0;E<this.sessionsContainer.length;E++){var G=this.sessionsContainer[E].getElementsByClassName("session");for(var B=0;B<G.length;B++){if(G[B].hasAttribute("tracks")){}var A=$(G[B]).getAttribute("tracks");if(C=="session"||A.indexOf(C)!=-1){if(Prototype.Browser.IE6){var D=$(G[B]).getStyle("backgroundImage");$(G[B]).setStyle({backgroundImage:D.replace("background-dim.gif","background.gif")});$(G[B]).removeClassName("dim")}else{if(Prototype.Browser.IE){$(G[B]).setOpacity(1)}else{$(G[B]).fade({to:1,duration:0.2})}}}else{if(Prototype.Browser.IE6){var D=$(G[B]).getStyle("backgroundImage");$(G[B]).setStyle({backgroundImage:D.replace("background.gif","background-dim.gif")});$(G[B]).addClassName("dim");var F=parseInt($(G[B]).getStyle("paddingTop").replace("px",""));$(G[B]).setStyle({height:(80-F)+"px"})}else{if(Prototype.Browser.IE){$(G[B]).setOpacity(0.25)}else{$(G[B]).fade({to:0.25,duration:0.2})}}}}}},enableSchedule:function(){var B=$("portal").getStyle("height");var A=$("portal");if(this.draggables.length>0){return }A.morph({height:(parseInt(B)-82)+"px"},{duration:0.2});if(Prototype.Browser.Safari2){$("safari2-slider").setStyle({height:(parseInt(B)-83)+"px"});slider.trackLength=slider.maximumOffset()-slider.minimumOffset()}for(var D=0;D<this.days.length;D++){var E=$("my-schedule"+D);if(this.currentDay==D){E.setOpacity(1);E.setStyle({width:(A.getDimensions().width-118)+"px",left:"126px",top:(A.getDimensions().height+75)+"px"});E.appear({duration:0.3})}else{E.setOpacity(0);E.setStyle({top:"-1978px"})}}$("my-schedule-room").setStyle({left:"25px",top:(A.getDimensions().height+75)+"px"});$("my-schedule-room").observe("mouseover",function(){this.addClassName("hover")});$("my-schedule-room").observe("click",function(){popupService.manualShow(25,y,"Instructions",'To add a session to your schedule, simply drag a session down to the "My Schedule" receptacle at the bottom. To remove a session, click on the "X" button found in the upper-right corner of each session in your schedule. Please note that general sessions cannot be added, and Pre-event labs must be added through the MAX Registration site.')});var C=$("my-schedule-help");C.setStyle({width:(A.getDimensions().width-118)+"px",left:"126px",top:(A.getDimensions().height+108)+"px"});this.makeDraggable()},disableSchedule:function(){var B=$("portal").getStyle("height");for(var C=0;C<this.days.length;C++){var D=$("my-schedule"+C);D.setOpacity(0);D.setStyle({left:"-1978px",top:"-1978px"})}var A=$("portal");A.morph({height:(parseInt(B)+82)+"px"},{duration:0.2});$("my-schedule-help").hide();$("my-schedule-help").setStyle({top:"-1978px",left:"-1978px"});this.unmakeDraggable()},saveSchedule:function(){var C=[];for(var B=0;B<this.savedSchedule.length;B++){var D=this.savedSchedule[B].getSessions();for(var A=0;A<D.length;A++){C.push(D[A])}}popupX=x;popupY=y;new Ajax.Request("/"+urlPrefix+"/json/saveAttendeeSessions/"+loginService.getUserId()+"/"+C.join(","),{method:"get",onSuccess:this._saveSchedule.bind(this)})},_saveSchedule:function(C,B){var A=C.responseText.evalJSON();if(A.error){if(A.expired){loginService.logout()}popupService.manualShow(popupX-Math.floor(popupService.popup.getDimensions().width/2),popupY,"Sorry!","Your schedule could not be saved. The system said: "+A.message)}else{if(urlPrefix=="na"){popupService.manualShow(popupX-Math.floor(popupService.popup.getDimensions().width/2),popupY,"Wait... you're almost done!","You must NOW go to an on-site MAX Badge Update Station (located at each end of the MAX Information Kiosk tables) so that your latest schedule can be saved to your badge.")}else{popupService.manualShow(popupX-Math.floor(popupService.popup.getDimensions().width/2),popupY,"Hooray!","Your schedule was saved.")}$("save").setOpacity(0.25)}}});function calculateWidths(E){scheduleWidth=Math.floor((document.documentElement.clientWidth-150)/TIMES.length)*TIMES.length;TIME_WIDTH=Math.floor(scheduleWidth/TIMES.length*2);PM_TIMES_OFFSET=scheduleWidth*-1;PM_SESSIONS_OFFSET=PM_TIMES_OFFSET+AM_SESSIONS_OFFSET;for(var B=0;B<NUM_DAYS;B++){$("sessions"+B).setStyle({width:(TIME_WIDTH*TIMES.length)+"px"})}var A=$$("div.session");for(var B=0;B<A.length;B++){var D=TIME_WIDTH*parseInt(A[B].getAttribute("duration"))/BLOCK_INTERVAL+1;if(Prototype.Browser.IE||Prototype.Browser.Gecko){D-=2}$(A[B]).setStyle({width:D+"px",left:(parseInt(A[B].getAttribute("startTime"))*TIME_WIDTH-1)+"px"})}var C=$$("div.time");for(var B=0;B<C.length;B++){$(C[B]).setStyle({width:TIME_WIDTH+"px",left:(B*TIME_WIDTH-1)+"px"})}}function preloadRooms(C,B){if(C.responseJSON==null){trackMenu.setTrack(trackMenu.track);loader.hide();clearInterval(sessionsLoadedTimer);sessionsLoadedTimer=false;$("daySelector").hide();$("timeSelector").hide();$("dayviewRoomHeading").hide();$("timesContainer").hide();$("buttonContainer").hide();$("key").hide();$("portal").hide();popupService.manualShow(Math.floor((document.documentElement.clientWidth-popupService.getWidth())/2),Math.floor(document.documentElement.clientHeight/2)+50,"Error loading sessions","There was an error loading the sessions. Please try reloading the page, or if the problem persists, try again a bit later.",true);return }SessionData=C.responseText.evalJSON();for(var A=0;A<SessionData.length;A++){sessionIdHash.set(SessionData[A][0],A)}for(var A=0;A<NUM_DAYS;A++){new Ajax.Request("/"+urlPrefix+"/json/getScheduleForDay/"+A+"/",{method:"get",onSuccess:loadRooms})}sessionsLoadedTimer=setInterval(function(){if(roomsLoaded==NUM_DAYS){new Effect.DropOut("loading");$("roomsShadow").setStyle({display:"block"});trackMenu.setTrack(trackMenu.track);loader.hide();clearInterval(sessionsLoadedTimer);sessionsLoadedTimer=false;new Ajax.Request("/"+urlPrefix+"/json/getGeneralSessions/",{method:"get",onSuccess:loadGeneralSessions})}},100)}function loadRooms(H,E){var G=H.responseText.evalJSON();var A=H.getResponseHeader("X-Day");roomsLoaded++;loader.hide();$(dayviewScheduler.sessionsContainer[A]).setStyle({height:(81*(G.length))+"px"});roomCount.set(A,G.length);for(var D=0;D<G.length;D++){dayviewScheduler.addRoom(G[D].room,"",A,G.length);for(var B=0;B<G[D].sessions.length;B++){var C="regular";switch(parseInt(SessionData[sessionIdHash.get(G[D].sessions[B].session_id)][4])){case 2:C="lab";break;case 3:C="pre";break;case 4:C="general";break}var F;if(SessionData[sessionIdHash.get(G[D].sessions[B].session_id)][3]==null){F=""}else{F=SessionData[sessionIdHash.get(G[D].sessions[B].session_id)][3].replace(","," ").toLowerCase()}dayviewScheduler.addSession(A,D,parseInt(G[D].sessions[B].position),parseInt(G[D].sessions[B].time),G[D].sessions[B].session_id,C,G[D].sessions[B].instance,F,G[D].sessions[B].atCapacity)}}}function loadGeneralSessions(D,C){var A=D.responseText.evalJSON();for(var B=0;B<A.length;B++){dayviewScheduler.addSession(A[B].day,0,A[B].position,A[B].time,A[B].session_id,"general",A[B].instance,"envision design develop",false)}loginService.checkLogin()}function resetDragging(){dragging=false}function sessionExpired(){popupService.manualShow(Math.floor((document.documentElement.clientWidth-popupService.getWidth())/2),Math.floor(document.documentElement.clientHeight/2)+50,"Error loading sessions","There was an error loading the sessions. Please try reloading the page, or if the problem persists, try again a bit later.",true)};