var page = { Start:function () { Page.searching.start (); return this; }, Leftmenu: { Start:function () { This.triggers = $ ("LeftNav"). GetElements (". Withsubmenu"); This.triggers.each (function (trigger) { Trigger.addevents ({ Mouseenter:page.leftMenu.show.bindWithEvent (Trigger), Mouseleave:page.leftMenu.hide.bindWithEvent (Trigger) }); }); return this; }, Show:function () { This.getelement (' a '). addclass (' current '); This.getelement ('. Ln-dropdown '). SetStyle (' Display ', ' inline '); return this; }, Hide:function () { This.getelement (' a '). Removeclass (' current '); This.getelement ('. Ln-dropdown '). SetStyle (' Display ', ' none '); return this; } }, Newscomplex: { Data: { Panels: ["Updates", "News", "events"], Tweens: [ { Property: ' Left ', duration:500 }, { Property: ' Top ', duration:500 }, { Property: ' Left ', duration:500 }, { Property: ' Top ', duration:500 } ], Sets: [470,-260,-470,260] }, Status: { current:0, Locked:false }, Start:function () { This.panels = []; This.triggers = []; for (Var i=0 i <this.data.panels.length; i++) { This.panels.push ($ ("recent-" + this.data.panels[i] + "-list"). Set (' Tween ', this.data.tweens[i]); if (i > 0) { This.panels[i].get (' tween '). Set (This.data.sets[i]); } This.triggers.push ($ ("recent-" + this.data.panels[i] + "-title"). GetElement (' a '). Addevent ("click", This.show.bindWithEvent (This,[i])); } return this; }, Show:function (E,at) { E.stop (); if (at!= this.status.current) { if (!this.status.locked) { This.status.locked = true; This.triggers[this.status.current].removeclass ("on"); This.triggers[at].addclass ("on"). blur (); This.panels[this.status.current].get (' Tween '). Start (This.data.sets[this.status.current]). Chain (function (at) { This.panels[this.status.current].addclass (' off '); This.panels[at].removeclass (' off '). Get (' tween '). Set (This.data.sets[at]). Start (0). Chain (function () { page.newsComplex.status.locked = false;}); }.bind (This,at)); This.status.current = at; } } return this; } }, Features: { Data: { Emoteset: [' ^_^ ', ':-P ', ' @_@ ', ' t_t ', '-_-b ', '-_-+ ', ' =_= ' ', '-o-', '-w-', ' (^o^)/', ' Orz ', '?? Z '], Superloadingcontainer: "Superloadingcontainer", Colsize:3, featurecount:0, rotateduration:5000, Step:-170, MOVEDURATION:300, dehighlightopacity:0.3, infoopacity:0.5 }, Status: { Locked:false, current:0, Highlight:1, headpos:0 }, Start:function () { This.featurelistwrapper = $ ("features"). Addevents ({ Mouseenter:this.onEnter.bind (This), Mouseleave:this.onLeave.bind (This) }); This.featurelistcountainer = $ ("feature-list-h"); This.featurelist = $ ("Feature-list"). Set ("Tween", {property: "Left", duration:this.data.moveDuration}); This.featurelistitems = this.featureList.getElements (' a '); This.data.featureCount = This.featureListItems.length; This.loadingtext = new Loadingtexticons (This.data.superloadingcontainer,this.data.emoteset). Start (); This.dropshadow (); THIS.PREVBTN = new Element (' div '). Set ({ ID: "Features-btn-prev", Title: "Prev" }). addclass ("Features-btn"). AddClass ("features-btn-prev-on"). Inject (This.featurelistwrapper). AddEvent (' click ', This.prev.bindWithEvent (this)); THIS.NEXTBTN = new Element (' div '). Set ({ ID: "Features-btn-next", Title: "Next" }). addclass ("Features-btn"). AddClass ("features-btn-next-on"). Inject (This.featurelistwrapper). AddEvent (' click ', This.next.bindWithEvent (this)); This.info = $ ("Feature-info"). SetStyle (' Display ', ' none '); This.info.getElement (' span '). SetStyle (' opacity ', this.data.infoOpacity); This.infolink = $ ("cur-feature"); This.highlight (this.status.current); This.rotate.periodical (This.data.rotateduration,this); This.featureListWrapper.removeClass ("Loading"); return this; }, Dropshadow:function () { This.shims = []; for (Var i=0 i <this.data.featureCount; i++) { This.shims.push ({ Shadow:new Element (' div '). addclass ("Feature-shadow"). Inject (this.featurelistitems[i], ' before '), Glow:new Element (' div '). addclass ("Feature-glow"). Inject (this.featurelistitems[i], ' before '). SetStyle (' Display ', ' None ') }); This.featurelistitems[i].setstyle (' opacity ', this.data.deHighlightOpacity). Addevents ({ Mouseenter:this.highlight.bind (This,[i]), Mouseleave:this.deHighlight.bind (This,[i]) }); } return this; }, Onenter:function () { This.status.locked = true; This.info.setStyle (' Display ', ""); This.dehighlight (this.status.current); return this; }, Onleave:function () { this.status.locked = false; This.info.setStyle (' Display ', ' none '); return this; }, Updateinfolink:function (at) { This.infoLink.set ({ Href:this.featurelistitems[at].get ("href"), Html:this.featurelistitems[at].get ("title") }); return this; }, Rotate:function () { if (!this.status.locked) { This.next (); } return this; }, Prev:function () { This.dehighlight (this.status.current); This.status.current = this.status.current-1 < 0? This.data.featurecount-1: this.status.current-1; This.to (this.status.current, "prev"); return this; }, Next:function () { This.dehighlight (this.status.current); This.status.current = this.status.current + 1 >= this.data.featureCount? 0:this.status.current + 1; This.to (This.status.current, "next"); return this; }, To:function (at,direction) { if (Direction = = "Next") { this.status.highlight++; if (this.status.highlight <= this.data.colSize) { This.highlight (at); } else { if (at < This.data.featureCount && at!= 0) { This.featureList.get ("Tween"). Start ((at + 1-this.data.colsize) * this.data.step). Chain (This.highlight.bind at]); This.status.highlight = this.data.colSize; } else { This.featureList.get ("Tween"). Start (0); This.highlight (0); This.status.highlight = 1; } } else if (direction = = "Prev") { this.status.highlight--; if (This.status.highlight > 0) { This.highlight (at); } else { if (at >= 0 && at!= this.data.featurecount-1) { This.featureList.get ("Tween"). Start (at * this.data.step). Chain (This.highlight.bind (This,[at)); This.status.highlight = 1; } else { This.featureList.get ("Tween"). Start ((this.data.featurecount-this.data.colsize) * this.data.step); This.highlight (this.data.featurecount-1); This.status.highlight = this.data.colSize; } } } return this; }, Highlight:function (at) { This.shims[at].shadow.setstyle ("Display", "none"); This.shims[at].glow.setstyle ("Display", ""); This.featurelistitems[at].setstyle (' opacity ', 1); This.updateinfolink (at); return this; }, Dehighlight:function (at) { This.shims[at].shadow.setstyle ("Display", ""); This.shims[at].glow.setstyle ("Display", "none"); This.featurelistitems[at].setstyle (' opacity ', this.data.deHighlightOpacity); return this; } }, PRM: { Data: { count:0, duration:5000 }, Status: { current:0, Locked:false }, Start:function () { This.holder = $ ("PRM"). Addevents ({ Mouseenter:function () {this.status.locked = true;}. Bind (This), Mouseleave:function () {this.status.locked = false;}. Bind (This) }); This.images = this.holder.getElements ("#prm-images li"); This.data.count = This.images.length; This.triggerholder = new Element ("P"). Set ("id", "prm-nums"). Inject (This.holder); This.triggers = []; for (Var i=0 i <this.data.count; i++) { This.triggers.push (New Element ("a"). Set ("HTML", I + 1). Inject (This.triggerholder). Addevents ({ Click:function (e) {e.stop ()}, Mouseover:this.show.bind (This,[i]) })); } This.show (0); This.rotate.periodical (This.data.duration,this); return this; }, Show:function (at) { This.images[this.status.current].setstyle ("Display", "none"); This.triggers[this.status.current].removeclass ("current"); This.images[at].setstyle ("Display", "block"); This.triggers[at].addclass ("current"); This.status.current = at; return this; }, Rotate:function () { if (!this.status.locked) { This.show (this.status.current + 1 >= this.data.count? 0:this.status.current + 1); } return this; } }, Community: { Status: { current:0 }, Start:function () { This.triggers = $ ("Community-tab"). GetElements ("a"); This.contents = $ ("community-contents"). GetElements (". Community-content"); for (Var i=0 i <this.triggers.length; i++) { This.triggers[i].addevent ("Click", This.switchTo.bindWithEvent (This,[i)); } return this; }, Switchto:function (E,at) { E.stop (); if (at!= this.status.current) { This.triggers[this.status.current].removeclass ("current"); This.contents[this.status.current].removeclass ("current"); This.triggers[at].addclass ("current"); This.contents[at].addclass ("current"); This.status.current = at; } This.triggers[at].blur (); return this; } }, Searching: { Start:function () { This.text = new TextInput ("Search-input", "site search is about to open", { OnEnterPressed:this.startSearch.bind (This) }); This.searchbutton = $ ("Start-search"). Addevent ("Click", This.startSearch.bindWithEvent (this)); }, Startsearch:function (e) { try {e.stop ();} catch (Err) {} } } }; Window.siteOverall.data.currentNav = 0; Window.addevent (' Domready ', page.start); |