if(typeof LStrings=="undefined"){LStrings={}}LStrings.en={js:{nth:function(a){return a+(["","st","nd","rd"][(a<10||a>20)?a%10:a]||"th")},whois:function(a){var b='<span class="username">'+a.username+"</span>";b+=" is "+(a.roomId==null?"offline":'in room <span class="link" onclick="Quiz.setRoom({ id: \''+a.roomId+"' });\">"+escapeHTML(a.roomName)+"</span>");if(a.idleSince){b+=" and has been idle for "+Util.approxTimeDelay(new Date().valueOf()-a.idleSince)}b+=".";return b},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],leaveReason:[" because the user quit"," due to a connection problem"," to join another room"," 'cause (s)he was kicked by the room creator or an admin"],leadMsgs:["You have taken the lead.","You are tied for the lead.","You have lost the lead."],qTypes:["Single answer","Multiple answer","Sort","Text","Number","Map"],difficulty:{1:"Easy",2:"Medium",3:"Hard"},passResetResp:["Your password has been reset.","This password reset code has already been used.","The password reset code is invalid."],passResetReqResp:["An email has been send to your address with the password reset instructions.","A password reset email is already pending for this account.","This account is locked from resetting the password.","Wrong password."],newAccResp:["Account created.","Username is already taken. Please try a different username.","An unknown error has occured while trying to create your account. Please try again and if the problem persists contact us."],serverExceptionMsg:{1024:"Generic server exception",1025:"You don't have enough money",1026:"Money service payment error",1027:"Email is invalid",1028:"Email is already taken",1029:"Du-duplicate answers",1030:"Double reset password info",1031:"Username already taken"},paymentHistory:["You have deposited %s from %s using %s.","You have withdrawn %s from your account to %s using %s.","%s was successfully delivered to %s using %s.","Failed to transfer %s to %s using %s.","You have joined a game with %s participation fee.","You have won %s. (net)","You have bailed from a game. %s have been refunded to your account.","AnswerJoy has taken a tax of %s.","You have won %s (raw).","We have cancelled your game. %s have been refunded to your account.","You have received %s bonus for reaching 3 stars.","You have received %s bonus for a promotion.","You have received %s bonus for inviting 3 friends during the promotion."],paymentConfirmation:["%m has been delivered to %s through %s.","The transfer of %m to %s has failed for an unspecified reason.","The transfer of %m to %s has failed because %s has refused target account.","The transfer of %m to %s has failed. %s requests that you contact him.","The transfer of %m to %s has failed because there was a problem communicating with %s."],niceDateTimeFormat:"dddd, MMMM dn yyyy, hh:mm tt",seconds:{one:"second",more:"seconds"},minutes:{one:"minute",more:"minutes"},points:{one:"point",more:"points"},players:{one:"player",more:"players"},questions:{one:"question",more:"questions"},langInvite:"AnswerJoy in English",ftll:"Failed to load language.",qProximity:"proximity: %f",questionPosition:"%nth question",buttonAddInvite:"Add...",free:"free",Avatar:"Avatar",uploadAvatarFailed:"Avatar upload has failed (error code: %i).",newBalance:"%m have been added to you account. Your account balance is now %m.",newBalanceGame:"You have won %m. Your account balance is now %m.",illegalGuestNick:"The nickname you have entered is reserved.",enterRoomErr:"Enter room",mustLogIn:"You must be logged in to user this feature.",notEnoughMoneyToJoin:"You do not have enough money in your account to join this room.",notEnoughMoneyToJoinRoom:'You cannot enter room %s because the bet is %m and you only have %m in your account. <span class="link" onclick="Util.navigate(\'paymentHistory\'); Alert.removeItem(this);">Deposit money</span>.',gameAlreadyStarted:"This game has already began.",roomIsFull:"This room is full.",JoinRoom:"Join room %s?",JoinRoomPay:"Join room %s? This will cost you %m.",joinRoomNo:"No",joinRoomYes:"Yes",joinRoomPayNo:"No",joinRoomPayYes:"Yes, I agree to pay the fee",alreadyInRoom:"You are already in this room.",chatProblem:"Problem detected! You didn't say anything but server thinks you said: %s",chatMsgTooLong:"Your chat message is too large. Maximum length is 250 characters but yours has %i characters.",serverError:"Server error",connectingStopped:"Stopped",btnReconnect:"Reconnect",exceptionParsingSrvResp:"Exception while parsing server response: %s",srvErrEmpty:"Server error: %s <-- (empty)",msgFromSrvIsMissingType:"Message from server is missing type (y)",noHandler:"No handler found for message type (%s)",srvNotResp:"Server is not responding",statusTimeOut:"(Status req timed out)",normalReqTimeOut:"(Normal req timed out)",unableToConnect:'Unable to connect to "%s". Security exception?',connecting:"Connecting...",lastMsgAt:"Last message was at %s",logPopupBlocked:"It looks like a popup blocker is preventing this site from displaying the log. Fix this and try again.",viewLog:"View Log",appFullLogTitle:"AnswerJoy full log (%s)",appFullLog:"AnswerJoy full log",generatedAt:"Generated at %s",close:"close",Close:"Close",pointsEarned:"%s points earned.",answerPosition:"%s to answer the question!",answerTooLate:"Unfortunately, it seems you have answered too late.",nobodyCorrect:"Nobody answered this question correctly.",youLeadQuestion:"Congratulations! You are the leader for this question!",questionLeadersOne:"%s is the leader for this question.",questionLeadersMany:"%s are the leaders for this question.",questionBy:"Question was added by %s.",badLogin:"Bad username or password.",login:"Login",passChangeErr:"Error changing password.",passChangeOk:"Password changed.",unexpectedLogOut:"You have been logged out. Most likely this is because you have signed in on a different computer/browser.",unexpectedLogOutPayGame:"You have been logged out. Most likely this is because you have signed in on a different computer/browser. You cannot play a pay game as guest.",lobbyPressStart:'The game is waiting for players and will start when enough players press "Start Game".',youJoinedRoom:'You have joined room "%s".',youFirstNick:"You are known as %s.",youNewNick:"You are now known as %s.",clickNickToChange:"Click your nickname to change it",userJoin:"%s has joined this room.",userLeft:"%s has left this room%s.",notifyNewMsg:"NEW MESSAGE",youChangedNick:"<b>You</b> are now known as %s.",userChangedNick:"%s is now known as %s.",reconnecting:"Reconnecting...",x2:"Nickname is not available.",x3:"The game has ended. You now know everything.",x4:"Invalid data. We don't like wiseguys.",x5:"Server did not understand a message from us. Message type: %s",x7:"The server has encountered an internal exception.",x8:"The server database has encountered an internal exception.",xx:"Unknown exception from server. Code: %s.",inviteBonus:"%s will receive an invite bonus of %i points at the end of the round.",newAccCreated:"Your account has been created.",youFirstRound:"Congratulations! You came up first in this round!",youSecondRound:"Congratulations! You came up second in this round! Too bad you failed at being the first.",youThirdRound:"You came up third in this round!",youPlaceRound:"You came up %nth in this round.",youFirstGame:"Congratulations! You came up first in this game! You won %s!",youSecondGame:"Congratulations! You came up second in this game! Too bad you failed at being the first. You won %s!",youThirdGame:"You came up third in this game! You won %s!",youPlaceGame:"You came up %nth in this game. You won %s.",youLast:"You also happen to be the last.",numberAbbr:"No.",User:"User",Score:"Score",Error:"Error",clickShapeFB:"Click a shape to have it's index written to the FireBug log.",youClickedShape:"You clicked shape %i",atLeastOneDomain:"Please choose at least one domain.",atLeastOneLang:"Please choose at least one language for questions.",atLeastOneQT:"Please choose at least one questions type.",enterRoomTitle:"Please enter a title for the room.",roomTitleTooLong:"Room title is too long. Please enter at most 80 characters.",Tag:"Tag",Tags:"Tags",roomCreatedAtBy:"Created %s by %s",joinedTimes:"Joined %i times.",lastVisit:"Last visit: %s",allHintsAreDupes:"(all matches are already used)",noMatch:"(no match)",guestNickTooLong:"Nickname is too long, the restriction for guests is at most 17 characters.",guestNickTooShort:"Nickname is too short, it must have at least 3 characters.",notImplementedYet:"No implemented yet!",reportQuestionTitle:"Report Question",enterFeedbackMsg:"Please enter a feedback message",thankYouForYourFeedback:"Thank you for your feedback.",nowPlaying:"Now Playing",Play:"Current Game",unanswered:"Unanswered.",notAnsweredYet:"Not answered yet.",youDidntKnow:"You didn't know.",rightAnswer:"Right answer!",wrongAnswer:"Wrong answer.",qHistMeta:'Type: %s. Keywords: %s.<span class="multilang"> Language: %s.</span>',availableAnswers:"Available answers: ",itemsToSort:"Items: ",IdHeader:"Id",DelHeader:"Del?",EditHeader:"Edit",QHeader:"Q &amp; A",TypeHeader:"Type",DifHeader:"Diff",DateHeader:"Date",UserHeader:"User",BetHeader:"Bet",badQType:"Unable to determine question type",noQLang:"Please specify the language for this question.",noQText:"Please enter the question text.",qTextTooLong:'Question text is too long. %i characters maximum, "&" counts as 5 characters, "<" and ">" count as 4 characters each. The text you have entered has %i characters.',explTooLong:'Explanation text is too long. %i characters maximum, "&" counts as 5 characters, "<" and ">" count as 4 characters each. The text you have entered has %i characters.',infoUrlTooLong:"Information URL is too long. 255 characters maximum.",infoUrlNotValid:"Information URL is not valid.",oneCorAns:"Question must have at least 1 correct answer.",threeWrongAns:"Question must have at least 3 wrong answers.",max200Ans:"A question can have at most 200 answers.",ansTooLong:'An answer can have at most 50 characters. Answer "%s" has %i characters.',twoCorAns:"Question must have at least 2 correct answers.",fourWrongAns:"Question must have at least 4 wrong answers.",min3Ans:"Question must have at least 3 answers.",nrAnsNotInt:'The answer for number questions must be an integer!\nGood: "2009", "0", "-20"\nBad: "qwerty", 0.5\nTry again.',proximityNotInt:'The proximity for number questions must be an integer!\nGood: "2009", "0", "-20"\nBad: "qwerty", 0.5\nTry again.',repeatedAnswers:"The following answers are repeated more than once: %s.",minOneTag:"Please enter at least one tag.",max20Tags:"Please remove unrelated tags. The maximum is 20 tags per question.",tagTooLong:'Tag "%s" is too long. 30 characters max.',missingDiff:"Unknown difficulty.",imgUrlTooLong:"Image URL is too long. 255 characters maximum.",imgUrlNotValid:"Image URL is not valid.",missingKnownTag:"You must enter at least one tag which is in the public list of tags.",addQErrTitle:"Add/Edit Question",del:"",edit:"",tblAnswers:"Answer(s): %s",tblWrong:"Wrong: %s",editQNotFound:"Question not found (%s).",btnSaveEdit:"Save edit",editQTabTitle:"Edit Question",addQTabTitle:"Add Question",QuestionTitle:"Question",qAdded:"Question added",errAddQ:"Error adding question",qInDb:"Question already in database",errAddQUnkn:"Unknown error adding question",qUpd:"Question updated",qUpdErr:"Error updating question",qUpdErrUnkn:"Unknown error updating question",ansPlsWait:'You answered "%s". Please wait until others answer or time expires.',ansPlsWaitCbx:'You answered "%s". Please wait until others answer or time expires.',plsWaitGiveUp:"You gave up. Please wait until others answer or time expires.",timeExpired:"Time has expired.",youGaveUp:"You gave up.",youAnsNone:"Your answer is none.",youAns:'You answered "%s".',noAnsCor:"No aswer was correct.",corAns:"the correct answer was %s",timeXp:"Time has expired.",youAnsCor:"you answered correctly %s",youWrong:"You were wrong.",youNoAns:"You selected no answer.",learnMore:"Learn more...",streak10:"%s is unstoppable!",streakM10:"%s would have better luck picking at random.",Break:"Break",loadingAlt:"Loading...",waitQ:"Waiting for question...",retryIn:"retrying in %s.",startIn:"Game starts in %s.",reconnectNow:"Reconnect now",Title:"Title",Category:"Category",Tags:"Tags",Lang:"Lang",Players:"Players",Creator:"Creator",Started:"Started",TagInfo:"Tag: %s",Top:"Top",noCategsMatch:"No categories match the filter",joinPub:"Join a random public game in this category",join:"join",listCategGames:"List all games in this category",filter:"filter",relTags:"Related tags",noAudioSupport:"Your browser does not support audio playback. Sound effects are disabled.",globalTagName:"All categories",globalTag:"all",Filter:"Filter",passNotMatch:"Passwords do not match",noPass:"Please enter a password.",passTooShort:"Password is too short. Enter at least %i characters.",usrTooShort:"Please enter a username of at least %i characters.",usrTooLong:"Please restrict your username to at most %i characters.",usrGuestBad:'Username cannot begin with "G[", that is reserved for guests.',usrAIBad:'Username cannot begin with "AI", that is reserved for AI players.',noUsrOrPass:"Incomplete credentials.",mustLogIn:"You must be logged in to use this feature.",newPassNotMatch:"The new password does not match the repeated new password.",resetPassUsrOrEmail:"You must enter your username or email in order to reset your password.",resetPassTitle:"Reset Password",resetReqCode:"You must enter the code you received in your email in order to reset your password.",resetPassErrUnkn:"Unknown error while reseting password: %i.",resetPassReqErrUnkn:"Unknown error while requesting password reset: %i.",newAccErrUnkn:"Unknown error while creating account: %i.",infoUpdOk:"Your information has been updated.",infoUpdPartial:"Some of the information has been updated.",emailInvalid:"The email address is invalid.",emailInUse:"The email address is already in use by another account.",emailConfirm:"A confirmation email has been sent to your new address.",infoUpdTitle:"Account Information Update",statusLobby:"In lobby",statusNoLobby:"Playing",now:"now",noGlobalTagInQuestions:'"all" cannot be used as a tag for questions because it always describes all questions.',roomName:"%s's room",conjunction:"and",tagIncludes:"Includes",addThisDesc:"Play AnswerJoy: Live Knowledge Game",yahooHrefMsg:"ymsgr:im?msg='Play with me on AnswerJoy.com: %s'",kpoints:"%i points",clientError:"A client error has occured. AnswerJoy has been notified and someone will look into it as soon as possible. If you notice anything unusual please refresh the site.",receivedHalfStar:"Congratulations, you have received your first half star! Keep playing to receive stars.",receivedStar:"Congratulations, you have received a star!",receivedPoints:'You are at %.2f%% of the %nth star. <aj:progressBar value="%1%f"/>',youLeftRoom:"You have left the room %s.",unknownCommand:"Unknown command: %s",newRound:"A new round has started.",depositSuccess:"The deposit transaction has completed. Your account has been recharged.",depositCancel:"The deposit has been cancelled.",accountBalance:"Account Balance",pHAll:"%i records",pHInterval:"%i&ndash;%i",pH0:"You have not deposited any money in your account.",extractStart:"A transfer of %m from your AnswerJoy account to your %s account has been initiated. Please check your email address often for confirmation (you will NOT be notified here).",extractCash:"You do not have %m in you account.",extractUnknownError:"An unknown error has ocurred while extracting the money from your account.",leavePayGameMsg:"Do you wish to leave the current game? The bet will not be refounded.",leavePayGameYes:"Yes, I don't want to continue playing here.",leavePayGameNo:"No, I want to keep playing here.",logoffWhenInPayGame:"You are in a game with a bet. If you logoff, you will be moved in a free room and the money will not be refunded. Do you still wish to logoff?",logoffWhenInPayGameYes:"Yes, I want to logoff anyway.",logoffWhenInPayGameNo:"No, I want to keep playing here.",enterUrlPayGameMsg:"The game you are attempting to enter has an unknown bet. What do you wish to do?",enterUrlPayGameNo:"Continue playing where I am now, I don't want to pay an unkown game.",enterUrlPayGameYes:"I will pay the bet and enter the game anyway.",questionsAll:"%i questions",questionsInterval:"%i&ndash;%i",timerAnswer:"'till time expires",timerWaitAnswer:"'till others answer",timerEOM:"'till question analysis ends",timerNextQuestion:"'till next question",timerNextRound:"'till next round",wonQuestionOne:"%s won this question.",wonQuestionMany:"%s won this question.",wonGameOne:"%s won this game.",wonGameMany:"%s won this game.",moneyLeft:"%s in game",votingStatus:"%i users are ready, %i are not ready yet.",guestUser:"Guest %s",ieMsg:"You are using Internet Explorer. AnswerJoy looks and works better in more modern browsers.",oldBrowserH:"Your %s is out of date",oldBrowserMsg:"To get the best possible experience using AnswerJoy we recommend that you upgrade to a newer version or a better web browser. Click on a browser to download it:",oldBrowserRecommend:'Only in <a href="http://www.google.com/chrome">Google Chrome</a>, <a href="http://www.mozilla.com/firefox/">Mozilla Firefox</a> or <a href="http://www.apple.com/safari/download/">Apple Safari</a> our site looks good:',newBrowserScreenshot:"images/screenshot.en.png",oldBrowserDismiss:"I don't care"},html:{hNavHome:"Home",hNavHomeDesc:"Go home",hNavPlay:"Current Game",hNavPlayDesc:"Return to your game",hNavFreeGame:"Free Games",hNavFreeGameDesc:"Search for, or create personalized games",hNavPaidGame:"Paid Games",hNavPaidGameDesc:"Wanna put a price tag on your knowledge?",hNavAccount:"My Account",hNavYahoo:"Yahoo!",hNavYahooDesc:"Invite your friends",hNavFacebook:"Facebook",hNavFacebookDesc:"Notify your friends",hNavFeedback:"Feedback",hNavFeedbackDesc:"Send a smile",hBusinessMapHome:"Home",hBusinessMapPlay:"Current Game",hBusinessMapFreeGame:"Free Games",hBusinessMapPaidGame:"Paid Games",hBusinessMapProfile:"Profile",hBusinessMapTips:"Tips and Tricks",hBusinessMapRules:"Rules",hFeedbackTitle:"We'll read your opinion",hFeedbackSender:"What's your name?",hFeedbackSenderAddress:"E-Mail:",hFeedbackMessageSubject:"Subject:",hFeedbackMessageBody:"Body:",hFeedbackSend:"Send Message",hFeedbackCancel:"Cancel Message",hPasswordResetCol1Title:"Step 1",hPasswordResetCol2Title:"Step 2",hSettingsAnswersHead:"Answers",hSettingsDomainsHead:"Domains",hSettingsQuestionHead:"Question",hSettingsDepositHead:"Deposit money into the Account",hSettingsDepositHead2:"Deposit money into the Account",hSettingsDepositHead3:"Deposit money into the Account",hSettingsExtractHead:"Extract money out of the Account",hSettingsPaymentHead:"Money trail",hPaymentHistoryLoading:"Loading...",htmlLoadingDesc:"AnswerJoy is a knowledge game where you can put your money where your mouth is.",htmlIsLoading:"AnswerJoy is loading",htmlLoadingHTML:"Content",htmlLoadingJS:"Control",htmlLoadingCSS:"Presentation",htmlHome:"Home",htmlPlay:"Play",htmlCreateNoPay:"Create Game",htmlCreatePay:"Create Pay Game",htmlJoinNoPay:"Enter Game",htmlJoinPay:"Enter Pay Game",htmlProfile:"Profile",htmlPlayingAs:"Hello, ",htmlSignUp:"Sign up",htmlLogin:"Login",htmlWelcome:"Welcome",htmlLogoff:"Logoff",htmlSettings:"Settings",htmlUpdatedOn:"Updated on",htmlSiteMap:"Site Map",htmlContactUs:"Contact Us",htmlToU:"Terms of Use",htmlPrivacyPolicy:"Privacy Policy",htmlHelp:"Help",htmlFBName:"Your Name:",htmlFBMail:"Your Email:",htmlFBTitle:"Title:",htmlFBBody:"Feedback:",htmlFBSend:"Send",htmlFBLabel:"F E E D B A C K",htmlNewNick:"New Nick:",htmlChNick:"Change",htmlChNickCancel:"Cancel",htmlIBalance:"Balance: ",htmlClose:"Close",htmlPlsEnableJS:'Please enable JavaScript or use a client which supports JavaScript. <ul> <li>Internet Explorer:<br /> <ol><li>Go to the menu Tools, then choose Internet Options.</li> <li>Choose the tab Security, click the button "Custom level".</li> <li>Search for Scripting > Active Scripting, then choose Enable to activate JavaScript.</li> <li>Click Ok twice to close the dialogs.</li></ol></li> <li>Firefox Windows:<br /> <ol><li>Go to the menu Tools, then choose Options.</li> <li>Choose the tab Content, then enable the checkbox JavaScript.</li> <li>Click Ok to close the dialog.</li></ol></li> <li>Firefox Linux:<br /> <ol><li>Edit sources, recompile Firefox, play</li></ol></li> <li>Opera:<br /> <ol><li>Go to the menu Tools, then the submenu Quick Preferences and choose JavaScript to enable the checkbox.</li></ol></li> <li>Lynx support group meets Tuesday.</li> </ul>',htmlWHeading:"Welcome!",htmlWPlayNow:"Play now",htmlWHDesc:"AnswerJoy is an online trivia-like game where you're given the chance to put a price tag on your knowledge*",htmlWHDesc2:"<strong>*</strong> Paid games require users to ",htmlWHLink:"create an account",htmlWFreeHeader:"Play for Fun",htmlWFreeDescription:"It's easy to compete against any of your friends.",htmlWFreeLink:"Find a free game",htmlWMoneyHeader:"Play for Money",htmlWMoneyDescription:"Create a game that require users to pay a certain fee to enter, and invite any registered user to play with you.",htmlWMoneyLink:"Create a paid game",htmlWTopHeader:"Top users",htmlWRulesLink:"Read the rules",htmlGRulesLink:"Read the rules",htmlWLogin:"login",htmlWLoginFollow:" as guest, or ",htmlSMPlay:"Play",htmlSMJoinGame:"Join Game",htmlSMBrG:"Browse Games",htmlSMRecG:"Recent Games",htmlSMSrcG:"Search Games",htmlSMCrG:"Create Game",htmlSMQ:"Questions",htmlSMQA:"Add Question",htmlSMQL:"List Questions",htmlSMCopy:"Copyright Information",htmlSMSM:"Site Map ( &lt;-- you are here )",htmlSMToU:"Terms of Use",htmlSMPP:"Privacy Policy",htmlSMHelp:"Help",htmlSMContact:"Contact Us",htmlSAnim:"Animations",htmlSEnableAnim:"Enable animations",htmlSEnableBigAnim:"Enable big animations",htmlSChatOptions:"Chat options",htmlSCTimestamps:"Timestamps",htmlSCActivity:"Activity",htmlSCActivityOthers:"Other people",htmlSOtherOptions:"Other options",htmlSCDepositPopup:"Open money deposit services in new window (reduced functionality)",htmlSAvatar:"Avatar",htmlSUploadAvatar:"Upload new avatar",htmlSPickAvatar:"Choose new avatar",htmlSChooseAvatar:"Click an avatar to use it",htmlSChPass:"Change password",htmlSOldP:"Old pass:",htmlSNewP:"New pass:",htmlSNewP2:"New pass (repeat):",htmlSBtnChP:"Change password",htmlSChAccInfo:"Change account information",htmlSEmail:"Email:",htmlSFirstName:"First name:",htmlSSurName:"Last name:",htmlSSex:"Sex:",htmlSBirthDate:"Date of birth:",htmlSBirthDateHint:"dd.mm.yyyy, e.g. 01.02.1980 for February 1<sup>st</sup>",htmlSCountry:"Country:",htmlSState:"State:",htmlSBtnUpd:"Update information",htmlSBalance:"Balance:",htmlSDepositMBLink:"MoneyBookers Deposit",htmlSDepositEPLink:"ePayment Deposit",htmlSDepositMPLink:"MobilPay Deposit",htmlSExtractMBLink:"MoneyBookers Extract",htmlSDeposit:"Deposit money",htmlSBackDepositMB:"Back",htmlSBackExtractMB:"Back",htmlSBackDepositEP:"Back",htmlSBackDepositMP:"Back",htmlSCancelDeposit:"Cancel",htmlSDepositEP:"Deposit money",htmlSCancelDepositEP:"Cancel",htmlSDepositInfo:"Please note the MoneyBookers transfer fee is substracted from this amount (the fee is &euro;0.29 + 1.9%).",htmlSDepositEPInfo:"Please note the ePayment transfer fee is substracted from this amount (5.36%).",htmlSDepositMP:"Deposit money",htmlSCancelDepositMP:"Cancel",htmlSDepositMPInfo:"Please note that the MobilPay transfer fee is substracted from this amount (&euro;1.2).",htmlSExtract:"Extract money",htmlSExtractInfo:"The money will be delivered to your email address. Please note the MoneyBookers trasfer fee is substracted from this amount (the fee is &euro;0.29 + 1.9%).",htmlSExtractNoMoney:"You do not have enough money.",htmlSExtractNoEmail:"You need to configure an email account before you can extract money.",htmlSExtractEmail:"%s",htmlSHSett:"Settings",htmlSDSett:"View/change settings and account information.",htmlSHBalance:"Balance",htmlSDBalance:"Manage balance: interogate, deposit and extract money.",htmlQHAdd:"Add New Question",htmlQDAdd:"Add a question to your personal set of questions. You will be able to use these questions when making a game.",htmlQHView:"View Questions",htmlQDView:"Manage your questions; list, edit, or delete as you like.",htmlQQuestion:"Question:",htmlQInfo:"Detailed Information <i>(URL)</i>:",htmlQImg:"Image <i>(URL)</i>:",htmlQExpl:"Explanation:",htmlCancelQuestionImage:"Cancel",htmlQKw:"Keywords:",htmlQLang:"Language:",htmlQDiff:"Difficulty:",htmlQType:"Question Type:",htmlQSCDesc:"The user will be given only one right answer, the rest will be wrong, and he has to pick the right answer.",htmlQRA1:"Right answers:",htmlQWA1:"Wrong answers:",htmlQMCDesc:"The user will be given any number of right answers (none, all, or any intermediate value) and the rest will be wrong. For full score, he must pick all the right answers provided.",htmlQRA2:"Right answers",htmlQMA2:"Wrong answers",htmlQSDesc:"The user will be given a subset from this list and he must sort the elements received.",htmlQSAns:"Enter answers:",htmlQTDesc:'The user will have to guess the text. An asterisk mask will be provided (e.g. "**** ***").',htmlQTAns:"Enter answer:",htmlQNDesc:"The user will have to guess the number. No hints will be provided. The closest guess wins as long as it is not further away than proximity.",htmlQNAns:"Enter answer (number):",htmlQNProx:"Enter proximity (number):",htmlQMDesc:"The user will have to choose the shape on the map.",htmlQCancelEdit:"Cancel edit",htmlQPreview:"Preview",htmlQAdd:"Add",htmlQShowAll:"Show all",htmlQNoQ:"No questions found",htmlQDisjunction:"or",htmlRPUser:"Username:",htmlRPEmail:"Email:",htmlRPNotice:"or",htmlRPBtnReq:"Request password reset",htmlRPCode:"Code:",htmlRPBtnReset:"Reset password",htmlRPDidYouKnowHeader:"The username",htmlRPDidYouKnowDescription:"Recovering your password is as easy as entering your username. Provide it and we'll send you an email containing the confirmation code.",htmlRPTipHeader:"The confirmation code",htmlRPTipDescription:"Check your email address that you provided upon registration. Once you confirm that you're the owner of that username, we'll send you your new password.",htmlPMoneyLeft:"Bet left: ",htmlPAddThis:"Share AnswerJoy",htmlPYahooMsg:"Invite your Yahoo! friends",htmlPLang:"Language",htmlPTags:"Tags",htmlPReview:"Review Questions",htmlPReadyLobby:"Start game",htmlPNotReadyLobby:"Stop game",htmlPUsers:"Users",htmlPreturnToGame:"Return to game",htmlPAddQFromPrvw:"Add question to database",htmlPreturnFromPrvw:"Continue editing question",htmlPPlsWait:"Please wait while others answer the question...",htmlPConn:"Connecting to server...",htmlPSendAnsMulti:"Send Answer",htmlPSendAnsSort:"Send Answer",htmlPSendAnsText:"Send Answer",htmlPEomPaidGame:'The game has ended. Please use the "Find game" link above to enter another game.',htmlPPayReadyInfo:"Money games require at least two players.",htmlPGiveUp:"Give Up",htmlPCSend:"Send",htmlPCClear:"Clear",htmlPCLog:"View Log",htmlPGDidYouKnowHeader:"Did you know?",htmlPGDidYouKnowDescription:"<b>Anyone can enter your newly created game.</b> If you haven't marked your game as private, it will appear in the public game list of AnswerJoy.",htmlPGTipHeader:"Tip: Copy & Paste the URL",htmlPGTipDescription:"Your game is uniquely identified by the address from your browser. Thus, inviting your friends has never been easier: just send the URL to any of your friends using your favourite IM application.",htmlCGame:"Create New Game",htmlCBalance:"Balance: ",htmlCDeposit:"Deposit money",htmlCTitle:"Title:",htmlCNrPlayers:"Max. players:",htmlCBet:"Bet:",htmlCNoMoney:'You do not have enough money in your account. <span class="link" onclick="Util.navigate(\'paymentHistory\');">Deposit money</span>.',htmlCDiff:"Difficulty:",htmlCKw:"Domain Keywords:",htmlCLang:"Languages:",htmlCQuestionTypes:"Question types:",htmlCSC:"Single Choice",htmlCMC:"Multiple Choice",htmlCSo:"Sort",htmlCTe:"Text",htmlCNu:"Number",htmlCMap:"Map",htmlCAI:"Computer players:",htmlCPrv:"This is a private game, hide it from the public game list.",htmlCLobby:"Wait for other players before questions start",htmlCStart:"Start Game",htmlCCateg:"Choose Categories",htmlCTreeWait:"Creating domain tree, please wait...",htmlCGDidYouKnowHeader:"Did you know?",htmlCGDidYouKnowDescription:"<b>Creating new games is easy and free of charge.</b> However, you can play against a certain amount of money if you decide to do so. Use the <i>money cloud</i> to create such a game.",htmlCGTipHeader:"Tip: Customization",htmlCGTipDescription:"Before starting to play your new game, take the time to customize it. You can change anything from the title of the game to the types of questions that you and your friends will answer.",htmlLHC:"Create an account",htmlLUser:"Username:",htmlLEmail:"Email:",htmlLPass:"Password:",htmlLPass2:"Confirm password:",htmlLRem:"Remember Me",htmlLBtnCreate:"Sign Up",htmlLPP:"By clicking Sign Up, you're indicating that you have read and agree to the Terms of Use and Privacy Policy.",htmlLHL:"Login",htmlLUserL:"Username:",htmlLPassL:"Password:",htmlLRemL:"Remember Me",htmlLBtnLogin:"Login",htmlLForgot:"Forgot your password?",htmlLDidYouKnowHeader:"Creating an account is free of charge",htmlLDidYouKnowDescription:"Once you've created a new account, you're allowed to create paid games in which other users have to pay an entry fee set by you.",htmlLTipHeader:"Change your avatar",htmlLTipDescription:"After you login, go to <i>My Account</i> and change your avatar. You can upload your own picture, or choose one of the predefined avatars.",htmlFBalance:"Balance: ",htmlFDeposit:"Deposit money",htmlFBtnQuickJoin:"Quick game",htmlFBet:"Bet:",htmlFNoRecentRooms:"You haven't joined any room yet",htmlFBtnShowAll:"Show All",htmlFBtnRefresh:"Refresh",htmlFNoGame:"No game was found",htmlFDisjunction:"or",htmlFGDidYouKnowHeader:"Find an existing room",htmlFGDidYouKnowDescription:"Use the <em>Filter</em> field to search rooms that were created by other users. Click on the title of the room to start playing.",htmlGGTipHeader:"Create a custom room",htmlGGTipDescription:"If you feel that you can't find the perfect game, use the <em>Create a new room</em> tab to start your own game. As soon as the game begins, use the <em>Yahoo!</em> button to invite your friends.",htmlG20TipHeader:"8pm paid game",htmlG20TipDescription:"AnswerJoy sets up ...",htmlContactBody:'AnswerJoy is open to any inquiries or suggestions you may have; therefore, we thank you in advance for your help. Please allow 48 hours before receiving a response from us.<address>E-Mail: <a href="mailto:feedback@answerjoy.com">feedback@answerjoy.com</a><br/>Phone: +40 742 117996<br/>Place: Viilor Street, Number 27, Apartment 25, Cluj-Napoca, Cluj, Romania</address>Plus, you can send us any message using the feedback form located to the left of the window.',htmlCopyrightBody:'<h1> Pictures </h1><p>The pictures used for AnswerJoy\'s questions are taken from the <a href="http://commons.wikimedia.org">Wikimedia Commons</a> website. To better understand the licensing implications please visit the <a href="http://commons.wikimedia.org/wiki/Commons:Reusing_content_outside_Wikimedia">Wikimedia Commons\' Page</a> dedicated to this matter.</p> <h1>Icons</h1> <p>Some icons used on this web site are licensed by <a href="http://www.famfamfam.com/lab/icons/silk/">Mark James</a> under a <a href="http://creativecommons.org/licenses/by/2.5/">Creative Commons Attribution 2.5 License</a>.</p>',htmlRulesBody:"Rules here",htmlPPLastUpd:"Last updated: February 2009",htmlPPContent:'<p>AnswerJoy is committed to protecting your privacy. This privacy statement explains data collection and use practices of the  AnswerJoy site (the ?Site?). By accessing the Site, you are consenting to the information collection and use practices described in this privacy statement.</p><h2>Collecting Your Personal Information</h2><p>We will ask you when we need information that personally identifies you or allows us to contact you. To sign in to the Site, you will be asked to enter an e-mail address and password, which we refer to as your AnswerJoy credentials.</p><p>The Site may collect certain information about your visit, such as the name of the Internet service provider and the Internet Protocol (IP) address through which you access the Internet; the date and time you access the Site; the pages that you access while at the Site and the Internet address of the Web site from which you linked directly to our site. This information is used for the operation and improvement of the Site.</p><h2>Use of Your Personal Information</h2><p>The personal information collected on this Site will be used to operate the Site and to provide the service(s) you have requested or authorized. AnswerJoy may use personal information to provide you with more effective customer service, to improve the Site and any related AnswerJoy products or services, and to make the Site easier to use by eliminating the need for you to repeatedly enter the same information or by customizing the Site to your particular preference or interests. We may use your personal information to provide you with important information about the product or service that you are using, including critical updates and notifications. Additionally, with your permission, we may send you information about other AnswerJoy products and services, and/or share information with AnswerJoy partners so they may send you information about their products and services. AnswerJoy may disclose personal information if required to do so by law or in the good faith belief that such action is necessary to (a) conform to the edicts of the law or comply with legal process served on AnswerJoy or the Site; (b) protect and defend the rights or property of AnswerJoy and our family of Web sites; or (c) act in urgent circumstances to protect the personal safety of AnswerJoy employees or agents, users of AnswerJoy products or services, or members of the public. Personal information collected on the Site may be stored and processed in the European Union or any other country in which AnswerJoy or its affiliates, subsidiaries or agents maintain facilities, and by using the Site, you consent to any such transfer of information outside of your country. AnswerJoy abides by the safe harbor framework as set forth by the European Union regarding the collection, use, and retention of data.</p><h2>Control of Your Personal Information</h2><p>Except as otherwise described in this statement, personal information you provide on the Site will not be shared outside of AnswerJoy and its controlled subsidiaries and affiliates without your permission. Please be aware that this privacy statement and any choices you make on the Site will not necessarily apply to personal information you may have provided to AnswerJoy in the context of other, separately operated, AnswerJoy products or services.</p><h2>Access to Your Personal Information</h2><p>Customer information is collected by AnswerJoy. You can review and edit the personal information you provided at this Site by sending an e-mail to contact@AnswerJoy.com.</p><h2>Security of Your Personal Information</h2><p>AnswerJoy is committed to protecting the security of your personal information. We use a variety of security technologies and procedures to help protect your personal information from unauthorized access, use, or disclosure. For example, we store the personal information you provide on computer servers with limited access that are located in controlled facilities. Additionally, when we transmit sensitive personal information over the Internet, we protect it through the use of encryption, such as the Secure Socket Layer (SSL) protocol.</p><h2>Cookies</h2><p>We use cookies on this Site to ensure the integrity of the registration process and to personalize the Site. A cookie is a small text file that is placed on your hard disk by a Web page server. Cookies cannot be used to run programs or deliver viruses to your computer. Cookies are uniquely assigned to you, and can only be read by a Web server in the domain that issued the cookie to you. One of the primary purposes of cookies is to provide a convenience feature to save you time. For example, if you personalize a web page, or navigate within a site, a cookie helps the site to recall your specific information on subsequent visits. This simplifies the process of delivering relevant content, eases site navigation, and so on. When you return to the web site, the information you previously provided can be retrieved, so you can easily use the site\'s features that you customized. You have the ability to accept or decline cookies. Most web browsers automatically accept cookies, but you can usually modify your browser setting to decline cookies if you prefer. If you choose to decline cookies, you may not be able to fully experience the interactive features of this or other web sites you visit.</p><h2>Changes to This Privacy Statement</h2><p>We may occasionally update this privacy statement. When we do, we will also revise the "last updated" date at the top of the privacy statement. For material changes to this privacy statement, we will notify you either by placing a prominent notice on the home page of our web site or by directly sending you a notification. We encourage you to periodically review this privacy statement to stay informed about how we are helping to protect the personal information we collect. Your continued use of the service constitutes your agreement to this privacy statement and any updates.</p><h2>Contact Information</h2><p>AnswerJoy welcomes your comments regarding this privacy statement. If you have questions about this statement or believe that we have not adhered to it, please contact us by using our Web form at http://www.AnswerJoy.com/contact or via postal mail at the address provided below, and we will use commercially reasonable efforts to promptly determine and remedy the problem.</p>',htmlTermsOfUse:"<h2>Acceptance of Terms</h2> <p>The services that AnswerJoy provides to you are subject to the following Terms of Use (&quot;TOU&quot;). AnswerJoy reserves the right to update the TOU at any time without notice to you. The most current version of the TOU can be reviewed by clicking on the &quot;Terms of Use&quot; hypertext link located at the bottom of our Web pages.</p><h2>Personal and Non-Commercial Use Limitation</h2> <p>The AnswerJoy service is for your personal and non-commercial use. You may not modify, copy, distribute, transmit, display, perform, reproduce, publish, license, create derivative works from, transfer, or sell any information or services obtained from AnswerJoy.</p><h2>Notice Specific to Documents Available on This Web Site</h2><p>Permission to use Documents (such as white papers, press releases, datasheets and FAQs) from AnswerJoy is granted, provided that (1) the below copyright notice appears in all copies and that both the copyright notice and this permission notice appear, (2) use of such Documents from the AnswerJoy service is for informational and non-commercial or personal use only and will not be copied or posted on any network computer or broadcast in any media, and (3) no modifications of any Documents are made. Accredited educational institutions, such as K-12, universities, private/public colleges, and state community colleges, may download and reproduce the Documents for distribution in the classroom. Distribution outside the classroom requires express written permission. Use for any other purpose is expressly prohibited by law, and may result in severe civil and criminal penalties. Violators will be prosecuted to the maximum extent possible.</p><p>Documents specified above do not include the design or layout of the AnswerJoy.com Web site or any other AnswerJoy owned, operated, licensed or controlled site. Elements of AnswerJoy Web sites are protected by trade dress, trademark, unfair competition, and other laws and may not be copied or imitated in whole or in part. No logo, graphic, sound or image from any AnswerJoy Web site may be copied or retransmitted unless expressly permitted by AnswerJoy.</p><p>AnswerJoy AND/OR ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THE INFORMATION CONTAINED IN THE DOCUMENTS AND RELATED GRAPHICS PUBLISHED AS PART OF THE SERVICES FOR ANY PURPOSE. ALL SUCH DOCUMENTS AND RELATED GRAPHICS ARE PROVIDED &quot;AS IS&quot; WITHOUT WARRANTY OF ANY KIND. AnswerJoy AND/OR ITS RESPECTIVE SUPPLIERS HEREBY DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THIS INFORMATION, INCLUDING ALL WARRANTIES AND CONDITIONS OF MERCHANTABILITY, WHETHER EXPRESS, IMPLIED OR STATUTORY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL AnswerJoy AND/OR ITS RESPECTIVE SUPPLIERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF INFORMATION AVAILABLE FROM AnswerJoy.</p><p>THE DOCUMENTS AND RELATED GRAPHICS PUBLISHED ON AnswerJoy COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN. AnswerJoy AND/OR ITS RESPECTIVE SUPPLIERS MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED HEREIN AT ANY TIME.</p><h2>Notices Regarding Documents and Services Available on This Web Site</h2> <p>IN NO EVENT SHALL AnswerJoy AND/OR ITS RESPECTIVE SUPPLIERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF SOFTWARE, DOCUMENTS, PROVISION OF OR FAILURE TO PROVIDE SERVICES, OR INFORMATION AVAILABLE FROM THE SERVICES.</p> <h2>Member Account, Password, and Security</h2><p>If AnswerJoy requires you to open an account, you must complete the registration process by providing us with current, complete and accurate information as prompted by the applicable registration form. You also will choose a password and a user name. You are entirely responsible for maintaining the confidentiality of your password and account. Furthermore, you are entirely responsible for any and all activities that occur under your account. You agree to notify AnswerJoy immediately of any unauthorized use of your account or any other breach of security. AnswerJoy will not be liable for any loss that you may incur as a result of someone else using your password or account, either with or without your knowledge. However, you could be held liable for losses incurred by AnswerJoy or another party due to someone else using your account or password. You may not use anyone else&#39;s account at any time, without the permission of the account holder.</p><h2>No Unlawful or Prohibited Use</h2><p>As a condition of your use of AnswerJoy, you will not use AnswerJoy for any purpose that is unlawful or prohibited by these terms, conditions, and notices. You may not use AnswerJoy in any manner that could damage, disable, overburden, or impair any AnswerJoy server, or the network(s) connected to any AnswerJoy server, or interfere with any other party&#39;s use and enjoyment of AnswerJoy. You may not attempt to gain unauthorized access to AnswerJoy, other accounts, computer systems or networks connected to any AnswerJoy server, through hacking, password mining or any other means. You may not obtain or attempt to obtain any materials or information through any means not intentionally made available through AnswerJoy.</p><h2>Use of AnswerJoy Services</h2><p>The Services may contain e-mail services, bulletin board services, chat areas, news groups, forums, communities, personal web pages, calendars, photo albums, file cabinets and/or other message or communication facilities designed to enable you to communicate with others (each a &quot;Communication Service&quot; and collectively &quot;Communication Services&quot;). You agree to use the Communication Services only to post, send and receive messages and material that are proper and, when applicable, related to the particular Communication Service. By way of example, and not as a limitation, you agree that when using the Communication Services, you will not:</p><ul> <li>Use the Communication Services in connection with surveys, contests, pyramid schemes, chain letters, junk email, spamming or any duplicative or unsolicited messages (commercial or otherwise).</li><li>Defame, abuse, harass, stalk, threaten or otherwise violate the legal rights (such as rights of privacy and publicity) of others.</li><li>Publish, post, upload, distribute or disseminate any inappropriate, profane, defamatory, obscene, indecent or unlawful topic, name, material or information.</li><li>Upload, or otherwise make available, files that contain images, photographs, software or other material protected by intellectual property laws, including, by way of example, and not as limitation, copyright or trademark laws (or by rights of privacy or publicity) unless you own or control the rights thereto or have received all necessary consent to do the same.</li><li>Use any material or information, including images or photographs, which are made available through the Services in any manner that infringes any copyright, trademark, patent, trade secret, or other proprietary right of any party.</li><li>Upload files that contain viruses, Trojan horses, worms, time bombs, cancelbots, corrupted files, or any other similar software or programs that may damage the operation of another&#39;s computer or property of another.</li><li>Advertise or offer to sell or buy any goods or services for any business purpose, unless such Communication Services specifically allows such messages.</li><li>Download any file posted by another user of a Communication Service that you know, or reasonably should know, cannot be legally reproduced, displayed, performed, and/or distributed in such manner.</li><li>Falsify or delete any copyright management information, such as author attributions, legal or other proper notices or proprietary designations or labels of the origin or source of software or other material contained in a file that is uploaded.</li><li>Restrict or inhibit any other user from using and enjoying the Communication Services.</li><li>Violate any code of conduct or other guidelines which may be applicable for any particular Communication Service.</li><li>Harvest or otherwise collect information about others, including e-mail addresses.</li><li>Violate any applicable laws or regulations.</li><li>Create a false identity for the purpose of misleading others.</li><li>Use, download or otherwise copy, or provide (whether or not for a fee) to a person or entity any directory of users of the Services or other user or usage information or any portion thereof.</li> </ul><p>AnswerJoy has no obligation to monitor the Communication Services. However, AnswerJoy reserves the right to review materials posted to the Communication Services and to remove any materials in its sole discretion. AnswerJoy reserves the right to terminate your access to any or all of the Communication Services at any time, without notice, for any reason whatsoever.</p><p>AnswerJoy reserves the right at all times to disclose any information as AnswerJoy deems necessary to satisfy any applicable law, regulation, legal process or governmental request, or to edit, refuse to post or to remove any information or materials, in whole or in part, in AnswerJoy&#39;s sole discretion.</p><p>Always use caution when giving out any personally identifiable information about yourself or your children in any Communication Services. AnswerJoy does not control or endorse the content, messages or information found in any Communication Services and, therefore, AnswerJoy specifically disclaims any liability with regard to the Communication Services and any actions resulting from your participation in any Communication Services. Managers and hosts are not authorized AnswerJoy spokespersons, and their views do not necessarily reflect those of AnswerJoy.</p><p>Materials uploaded to the Communication Services may be subject to posted limitations on usage, reproduction and/or dissemination; you are responsible for adhering to such limitations if you download the materials.</p><h2>Materials Provided to AnswerJoy or Posted at Any AnswerJoy Web Site</h2><p>AnswerJoy does not claim ownership of the materials you provide to AnswerJoy (including feedback and suggestions) or post, upload, input or submit to any Services or its associated services for review by the general public, or by the members of any public or private community, (each a &quot;Submission&quot; and collectively &quot;Submissions&quot;). However, by posting, uploading, inputting, providing or submitting (&quot;Posting&quot;) your Submission you are granting AnswerJoy, its affiliated companies and necessary sublicensees permission to use your Submission in connection with the operation of their Internet businesses (including, without limitation, all AnswerJoy Services), including, without limitation, the license rights to: copy, distribute, transmit, publicly display, publicly perform, reproduce, edit, translate and reformat your Submission; to publish your name in connection with your Submission; and the right to sublicense such rights to any supplier of the Services.</p><p>No compensation will be paid with respect to the use of your Submission, as provided herein. AnswerJoy is under no obligation to post or use any Submission you may provide and AnswerJoy may remove any Submission at any time in its sole discretion.</p><p>By Posting a Submission you warrant and represent that you own or otherwise control all of the rights to your Submission as described in these Terms of Use including, without limitation, all the rights necessary for you to provide, post, upload, input or submit the Submissions.</p><p>In addition to the warranty and representation set forth above, by Posting a Submission that contain images, photographs, pictures or that are otherwise graphical in whole or in part (&quot;Images&quot;), you warrant and represent that (a) you are the copyright owner of such Images, or that the copyright owner of such Images has granted you permission to use such Images or any content and/or images contained in such Images consistent with the manner and purpose of your use and as otherwise permitted by these Terms of Use and the Services, (b) you have the rights necessary to grant the licenses and sublicenses described in these Terms of Use, and (c) that each person depicted in such Images, if any, has provided consent to the use of the Images as set forth in these Terms of Use, including, by way of example, and not as a limitation, the distribution, public display and reproduction of such Images. By Posting Images, you are granting (a) to all members of your private community (for each such Images available to members of such private community), and/or (b) to the general public (for each such Images available anywhere on the Services, other than a private community), permission to use your Images in connection with the use, as permitted by these Terms of Use, of any of the Services, (including, by way of example, and not as a limitation, making prints and gift items which include such Images), and including, without limitation, a non-exclusive, world-wide, royalty-free license to: copy, distribute, transmit, publicly display, publicly perform, reproduce, edit, translate and reformat your Images without having your name attached to such Images, and the right to sublicense such rights to any supplier of the Services. The licenses granted in the preceding sentences for a Images will terminate at the time you completely remove such Images from the Services, provided that, such termination shall not affect any licenses granted in connection with such Images prior to the time you completely remove such Images. No compensation will be paid with respect to the use of your Images.</p><h2>Links to Third Party Sites</h2><p>THE LINKS IN THIS AREA WILL LET YOU LEAVE AnswerJoy&#39;S SITE. THE LINKED SITES ARE NOT UNDER THE CONTROL OF AnswerJoy AND AnswerJoy IS NOT RESPONSIBLE FOR THE CONTENTS OF ANY LINKED SITE OR ANY LINK CONTAINED IN A LINKED SITE, OR ANY CHANGES OR UPDATES TO SUCH SITES. AnswerJoy IS NOT RESPONSIBLE FOR WEBCASTING OR ANY OTHER FORM OF TRANSMISSION RECEIVED FROM ANY LINKED SITE. AnswerJoy IS PROVIDING THESE LINKS TO YOU ONLY AS A CONVENIENCE, AND THE INCLUSION OF ANY LINK DOES NOT IMPLY ENDORSEMENT BY AnswerJoy OF THE SITE.</p>",htmlTips:"Tips and Tricks",htmlTipsBody:'<h2>Keyboard shortcuts</h2> <p><ul><li>You can use <b>Alt+C</b> anywhere in AnswerJoy to jump to the chat. Press Alt+C again to return to where you were.</li><li>You can answer button questions faster using the numbers on your keyboard or numpad (1-4). The faster you answer, the more points you get (assuming a correct answer).</li></ul></p> <h2>Chat commands</h2> <p>Chat commands are commands you can enter in the chat to do stuff. <ul><li><code>/number</code> will answer the current question if it is a sigle choice, multiple choice, sort or number question. For questions with multiple choices or sort questions, the digits represent the answer (in that order). E.g. /312 means "answer in the order: third, first and second".</li><li><code>/me</code> works like in IRC</li><li><code>/show <i>window</i></code> will display that window. E.g. <code>/show qreview</code> will show question review</li><li><code>/n <i>nickname</i></code> changes your nickname if you are a guest</li></ul></p> <h2>Social stuff</h2> <p><ul><li>You can copy the addess in your browser\'s location bar and give it to a friend. The special address will bring him or her in the same game where you are.</li><li>You can also add a bookmark in your browser and whenever you use the bookmark you will be returned to the same room.</li></ul></p>',htmlCSDidYouKnowHeader:"Did you know?",htmlCSDidYouKnowDescription:"<b>AnswerJoy will launch payed games very soon?</b> Please use the registration form to create an account, and you'll be the first to know when we'll launch games where you can play against a certain amount of money.",htmlCSTipHeader:"Tip: Play a game for fun",htmlCSTipDescription:"Invite your friends and play a game for fun. These games allow you to get used to the interface and game play, while increasing your chances of winning <i>payed games</i> once these are launched."},inline:{iFacebookMessage:"Wanna play AnswerJoy? %s",iSocial:"feeds/feed.en.html",inlineMetaDescription:"AnswerJoy (The online knowledge game) is the place where you compete against your friends for fun or for a certain amount of money, by answering questions from various domains.",inlineMetaKeywords:"AnswerJoy, game, online, trivia, knowledge, questions, answers, answer, friends, money, mathematics, science, society, technology, geography, biography, history, arts",inlineBackToHome:"Home",inlineFeedFrameUrl:"feed-en.html",inlineYahooHrefMsg:"Play with me on AnswerJoy.com: http://AnswerJoy.com/",inlineTitleSiteMap:"Site Map",inlineTitleToU:"Terms of Use",inlineTitleSettings:"Settings",inlineTitleResetPass:"Reset Password",inlineTitleReview:"Review Questions",inlineTitlePP:"Privacy Policy",inlineTitlePlay:"Play",inlineTitleHome:"Home",inlineTitlePeople:"People",inlineTitleMore:"More...",inlineTitleHelp:"Help",inlineTitleAbout:"About us",inlineTitleContact:"Contact Us",inlineTitleCopyright:"Copyright",inlineTitleRules:"Rules",inlineTitleBrowser:"Please use a different browser",inlineTitlePromo:"Prizes",inlineTitleLogin:"Sign Up or Login",inlineTitleFindAndCreateGame:"Find or Create a Game",inlineTitleTips:"Tips and Tricks",inlineTitleStars:"Stars",inlineTitleComingSoon:"Coming Soon...",inlineTitleDepositSuccess:"Deposit Success",inlineTitleReferred:"%s wants you to join AnswerJoy!",inlineEnterFBTooltip:"Enter Feedback",inlineEnterFBTooltip2:"Enter Feedback",inlineNewNick:"New nick",inlineChNickHint:"New nick (3-9 characters)",inlineIToggleSound:"Toggle sound",inlineLUser:"Username",inlineLUserHint:"Username (4-12 characters)",inlineLEmail:"Email",inlineLPass:"Password",inlineLPassHint:"Password (8 or more characters)",inlineLPass2:"Password (repeat)",inlineLLUser:"Username",inlineLLPass:"Password",inlineSEnableAnimTooltip:"When unchecked, all animations are disabled.",inlineSEnableBigAnimTooltip:"When unchecked, big animations are disabled (e.g. page change, TabFolder change, etc).",inlineSOldPass:"Old password",inlineSNewPass:"New password",inlineSNewPass2:"New password (repeat)",inlineSEmail:"Email",inlineSFirstName:"First name",inlineSSurName:"Surname",inlineSSex:"0:Unspecified,1:Male,2:Female",inlineSBirthDate:"Date of birth",inlineSCountry:"Country",inlineSState:"State",inlineSProfile:"Profile",inlineSBalance:"Balance",inlineRPUser:"Username",inlineRPEmail:"Email",inlineRPCode:"Confirmation code",inlineQPage0:"You can...",inlineQPage1:"Add New Question",inlineQPage2:"View Questions",inlineQImgPrvw:"Preview",inlineQDiffVal:"1:Easy,2:Medium,3:Hard",inlineQDiffTitles:"Piece of Cake:Bring It On!:Damn I'm Good",inlineQTypeVal:"sa:Single Answer,ma:Multiple Answers,so:Sort,te:Text,nr:Number,mp:Map",inlineQQuestion:"Question",inlineQInfo:"URL for more information",inlineQImageURL:"Image URL",inlineQExpl:"Explanation for answer",inlineQSCRA:"Right answers",inlineQSCWA:"Wrong answers",inlineQMCRA:"Right answers",inlineQMCWA:"Wrong answers",inlineQSortA:"Items to sort",inlineQTextA:"Answer",inlineQNrA:"Answer",inlineQNrP:"Proximity",inlinePEnterAns:"Enter Answer",inlinePGiveUpDesc:"This gives a few points, but it's better than a wrong answer which gives no points.",inlinePCMsg:"Enter Message",inlinePCSend:"Sends the message to everyone.",inlinePCClear:"Empties your chat history to free up memory.",inlinePCLog:"Opens a new window containing your full chat log.",inlineJCFindGame:"Find a room",inlineJCCreateGame:"Create a new room",inlineFBrowse:"Browse Rooms",inlineFRecent:"Recent Rooms",inlineFSearch:"Search Rooms",inlineFFilter:"Filter",inlineCTitle:"Room Name",inlineCDiffVal:"1:Easy,2:Medium,3:Hard",inlineCDiffTitle:"Piece of Cake:Bring It On!:Damn I'm Good",inlineCTagAll:"all",inlineCSC:"Single Choice",inlineCMC:"Multiple Choice",inlineCAI:"0:None,1:1 AI,2:2 AIs,3:3 AIs",inlineCUnlimited:"Unlimited"}};Strings=LStrings.en.js;curLang="en";var fullDomains=[{label:"Culture",tag:"culture",subcat:[{label:"Arts",tag:"art",subcat:[{label:"Architecture",tag:"architecture"},{label:"Crafts",tag:"crafts"},{label:"Dance",tag:"dance"},{label:"Literature",tag:"literature",subcat:[{label:"By cultural movement",tag:"literature",subcat:[{label:"Luminism (Impressionism)",tag:"impressionist literature"},{label:"Modernism",tag:"modernist literature",subcat:[{label:"Charles Dickens",ref:"dickens"},{label:"Romanticism",tag:"romanticism literature",subcat:[{label:"Edgar Allan Poe",tag:"poe"}]},{label:"Surrealism",tag:"surrealism literature"},{label:"T. S. Elliot",ref:"elliot"}]},{label:"Realism",tag:"realist literature",subcat:[{label:"Leo Tolstoi",ref:"tolstoi"}]},{label:"Renaissance",tag:"renaissance literature",subcat:[{label:"Shakespeare",tag:"shakespeare literature"}]}]},{label:"By nationality",tag:"literature people",subcat:[{label:"American",tag:"american literature",subcat:[{label:"Edgar Allan Poe",ref:"poe"}]},{label:"British",tag:"british literature",subcat:[{label:"Charles Dickens",ref:"dickens"},{label:"Shakespeare",ref:"shakespeare literature"}]}]}]},{label:"Movies",tag:"movies",subcat:[{label:"By director",tag:"movies",subcat:[{label:"Stanley Kubrick",tag:"stanley kubrick",subcat:[{label:"Dr. Strangelove",tag:"dr strangelove",tooltip:"Dr. Strangelove or How I Learned To Stop Worrying and Love The Bomb"},{label:"Full Metal Jacket",tag:"full metal jacket"},{label:"The Shining",tag:"the shining"}]}]},{label:"By cultural movement",tag:"movies",subcat:[{label:"Realism",tag:"realist movies"},{label:"Surrealism",tag:"surrealism movies"}]},{label:"By genre",tag:"movies",subcat:[{label:"Action",tag:"action movies",subcat:[{label:"Bourne series",tag:"bourne"},{label:"James Bond franchise",tag:"bond"}]},{label:"Adventure",tag:"adventure movies",subcat:[{label:"Indiana Jones series",tag:"indiana jones"},{label:"The Mummy series",tag:"the mummy"}]},{label:"Animation and Cartoons",tag:"animation movies",subcat:[{label:"Bugs Bunny series",tag:"bugs bunny"},{label:"Final Fantasy series",tag:"final fantasy"},{label:"Futurama series",tag:"futurama"},{label:"Ice Age series",tag:"ice age"},{label:"Looney Tunes series",tag:"looney tunes"},{label:"South Park series",tag:"south park"},{label:"The Simpsons series",tag:"simpsons"},{label:"Tom &amp; Jerry series",tag:"tom & jerry"}]},{label:"Comedy",tag:"comedy movies"},{label:"Crime",tag:"crime movies"},{label:"Drama",tag:"drama movies"},{label:"Historical",tag:"history movies"},{label:"Horror",tag:"horror movies"},{label:"Musical",tag:"musical movies"},{label:"Science Fiction",tag:"sf movies",subcat:[{label:"Firefly series",tag:"firefly movie"}]},{label:"War",tag:"war movies"},{label:"Western",tag:"western movies"}]}]},{label:"Music",tag:"music",subcat:[{label:"'70s",tag:"'70s music"},{label:"'80s",tag:"'80s music"},{label:"'90s",tag:"'90s music"},{label:"Ballads",tag:"ballad",subcat:[{label:"Rock Ballads",ref:"rock ballads"}]},{label:"Blues",tag:"blues"},{label:"Classical",tag:"classical",subcat:[{label:"Luminism (Impressionism)",tag:"impressionist music"},{label:"Renaissance",tag:"renaissance music"},{label:"Romanticism",tag:"romanticism music"}]},{label:"Jazz",tag:"jazz"},{label:"Pop",tag:"pop"},{label:"Rock",tag:"rock",subcat:[{label:"Ballads",tag:"rock ballads"},{label:"Hard Rock, Heavy Metal",tag:"heavy metal",subcat:[{label:"AC/DC",tag:"acdc"},{label:"Alice Cooper",tag:"alice cooper"},{label:"Black Sabbath",tag:"black sabbath"},{label:"Godsmack",tag:"godsmack"},{label:"Guns N' Roses",tag:"guns n' roses"},{label:"Judas Priest",tag:"judas priest"},{label:"Motörhead",tag:"motorhead"},{label:"Ozzy Osbourne",tag:"ozzy"},{label:"Skid Row",tag:"skid row",hide:true},{label:"Twisted Sister",tag:"twisted sister"}]},{label:"NWOBHM",tag:"nwobhm",tooltip:"New Wave of British Heavy Metal"},{label:"Oldies",tag:"rock oldies"},{label:"Soft Rock",tag:"soft rock",subcat:[{label:"Aerosmith",tag:"aerosmith"},{label:"Bryan Adams",tag:"bryan adams"},{label:"Deep Purple",tag:"deep purple",hide:true},{label:"Led Zeppelin",tag:"led zeppelin"},{label:"Lita Ford",tag:"Lita Ford"},{label:"Liz Phair",tag:"liz phair"},{label:"Mötley Crüe",tag:"motley crue"},{label:"Oasis",tag:"oasis"},{label:"Sheryl Crow",tag:"sheryl crow"},{label:"The Red Hot Chili Peppers",tag:"rhcp"},{label:"The Rolling Stones",tag:"rolling stones"},{label:"The Scorpions",tag:"scorpions"},{label:"U2",tag:"u2"}]},{label:"Thrash",tag:"thrash"}]}]},{label:"Painting",tag:"painting",subcat:[{label:"Cubism",tag:"cubism painting",subcat:[{label:"Cubism",tag:"cubist painting",subcat:[{label:"Pablo Picasso",tag:"picasso painting"}]}]},{label:"Expressionism",tag:"expressionism painting"},{label:"Hyperrealism",tag:"hyperrealism"},{label:"Luminism (Impressionism)",tag:"impressionist painting"},{label:"Post Impressionism",ref:"post impressionism"},{label:"Photorealism",tag:"photorealism"},{label:"Realism",tag:"realist painting"},{label:"Renaissance",tag:"renaissance painting",subcat:[{label:"Leonardo da Vinci",tag:"da vinci painting"},{label:"Pablo Picasso",tag:"picasso sculpture"}]},{label:"Romanticism",tag:"romanticism painting"},{label:"Surrealism",tag:"surrealism painting"}]},{label:"Sculpture",tag:"sculpture",subcat:[{label:"Leonardo da Vinci",tag:"da vinci sculpture"}]},{label:"Theatre",tag:"theatre",subcat:[{label:"Realism",tag:"realist theatre"}]}]},{label:"Entertainment",tag:"entertainment",subcat:[{label:"Games",tag:"entertainment games",subcat:[{label:"Duke Nukem series",tag:"duke nukem"}]},{label:"Magic (illusion)",tag:"magic"},{label:"Sports",tag:"sports"},{label:"Tourism",tag:"tourism"}]},{label:"Food",tag:"food",subcat:[{label:"American",tag:"american cuisine"},{label:"Asian",tag:"asian cuisine"},{label:"European",tag:"european cuisine",subcat:[{label:"French",tag:"french cuisine"},{label:"Italian",tag:"italian cuisine"}]}]},{label:"Languages",tag:"language"},{label:"Money",tag:"numismatics"},{label:"Movements",tag:"cultural movements",subcat:[{label:"Baroque",tag:"baroque"},{label:"Contemporary Art",tag:"contemporary art",subcat:[{label:"Hyperrealism",ref:"hyperrealism"},{label:"Photorealism",ref:"photorealism"}]},{label:"Expressionism",tag:"expressionism",subcat:[{label:"Painting",ref:"expressionism painting"}]},{label:"Luminism (Impressionism)",tag:"impressionism",subcat:[{label:"Literature",ref:"impressionist literature"},{label:"Music",ref:"impressionist music"},{label:"Painting",ref:"impressionist painting"}]},{label:"Modernism",tag:"modernism",subcat:[{label:"People",tag:"modernist people",subcat:[{label:"Charles Dickens",ref:"dickens"},{label:"T. S. Elliot",ref:"elliot"}]},{label:"Bauhaus",tag:"bauhaus"},{label:"Cubism",tag:"cubism",subcat:[{label:"People",tag:"cubist people",subcat:[{label:"Picasso",ref:"picasso"}]},{label:"Painting",ref:"cubist painting"}]},{label:"Imagism",tag:"imagism"},{label:"Leninism",tag:"leninism"},{label:"Surrealism",tag:"surrealism",subcat:[{label:"Automatic drawing",tag:"automatic drawing"},{label:"Literature",ref:"surrealism literature"},{label:"Film",ref:"surrealism movies"},{label:"Painting",ref:"surrealism painting"}]}]},{label:"Post Impressionism",tag:"post impressionism",subcat:[{label:"Vincent van Gogh",ref:"van gogh"}]},{label:"Realism",tag:"realism",subcat:[{label:"Cinema",ref:"realist movies"},{label:"Literature",ref:"realist literature",subcat:[{label:"Leo Tolstoi",ref:"tolstoi"}]},{label:"Painting",ref:"realist painting"},{label:"Theatre",ref:"realist theatre"}]},{label:"Renaissance",tag:"renaissance",subcat:[{label:"Music",ref:"renaissance music"},{label:"Literature",ref:"renaissance literature"},{label:"Painting",ref:"renaissance painting"},{label:"People",tag:"renaissance people",subcat:[{label:"Leonardo da Vinci",ref:"da vinci"},{label:"William Shakespeare",ref:"shakespeare"}]}]},{label:"Romanticism",tag:"romanticism",subcat:[{label:"Literature",ref:"romanticism literature"},{label:"Music",ref:"romanticism music"},{label:"Painting",ref:"romanticism painting"}]}]},{label:"Mythology",tag:"mythology",subcat:[{label:"Egyptian",tag:"egyptian mythology"},{label:"Greek",tag:"greek mythology"},{label:"Norse",tag:"norse mythology"},{label:"Roman",tag:"roman mythology"}]},{label:"People",tag:"culture people",subcat:[{label:"Charles Dickens",tag:"dickens"},{label:"Edgar Allan Poe",ref:"poe"},{label:"Leo Tolstoi",tag:"tolstoi",tooltip:"Count Lev Nikolayevich Tolstoy"},{label:"Leonardo da Vinci",tag:"da vinci",tooltip:"Leonardo di ser Piero da Vinci",subcat:[{label:"Painting",ref:"da vinci painting"},{label:"Sculpture",ref:"da vinci sculpture"}]},{label:"Pablo Picasso",tag:"picasso",subcat:[{label:"Painting",tag:"picasso painting"},{label:"Sculpture",tag:"picasso sculpture"}]},{label:"Stanley Kubrick",ref:"stanley kubrick"},{label:"T. S. Elliot",tag:"elliot",tooltip:"Thomas Stearns Eliot"},{label:"Vincent van Gogh",tag:"van gogh",tooltip:"Vincent Willem van Gogh"},{label:"William Shakespeare",tag:"shakespeare",subcat:[{label:"Literature",ref:"shakespeare literature"}]}]},{label:"Philosoply",tag:"philosophy"}]},{label:"History",tag:"history",subcat:[{label:"African",tag:"african history"},{label:"Ancient history",tag:"ancient history",subcat:[{label:"Ancient China",tag:"ancient china"},{label:"Ancient Greece",tag:"ancient greece"},{label:"Ancient Rome",tag:"ancient rome"}]},{label:"American",tag:"american history"},{label:"Asian",tag:"asian history"},{label:"European",tag:"european history"}]},{label:"Mathematics",tag:"mathematics"},{label:"People",tag:"people",subcat:[{label:"In culture",ref:"culture people"},{label:"In science",ref:"science people"}]},{label:"Science and Technology",tag:"science",subcat:[{label:"Astronomy",tag:"astronomy"},{label:"Biology",tag:"biology"},{label:"Chemistry",tag:"chemistry",subcat:[{label:"People",tag:"chemistry people",subcat:[{label:"Alfred Nobel",tag:"nobel"},{label:"Marie Curie",ref:"marie curie"}]},{label:"Explosives",tag:"explosives"},{label:"Extreme",tag:"extreme chemistry",tooltip:"Beyond standard conditions"},{label:"General",tag:"general chemistry"},{label:"Organic",tag:"organic chemistry"}]},{label:"Electronics",tag:"electronics",subcat:[{label:"Components",tag:"electronics components",subcat:[{label:"Antenna",tag:"antenna"},{label:"Capacitor",tag:"capacitor"},{label:"LCD",tag:"lcd",tooltip:"Liquid Crystal Display"},{label:"PCB",tag:"pcb",tooltip:"Printed Circuit Board"},{label:"Transformer",tag:"transformer",tooltip:"transformer"},{label:"Transistor",tag:"transistor"}]},{label:"Fields",tag:"electronics fields",subcat:[{label:"Avionics",tag:"avionics"},{label:"Molecular electronics",tag:"molecular electronics"},{label:"Nanoelectronics",tag:"nanoelectronics"},{label:"Optoelectronics",tag:"optoelectronics"},{label:"Organic electronics",tag:"organic electronics"},{label:"Quantum electronics",tag:"quantum electronics"},{label:"Semiconductors",tag:"semiconductors"},{label:"Spintronics",tag:"spintronics"}]},{label:"Products",tag:"electronics products"},{label:"Theory",tag:"electronics theory"}]},{label:"Geography",tag:"geography"},{label:"Information Technology",tag:"it",subcat:[{label:"CPU Architectures",tag:"cpu arch",subcat:[{label:"x86/x64",tag:"x86"},{label:"SPARC",tag:"sparc"}]},{label:"Games",tag:"it games"},{label:"Hacking",tag:"hacking",subcat:[{label:"x86",tag:"x86 hacking"}]},{label:"Networking",tag:"it networking"},{label:"People",tag:"it people",subcat:[{label:"John Carmack",tag:"john carmack",tooltip:"John D. Carmack II"}]},{label:"Security",tag:"it security"}]},{label:"Medicine",tag:"medicine"},{label:"People",tag:"science people",subcat:[{label:"In chemistry",ref:"chemistry people"},{label:"In information technology",ref:"it people"},{label:"In physics",ref:"physics people"}]},{label:"Physics",tag:"physics",subcat:[{label:"People",tag:"physics people",subcat:[{label:"Albert Einstein",tag:"einstein"},{label:"Marie Curie",tag:"marie curie",tooltip:"Marie Sk&#x142;odowska–Curie "}]},{label:"Fluid dynamics",tag:"fluid dynamics"},{label:"Material Ph.",tag:"material physics"},{label:"Newtonian",tag:"newtonian physics"},{label:"Relativity",tag:"relativity"},{label:"Particle Physics",tag:"particle physics",subcat:[{label:"Quantum Theory",tag:"quantum"}]}]}]}];var simpleDomains=[{label:"Culture",tag:"culture",qimg:"qimg/defaults/arts.en.jpg",image:"images/categs/arts.jpg"},{label:"Geography",tag:"geography",qimg:"qimg/defaults/geography.en.jpg",image:"images/categs/geography.jpg"},{label:"History",tag:"history",qimg:"qimg/defaults/history.en.jpg",image:"images/categs/history.jpg"},{label:"Mathematics",tag:"mathematics",qimg:"qimg/defaults/mathematics.en.jpg",image:"images/categs/mathematics.jpg"},{label:"Medicine",tag:"medicine"},{label:"People",tag:"people",qimg:"qimg/defaults/biography.en.jpg",image:"images/categs/biography.jpg"},{label:"Science and Technology",tag:"science",qimg:"qimg/defaults/mathematics.en.jpg",image:"images/categs/mathematics.jpg"}];var setCookie=function(c,d,e){if(d===null){return deleteCookie(c)}if(e!=="session"){if(!e){e=1000*60*60*24*61}var b=new Date();b.setTime(b.getTime()+(e*1000));var a="; expires="+b.toGMTString()}else{var a=""}document.cookie=c+"="+d+a+"; path=/"};var getCookie=function(b){b=b+"=";var a=document.cookie.split(";");for(var d=0;d<a.length;d++){var e=a[d].replace(/^\s+/,"");if(e.indexOf(b)==0){return e.substring(b.length,e.length)}}return null};var deleteCookie=function(a){setCookie(a,"",-1)};var pageTracker;var languages={names:["English","Fran&ccedil;ais","Rom&acirc;n&#259;","Deutch"],codes:["en","fr","ro","de"],ids:[0,1,2,3,4]};var currencies=[{name:"EUR",sign:"\u20ac",singular:"euro",plural:"euros"},{name:"USD",sign:"$",singular:"dollar",plural:"dollars"},{name:"RON",sign:null,singular:"leu",plural:"lei"},{name:"GBP",sign:"Â£",singular:"pound",plural:"pounds"}];var countries=[["","Unkown"],["AF","Afghanistan"],["AX","Aland Islands ï»¿"],["AL","Albania"],["DZ","Algeria"],["AS","American Samoa"],["AD","Andorra"],["AO","Angola"],["AI","Anguilla"],["AQ","Antarctica"],["AG","Antigua and Barbuda"],["AR","Argentina"],["AM","Armenia"],["AW","Aruba"],["AU","Australia"],["AT","Austria"],["AZ","Azerbaijan"],["BS","Bahamas"],["BH","Bahrain"],["BD","Bangladesh"],["BB","Barbados"],["BY","Belarus"],["BE","Belgium"],["BZ","Belize"],["BJ","Benin"],["BM","Bermuda"],["BT","Bhutan"],["BO","Bolivia, Plurinational State of"],["BA","Bosnia and Herzegovina"],["BW","Botswana"],["BV","Bouvet Island"],["BR","Brazil"],["IO","British Indian Ocean Territory"],["BN","Brunei Darussalam"],["BG","Bulgaria"],["BF","Burkina Faso"],["BI","Burundi"],["KH","Cambodia"],["CM","Cameroon"],["CA","Canada"],["CV","Cape Verde"],["KY","Cayman Islands"],["CF","Central African Republic"],["TD","Chad"],["CL","Chile"],["CN","China"],["CX","Christmas Island"],["CC","Cocos (Keeling) Islands"],["CO","Colombia"],["KM","Comoros"],["CG","Congo"],["CD","Congo, the Democratic Republic of the"],["CK","Cook Islands"],["CR","Costa Rica"],["CI","Cote d'Ivoire ï»¿"],["HR","Croatia"],["CU","Cuba"],["CY","Cyprus"],["CZ","Czech Republic"],["DK","Denmark"],["DJ","Djibouti"],["DM","Dominica"],["DO","Dominican Republic"],["EC","Ecuador"],["EG","Egypt"],["SV","El Salvador"],["GQ","Equatorial Guinea"],["ER","Eritrea"],["EE","Estonia"],["ET","Ethiopia"],["FK","Falkland Islands (Malvinas)"],["FO","Faroe Islands"],["FJ","Fiji"],["FI","Finland"],["FR","France"],["GF","French Guiana"],["PF","French Polynesia"],["TF","French Southern Territories"],["GA","Gabon"],["GM","Gambia"],["GE","Georgia"],["DE","Germany"],["GH","Ghana"],["GI","Gibraltar"],["GR","Greece"],["GL","Greenland"],["GD","Grenada"],["GP","Guadeloupe"],["GU","Guam"],["GT","Guatemala"],["GG","Guernsey"],["GN","Guinea"],["GW","Guinea-Bissau"],["GY","Guyana"],["HT","Haiti"],["HM","Heard Island and McDonald Islands"],["VA","Holy See (Vatican City State)"],["HN","Honduras"],["HK","Hong Kong"],["HU","Hungary"],["IS","Iceland"],["IN","India"],["ID","Indonesia"],["IR","Iran, Islamic Republic of"],["IQ","Iraq"],["IE","Ireland"],["IM","Isle of Man"],["IL","Israel"],["IT","Italy"],["JM","Jamaica"],["JP","Japan"],["JE","Jersey"],["JO","Jordan"],["KZ","Kazakhstan"],["KE","Kenya"],["KI","Kiribati"],["KP","Korea, Democratic People's Republic of"],["KR","Korea, Republic of"],["KW","Kuwait"],["KG","Kyrgyzstan"],["LA","Lao People's Democratic Republic"],["LV","Latvia"],["LB","Lebanon"],["LS","Lesotho"],["LR","Liberia"],["LY","Libyan Arab Jamahiriya"],["LI","Liechtenstein"],["LT","Lithuania"],["LU","Luxembourg"],["MO","Macao"],["MK","Macedonia, the former Yugoslav Republic of"],["MG","Madagascar"],["MW","Malawi"],["MY","Malaysia"],["MV","Maldives"],["ML","Mali"],["MT","Malta"],["MH","Marshall Islands"],["MQ","Martinique"],["MR","Mauritania"],["MU","Mauritius"],["YT","Mayotte"],["MX","Mexico"],["FM","Micronesia, Federated States of"],["MD","Moldova, Republic of"],["MC","Monaco"],["MN","Mongolia"],["ME","Montenegro"],["MS","Montserrat"],["MA","Morocco"],["MZ","Mozambique"],["MM","Myanmar"],["NA","Namibia"],["NR","Nauru"],["NP","Nepal"],["NL","Netherlands"],["AN","Netherlands Antilles"],["NC","New Caledonia"],["NZ","New Zealand"],["NI","Nicaragua"],["NE","Niger"],["NG","Nigeria"],["NU","Niue"],["NF","Norfolk Island"],["MP","Northern Mariana Islands"],["NO","Norway"],["OM","Oman"],["PK","Pakistan"],["PW","Palau"],["PS","Palestinian Territory, Occupied"],["PA","Panama"],["PG","Papua New Guinea"],["PY","Paraguay"],["PE","Peru"],["PH","Philippines"],["PN","Pitcairn"],["PL","Poland"],["PT","Portugal"],["PR","Puerto Rico"],["QA","Qatar"],["RE","Reunion ï»¿"],["RO","Romania"],["RU","Russian Federation"],["RW","Rwanda"],["BL","Saint BarthÃ©lemy"],["SH","Saint Helena"],["KN","Saint Kitts and Nevis"],["LC","Saint Lucia"],["MF","Saint Martin (French part)"],["PM","Saint Pierre and Miquelon"],["VC","Saint Vincent and the Grenadines"],["WS","Samoa"],["SM","San Marino"],["ST","Sao Tome and Principe"],["SA","Saudi Arabia"],["SN","Senegal"],["RS","Serbia"],["SC","Seychelles"],["SL","Sierra Leone"],["SG","Singapore"],["SK","Slovakia"],["SI","Slovenia"],["SB","Solomon Islands"],["SO","Somalia"],["ZA","South Africa"],["GS","South Georgia and the South Sandwich Islands"],["ES","Spain"],["LK","Sri Lanka"],["SD","Sudan"],["SR","Suriname"],["SJ","Svalbard and Jan Mayen"],["SZ","Swaziland"],["SE","Sweden"],["CH","Switzerland"],["SY","Syrian Arab Republic"],["TW","Taiwan, Province of China"],["TJ","Tajikistan"],["TZ","Tanzania, United Republic of"],["TH","Thailand"],["TL","Timor-Leste"],["TG","Togo"],["TK","Tokelau"],["TO","Tonga"],["TT","Trinidad and Tobago"],["TN","Tunisia"],["TR","Turkey"],["TM","Turkmenistan"],["TC","Turks and Caicos Islands"],["TV","Tuvalu"],["UG","Uganda"],["UA","Ukraine"],["AE","United Arab Emirates"],["GB","United Kingdom"],["US","United States"],["UM","United States Minor Outlying Islands"],["UY","Uruguay"],["UZ","Uzbekistan"],["VU","Vanuatu"],["VE","Venezuela, Bolivarian Republic of"],["VN","Viet Nam"],["VG","Virgin Islands, British"],["VI","Virgin Islands, U.S."],["WF","Wallis and Futuna"],["EH","Western Sahara"],["YE","Yemen"],["ZM","Zambia"],["ZW","Zimbabwe"]];var states={US:["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"]};(function(){for(var a=0;a<currencies.length;a++){currencies[currencies[a].name]=currencies[a];currencies[a].currencyIndex=a}}());var constants={release:true,appName:"AnswerJoy",appDomain:"AnswerJoy.com",googleAnalytics:"UA-7701302-1",firstWindow:"home",defaultCurrency:"EUR",defaultRoom:Strings.globalTag,countryPickerId:"userInfoCountry",filterQuestionsDefaultCount:20,hideLangPickerAfterAdd:false,keySensitivity:400,lockedCountry:"",menuHideDelay:400,minimumDelayBeforeFadingOutUserAnswers:5000,statePickerId:"userInfoState",userAccountSettingsPage:0,avatarPath:"avatars/",avatars:{ai:"defaults/ai.jpg",guest:"defaults/guest.jpg",none:"defaults/none.jpg",extra:["defaults/1.jpg","defaults/2.jpg","defaults/3.jpg","defaults/4.jpg","defaults/5.jpg","defaults/6.jpg","defaults/7.jpg","defaults/8.jpg","defaults/none.jpg"]},sounds:{rightAnswer:{src:"audio/registerscan.mp3",length:2000},wrongAnswer:{src:"audio/punch2.mp3",length:1000},dontKnow:{src:"audio/punch2.mp3",length:1000},noAnswer:{src:"audio/punch2.mp3",length:1000},click:{src:"bang_1.wav",length:1000},applications:{Iluminatus:{wrongAnswer:{src:"audio/iluminatus/em1brokeglass.mp3",length:2000},dontKnow:null,noAnswer:{src:"audio/iluminatus/em1brokeglass.mp3",length:2000},rightAnswer:{src:"audio/iluminatus/sound_castigator_intrebare.mp3",length:2000},matchWon:{src:"audio/iluminatus/winner.mp3",length:7000},click:{src:"audio/iluminatus/sound_click_butoane.mp3",length:1000},hover:{src:"audio/iluminatus/sound_hoover_butoane.mp3",length:1000},welcome:{src:"audio/iluminatus/soundtrack_iluminatus.mp3",length:18000}}}},maps:{},question:{schoice:0,mchoice:1,sort:2,text:3,number:4,map:5},timerTransition:{moments:[10,5],colors:[[17,187,34],[255,138,0],[255,26,0]],waiting:"#1C418C"},buttonTransitions:{highlight:[[255,255,255],[0,108,199]],rightAnswer:[[255,255,255],[17,187,34]]},userColors:["#36393D","#CC0000","#003300","#008C00","#006E2E","#4096EE","#3F4C6B"]};var AJ={activity:1,animations:false,avatar:"",bigAnimations:false,changedNick:false,curLang:"en",focused:true,joining:false,lag:100,previousAvatars:[],referrer:null,username:"",userType:0,userBalance:0,qHistorySize:40,selfColor:"Navy",session:null,sound:false,initStep:0};var variables={avatarDisplaySize:64,buttonPressed:null,cachedImgs:[],changeNickBalloon:false,clickedInPicker:false,clickInChangeNickDiv:false,curFocus:null,currentAnswer:null,currentWindow:"",eomGraphWidth:600,eomGraphHeight:300,exceptions:[],expectingNickChangeFrom:null,filterQuestionsCount:20,firstJoin:true,focusAfterWindowShow:null,hasSound:true,idleDelay:30*1000,loadedFirstHash:false,loadedScripts:[],mapWidth:325,mapHeight:325,numberCodes:{},prevFocus:null,showWindowAfterConnect:null,showWindowAfterLogin:null,skins:["tree"],storage:window.localStorage||window.globalStorage&&location.hostname&&window.globalStorage[location.hostname],updateChatHeightOnShowPlay:false,wasEOMbefore:false,watchList:[],windowBeforeAltC:null,windowIsActive:true,windowsShown:{},x7:[]};var features={editing:false,transform:false,list:["transform"],props:[["transformProperty","webkitTransform","MozTransform","mozTransform","oTransform","msTransform","filter"]],mhtml:features.mhtml,dataURI:features.dataURI};var fullDomainsHash=null;var simpleDomainsHash=null;var domainsHash=null;var domains=null;var currentRoom=null;var recentRooms=[];var question=null;var previousQuestions=[];var showRoomOnJoin=false;var firstBrowseCateg=0;var rooms=[];rooms.byId={};var lastAnswer=null;var dontKnow={};var RadioSets={};var smileys=[[/:\)\)/g,"background: transparent url('icons/famfamfam/emoticon_happy.png'); width: 16px; height: 16px;"],[/:\)/g,"background: transparent url('icons/famfamfam/emoticon_smile.png'); width: 16px; height: 16px;"],[/B\)/,"background: transparent url('icons/famfamfam/emoticon_evilgrin.png'); width: 16px; height: 16px;"],[/:D/,"background: transparent url('icons/famfamfam/emoticon_grin.png'); width: 16px; height: 16px;"],[/:P/,"background: transparent url('icons/famfamfam/emoticon_tongue.png'); width: 16px; height: 16px;"],[/;\)/,"background: transparent url('icons/famfamfam/emoticon_wink.png'); width: 16px; height: 16px;"],[/:\(/,"background: transparent url('icons/famfamfam/emoticon_unhappy.png'); width: 16px; height: 16px;"],[/:O/,"background: transparent url('icons/famfamfam/emoticon_surprised.png'); width: 16px; height: 16px;"],[/:o/,"background: transparent url('icons/famfamfam/emoticon_surprised.png'); width: 16px; height: 16px;"],[/=\)\)/,"background: transparent url('icons/famfamfam/emoticon_happy.png'); width: 16px; height: 16px;"]];var RX={cls:{active:/\bactive\b/,alertMessage:/\balertMessage\b/,asc:/\basc\b/,ascdesc:/\b(a|de)sc\b/,betFree:/\b(bet|free)\b/,button:/\bbutton\b/,checked:/\bchecked\b/,checkedPartial:/\b(checked|partial)\b/,collapsed:/\bcollapsed\b/,desc:/\bdesc\b/,disabled:/\bdisabled\b/,down:/\bdown\b/,empty:/\bempty\b/,expanded:/\bexpanded\b/,hideActivityBoth:/\bhideActivity(?:Others)?\b/,hideTimestamps:/\bhideTimestamps\b/,highlight:/\bhighlight\b/,hover:/\bhover\b/,left:/\bleft\b/,linking:/\blinking\b/,no_ads:/\b(no)?ads\b/,noBtn:/\bnoBtn\b/,noMatch:/\bnoMatch\b/,now_playing:/\bnow_playing\b/,number:/\bnumber\b/,numbers:/\bnumbers\b/,opac:/\bopac\d*/,partial:/\bpartial\b/,place:/\bplace\S*\b/,pressed:/\bpressed\b/,readOnly:/\breadOnly\b/,right:/\bright\b/,selected:/\bselected\b/,showMenu:/\bshowMenu\b/,simple:/\bsimple\b/,slider:/\bslider\b/,sortable:/\bsortable\b/,sticky:/\bsticky\b/,unselectable:/\bunselectable\b/,yesNoPay:/\b(yes|no|for)-pay\b/,yesNoPayg:/\b(yes|no|for)-pay\b/g,yesPay:/\byes-pay\b/},elem:{bg:/<\/?b>/gi,table:/<table[\s\S]+?<\/table>/i},general:{NaN:/^NaN/,natural:/^\d+$/,isUrl:/^https?:\/\//},chr:{ampg:/&/g,dash:/-/,gtg:/>/g,ltg:/</g,rampg:/&amp;/g,rltg:/&lt;/g,rgtg:/&gt;/g,spaceg:/ /g,comma:/,/,quoteg:/"/g,bkslsg:/\\/g,S:/\S/,starg:/\*/g},other:{avatarPath:/^avatars\//,dashNoPay:/-no-pay$/,dashPay:/-pay$/,duArAwAg:/\b(?:disabled|userAnswer|rightAnswer|wrongAnswer)\b/g,cduArAwAg:/\b(?:checked|disabled|userAnswer|rightAnswer|wrongAnswer)\b/g,endsInColor:/(?:^color|Color)$/,etc1g:/","/g,etc2g:/,\s*\{/g,etc3:/^G[\[<]/,etc4:/[^\/]+$/,etc5g:/\$\./g,etc6g:/\$\(/g,etc7:/^\s*(\S.*?)\s*$/,etc8:/\s*,\s*/,etc9g:/[^ ,-]/g,etc10:/^-?\d+$/,etc11:/(_\d+)*$/,etc12:/> </g,etc13:/\s\s+/,guest:/^G\[/,extractGuestNick:/^G\[(.+)\]$/,illegalGuestNick:/^\d+$/,intervalDash:/-| \u2013 /,sbD:/^sb(\d+)$/,leadingSpace:/^\s+/,trailingSpace:/\s+$/,whitespace:/\s+/,leadingComma:/^,/,trailingComma:/,$/,me:/^\/me\s+/,messagePayed:/appFeedback.html#payed:(\d+)$/,messagePayCancelled:/appFeedback.html#cancelPayment:(\d+)$/,msgPayed:/^payed;(\w+)$/,newLineWhatever:/\r?\n\r?|<br\s*\/?>/i,nonAlphaNumeric:/[^a-zA-Z0-9_]/g,numbers:/-?\d+|\u221E/g,wikipedia:/http:\/\/(?:\w+\.)?wikipedia\.org\//,http:/^http:\/\//,_20g:/%20/g,_23g:/%23/g,underg:/under/g,overg:/over/g,payFormVariable:/(?:\$)([^;]+);/g,stripTagsg:/<\/?[^>]+>/g,thisSrcg:/this\.src/g,validURL:/^https?:\/\/[\.0-9a-zA-Z]+\.[a-zA-Z]{2,3}\/[^\s"<>#]*$/,validURLMaybeHash:/^https?:\/\/[\.0-9a-zA-Z]+\.[a-zA-Z]{2,3}\/[^\s"<>]*$/,windowLink:/Window\.show\(\s*(['"])([-a-zA-Z]+)\1\s*\)/},v:{action:/\$action/,cls:/\$class/,clsg:/\$class/g,checkedg:/\$checked/g,codeg:/\$code/g,content:/\$content/,defLangg:/\$defLang/g,formatter:/\$formatter/,id:/\$id/,idg:/\$id/g,items:/\$items/,keydown:/\$keydown/,label:/\$label/,max:/\$max/,min:/\$min/,mouseout:/\$mouseout/,mouseover:/\$mouseover/,onchange:/\$onchange/,options:/\$options/,over:/\$over/,pageg:/\$page/g,simple:/\$simple/,sliderHeads:/\$sliderHeads/,sliderStyle:/\$sliderStyle/,stateg:/\$state/g,style:/\$style/,switchg:/\$switch/g,title:/\$title/,titleg:/\$title/g,tooltip:/\$tooltip/,under:/\$under/,valg:/\$val/g,value:/\$value/,valueg:/\$value/g},hash:{br:/#br:([^#]+)/,from:/#from:([^#]+)/,referrer:/#referrer:([^#]+)/,rp:/#resetPasswordConfirmationId=([^#]+)/,room:/#room:([^#]+)(?:#|$)/,tabg:/#tab:(\w+)_(\d+)/g,tag:/#tag:([^#]+)(?:#|$)/,wnd:/#wnd:([^#]*)(?:#|$)/},cssColors:{hex3:/^#?(\w)(\w)(\w)$/,hex6:/^#?(\w\w)(\w\w)(\w\w)$/,rgb:/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/},tags:{},langs:{},units:{px:/^(\d+)px$/}};if(typeof console=="undefined"){var console={text:"",log:function(b){this.text+=b;for(var a=1;a<arguments.length;a++){this.text+=", "+String(arguments[a])}this.text+="\n"}};console.error=console.warn=console.log}if(!Array.prototype.last){Array.prototype.last=function(){return this[this.length-1]}}if(!Array.prototype.equal){Array.prototype.equal=function(d){if(this.length!=d.length){return false}var a=[],f,e,g;for(f=0;f<this.length;f++){g=false;for(e=0;e<d.length;e++){if(!a[e]&&this[f]==d[e]){a[e]=true;g=true;break}}if(!g){return false}}return true}}if(!Array.prototype.contains){Array.prototype.contains=function(b){for(var a=0;a<this.length;a++){if(this[a]==b){return true}}return false}}if(!Array.prototype.compact){Array.prototype.compact=function(){for(var a=0;a<this.length;a++){if(this[a]==null||typeof this[a]=="undefined"){this.splice(a--,1)}}return this}}Array.prototype.indexOf__=function(b){var a,c;for(a=0;c=this[a];a++){if(b===c){return a}}return -1};Array.prototype.indexOf_=Array.prototype.indexOf||Array.prototype.indexOf__;if(!Array.prototype.indexOf){Array.prototype.indexOf=function(b){for(var a=0;a<this.length;a++){if(this[a]==b){return a}}return -1}}if(!Array.prototype.removeItem){Array.prototype.removeItem=function(b){var a=this.indexOf(b);if(a>-1){return this.splice(a,1)}return null}}if(!Array.prototype.without){Array.prototype.without=function(){if(arguments.length==0){return this.clone()}var d=[],b=$A_(arguments);for(var c=0;c<this.length;c++){if(b.indexOf(this[c])<0){d.push(this[c])}}return d}}if(!Array.prototype.clone){Array.prototype.clone=function(){var a=[];for(var b=0;b<this.length;b++){a.push(this[b])}return a}}if(!Array.prototype.pluck){Array.prototype.pluck=function(c){var a=[];for(var b=0;b<this.length;b++){a.push(this[b][c])}return a}}if(!Array.prototype.pluck_){Array.prototype.pluck_=function(d){var a=[],c;for(var b=0;c=this[b];b++){a.push(c[d])}return a}}if(!Array.pluck_){Array.pluck_=function(b,a){return Array.prototype.pluck_.call(b,a)}}if(!Array.prototype.select){Array.prototype.select=function(c){var a=[];for(var b=0;b<this.length;b++){if(c(this[b],b)){a.push(this[b])}}return a}}if(!Array.prototype.map){Array.prototype.map=function(d){var a=[],c;for(var b=0;b<this.length;b++){if(c=d(this[b],b)){a.push(c)}}return a}}if(!Array.prototype.mapTo){Array.prototype.mapTo=function(b){var a=[],d;for(var c=0;c<this.length;c++){a.push(b[this[c]])}return a}}Array.prototype.reduce=function(){var a=[],c;for(var b=0;b<this.length;b++){if(this[b] instanceof Array){a=a.concat(this[b])}else{a.push(this[b])}}return a};if(!Array.prototype.joina){Array.prototype.joina=function(d,c){d=d||"";c=c||"";if(!this.length){return""}if(this.length==1){return d+this[0]+c}var a=[];for(var b=0;b<this.length-1;b++){a.push(this[b])}a=d+a.join(c+", "+d)+c+" "+Strings.conjunction+" "+d+this[this.length-1]+c;return a}}if(!Array.prototype.joinw){Array.prototype.joinw=function(c,a,b){c=c||"";b=b||"";a=a||"";if(!this.length){return""}if(this.length==1){return c+this[0]+b}return c+this.join(b+a+c)+b}}if(!Array.prototype.uniq1){Array.prototype.uniq1=function(){var a=[],c={};for(var b=0;b<this.length;b++){if(!c[this[b]]){a.push(this[b]);c[this[b]]=true}}return a}}if(!Array.prototype.intersect){Array.prototype.intersect=function(a){var b,c=[];for(b=0;b<this.length;b++){if(a.indexOf(this[b])>-1){c.push(this[b])}}return c}}if(!Array.prototype.includedIn){Array.prototype.includedIn=function(a){if(this.length<a.length){return false}for(var b=0;b<this.length;b++){if(a.indexOf(this[b])==-1){return false}}return true}}if(!Array.prototype.pushAll){Array.prototype.pushAll=function(a){this.push.apply(this,a)}}if(!Array.prototype.reverse){Array.prototype.reverse=function(){var b,c=0,a=this.length-1;while(c<a){b=this[c];this[c]=this[a];this[a]=b;c++,a--}}}Array.prototype.toString=function(){return"["+this.join(", ")+"]"};var $A=function(b){var a=[],d=b.length;for(var c=0;c<d;c++){a[c]=b[c]}return a};var $A_=function(b){var a=[],d;for(var c=0;d=b[c];c++){a.push(d)}return a};Object.prototype.clone=function(a){var c={};for(var b in this){if(this.hasOwnProperty(b)){c[b]=a&&this[b]&&typeof this[b]==="object"?this[b].clone(a):this[b]}}return c};Object.prototype.toString=function(){var b=[];for(var a in this){if(this.hasOwnProperty(a)){if(typeof this[a]=="function"){b.push(a+": function")}else{if(typeof this[a]=="string"){b.push(a+': "'+this[a].replace(RX.chr.quoteg,'\\"')+'"')}else{b.push(a+": "+String(this[a]))}}}}return"{"+b.join(", ")+"}"};String.prototype.trim=function(){var b=this.replace(RX.other.leadingSpace,"");for(var a=b.length-1;a>=0;a--){if(RX.chr.S.test(b.charAt(a))){if(a!=b.length-1){b=b.substring(0,a+1)}break}}return b};String.prototype.stripTags=function(){return this.replace(RX.other.stripTagsg,"")};String.prototype.normalize=function(){var d=this.toLowerCase(),b=String.prototype.normalize.accents;for(var a=0,c;c=b[a];a++){d=d.replace(c.regex,c.letter)}return d};String.prototype.normalize.accents=[{regex:/[\u00e0-\u00e6\u0100-\u0105\u01ce\u01de-\u01e3\u01fa-\u01fd\u0200-\u0203\u0227\u023a]/g,letter:"a"},{regex:/[\u0180-\u0185\u0243]/g,letter:"b"},{regex:/[\u00e7\u0106-\u010d\u0188\u023c]/g,letter:"c"},{regex:/[\u010e-\u0111\u0189-\u018d\u0221]/g,letter:"d"},{regex:/[\u00e8-\u00eb\u0112-\u011b\u018e\u0190\u01a9\u01dd\u0204-\u0207\u0229\u0247]/g,letter:"e"},{regex:/[\u0192]/g,letter:"f"},{regex:/[\u011c-\u0123\u0193\u0194\u01e4-\u01e7\u01f5]/g,letter:"g"},{regex:/[\u0124-\u0127\u0195\u021f]/g,letter:"h"},{regex:/[\u00ec-\u00ef\u0128-\u0133\u0196\u0197\u01d0\u0208-\u020b]/g,letter:"i"},{regex:/[\u0135\u01f0\u0249]/g,letter:"j"},{regex:/[\u0137\u0138\u0199\u01e9]/g,letter:"k"},{regex:/[\u0139-\u0142\u019a\u019b\u0234\u023d]/g,letter:"l"},{regex:/[\u00e1\u0143-\u014b\u019d\u019e\u01f9\u0220\u0235]/g,letter:"n"},{regex:/[\u00f0\u00f2-\u00f6\u00f8\u014c-\u0153\u019f-\u01a3\u01d2\u01ea-\u01ed\u01ff\u020c-\u020f\u022a-\u0231]/g,letter:"o"},{regex:/[\u01a4\u01a5]/g,letter:"p"},{regex:/[\u024b]/g,letter:"q"},{regex:/[\u0154-\u0159\u01a6\u0210-\u0213\u024d]/g,letter:"r"},{regex:/[\u015a-\u0161\u017f\u01a8\u0219\u023f]/g,letter:"s"},{regex:/[\u0162-\u0167\u01ab-\u01ae\u021b\u0236\u023e]/g,letter:"t"},{regex:/[\u00f9-\u00fc\u0168-\u0173\u01af-\u01b1\u01d3-\u01dc\u0214-\u0217\u0244]/g,letter:"u"},{regex:/[\u01b2]/g,letter:"v"},{regex:/[\u00fd\u00ff\u0177\u01b4\u0233\u024f]/g,letter:"y"},{regex:/[\u0175\u0177]/g,letter:"w"},{regex:/[\u0179-\u017e\u01b6\u0225\u0240]/g,letter:"z"}];if("a".replace(/a/,"$.1")=="$.1"){String.prototype.replace_=function(a,b){return this.replace(a,b||"")}}else{String.prototype.replace_=function(a,b){b=b?b.replace(RX.other.etc5g,"$$$$.").replace(RX.other.etc6g,"$$$document.getElementById("):"";return this.replace(a,b)}}Function.prototype.bindTo=function(c){var b=this;var a=function(){return b.apply(c,$A(arguments))};a.boundFunction=b;return a};if(!Function.prototype.bind){Function.prototype.bind=function(){var c=$A(arguments),d=c.shift(),b=this;var a=function(){var e=arguments.length?c.concat(arguments):c;return b.apply(d,c)};a.boundFunction=b;return a}}function stopEvt(a){if(globalEvents.currentEvent!=a){globalEvents.run("on"+a.type,a)}else{globalEvents.returnValue=false}if(a.preventDefault){a.preventDefault();a.stopPropagation()}else{a.returnValue=false;a.cancelBubble=true}}function pointerX(a){return a.pageX||(a.clientX+(document.documentElement||document.body).scrollLeft)}function pointerY(a){return a.pageY||(a.clientY+(document.documentElement||document.body).scrollTop)}var $=function(a){return document.getElementById(a)};function getStyle(a){try{return a.currentStyle||document.defaultView.getComputedStyle(a,null)}catch(b){console.error("Exception getting style for %o",a);throw b}}var getElementsByClassName;if(document.getElementsByClassName){getElementsByClassName=function(b,a){return $A_(b.getElementsByClassName(a))}}else{getElementsByClassName=function(e,a){a=new RegExp("(^|\\s)"+a+"(\\s|$)");var d=$A_(e.all||e.getElementsByTagName("*"));var b=[];for(var c=0;d[c];c++){if(a.test(d[c].className)){b.push(d[c])}}return b}}if(window.Node&&Node.prototype&&!Node.prototype.contains){Node.prototype.contains=function(a){return !!(this.compareDocumentPosition(a)&16)}}var offsetBoxDirect=function(f,a,e){var d=f.getBoundingClientRect();var c=[d.left,d.top,f.offsetWidth,f.offsetHeight];a=a!==false;var b;if(a){b=document.body}else{b=f.offsetParent;while(b){if(!["absolute","fixed"].contains(getStyle(el).position)){b=b.offsetParent}}}if(b){d=b.getBoundingClientRect();c[0]-=d.left;c[1]-=d.top}if(e){d=document.body.getBoundingClientRect();c[0]+=d.left;c[1]+=d.top}return c};var offsetBoxIter=function(f,a,e){var c=f,b;var d=[0,0,f.offsetWidth,f.offsetHeight];a=a!==false;while(c){if(!a&&["absolute","fixed"].contains(getStyle(c).position)){break}b=c.offsetParent;if(c==document.body){a=true;break}d[0]+=c.offsetLeft;d[1]+=c.offsetTop;if(c!=f){d[0]-=c.scrollLeft;d[1]-=c.scrollTop}c=b}if(a){d[0]+=document.body.offsetLeft;d[1]+=document.body.offsetTop;d[0]+=document.body.parentNode.offsetLeft;d[1]+=document.body.parentNode.offsetTop}if(e){d[0]-=document.body.scrollLeft;d[1]-=document.body.scrollTop;d[0]-=document.body.parentNode.scrollLeft;d[1]-=document.body.parentNode.scrollTop}return d};var offsetBox=document.documentElement.getBoundingClientRect?offsetBoxDirect:offsetBoxIter;var Class={create:function(b){var a=function(){this.initialize.apply(this,arguments)};if(!b.initialize){b.initialize=function(){}}a.prototype=b;return a}};var as=function(a,b){if(!a){b=b||"";var d=2;while(d<arguments.length){b=b+"; %node: "+Util.getShortestElemPath(arguments[d++])}b="Assert failed: "+b;throwError(b);return false}return true};function init(){if(AJ.initStep>0){return}var f=new Date().valueOf();var c,b;AJ.initStep=0.1;if(window.curLang){AJ.curLang=window.curLang}if(isIE){document.createElement("header");document.createElement("nav")}ProgressBar.setValue(document.getElementById("progJS"),100);Request.initCallbacks();if(typeof G_vmlCanvasManager!="undefined"){G_vmlCanvasManager.init()}if(constants.lockedCountry){countries=[countries[countries.pluck("0").indexOf(constants.lockedCountry)]]}Util.initStorage();Util.initDomains();Util.init();HTML.init();$.footer=document.getElementById("business");LanguageList.reloadLanguages();Util.findElements("index");UI.init();Hash.loadingHash=true;Hash.noRehash=true;Window.init();Window.show("play");if(constants.firstWindow!="play"){Window.show(constants.firstWindow)}Hash.loadingHash=false;Hash.noRehash=false;Alert.init();InfoBox.init();Sound.init();Animate.init();etcInit();LanguageList.init();Tooltip.init();TagList.init();Field.init();globalEvents.init();Map.init();Graph.init();Menu.init();Merchants.init();UserCache.init();Account.init();if(window.attachEvent){window.attachEvent("onmessage",Util.receiveMessage)}else{if(window.addEventListener){window.addEventListener("message",Util.receiveMessage,false)}}var e=md5_vm_test(),g=sha1_vm_test();if(e&&g){console.log("Cripto tests passed")}else{if(!e&&!g){console.error("Crypto tests failed")}else{if(e){console.error("MD5 test passed, SHA-1 test failed")}else{console.error("SHA-1 test passed, MD5 test failed")}}}Util.isolateScroll(document.getElementById("chatText"));Util.isolateScroll(document.getElementById("userList"));Settings.init();Util.loadOldSettings();Questions.makeTableHeader();window.onunload=unload;var a=new Date().valueOf();console.log("Initialization (stage 1/2) done in "+((a-f)/1000)+"s.");AJ.initStep=1}function init2(){if(AJ.initStep>1){return}if(!AJ.initStep){init()}var d=new Date().valueOf();AJ.initStep=1.1;ProgressBar.setValue(document.getElementById("progCSS"),100);UserList.updateHeight();Field.init2();Util.checkFeatures();Util.initLang();if(constants.googleAnalytics){gaSSDSLoad(constants.googleAnalytics)}injectLiveSearch();BrowserUpdate.init();if(UI.timer){UI._apply(3)}var a=Window.show;Window.show=function(e){variables.showWindowAfterConnect=e};var c=Util.navigate;Util.navigate=function(){var e=$A(arguments);if(!e[0]){e[0]=variables.showWindowAfterConnect||variables.currentWindow}variables.showWindowAfterConnect=e};Request.start();Window.show=a;Util.navigate=c;Hash.reHash();Hash.initHash();try{document.promo&&document.promo.Rewind&&document.promo.Rewind()}catch(g){throwError("Adobe Flash CRASHED on rewind.",true)}var f=Animate.fade(document.getElementById("loadingScreen"),1,0,0.5);console.log("fading loading screen "+(f?"ok":"bad"));if(f){f.after(_o)}if(constants.sounds.welcome){Sound.play("welcome")}setTimeout(function(){try{if(variables.currentWindow=="home"){document.promo&&document.promo.Play&&document.promo.Play()}}catch(h){throwError("Adobe Flash CRASHED on start playing.",true)}},1500);var b=new Date().valueOf();console.log("Initialization (stage 2/2) done in "+((b-d)/1000)+"s.");console.log("Page loaded in "+((b-pageLoadBegin)/1000)+"s.");AJ.initStep=2}function init3(){if(AJ.initStep>2){return}as(AJ.initStep==2,"InitStep 2 expected!");AJ.initStep=2.1;Idle.init();_s($.sideInfoContainer.style,"display","");if(!variables.positionedTimer&&variables.currentWindow=="play"){UI.afterApplyOnce.push(Util.positionTimer)}_s($.question_outer.parentNode.style,"display","inline-block");_s($.question_outer.style,"width","");_s($.chatContainer.style,"display","");if(variables.showWindowAfterConnect){if(typeof variables.showWindowAfterConnect=="string"){window.show(variables.showWindowAfterConnect)}else{Util.navigate.apply(Util,variables.showWindowAfterConnect)}variables.showWindowAfterConnect=null}_s($.user.style,"display","");Util.updateTopUsers();if(isIE){Chat._addMsg(Strings.ieMsg,"ie")}AJ.initStep=3}function unInit3(){_s(document.getElementById("dontKnowDiv").style,"display","none");_s($.user.style,"display","none")}var unloading=false;function unload(){Request.stop();unloading=true}var Algorithms={longestCommonSubsequence:function(a,g){if(!a.length||!g.length){return[]}var d=[[]];for(var c=1;c<=a.length;c++){d[c]=[]}var e,f;for(var c=0;c<g.length;c++){e=[];for(var b=0;b<a.length;b++){f=d[b+1];if(a[b]==g[c]){d[b+1]=e.clone();d[b+1].push(a[b])}else{if(d[b].length>d[b+1].length){d[b+1]=d[b]}}e=f}}return d[a.length]}};var Request={url:(document.domain?"":"http://127.0.0.1:8002/")+"game",timeout:15000,timeout2:20000,unique:{j:true,n:true,cR:true,fQ:true,rP:true,rPR:true},reconnectDelays:[1,2,3,5,10,20,30,60,120,300],reconnectIndex:0,retryTimeVal:null,started:false,active:null,statusReq:null,sent:[],sendQ:[],activeTimeout:null,statusTimeout:null,statusMsg:"",lastResponse:new Date().valueOf(),connected:false,afterConnect:[],readyStateChange:function(f){if(f.readyState==4){var b="U";if(f==Request.active){clearTimeout(Request.activeTimeout);Request.activeTimeout=null;b="A"}else{if(f==Request.statusReq){clearTimeout(Request.statusTimeout);Request.statusTimeout=null;b="S"}else{Chat.addDebugMsg("(old request) <-- "+f.responseText.replace(RX.chr.ampg,"&amp;").replace(RX.chr.ltg,"&lt;").replace(RX.other.etc1g,'", "').replace(RX.other.etc2g,",<br />{"));return}}if(f.status&&f.status<300){if(f.responseText){var d;try{d=parseJSON(f.responseText)||[]}catch(c){d=null;if(f==Request.active&&!Request.statusReq){Request.stop(true)}else{Chat.addServerMsg(Util.sprintf(Strings.exceptionParsingSrvResp,f.responseText.replace(RX.chr.ampg,"&amp;").replace(RX.chr.ltg,"&lt;")))}}Chat.addDebugMsg(b+" <-- "+f.responseText.replace(RX.chr.ampg,"&amp;").replace(RX.chr.ltg,"&lt;").replace(RX.other.etc1g,'", "').replace(RX.other.etc2g,",<br />{"));if(d){Request.lastResponse=new Date().valueOf();if(!Request.started){Request.started=true;Request.reconnectIndex=0}if(!Request.connected){Request.connected=true}if(f==Request.active){Request.sent=[];Request.sent.types=[]}if(d.length){Request.dispatchResponse(d)}if(Request.connected&&Request.afterConnect.length){for(var a=0;a<Request.afterConnect.length;a++){Request.afterConnect[a]()}Request.afterConnect=[]}}}else{Chat.addServerMsg(Util.sprintf(Strings.srvErrEmpty,b))}}else{if((f==Request.active&&!Request.statusReq)||new Date().valueOf()-Request.lastResponse>Request.timeout2*2){Request.stop(true);return}}if(f==Request.statusReq){Request._queueS(true)}else{if(Request.sendQ.length){Request._queue(true)}else{Request.active=null}}}},dispatchResponse:function(f){if(UI.timer){UI._apply(UI.timer<0?6:UI.timer)}UI.timer=5;var b=false;for(var a=0,d;d=f[a];a++){if(!d.y){throwError(Strings.msgFromSrvIsMissingType)}else{if(Request.callbacks[d.y]){if(d.y=="q"||d.y=="a"){if(b){UI._apply(6);UI.timer=5}b=true}try{Request.callbacks[d.y](d)}catch(c){console.error("An error has occureed while handling message (type: %o) %o. Exception: %o",d.y,d,c)}}else{console.warn(Util.sprintf(Strings.noHandler,d.y))}}}UI._apply(5,true)},getTransport:function(){var d;var a=[function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}];for(var b=0;b<a.length;b++){try{d=a[b]();Request.getTransport=a[b];return d}catch(c){}}},setReqHeaders:function(a){a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.setRequestHeader("Accept","text/javascript")},_queueS:function(a){if(!a){if(new Date().valueOf()-Request.lastResponse>Request.timeout2*2){Chat.addDebugMsg(Strings.statusTimeOut+". "+Strings.srvNotResp+".");Request.statusReq=null;Request.stop(true,Strings.srvNotResp);return}else{Chat.addDebugMsg(Strings.statusTimeOut)}}if(!Request.statusMsg){return}var c=Request.getTransport();Request.statusReq=c;Chat.addDebugMsg("--> "+Request.statusMsg.replace(RX.chr.ampg,"&amp;").replace(RX.chr.ltg,"&lt;").replace(RX.other.etc1g,'", "').replace(RX.other.etc2g,",<br />{"));try{c.open("post",Request.url,true);Request.setReqHeaders(c);c.onreadystatechange=function(){if(window.Request){Request.readyStateChange(c)}};c.send(Request.statusMsg);Request.statusTimeout=setTimeout(Request._queueS,Request.timeout2)}catch(b){Chat.addServerMsg(Util.sprintf(Strings.unableToConnect,Request.url))}},_queue:function(c){if(!c){if(Request.statusReq){Chat.addDebugMsg(Strings.normalReqTimeOut)}else{Request.stop(true);return}}if(Request.sendQ.length){Request.sent.types.pushAll(Request.sendQ.types);var b=Request.sent.types;Request.sent.pushAll(Request.sendQ);Request.sent.types=b;Request.sendQ=[];Request.sendQ.types=[];var f={};for(var a=Request.sent.length-1;a>=0;a--){if(Request.unique[b[a]]){if(!f[b[a]]){f[b[a]]=true}else{b.splice(a,1);Request.sent.splice(a,1)}}}}var h="["+Request.sent.join(",")+"]";Chat.addDebugMsg("--> "+h.replace(RX.chr.ampg,"&amp;").replace(RX.chr.ltg,"&lt;").replace(RX.other.etc1g,'", "').replace(RX.other.etc2g,",<br />{"));var g=Request.getTransport();Request.active=g;try{g.open("post",Request.url,true);Request.setReqHeaders(g);g.onreadystatechange=function(){Request.readyStateChange(g)};g.send(h);Request.activeTimeout=setTimeout(Request._queue,Request.timeout)}catch(d){Chat.addServerMsg(Util.sprintf(Strings.unableToConnect,Request.url))}},queue:function(a,d){var c="{";if(typeof AJ.playerId!="undefined"){c+='"p":"'+AJ.playerId+'","s":"'+AJ.serverId+'",'}c+='"y":"'+a+'"';if(d&&d.length){for(var b=0;b<d.length;b+=2){c+=',"'+d[b].replace(RX.chr.quoteg,'\\"')+'":';if(d[b+1]==null){c+="null"}else{if(typeof d[b+1]=="number"||typeof d[b+1]=="boolean"){c+=String(d[b+1]-0)}else{if(typeof d[b+1]=="string"){c+='"'+d[b+1].replace(RX.chr.bkslsg,"\\\\").replace(RX.chr.quoteg,'\\"')+'"'}else{if(d[b+1] instanceof Array){if(d[b+1].length&&typeof d[b+1][0]=="string"){c+='["'+d[b+1].join('","')+'"]'}else{c+=d[b+1].toString()}}else{c+="unsupported";console.error("Unsupported message (%o) property (%o) value (%o).",a,d[b],d[b+1])}}}}}}c+="}";Request.sendQ.push(c);Request.sendQ.types.push(a);if(!Request.active&&Request.started){Request._queue(true)}},start:function(){if(Request.active){console.warn("Request.start: an active request is already open.");return}Request.retryTimeVal=null;Hash.savedHash=Hash.savingHash=null;Quiz.clearQuestion(true,Strings.connecting);var a=currentRoom;currentRoom=null;Request.started=true;Hash.loadHash("#wnd:"+variables.currentWindow);if(!currentRoom){currentRoom=a}},stop:function(c,b){lastSetRoom=null;Request.connected=false;if(c){var a=Request.reconnectDelays[Request.reconnectIndex]*1000;if(Request.startTimeout){clearTimeout(Request.startTimeout)}Request.startTimeout=setTimeout(Request.start,a);Request.retryTimeVal=new Date().valueOf()+a;Quiz.serverError(b,a);if(Request.reconnectIndex+1<Request.reconnectDelays.length){Request.reconnectIndex++}}else{Request.getTransport=function(){return{fake:true,sent:"",open:function(){},send:function(d){this.sent+=d},setRequestHeader:function(){}}};Quiz.serverError(b,-1);if(Request.startTimeout){clearTimeout(Request.startTimeout);Request.startTimeout=null;Request.retryTimeVal=null}}Request.active=null;if(Request.activeTimeout){clearTimeout(Request.activeTimeout)}Request.statusReq=null;if(Request.statusTimeout){clearTimeout(Request.statusTimeout)}Request.statusMsg=""},setRoom:function(a){var b;if(typeof a=="string"){b=["k",a==Strings.globalTag?"all":a]}else{if(a.tag){b=["k",a.tag==Strings.globalTag?"all":a.tag]}else{b=["i",a.id];if(rooms.byId[a.id]){b.push("r",false)}}}if(AJ.session){b.push("j",AJ.session)}else{if(AJ.guestNick){b.push("n",AJ.guestNick)}else{b.push("n",(67+(Math.random()*(401-67))|0)+"")}}if(variables.firstJoin){b.push("a",1)}Request.queue("j",b);Quiz.expireQuestion()},createRoom:function(n,e,g,c,f,l,a,b,k,h){var d=["t",n,"d",e,"k",g,"l",c,"q",f,"c",l,"r",h];if(a){d.push("n",a)}if(b){d.push("b",b)}if(k){d.push("L",k)}if(AJ.session){d.push("j",AJ.session)}Request.queue("cR",d)},sendAnswer:function(a){Request.queue("a",["q",question.id,"a",a])},login:function(a,b,d){variables.loggingIn=true;var c=["u",a,"q",b,"r",d];if(AJ.session){c.push("i",AJ.session)}Request.queue("login",c)},createAccount:function(a,b,d,e,c){variables.loggingIn=true;Request.queue("newAcc",["user",a,"pass",d,"email",b,"rem",e,"f",c])},changePass:function(b,a){Request.queue("cP",["o",b,"n",a,"i",AJ.session])},requestPasswordReset:function(b,a){Request.queue("rPR",["u",b,"e",a])},resetPassCode:function(a){Request.queue("rP",["i",a])},updateAccInfo:function(b,d,c,e,a,h,f){var g=["i",AJ.session];if(b!=Account.email){g.push("e",b);Account.email=b}if(d!=Account.firstName){g.push("n",d);Account.firstName=d}if(c!=Account.surName){g.push("sn",c);Account.surName=c}if(e!=Account.sex){g.push("m",e);Account.sex=e}if(a!=Account.birthDate){g.push("bi",a);Account.birthDate=a}if(h!=Account.country){g.push("co",h);Account.country=h}if(f!=Account.state){g.push("st",f);Account.state=f}Request.queue("uI",g);Account.updateValuesInSettings()},logoff:function(){Request.queue("logoff")},sendMessage:function(b,a){if(!a){Request.queue("c",["m",b])}else{Request.queue("c",["m",b,"t",a])}},updateRFilter:function(d,c,a){var e=["f",d,"l",c];if(a){e.push("b",a)}Request.queue("f",e)},updateQFilter:function(g,a,h,e){var d=[];if(g){d.push("f",g)}if(a){d.push("b",a)}if(!h){h=variables.filterQuestionsCount}if(h&&h!=constants.filterQuestionsDefaultCount){d.push("c",h)}if(e&&(e.length!=2||e[0]!="-valid"||e[1]!="-id")){d.push("s",e)}Request.queue("fQ",d)},addQuestion:function(h,a,n,x,c,b,g,y,f,p,r){var w=["q",a,"e",n,"u",x,"l",c,"ra",b,"wa",g,"t",y,"k",f,"d",p,"im",r];if(h<0){Request.queue("aQ",w)}else{Request.queue("uQ",["i",h].concat(w))}},deleteQuestion:function(a){Request.queue("dQ",["i",a])},changeNick:function(a){Request.queue("n",["t",a])},idle:function(a){Request.queue("i",["t",a])},messageForAdmins:function(b,a){if(!/\.\w+$/.test(location.host)){return}b+=" [UA: "+navigator.userAgent+"] [URL: "+location.host+location.pathname+"] [Username: "+AJ.username+"] [Timestamp: "+getDateTime()+"]";Request.queue("m",["t",a||0,"m",b])},exception:function(a){Request.messageForAdmins(a,1)},sendFeedback:function(a){Request.messageForAdmins(a,2)},setReady:function(a){Request.queue("v",["v",a])},setAvatar:function(a){Request.queue("av",["u",a])},ping:function(c,b){var a=c?["i",c]:[];if(b){a.push("o",b)}Request.queue("p",a)},payMe:function(b,a,c){Request.queue("pM",["x",b,"d",a,"m",c])},paymentHistory:function(b,a){Request.queue("ph",["b",b,"c",a])},saveSettings:function(a){Request.queue("s",["s",a,"i",AJ.session])},topUsers:function(b,a){Request.queue("tu",["b",b,"c",a])},wall:function(a){Request.queue("wall",["m",a])},whois:function(a){Request.queue("whois",["u",a])}};Request.sent.types=[];Request.sendQ.types=[];Request.callbacks={question:function(e){var c=null,d=null,a=currentRoom.users.length;if(Field.activeElem==$.msg){c=document.body.scrollHeight;d=document.body.parentNode.scrollHeight}var a=currentRoom.users.length;if(Quiz.startTime){Quiz.startNow()}if(variables.wasEOMbefore){variables.wasEOMbefore=false;currentRoom.question=0;currentRoom.scoreHistory.scores=[[]];currentRoom.scoreHistory.usernames=currentRoom.users.pluck("username");currentRoom.scoreHistory.userInfo=currentRoom.users.clone();currentRoom.scoreHistory.indexByUser={};for(var b=0;b<a;b++){currentRoom.users[b].score=0;currentRoom.users[b].prevScore=0;currentRoom.users[b].winnings=0;currentRoom.scoreHistory.scores[0][b]=0;currentRoom.scoreHistory.indexByUser[currentRoom.users[b].username]=b}_s($.moneyWon,"innerHTML",Util.printMoney(0));Chat.addActivity(Strings.newRound,AJ.username);UserList.updateUserInfo()}Quiz.setQuestion(e);for(var b=0;b<a;b++){currentRoom.users[b].prevScore=currentRoom.users[b].score}if(c||d){UI.afterApplyOnce.push(function(){c=document.body.scrollTop+document.body.scrollHeight-c;d=document.body.parentNode.scrollTop+document.body.parentNode.scrollHeight-d;scroll(0,c||d)})}},mask:function(a){Quiz.updateQuestionMask(a.m,a.ti||question.srvObj.ti)},answer:function(h){currentRoom.question++;Quiz.expireQuestion();var b=Quiz.answerResult(h),a="";if(typeof h.u=="string"){h.u=[h.u];h.s=[h.s];h.w=[h.w];h.a=[h.a];h.d=[h.d]}if(!h.a){h.a=[]}if(!h.d){h.d=[]}for(var k=0,c=h.u.length;k<c;k++){if(typeof h.d[k]=="number"&&h.d[k]!=-1){currentRoom.users[currentRoom.indexByUser[h.u[k]]].userLastAnswer={a:h.a[k],t:h.d[k],right:h.s[k]>currentRoom.users[currentRoom.indexByUser[h.u[k]]].score}}}currentRoom.userLastAnswerTimestamp=new Date().valueOf();h.s1=[];if(!h.w){h.w=[]}var k,c=h.u.length;var p=[];for(k=0;k<c;k++){var f=currentRoom.users[currentRoom.indexByUser[h.u[k]]];h.s1[k]=h.s[k]-f.score;f.score=h.s[k];if(h.w[k]&&h.w[k]>f.winnings){p.push(f.username);f.winnings=h.w&&h.w[k]||(h.w[k]=0)}}if(p.length){Chat.addPayMsg(Util.sprintf(p.length<2?Strings.wonQuestionOne:Strings.wonQuestionMany,p.mapTo(currentRoom.usernameMap).joina()))}var e=[];currentRoom.scoreHistory.scores.push(e);for(k=0,c=currentRoom.users.length;k<c;k++){e[currentRoom.scoreHistory.indexByUser[currentRoom.users[k].username]]=currentRoom.users[k].score}c=h.u.length;var r,g=c-1;while(g){g=false;for(k=0;k<c-1;k++){if(h.s1[k]<h.s1[k+1]){r=h.s[k];h.s[k]=h.s[k+1];h.s[k+1]=r;r=h.s1[k];h.s1[k]=h.s1[k+1];h.s1[k+1]=r;r=h.w[k];h.w[k]=h.w[k+1];h.w[k+1]=r;r=h.u[k];h.u[k]=h.u[k+1];h.u[k+1]=r;g=true}}}var q=h.u.indexOf(AJ.username);var d=false;if(q>-1&&h.s1[q]>0){_s($.moneyWon,"innerHTML",Util.printMoney(h.w[q]||0));for(k=0;k<=q;k++){if(h.s1[k]==h.s1[q]){_r($.waitBreakState,"className",RX.cls.place,"place"+(k+1));var n=k+1;_s($.waitBreakState,"innerHTML",Util.sprintf(Strings.pointsEarned,"<strong>"+h.s1[q]+"</strong>"));d=q==0}}}else{_r($.waitBreakState,"className",RX.cls.place,"place");_s($.waitBreakState,"innerHTML",Util.sprintf(Strings.pointsEarned,"<strong>0</strong>"));if(b){a="<br />"+Strings.answerTooLate}}_a($.waitBreakAnswer,"innerHTML",a+"<br />");Util.updateMoneyLeft();UserList.updateUserInfo();UserList.sortUsers();UserList.showLastAnswer(Math.max(constants.minimumDelayBeforeFadingOutUserAnswers,(h.ti-5)*1000-AJ.lag*2));PlayZone.paint()},roomInfos:function(b){rooms=[];rooms.byId={};for(var a=0;a<b.rs.length;a++){Request.callbacks.roomInfo(b.rs[a])}Rooms.setList(rooms)},roomInfo:function(a){rooms.push({id:a.i,title:a.t,kw:a.k,lang:a.l,creator:a.cu,people:a.p,capacity:a.c,diff:a.d,bet:(a.b||0)*100,questionCount:a.qc,lobby:!!a.L,created:Util.getDateFromJSON(a.cd)});if(rooms.byId[a.i]){rooms.splice(rooms.indexOf(rooms.byId[a.i]),1)}rooms.byId[a.i]=rooms[rooms.length-1]},welcome:function(a){if(!a.t&&!a.fromByeBye&&variables.loggingIn){variables.loggingIn=false;Util.info(Strings.badLogin,Strings.login);return}variables.loggingIn=false;if(a.i){AJ.session=a.i}AJ.avatar=Util.getAvatar(a.u,a.a);AJ.previousAvatars=a.h||[];Util.tryUpdateAvatarOptions();AJ.balance=a.t&&a.b||0;AJ.userType=a.t;if(AJ.username&&(a.t||a.fromByeBye)){variables.expectingNickChangeFrom=AJ.username}if(a.u){Util.updateUsername(a.u)}Account.updatePoints(a.sc||0);_s($.rankContainer,"className",a.t?"":"disabled");Account.setup(a);Util.updateBalances();if(!a.t){Util.showGuestStuff()}else{AJ.referrer=null;Util.showUserStuff();UserCache.handleWelcomeMessage(a);if($_("loginUsername")){Field.empty($_("loginUsername"));Field.empty($_("loginPassword"))}Util.save("session",a.i||AJ.session);if(variables.currentWindow=="login"){if(variables.showWindowAfterLogin){Window.show(variables.showWindowAfterLogin);variables.showWindowAfterLogin=null}else{Window.show("play")}}}},passwordChanged:function(a){Util.info(a.r!==0?Strings.passChangeErr:Strings.passChangeOk)},byebye:function(a){AJ.userType=0;Util.save("session",null);Request.callbacks.welcome({u:a.u,t:0,fromByeBye:true});if(AJ.loggingOut){AJ.loggingOut=false}else{Util.alert(currentRoom&&currentRoom.roomInfo.bet?Strings.unexpectedLogOutPayGame:Strings.unexpectedLogOut)}},enterRoom:function(g){AJ.joining=false;variables.firstJoin=false;var a=rooms.byId[g.i];if(!a.created){a.created=new Date(1970,0,1);console.warn("roomInfo for room "+g.i+" is missing property <<cd>> (created - date), assuming 1st Jan 1970.")}if(!a.lang){a.lang="Espagnol";console.warn("roomInfo for room "+g.i+" is missing property <<l>> (language), assuming Espagnol.")}a.lastVisit=new Date();a.joins=1;if(AJ.serverId!=g.s||AJ.playerId!=g.p){AJ.serverId=g.s;AJ.playerId=g.p;Request.statusMsg='[{"p":"'+g.p+'", "s":"'+g.s+'","y":"g"}]';if(Request.statusTimeout){clearTimeout(Request.statusTimeout)}Request._queueS(true)}if(!currentRoom){init3()}else{Chat.addActivity(Util.sprintf(Strings.youLeftRoom,'<span class="link rejoin" onclick="Quiz.setRoom({id:\''+currentRoom.id+"'});\">"+currentRoom.title+"</span>"),AJ.username)}variables.wasEOMbefore=false;if(g.L){_sC($_("reviewQuestionsArea").style,"display","none");Quiz.setStartGameHighlight();Chat.addServerMsg(Strings.lobbyPressStart)}else{_sC($_("reviewQuestionsArea").style,"display","");Quiz.clearStartGameHighlight()}currentRoom={id:g.i,users:new Array(g.o.length),indexByUser:{},usernameMap:{},title:a.title,kw:a.kw,lang:a.lang,creator:a.creator,created:a.created,roomInfo:rooms.byId[g.i],question:(g.q||1)-1,scoreHistory:{scores:[[]],userInfo:[],usernames:[],indexByUser:{}}};if(currentRoom.roomInfo.bet){AJ.balance-=currentRoom.roomInfo.bet;Util.updateBalances();Account.addPaymentInfo({ammount:currentRoom.roomInfo.bet,type:4},currentRoom.id);if(!currentRoom.roomInfo.lobby){currentRoom.money=currentRoom.users.length*currentRoom.roomInfo.bet}}if(!g.d){console.warn("EnterRoom message is missing the parameter <<d>>!. Incomplete data, assuming random values for diversity.")}Chat.clearUserCache();var p=g.u&&AJ.username!=g.u;if(p){AJ.username=g.u;AJ.usernameRx=new RegExp("\\b\\"+AJ.username.split("").join("\\")+"\\b")}for(var h=0,c=g.o.length;h<c;h++){var f=g.o[h].match(RX.other.extractGuestNick);currentRoom.users[h]={username:g.o[h],displayedUsername:f?Util.sprintf(Strings.guestUser,f[1]):g.o[h],score:g.c[h],prevScore:g.c[h],streak:g.d?g.d[h]:Math.floor(Math.random()*10),avatar:Util.getAvatar(g.o[h],g.a&&g.a[h]),isGuest:!!f,winnings:g.w&&g.w[h]||0,ready:g.v&&g.v[h],userPos:h%constants.userColors.length};currentRoom.users[h].userColor=constants.userColors[currentRoom.users[h].userPos];currentRoom.users[h].userPosSelf=(g.o[h]==AJ.username)?"self":currentRoom.users[h].userPos;currentRoom.usernameMap[g.o[h]]='<span class="user user'+currentRoom.users[h].userPosSelf+'">'+currentRoom.users[h].displayedUsername+"</span>";Chat.addUserRx(f?f[1]:g.o[h],g.o[h],!!f);currentRoom.indexByUser[g.o[h]]=currentRoom.scoreHistory.indexByUser[g.o[h]]=h;currentRoom.scoreHistory.userInfo[h]=currentRoom.users[h];currentRoom.scoreHistory.usernames[h]=g.o[h];currentRoom.scoreHistory.scores[0][h]=g.c[h];var n=currentRoom.users[h].userCache=UserCache.add(g.o[h]);if(!n.isGuest){n.setAvatar(currentRoom.users[h].avatar)}n.setRoom(currentRoom.title,currentRoom.id)}UserList.selfStatus=currentRoom.users.length>1?3:1;Hash.reHash();Chat.addActivity(Util.sprintf(Strings.youJoinedRoom,escapeHTML(a.title)),AJ.username);var b=Util.read("guestNick");if(p){if(AJ.userType){Request.callbacks.byebye({u:g.u})}else{Util.updateCreateGameTitle();if((b&&"G["+b+"]")!=g.u){if(AJ.changedNick){AJ.changedNick=false}Chat.addActivity(Util.sprintf(AJ.username?Strings.youNewNick:Strings.youFirstNick,currentRoom.usernameMap[g.u]),AJ.username)}else{if(!AJ.changedNick){AJ.changedNick=true}}_s($.nick,"innerHTML",currentRoom.users[currentRoom.indexByUser[g.u]].displayedUsername)}}Util.initRoom(!!g.L);_sC($.moneyWon,"innerHTML",Util.printMoney(0));_sC($.moneyLeft.style,"display",currentRoom.roomInfo.bet?"":"none");_r($.questionContainer,"className",RX.cls.betFree,currentRoom.roomInfo.bet&&"bet"||"free");UI.afterApplyOnce.push(Chat.updateHeight);if(currentRoom.roomInfo.bet){Util.updateMoneyLeft();if(currentRoom.users.length==1){Quiz.disableReadyButton()}else{Quiz.enableReadyButton()}}else{Quiz.enableReadyButton()}if(showRoomOnJoin){Window.show("play");showRoomOnJoin=false}var h,d;for(h=0;d=recentRooms[h];h++){if(d.id==a.id){recentRooms.splice(h,1);a.joins+=d.joins;break}}recentRooms.push(a);Util.updateJoinRoomPopup();if(variables.currentWindow==Window.findRoomWindow){makeRecentRooms()}if(g.u&&RX.other.etc3.test(g.u)&&(!b||g.u!="G["+b+"]")){if(variables.currentWindow=="play"){Balloons.changeNick.show()}else{variables.changeNickBalloon=true}}else{variables.changeNickBalloon=false}try{if(pageTracker){pageTracker._trackEvent(currentRoom.roomInfo.bet?"PaidRoom":"FreeRoom","Joined")}}catch(k){throwError("Google Analytics failed on tracking event.",true)}},joins:function(e){if(currentRoom.roomInfo.bet&&currentRoom.users.length==1){Quiz.enableReadyButton()}if(typeof e.u=="string"){if(typeof e.d=="undefined"){console.warn("JOIN message is incomplete, parameter <<d>> is missing. Generating random value for diversity.");e.d=Math.floor(Math.random()*10)}e.u=[e.u];e.s=[e.s];e.d=[e.d];e.a=[e.a]}var g=currentRoom.scoreHistory.scores.last();for(var c=0,b=e.u.length;c<b;c++){if(typeof e.d=="undefined"){console.warn("JOIN message is incomplete, parameter <<d>> is missing. Generating random value for diversity.")}var d=e.u[c].match(RX.other.extractGuestNick);var a;currentRoom.users.push(a={username:e.u[c],displayedUsername:d?Util.sprintf(Strings.guestUser,d[1]):e.u[c],score:e.s[c]||0,prevScore:e.s[c]||0,streak:e.d?e.d[c]:Math.floor(Math.random()*10),avatar:Util.getAvatar(e.u[c],e.a&&e.a[c]),isGuest:!!d,winnings:0,userPos:currentRoom.users.length%constants.userColors.length});a.userCache=UserCache.add(a.username);a.userCache.setAvatar(a.avatar);a.userCache.setRoom(currentRoom.title,currentRoom.id);a.userCache.idleSince=null;a.userColor=constants.userColors[a.userPos];a.userPosSelf=a.userPos;currentRoom.usernameMap[e.u[c]]='<span class="user user'+a.userPosSelf+'">'+a.displayedUsername+"</span>";Chat.addUserRx(d?d[1]:e.u[c],e.u[c],!!d);currentRoom.indexByUser[e.u[c]]=currentRoom.users.length-1;if(typeof currentRoom.scoreHistory.indexByUser[e.u[c]]=="undefined"){currentRoom.scoreHistory.indexByUser[e.u[c]]=currentRoom.scoreHistory.usernames.length;currentRoom.scoreHistory.usernames.push(e.u[c]);currentRoom.scoreHistory.userInfo.push(a);g[currentRoom.scoreHistory.indexByUser[e.u[c]]]=e.s[c]||0}else{var f=currentRoom.scoreHistory.indexByUser[e.u[c]];currentRoom.scoreHistory.userInfo[f]=a;if(!g[currentRoom.scoreHistory.indexByUser[e.u[c]]]){g[currentRoom.scoreHistory.indexByUser[e.u[c]]]=e.s[c]||0}}}Chat.addActivity(Util.sprintf(Strings.userJoin,e.u.mapTo(currentRoom.usernameMap).joina()),null);if(currentRoom.roomInfo.bet){Util.updateMoneyLeft();Util.updateVotingStatus()}UserList.addNewUsers();UserList.sortUsers()},leaves:function(f){if(typeof f.r=="undefined"){console.warn("LEAVE message from server is missing parameter <<r>>.")}if(typeof f.u=="string"){f.u=[f.u];f.r=[f.r]}UserList.removeUsers(f.u);var c,e,d,b=Util.read("guestNick");for(e=0,d=f.u.length;e<d;e++){c=currentRoom.indexByUser[f.u[e]];var a=f.u[e].match(RX.other.extractGuestNick);if(f.u[e]=="G["+b+"]"&&RX.other.etc3.test(AJ.username)&&AJ.username!=f.u[e]){Request.changeNick(b)}Chat.addActivity(Util.sprintf(Strings.userLeft,currentRoom.usernameMap[f.u[e]],Strings.leaveReason[f.r[e]]||""),null);Chat.removeUserRx(a?a[1]:f.u[e],!!a)}for(e=0;e<d;e++){UserCache.userLeftRoom(f.u[e]);currentRoom.users.splice(currentRoom.indexByUser[f.u[e]],1);delete currentRoom.indexByUser[f.u[e]]}for(e=0,d=currentRoom.users.length;e<d;e++){currentRoom.indexByUser[currentRoom.users[e].username]=e}if(currentRoom.roomInfo.bet){Util.updateMoneyLeft();Util.updateVotingStatus();if(currentRoom.users.length==1){Quiz.disableReadyButton()}}},p:function(a){if(a.o){Util.setLag(new Date().valueOf()-a.o)}if(a.i){Request.ping(false,a.i)}},chat:function(a){if(a.u){Chat.addMsg(a);Activity.notify(Strings.notifyNewMsg)}else{Chat.addServerMsg(a.m)}},questionList:function(a){Questions.list(a)},addedQuestion:function(a){Questions.added(a)},updatedQuestion:function(a){Questions.updated(a)},deletedQuestion:function(a){Questions.deleted(a)},imagePath:function(f){if(f.p.indexOf(">")>-1||f.p.indexOf("<")>-1){f.p="-1"}if(RX.general.natural.test(f.p)){Util.info(Util.sprintf(Strings.uploadAvatarFailed,f.p-0),Strings.Avatar);return}var c=AJ.avatar&&AJ.avatar.substr(constants.avatarPath.length);if(f.p==c){return}var d=f.p.match(RX.other.etc4)[0];var b='<img src="'+constants.avatarPath+f.p+'" alt="'+d+'" />';var e=document.getElementById("avatarStatus");as(e);_s(e,"innerHTML",b);Request.callbacks.changeAvatar({u:AJ.username,a:f.p});if(c&&c!=constants.avatars.none){var a;if((a=AJ.previousAvatars.indexOf(f.p))>-1){AJ.previousAvatars.splice(a,1)}if(!constants.avatars.extra.contains(c)){AJ.previousAvatars.push(c);Util.tryUpdateAvatarOptions()}}},changeAvatar:function(b){var c=Util.getAvatar(b.u,b.a);var a=currentRoom.users[currentRoom.indexByUser[b.u]];a.avatar=c;_s(a.avatarImage,"src",a.avatar);if(b.u==AJ.username){AJ.avatar=c;_s($.avatar,"src",AJ.avatar)}UserList.updateUserInfo()},nickChange:function(d){var k,h=d.t.match(RX.other.extractGuestNick);UserCache.userLeftRoom(d.f);var e=UserCache.add(d.t);var f=e.displayName;var b=currentRoom.usernameMap[d.f],a;if(currentRoom&&currentRoom.users){var c=currentRoom.users[currentRoom.indexByUser[d.f]];c.username=d.t;c.userCache=e;e.setRoom(currentRoom.title,currentRoom.id);c.displayedUsername=f;delete currentRoom.usernameMap[d.f];a=currentRoom.usernameMap[d.t]='<span class="user user'+c.userPosSelf+'">'+c.displayedUsername+"</span>";currentRoom.indexByUser[d.t]=currentRoom.indexByUser[d.f];delete currentRoom.indexByUser[d.f];c.avatar=constants.avatarPath+constants.avatars.guest;_s(c.avatarImage,"src",c.avatar);var g=currentRoom.scoreHistory.indexByUser[d.f];currentRoom.scoreHistory.usernames[g]=d.t;delete currentRoom.scoreHistory.indexByUser[d.f];currentRoom.scoreHistory.indexByUser[d.t]=g;UserList.updateUserInfo(d.t)}Chat.addUserRx(h?h[1]:d.t,d.t,!!h);if(d.f==(variables.expectingNickChangeFrom||AJ.username)){delete variables.expectingNickChangeFrom;Util.updateUsername(d.t);AJ.changedNick=true;_sC($.changeNickDiv.style,"display","none");Field.empty($.changeNickInput);Chat.addActivity(Util.sprintf(Strings.youChangedNick,a),d.t)}else{Chat.addActivity(Util.sprintf(Strings.userChangedNick,b,a),d.t)}Chat.removeUserRx(k?k[1]:d.f,!!k)},precache:function(a){if(a.i){Util.cacheImg(RX.other.http.test(a.i)?a.i:("qimg/"+a.i))}if(a.m){if(typeof a.m=="string"){console.warn("Map JSON received inside string");if(a.m.indexOf("M")>=0){a.m=a.m.replace(/([a-zA-Z])/g,'"$1"');console.warn("Map JSON is in old format")}constants.maps[a.mId]=parseJSON(a.m)}else{constants.maps[a.mId]=a.m}}if(a.n){Util.loadScript("/maps/"+a.n,function(){if(Quiz.q&&Quiz.q.mId&&constants.maps[Quiz.q.mId]){Map.setMap(constants.maps[Quiz.q.mId]);Map.drawMap()}})}},languageList:function(a){if(a.i instanceof Array){languages={names:a.l,codes:a.c,ids:a.i}}else{languages={names:[a.l],codes:[a.c],ids:[a.i]}}LanguageList.reloadLanguages()},exception:function(c){switch(c.t){case 1:if(!c.noStop){Request.stop(true)}Quiz.clearQuestion(true,Strings.reconnecting);AJ.playerId=null;AJ.serverId=null;variables.firstJoin=true;currentRoom=lastSetRoom=null;Hash.loadHash();Request.start();break;case 2:if(!Balloon.exists("unavailableNickBalloon")){if(_g($.changeNickDiv.style,"display")=="none"){changeNick({target:$.nick},true)}Balloon.show(Strings.x2,$.changeNickInput,"unavailableNickBalloon");setTimeout(function(){Balloon.tryHide("unavailableNickBalloon")},20000)}break;case 3:Quiz.clearQuestion(false,Strings.x3);break;case 4:Util.info(Strings.x4);break;case 5:console.warn(Util.sprintf(Strings.x5,c.n));break;case 6:location.hash=location.hash.replace(RX.other._20g," ").replace(RX.other._23g,"#").replace(RX.hash.room,"#").replace("##","#");if(currentRoom){Hash.reHash()}else{if(Hash.savingHash){Hash.savingHash=null;Hash.rehashTimeout=null}}if(!Hash.savingHash){Hash.loadHash()}break;case 7:Chat.addServerMsg(Strings.x7);var b=new Date().valueOf(),a=0;while(a<variables.x7.length&&b-variables.x7[a]>1000){a++}if(a){variables.x7.splice(0,a)}variables.x7.push(b);if(!Request.statusReq||variables.x7.length==3){variables.x7=[];Request.stop(true)}break;case 8:Chat.addServerMsg(Strings.x8);break;default:var d=Strings.serverExceptionMsg[c.t]||Util.sprintf(Strings.xx,c.t);Chat.addServerMsg(d);Util.info(d)}},newAccResult:function(a){if(a.r==0){if(variables.currentWindow=="login"){Window.show("play")}Chat.addServerMsg(Strings.newAccCreated);Request.callbacks.welcome({t:1,i:AJ.session,u:variables.createAccUsername,sc:UserCache.users[variables.createAccUsername]&&UserCache.users[variables.createAccUsername].points});Util.info(Strings.newAccResp[0]);Field.empty(document.getElementById("createUsername"));Field.empty(document.getElementById("createPassword"));Field.empty(document.getElementById("createPassword2"));Field.empty(document.getElementById("createEmail"))}else{Util.info(Strings.newAccResp[a.r]||Util.sprintf(Strings.newAccErrUnkn,a.r));Window.show("login")}},break_:function(a){Quiz.break_(a)},endOfMatch:function(d){var t,a,f;if(currentRoom.roomInfo.bet){_sC($.moneyLeft.style,"display","none");UI.afterApplyOnce.push(Chat.updateHeight);if(!d.n){d.n=[];d.v=[]}var p=[];for(var f=0;f<d.n.length;f++){if(currentRoom.users[currentRoom.indexByUser[d.n[f]]].winnings<d.v[f]){p.push(d.n[f])}if(currentRoom.users[currentRoom.indexByUser[d.n[f]]].winnings!=d.v[f]){currentRoom.users[currentRoom.indexByUser[d.n[f]]].winnings=d.v[f]}}Chat.addPayMsg(Util.sprintf(p.length<2?Strings.wonGameOne:Strings.wonGameMany,p.mapTo(currentRoom.usernameMap).joina()))}for(var f=0;f<currentRoom.users.length;f++){currentRoom.users[f].userCache.addPoints(currentRoom.users[f].score)}UserList.updateUserInfo();var r,n,c=currentRoom.users.length,b=currentRoom.users[currentRoom.indexByUser[AJ.username]].score;var k=[];var q="matchLost";if(b==currentRoom.users[0].score){t="youFirst";q="matchWon"}else{if(currentRoom.users.length>1&&b==currentRoom.users[1].score){t="youSecond"}else{if(currentRoom.users.length>2&&b==currentRoom.users[2].score){t="youThird"}else{f=currentRoom.indexByUser[AJ.username];while(f&&currentRoom.users[f-1].score==currentRoom.users[f].score){f--}n=f+1;t="youPlace";k.push(n)}}}var g=currentRoom.users[currentRoom.indexByUser[AJ.username]].winnings;if(currentRoom.roomInfo.bet){t+="Game";k.push(Util.printMoney(g))}else{t+="Round"}t=Strings[t];if(k.length){t=Util.sprintf.apply(Util,[t].concat(k))}_s($.waitBreakEOMMessage,"innerHTML",t);if(g){_s($.moneyWon,"innerHTML",Util.printMoney(g));Request.callbacks.balance({b:AJ.balance+g,gameWinnings:true})}UI.afterApplyOnce.push(Graph.drawEomGraph);if(question){question.EOM="wait";question.eomWait=d.ti}if(variables.currentWindow=="qreview"){QuestionHistory.updateLast()}variables.wasEOMbefore=true;if(AJ.userType&&b&&b>=currentRoom.roomInfo.questionCount*100*0){Account.updatePoints(Account.points+b)}Quiz.updateQuestionPosition(true);Sound.play(q);PlayZone.paint();try{if(pageTracker){pageTracker._trackEvent(currentRoom.roomInfo.bet?"PaidRoom":"FreeRoom","Ended")}}catch(h){throwError("Google Analytics failed on tracking event.",true)}},passwordHasBeenReset:function(a){User.passwordHasBeenReset(a)},passwordResetRequestResult:function(a){User.passwordResetRequestResult(a)},updateInfoResult:function(a){User.updateInfoResult(a)},noEnterRoom:function(a){switch(a.r){case 1:Util.info(Strings.mustLogIn,Strings.enterRoomErr);break;case 2:Util.info(AJ.userType?Strings.notEnoughMoneyToJoin:Strings.mustLogIn,Strings.enterRoomErr);break;case 3:Util.info(Strings.gameAlreadyStarted,Strings.enterRoomErr);break;case 4:Util.info(Strings.roomIsFull,Strings.enterRoomErr);break}if(!currentRoom){Request.callbacks.exception({t:6})}},balance:function(b){var a=b.b-AJ.balance;if(b.gameWinnings){Account.addPaymentInfo({ammount:a,type:5},currentRoom.id)}else{if(b.m){Account.addPaymentInfo({ammount:a,type:0},b.d||user.email,b.m)}}AJ.balance=b.b;Util.updateBalances();Util.info(Util.sprintf(b.gameWinnings?Strings.newBalanceGame:Strings.newBalance,a,AJ.balance),constants.appName)},voteStart:function(a){currentRoom.users[currentRoom.indexByUser[a.n]].ready=!!a.v;UserList.updateUserInfo(a.n);Util.updateVotingStatus()},starting:function(a){Quiz.starting(a.ti);UserList.updateUserInfo()},paid:function(a){if(!a.r){AJ.balance-=a.x;Util.updateBalances()}switch(a.r){case 0:Account.addPaymentInfo({ammount:a.x,type:1},a.d,a.m);Util.info(Util.sprintf(Strings.extractStart,a.x,a.m));break;case 1:Util.info(Util.sprintf(Strings.extractCash,a.x));break;case 2:Util.info(Strings.mustLogIn);break;default:Util.info(Strings.extractUnknownError)}},paymentConfirmation:function(c){if(c.r){AJ.balance+=c.x;Util.updateBalances();Account.addPaymentInfo({ammount:c.x,type:3},Account.email,c.m)}else{Account.addPaymentInfo({ammount:c.x,type:2},Account.email,c.m)}var a=[Strings.paymentConfirmation[c.r],c.x,c.d];if(c.r!=1){a.push(c.m)}var b=Util.sprintf.apply(Util,a);Util.info(b)},topUsers:function(c){var b="<table><tbody>";for(var a=0;a<c.u.length;a++){b+='<tr><td class="place">'+(c.b+a+1)+'.</td><td class="user"><span>'+c.u[a]+'</span></td><td class="score"><span>'+Util.sprintf(Strings.kpoints,c.c[a])+"</span></td></tr>"}b+="</tbody></table>";_s($.homeTopUsers,"innerHTML",b);_s($.homeTopUsersLoader.style,"display","none")},mpay:function(a){Merchants.goStage2("MobilPay",a)},inviteBonus:function(a){Chat.addServerMsg(Util.sprintf(Strings.inviteBonus,currentRoom.usernameMap[a.w],a.s))},ro:function(a){}};Request.initCallbacks=function(){Request.callbacks.q=Request.callbacks.question;Request.callbacks.m=Request.callbacks.mask;Request.callbacks.a=Request.callbacks.answer;Request.callbacks.rs=Request.callbacks.roomInfos;Request.callbacks.r=Request.callbacks.roomInfo;Request.callbacks.w=Request.callbacks.welcome;Request.callbacks.pC=Request.callbacks.passwordChanged;Request.callbacks.bb=Request.callbacks.byebye;Request.callbacks.e=Request.callbacks.enterRoom;Request.callbacks.j=Request.callbacks.joins;Request.callbacks.l=Request.callbacks.leaves;Request.callbacks.p=Request.callbacks.pong;Request.callbacks.c=Request.callbacks.chat;Request.callbacks.aQ=Request.callbacks.addedQuestion;Request.callbacks.uQ=Request.callbacks.updatedQuestion;Request.callbacks.qL=Request.callbacks.questionList;Request.callbacks.dQ=Request.callbacks.deletedQuestion;Request.callbacks.cA=Request.callbacks.changeAvatar;Request.callbacks.iP=Request.callbacks.imagePath;Request.callbacks.pr=Request.callbacks.precache;Request.callbacks.lL=Request.callbacks.languageList;Request.callbacks.x=Request.callbacks.exception;Request.callbacks.b=Request.callbacks.break_;Request.callbacks.eom=Request.callbacks.endOfMatch;Request.callbacks.pR=Request.callbacks.passwordHasBeenReset;Request.callbacks.pRRR=Request.callbacks.passwordResetRequestResult;Request.callbacks.uIR=Request.callbacks.updateInfoResult;Request.callbacks.nER=Request.callbacks.noEnterRoom;Request.callbacks.v=Request.callbacks.voteStart;Request.callbacks.st=Request.callbacks.starting;Request.callbacks.ph=Account.updatePaymentInfoFromServer;Request.callbacks.pd=Request.callbacks.paid;Request.callbacks.n=Request.callbacks.nickChange;Request.callbacks.tu=Request.callbacks.topUsers;Request.callbacks.ib=Request.callbacks.inviteBonus;Request.callbacks.u=UserCache.handleServerUpdate;Request.callbacks.i=Request.callbacks.idle};var lastSetRoom=null;var Quiz={baseTimerIntervalDelay:100,timeout:null,timerInterval:null,q:null,waiting:true,firstWait:true,timePrefix:"",setRoom:function(a,c,b){var d=(a.id||a.tag)?a:domainsHash.byTag[a]||(lastSetRoom&&lastSetRoom.tag==a?lastSetRoom:{tag:a});if(lastSetRoom==d){return}if(!b&&Request.started&&currentRoom&&currentRoom.roomInfo.bet&&!(question&&question.EOM)){Alert.choice(Strings.leavePayGameMsg,[Strings.leavePayGameNo,Strings.leavePayGameYes],function(e){if(e){Quiz.setRoom(d,c,true)}});return}lastSetRoom=d;Hash.reHash();if(c){showRoomOnJoin=true}Request.setRoom(d)},setRoomFromHash:function(a){if(lastSetRoom&&lastSetRoom.id==a){return}if(a.charAt(4).toUpperCase()=="P"){Alert.choice(Strings.enterUrlPayGameMsg,[Strings.enterUrlPayGameNo,Strings.enterUrlPayGameYes],function(b){if(b){Quiz.setRoom({id:a})}});if(!currentRoom){Quiz.setRoom(constants.defaultRoom)}}else{Quiz.setRoom({id:a})}},answer:function(b){if(PlayZone.isPreview()&&Questions.randomizeAnswers(Questions.q)){PlayZone.lastPaintState=null;PlayZone.paint()}if(PlayZone.isMapDebug()){var a=Util.sprintf(Strings.youClickedShape,b+1);console.log("["+getTime()+"] "+a);Chat.addServerMsg(a)}if(!PlayZone.isGame()){return}variables.currentAnswer=b;b++;Chat.addGameMsg(Util.sprintf(Strings.ansPlsWait,(question.answers?question.answers[b-1]:b)));lastAnswer=b;question.lA=[b];Request.sendAnswer(b);Quiz.freezeTimer();if(question.type==5){Map.setFixedColor(b,[128,128,255])}PlayZone.paint()},answerCheckboxes:function(){if(PlayZone.isPreview()&&Questions.randomizeAnswers(Questions.q)){PlayZone.lastPaintState=null;PlayZone.paint()}if(!PlayZone.isGame()){return}var c,b=[];var a=[];for(c=0;c<question.answers.length;c++){if(Checkbox.isChecked(document.getElementById("cb"+c))){b.push(c+1);a.push(question.answers[c])}}Chat.addGameMsg(Util.sprintf(Strings.ansPlsWaitCbx,a.join()));lastAnswer=question.lA=b;Request.sendAnswer(b);Quiz.freezeTimer();PlayZone.paint()},answerSort:function(){if(!PlayZone.isGame()){return}var c,b=[],a=[];for(var c=0;c<$.sorted.childNodes.length;c++){b.push($.sorted.childNodes[c].id.match(RX.other.sbD)[1]-0+1);a.push(question.answers[b[c]-1])}Chat.addGameMsg(Util.sprintf(Strings.ansPlsWait,a.join()));lastAnswer=question.lA=b;Request.sendAnswer(b);Quiz.freezeTimer();PlayZone.paint()},answerText:function(){if(PlayZone.isPreview()&&Questions.randomizeAnswers(Questions.q)){PlayZone.lastPaintState=null;PlayZone.paint()}if(!PlayZone.isGame()){return}if(Field.isEmpty($.ansText)||(question.type==3&&question.mask.length!=$.ansText.value.length)){return}lastAnswer=variables.currentAnswer=Field.value($.ansText);question.lA=[lastAnswer];Chat.addGameMsg(Util.sprintf(Strings.ansPlsWait,lastAnswer));Request.sendAnswer(lastAnswer);Quiz.freezeTimer();PlayZone.paint()},dontKnow:function(){if(!PlayZone.isGame()){return}Chat.addGameMsg(Strings.plsWaitGiveUp);lastAnswer=variables.currentAnswer=dontKnow;question.lA=[dontKnow];Request.sendAnswer(null);Quiz.freezeTimer();PlayZone.paint()},setQuestion:function(c){Quiz.waiting=false;lastAnswer=null;currentRoom.userLastAnswerTimestamp=null;for(var b=0;b<currentRoom.users.length;b++){delete currentRoom.users[b].userLastAnswer}c.l=c.l||"en";if(c.t==5){c.a=null}if(question){delete question.srvObj}question={id:c.i,type:c.t,answers:c.a,html:c.h,text:c.q,time:c.ti,kw:c.k,lang:c.l,mask:c.m,user:c.u,position:currentRoom.question+1,srvObj:c};variables.currentAnswer=(c.t==3||c.t==4)?"":(c.t==1||c.t==2)?[]:null;var a=Quiz.q;PlayZone.newGameQuestion(Quiz.q=c,a);Chat.addGameMsg("Q: "+c.q);Quiz.timeout=new Date().valueOf()+1000*(question.time);Quiz.startTimer(true);previousQuestions.push(question);if(variables.currentWindow=="qreview"){QuestionHistory.addLast()}while(previousQuestions.length>AJ.qHistorySize){previousQuestions.shift();if(variables.currentWindow=="qreview"){QuestionHistory.removeFirst()}}Quiz.updateQuestionPosition()},updateQuestionMask:function(a,c){question.time+=c;question.mask=question.srvObj.m=a;question.expired=false;variables.currentAnswer=null;lastAnswer=null;currentRoom.userLastAnswerTimestamp=null;for(var b=0;b<currentRoom.users.length;b++){delete currentRoom.users[b].userLastAnswer}Quiz.timeout=new Date().valueOf()+1000*(c);Quiz.startTimer(true);if(variables.currentWindow=="qreview"){QuestionHistory.updateLast()}PlayZone.updateGameQuestionMask(a)},sortBtnClick:function(a){if(PlayZone.isPreview()&&Questions.randomizeAnswers(Questions.q)){PlayZone.lastPaintState=null;PlayZone.paint()}if(!PlayZone.isGame()||lastAnswer!=null){return}if(a.parentNode==$.sortButtonsHolder){_an($.sorted,a);if($.sorted.childNodes.length==question.answers.length-1){_s($.sortSubmit.style,"display","");Button.startHighlight($.sortSubmit)}variables.currentAnswer.push(a.id.match(RX.other.sbD)[1]-0)}else{_an($.sortButtonsHolder,a);if(_g($.sortSubmit.style,"display")!="none"){_s($.sortSubmit.style,"display","none");Button.stopHighlight($.sortSubmit)}variables.currentAnswer.splice(variables.currentAnswer.indexOf(a.id.match(RX.other.sbD)[1]-0),1)}Button.mouseout(a,null);UI.afterApplyOnce.push(function(){($.sortButtons.childNodes[2]||$.sortButtons.childNodes[1]).focus()})},freezeTimer:function(){if(Quiz.timerInterval){Quiz.timePrefix=Quiz.timerText.replace("active","expired");Quiz.waiting=Quiz.firstWait=true;Quiz.tick(true)}},expireQuestion:function(){if(!question||question.expired){return false}question.expired=true;Quiz.stopTimer();Quiz.waiting=Quiz.firstWait=true;PlayZone.paint();return true},answerResult:function(n){if(!question){throwError("Quiz.answerResult: no question received yet!");return}if(!n.r){throwError("Quiz.answerResult: bad call! result.r is missing");return}question.rightAnswer=n.r;var a=n.r instanceof Array?n.r:[n.r];var d,c,l=false;if(PlayZone.isGame()&&question.type==5){if(lastAnswer==a[0]){Map.setFixedColor(a[0],[128,255,255])}else{Map.setFixedColor(a[0],[255,255,128]);Map.setFixedColor(lastAnswer,[255,128,128])}Map.drawMap()}if(typeof a[0]=="number"){if(a.length==1){d=question.answers?question.answers[a[0]-1]:a[0]}else{d=[];for(var c=0;c<a.length;c++){d.push(question.answers[a[c]-1])}d=d.joina("<i>","</i>")}}else{d=a[0]}var h=null,k=null;if(lastAnswer==null){question.answerMsg=d?Util.sprintf(Strings.corAns,'<span class="correct"><strong>'+d+"</strong></span>"):Strings.noAnsCor;h=question.answerMsg;k="noAnswer"}else{if(lastAnswer==dontKnow){question.answerMsg=h=d?Strings.youGaveUp:Util.sprintf(Strings.corAns,'<span class="correct"><strong>'+d+"</strong></span>");k="dontKnow"}else{var f=lastAnswer instanceof Array?lastAnswer:[lastAnswer];var g=f.length==a.length;if(g){if(question.type==3){g=f[0].toLowerCase()==a[0].toLowerCase()}else{for(c=0;c<f.length;c++){if(f[c]!=a[c]){g=false;break}}}}if(g){question.answerMsg=h=Util.sprintf(Strings.youAnsCor,"<span class='correct'><strong>"+d+"</strong></span>");k="rightAnswer";l=true;question.userRightAnswer=true}else{if(question.type<3){f=f.map(function(q,p){return question.answers[q-1]})}question.answerMsg=h=Util.sprintf(Strings.corAns,'<span class="correct"><strong>'+d+"</strong></span>");k="wrongAnswer"}}}if(n.e||n.l){var b=[];if(n.e){b.push(n.e)}if(n.l){b.push('<a target="_blank" href="'+n.l+'">'+Strings.learnMore+"</a>"+(RX.other.wikipedia.test(n.l)?" (Wikipedia)":""))}_s($.waitShowMore,"innerHTML",question.info=b.join("&nbsp;"))}_i($.waitBreakState,"beforeEnd",'<span class="answer">'+h+"</span>");Chat.addGameMsg(h);Sound.play(k);for(c=0;c<currentRoom.users.length;c++){var e=currentRoom.users[c].userLastAnswer;if(e&&typeof e.a==typeof n.r&&(e.a instanceof Array?e.a.equal(n.r):e.a==n.r)){currentRoom.users[c].streak=currentRoom.users[c].streak<0?1:currentRoom.users[c].streak+1;if(currentRoom.users[c].streak==10){Chat.addActivity(Util.sprintf(Strings.streak10,escapeHTML(currentRoom.users[c].displayedUsername)),currentRoom.users[c].username)}}else{currentRoom.users[c].streak=currentRoom.users[c].streak>0?-1:currentRoom.users[c].streak-1}}if(Quiz.timePrefix){Quiz.timePrefix=""}Quiz.break_(n);if(variables.currentWindow=="qreview"){QuestionHistory.updateLast()}return l},break_:function(a){Quiz.waiting=Quiz.firstWait=true;Quiz.timeout=new Date().valueOf()+1000*(a.ti);Quiz.startTimer(true)},startTimer:function(a){if(!Quiz.timerInterval){Quiz.timerInterval=setInterval(Quiz.tick,Quiz.baseTimerIntervalDelay)}if(a){Quiz.tick(true)}},stopTimer:function(){clearInterval(Quiz.timerInterval);Quiz.timerInterval=null},timerText:null,tick:function(e){if(!Quiz.timerInterval){return}var l=UI.timer;if(!e&&Animation.interval&&!l&&Animation.deltaT<=150){return}var f=new Date().valueOf();var h=Quiz.timeout-f-AJ.lag;var k=Quiz.timePrefix+'<span class="active">'+((h%1000<100)?(Math.floor(h/1000)+".0"):(Math.floor(h/100)/10))+"</span>";if(h<2&&question&&question.EOM=="wait"){question.EOM=true;if(!currentRoom.roomInfo.bet){Quiz.timeout=f+(h=question.eomWait*1000)}PlayZone.paint();UI.afterApplyOnce.push(Chat.updateHeight)}var v=null,t=null;if(h<2){t=Quiz.waiting?constants.timerTransition.waiting:"rgb("+constants.timerTransition.colors[2][0]+","+constants.timerTransition.colors[2][1]+","+constants.timerTransition.colors[2][2]+")";v=Strings.Break;if(Quiz.expireQuestion()){if(lastAnswer==null){if(l){_s($.waitBreakAnswer,"innerHTML",Strings.timeXp)}else{$.waitBreakAnswer.innerHTML=Strings.timeXp}}}else{Quiz.stopTimer()}if(variables.currentWindow=="qreview"&&!Quiz.waiting){QuestionHistory.updateLast();l=true}}else{if(Quiz.waiting){v=k;if(Quiz.firstWait){Quiz.firstWait=false;t=constants.timerTransition.waiting}}else{if(k==Quiz.timerText){return}var a,n,u;h/=1000;if(h>=constants.timerTransition.moments[0]){a=constants.timerTransition.colors[0][0];n=constants.timerTransition.colors[0][1];u=constants.timerTransition.colors[0][2]}else{if(h>=constants.timerTransition.moments[1]){var c=(h-constants.timerTransition.moments[1])/constants.timerTransition.moments[1];var d=1-c;a=Math.round(constants.timerTransition.colors[0][0]*c+constants.timerTransition.colors[1][0]*d);n=Math.round(constants.timerTransition.colors[0][1]*c+constants.timerTransition.colors[1][1]*d);u=Math.round(constants.timerTransition.colors[0][2]*c+constants.timerTransition.colors[1][2]*d)}else{var c=h/constants.timerTransition.moments[1];var d=1-c;a=Math.round(constants.timerTransition.colors[1][0]*c+constants.timerTransition.colors[2][0]*d);n=Math.round(constants.timerTransition.colors[1][1]*c+constants.timerTransition.colors[2][1]*d);u=Math.round(constants.timerTransition.colors[1][2]*c+constants.timerTransition.colors[2][2]*d)}}v=k;t="rgb("+a+","+n+","+u+")"}}if(v!=Quiz.timerText){Quiz.timerText=v;if(l){_s($.timer,"innerHTML",v);if(t){_s($.timerContainer.style,"backgroundColor",t)}}else{if(!Animation.animating){$.timer.innerHTML=v;if(t){$.timerContainer.style.backgroundColor=t}}}}},keypress:function(c){if(question&&Quiz.q==question.srvObj&&Quiz.q.t<3){var b=c.charCode||c.keyCode;var a=b-"1".charCodeAt(0);if(a>=0&&a<Quiz.q.a.length){var d=["ab","cb","sb"][Quiz.q.t];document.getElementById(d+a).onclick()}}},keydown:function(c){if(question&&Quiz.q==question.srvObj&&Quiz.q.t<3){var b=c.charCode||c.keyCode;var a=b-"1".charCodeAt(0);if(b==13){if(Quiz.q.t==1){$.checkboxSubmit.onclick()}else{if(Quiz.q.t==2){$.sortSubmit.onclick()}}}}},fieldKeyDown:function(b){var a=b.charCode||b.keyCode;if(a==13){$.btnText.onclick();return}if(PlayZone.displayedQ.t!=4){return}if(b.ctrlKey||b.altKey){return}if(b.shiftKey){return false}if(a>40&&a!=32&&!variables.numberCodes[a]&&a!=190&&a!=46&&a!=109){return false}if(a==38){$.ansText.value=($.ansText.value||0)-0+1}else{if(a==40){$.ansText.value=($.ansText.value||0)-1}}return},clearQuestion:function(a,b){if(PlayZone.isGame()){PlayZone.displayedQ=null}Quiz.q=null;PlayZone.showMessage(a!==false,b);Quiz.stopTimer();_s($.timer,"innerHTML",Strings.Break);if(Quiz.retryUpdateInterval){clearInterval(Quiz.retryUpdateInterval);Quiz.retryUpdateInterval=null}},updateQuestionPosition:function(a){},retryUpdateInterval:null,serverError:function(b,a){$_.clear("retryTime");Quiz.clearQuestion(a!=-1,Strings.serverError+(a==-1?(". "+Strings.connectingStopped+". "+HTML.parse('<aj:button action="Request.callbacks.x({t: 1, noStop: true});">'+Strings.btnReconnect+"</aj:button>",{button:true})):(", "+Util.sprintf(Strings.retryIn,'<span id="retryTime">'+Util.approxTimeDelay(Request.retryTimeVal-new Date().valueOf())+"</span>")+HTML.parse('<aj:button action="clearTimeout(Request.startTimeout); Request.startTimeout = null; Request.start();">'+Strings.reconnectNow+"</aj:button>",{button:true}))));if(a!=-1){UI.afterApplyOnce.push(Quiz.scheduleRetryUpdateInterval)}},scheduleRetryUpdateInterval:function(){Quiz.retryUpdateInterval=setInterval(Quiz.updateServerRetryDelay,1000)},updateServerRetryDelay:function(){if(!Quiz.retryUpdateInterval){return}var b=Util.approxTimeDelay(Request.retryTimeVal-new Date().valueOf());var a=$_("retryTime");if(_g(a,"innerHTML")==b){return}if(UI.timer){_s(a,"innerHTML",b)}else{a.innerHTML=b}},startGameHighlight:null,setStartGameHighlight:function(){if(Quiz.startGameHighlight){return}Button.startHighlight(Quiz.startGameHighlight=$_("btnToggleReady"));if(Button.isDown(Quiz.startGameHighlight)){_r(Quiz.startGameHighlight,"className",RX.cls.down,"")}},clearStartGameHighlight:function(){if(!Quiz.startGameHighlight){return}Button.stopHighlight(Quiz.startGameHighlight);Quiz.startGameHighlight=null},setReady:function(a){if(a){Quiz.clearStartGameHighlight()}else{Quiz.setStartGameHighlight()}Request.setReady(a)},startTime:null,starting:function(a){Quiz.startTime=new Date().valueOf()+a*1000;currentRoom.roomInfo.lobby=false;Quiz.clearQuestion(true,Util.sprintf(Strings.startIn,'<span id="startTime">'+Util.approxTimeDelay(a*1000)+"</span>"));Quiz.retryUpdateInterval=setInterval(Quiz.updateStartDelay,1000)},updateStartDelay:function(){if(!Quiz.retryUpdateInterval){return}var a=Quiz.startTime-new Date().valueOf();var b=document.getElementById("startTime");if(a<=0){Quiz.startNow();return}var c=Util.approxTimeDelay(a);if(_g(b,"innerHTML")==c){return}if(UI.timer){_s(b,"innerHTML",c)}else{b.innerHTML=c}},startNow:function(){if(Quiz.retryUpdateInterval){clearInterval(Quiz.retryUpdateInterval);Quiz.retryUpdateInterval=null}Quiz.clearQuestion(false,Strings.waitQ);Quiz.startTime=null;for(var a=0;a<currentRoom.users.length;a++){currentRoom.users[a].ready=null}currentRoom.money=currentRoom.users.length*currentRoom.roomInfo.bet;UserList.updateUserInfo()},enableReadyButton:function(){Button.enable($.btnToggleReady);_sC($.readyInfoPaid.style,"display","none")},disableReadyButton:function(){Button.disable($.btnToggleReady);_sC($.readyInfoPaid.style,"display","")}};var Questions={windowName:"settings",tabFolderName:"tFS",addQTab:2,listQTab:3,questionTextLength:150,questionExplanationLength:400,editing:-1,q:null,addedQ:[],updateFilterTimeout:null,lastFilter:{f:null,b:0,sC:["-valid","-id"]},tableHeader:null,loadingAnimation:false,viewList:function(a){if(a){Questions._viewList()}else{UI.afterApplyOnce.push(Questions._viewList)}},_viewList:function(){document.getElementById(Questions.tabFolderName).childNodes[Questions.listQTab].onclick()},makeTableHeader:function(){Questions.tableHeader='<table id="qList" class="grid" cellpadding="0" cellspacing="0"><thead><tr><th class="sortable number $sortId" onclick="Questions.toggleSort(\'id\', this);">'+Strings.IdHeader+'<span class="sortIcon">&nbsp;</span></th><th>'+Strings.DelHeader+"</th><th>"+Strings.EditHeader+'</th><th class="sortable $sortText" onclick="Questions.toggleSort(\'text\', this);">'+Strings.QHeader+'<span class="sortIcon">&nbsp;</span></th><th class="sortable $sortType" onclick="Questions.toggleSort(\'type\', this);">'+Strings.TypeHeader+'<span class="sortIcon">&nbsp;</span></th><th class="sortable number $sortDiff" onclick="Questions.toggleSort(\'diff\', this);">'+Strings.DifHeader+'<span class="sortIcon">&nbsp;</span></th><th class="$sortDate" onclick="Questions.toggleSort(\'date\', this);">'+Strings.DateHeader+'<span class="sortIcon">&nbsp;</span></th><th class="sortable $sortUser" onclick="Questions.toggleSort(\'user\', this);">'+Strings.UserHeader+'<span class="sortIcon">&nbsp;</span></th></tr></thead><tbody>'},updateFilter:function(a){if(Questions.updateFilterTimeout){clearTimeout(Questions.updateFilterTimeout);Questions.updateFilterTimeout=null}if(a){Questions._updateFilter()}else{Questions.updateFilterTimeout=setTimeout(Questions._updateFilterTimeout,constants.keySensitivity)}},_updateFilterTimeout:function(){Questions._updateFilter()},_updateFilter:function(a,g){if(Questions.updateFilterTimeout){clearTimeout(Questions.updateFilterTimeout);Questions.updateFilterTimeout=null}if(_io(document.getElementById("qList"))){setTimeout(Questions._updateFilterTimeout,10)}var e=false;var c=Questions.lastFilter;if(typeof a!="number"||a<0){a=0}if(!g){s=c.sC}var d=Field.value(document.getElementById("fQF"));if(c.f!==d||c.b!==a||!Util.objectsMatch(c.sC,g)){c.f=d;c.b=a;c.sC=g;Request.updateQFilter(c.f,c.b,null,c.sC);if(!Questions.loadingAnimation){Questions.loadingAnimation=true;Questions._prepareGridResize();_o(document.getElementById("qList"));_i(document.getElementById("qList").parentNode,"beforeEnd",'<table id="qList" style="width: 100%; height: 36px;"><tbody><tr><td class="working" colspan="8"></td></tr></tbody></table>');_sC($.noQuestions.style,"display","none");UI.afterApplyOnce.push(Questions._makeGrid)}}Questions.updateFilterTimeout=null},showAll:function(){Field.empty(document.getElementById("fQF"));Questions._updateFilter(0,["-valid","-id"])},setPageStart:function(a){Questions._updateFilter(a)},setSort:function(b,a){if(a){b="-"+b}Questions._updateFilter(null,[b])},toggleSort:function(c,d){var b=Questions.lastFilter.sC,a;if((a=b.indexOf(c))>-1){b[a]="-"+c;_s(d,"className",_g(d,"className").replace(RX.cls.ascdesc,"")+" desc")}else{if((a=b.indexOf("-"+c))>-1){b[a]=c;_s(d,"className",_g(d,"className").replace(RX.cls.ascdesc,"")+" asc")}else{b=[c];_s(d,"className",_g(d,"className").replace(RX.cls.ascdesc,"")+" asc")}}Questions._updateFilter(null,b)},appendSort:function(d,b){var c=Questions.lastFilter.sC,a;if((a=c.indexOf(d))>-1){c.splice(a,1)}if((a=c.indexOf("-"+d))>-1){c.splice(a,1)}if(b){d="-"+d}c.push(d);Questions._updateFilter(null,c)},clearFields:function(){Field.empty(document.getElementById("nQ1Text"));Field.empty(document.getElementById("nQ1URL"));Field.empty(document.getElementById("nQ1Img"));Field.empty(document.getElementById("nQ1Expl"));ButtonList.setValue(document.getElementById("nQ1R1"),[]);ButtonList.setValue(document.getElementById("nQ1W1"),[]);ButtonList.setValue(document.getElementById("nQ1R2"),[]);ButtonList.setValue(document.getElementById("nQ1W2"),[]);ButtonList.setValue(document.getElementById("nQ1R3"),[]);Field.empty(document.getElementById("nQ1R4"));Field.empty(document.getElementById("nQ1R5"));Field.empty(document.getElementById("nQ1W5"))},add:function(g){var c,h=[],f=[];switch(c=TabFolder.getIndex(document.getElementById("nQ1AnswerSet"))){case 0:h=ButtonList.getValue(document.getElementById("nQ1R1"));f=ButtonList.getValue(document.getElementById("nQ1W1"));break;case 1:h=ButtonList.getValue(document.getElementById("nQ1R2"));f=ButtonList.getValue(document.getElementById("nQ1W2"));break;case 2:h=ButtonList.getValue(document.getElementById("nQ1R3"));break;case 3:h=[Field.value(document.getElementById("nQ1R4"))];break;case 4:h=[Field.value(document.getElementById("nQ1R5"))];f=[Field.value(document.getElementById("nQ1W5"))];if(f[0]===""){f=[]}else{f[0]=parseFloat(f[0],10)}break;case 5:break;default:Util.alert(Strings.badQType);return}if(!$_("nQ1Lang").value){Util.alert(Strings.noQLang);return}var d=document.getElementById("nQ1Keywords").value.split(","),a;if(d.length==1&&d[0]==""){d.pop()}if((a=d.indexOf(Strings.globalTag))>-1){d.splice(a,1);Util.info(Strings.noGlobalTagInQuestions,Strings.addQErrTitle);TagList.removeTag(document.getElementById("nQ1Keywords"),Strings.globalTag)}if(g){var e=Questions.q={i:Questions.editing,q:Field.value(document.getElementById("nQ1Text")),e:Field.value(document.getElementById("nQ1Expl")),u:Field.value(document.getElementById("nQ1URL")),l:languages.idFromCode[document.getElementById("nQ1Lang").value],ra:h,wa:f,t:c,k:d,di:document.getElementById("nQ1Diff").value-0,im:Field.value(document.getElementById("nQ1Img"))};Questions.q.a=f?h.concat(f):h;if(c==3){Questions.q.m=h[0].replace(RX.other.etc9g,"*")}var b=[e.i,e.q,e.e,e.u,languages.idFromCode[e.l],e.ra,e.wa,e.t,e.k,e.di,e.im];if(!Questions.canAdd(b)){return}Questions.randomizeAnswers(Questions.q);PlayZone.showQuestion(Questions.q);_s($.addQfromPreview.style,"display","");Window.show("play")}else{var b=[Questions.editing,Field.value(document.getElementById("nQ1Text")),Field.value(document.getElementById("nQ1Expl")),Field.value(document.getElementById("nQ1URL")),languages.idFromCode[document.getElementById("nQ1Lang").value],h,f,c,d,document.getElementById("nQ1Diff").value-0,Field.value(document.getElementById("nQ1Img"))];if(Questions.canAdd(b)){Questions.addedQ.push(b);Request.addQuestion.apply(Request,b)}}},clearPreview:function(){PlayZone.returnToGame();Questions.q=null},addFromPreview:function(){var b=Questions.q;Questions.clearPreview();var a=[b.i,b.q,b.e,b.u,languages.idFromCode[b.l],b.ra,b.wa,b.t,b.k,b.di,b.im];if(Questions.canAdd(a)){Questions.addedQ.push(a);Request.addQuestion.apply(Request,a)}Window.show(Questions.windowName)},continueEditFromPreview:function(){Questions.clearPreview();Window.show(Questions.windowName)},canAdd:function(e){var h=[];e[1]=escapeHTML(e[1].trim());if(!e[1]){h.push(Strings.noQText)}if(e[1].length>Questions.questionTextLength){h.push(Util.sprintf(Strings.qTextTooLong,Questions.questionTextLength,e[1].length))}e[2]=escapeHTML(e[2].trim());if(e[2].length>Questions.questionExplanationLength){h.push(Util.sprintf(Strings.explTooLong,Questions.questionExplanationLength,e[2].length))}if(e[3]){e[3]=escapeHTML(e[3].trim());if(e[3].length>255){h.push(Strings.infoUrlTooLong)}if(!RX.other.validURLMaybeHash.test(e[3])){h.push(Strings.infoUrlNotValid)}}if(e[5] instanceof Array){for(var d=0;d<e[5].length;d++){e[5][d]=e[5][d].trim()}}if(e[6] instanceof Array&&typeof e[6][0]==="string"){for(var d=0;d<e[6].length;d++){e[6][d]=e[6][d].trim()}}var g=[],f=[];switch(e[7]){case 0:if(e[5].length<1){h.push(Strings.oneCorAns)}if(e[6].length<3){h.push(Strings.threeWrongAns)}if(e[5].length+e[6].length>200){h.push(Strings.max200Ans)}g=e[5].concat(e[6]);break;case 1:if(e[5].length<2){h.push(Strings.twoCorAns)}if(e[6].length<4){h.push(Strings.fourWrongAns)}if(e[5].length+e[6].length>200){h.push(Strings.max200Ans)}g=e[5].concat(e[6]);break;case 2:if(e[5].length<3){h.push(Strings.min3Ans)}if(e[5].length+e[6].length>200){h.push(Strings.max200Ans)}g=e[5];break;case 4:if(!RX.other.etc10.test(e[5][0])){h.push(Strings.nrAnsNotInt)}if(e[6].length&&!RX.other.etc10.test(e[6][0])){h.push(Strings.proximityNotInt)}break}for(var d=0;d<g.length;d++){if(!f.contains(g[d])){if(g[d].length>50){h.push(Util.sprintf(Strings.ansTooLong,escapeHTML(g[d]),g[d].length))}for(var c=d+1;c<g.length;c++){if(g[d]==g[c]){f.push(g[d]);break}}}}if(f.length){h.push(Util.sprintf(Strings.repeatedAnswers,f.joina()))}if(!e[8].length){h.push(Strings.minOneTag)}else{if(e[8].length>20){h.push(Strings.max20Tags)}else{for(var d=0,a=e[8].length;d<a;d++){e[8][d]=e[8][d].trim();if(e[8][d].length>30){h.push(Util.sprintf(Strings.tagTooLong,e[8][d]))}}}}var b=false;for(var d=0,a=e[8].length;d<a;d++){if(fullDomainsHash.byTag[e[8][d]]){b=true;break}}if(!b){h.push(Strings.missingKnownTag)}if(e[9]<1||e[9]>3){h.push(Strings.missingDiff)}var d;if(e[10]){if(!(e[0]&&e[0]>-1&&(d=Questions.lastList.i.indexOf(e[0]))>-1&&e[10]==Questions.lastList.im[d])){e[10]=escapeHTML(e[10].trim());if(e[10].length>255){h.push(Strings.imgUrlTooLong)}if(!RX.other.validURL.test(e[10])){h.push(Strings.imgUrlNotValid)}}}if(h.length){Util.info(h.join("<br />"),Strings.addQErrTitle);return false}else{return true}},del:function(b,a){_a(a,"className"," working");Request.deleteQuestion(b)},getPagingHTML:function(b,a){return Util.getPagingHTML(b,variables.filterQuestionsCount,a,Strings.questionsInterval,Strings.questionsAll,"Questions.setPageStart")},lastList:{i:[],q:[],di:[],e:[],h:[],l:[],k:[],im:[],t:[],r:[],w:[],da:[],u:[]},list:function(d){Questions.loadingAnimation=false;Questions.lastList=d;if(!d.da){console.warn("question list from server is missing arguments <<da>>");d.da=[]}if(!d.q.length){_sC(document.getElementById("qList").style,"display","none");_sC($.questionsPaging.style,"display","none");_sC($.noQuestions.style,"display","")}else{if(!d.b){d.b=0}if(!d.sC){d.sC=["-valid","-id"]}_sC($.questionsPaging.style,"display","");_sC($.questionsPaging,"innerHTML",Questions.getPagingHTML(d.b,d.c));var c={};for(var a=0;a<d.sC.length;a++){if(d.sC[a].charAt(0)=="-"){c[d.sC[a].substr(1)]="desc"}else{c[d.sC[a]]="asc"}}var b=[Questions.tableHeader.replace(/\$sort([A-Z])([a-z]*)/g,function(g,f,e){return c[f.toLowerCase()+e]||""})];for(var a=0;a<d.q.length;a++){b.push("<tr");if(a%2){b.push(' class="alt"')}b.push("><td>",d.i[a],'</td><td class="delete link" onclick="Questions.del(',d.i[a],', this);"><span>',Strings.del,'</span></td><td class="edit link" onclick="Questions.edit(',d.i[a],');">',Strings.edit,"</td><td>",d.q[a],"<br />",Util.sprintf(Strings.tblAnswers,d.r[a] instanceof Array?d.r[a].join(", "):d.r[a]));if(d.t[a]<2){b.push("<br />",Util.sprintf(Strings.tblWrong,d.w[a] instanceof Array?d.w[a].join(", "):d.w[a]))}b.push("</td><td>",Strings.qTypes[d.t[a]],"</td><td>",d.di[a],"</td><td>",(d.da[a] instanceof Date?d.da[a]:getDateTime(Util.getDateFromJSON(d.da[a]))||new Date(1970,0,1),"0"),"</td><td>",d.u[a],"</td></tr>")}b.push("</tbody></table>");b=b.join("");Questions._prepareGridResize();_o(document.getElementById("qList"));_i(document.getElementById("qList").parentNode,"beforeEnd",b);_sC($.noQuestions.style,"display","none");UI.afterApplyOnce.push(Questions._makeGrid)}},_hideNoQ:function(){_s($.noQuestions.style,"display","none")},_prepareGridResize:function(){var a=document.getElementById("qList").parentNode;if(a.offsetHeight){UI.makeExtraHeight(a);_s(a.style,"height",a.offsetHeight-a.extraHeight+"px");a.extraStartHeight=$.noQuestions.offsetHeight;a.lastGridHeight=document.getElementById("qList").offsetHeight}},_makeGrid:function(){var c=document.getElementById("qList");if(c.offsetHeight){var d=c.parentNode,b=parseFloat(_g(d.style,"height")),a=b-d.extraStartHeight+c.offsetHeight-d.lastGridHeight;Animation.addTransition(d,"height",b,a,"px")}},edit:function(d){var a;if((a=Questions.lastList.i.indexOf(d))<0){Util.alert(Util.sprintf(Strings.editQNotFound,d));return}Questions.editing=d;var c=Questions.lastList;Field.setValue(document.getElementById("nQ1Text"),c.q[a]);Field.setValue(document.getElementById("nQ1Expl"),c.e[a]);Field.setValue(document.getElementById("nQ1URL"),c.h[a]);Field.setValue(document.getElementById("nQ1Img"),c.im[a]);document.getElementById("nQ1ImgPic").src=Util.getQuestionImagePath(c.im[a]);LanguageList.setLang(document.getElementById("nQ1Lang"),languages.codeFromId[c.l[a]]);TagList.setValue(document.getElementById("nQ1Keywords"),c.k[a]);var b=document.getElementById("nQ1Diff_"+Math.round(c.di[a]-1));if(b){b.onclick()}else{}document.getElementById("nQ1QuestionType").parentNode.childNodes[c.t[a]+1].onclick();switch(c.t[a]){case 0:ButtonList.setValue(document.getElementById("nQ1R1"),c.r[a]);ButtonList.setValue(document.getElementById("nQ1W1"),c.w[a]);break;case 1:ButtonList.setValue(document.getElementById("nQ1R2"),c.r[a]);ButtonList.setValue(document.getElementById("nQ1W2"),c.w[a]);break;case 2:ButtonList.setValue(document.getElementById("nQ1R3"),c.r[a]);break;case 3:Field.setValue(document.getElementById("nQ1R4"),c.r[a][0]);break;case 4:Field.setValue(document.getElementById("nQ1R5"),c.r[a][0]);if(typeof c.w[a][0]=="number"){Field.setValue(document.getElementById("nQ1W5"),c.w[a][0])}else{Field.empty(document.getElementById("nQ1W5"))}break;case 5:break;default:throwError("Unsupported question type: "+c.t[a]);return}_s(document.getElementById("btnQ1CEd").style,"display","");_s(document.getElementById("btnQ1Add").firstChild,"innerHTML",Strings.btnSaveEdit);TabFolder.setPageTitle(document.getElementById(Questions.tabFolderName),Questions.addQTab,Strings.editQTabTitle);document.getElementById(Questions.tabFolderName).childNodes[Questions.addQTab].onclick();Util.scrollTop(0,offsetBox(document.getElementById(Questions.tabFolderName+"Body"))[1],0.5)},cancelEdit:function(){_s(document.getElementById("btnQ1CEd").style,"display","none");Questions.editing=-1;_s(document.getElementById("btnQ1Add").firstChild,"innerHTML",LStrings[AJ.curLang].html.htmlQAdd);TabFolder.setPageTitle(document.getElementById(Questions.tabFolderName),Questions.addQTab,Strings.addQTabTitle);Questions.clearFields();Questions.viewList();Util.scrollTop(0,offsetBox(document.getElementById(Questions.tabFolderName+"Body"))[1],0.5)},getUpdatedRow:function(b){var d=document.createElement("tr"),a;if(b[0]&&b[0]>-1){d.appendChild(document.createElement("td")).innerHTML=b[0];a=d.appendChild(document.createElement("td"));a.innerHTML="<span>"+Strings.del+"</span>";a.className="delete link";a.onclick=function(){Questions.del(b[0])};a=d.appendChild(document.createElement("td"));a.innerHTML="<span>"+Strings.edit+"</span>";a.className="edit link";a.onclick=function(){Questions.edit(b[0])}}else{a=d.appendChild(document.createElement("td"));a.innerHTML="+";a.colSpan=3}a=null;var c=b[1]+"<br />"+Util.sprintf(Strings.tblAnswers,b[5] instanceof Array?b[5].join(", "):b[5]);if(b[7]<2){c+="<br />"+Util.sprintf(Strings.tblWrong,b[6] instanceof Array?b[6].join(", "):b[6])}d.appendChild(document.createElement("td")).innerHTML=c;d.appendChild(document.createElement("td")).innerHTML=Strings.qTypes[b[7]];d.appendChild(document.createElement("td")).innerHTML=b[9];d.appendChild(document.createElement("td")).innerHTML=getDateTime(new Date(),"0");d.appendChild(document.createElement("td")).innerHTML=AJ.username;try{return d}finally{d=null}},added:function(c){var a=Questions.addedQ.shift(),b=false;if(!a){throwError("Received question-added message without sending an add-question request.")}switch(c.r){case 0:Util.info(Strings.qAdded,Strings.QuestionTitle);b=true;break;case 1:Util.info(Strings.errAddQ,Strings.QuestionTitle);break;case 2:Util.info(Strings.qInDb,Strings.QuestionTitle);break;default:Util.info(Strings.errAddQUnkn,Strings.QuestionTitle);break}if(b){Questions.lastList.i.splice(0,0,c.i||a[0]);Questions.lastList.q.splice(0,0,a[1]);Questions.lastList.e.splice(0,0,a[2]);Questions.lastList.h.splice(0,0,a[3]);Questions.lastList.l.splice(0,0,a[4]);Questions.lastList.r.splice(0,0,a[5]);Questions.lastList.w.splice(0,0,a[6]);Questions.lastList.t.splice(0,0,a[7]);Questions.lastList.k.splice(0,0,a[8]);Questions.lastList.di.splice(0,0,a[9]);Questions.lastList.im.splice(0,0,a[10]);Questions.lastList.da.splice(0,0,new Date());Questions.lastList.u.splice(0,0,AJ.username);Questions.list(Questions.lastList);Questions.clearFields();Util.scrollTop(0,offsetBox(document.getElementById(Questions.tabFolderName+"Body"))[1],0.5)}},updated:function(d){Questions.cancelEdit();var b=Questions.addedQ.shift(),c=false;if(!b){throwError("Received question-edited message without sending an edit-question request.")}switch(d.r){case 0:Util.info(Strings.qUpd,Strings.QuestionTitle);c=true;break;case 1:Util.info(Strings.qUpdErr,Strings.QuestionTitle);break;default:Util.info(Strings.qUpdErrUnkn,Strings.QuestionTitle);break}if(c){var a=Questions.lastList.i.indexOf(b[0]);var e=Questions.lastList.u[a];Questions.lastList.i.splice(a,1);Questions.lastList.q.splice(a,1);Questions.lastList.e.splice(a,1);Questions.lastList.h.splice(a,1);Questions.lastList.l.splice(a,1);Questions.lastList.r.splice(a,1);Questions.lastList.w.splice(a,1);Questions.lastList.t.splice(a,1);Questions.lastList.k.splice(a,1);Questions.lastList.di.splice(a,1);Questions.lastList.im.splice(a,1);Questions.lastList.da.splice(a,1);Questions.lastList.u.splice(a,1);Questions.lastList.i.splice(0,0,b[0]);Questions.lastList.q.splice(0,0,b[1]);Questions.lastList.e.splice(0,0,b[2]);Questions.lastList.h.splice(0,0,b[3]);Questions.lastList.l.splice(0,0,b[4]);Questions.lastList.r.splice(0,0,b[5]);Questions.lastList.w.splice(0,0,b[6]);Questions.lastList.t.splice(0,0,b[7]);Questions.lastList.k.splice(0,0,b[8]);Questions.lastList.di.splice(0,0,b[9]);Questions.lastList.im.splice(0,0,b[10]);Questions.lastList.da.splice(0,0,new Date());Questions.lastList.u.splice(0,0,e);Questions.list(Questions.lastList);Questions.clearFields();Questions.viewList();Util.scrollTop(0,offsetBox(document.getElementById(Questions.tabFolderName+"Body"))[1],0.5)}},getTableRowsWithIds:function(f){var b=document.getElementById("qList").tBodies[0],a=b.rows;var e,d,c=[];for(e=0;e<f.length;e++){for(d=0;d<a.length;d++){if(f[e]==a[d].cells[0].innerHTML){c.push(d);break}}}return c},deleted:function(f){var a=document.getElementById("qList").tBodies[0],e=a.rows;if(typeof f.i.length=="undefined"){f.i=[f.i]}var d,b=Questions.getTableRowsWithIds(f.i);for(d=0;d<b.length;d++){Animate.removeRow(e[b[d]])}for(var c=0;c<f.i.length;c++){d=Questions.lastList.i.indexOf(f.i[c]);if(d>-1){Questions.lastList.i.splice(d,1);Questions.lastList.q.splice(d,1);Questions.lastList.e.splice(d,1);Questions.lastList.h.splice(d,1);Questions.lastList.l.splice(d,1);Questions.lastList.r.splice(d,1);Questions.lastList.w.splice(d,1);Questions.lastList.t.splice(d,1);Questions.lastList.k.splice(d,1);Questions.lastList.di.splice(d,1);Questions.lastList.im.splice(d,1);Questions.lastList.da.splice(d,1);Questions.lastList.u.splice(d,1)}}},randomizeAnswers:function(d){var c;switch(d.t){case 0:if(d.ra.length<1||d.wa.length<3){return false}var e=d.wa.clone();d.a=[];for(c=1;c<4;c++){d.a.push(e.splice((Math.random()*e.length)|0,1)[0])}d.a.splice((Math.random()*(d.a.length+1))|0,0,d.ra[(Math.random()*d.ra.length)|0]);break;case 1:var e=d.ra.concat(d.wa);d.a=[];for(c=0;c<4;c++){d.a.push(e.splice((Math.random()*e.length)|0,1)[0])}break;case 2:var e=d.ra.clone();d.a=[];for(c=0;c<4;c++){d.a.push(e.splice((Math.random()*e.length)|0,1)[0])}break;case 3:d.m=d.ra[0].replace(RX.other.etc9g,"*");var e=[],b;while(b=RX.chr.starg.exec(d.m)){e.push(b.index)}if(e.length<=3){return false}for(c=0;c<3;c++){var a=e.splice((Math.random()*e.length)|0,1)[0];d.m=d.m.substr(0,a)+d.ra[0].charAt(a)+d.m.substr(a+1)}break;default:return false}return true}};var HTML={template:{button:'<span class="button unselectable $class" onmouseover="if (!isIE && !Util.eventIsInside(this, arguments && arguments[0] || event)) { this.onmouseenter(arguments && arguments[0] || event); }" onmouseout="if (!isIE && !Util.eventIsInside(this, arguments && arguments[0] || event)) { this.onmouseleave(arguments && arguments[0] || event); }" onmouseenter="if (!Button.isDisabled(this)) { if (Button.mouseover(this, arguments && arguments[0] || event) === false) return; $mouseover }" onmouseleave="if (Button.mouseout(this, arguments && arguments[0] || event) === false) return; $mouseout" onmousedown="Button.mousedown(this, arguments && arguments[0] || event); return false;" onmouseup="Button.mouseup(this, arguments && arguments[0] || event)" onmousemove="Button.mousemove(this, arguments && arguments[0] || event);" onkeydown="Button.keydown(this, arguments && arguments[0] || event);" onclick="this.delayedClickCheck = null; if (!Button.isDisabled(this)) { Button.clicked(this); $action }" onfocus="Util.focusMovedTo(this);" id="$id" style="$style" title="$title" unselectable="on" tabindex="0">$content</span>',checkbox:'<div class="checkbox unselectable $checked $class" onmouseover="if (!Checkbox.isDisabled(this)) Checkbox.mouseover(this, arguments && arguments[0] || event);" onmouseout="Checkbox.mouseout(this, arguments && arguments[0] || event);" onclick="if (!Button.isDisabled(this)) { Checkbox.click(this, arguments && arguments[0] || event); Checkbox.clicked(this); $action }" onfocus="Util.focusMovedTo(this);" onkeydown="Checkbox.keydown(this, arguments && arguments[0] || event);" id="$id" style="$style" title="$title" unselectable="on" tabindex="0"><span class="checkmark"></span><span class="bcontent">$content</span></div>',window:'<div class="windows"><div class="window opac" style="display: none; $style"><div class="title">$title</div><div class="content">$content</div></div></div>',langItem:'<span class="langItem" tabindex="0">$value</span><aj:button action="LanguageList.btnRemoveItemClicked(this, \'$code\');">-</aj:button><br />',langList:'<div class="langList $class" style="$style" onclick="variables.clickedInPicker = true;"><input id="$id" type="hidden" value="$defLang" onkeydown="$onchange" /><span class="langItems noBtn $simple"><aj:langItem value="$defLang" /></span><aj:button class="$class" action="LanguageList.togglePicker(this);">Choose</aj:button></div>',progressBar:'<span class="progressBar" id="$id" style="$style"><span class="progress" style="width: $value%">&nbsp;</span></span>',select:'<select title="$title" id="$id" onchange="$onchange" onfocus="Field.onfocus(this, arguments && arguments[0] || event);" onblur="Field.onblur(this, arguments && arguments[0] || event);">$options</select>',slider:'<span id="$idSlider" class="slider $class" tabindex="0" onfocus="Slider.onFocus(this);" onblur="Slider.onBlur(this);" onkeydown="return Slider.handleKey(arguments && arguments[0] || event);"><input id="$id" type="hidden" value="$value" min="$min" max="$max" $under $over $formatter $onchange /><div class="sliderLabelHolder"><input class="sliderLabel" value="$label" onchange="Slider.trySetValue(\'$id\', this.value);" onkeydown="Slider.ignoreNextKey = true;" onfocus="this.oldValue = this.value;" /></div><div class="sliderLine">$sliderHeads</div></span>',sliderHead:'<span class="sliderHandle" onmousedown="Slider.grabHandle(this, arguments && arguments[0] || event);" style="$sliderStyle"></span>',tabFolderButton:'<span id="$id_b_$page" tabindex="0" class="pageBtn $class" onmousedown="Button.mousedown(this, arguments && arguments[0] || event); return false;" onmouseup="Button.mouseup(this, arguments && arguments[0] || event)" onclick="this.delayedClickCheck = null; TabFolder.setPage(this, \'$id_$page\');">$value</span>',tagList:'<div id="$id_TagList" class="tagList $class" style="$style" onclick="TagList.select(this);" onfocus="TagList.onFocus(this);" onmousedown="TagList.onMouseDown(this);" tabindex="0"><input type="hidden" id="$id" value="$value" $onchange />$items</div>',tagItem:'<span class="tagItem" onclick="TagList.selectItem(this); stopEvt(arguments && arguments[0] || event);" onkeydown="TagList.itemKeyDown(arguments && arguments[0] || event);" onfocus="TagList.itemFocus(this, arguments && arguments[0] || event);" onblur="TagList.itemBlur(this, arguments && arguments[0] || event);" tabindex="0" tooltiptitle="$tooltip">$value<span class="del" onclick="TagList.removeItem(this.parentNode);">&nbsp;</span></span>',treeToggle:'<span class="treeToggle $state" onclick="TreeToggle.click(this, arguments && arguments[0] || event);">&nbsp;</span>',treeToggleSpacer:'<span class="treeToggle"">&nbsp;</span>',subtree:'<div class="subtree" style="$style">'},rx:{button:/<aj:button(?:\s+id="([^"]+)")?(?:\s+class="([^"]*)")?(?:\s+action="([^"]+)")?(?:\s+title="([^"]+)")?(?:\s+style="([^"]*)")?(?:\s+onmouseover="([^"]*)")?(?:\s+onmouseout="([^"]*)")?\s*>([\s\S]*?)<\/aj:button>/,buttons:/<aj:buttons>([\s\S]*?)<\/aj:buttons>/,checkbox:/<aj:checkbox(?:\s+id="([^"]+)")?(?:\s+checked="([^"]+)")?(?:\s+action="([^"]+)")?(?:\s+class="([^"]*)")?(?:\s+style="([^"]*)")?(?:\s+title="([^"]+)")?\s*>([\s\S]*?)<\/aj:checkbox>/,input:/<aj:(input|textarea)\s+title="([^"]+)"(?:\s+class="([^"]*)")?(?:\s+value="([^"]+)")?(?:\s+onchange="([^"]+)")?(?:\s+type="([^"]+)")?([^>]*>)(<\/textarea)?/,langList:/<aj:langList\s+id="([^"]+)"(?:\s+class="([^"]*)")?(?:\s+style="([^"]*)")?(?:\s+simple="([^"]+)")?(?:\s+onchange="([^"]+)")?\s*\/>/,langItem:/<aj:langItem\s+value="([^"]+)"\s*\/>/,progressBar:/<aj:progressBar(?:\s+id="([^"]+)")?\s+value="([^"]+)"(?:\s+style="([^"]+)")?\s*\/>/,radioSet:/<aj:radioSet\s+id="([^"]+)"(?:\s+class="([^"]*)")?\s+values="([^"]+)"(?:\s+value="([^"]+)")?(?:\s+titles="([^"]+)")?(?:\s+onchange="([^"]+)")?(?:\s+style="([^"]*)")?\s*\/>/,select:/<aj:select(?:\s+title="([^"]+)")?(?:\s+onchange="([^"]+)")?\s+id="([^"]+)"\s*\/>/,slider:/<aj:slider\s+id="([^"]+)"(?:\s+class="([^"]*)")?\s+min="([^"]*)"\s+max="([^"]*)"(?:\s+under="([^"]*)")?(?:\s+over="([^"]*)")?(?:\s+heads="(\d+)")?\s+value="([^"]*)"(?:\s+onchange="([^"]*)")?(?:\s+formatter="([^"]*)")?\s*\/>/,subtree:/<aj:subtree(?:\s+style="([^"]+)")?\s*>/,subtreeEnd:/<\/aj:subtree>/g,tabFolder1:/<aj:tabFolder(?:\s+id="([^"]+)")?(?:\s+startPage="([^"]+)")?\s*>/,tabFolder1g:/<aj:tabFolder(?:\s+id="([^"]+)")?(?:\s+startPage="([^"]+)")?\s*>/g,tabFolder2:/<\/aj:tabFolder>/,tabFolder2g:/<\/aj:tabFolder>/g,tabPage:/<aj:tabPage(?:\s+name="([^"]*)")?(?:\s+style="([^"]*)")?\s*>(.*?)<\/aj:tabPage>/,tagList:/<aj:tagList(?:\s+id="([^"]+)")?(?:\s+class="([^"]*)")?(?:\s+style="([^"]+)")?\s+value="([^"]+)"(?:\s+onchange="([^"]+)")?\s*\/>/,tagItem:/<aj:tagItem\s+value="([^"]+)"\s*\/>/,tooltiptitle:/tooltiptitle=/g,treeToggle:/<aj:treeToggle(?:\s+state="(\w+)")?\s*\/>/,treeToggleSpacer:/<aj:treeToggleSpacer\s*\/>/g,window:/<aj:window\s+title="([^"]+)"(?:\s+style="([^"]*)")?\s*>([\s\S]*?)<\/aj:window>/},nextId:0,all:{tabFolder:true,langList:true,langItem:true,window:true,buttons:true,radioSet:true,button:true,checkbox:true,tagList:true,tagItem:true,input:true,progressBar:true,select:true,slider:true,tree:true},init:function(){HTML.rx.buttong=new RegExp(HTML.rx.button.source,"g")},parseBasicContent:function(a){return HTML.parse(a.replace(/<aj:(langList|select|slider|tagList)[^>]*\/>/g,""))},parse:function(e,u){var l,b,k,q,p,f;u=u||HTML.all;if(u.tabFolder){var A=[],z=[],r=[],v=[];while(l=e.match(HTML.rx.tabFolder1)){e=e.replace_(l[0],"");v.push(l[1]||("generatedId"+HTML.nextId++));A.push(l.index);r.push((l[2]||0)-0)}while(l=e.match(HTML.rx.tabFolder2)){e=e.replace(l[0],"");z.push(l.index);for(q=0;q<A.length;q++){if(A[q]>l.index){A[q]-=l[0].length}}}if(A.length!=z.length){console.log("Error, <aj:tabFolder> and </aj:tabFolder> don't match!")}else{while(A.length){var n=false;for(q=0;!n&&q<A.length;q++){for(p=0;p<z.length;p++){if(z[p]>A[q]&&((q==A.length-1)||(A[q+1]>z[p]))){k=this.makeTabFolder(e.substring(A[q],z[p]),v[q],r[q]);var y=z[p]-A[q]-k.length;for(f=q+1;f<A.length;f++){A[f]-=y}for(f=p+1;f<z.length;f++){z[f]-=y}e=e.substring(0,A[q])+k+e.substr(z[p]);A.splice(q,1);z.splice(p,1);v.splice(q,1);n=true;break}}}}}}if(u.langList){while(l=e.match(HTML.rx.langList)){e=e.replace_(l[0],HTML.template.langList.replace_(RX.v.idg,l[1]).replace_(RX.v.defLangg,AJ.curLang).replace_(RX.v.clsg,l[2]).replace_(RX.v.style,l[3]).replace_(RX.v.simple,l[4]).replace_(RX.v.onchange,l[5]))}}if(u.langItem){while(l=e.match(HTML.rx.langItem)){e=e.replace_(l[0],HTML.template.langItem.replace(RX.v.valueg,languages.map[l[1]]).replace(RX.v.codeg,l[1]))}}if(u.window){while(l=e.match(HTML.rx.window)){e=e.replace_(l[0],HTML.template.window.replace_(RX.v.titleg,l[1]).replace_(RX.v.style,l[2]).replace_(RX.v.content,l[3]))}}if(u.buttons){while(l=e.match(HTML.rx.buttons)){k="";f=l[1].match(HTML.rx.buttong);for(q=0;q<f.length;q++){b=f[q].match(HTML.rx.button);p="";if(!q){p+=" first"}if(q==f.length-1){p+=" last"}if(!p){p=" middle"}k+=HTML.template.button.replace_(RX.v.idg,b[1]||("generatedId"+HTML.nextId++)).replace_(RX.v.clsg,(b[2]||"")+p).replace_(RX.v.action,b[3]).replace_(RX.v.title,b[4]).replace_(RX.v.style,b[5]).replace_(RX.v.mouseover,b[6]).replace_(RX.v.mouseout,b[7]).replace_(RX.v.content,b[8])}e=e.replace_(l[0],"<div>"+k+"</div>")}}if(u.radioSet){while(l=e.match(HTML.rx.radioSet)){val=l[3].split(",");var C=(l[5]||"").split(":");b=val[0].split(":");var h=l[4]||b[0];k='<input id="'+l[1]+'" type="hidden" value="'+h+'" '+(l[6]?'onchange="'+l[6]+'" ':"")+"/>";RadioSets[l[1]]=[];for(q=0;q<val.length;q++){p="";b=val[q].split(":");RadioSets[l[1]].push(b[0]);if(!q){p+=" first"}if(q==val.length-1){p+=" last"}if(!p){p=" middle"}if(b[0]==h){p+=" pressed"}k+=HTML.template.button.replace_(RX.v.idg,l[1]+"_"+b[0]).replace_(RX.v.clsg,(l[2]||"")+p).replace_(RX.v.action,"RadioSet.onclick(arguments && arguments[0] || event, this);").replace_(RX.v.titleg,C[q]).replace_(RX.v.style,"").replace_(RX.v.mouseover,"").replace_(RX.v.mouseout,"").replace_(RX.v.content,b[1]||b[0])}e=e.replace_(l[0],'<div class="radioSet'+(l[2]?" "+l[2]:"")+'"'+(l[7]?' style="'+l[7]+'"':"")+">"+k+"</div>")}}if(u.button){while(l=e.match(HTML.rx.button)){e=e.replace_(l[0],HTML.template.button.replace_(RX.v.idg,l[1]||("generatedId"+HTML.nextId++)).replace_(RX.v.clsg,l[2]||"").replace_(RX.v.action,l[3]).replace_(RX.v.titleg,l[4]).replace_(RX.v.style,l[5]).replace_(RX.v.mouseover,l[6]).replace_(RX.v.mouseout,l[7]).replace_(RX.v.content,l[8]))}}if(u.checkbox){while(l=e.match(HTML.rx.checkbox)){e=e.replace_(l[0],HTML.template.checkbox.replace_(RX.v.idg,l[1]||("generatedId"+HTML.nextId++)).replace_(RX.v.checkedg,l[2]).replace_(RX.v.switchg,l[2]=="checked"?"on":l[2]=="partial"?"half":"off").replace_(RX.v.action,l[3]).replace_(RX.v.clsg,l[4]).replace_(RX.v.style,l[5]).replace_(RX.v.titleg,l[6]).replace_(RX.v.content,l[7]))}}if(u.tagList){while(l=e.match(HTML.rx.tagList)){k="";var B=l[4]=="all"?Strings.globalTag:l[4];f=B.split(RX.other.etc8);for(q=0;q<f.length;q++){k+='<aj:tagItem value="'+f[q]+'" />'}e=e.replace_(l[0],HTML.template.tagList.replace_(RX.v.idg,l[1]).replace_(RX.v.cls,l[2]).replace_(RX.v.style,l[3]).replace_(RX.v.value,B).replace_(RX.v.onchange,l[5]?'onchange="'+l[5]+'"':"").replace_(RX.v.items,k))}}if(u.tagItem){while(l=e.match(HTML.rx.tagItem)){e=e.replace_(l[0],HTML.template.tagItem.replace_(RX.v.value,l[1]).replace_(RX.v.tooltip,domainsHash.byTag[l[1]]&&domainsHash.byTag[l[1]].subcat&&domainsHash.byTag[l[1]].subcat.length?Strings.tagIncludes+" "+domainsHash.byTag[l[1]].subcat.map(function(D,t){return(D.tag==l[1])?D.subcat:D}).reduce().pluck("label").joina("<i>","</i>"):""))}}if(u.input){while(l=e.match(HTML.rx.input)){var g=l[4]?l[4]:("("+l[2]+")");e=e.replace_(l[0],"<"+l[1]+' onfocus="Field.onfocus(this, arguments && arguments[0] || event);" onblur="Field.onblur(this, arguments && arguments[0] || event);" title="'+l[2]+(l[1]=="textarea"?"":'" value="'+g)+'" class="'+l[3]+(l[4]?"":" empty")+(l[5]?'" onchange="'+l[5]:"")+(l[6]?l[6]=="password"?'" type="text" isPassword="true':'" type="'+l[6]:"")+'"'+l[7]+(l[1]=="textarea"?g:"")+(l[8]||""))}}if(u.tree){while(l=e.match(HTML.rx.treeToggle)){e=e.replace_(l[0],HTML.template.treeToggle.replace_(RX.v.stateg,(l[1]&&l[1]=="expanded")?"expanded":"collapsed"))}while(l=e.match(HTML.rx.subtree)){e=e.replace_(l[0],HTML.template.subtree.replace_(RX.v.style,l[1]))}e=e.replace_(HTML.rx.treeToggleSpacer,HTML.template.treeToggleSpacer);e=e.replace_(HTML.rx.subtreeEnd,"</div>")}if(u.progressBar){while(l=e.match(HTML.rx.progressBar)){e=e.replace_(l[0],HTML.template.progressBar.replace_(RX.v.id,l[1]||("generatedId"+HTML.nextId++)).replace_(RX.v.value,l[2]).replace_(RX.v.style,l[3]||""))}}if(u.select){while(l=e.match(HTML.rx.select)){var a="";if(l[3]===constants.countryPickerId){a=HTML.makeOptionsHTML(countries)}e=e.replace_(l[0],HTML.template.select.replace_(RX.v.id,l[3]).replace_(RX.v.title,l[1]).replace_(RX.v.onchange,l[2]).replace_(RX.v.options,a||""))}}if(u.slider){while(l=e.match(HTML.rx.slider)){var d=(l[7]||1)-0;var w=[],x=l[8].split(RX.other.intervalDash),q;for(q=0;q<d;q++){w[q]=HTML.template.sliderHead.replace_(RX.v.sliderStyle,Slider.getStyle(x[q],l[3],l[4],l[5],l[6]));x[q]=x[q]=="under"?l[5]:x[q]=="over"?l[6]:x[q]-0;x[q]=l[10]?Util.getVariableFromStringPath(l[10])(x[q]):String(x[q])}w=w.join("");e=e.replace_(l[0],HTML.template.slider.replace_(RX.v.idg,l[1]).replace_(RX.v.cls,l[2]||"").replace_(RX.v.min,l[3]).replace_(RX.v.max,l[4]).replace_(RX.v.under,l[5]?'under="'+l[5]+'"':"").replace_(RX.v.over,l[6]?'over="'+l[6]+'"':"").replace_(RX.v.value,l[8]).replace_(RX.v.onchange,l[9]?'onchange="'+l[9]+'"':"").replace_(RX.v.formatter,l[10]?'formatter="'+l[10]+'"':"").replace_(RX.v.label,x.join(" \u2013 ")).replace_(RX.v.sliderHeads,w))}}e=e.replace(HTML.rx.tooltiptitle,'onmouseover="if (!this.tt) {this.tt = this.title; this.title = \'\';}; Tooltip.show(arguments && arguments[0] || event, this.tt);" onmousemove="Tooltip.updatePosition(arguments && arguments[0] || event);" onmouseout="Tooltip.hide();" title=');var c="It looks like some <aj:stuff> were not processed. Possible reasons: wrong order of attributes, missing required attributes, invalid values in attributes.";if(typeof as!="undefined"){as(e.indexOf("<aj:")<0,c)}else{if(!(e.indexOf("<aj:")<0)){throw new Error(c+": "+e.substr(e.indexOf("<aj:"),100))}}return e},makeTreeFromDomain:function(b){var a='<aj:treeToggle state="expanded"/><aj:checkbox id="domainTree" action="domainTreeClicked(this);" title="'+Strings.globalTag+'">'+Strings.globalTagName+"</aj:checkbox>";a+=HTML.makeSubDomainTree(b,"","expanded");return a},_makeTreeFromDomain:function(b,c){var a="<div>"+(b.subcat?"<aj:treeToggle/>":"<aj:treeToggleSpacer/>")+'<aj:checkbox action="domainTreeClicked(this);" title="'+b.tag+'">'+b.label+"</aj:checkbox>";if(b.subcat){a+=HTML.makeSubDomainTree(b.subcat,c,"collapsed")}a+="</div>";return a},makeSubDomainTree:function(d,e,c){var b="<aj:subtree"+(c!="expanded"?' style="display: none"':"")+">";for(var a=0;a<d.length;a++){b+=HTML._makeTreeFromDomain(d[a],e+"_"+a)}b+="</aj:subtree>";return b},makeTabFolder:function(f,g,d){var e="",c="",b=0,a;while(a=f.match(HTML.rx.tabPage)){c+=HTML.template.tabFolderButton.replace(RX.v.idg,g).replace(RX.v.pageg,b).replace(RX.v.cls,b!=d?"":" selected").replace(RX.v.value,a[1]||"Tab");e+='<div id="'+g+"_"+b+'" class="tabFolderPage opac" style="'+(b!=d?"display: none;":"")+(a[2]||"")+'">'+a[3]+"</div>";b++;f=f.substr(a[0].length+a.index)}return'<div class="tabFolderHead" id="'+g+'">'+c+'</div><div class="tabFolderBody" id="'+g+'Body">'+e+"</div>"},makeOptionsHTML:function(d,c){var b="";for(var a=0;a<d.length;a++){b+='<option value="'+d[a][0]+'"'+(c==d[a][0]?" selected":"")+">"+(d[a][1]||d[a][0])+"</option>"}return b},setOptions:function(a,d,c){for(var b=a.options.length-1;b>=0;b--){a.remove(b)}for(var b=0;b<d.length;b++){if(typeof d[b]==="string"){d[b]=[d[b]]}a.appendChild(new Option(d[b][1]||d[b][0],d[b][0]),b)}Field.setValue(a,c)}};var Animation={deltaT:50,speed:1000,minFrameT:25,interval:null,animating:false,animatingPosition:-1,lastFrame:null,lastFrameT:null,firstIteration:true,decoyTransition:function(a){return{node:a,isTransition:true,after:function(b){if(b.isTransition){Animation.transitions.push(b);if(!Animation.interval){Animation.interval=setInterval(Animation.animate_,Animation.deltaT)}return b}else{if(b.isAnimation){}else{b.call(a,a)}}}}},list:[],start:[],owner:[],speeds:[],rq:[],finalize:[],transitions:[],getFPS:function(a){return Math.round(10000/(a||Animation.deltaT))/10},animate_:function(){Animation.animate(false)},animate:function(k){Animation.animating=true;UI.timer=2;var a=new Date().valueOf(),f,h;if(!k){var l=a-Animation.lastFrame;if(l>this.deltaT*2&&this.lastFrameT&&this.lastFrameT>this.deltaT*2){h=this.deltaT*1.5}else{if(l>this.deltaT*1.5&&this.lastFrameT&&this.lastFrameT>this.deltaT*1.5){h=this.deltaT*1.2}else{if(this.deltaT>this.minFrameT*1.9&&l<this.deltaT*2&&this.lastFrameT&&this.lastFrameT<this.deltaT*2){h=this.deltaT*0.5}else{if(this.deltaT>this.minFrameT&&l<this.deltaT+10&&this.lastFrameT&&this.lastFrameT<this.deltaT+10){h=this.deltaT*0.8}}}}if(Animation.firstIteration){Animation.firstIteration=false}else{Animation.lastFrameT=l;if(h){h=Math.round(h);Animation.deltaT=h;clearInterval(Animation.interval);Animation.interval=setInterval(Animation.animate_,Animation.deltaT)}}Animation.lastFrame=a}var c,e;for(f=0;e=Animation.list[f];f++){Animation.animatingPosition=f;c=AJ.animations?(a-e.beginTime)/e.speed:1;if(c<1){if(e.timing=="liniar"){}else{c=0.5-Math.cos(c*Math.PI)/2;c=0.5-Math.cos(c*Math.PI)/2}}e.animator.call(e.owner,c);if(c>=1){Animation.rq.push(f)}}Animation.animatingPosition=-1;if(Animation.rq.length){var n=[],b;for(f=0,b=Animation.rq.length;f<b;f++){n[Animation.rq[f]]=true}var g=[],d=[];for(f=0;Animation.list[f];f++){if(!n[f]){g.push(Animation.list[f])}else{if(Animation.list[f].after!=Animation._after){if(Animation.list[f].after.isAnimator){Animation.add(Animation.list[f].after)}else{d.push({owner:Animation.list[f].owner,fct:Animation.list[f].after})}}}}for(f=0;d[f];f++){d[f].fct.call(d[f].owner,d[f].owner)}Animation.rq=[];Animation.list=g;if(!(Animation.list.length+Animation.transitions.length)){clearInterval(Animation.interval);Animation.interval=null;Animation.lastFrame=null;Animation.lastFrameT=null}}if(Animation.finalize.length){for(f=0;e=Animation.finalize[f];f++){e.animator.call(e.owner,1)}Animation.finalize=[]}if(Animation.transitions.length){Animation.animateTransitions(a)}Quiz.tick();Animation.animating=false;UI._apply(2,true)},animateTransitions:function(a){var k=Animation.transitions,f,c=k.length,g=[],b={};var h=[],e=[];for(f=0;f<c;f++){done=AJ.animations?(a-k[f].beginTime)/k[f].speed:1;if(k[f].beforeBegin){k[f].beforeBegin.call(k[f].node);k[f].beforeBegin=null}if(done>=1){k[f].currentValue=!k[f].keep?"":k[f].keep!==true?k[f].keep:k[f].interpret?k[f].interpret(k[f].end):(k[f].end+k[f].unit);_s(k[f].propertyHolder,k[f].prop,k[f].currentValue);k[f].done=1;g.push(f);if(k[f].afterEnd){e.push({node:k[f].node,fct:k[f].afterEnd})}if(k[f].after!=Animation._after){if(k[f].after.isTransition){h.push(k[f].after);k[f].after.beginTime=a}else{if(k[f].after.isAnimation){Animation.addAnimation(k[f].after)}else{e.push({node:k[f].node,fct:k[f].after})}}}}else{k[f].done=done;done=0.5-Math.cos(done*Math.PI)/2;done=0.5-Math.cos(done*Math.PI)/2;k[f].currentValue=k[f].compose?k[f].compose(k[f].begin,k[f].end,done):(k[f].begin+done*(k[f].end-k[f].begin)+k[f].unit);if(k[f].interpret){k[f].currentValue=k[f].interpret(k[f].currentValue)}_sC(k[f].propertyHolder,k[f].prop,k[f].currentValue);if(k[f].afterUpdate){k[f].afterUpdate.call(k[f].node)}}if(done>=1){g.push(f);b[f]=true}}if(g.length){var d=[];for(f=0;f<c;f++){if(!b[f]){d.push(k[f])}}Animation.transitions=k=d}if(h.length){k.pushAll(h)}if(!Animation.list.length&&!Animation.transitions.length){Animation._endAnimation()}for(f=0,c=e.length;f<c;f++){e[f].fct.call(e[f].node,e[f].node)}},add:function(a){return a.isAnimation?Animation.addAnimation(a):a.isTransition?Animation.addTransition(a):Animation.addAnimation.apply(Animation,arguments)},addAnimation:function(a){if(!a.isAnimation){a=Animation.getNewAnimation.apply(this,arguments)}a.beginTime=new Date().valueOf();Animation.list.push(a);if(!Animation.interval){Animation.interval=setInterval(Animation.animate_,Animation.deltaT)}return a},getNewAnimation:function(c,a,b){return{animator:c,owner:a,speed:(b||1)*Animation.speed,after:Animation._after,timing:c.timing,isAnimation:true,isAnimator:true}},addTransition:function(a){if(!a.isTransition){a=Animation.getNewTransition.apply(this,arguments)}a.beginTime=new Date().valueOf();Animation.transitions.push(a);if(!Animation.interval){Animation.interval=setInterval(Animation.animate_,Animation.deltaT)}return a},getNewTransition:function(f,b,d,g,l,a,e){as(f,"node? prop: "+b+", begin: "+d+", end: "+g+", keep: "+a);var h=b in document.body.style?f.style:f;e=(e||1)*Animation.speed;var k,c;if(b.match(RX.other.endsInColor)){k=Util.Color.compose;d=Util.Color.fromCssColor(d);g=Util.Color.fromCssColor(g);c=Util.Color.toCssColor;l=""}else{if(typeof d!="number"){d=parseFloat(_g(h,b)||"0")}if(isNaN(d)){throwError("addTransition: begin is NaN; prop: "+b+"; node: "+Util.getShortestElemPath(f))}if(isNaN(g)){throwError("addTransition: end is NaN; prop: "+b+"; node: "+Util.getShortestElemPath(f))}}return{node:f,prop:b,begin:d,end:g,keep:a,speed:e,unit:l||"",after:Animation._after,compose:k,interpret:c,isTransition:true,isAnimator:true,propertyHolder:h}},remove:function(b){var a=Animation.list.indexOf_(b);if(Animation.animating){Animation.rq.push(a)}else{Animation.list.splice(a,1)}if(Animation.interval&&!Animation.list.length&&!Animation.transitions.length){Animation._endAnimation()}},clear:function(g,a){var d,e,b=[],c=[];if(arguments.length==1||!g){a=g;g=null;for(d=0,e=Animation.list.length;d<e;d++){if(Animation.list[d].owner==a){b.push(d)}}for(d=0,e=Animation.transitions.length;d<e;d++){if(Animation.transitions[d].node==a){c.push(d)}}}else{for(d=0,e=Animation.list.length;d<e;d++){if(Animation.list[d].owner==a&&Animation.list[d].animator==g){b.push(d)}}}if(Animation.animating){for(d=0,e=b.length;d<e;d++){if(!Animation.rq.contains(b[d])){Animation.rq.push(b[d]);Animation.finalize.push(Animation.list[b[d]])}}}else{for(d=0,e=b.length;d<e;d++){b[d]-=d;Animation.list[b[d]].animator.call(Animation.list[b[d]].owner,1);this.list.splice(b[d],1)}}for(d=0,e=c.length;d<c.length;d++){var f=Animation.transitions.splice(c[d]-d,1)[0];f.currentValue=!f.keep?"":f.keep!==true?f.keep:f.interpret?f.interpret(f.end):(f.end+f.unit);_s(f.propertyHolder,f.prop,f.currentValue);if(f.afterEnd){f.afterEnd.call(f.node,f.node)}if(f.after!=Animation._after){if(f.after.isTransition){Animation.transitions.push(f.after);if(f.after.node==f.node){c.push(Animation.transitions.length-1+d+1);e++}}else{if(f.after.isAnimation){Animation.add(f.after)}else{f.after.call(f.node,f.node)}}}}if(Animation.interval&&!Animation.list.length&&!Animation.transitions.length){Animation._endAnimation()}},getTransition:function(b,d){var c;for(var a=0;c=Animation.transitions[a];a++){if(c.node==b&&c.prop==d){return c}}return null},run:function(){Animation.animate(true)},_after:function(a){if(this._after){a.after(this._after)}return this.after=a},_endAnimation:function(){clearInterval(Animation.interval);Animation.interval=null;Quiz.tick()}};var UI={div:document.createElement("div"),init:function(){if(document.body.insertAdjacentHTML){UI.__insertHTMLs=UI.__insertHTMLsAdj}},positionOverBox:function(b,a){UI._positionOverBox(b,a);_s(b.style,"overflow","hidden");_s(b.style,"position","absolute")},_positionOverBox:function(b,a){UI.makeExtraHeight(b);UI.makeExtraWidth(b);_s(b.style,"left",a[0]+"px");_s(b.style,"top",a[1]+"px");_s(b.style,"width",a[2]-b.extraWidth+"px");_s(b.style,"height",a[3]-b.extraHeight+"px")},fromHTML:function(a){UI.div.innerHTML=a;if(UI.div.childNodes.length!=1){console.warn("UI.fromHTML: "+UI.div.childNodes.length+" elements created")}var b=UI.div.firstChild;UI.div.removeChild(b);return b},fromAJ:function(a,b){return UI.fromHTML(HTML.parse(a,b))},makeExtraHeight:function(c){if(typeof c.extraHeight!=="undefined"){return}var b=getStyle(c),a=0;if(b.paddingTop.indexOf("em")>-1){a=c.firstChild.offsetTop-(b.position==="static"?c.offsetTop:0)-(b.borderTopStyle=="none"?0:parseFloat(b.borderTopWidth||"0"));a/=parseFloat(b.paddingTop)}c.paddingHeight=(b.paddingTop.indexOf("em")>-1?parseFloat(b.paddingTop)*a:parseFloat(b.paddingTop||"0"))+(b.paddingBottom.indexOf("em")>-1?parseFloat(b.paddingBottom)*a:parseFloat(b.paddingBottom||"0"));c.borderHeight=(b.borderTopStyle=="none"?0:parseFloat(b.borderTopWidth||"0"))+(b.borderBottomStyle=="none"?0:parseFloat(b.borderBottomWidth||"0"));c.extraHeight=c.paddingHeight+c.borderHeight},makeExtraWidth:function(c){if(typeof c.extraWidth!=="undefined"){return}var b=getStyle(c),a=0;if(b.paddingLeft.indexOf("em")>-1){a=c.firstChild.offsetLeft-(b.position==="static"?c.offsetLeft:0)-(b.borderLeftStyle=="none"?0:parseFloat(b.borderLeftWidth||"0"));a/=parseFloat(b.paddingLeft)}c.extraWidth=(b.paddingLeft.indexOf("em")>-1?parseFloat(b.paddingLeft)*a:parseFloat(b.paddingLeft||"0"))+(b.paddingRight.indexOf("em")>-1?parseFloat(b.paddingRight)*a:parseFloat(b.paddingRight||"0"))+(b.borderLeftStyle=="none"?0:parseFloat(b.borderLeftWidth||"0"))+(b.borderRightStyle=="none"?0:parseFloat(b.borderRightWidth||"0"))},changes:[],toOrphan:[],toAppend:[],toInsert:[],htmlInsert:[],toFocus:null,overridden:0,beforeApplyOnce:[],afterApplyOnce:[],applying:false,reapply:false,clearProps:function(c){var b,a=arguments.length;for(b=1;b<a;b++){_s(c.style,arguments[b],"")}},_get:function(b,c){var a;as(b,"_g: obj?; prop: "+c);as(c,"_g: prop?; obj: <node>",b);if(a=b.uiObj){if(a.hasProp[c]){return a.values[c]}}return b[c]},_set:function(b,d,c){as(b,"_s: obj?; prop: "+d+"; val: "+c);as(d,"_s: prop?; val: "+c+"; obj: <node>",b);as(!RX.general.NaN.test(c),"_s: val is NaN; prop: "+d+"; obj: <node>",b);var a;if(!(a=b.uiObj)){UI.changes.push(b.uiObj=a={obj:b,props:[],hasProp:{},values:{}})}if(!(a.hasProp[d])){a.props.push(d);a.hasProp[d]=true}else{UI.overridden++}if(!UI.timer){UI.scheduleTimer()}return a.values[d]=c},_setCheck:function(c,e,d){as(c,"_sC: obj?; prop: "+e+"; val: "+d);as(e,"_sC: prop?; val: "+d+"; obj: <node>",c);as(!RX.general.NaN.test(d),"_sC: val is NaN; prop: "+e+"; obj: <node>",c);var b,a=true;if(!(b=c.uiObj)){if(c[e]==d){return d}a=false;UI.changes.push(c.uiObj=b={obj:c,props:[],hasProp:{},values:{}})}if(!(b.hasProp[e])){if(a&&c[e]==d){return d}b.props.push(e);b.hasProp[e]=true}else{UI.overridden++}if(!UI.timer){UI.scheduleTimer()}return b.values[e]=d},_clearInsert:function(b,a){as(b,"_ci: node?; position: "+a);as(a,"_ci: position?; node: <node>",b);for(i=0;o=UI.htmlInsert[i];i++){if(o.node==b&&o.position==a){UI.htmlInsert.splice(i,1);return o.html}}return null},_insert:function(d,a,c){as(d,"_i: node?; position: "+a+"; html: "+c);as(a,"_i: position?; node: <node>; html: "+c,d);as(c,"_i: html?; position: "+a+"; node: <node>",d);var b,e;for(b=0;e=UI.htmlInsert[b];b++){if(e.node==d&&e.position==a){e.html=a=="beforeBegin"?c+e.html:a=="afterBegin"?c+e.html:a=="beforeEnd"?e.html+c:a=="afterEnd"?e.html+c:throwError("_i: bad position: "+a);return c}}UI.htmlInsert.push({node:d,position:a,html:c});if(!UI.timer){UI.scheduleTimer()}},_append:function(b,d,c){as(b,"_a: obj?; prop: "+d+"; val: "+c);as(d,"_a: prop?; val: "+c+"; obj: <node>",b);as(c,"_a: val? Did you mean _an?; prop: "+d+"; obj: <node>",b);as(!RX.general.NaN.test(c),"_a: val is NaN; prop: "+d+";obj: <node>",b);var a;if(!(a=b.uiObj)){UI.changes.push(b.uiObj=a={obj:b,props:[],hasProp:{},values:{}})}if(!(a.hasProp[d])){a.props.push(d);a.hasProp[d]=true;a.values[d]=b[d]}if(!UI.timer){UI.scheduleTimer()}return a.values[d]+=c},_replace:function(c,f,b,e){as(c,"_r: obj?; prop: "+f+"; regex: "+b+"; str: "+e);as(f,"_r: prop?; regex: "+b+"; str: "+e+";obj: <node>",c);as(b,"_r: regex?; prop: "+f+"; str: "+e+";obj: <node>",c);var a,d;if(!(a=c.uiObj)){UI.changes.push(c.uiObj=a={obj:c,props:[],hasProp:{},values:{}})}if(!(a.hasProp[f])){a.props.push(f);a.hasProp[f]=true;d=c[f]}else{d=a.values[f];UI.overridden++}if(!UI.timer){UI.scheduleTimer()}return a.values[f]=d.replace(b,e)},_replaceTest:function(d,g,c,f){as(d,"_rT: obj?; prop: "+g+"; regex: "+c+"; str: "+f);as(g,"_rT: prop?; regex: "+c+"; str: "+f+";obj: <node>",d);as(c,"_rT: regex?; prop: "+g+"; str: "+f+";obj: <node>",d);var b,e,a=true;if(!(b=d.uiObj)){if(!c.test(d[g])){return d[g]}a=false;UI.changes.push(d.uiObj=b={obj:d,props:[],hasProp:{},values:{}})}if(!(b.hasProp[g])){e=d[g];if(a&&!c.test(e)){return e}b.props.push(g);b.hasProp[g]=true}else{e=b.values[g];if(!c.test(e)){return e}}if(!UI.timer){UI.scheduleTimer()}return b.values[g]=e.replace(c,f)},_replaceAppend:function(c,f,b,e){as(c,"_ra: obj?; prop: "+f+"; regex: "+b+"; str: "+e);as(f,"_ra: prop?; regex: "+b+"; str: "+e+";obj: <node>",c);as(b,"_ra: regex?; prop: "+f+"; str: "+e+";obj: <node>",c);var a,d;if(!(a=c.uiObj)){UI.changes.push(c.uiObj=a={obj:c,props:[],hasProp:{},values:{}})}if(!(a.hasProp[f])){d=c[f];a.props.push(f);a.hasProp[f]=true}else{d=a.values[f]}if(!UI.timer){UI.scheduleTimer()}return a.values[f]=d.replace(b,"")+e},_makeLastChanges:function(f){var e,c,b,d;if(e=f.uiObj){var a=UI.changes.indexOf(e);UI.changes.push(UI.changes.splice(a,1)[0])}},_changePropLast:function(e,f){var d,b,a,c;if(d=e.uiObj){if(!d.hasProp[f]){return}d.props.splice(d.props.indexOf(f),1);d.props.push(f)}},_orphan:function(a){as(a.parentNode,"_o: Already an orphan! node: <node>",a);as(!UI.toOrphan.contains(a),"_o: Already orphaning! node: <node>",a);UI.toOrphan.push(a);if(!UI.timer){UI.scheduleTimer()}},_appendNode:function(a,b){as(a,"_an: parent?; child: <node>",b);as(b,"_an: child?; parent: <node>",a);UI.toAppend.push([a,b]);if(!UI.timer){UI.scheduleTimer()}},_clearAppendNode:function(b){as(b,"_cAn: parent?");for(var a=0;UI.toAppend[a];a++){if(UI.toAppend[a][0]===b){UI.toAppend.splice(a,1);a--}}},_clearAppendingNode:function(b){as(b,"_cAn2: child?");for(var a=0;UI.toAppend[a];a++){if(UI.toAppend[a][1]===b){UI.toAppend.splice(a,1);a--}}},_insertNode:function(a,c,b){as(a,"_an: parent?; child: <node>",c);as(c,"_an: child?; parent: <node>",a);if(b){as(!_io(b),"nextSibling must not be orphaned")}UI.toInsert.push([a,c,b]);if(!UI.timer){UI.scheduleTimer()}},_clearInsertNode:function(b){as(b,"_cIn: parent?");for(var a=0;UI.toInsert[a];a++){if(UI.toInsert[a][0]===b){UI.toInsert.splice(a,1);a--}}},_isOrphan:function(a){return !a.parentNode||UI.toOrphan.contains(a)},timer:null,scheduleTimer:function(){if(UI.applying&&UI.applying!=="soon"){if(UI.reapply&&UI.reapply!=1){console.log("Next UI.reaply includes reason "+UI.reapply)}UI.reapply=1}else{if(!UI.timer){var a=UI.timer=-1-Util.zeroTimeout.add(function(){if(UI.timer==a){UI._apply(1)}})}}},__insertHTMLs:function(){as(false,"__insertHTMLs: UI not initialized")},__insertHTMLsAdj:function(){var a,b;for(a=0;b=UI.htmlInsert[a];a++){b.node.insertAdjacentHTML(b.position,b.html)}},__insertHTMLsDOM:function(){var b,d;for(b=0;d=UI.htmlInsert[b];b++){UI.div.innerHTML=d.html;switch(d.position){case"beforeBegin":while(UI.div.firstChild){d.node.parentNode.insertBefore(UI.div.firstChild,d.node)}break;case"afterBegin":var a=d.node.firstChild;while(UI.div.firstChild){d.node.insertBefore(UI.div.firstChild,a)}break;case"beforeEnd":while(UI.div.firstChild){d.node.appendChild(UI.div.firstChild)}break;case"afterEnd":var a=d.node.nextSibling;while(UI.div.firstChild){d.node.parentNode.insertBefore(UI.div.firstChild,a)}break;default:throwError("Unsupport insertHTML position: "+d.position);break}}},hasWork:function(){return UI.changes.length||UI.beforeApplyOnce.length||UI.afterApplyOnce.length||UI.toOrphan.length||UI.toAppend.length||UI.toInsert.length||UI.htmlInsert.length||UI.toFocus},_apply:function(w,y){if(UI.applying){console.log("Delaying _apply until first _apply is done (reason = "+w+").");UI.reapply=w;return}if(!UI.hasWork()){if(arguments.length<2||!y){console.log("UI._apply with reason "+w+" has no work to do.")}if(UI.timer){UI.timer=null}return}UI.applying="soon";var A=new Date().valueOf(),l=0,v=0;var u,t,q,p,b;while(UI.beforeApplyOnce.length){var r=UI.beforeApplyOnce;UI.beforeApplyOnce=[];v+=r.length;for(u=0;p=r[u];u++){try{p()}catch(z){console.error("Exc. in beforeApplyOnce closure, idx: "+u+", function: "+String(p.boundFunction||p)+", exception: %o.",z)}}}if(UI.timer){UI.timer=null}UI.applying=true;var g=new Date().valueOf()-A;A=new Date().valueOf();var B=[];for(u=0;t=UI.toOrphan[u];u++){B[u]=t.parentNode}for(u=0;q=UI.changes[u];u++){p=q.obj;p.uiObj=null;for(t=0;b=q.props[t];t++){if(constants.release){p[b]=q.values[b]}else{try{p[b]=q.values[b]}catch(z){console.error("Unable to change property %o of node %o to %o",b,p,q.values[b])}}l++}}UI.__insertHTMLs();for(u=0;t=UI.toAppend[u];u++){t[0].appendChild(t[1])}for(u=0;t=UI.toInsert[u];u++){t[0].insertBefore(t[1],t[2])}for(u=0;t=UI.toOrphan[u];u++){B[u].removeChild(t)}var k=(l?"Applied "+l+" properties to "+UI.changes.length+" objects. ":"")+(UI.toOrphan.length?UI.toOrphan.length+" elements removed. ":"")+(UI.toAppend.length?UI.toAppend.length+" elements added. ":"")+(UI.toInsert.length?UI.toInsert.length+" elements inserted. ":"")+(UI.htmlInsert.length?UI.htmlInsert.length+" html blocks inserted. ":"")+(UI.afterApplyOnce.length?"Called "+UI.afterApplyOnce.length+" closures (afterApplyOnce). ":"")+(UI.toFocus?"And focused. ":"");var C=UI.changes;UI.changes=[];UI.htmlInsert=[];UI.toAppend=[];UI.toInsert=[];UI.toOrphan=[];var f=UI.afterApplyOnce,D=UI.toFocus;UI.afterApplyOnce=[];UI.toFocus=null;var c=A;document.body.offsetHeight;c=(A=new Date().valueOf())-c;var h=A;h=(A=new Date().valueOf())-h;for(u=0;p=f[u];u++){try{p()}catch(z){console.error("Exc. in afterApplyOnce closure, idx: "+u+", function: "+String(p.boundFunction||p)+", exception: %o.",z)}}if(D&&AJ.focused){if(typeof D=="string"){D=document.getElementById(D)||console.error('Unable to focus "'+D+'" because it is not found!')||null}try{if(D){D.focus();Util.focusMovedTo(D)}}catch(z){console.warn("Unable to focus <"+D.id+">!")}}var a=new Date().valueOf()-A;if(g+h+a>5){console.log(k+"Time: "+(g+h+c+a)+"ms: "+g+" (before) + "+h+" (apply) + "+c+" (reflow) + "+a+" (callbacks). Reason: "+w+". Overridden so far: "+UI.overridden)}UI.applying=false;if(UI.reapply){var n=UI.reapply;UI.reapply=false;UI._apply(n)}}};UI.__insertHTMLs=UI.__insertHTMLsDOM;var _focus=function(){if(UI.toFocus){return}try{this.focus()}catch(a){}};var _g=UI._get;var _s=UI._set;var _sC=UI._setCheck;var _a=UI._append;var _i=UI._insert;var _ci=UI._clearInsert;var _r=UI._replace;var _rT=UI._replaceTest;var _ra=UI._replaceAppend;var _o=UI._orphan;var _an=UI._appendNode;var _cAn=UI._clearAppendNode;var _cAn2=UI._clearAppendingNode;var _in=UI._insertNode;var _cIn=UI._clearInsertNode;var _io=UI._isOrphan;var _oC=function(a){if(!_io(a)){_o(a)}};var lastRecentRooms=0;var events={balanceSpan:{findGame:"fRBalance",settings:"sBalance"},beforeFirstWindowShow:function(a){if(a==Window.findRoomWindow){DomBr.init()}switch(a){case"qreview":QuestionHistory.init();break;case"settings":var b=Util.getAvatarOptionsHTML(constants.avatars.extra.concat(Util.getExtraAvatarOptions()));windows[a]=windows[a].replace(/(<fieldset[^>]+id="extraAvatars"[^>]*>.*?)(<\/fieldset>)/,"$1"+b+"$2");break}if(events.balanceSpan[a]){windows[a]=windows[a].replace(new RegExp('(<span\\s+id="'+events.balanceSpan[a]+'">)[^<]*(</span>)'),"$1"+Util.printMoney(AJ.balance)+"$2");Util.balanceElements.push(events.balanceSpan[a])}},onWindowShow:function(b){_sC($.timerContainer.style,"display",b=="play"?"":"none");if(b==Window.makeRoomWindow){Util.updateCreateGameTitle()}if(b==Window.findRoomWindow){if(Rooms.lastFilter.time){Rooms.updateFilter(true)}}switch(b){case"home":Util.updateTopUsers();break;case"play":if(variables.changeNickBalloon){Balloons.changeNick.show()}PlayZone.paint(true);break;case"settings":if(!variables.windowsShown[b]){var c=$.incomingPayment;if(c.onload&&c.attachEvent){c.attachEvent("onload",c.onload);c.onload=null}var c=document.getElementById("uII");if(c.attachEvent){c.attachEvent("onload",Util.avatarIframeLoaded)}else{c.onload=Util.avatarIframeLoaded}}Util.updateItemsInSettings();if(!AJ.userType){if(TabFolder.getIndex($.tFS)!=0){TabFolder.setPageByIdx($.tFS,0)}}else{_sC($.avatarStatus,"innerHTML",'<img src="'+AJ.avatar+'" alt="Avatar"/>')}break;case"login":Balloons.changeNick.hide();break;case"referred":if(!variables.windowsShown.referred){var a=escapeHTML(AJ.referrer||"AnswerJoy");_s(document.getElementById("htmlReferredStepMotivationHeader"),"innerHTML",Util.sprintf(LStrings[AJ.curLang].html.htmlReferredStepMotivationHeader,a));_s(document.getElementById("htmlReferredStepFriendHeader"),"innerHTML",Util.sprintf(LStrings[AJ.curLang].html.htmlReferredStepFriendHeader,a));_s(document.getElementById("htmlReferredContinueToLogin"),"innerHTML",Util.sprintf(LStrings[AJ.curLang].html.htmlReferredContinueToLogin,a))}break;case"promo":if(!variables.windowsShown.promo){Util.setPromoUrl()}break}variables.windowsShown[b]=true},afterWindowShow:function(a){if(a!="play"&&PlayZone.isPreview()){Questions.clearPreview()}if(a==Window.findRoomWindow){if(!$.browseGames){$.browseGames=document.getElementById("browseGames");Rooms.showAll()}if(recentRooms.length>lastRecentRooms){lastRecentRooms=recentRooms.length;makeRecentRooms()}}if(a==Window.makeRoomWindow){if(!variables.windowsShown[a==Window.makeRoomWindow]){setTimeout(function(){_s(document.getElementById("domainTreeHolder"),"innerHTML",HTML.parse(HTML.makeTreeFromDomain(domainsHash[0].subcat),{tree:true,checkbox:true}));UI.afterApplyOnce.push(function(){document.getElementById("domainTree").onclick()})},50)}}switch(a){case"play":if(!variables.positionedTimer&&AJ.initStep>2){Util.positionTimer()}Chat.positionAtEnd();if(Map.drawOnShow){Map.drawMap()}if(variables.updateChatHeightOnShowPlay){variables.updateChatHeightOnShowPlay=false;Chat.updateHeight()}Animation.clear($.chatText);break;case"qreview":if(variables.windowsShown.qreview){QuestionHistory.show()}break;case"settings":if(!arguments.callee.settings){arguments.callee.settings=true;ButtonList.setup(document.getElementById("nQ1R1"));ButtonList.setup(document.getElementById("nQ1W1"));ButtonList.setup(document.getElementById("nQ1R2"));ButtonList.setup(document.getElementById("nQ1W2"));ButtonList.setup(document.getElementById("nQ1R3"));if(AJ.userType){Questions.showAll()}Util.initSimpleAddQCheckboxes();TagList.setValue($_("nQ1Keywords"),[]);Settings.reapply("activity","animations","depositPopup","timestamps")}if(window.OnLoadSearch){OnLoadSearch()}if(!isIE&&TabFolder.getIndex($.tFS)==constants.userAccountSettingsPage){repositionAvatarUpload()}if(AJ.userType){_sC($.uAF.style,"display","")}break}if(typeof variables.focusAfterWindowShow=="string"){variables.focusAfterWindowShow=document.getElementById(variables.focusAfterWindowShow)}if(variables.focusAfterWindowShow){variables.focusAfterWindowShow.focus()}if(events.afterWindowShowCallbacks[a]){for(var b=0;b<events.afterWindowShowCallbacks[a].length;b++){events.afterWindowShowCallbacks[a][b]()}events.afterWindowShowCallbacks[a]=null}},afterWindowShowCallbacks:{},addAfterWindowShowCallback:function(a,b){if(!events.afterWindowShowCallbacks[a]){events.afterWindowShowCallbacks[a]=[]}if(!events.afterWindowShowCallbacks[a].contains(b)){events.afterWindowShowCallbacks[a].push(b)}},afterTabFolderSetPage:function(a,b){if(!isIE&&a===$.tFS&&b===constants.userAccountSettingsPage){repositionAvatarUpload()}}};events.afterWindowShow.bound={};var globalEvents={onclick:[function(a){if(_g($.changeNickDiv.style,"display")!="none"){if(variables.clickInChangeNickDiv){variables.clickInChangeNickDiv=false}else{_s($.changeNickDiv.style,"display","none")}}if(_g(LanguageList.picker.style,"display")!="none"){if(variables.clickedInPicker){variables.clickedInPicker=false}else{LanguageList.hidePicker()}}Menu.closeAll();ButtonList.globalClick(a)}],onmouseup:[function(a){if(variables.buttonPressed){Button.mouseup(variables.buttonPressed,a)}if(Slider.active&&Slider.active.mouse){Slider.release()}}],onkeydown:[function(a){Util.bodyKeydown(a)}],onmousedown:[],onmousemove:[],currentEvent:null,returnValue:null,run:function(b,a){if(!globalEvents[b]){return}if(!a&&event){a=event}globalEvents.currentEvent=a;globalEvents.returnValue=this.thisPropertyDoesNotExistSoItIsUndefined;for(var c=0;c<globalEvents[b].length;c++){globalEvents[b][c](a)}return globalEvents.returnValue},init:function(){document.body.onclick=function(a){globalEvents.run("onclick",a)};document.body.onmouseup=function(a){globalEvents.run("onmouseup",a)};document.body.onkeydown=function(a){globalEvents.run("onkeydown",a)};document.body.onmousedown=function(a){globalEvents.run("onmousedown",a)};document.body.onmousemove=function(a){globalEvents.run("onmousemove",a)}}};var User={minPass:8,minUser:4,maxUser:12,maxGuestNickLength:9,createAccount:function(){var d=Field.value(document.getElementById("createPassword"));var g=[];if(!d){g.push(Strings.noPass)}else{if(d.length<User.minPass){g.push(Util.sprintf(Strings.passTooShort,User.minPass))}else{if(d!=Field.value(document.getElementById("createPassword2"))){g.push(Strings.passNotMatch)}}}var a=Field.value(document.getElementById("createUsername"));if(!a||a.length<User.minUser){g.push(Util.sprintf(Strings.usrTooShort,User.minUser))}else{if(a.length>User.maxUser){g.push(Util.sprintf(Strings.usrTooLong,User.maxUser))}else{if(RX.other.guest.test(a)){g.push(Strings.usrGuestBad)}}}d=hex_hmac_md5(d,a.substr(0,3));d=RSA.encrypt(d,pubKey);variables.createAccUsername=a;var b=Field.value(document.getElementById("createEmail"));if(g.length){for(var c=0;c<g.length;c++){Util.info(g[c])}return}Request.createAccount(a,b,d,Checkbox.isChecked(document.getElementById("createRememberMe")),AJ.referrer);try{if(pageTracker){pageTracker._trackEvent("User","Created")}}catch(f){throwError("Google Analytics failed on tracking event.",true)}},login:function(a,b){a=a||Field.value(document.getElementById("loginUsername"));b=b||Field.value(document.getElementById("loginPassword"));if(!a||!b){Util.info(Strings.noUsrOrPass);return}b=hex_hmac_md5(b,a.substr(0,3));b=hex_hmac_md5(b,AJ.playerId);Request.login(a,b,Checkbox.isChecked(document.getElementById("loginRememberMe")));try{if(pageTracker){pageTracker._trackEvent("User","LoggedOn")}}catch(c){throwError("Google Analytics failed on tracking event.",true)}},logoff:function(a){if(!a&&currentRoom&&currentRoom.roomInfo.bet&&!(question&&question.EOM)){Alert.choice(Strings.logoffWhenInPayGame,[Strings.logoffWhenInPayGameNo,Strings.logoffWhenInPayGameYes],function(c){if(c){User.logoff(true)}});return}AJ.loggingOut=true;Request.logoff();try{if(pageTracker){pageTracker._trackEvent("User","LoggedOff")}}catch(b){throwError("Google Analytics failed on tracking event.",true)}},changePassword:function(){if(!AJ.userType){Util.alert(Strings.mustLogIn);return}var b=Field.value(document.getElementById("newPass1"));var d=[];if(!b){d.push(Strings.noPass)}else{if(b.length<User.minPass){d.push(Util.sprintf(Strings.passTooShort,User.minPass))}else{if(b!=Field.value(document.getElementById("newPass2"))){d.push(Strings.newPassNotMatch)}}}if(d.length){for(var a=0;a<d.length;a++){Util.info(d[a])}return}var c=Field.value(document.getElementById("oldPass"));Field.empty(document.getElementById("oldPass"));c=hex_hmac_md5(c,AJ.username.substr(0,3));c=hex_hmac_md5(c,AJ.playerId);b=hex_hmac_md5(b,AJ.username.substr(0,3));b=RSA.encrypt(b,pubKey);Request.changePass(c,b);User.checkCanChangePassword()},requestPassReset:function(){var a=Field.value(document.getElementById("rpUser")),b="";if(!a&&!b){Util.info(Strings.resetPassUsrOrEmail,Strings.resetPassTitle);return}Request.requestPasswordReset(a,b)},requestResetPass:function(a){if(!a){Util.info(Strings.resetReqCode,Strings.resetPassTitle);return}Request.resetPassCode(a)},passwordHasBeenReset:function(a){var b;if(Strings.passResetResp[a.r]){b=Strings.passResetResp[a.r]}else{b=Util.sprintf(Strings.resetPassErrUnkn,a.r)}Util.info(b,Strings.resetPassTitle)},passwordResetRequestResult:function(a){var b;if(Strings.passResetReqResp[a.r]){b=Strings.passResetReqResp[a.r]}else{b=Util.sprintf(Strings.resetPassReqErrUnkn,a.r)}Util.info(b,Strings.resetPassTitle)},updateInfoResult:function(a){var b;if(!a.r){b=Strings.infoUpdOk}else{b=[];if(a.r&1){b.push(Strings.infoUpdPartial)}if(a.r&2){b.push(Strings.emailInvalid)}if(a.r&4){b.push(Strings.emailInUse)}if(a.r&8){b.push(Strings.emailConfirm)}}Util.info(b,Strings.infoUpdTitle)},setAvatar:function(a){Request.setAvatar(a);Request.callbacks.imagePath({p:a})},checkCanChangePassword:function(){if(Button.isDisabled($.btnChangePass)){if(User.canChangePassword()){Button.enable($.btnChangePass);Button.startHighlight($.btnChangePass)}}else{if(!User.canChangePassword()){Button.stopHighlight($.btnChangePass);Button.disable($.btnChangePass)}}},canChangePassword:function(){return Field.value($_("oldPass"))&&Field.value($_("newPass1"))&&Field.value($_("newPass2"))&&true},changeGuestNick:function(a){if(RX.other.illegalGuestNick.test(a)){Util.info(Strings.illegalGuestNick)}else{if(a.length>User.maxGuestNickLength){Util.info(Strings.guestNickTooLong);return}if(a.length<3){Util.info(Strings.guestNickTooShort);return}Util.save("guestNick",a,0);Request.changeNick(a)}}};var Chat={maxHistory:50,lastMsgDelay:5*60*1000,animateSpeed:0.5,suspendScrollDelay:2*60*1000,scrolling:false,enableScroll:true,suspendScrollUntil:0,prevScrollTop:0,lastSetScrollTop:0,bottomScrollTop:0,resizeTransition:null,log:"",userRx:[],userRxHash:{},guestRx:[],guestRxHash:{},addMsg:function(e,b){if(!b){b=$.chatHistory}var d=true;if(e.u==AJ.username&&b!=$.pendingChat){var a=0,c=$.pendingChat.childNodes.length;while(a<c&&_io($.pendingChat.childNodes[a])){a++}if(a==c){Chat.addServerMsg(Util.sprintf(Strings.chatProblem,e));return}_o($.pendingChat.childNodes[a]);d=false}_an(b,Chat.printMsg(e));if(d&&Chat.enableScroll){UI.afterApplyOnce.push(Chat._checkScroll)}Chat.setLastMsgTimeout()},setLastMsgTimeout:function(){var b=new Date();if(Chat.lastMsgTimeout){clearTimeout(Chat.lastMsgTimeout)}var a=Chat.lastMsgTimeout=setTimeout(function(){if(a==Chat.lastMsgTimeout){Chat.timestampLastMsg(b)}Chat.lastMsgTimeout=null},Chat.lastMsgDelay)},_addMsg:function(a,b){var c=document.createElement("div");c.className=b;c.innerHTML=a;_an($.chatHistory,c);if(Chat.enableScroll){UI.afterApplyOnce.push(Chat._checkScroll)}},_checkScroll:function(){Chat.bottomScrollTop=$.chatText.scrollHeight-$.chatText.clientHeight;if($.chatText.scrollTop+$.chatText.clientHeight<$.chatText.scrollHeight){Chat._scrollTo(Chat.bottomScrollTop)}},onscroll:function(a){if(UI.applying){return}var b=$.chatText.scrollTop;if(Math.abs(Chat.lastSetScrollTop-b)<=5){return}if(Chat.prevScrollTop==b){return}if(Chat.scrolling&&Math.abs(Chat.scrolling.currentValue-$.chatText.scrollTop)<=5){return}if(Chat.resizeTransition){return}if($.chatText.scrollHeight<=$.chatText.clientHeight||$.chatText.scrollHeight-$.chatText.scrollTop-$.chatText.clientHeight<=5){if(!Chat.enableScroll){Chat.reenableScroll()}}else{Chat.suspendAutoScrolling()}},chatTextKeyDown:function(c){var b=c.charCode||c.keyCode;var e=true,a,d;switch(b){case 36:if(!$.chatText.scrollTop){return}Chat.suspendAutoScrolling();Chat._scrollTo(0);if(Chat.scrolling){Chat.scrolling.externalChatScroll=true}break;case 35:if(Chat.enableScroll){return}Chat.reenableScroll();break;case 33:if(!$.chatText.scrollTop){return}Chat.suspendAutoScrolling();a=($.chatText.offsetHeight*0.8)|0;d=Chat.scrolling&&Chat.scrolling.end||_g($.chatText,"scrollTop");Chat.tryScrollTo(d-a);if(Chat.scrolling){Chat.scrolling.externalChatScroll=true}break;case 34:if(Chat.enableScroll){return}a=($.chatText.offsetHeight*0.8)|0;d=Chat.scrolling&&Chat.scrolling.end||_g($.chatText,"scrollTop");Chat.tryScrollTo(d+a);if(Chat.scrolling&&!Chat.enableScroll){Chat.scrolling.externalChatScroll=true}break;default:e=false;break}if(e){stopEvt(c)}},suspendAutoScrolling:function(){Chat.enableScroll=false;if(!Chat.suspendScrollUntil){setTimeout(Chat.checkReenableScroll,Chat.suspendScrollDelay)}Chat.suspendScrollUntil=new Date().valueOf()+Chat.suspendScrollDelay},checkReenableScroll:function(){if(Chat.enableScroll){Chat.suspendScrollUntil=0;return}var a=new Date().valueOf();if(a>=Chat.suspendScrollUntil){Chat.reenableScroll()}else{setTimeout(Chat.checkReenableScroll,Chat.suspendScrollUntil-a)}},reenableScroll:function(){Chat.enableScroll=true;Chat.suspendScrollUntil=0;Chat._checkScroll()},addActivity:function(d,b,a){Chat.log+="<br />["+getTime(null,"0")+"] Activity: "+d;var c="";if(b!=null){c=" user"+(b==AJ.username?"self":currentRoom.users[currentRoom.indexByUser[b]].userPosSelf)}if(a){c+=" "+a}Chat._addMsg(Chat.getTimestampSpan()+d,"activity"+c)},addServerMsg:function(a){Chat.log+="<br />["+getTime(null,"0")+"] Server: "+a;Chat._addMsg(Chat.getTimestampSpan()+a,"serverMsg tip")},addPayMsg:function(a){Chat.log+="<br />["+getTime(null,"0")+"] Payment: "+a;Chat._addMsg(Chat.getTimestampSpan()+a,"payment")},addGameMsg:function(a){Chat.log+="<br />["+getTime(null,"0")+"] Game: "+a},addDebugMsg:function(a){if(!constants.release){Chat.log+="<br />["+getTime(null,"0")+"] Debug: "+a}},printMsg:function(d){var b=d.u||AJ.username;var f=escapeHTML(d.m);var c;var a="";if(c=RX.other.me.test(f)){a+=" action";f=f.replace(RX.other.me,"")}else{a+=" message"}a+=" user";if(!d.t){a+=(b==AJ.username?"self":currentRoom.users[currentRoom.indexByUser[b]].userPos)}else{a+=currentRoom.users[currentRoom.indexByUser[b!=AJ.username?b:d.t]].userPos+" private"}var e=Chat.getTimestampSpan()+(c?"* ":"")+'<img class="avatar" width="32" height="32" src="'+currentRoom.users[currentRoom.indexByUser[b]].avatar+'" />'+currentRoom.usernameMap[b];if(d.t){e+=" -> "+currentRoom.usernameMap[d.t]}e+='<span class="hidden">: </span><span class="message">'+Chat.highlightUserNames(Util.parseSmileys(f))+"</span>";var g=document.createElement("div");g.className=a.substr(1);g.innerHTML=e;Chat.log+="<br />["+getTime(null,"0")+"] "+(c?"* ":"")+(d.pending?"Sending message: ":"Message: "+currentRoom.usernameMap[b])+(d.t?" -> "+currentRoom.usernameMap[d.t]:"")+": "+f;return g},sendMessage:function(b,c){var a={m:b,pending:true};if(c){a.t=c}Chat.addMsg(a,$.pendingChat);Request.sendMessage(b,c)},sendMessageFrom:function(a){var b=Field.value(a);if(!b){return}Field.empty(a);if(b.charAt(0)=="/"&&b.substr(0,4)!="/me "){Chat.handleCommand(b.substr(1));return}if(b.length>250){Util.info(Strings.chatMsgTooLong,b.length);return}Chat.sendMessage(b)},timestampLastMsg:function(a){if(!Chat.lastMsgTimeout){return}Chat.lastMsgTimeout=null;Chat._addMsg(Util.sprintf(Strings.lastMsgAt,getTime(a)),"timestampInfo")},getTimestampSpan:function(){return'<span class="timestamp">['+getTime()+"]</span>"},viewFullLog:function(){var a=window.open("","AnswerJoyFullLog","");if(!a){Util.info(Strings.logPopupBlocked,Strings.viewLog);return}var c=a.document;var b=getDateTime(null,"0");c.write("<html><head><title>"+Util.sprintf(Strings.appFullLogTitle,b)+"</title>");c.write("</head><body><h1>"+Strings.appFullLog+"</h1><h4>"+Util.sprintf(Strings.generatedAt,b)+"</h4><p>");c.write(Chat.log);c.write('</p><p><a href="javascript:self.close()">'+Strings.close+"</a></p>");c.write("</body></html>");c.close();a.focus()},handleCommand:function(b){var c=b.split(RX.other.whitespace);if(c.length&&!c[c.length-1]){c.pop()}if(c.length==1&&RX.general.natural.test(c[0])){if(!question||question.lA!=null||question.expired){return}var a=c[0];if(question.type==constants.question.schoice){if(a&&a<=question.answers.length){Quiz.answer(a-1)}else{Sound.play("beep")}}else{if(question.type==constants.question.number){Field.setValue($.ansText,String(a));Quiz.answerText()}else{if(question.type==contants.question.mchoice){while(a){Checkbox.check(document.getElementById("cb"+(a%10-1)));a=(a/10)|0}Quiz.answerCheckboxes()}else{Sound.play("beep")}}}}else{if(c.length==2&&c[0]=="show"){Util.navigate(c[1])}else{if(c.length==2&&c[0]=="skin"){Util.setSkin(c[1])}else{if(c.length==2&&c[0]=="lang"){Util.setLang(c[1])}else{if(c.length==2&&c[0]=="n"){if(!AJ.userType&&c[1]){User.changeGuestNick(c[1])}}else{if(c.length==2&&c[0]=="j"){if(c[1]){Chat.setRoom({id:c[1]})}else{Sound.play("beep")}}else{if(c[0]=="wall"){Request.wall(c.slice(1).join(" "))}else{if(c[0]=="whois"){Util.whois(b.substr(6))}else{if(c[0]=="?"||c[0]=="help"){Chat._addMsg("/123 - answer question <br/>/j <roomId> - change room <br/>/lang en - set language <br/>/n myUberNick - change nick when guest <br/>/show qreview - jump to a window <br/>/skin tree - set theme <br/>/wall Good news everyone! - admin only - send message to all players connected to the server <br/>/whois Alice,Bob,Eva - see information about one or more users (no spaces unless they are part of the username!)<br/>That's it for now")}else{if(c.length){Chat._addMsg(Util.sprintf(Strings.unknownCommand,c.join(" ")));Sound.play("beep")}}}}}}}}}}},updateHeight:function(){if(variables.currentWindow!="play"){variables.updateChatHeightOnShowPlay=true;return}var d=$.questionContainer.offsetHeight+$.questionContainer.offsetTop;var e=$.sideInfoContainer.offsetHeight+$.sideInfoContainer.offsetTop+parseFloat(_g($.userList.style,"height"))-parseFloat($.userList.style.height);var b=$.chatContainer.offsetHeight-$.chatText.offsetHeight;var a=e-d-b;if(typeof $.chatText.extraHeight=="undefined"){UI.makeExtraHeight($.chatText)}var c=parseInt(getStyle($.chatText).minHeight)+$.chatText.extraHeight;if(a<c){a=c}Chat._updateHeightTo(a)},_updateHeightTo:function(a){var c=a-$.chatText.paddingHeight;Chat.bottomScrollTop=$.chatText.scrollHeight-a;var b;if(Chat.enableScroll){b=Chat.bottomScrollTop}else{b=$.chatText.scrollTop+$.chatText.clientHeight-a}b=Math.max(0,b);if(!AJ.animations){_sC($.chatText.style,"height",c+"px")}else{if(Chat.resizeTransition){Chat.resizeTransition.end=c}else{var d=$.chatText.offsetHeight-$.chatText.extraHeight;(Chat.resizeTransition=Animation.addTransition($.chatText,"height",d,c,"px",true,Chat.animateSpeed)).after(Chat._afterChatResize);if(Chat.scrolling){Animation.transitions.splice(Animation.transitions.indexOf(Chat.scrolling),1);Animation.transitions.push(Chat.scrolling)}}}if(!Chat.scrolling||!Chat.scrolling.externalChatScroll){Chat._scrollTo(b)}},_afterChatResize:function(){Chat.resizeTransition=null},tryScrollTo:function(a){if(a>Chat.bottomScrollTop){if(!Chat.enableScroll){Chat.reenableScroll();return}a=Chat.bottomScrollTop}if(a<0){a=0}Chat._scrollTo(a)},_scrollTo:function(a){if(!AJ.animations){Chat.prevScrollTop=$.chatText.scrollTop;_s($.chatText,"scrollTop",Chat.lastSetScrollTop=a);UI._makeLastChanges($.chatText)}else{if(Chat.scrolling){Chat.scrolling.end=a;Chat.scrolling.beginTime+=Chat.animateSpeed*100}else{var b=_g($.chatText,"scrollTop");if(b!=a){(Chat.scrolling=Animation.addTransition($.chatText,"scrollTop",b,a,0,true,Chat.animateSpeed)).after(Chat._afterChatScroll);Chat.scrolling.currentValue=b;Chat.scrolling.unit=0}}}},_afterChatScroll:function(){if(Chat.scrolling){Chat.prevScrollTop=$.chatText.scrollTop;Chat.lastSetScrollTop=Chat.scrolling.currentValue;Chat.scrolling=null}var b=Chat.lastSetScrollTop;if(Chat.maxHistory&&$.chatHistory.childNodes.length>Chat.maxHistory){var a=$.chatHistory.childNodes.length-Chat.maxHistory;while(a){a--;if($.chatHistory.childNodes[a].offsetHeight){b-=$.chatHistory.childNodes[a].offsetHeight}_oC($.chatHistory.childNodes[a])}if(b!=Chat.lastSetScrollTop){Chat.prevScrollTop=$.chatText.scrollTop;_s($.chatText,"scrollTop",Chat.lastSetScrollTop=b);UI._makeLastChanges($.chatText)}}},positionAtEnd:function(){_s($.chatText,"scrollTop",Math.max($.chatText.scrollHeight-$.chatText.offsetHeight,0))},clearUserCache:function(){Chat.userRx=[];Chat.userRxHash={};Chat.guestRx=[];Chat.guestRxHash={}},addUserRx:function(b,d,a){var c=currentRoom.usernameMap[d];b=new RegExp("\\b"+b.replace(RX.other.nonAlphaNumeric,"\\$&")+"\\b","g");if(!a){Chat.userRxHash[d]=Chat.userRx.length;Chat.userRx.push([b,c,d])}else{Chat.guestRxHash[d]=Chat.userRx.length;Chat.guestRx.push([b,c,d])}},removeUserRx:function(b,a){if(!a){Chat.userRx.splice(Chat.userRxHash[b],1);delete Chat.userRxHash[b]}else{Chat.guestRx.splice(Chat.guestRxHash[b],1);delete Chat.guestRxHash[b]}},highlightUserNames:function(c,b){if(b&&AJ.usernameRx.test(c)){Sound.play("beep")}for(var a=0;a<Chat.userRx.length;a++){c=c.replace(Chat.userRx[a][0],Chat.userRx[a][1])}for(var a=0;a<Chat.guestRx.length;a++){if(!Chat.userRxHash.hasOwnProperty(Chat.guestRx[a][2])){c=c.replace(Chat.guestRx[a][0],Chat.guestRx[a][1])}}return c}};function domainTreeClicked(e){var l=(e.id.match(RX.other.etc11)||[""])[0];var h=RX.cls.checked.test(_g(e,"className"));var a=e.nextSibling?$A_(e.nextSibling.childNodes).pluck_("childNodes").pluck_("1"):[];var g=[],b=[];var f;if(h){g.push(e.title||e.tt);while(a.length){if(!Checkbox.isChecked(a[0])){Checkbox.check(a[0]);if(a[0].nextSibling){a=a.concat($A_(a[0].nextSibling.childNodes).pluck_("childNodes").pluck_("1"))}}else{b.push(a[0].title||a[0].tt)}a.shift()}a=(e.title||e.tt)==Strings.globalTag?null:e.parentNode.parentNode.previousSibling;while(a&&domainsHash.byTag[a.title||a.tt].subcat.length==1){Checkbox.check(a);g[0]=a.title||a.tt;a=(a.title||a.tt)==Strings.globalTag?null:a.parentNode.parentNode.previousSibling}while(a){if(Checkbox.isPartial(a)){break}Checkbox.makePartial(a);a=(a.title||a.tt)==Strings.globalTag?null:a.parentNode.parentNode.previousSibling}}else{b.push(e.title||e.tt);while(a.length){if(!Checkbox.isUnchecked(a[0])){Checkbox.uncheck(a[0]);if(a[0].nextSibling){a=a.concat($A_(a[0].nextSibling.childNodes).pluck_("childNodes").pluck_("1"))}}a.shift()}a=(e.title||e.tt)==Strings.globalTag?null:e.parentNode.parentNode.previousSibling;var c=e;while(a&&domainsHash.byTag[a.title||a.tt].subcat.length==1){Checkbox.uncheck(a);b[0]=a.title||a.tt;c=a;a=(a.title||a.tt)==Strings.globalTag?null:a.parentNode.parentNode.previousSibling}while(a){var k=false;var d=$A_(a.nextSibling.childNodes).pluck_("childNodes").pluck_("1");for(f=0;f<d.length;f++){if(d[f]!=c&&!Checkbox.isUnchecked(d[f])){k=true;break}}if(k){if(Checkbox.isPartial(a)){break}Checkbox.makePartial(a);b[0]=a.title||a.tt;for(f=0;f<d.length;f++){if(d[f]!=c&&Checkbox.isChecked(d[f])){g.push(d[f].title||d[f].tt)}}a=(a.title||a.tt)==Strings.globalTag?null:a.parentNode.parentNode.previousSibling;while(a){if(Checkbox.isPartial(a)){break}Checkbox.makePartial(a);b[0]=a.title||a.tt;d=$A_(a.nextSibling.childNodes).pluck_("childNodes").pluck_("1");for(f=0;f<d.length;f++){if(d[f]!=c&&Checkbox.isChecked(d[f])){g.push(d[f].title||d[f].tt)}}c=a;a=(a.title||a.tt)==Strings.globalTag?null:a.parentNode.parentNode.previousSibling}break}else{Checkbox.uncheck(a)}c=a;a=(a.title||a.tt)==Strings.globalTag?null:a.parentNode.parentNode.previousSibling}}for(f=0;f<b.length;f++){TagList.removeTag($_("custDom"),b[f])}for(f=0;f<g.length;f++){TagList.addTag($_("custDom"),g[f])}}function makeCustom(){var q=_g($_("custDom"),"value").split(",");if(!q[0]){Util.alert(Strings.atLeastOneDomain);return}else{for(var g=0;g<q.length;g++){if(q[g]==Strings.globalTag){q[g]="all"}}}var c=_g($_("custLang"),"value").split(" ");if(!c[0]){Util.alert(Strings.atLeastOneLang);return}else{for(var g=0;g<c.length;g++){c[g]=languages.idFromCode[c[g]]}}var f=0;if(Checkbox.isChecked($_("cRschoice"))){f+=1}if(Checkbox.isChecked($_("cRmchoice"))){f+=2}if(Checkbox.isChecked($_("cRsort"))){f+=4}if(Checkbox.isChecked($_("cRtext"))){f+=8}if(Checkbox.isChecked($_("cRnumber"))){f+=16}if(Checkbox.isChecked($_("cRmap"))){f+=32}if(!f){Util.alert(Strings.atLeastOneQT);return}showRoomOnJoin=true;var n=Field.value($.custTitle);if(!n){Util.info(Strings.enterRoomTitle);return}else{if(n.length>80){Util.info(Strings.roomTitleTooLong);return}}var d=Field.value($_("custDiff"))-0;var p=Field.value($_("custAIs"))-0;var a=_g($_("custPlayers"),"value");if(a=="over"){a=0}else{a=a-0}var b=_g($_("custBet").parentNode.parentNode,"className")!="no-pay"?_g($_("custBet"),"value"):"under";if(b=="under"){b=0}else{b=+b}var l=Checkbox.isChecked($_("custLobby"));var h=Checkbox.isChecked($_("custPrivate"));Request.createRoom(n,d,q,c,f,p,a,b,l,h);if(b){try{if(pageTracker){pageTracker._trackEvent("PaidRoom","Created")}}catch(k){throwError("Google Analytics failed on tracking event.",true)}}else{try{if(pageTracker){pageTracker._trackEvent("FreeRoom","Created")}}catch(k){throwError("Google Analytics failed on tracking event.",true)}}}var maskOK=false;function makeAnswerMask(b,g){var a=b.split("");var e=g.split("");maskOK=a.length==e.length;var h=[];var d;for(d=0;d<a.length&&d<e.length;d++){h[d]=(a[d]==" "?"space ":"")+(a[d]=="*"?e[d]==" "?"space wrong":"guess":a[d].toLowerCase()==e[d].toLowerCase()?"right":"wrong")}if(a.length<e.length){while(h.length<e.length){a.push(e[h.length]);h.push(e[h.length]==" "?"space wrong":"wrong")}}var f="";for(d=0;d<a.length;d++){f+='<span class="'+(h[d]||"")+'">'+(a[d]=="*"?e[d]||a[d]:a[d])+"</span>"}maskOK=maskOK&&f.indexOf('wrong"')==-1;if(maskOK&&PlayZone.isGame()&&PlayZone.lastPaintState==0){Button.startHighlight($.btnText)}else{Button.stopHighlight($.btnText)}return f.replace(RX.other.etc12,">&nbsp;<")}function makeRecentRooms(){var e='<table class="nav"><tbody><tr>',d,c=recentRooms.length;if(!c){return}var a=c<5?2:c<10?3:c<17?4:5;for(var b=0;d=recentRooms[b];b++){if(b&&(b%a==0)){e+="</tr><tr>"}e+="<td onclick=\"Quiz.setRoom({id: '"+d.id+"'}, 1);\"><h2>"+d.title+"</h2><div>"+(d.kw.length>1?Strings.Tags:Strings.Tag)+": "+d.kw+" ("+d.lang+")</div><div>"+Util.sprintf(Strings.roomCreatedAtBy,"<i>"+Util.getNiceDateTime(d.created)+"</i>","<b>"+d.creator+"</b>")+"</div><div>"+(d.joins>1?Util.sprintf(Strings.joinedTimes,d.joins):"")+" "+Util.sprintf(Strings.lastVisit,Util.getNiceDateTime(d.lastVisit))+"</div></td>"}e+="</tr></tbody></table>";_s(document.getElementById("recentRooms"),"innerHTML",e)}function etcInit(){AJ.lastModified=new Date(document.lastModified);if(isIE){document.onfocusin=Util.windowFocus;document.onfocusout=Util.windowBlur}else{window.onfocus=Util.windowFocus;window.onblur=Util.windowBlur}AJ.session=Util.read("session")||null;AJ.guestNick=Util.read("guestNick");var b,a;for(b="0".charCodeAt(0),a="9".charCodeAt(0);b<=a;b++){variables.numberCodes[b]=true}for(b=48;b<=57;b++){variables.numberCodes[b]=true}for(b=96;b<=105;b++){variables.numberCodes[b]=true}}function changeNick(b,c){Balloons.changeNick.hide(true);if(_g($.changeNickDiv.style,"display")=="none"){var a=offsetBox(b.target||b.srcElement);_s($.changeNickDiv.style,"top",a[1]+a[3]+"px");_s($.changeNickDiv.style,"left",a[0]+a[2]-200+"px");_s($.changeNickDiv.style,"display","");if(!c){UI.toFocus=$.changeNickInput}}else{_s($.changeNickDiv.style,"display","none")}}function changeNick2(){var a=Field.value($.changeNickInput);if(!a){return}User.setGuestNick(a)}function repositionAvatarUpload(){var b=document.getElementById("uAF");var c=offsetBox($.btnUploadAvatar);var a=offsetBox(b.offsetParent||document.body);_s(b.style,"left",c[0]-a[0]+"px");_s(b.style,"top",c[1]-a[1]+"px");_s(b.style,"width",c[2]+"px");_s(b.style,"height",c[3]+"px")}function reportQuestion(a){Util.info(Strings.notImplementedYet,Strings.reportQuestionTitle)}function sendFeedback(){if(Field.isEmpty($.feedbackMessage)){Util.alert(Strings.enterFeedbackMsg);return}Request.sendFeedback("[From: "+Field.value($.feedbackFrom)+"] [Title: "+Field.value($.feedbackTitle)+"] [Email: "+Field.value($.feedbackEmail)+"] [Message: "+Field.value($.feedbackMessage)+"]");Util.info(Strings.thankYouForYourFeedback,constants.appName);Field.empty($.feedbackFrom);Field.empty($.feedbackEmail);Field.empty($.feedbackTitle);Field.empty($.feedbackMessage);document.getElementById("cancelFeedback").onclick()}var Hash={loadingHash:false,savedHash:"",noRehash:false,rehashTimeout:null,savingHash:null,loadHash:function(b){if(Hash.loadingHash){return}Hash.loadingHash=true;var k=(location.hash||b||"").replace(RX.other._20g," ").replace(RX.other._23g,"#");var a,d;var g=k.match(RX.hash.referrer);var f=g?null:"play";if(!variables.loadedFirstHash){variables.loadedFirstHash=true;if(a=k.match(RX.hash.rp)){User.requestResetPass(a[1])}if(a=k.match(RX.hash.from)){if(a[1].toLowerCase()=="facebook"){setTimeout(Util.setupFacebookHighlight,100*1000);f=null}}if(g){Util.setReferrer(g[1])}}if(a=k.match(RX.hash.room)){Quiz.setRoomFromHash(a[1])}else{if(a=k.match(RX.hash.tag)){Quiz.setRoom(a[1])}else{if(!currentRoom){Quiz.setRoom(constants.defaultRoom)}}}var c=variables.showWindowAfterConnect||variables.currentWindow;if(Window.betState[c]){c+=Window.betState[c]==1?"-pay":"-no-pay"}if(a=k.match(RX.hash.wnd)){f=a[1]}if(c!=f&&f){Window.show(f)}while(a=RX.hash.tabg.exec(k)){k=k.replace(a[0],"");try{Util.navigate(null,a[1],a[2]-0)}catch(h){}}if(a=k.match(RX.hash.br)){if(windowStack.pluck_("id").indexOf(Window.findRoomWindow)>-1&&domainsHash.byTag[a[1]]){firstBrowseCateg=domainsHash.byTag[a[1]].allDomIndex}}Hash.savedHash=location.hash;if(Hash.rehashTimeout){clearTimeout(Hash.rehashTimeout);Hash.rehashTimeout=null;Hash.savingHash=null}Hash.loadingHash=false},reHash:function(){if(Hash.noRehash){return}if(Hash.rehashTimeout){clearTimeout(Hash.rehashTimeout);Hash.rehashTimeout=null}var c="";if(currentRoom){c+="#"+currentRoom.title.replace(/[^a-zA-Z'"-]/g,"_")+"#room:"+currentRoom.id+"#tag:"+(currentRoom.kw.length==1&&currentRoom.kw[0]=="all"?Strings.globalTag:currentRoom.kw.join(","))}else{if(lastSetRoom&&lastSetRoom.tag){c+="#tag:"+(lastSetRoom.tag=="all"?Strings.globalTag:lastSetRoom.tag)}}var b=windowStack.length&&windowStack.last().id;var a=b;if(Window.betState[b]){b+=Window.betState[b]==1?"-pay":"-no-pay"}if(a==Window.findRoomWindow){b+="#tab:tFFG_"+TabFolder.getIndex(document.getElementById("tFFG"));b+="#br:"+DomBr.lastBrTag}switch(a){case"play":b="";break;case"settings":b+="#tab:tFS_"+TabFolder.getIndex(document.getElementById("tFS"));break;default:break}if(b){c+="#wnd:"+b}if(location.hash!=c){Hash.savingHash=c||"#";Hash.rehashTimeout=setTimeout(function(){if(!Hash.rehashTimeout){return}if(location.hash!=Hash.savingHash){location.hash=Hash.savingHash;Hash.savingHash=location.hash}Hash.rehashTimeout=null;Hash.savedHash=Hash.savingHash;Hash.savingHash=null},100)}else{Hash.savingHash=null}},checkHash:function(){if(!Hash.loadingHash&&location.hash!=Hash.savedHash&&location.hash!=Hash.savingHash){Hash.loadHash()}},pollInterval:null,initHash:function(){if("onhashchange" in window){window.onhashchange=Hash.checkHash}else{Hash.pollInterval=setInterval(Hash.checkHash,300)}}};var TabFolder={animationSpeed:0.5,setPage:function(f,d){var h=document.getElementById(d);if(_g(h.style,"display")!="none"&&!h.slidingOut){return}else{var e,b;var g=null;var l=null;var c=$A_(h.parentNode.childNodes);var k=$A_(f.parentNode.childNodes);for(e=0;b=c[e];e++){if(_g(b.style,"display")!="none"&&!b.slidingOut){l=b;g=k[e];break}}_r(g,"className",RX.cls.selected,"");_a(f,"className"," selected");f.parentNode.curPage=c.indexOf(h);var a=l.offsetHeight;Animation.clear(l);Animation.clear(h);_sC(f.parentNode,"scrollTop",0);if(a){if(h.parentNode.sliding){h.parentNode.nextSlide=[l,h,"Horizontal",TabFolder.animationSpeed]}else{h.parentNode.sliding=true;Animate.slidePush(l,h,"Horizontal",TabFolder.animationSpeed).after(TabFolder._checkNext)}}else{_s(l.style,"display","none");_s(h.style,"display","");events.afterTabFolderSetPage(f.parentNode,f.parentNode.curPage)}}Hash.reHash()},setPageByTitle:function(a,c){var b=$A_(a.childNodes);b[b.pluck_("innerHTML").indexOf__(c)].onclick()},setPageByIdx:function(b,a){b.childNodes[a].onclick()},setPageTitle:function(a,b,c){_s(a.childNodes[b],"innerHTML",c)},getIndex:function(c){var b,d,a=$A_(c.childNodes);for(b=0;d=a[b];b++){if(RX.cls.selected.test(_g(d,"className"))){return b}}return -1},_checkNext:function(b){b=b.parentNode;if(b.nextSlide){var a=b.nextSlide;delete b.nextSlide;Animate.slidePush.apply(Animate,a).after(TabFolder._checkNext)}else{b.sliding=false;events.afterTabFolderSetPage(b.previousSibling,b.previousSibling.curPage)}},langSetPageTitle:function(k,a,q,r){var c=document.getElementById(k);if(c){TabFolder.setPageTitle(c,a,q)}else{if(windows[r]){var n=windows[r];var p=[],l=[],f=[],e;while(e=HTML.rx.tabFolder1g.exec(n)){f.push(e[1]||"generatedId");p.push(e.index)}while(e=HTML.rx.tabFolder2g.exec(n)){l.push(e.index)}if(p.length!=l.length){console.log("Error, <aj:tabFolder> and </aj:tabFolder> don't match!")}p.push(n.length);var b=/<aj:tabPage\s*name=\"[^"]*"\s*>/g;for(var g=0;g<f.length;g++){if(f[g]==k){b.lastIndex=p[g];var h=g+1;var d=0;while(l[d]<p[g]){d++}for(j=0;j<=a;j++){e=b.exec(n);while(e.index>p[h]){h++;while(p[h]<l[d]){h++;d++}d++;b.lastIndex=l[d-1];e=b.exec(n)}}windows[r]=n.substr(0,e.index)+'<aj:tabPage name="'+q+'">'+n.substr(e.index+e[0].length);return}}console.warn("Unable to change page name for TabPage %o of TabFolder %o (window %o) to %o. Typo in TabFolder name?",a,k,r,q)}}}};var LanguageList={picker:null,pickTarget:null,isSimple:false,madePicker:false,toParse:{langItem:true,button:true},init:function(){LanguageList.picker=$.langPicker},reloadLanguages:function(){languages.map={};languages.revMap={};languages.idFromCode={};languages.nameFromId={};languages.codeFromId={};for(var a=0;a<languages.codes.length;a++){languages.map[languages.codes[a]]=languages.names[a];languages.revMap[languages.names[a]]=languages.codes[a];languages.idFromCode[languages.codes[a]]=languages.ids[a];languages.nameFromId[languages.ids[a]]=languages.names[a];languages.codeFromId[languages.ids[a]]=languages.codes[a]}if(LanguageList.madePicker){LanguageList.makePicker()}},btnRemoveItemClicked:function(c,b){var a=c.parentNode.previousSibling;_s(a,"value",_g(a,"value").replace(b,"").replace(RX.other.etc13," ").trim());if(c.parentNode.childNodes.length/3==2){_a(c.parentNode,"className"," noBtn")}_o(c.previousSibling);_o(c.nextSibling);_o(c);if(LanguageList.pickTarget){UI._apply(19);LanguageList.repositionPicker()}if(a.onkeydown){a.onkeydown()}},togglePicker:function(a){variables.clickedInPicker=true;if(!LanguageList.madePicker){LanguageList.makePicker()}if(LanguageList.pickTarget==a){LanguageList.hidePicker();return}LanguageList.pickTarget=a;LanguageList.repositionPicker();if(RX.cls.simple.test(_g(a.previousSibling,"className"))){if(!LanguageList.isSimple){LanguageList.isSimple=true;_a(LanguageList.picker,"className"," simple")}}else{if(LanguageList.isSimple){LanguageList.isSimple=false;_r(LanguageList.picker,"className",RX.cls.simple,"")}}Button.press(a);_s(LanguageList.picker.style,"display","")},repositionPicker:function(){var a=offsetBox(LanguageList.pickTarget);_s(LanguageList.picker.style,"top",a[1]+a[3]+"px");_s(LanguageList.picker.style,"left",a[0]+"px")},hidePicker:function(){Button.release(LanguageList.pickTarget);LanguageList.pickTarget=null;_s(LanguageList.picker.style,"display","none")},makePicker:function(){var b="";for(var a=0;a<languages.names.length;a++){b+="<aj:buttons><aj:button action=\"LanguageList.pick('"+languages.codes[a]+"');\">"+languages.names[a]+"</aj:button><aj:button action=\"LanguageList.add('"+languages.codes[a]+"');\">+</aj:button></aj:buttons>"}_s(LanguageList.picker,"innerHTML",HTML.parse(b,{buttons:true,button:true}));LanguageList.madePicker=true},setLang:function(a,b){_s(a.nextSibling,"innerHTML",HTML.parse('<aj:langItem value="'+b+'" />',LanguageList.toParse));if(!RX.cls.noBtn.test(_g(a.nextSibling,"className"))){_a(a.nextSibling,"className"," noBtn")}_s(a,"value",b);if(a.onkeydown){a.onkeydown()}},pick:function(a){LanguageList.setLang(LanguageList.pickTarget.previousSibling.previousSibling,a);LanguageList.hidePicker()},add:function(b){var a=RX.langs[b]||(RX.langs[b]=new RegExp("\\b"+b+"\\b"));if(a.test(_g(LanguageList.pickTarget.previousSibling.previousSibling,"value"))){return}_i(LanguageList.pickTarget.previousSibling,"beforeEnd",HTML.parse('<aj:langItem value="'+b+'" />',LanguageList.toParse));_rT(LanguageList.pickTarget.previousSibling,"className",RX.cls.noBtn,"");_a(LanguageList.pickTarget.previousSibling.previousSibling,"value"," "+b);if(constants.hideLangPickerAfterAdd){LanguageList.hidePicker()}else{UI._apply(18);LanguageList.repositionPicker()}if(LanguageList.pickTarget.previousSibling.previousSibling.onkeydown){LanguageList.pickTarget.previousSibling.previousSibling.onkeydown()}},isReadOnly:function(a){return RX.cls.readOnly.test(_g(a.parentNode,"className"))}};var LanguageLists=[];var TreeToggle={click:function(e,d){var a=!RX.cls.expanded.test(_g(e,"className"));var c=a?RX.cls.collapsed:RX.cls.expanded;var f=a?"expanded":"collapsed";var b=e.nextSibling.nextSibling;_r(e,"className",c,f);if(b){_r(b,"className",c,f);if(a){Animate.blindDown(b)}else{Animate.blindUp(b)}}}};var Button={noAnimationsHighlightDelay:500,tooltip:false,getButtonObject:function(c){if(!c.buttonObject){var b=_g(c,"className");var a=c.buttonObject={disabled:RX.cls.disabled.test(b),down:RX.cls.down.test(b),element:c,hover:RX.cls.hover.test(b),pressed:RX.cls.pressed.test(b),sticky:RX.cls.sticky.test(b),tooltip:_g(c,"title")};if(a.tooltip){_s(c,"title","")}}return c.buttonObject},mouseover:function(d,c){var a=Button.getButtonObject(d);if(a.hover){return false}a.hover=true;var b=_g(d,"className")+" hover";if(d.mousedownOut){d.mousedown=true;d.mousedownOut=false;b=b+" pressed";a.pressed=true}_s(d,"className",b);if(a.tooltip){Tooltip.show(c,a.tooltip);Button.tooltip=true}Sound.play("hover")},mouseout:function(d,c){var a=Button.getButtonObject(d);if(!a.hover){return false}a.hover=false;var b=_g(d,"className").replace(" hover","");if(d.mousedown){d.mousedown=false;d.mousedownOut=true;b=b.replace(" pressed","");a.pressed=false}_s(d,"className",b);if(Button.tooltip&&c){Tooltip.hide();Button.tooltip=false}},mousedown:function(c,b){var a=Button.getButtonObject(c);if(c.mousedown){if(variables.buttonPressed===c){Button.mouseup(c)}else{throwError("This should never be reached (Button -> mousedown)#2; ID: "+c.id+", Text: "+c.innerHTML)}}if(!a.disabled){if(variables.buttonPressed){Button.mouseup(variables.buttonPressed,b)}Button.press(c);c.mousedown=true;if(Button.tooltip){Tooltip.hide();Button.tooltip=false}variables.buttonPressed=c}},mouseup:function(c,b){var a=Button.getButtonObject(c);if(c.mousedownOut){c.mousedownOut=false;c.mousedown=true}if(c.mousedown){if(variables.buttonPressed!==c){if(variables.buttonPressed){Button.mouseup(variables.buttonPressed)}variables.buttonPressed=c}c.mousedown=false;Button.release(c);if(a.sticky){if(a.down){a.down=false;_r(c,"className",RX.cls.down,"")}else{a.down=true;_a(c,"className"," down")}}variables.buttonPressed=null}var d=b&&(b.target||b.srcElement);if(c==d&&b.button==(isIE?1:0)){c.delayedClickCheck=b;setTimeout(function(){if(c.delayedClickCheck==b){c.onclick(b);c.focus()}},10)}},mousemove:function(b,a){if(Button.tooltip){Tooltip.updatePosition(a)}},keydown:function(c,b){var a=b.charCode||b.keyCode;if(a==13||a==32){c.onclick(b);stopEvt(b);return false}},getTextNode:function(a){return a},press:function(b){var a=Button.getButtonObject(b);if(a.pressed){return}_a(b,"className"," pressed");a.pressed=true},release:function(b){var a=Button.getButtonObject(b);if(!a.pressed){return}_rT(b,"className",RX.cls.pressed,"");a.pressed=false},isPressed:function(a){return Button.getButtonObject(a).pressed},isDown:function(a){return Button.getButtonObject(a).down},isDisabled:function(a){return Button.getButtonObject(a).disabled},disable:function(b){var a=Button.getButtonObject(b);if(a.disabled){return}a.disabled=true;_a(b,"className"," disabled");Button.mouseout(b)},enable:function(b){var a=Button.getButtonObject(b);if(!a.disabled){return}a.disabled=false;_r(b,"className",RX.cls.disabled,"")},clicked:function(a){Sound.play("click");UI.toFocus=a},startHighlight:function(a,b){a.transition=b||"highlight";if(a.glowing){return}if(!a.highlightProp){a.highlightProp=parseFloat(getStyle(a).borderBottomWidth||"0")!=0?"borderColor":"background"}a.glowing=true;if(AJ.animations){Animation.add(Button.highlightUp,a)}else{a.highlightTimeout=setTimeout(Button.highlightUp.bind(a,1),Button.noAnimationsHighlightDelay)}},stopHighlight:function(a){if(!a.glowing){return}a.glowing=false;if(!a.highlightProp){return}if(a.highlightTimeout){clearTimeout(a.highlightTimeout);a.highlightTimeout=null;_s(a.style,a.highlightProp,"")}else{Animation.clear(a)}},highlightUp:function(e){var l=this,n=constants.buttonTransitions[l.transition];if(e>=1){if(!l.glowing){_s(l.style,l.highlightProp,"");return}_sC(l.style,l.highlightProp,"rgb("+n[1][0]+","+n[1][1]+","+n[1][2]+")");if(AJ.animations){l.highlightTimeout=null;Animation.add(Button.highlightDown,l)}else{l.highlightTimeout=setTimeout(Button.highlightDown.bind(l,1),Button.noAnimationsHighlightDelay)}}else{var d=1-e;var k=Math.round(n[0][0]*d+n[1][0]*e);var h=Math.round(n[0][1]*d+n[1][1]*e);var a=Math.round(n[0][2]*d+n[1][2]*e);var f="rgb("+k+","+h+","+a+")";_sC(l.style,l.highlightProp,f)}},highlightDown:function(e){var l=this,n=constants.buttonTransitions[l.transition];if(e>=1){if(!l.glowing){_s(l.style,l.highlightProp,"");return}_sC(l.style,l.highlightProp,"rgb("+n[0][0]+","+n[0][1]+","+n[0][2]+")");if(AJ.animations){l.highlightTimeout=null;Animation.add(Button.highlightUp,l)}else{l.highlightTimeout=setTimeout(Button.highlightUp.bind(l,1),Button.noAnimationsHighlightDelay)}}else{var d=1-e;var k=Math.round(n[0][0]*e+n[1][0]*d);var h=Math.round(n[0][1]*e+n[1][1]*d);var a=Math.round(n[0][2]*e+n[1][2]*d);var f="rgb("+k+","+h+","+a+")";_sC(l.style,l.highlightProp,f)}},getText:function(a){as(a,"Button->getText: elem?");return _g(a,"innerHTML")},setText:function(a,b){as(a,"Button->setText: elem?");_s(a,"innerHTML",b)},setTitle:function(a,b){as(a,"Button->setTitle: elem?");Button.getButtonObject(a).tooltip=b},langSetTitle:function(b,e,a){var c=document.getElementById(b);if(c){Button.setTitle(c,e)}else{if(windows[a]){var d=new RegExp('(<aj:button\\s*id="'+b+'"[^>]*?title=")[^"]*?"');as(d.test(windows[a]));windows[a]=windows[a].replace(d,"$1"+e+'"')}else{console.warn("Unable to change button %o title to %o (window %o). Window not found.",b,e,a)}}}};var Checkbox={mouseover:function(b,a){Button.mouseover(b,a)},mouseout:function(b,a){Button.mouseout(b,a)},click:function(b,a){if(Checkbox.isChecked(b)){Checkbox.uncheck(b)}else{Checkbox.check(b)}},check:function(b){var a=_g(b,"className");if(!RX.cls.checked.test(a)){_s(b,"className",a.replace(RX.cls.partial,"")+" checked")}},uncheck:function(b){var a=_g(b,"className");if(RX.cls.checkedPartial.test(a)){_s(b,"className",a.replace(RX.cls.checkedPartial,""))}},makePartial:function(b){var a=_g(b,"className");if(!RX.cls.partial.test(a)){_s(b,"className",a.replace(RX.cls.checked,"")+" partial")}},isChecked:function(a){return !!RX.cls.checked.test(_g(a,"className"))},isUnchecked:function(a){return !RX.cls.checkedPartial.test(_g(a,"className"))},isPartial:function(a){return RX.cls.partial.test(_g(a,"className"))},getTextNode:function(a){return a.lastChild},isDisabled:function(a){return RX.cls.disabled.test(_g(a,"className"))},disable:function(a){_a(a,"className"," disabled");Checkbox.mouseout(a)},enable:function(a){_r(a,"className",RX.cls.disabled,"")},clicked:function(a){Sound.play("click")},keydown:function(c,b){var a=b.charCode||b.keyCode;if(a==32){c.onclick(b)}},setTitle:function(a,b){Button.setTitle(a,b)},langSetTitle:function(e,d,a){var b=document.getElementById(e);if(b){Checkbox.setTitle(b,d)}else{if(windows[a]){var c=new RegExp('(<aj:checkbox\\s*id="'+e+'"[^>]*?title=")[^"]*?"');as(c.test(windows[a]));windows[a]=windows[a].replace(c,"$1"+d+'"')}else{console.warn("Unable to change checkbox %o title to %o (window %o). Window not found.",e,d,a)}}}};var Window={stack:[],windowsCreated:[],show:function(b){var h=0;if(RX.other.dashNoPay.test(b)){b=b.substr(0,b.length-7);h=2}else{if(RX.other.dashPay.test(b)){b=b.substr(0,b.length-4);h=1}}if(h==1&&!AJ.userType){variables.showWindowAfterLogin=b+"-pay";b="login";Util.info(Strings.mustLogIn,constants.appName)}var d=$[b];if(!d){if(windows[b]){events.beforeFirstWindowShow(b);var a=windows[b].trim();if(h){a=a.replace(RX.cls.yesNoPayg,h==1?"yes-pay":"no-pay")}Window.betState[b]=h;delete windows[b];_an($.page,d=UI.fromAJ(a));$[b]=d=d.firstChild;_s(d,"id",b);UI._apply(13);if(!as(d,"The created window should exist ("+b+"). Windows created: "+Window.windowsCreated.join(", "))){return}Window.windowsCreated.push(b);Util.findElements(b)}else{throwError('Window "'+b+'" not found! Windows created: '+Window.windowsCreated.join(", "));return}}else{if(h&&Window.betState[b]!=h){Util.setPayElements(b,h==1);if(Window.onBetStateChange[b]){Window.onBetStateChange[b](h)}Window.betState[b]=h}}var g=d.firstChild.innerHTML,c=null;if(Window.stack.length){if(Window.stack[Window.stack.length-1]==d){Window._updateWindowLinks();Hash.reHash();return}else{c=Window.stack[Window.stack.length-1];_s(c.style,"display","none");Animate.blind($.page,c,d,0.5);if(Field.activeElem&&c.contains(Field.activeElem)){Field.activeElem.blur()}}}Window.stack.removeItem(d);Window.stack.push(d);_s(d.style,"display","");Activity.updateTitle(constants.appName+" - "+g);Hash.reHash();events.onWindowShow(b);UI.afterApplyOnce.push(events.afterWindowShow.bound[b]||(events.afterWindowShow.bound[b]=events.afterWindowShow.bind(events,b)));if(AJ.bigAnimations){Animate.fade(d,0,1,0.5)}if(variables.currentWindow=="play"&&!Idle.idle){Idle.sendIdleToServer(0)}variables.currentWindow=b;if(variables.currentWindow=="play"&&!Idle.idle){Idle.sendIdleToServer(null)}Window._updateWindowLinks();try{if(pageTracker){pageTracker._trackPageview(b)}}catch(f){throwError("Google Analytics failed on tracking page view.",true)}},hide:function(a){console.log("Does this still happen? Erm, remove?!");if(RX.other.dashNoPay.test(a)){a=a.substr(0,a.length-7)}else{if(RX.other.dashPay.test(a)){a=a.substr(0,a.length-4)}}var c=$[a];var d="";if(c==Window.stack[Window.stack.length-1]&&Window.stack.length>1){d=Window.stack[Window.stack.length-2].firstChild.innerHTML}_s(c.style,"display","none");if(c==Window.stack[Window.stack.length-1]&&Window.stack.length>1){var b=Window.stack[Window.stack.length-2];_s(b.style,"display","")}Window.stack.removeItem(c);if(d){document.title=(constants.appName+" - "+d).replace(RX.chr.ampg,"&").replace(RX.chr.gtg,">");variables.currentWindow=Window.stack.last().id;events.onWindowShow(variables.currentWindow);UI.afterApplyOnce.push(events.afterWindowShow.bound[variables.currentWindow]||(events.afterWindowShow.bound[variables.currentWindow]=events.afterWindowShow.bind(events,variables.currentWindow)))}Hash.reHash();Window._updateWindowLinks()},setTitle:function(a,c){var b=$[a];if(!b){Window.show(a);if(!(b=$[a])){return}}if(_g(b.firstChild,"innerHTML")!=c){_s(b.firstChild,"innerHTML",c);if(Window.stack.length&&Window.stack[Window.stack.length-1]==b){document.title=(constants.appName+" - "+c).replace(RX.chr.rampg,"&").replace(RX.chr.rgtg,">")}}},setContent:function(b,a){var c=$[b];_s(c.lastChild,"innerHTML",a)},betState:{},onBetStateChange:{findGame:function(a){Rooms.refresh()}},windowLinks:{},init:function(){var a=getElementsByClassName(document.body,"windowLink");for(var b=0;b<a.length;b++){var c=String(a[b].getAttribute("onclick")||a[b].getAttribute("onmouseup")||a[b].getAttribute("onmousedown")).match(RX.other.windowLink);if(!c){console.warn("Unable to find window reference for link %o",a[b]);continue}c=c[2];if(!Window.windowLinks[c]){Window.windowLinks[c]=[]}Window.windowLinks[c].push(a[b])}},lastWindowShown:null,_updateWindowLinks:function(b){var d,a=Window.lastWindowShown;Window.lastWindowShown=variables.currentWindow;if(Window.betState[variables.currentWindow]===1){Window.lastWindowShown+="-pay"}else{if(Window.betState[variables.currentWindow]===2){Window.lastWindowShown+="-no-pay"}}if(Window.lastWindowShown===a){return}if(a){d=Window.windowLinks[a];if(d&&d.length){for(var c=0;c<d.length;c++){_r(d[c],"className",RX.cls.disabled,"")}}}d=Window.windowLinks[Window.lastWindowShown];if(d&&d.length){for(var c=0;c<d.length;c++){_a(d[c],"className"," disabled")}}},langSetTitle:function(a,b){if($[a]){Window.setTitle(a,b)}else{if(windows[a]){windows[a]=windows[a].replace(/<aj:window title="[^"]*">/,'<aj:window title="'+b+'">')}else{console.warn("Unable to change window %o title to %o. Window not found.",a,b)}}}};var windowStack=Window.stack;var show=Window.show;var hide=Window.hide;Window.findRoomWindow="findGame";Window.makeRoomWindow="findGame";var Balloon={width:200,list:[],exists:function(a){return !!Balloon.list[a]},show:function(d,c,e){if(arguments.length<3){throwError("Balloon id is required!")}var a=Balloon._create(d,e);Balloon.list[e]=a;UI.afterApplyOnce.push(function(){var b=offsetBox(c,true);var f=offsetBox(document.body);b[0]-=f[0];b[1]-=f[1];var g=b[1]+b[3]+1+50;if(f[2]>=b[0]+Balloon.width){_s(a.style,"left",b[0]+"px");_s(a.style,"top",g+"px");_a(a,"className"," topLeftAnchor")}else{_s(a.style,"left",b[0]+b[2]-Balloon.width+"px");_s(a.style,"top",g+"px");_a(a,"className"," topRightAnchor")}_s(a.style,"visibility","visible");Animate.slideUp(a,50,1).keep=true});Balloon._show(a);return a},_show:function(a){_an(document.body,a);Animate.fade(a,0,1)},tryHide:function(a){if(Balloon.exists(a)){Balloon.hide(a)}},hide:function(d,c){if(typeof d=="string"){d=Balloon.list[d]}if(d.hiding){return}d.hiding=true;Animation.clear(d);Balloon.list[d.id]=null;var b=Animate.fade(d,1,0,!!c?0.5:1);if(b){b.after(_o)}},setContent:function(a,b){_s(a.lastChild,"innerHTML",b)},_create:function(b,c){var a=arguments.length;if(a==0){b="&nbsp;"}c=(typeof c!="undefined"&&c)?' id="'+c+'"':"";return UI.fromHTML("<div"+c+' class="balloon opac" style="visibility: hidden" onclick="Balloon.hide(this);"><div class="anchor"><div class="anchorMask"></div></div><div>'+b+"</div></div>")}};var Balloons={changeNick:{id:"changeNickBalloon",delay:30000,timeout:null,show:function(){if(!Balloons.changeNick.timeout){Balloon.show(Strings.clickNickToChange,$.nick,Balloons.changeNick.id)}Balloons.changeNick.timeout=setTimeout(Balloons.changeNick.hide,Balloons.changeNick.delay);variables.changeNickBalloon=false},hide:function(a){if(Balloons.changeNick.timeout){a=a===true;Balloon.tryHide(Balloons.changeNick.id,a);Balloons.changeNick.timeout=null}}}};var TabFolder={animationSpeed:0.5,setPage:function(f,d){var h=document.getElementById(d);if(_g(h.style,"display")!="none"&&!h.slidingOut){return}else{var e,b;var g=null;var l=null;var c=$A_(h.parentNode.childNodes);var k=$A_(f.parentNode.childNodes);for(e=0;b=c[e];e++){if(_g(b.style,"display")!="none"&&!b.slidingOut){l=b;g=k[e];break}}_r(g,"className",RX.cls.selected,"");_a(f,"className"," selected");f.parentNode.curPage=c.indexOf(h);var a=l.offsetHeight;Animation.clear(l);Animation.clear(h);_sC(f.parentNode,"scrollTop",0);if(a){if(h.parentNode.sliding){h.parentNode.nextSlide=[l,h,"Horizontal",TabFolder.animationSpeed]}else{h.parentNode.sliding=true;Animate.slidePush(l,h,"Horizontal",TabFolder.animationSpeed).after(TabFolder._checkNext)}}else{_s(l.style,"display","none");_s(h.style,"display","");events.afterTabFolderSetPage(f.parentNode,f.parentNode.curPage)}}Hash.reHash()},setPageByTitle:function(a,c){var b=$A_(a.childNodes);b[b.pluck_("innerHTML").indexOf__(c)].onclick()},setPageByIdx:function(b,a){b.childNodes[a].onclick()},setPageTitle:function(a,b,c){_s(a.childNodes[b],"innerHTML",c)},getIndex:function(c){var b,d,a=$A_(c.childNodes);for(b=0;d=a[b];b++){if(RX.cls.selected.test(_g(d,"className"))){return b}}return -1},_checkNext:function(b){b=b.parentNode;if(b.nextSlide){var a=b.nextSlide;delete b.nextSlide;Animate.slidePush.apply(Animate,a).after(TabFolder._checkNext)}else{b.sliding=false;events.afterTabFolderSetPage(b.previousSibling,b.previousSibling.curPage)}},langSetPageTitle:function(k,a,q,r){var c=document.getElementById(k);if(c){TabFolder.setPageTitle(c,a,q)}else{if(windows[r]){var n=windows[r];var p=[],l=[],f=[],e;while(e=HTML.rx.tabFolder1g.exec(n)){f.push(e[1]||"generatedId");p.push(e.index)}while(e=HTML.rx.tabFolder2g.exec(n)){l.push(e.index)}if(p.length!=l.length){console.log("Error, <aj:tabFolder> and </aj:tabFolder> don't match!")}p.push(n.length);var b=/<aj:tabPage\s*name=\"[^"]*"\s*>/g;for(var g=0;g<f.length;g++){if(f[g]==k){b.lastIndex=p[g];var h=g+1;var d=0;while(l[d]<p[g]){d++}for(j=0;j<=a;j++){e=b.exec(n);while(e.index>p[h]){h++;while(p[h]<l[d]){h++;d++}d++;b.lastIndex=l[d-1];e=b.exec(n)}}windows[r]=n.substr(0,e.index)+'<aj:tabPage name="'+q+'">'+n.substr(e.index+e[0].length);return}}console.warn("Unable to change page name for TabPage %o of TabFolder %o (window %o) to %o. Typo in TabFolder name?",a,k,r,q)}}}};var Menu={init:function(){Menu.holder=document.body},popUnder:function(c,b){var a=offsetBox(b);Menu.pop(c,a[0],a[1]+a[3])},popBeside:function(c,b){var a=offsetBox(b);Menu.pop(c,a[0]+a[2],a[1])},pop:function(c,a,d){if(arguments.length<3){d=pointerY(a);a=pointerX(a)}var b;if(typeof c=="number"){if(b=document.getElementById("menu"+c)){c=b}else{UI._apply(26);c=document.getElementById("menu"+c)}}_s(c.style,"left",a+"px");_s(c.style,"top",d+"px");Menu.open.push(c);Animate.blindDown(c)},submenus:[],actions:[],holder:null,open:[],closeAll:function(){for(var a=0;a<Menu.open.length;a++){_s(Menu.open[a].style,"display","none")}Menu.open=[]},nextId:1,createFromObj:function(a){a.id=Menu.nextId++;_i(Menu.holder,"beforeEnd",Menu._createFromObj(a));return a.id},_createFromObj:function(c){if(c.name==="-"){return'<hr class="menuSeparator" />'}else{if(c.name){var a="";if(c.list){a+="Menu.popBeside(Menu.submenus["+Menu.submenus.length+"], this);";Menu.submenus.push(Menu.createFromObj({list:c.list}))}else{a+="Menu.closeAll();"}if(c.action){if(typeof c.action=="string"){a+=c.action}else{a+="Menu.actions["+Menu.actions.length+"]();";Menu.actions.push(c.action)}}return'<div class="menuItem '+(c.clss||"")+'" onclick="'+a+'" title="'+(c.title||c.name)+'">'+c.name+"</div>"}else{if(c.list){var d='<div id="menu'+c.id+'" class="menu" style="display: none;">';for(var b=0;b<c.list.length;b++){d+=Menu._createFromObj(c.list[b])}d+="</div>";return d}else{throw new Error("Unable to create menu[Item] from nothing.")}}}},destroy:function(b){var a;if(typeof b=="number"){if(a=document.getElementById("menu"+b)){_o(a)}}else{if(b.tagName){_o(b)}else{if(b.id&&(a=document.getElementById("menu"+b.id))){_o(a)}}}}};var TagList={input:null,curList:null,curItem:null,curTags:null,ignoreNextFocus:false,toParse:{tagItem:true},init:function(){TagList.input=UI.fromHTML('<input type="text" onblur="TagList.inputBlur();" onkeydown="TagList.inputKeyDown(arguments && arguments[0] || event);" />')},inputBlur:function(){_oC(TagList.input);if(!TagList.curList){_sC(TagList.input,"value","")}else{if(_g(TagList.input,"value")){TagList.inputChange(0)}_r(TagList.curList,"className",RX.cls.active,"");TagList.curList=null}Field.tryHideHints(TagList.input)},inputKeyDown:function(d){var c=d.charCode||d.keyCode,b=false;switch(c){case 8:if(TagList.input.value==""&&TagList.input.previousSibling){TagList.input.previousSibling.onclick(d)}else{b=true}break;case 37:if(TagList.input.value==""&&TagList.input.previousSibling){TagList.input.previousSibling.onclick(d)}break;case 39:if(TagList.input.value==""&&TagList.input.nextSibling){TagList.curItem.nextSibling.onclick(d)}break;case 40:if(Field.isShowingHints(TagList.input)){Field.hintDown()}break;case 38:if(Field.isShowingHints(TagList.input)){Field.hintUp()}break;case 13:if(_g(TagList.input,"value")){stopEvt(d)}if(Field.canFeed(TagList.input)){Field.feedCurrent(TagList.input)}else{var a=TagList.curList;TagList.inputBlur();UI.afterApplyOnce.push(function(){UI.toFocus=a.lastChild;if(!UI.timer){UI.scheduleTimer()}})}break;case 27:stopEvt(d);_sC(TagList.input,"value","");if(TagList.input.nextSibling){TagList.input.nextSibling.onclick(d)}else{if(TagList.input.previousSibling){TagList.input.previousSibling.onclick(d)}else{TagList.inputBlur(d)}}break;default:b=true}if(b){setTimeout(function(){TagList.inputChange(1)},10)}},itemKeyDown:function(d){var c=d.charCode||d.keyCode;switch(c){case 8:case 46:var b=TagList.curItem;var a=b.parentNode;if(TagList.curItem.nextSibling){TagList.selectItem(TagList.curItem.nextSibling)}else{if(TagList.curItem.previousSibling){TagList.selectItem(TagList.curItem.previousSibling)}}TagList.removeItem(b);if(!TagList.curItem){TagList.select(a)}stopEvt(d);break;case 37:if(TagList.curItem.previousSibling&&TagList.curItem.previousSibling.onclick){TagList.curItem.previousSibling.onclick(d)}stopEvt(d);break;case 39:if(TagList.curItem.nextSibling){TagList.curItem.nextSibling.onclick(d)}else{TagList.select(TagList.curItem.parentNode)}stopEvt(d);break;default:break}},inputChange:function(f){if(!TagList.input.parentNode){return}if(!TagList.input.value){Field.tryHideHints(TagList.input);return}var b=_g(TagList.input,"value").split(RX.chr.comma),e,h,g=false;if(b.length>f){var c=(_g(TagList.curList.firstChild,"value")||"").split(RX.chr.comma);var d="";if(!c[0]){c.length=0}for(e=0;e<b.length-f;e++){if(h=b[e].match(RX.other.etc7)){h=h[1]=="all"?Strings.globalTag:h[1]}if(h&&c.indexOf(h[1])<0){c.push(h);d+=HTML.parse('<aj:tagItem value="'+h+'" />',TagList.toParse);g=true}}if(g){_s(TagList.curList.firstChild,"value",c.join(","));_i(TagList.input,"beforeBegin",d);if(TagList.curList.firstChild.onchange){var a=TagList.curList.firstChild;UI.afterApplyOnce.push(function(){a.onchange()})}}var h=b[b.length-f]||"";_s(TagList.input,"value",h);_s(TagList.input.style,"width",h.length+2+"em")}else{_s(TagList.input.style,"width",_g(TagList.input,"value").length+2+"em")}if(_g(TagList.input,"value")){Field.listHints(TagList.input,TagList._withoutTags(Util.tagsWhichBeginWith(_g(TagList.input,"value")),TagList.curTags),TagList.hintFeed)}else{Field.tryHideHints(TagList.input)}},_withoutTags:function(d,a){if(a.length==0){return d}var c=[];for(var b=0;b<d.length;b++){if(a.indexOf(d[b].replace(RX.elem.bg,""))<0){c.push(d[b])}}if(!c.length&&d.length){c.allDuplicates=true}return c},hintFeed:function(b){b=b.replace(RX.elem.bg,"");var c=_g(TagList.curList.firstChild,"value");_s(TagList.curList.firstChild,"value",c?c+","+b:b);if(TagList.curList.firstChild.onchange){var a=TagList.curList.firstChild;UI.afterApplyOnce.push(function(){a.onchange()})}TagList.curTags.push(b);_i(TagList.input,"beforeBegin",HTML.parse('<aj:tagItem value="'+b+'" />',TagList.toParse));_s(TagList.input,"value","");Field.tryHideHints(TagList.input)},itemFocus:function(b,a){b.onclick(a);Util.focusMovedTo(b)},itemBlur:function(b,a){if(TagList.curItem==b){TagList.blurItem(b)}},setValue:function(d,e){var f=typeof e=="string"?e.split(RX.chr.comma):e.clone(),b,a=[],c;if(f[0]){for(b=0;b<f.length;b++){c=f[b].match(RX.other.etc7)[1];if(c=="all"){c=Strings.globalTag}a.push(c);f[b]='<aj:tagItem value="'+c+'" />'}}var h=d.nextSibling;while(h){_o(h);h=h.nextSibling}var g=document.createElement("div");if(f.length){_i(d.parentNode,"beforeEnd",HTML.parse(f.join(""),TagList.toParse))}_s(d,"value",a.join(",")||"");if(d.onchange){UI.afterApplyOnce.push(function(){d.onchange()})}if(d.parentNode==TagList.curList){TagList.curTags=a}},onMouseDown:function(a){TagList.ignoreNextFocus=true},onFocus:function(a){if(TagList.ignoreNextFocus){TagList.ignoreNextFocus=false;return}if(_g(a.firstChild,"value")){if(UI.timer){UI.toFocus=a.childNodes[1]}else{a.childNodes[1].focus()}}else{TagList.select(a)}},select:function(a){if(TagList.isReadOnly(a)){return}if(TagList.curList){TagList.inputBlur()}if(TagList.curItem){TagList.blurItem(TagList.curItem)}TagList.curList=a;TagList.curTags=_g(TagList.curList.firstChild,"value").split(",");_sC(TagList.input.style,"width","3ex");_sC(TagList.input,"value","");_an(a,TagList.input);_a(a,"className"," active");UI.toFocus=TagList.input},selectItem:function(a){if(RX.cls.linking.test(_g(a.parentNode,"className"))){DomBr._browseCateg(domainsHash.byTag[a.firstChild.nodeValue].allDomIndex,a);Util.navigate(Window.findRoomWindow,"tFFG",0);return}if(TagList.curItem==a||TagList.isReadOnly(a.parentNode)){return}if(TagList.curList){TagList.inputBlur()}if(TagList.curItem){TagList.blurItem(TagList.curItem)}TagList.curItem=a;_a(a,"className"," active");UI.toFocus=a},blurItem:function(a){_r(a,"className",RX.cls.active,"");if(TagList.curItem==a){TagList.curItem=null}},removeItem:function(c){var b=c.firstChild.nodeValue;var d=RX.tags[b]||(RX.tags[b]=new RegExp("(^|,)"+b+"(,|$)"));_s(c.parentNode.firstChild,"value",_g(c.parentNode.firstChild,"value").replace(d,",").replace(RX.other.leadingComma,"").replace(RX.other.trailingComma,""));_o(c);if(c.parentNode.firstChild.onchange){var a=c.parentNode.firstChild;UI.afterApplyOnce.push(function(){a.onchange()})}if(TagList.curList==c.parentNode){TagList.curTags.removeItem(b)}},isReadOnly:function(a){return RX.cls.readOnly.test(_g(a,"className"))},hasTag:function(b,a){var c=RX.tags[a]||(RX.tags[a]=new RegExp("(^|,)"+a+"(?:,|$)"));return c.test(_g(b,"value"))},addTag:function(c,a){if(a=="all"){a=Strings.globalTag}if(TagList.hasTag(c,a)){return}var b=_g(c,"value");if(c.parentNode==TagList.input.parentNode){_s(c,"value",b?b+","+a:a);_i(TagList.input,"beforeBegin",HTML.parse('<aj:tagItem value="'+a+'" />',TagList.toParse))}else{_s(c,"value",b?b+","+a:a);_i(c.parentNode,"beforeEnd",HTML.parse('<aj:tagItem value="'+a+'" />',TagList.toParse))}if(c.onchange){UI.afterApplyOnce.push(function(){c.onchange()})}if(TagList.curList==c.parentNode){TagList.curTags.push(a)}},removeTag:function(b,a){if(a=="all"){a=Strings.globalTag}if(!TagList.hasTag(b,a)){return}b=b.nextSibling;while(b){if(b.firstChild.nodeValue!=a){b=b.nextSibling}else{break}}TagList.removeItem(b)}};var Grid={lastTh:{},make:function(c){var d=c.tHead.rows[0],a;for(var b=0;a=d.cells[b];b++){if(RX.cls.sortable.test(_g(a,"className"))){Grid.makeSortable(a,c)}}},makeSortable:function(b,a){b.onclick=Grid.sortClick;_i(b,"beforeEnd",'<span class="sortIcon">&nbsp;</span>')},sortClick:function(){var d=arguments&&arguments[0]||event;var c=d.target||d.srcElement;var b=c.parentNode;while(b.tagName.toLowerCase()!="table"){b=b.parentNode}var a=Grid.lastTh[b.id];if(a&&a!=c){_r(a,"className",RX.cls.ascdesc,"")}Grid.lastTh[b.id]=c;Grid.sortBy(c,b)},sortBy:function(a,k){var f=true;if(RX.cls.asc.test(_g(a,"className"))){f=false}var b=k.tBodies[0];var c,d=[];var g=Grid._retVal;var e=RX.cls.numbers.test(_g(a,"className"))?Grid.cmpNumbers:RX.cls.number.test(_g(a,"className"))?Grid.cmpNumber:Grid.cmpStr;var n,l=a.cellIndex;for(c=0;n=b.rows[c];c++){d[c]={i:c,tr:n,val:n.cells[l].innerHTML,toString:g}}d.sort(e);var h=k.parentNode;k.parentNode.removeChild(k);if(f){for(c=0;c<d.length;c++){_an(b,d[c].tr)}}else{for(c=d.length-1;c>=0;c--){_an(b,d[c].tr)}}_s(a,"className",f?_g(a,"className").replace(RX.cls.desc,"")+" asc":_g(a,"className").replace(RX.cls.asc,"")+" desc");_an(h,k);UI._apply(16)},_retVal:function(){return this.val},cmpNumber:function(d,c){return d-c},cmpNumbers:function(d,c){var g=String(d).match(RX.other.numbers);var f=String(c).match(RX.other.numbers);for(var e=0;e<g.length&&e<f.length;e++){if(g[e]=="\u221E"){g[e]=Infinity}if(f[e]=="\u221E"){f[e]=Infinity}var h=g[e]-f[e];if(h){return h}}return 0},cmpStr:function(d,c){if(d.val>c.val){return 1}else{if(c.val>d.val){return -1}else{return 0}}}};var Tooltip={showDelay:0.5,div:null,isVisible:false,timeout:null,lastBind:null,init:function(){Tooltip.div=document.getElementById("tooltip");globalEvents.onclick.push(Tooltip.hide)},show:function(b){if(Tooltip.timeout){clearTimeout(Tooltip.timeout)}var a=$A(arguments);if(b.pageX||b.clientX){a[0]={target:b.target,srcElement:b.srcElement,pageX:b.pageX,clientX:b.clientX,pageY:b.pageY,clientY:b.clientY}}Tooltip.lastBind=a[0];var c=Tooltip.timeout=setTimeout(function(){if(Tooltip.timeout==c){Tooltip._show.apply(Tooltip,a);Tooltip.timeout=null}},Tooltip.showDelay*1000)},_show:function(a,b){if(!b){return}_s(Tooltip.div,"innerHTML",b||(a.target||a.srcElement).title);Animation.clear(Tooltip.div);_s(Tooltip.div.style,"visibility","hidden");_s(Tooltip.div.style,"display","");Tooltip.isVisible=true;UI._apply(15);Tooltip.updatePosition(a);_s(Tooltip.div.style,"visibility","");Animate.fade(Tooltip.div,0,0.9,0.5)},hide:function(){if(Tooltip.timeout){clearTimeout(Tooltip.timeout);Tooltip.timeout=null}if(!Tooltip.isVisible){return}Animation.clear(Tooltip.div);Animate.fade(Tooltip.div,0.9,0,0.5);Tooltip.isVisible=false;Tooltip.lastBind=null},updateText:function(a){_s(Tooltip.div,"innerHTML",a)},updatePosition:function(c){if(!Tooltip.isVisible){return}Tooltip.lastBind=c;var a=Tooltip.div.offsetHeight;var e=offsetBox(document.body,null,true);if(c.pageX||c.clientX){var d=pointerY(c);if(-e[1]+e[3]-d>a+21){_s(Tooltip.div.style,"top",d+20+"px");_s(Tooltip.div.style,"bottom","");_s(Tooltip.div.style,"left",pointerX(c)-10+"px")}else{_s(Tooltip.div.style,"top","");_s(Tooltip.div.style,"bottom",e[3]-d+5+"px");_s(Tooltip.div.style,"left",pointerX(c)-10+"px")}}else{var b=offsetBox(c);var d=b[1]-a;if(d<0){d=b[1]+b[3]}_s(Tooltip.div.style,"top",d+"px");_s(Tooltip.div.style,"bottom","");_s(Tooltip.div.style,"left",b[0]+"px")}}};var Field={hintDiv:null,hinting:null,fieldHint:null,activeHint:null,hintCallback:null,activeElem:null,changeInterval:null,lastChange:null,ignoreNextFocus:null,ignoreNextBlur:null,init:function(){Field.hintDiv=document.getElementById("hintDiv");Field.fieldHint=document.getElementById("fieldHint")},init2:function(){UI.makeExtraWidth(Field.fieldHint)},onfocus:function(d,c){if(Field.ignoreNextFocus==d){Field.ignoreNextFocus=null;return}if(Field.activeElem){Field.onblur(Field.activeElem,{})}Util.focusMovedTo(d);var a=_g(d,"className");var e=RX.cls.empty.test(a);if(e){_s(d,"value","");a=a.replace(RX.cls.empty,"")}a+=" active";if(d._maxLength){_s(d,"maxLength",d._maxLength)}_s(d,"className",a);var f=d.id!="msg"&&d.id!="ansText"&&(d.getAttribute("hint")||_g(d,"title"));if(f){_sC(Field.fieldHint,"innerHTML",f);_s(Field.fieldHint.style,"display","");var b=offsetBox(d);_s(Field.fieldHint.style,"top",b[1]+b[3]+"px");_s(Field.fieldHint.style,"left",b[0]+"px");_s(Field.fieldHint.style,"maxWidth",b[2]-Field.fieldHint.extraWidth+"px")}if(d.getAttribute("isPassword")){if(d.type!="password"){if(!isIE){d.type="password";d.focus()}else{UI.afterApplyOnce.push(function(){if(!d.cloneRef){d.cloneRef=d.cloneNode(false);d.cloneRef.type="password";d.cloneRef.cloneRef=d}d.cloneRef.value="";d.cloneRef.className=d.className;if(d.maxLength){d.cloneRef.maxLength=d.maxLength}Field.ignoreNextFocus=d.cloneRef;Field.ignoreNextBlur=d;Field.activeElem=d.cloneRef;d.parentNode.replaceChild(d.cloneRef,d);d.cloneRef.focus();setTimeout(function(){d.cloneRef.focus()},10)})}}}Field.activeElem=d;if(d.onchange){Field.lastChange=_g(d,"value");Field.changeInterval=setInterval(Field.checkChange,50)}},onblur:function(c,b){if(unloading){return}if(Field.ignoreNextBlur==c){Field.ignoreNextBlur=null;return}if(Field.activeElem!=c){return}var a=_g(c,"className");if(_g(c,"value")==""){if(_g(c,"maxLength")&&_g(c,"maxLength")>0){c.removeAttribute("maxLength")||c.removeAttribute("maxlength")}a+=" empty";if(c.getAttribute("isPassword")){if(c.type!="text"){if(!isIE){c.type="text"}else{UI.afterApplyOnce.push(function(){if(c.parentNode){c.cloneRef.value=c.value;c.cloneRef.className=c.className;if(c.maxLength){c.cloneRef.maxLength=c.maxLength}c.parentNode.replaceChild(c.cloneRef,c)}})}}}_s(c,"value","("+_g(c,"title")+")")}a=a.replace(RX.cls.active,"");_s(c,"className",a);_sC(Field.fieldHint.style,"display","none");Field.activeElem=null;if(Field.changeInterval){clearInterval(Field.changeInterval);Field.checkChange();Field.changeInterval=Field.lastChange=null}},checkChange:function(){if(!Field.activeElem){return}var a=Field.value(Field.activeElem);if(a!=Field.lastChange){Field.lastChange=a;Field.activeElem.onchange()}},value:function(a){return Field.isEmpty(a)?"":_g(a,"value")},empty:function(a){if(Field.activeElem==a){_sC(a,"value","")}else{if(!RX.cls.empty.test(_g(a,"className"))){_a(a,"className"," empty");if(a.getAttribute("isPassword")){if(a.type!="text"){if(!isIE){a.type="text"}else{UI.afterApplyOnce.push(function(){a.parentNode.replaceChild(a.cloneRef,a)})}}}_s(a,"value",a.title?"("+a.title+")":"")}}},disable:function(a){if(Field.activeElem==a){a.blur()}_sC(a,"disabled",true)},enable:function(d){if(d.disabled){_sC(d,"disabled",false)}else{var c,b;if((c=d.changesIdx)&&(b=UI.changes.lst[c].propIdx.disabled)){UI.changes.lst[c].lst.splice(b-1,1);delete UI.changes.lst[c].propIdx.disabled;var e;for(var a=b;a<UI.changes.lst[c].prop.length-1;a++){e=UI.changes.lst[c].prop[a]=UI.changes.lst[c].prop[a+1];UI.changes.lst[c].propIdx[e]=a}UI.changes.lst[c].prop.pop()}}},isEmpty:function(a){return RX.cls.empty.test(_g(a,"className"))||!_g(a,"value")},setValue:function(a,b){if(b===""){Field.empty(a)}else{_rT(a,"className",RX.cls.empty,"");_s(a,"value",b)}if(a.onchange){a.onchange()}},feedHint:function(a){var b=_g(a,"innerHTML");if(Field.hintCallback){Field.hintCallback(b)}Field.hideHints()},canFeed:function(a){return Field.isShowingHints(a)&&Field.activeHint},feedCurrent:function(a){if(Field.isShowingHints(a)){Field.feedHint(Field.activeHint)}},listHints:function(c,d,f){var e='<div onmousedown="Field.feedHint(this); stopEvt(arguments && arguments[0] || event);">',a="</div>";var b=offsetBox(c);_s(Field.hintDiv,"innerHTML",d.length?e+d.join(a+e)+a:d.allDuplicates?'<div class="noMatch">'+Strings.allHintsAreDupes+"</div>":'<div class="noMatch">'+Strings.noMatch+"</div>");_sC(Field.hintDiv.style,"top",b[1]+b[3]+"px");_sC(Field.hintDiv.style,"left",b[0]+"px");_sC(Field.hintDiv.style,"display","");Field.hinting=c;Field.activeHint=null;Field.hintCallback=f},hideHints:function(){_s(Field.hintDiv.style,"display","none");Field.hinting=null},isShowingHints:function(a){return Field.hinting==a},tryHideHints:function(a){if(Field.isShowingHints(a)){Field.hideHints()}},setActiveHint:function(a){if(Field.activeHint){_r(Field.activeHint,"className",RX.cls.highlight,"")}Field.activeHint=a;_a(Field.activeHint,"className"," highlight")},hintDown:function(){UI._apply(10,true);if(RX.cls.noMatch.test(Field.hintDiv.firstChild.className)){return}Field.setActiveHint(Field.activeHint&&Field.activeHint.nextSibling||Field.hintDiv.firstChild)},hintUp:function(){UI._apply(11);if(RX.cls.noMatch.test(Field.hintDiv.firstChild.className)){return}Field.setActiveHint(Field.activeHint&&Field.activeHint.previousSibling||Field.hintDiv.lastChild)},setTitle:function(a,b){if(a.title==b){return}_s(a,"title",b);if(Field.isEmpty(a)){_s(a,"value","("+b+")")}},langSetTitle:function(b,d,a){var c=document.getElementById(b);if(c){Field.setTitle(c,d)}else{if(windows[a]){windows[a]=windows[a].replace(new RegExp('(<aj:input\\s[^>]*?title=")[^"]*?("[^>]*?id="'+b+'")'),"$1"+d+"$2")}else{console.warn("Unable to change field %o title to %o. Window %o not found.",b,d,a)}}},langSetHint:function(b,c,a){var d=document.getElementById(b);if(d){_s(d,"hint",c)}else{if(windows[a]){windows[a]=windows[a].replace(new RegExp('(<aj:input\\s[^>]*?id="'+b+'"[^>]*?hint=")[^"]*?(")'),"$1"+c+"$2")}else{console.warn("Unable to change field %o title to %o. Window %o not found.",b,newTitle,a)}}}};var Rooms={updateFilterTimeout:null,lastFilter:{time:0},updateFilter:function(a){if(Rooms.updateFilterTimeout){clearTimeout(Rooms.updateFilterTimeout)}if(a){Rooms._updateFilter()}else{Rooms.updateFilterTimeout=setTimeout(Rooms._updateFilter,constants.keySensitivity)}},_updateFilter:function(){var e=false;var c=Rooms.lastFilter;var a=RX.cls.yesPay.test(_g($.fRBet.parentNode.parentNode,"className"))?_g($.fRBet,"value").replace(RX.other.underg,"0"):"0-0";var b=new Date().valueOf();if(c.filter!=Field.value($.fRF)||c.lang!=_g($.fRL,"value")||c.bet!=a||b-c.time>=30*1000){c.filter=Field.value($.fRF);var f=(c.lang=$.fRL.value).split(" ");for(var d=0;d<f.length;d++){f[d]=languages.idFromCode[f[d]]}c.bet=a;c.time=b;a=a.split(RX.other.intervalDash);a[0]=a[0]-0;a[1]=a[1]-0;Request.updateRFilter(c.filter,f,a[0]||a[1]?a:null);_s($.findGameLoader.style,"display","")}Rooms.updateFilterTimeout=null},filterTag:function(a){Field.setValue($.fRF,a);document.getElementById("tFFG").lastChild.onclick();Rooms.updateFilter()},showAll:function(){Field.empty($.fRF);Rooms.updateFilter(true)},refresh:function(){Rooms.lastFilter={};Rooms.updateFilter(true)},setList:function(b){_s($.findGameLoader.style,"display","none");if(!b.length){_s(document.getElementById("noGameFound").style,"display","");_s(document.getElementById("gameList").style,"display","none")}else{var a=Window.betState[Window.findRoomWindow]==1;document.getElementById("noGameFound").style.display="none";var d=['<table id="gameList" class="grid" cellpadding="0" cellspacing="0"><thead>','<tr><th class="sortable">'+Strings.Title+'</th><th class="sortable">'+Strings.Category+'</th><th class="sortable">'+Strings.Tags+'</th><th class="sortable multilang">'+Strings.Lang+'</th><th class="sortable numbers">'+Strings.Players+(a?'</th><th class="sortable bet">'+Strings.BetHeader:"")+'</th><th class="sortable">'+Strings.Creator+"</th><th>"+Strings.Started+"</th></tr>","</thead><tbody>"];for(var c=0;c<b.length;c++){d.push("<tr onclick=\"Rooms.attemptJoin('"+b[c].title.replace(/'/g,"\\'")+"', '"+b[c].id+"', "+b[c].bet+');"><td>',b[c].title,"</td><td>",Strings.difficulty[b[c].diff],"</td><td>",b[c].kw.joina(),'</td><td class="multilang">',b[c].l?b[c].l.mapTo(languages.nameFromId).joina():"No language. Dyslexic?","</td><td>",b[c].people+" / "+(b[c].capacity?b[c].capacity:"\u221E"),(a?'</td><td class="bet">'+(b[c].bet?Util.printMoney(b[c].bet):Strings.free):""),"</td><td>",b[c].creator,"</td><td>",b[c].lobby?Strings.statusLobby:Strings.statusNoLobby,"</td></tr>")}d.push("</tbody></table>");d=d.join("");var e=document.createElement("div");document.getElementById("gameList").parentNode.removeChild(document.getElementById("gameList"));e.innerHTML=d;document.getElementById("noGameFound").parentNode.appendChild(e.firstChild);Grid.make(document.getElementById("gameList"))}},attemptJoin:function(b,d,a){if(currentRoom&&d==currentRoom.id){Util.info(Strings.alreadyInRoom,constants.appName);return}if(a&&a>AJ.balance){Util.alert(Util.sprintf(Strings.notEnoughMoneyToJoinRoom,b,a,AJ.balance));return}var c,e;var f=function(g){if(g){Quiz.setRoom({id:d},true)}};if(a){c=Util.sprintf(Strings.JoinRoomPay,b,a);e=[Strings.joinRoomPayNo,Strings.joinRoomPayYes]}else{c=Util.sprintf(Strings.JoinRoom,b);e=[Strings.joinRoomNo,Strings.joinRoomYes]}Alert.choice(c,e,f)}};var DomBr={lastBrTag:Strings.globalTag,categTooltip:function(a){return Util.sprintf(Strings.TagInfo,"<b>"+a.tag+"</b>")+"<br />"+a.subcat.pluck("label").joina()},printBrowseCategPath:function(a){var c="",b=a;while(b=b.parentCat){if(b.parentCat){c='<span class="link" onclick="DomBr._browseCateg('+b.allDomIndex+', this);" tooltiptitle="'+DomBr.categTooltip(b)+'">'+b.label+"</span> -> "+c}else{c='<span class="link" onclick="DomBr._browseCateg(0, this);" tooltiptitle="'+Util.sprintf(Strings.TagInfo,Strings.globalTag)+'">'+Strings.Top+"</span> -> "+c}}return"<h1>"+c+"<em>"+a.label+"</em></h1>"},makeDomainTable:function(f,b,a,e){if(!f.length){return'<div class="noMatch">'+Strings.noCategsMatch+"</div>"}var d,c;d='<table class="nav"><tbody><tr><td';var g=f.length>16?5:f.length>9?4:f.length==4?2:3;for(c=0;c<f.length;c++){if(c){if(c%g){d+="</td><td"}else{d+="</td></tr><tr><td"}}if(f[c].subdepth>1){d+=' onclick="DomBr._browseCateg('+f[c].allDomIndex+', this);"><span style="background: '+(f[c].image||"transparent; display: none;")+'">&nbsp;</span><h2><span class="link h2">'+f[c].label+'</span> <span class="link sml" onclick="Quiz.setRoom(\''+f[c].tag+'\', 1); stopEvt(arguments && arguments[0] || event);" title="'+Strings.joinPub+'">'+Strings.join+'</span> <span class="link sml" onclick="Rooms.filterTag(\''+f[c].tag+'\'); stopEvt(arguments && arguments[0] || event);" title="'+Strings.listCategGames+'">'+Strings.filter+"</span>";if(b&&b[c]&&b[c].length){d+='<span class="link" style="margin-left: 2em;" onclick="DomBr.showSubMatch('+f[c].allDomIndex+", '"+e+"');  stopEvt(arguments && arguments[0] || event);\">+"+b[c].length+"</span>"}d+="</h2><h3>";for(j=0;j<f[c].subcat.length;j++){if(f[c].subcat[j].subdepth>1){d+='<span class="link" onclick="Tooltip.hide(); DomBr._browseCateg('+f[c].subcat[j].allDomIndex+", this, "+f[c].allDomIndex+', this.parentNode.parentNode); stopEvt(arguments && arguments[0] || event);" tooltiptitle="'+DomBr.categTooltip(f[c].subcat[j])+'">'+f[c].subcat[j].label+"...</span> "}else{d+='<span class="link" onclick="Quiz.setRoom(\''+f[c].subcat[j].tag+'\', 1); stopEvt(arguments && arguments[0] || event);" tooltiptitle="'+Util.sprintf(Strings.TagInfo,"<b>"+f[c].subcat[j].tag+"</b>")+'">'+f[c].subcat[j].label+"</span> "}}d+="</h3>"}else{d+=" onclick=\"Quiz.setRoom('"+f[c].tag+'\', 1);"><span style="background: '+(f[c].image||"transparent; display: none;")+'">&nbsp;</span><h2><span class="link h2">'+f[c].label+'</span> <span class="link sml" onclick="Rooms.filterTag(\''+f[c].tag+'\'); stopEvt(arguments && arguments[0] || event)" title="'+Strings.listCategGames+'">'+Strings.filter+"</span></h2>"}}d+="</td></tr></tbody></table>";return d},domHTML:function(e){if(!e.browseHTML){var c,b;e.browseHTML='<div class="browsePanel">';e.browseHTML+=DomBr.printBrowseCategPath(e);if(e.vref){for(c=0;c<e.vref.length;c++){e.browseHTML+=DomBr.printBrowseCategPath(e.vref[c])}}e.browseHTML+='<div class="catStuff"><div style="float: right;"><aj:input title="'+Strings.Filter+"\" onchange=\"if (!(arguments && arguments[0] || event)) DomBr.updateDomainFilter(_g(this, 'value'), domainsHash["+e.allDomIndex+']);" id="DomBrFilter" /></div>';var d=Util.parentTags(e),a=Util.relatedTags(e);e.browseHTML+='<span>Tag: </span><aj:tagList class="readOnly inline" value="'+e.tag+'"/> <span class="link" onclick="Quiz.setRoom(\''+e.tag+'\', 1);" title="'+Strings.joinPub+'" style="margin-left: 1em">'+Strings.join+'</span> <span class="link" onclick="Rooms.filterTag(\''+e.tag+'\');" title="'+Strings.listCategGames+'">'+Strings.filter+"</span>"+(d.length||a.length?"<br /><span>"+Strings.relTags+": </span>"+(d.length?'<aj:tagList class="readOnly inline linking" value="'+d.join(",")+'"/>':"")+(a.length?' || <aj:tagList class="readOnly inline linking" value="'+a.join(",")+'"/>':""):"")+"</div>";if(e.subcat&&e.subcat.length){e.browseHTML+=DomBr.makeDomainTable(e.subcat,null,null)}else{e.browseHTML+="<table><tbody></tbody></table>"}e.browseHTML+="</div>";e.browseHTML=HTML.parse(e.browseHTML,{tagList:true,input:true,tagItem:true})}return e.browseHTML},_browseCateg:function(h,b,g,a){Animation.clear(DomBr);var k=[],f,e,c;c=$.browseGames.firstChild.lastChild.tBodies[0];for(f=0;f<c.rows.length;f++){for(e=0;e<c.rows[f].cells.length;e++){k.push(c.rows[f].cells[e]);if(k[k.length-1]==(a||b)){k.pop()}}}var n=offsetBox(b),l,q=offsetBox($.browseGames),u=document.createElement("div"),t;if(g){l=offsetBox(a);t=document.createElement("div");UI.positionOverBox(t,l);t.innerHTML=DomBr.domHTML(domainsHash[g]);t.className="opac90"}UI.positionOverBox(u,n);u.innerHTML=DomBr.domHTML(domainsHash[h]);u.firstChild.style.width=$.browseGames.firstChild.offsetWidth+"px";u.className="opac90";Animation.add(function(p){if(p>=1){DomBr.browseCateg(h);u.parentNode.removeChild(u)}else{u.style.left=Math.round(q[0]*p+n[0]*(1-p))+"px";u.style.top=Math.round(q[1]*p+n[1]*(1-p))+"px";u.style.width=Math.round(q[2]*p+n[2]*(1-p))+"px";u.style.height=Math.round(q[3]*p+n[3]*(1-p))+"px"}},DomBr);Animation.add(function(v){var p;if(v>=0.5){p=0}else{p=Math.floor(10-v*20)}for(f=0;f<k.length;f++){k[f].className=k[f].className.replace(RX.cls.opac,"")+" opac"+p+"0"}},DomBr);var d=$.browseGames.firstChild.offsetHeight;var r=0;Animation.add(function(p){if(p>=1){$.browseGames.firstChild.style.height=r+"px"}else{$.browseGames.firstChild.style.height=Math.floor(p*r+(1-p)*d)+"px"}},DomBr);if(t){Animation.add(function(p){p*=2;if(p>=1){if(t.parentNode){t.parentNode.removeChild(t)}}else{t.style.left=Math.round(q[0]*p+l[0]*(1-p))+"px";t.style.top=Math.round(q[1]*p+l[1]*(1-p))+"px";t.style.width=Math.round(q[2]*p+l[2]*(1-p))+"px";t.style.height=Math.round(q[3]*p+l[3]*(1-p))+"px"}},DomBr);t.firstChild.style.width=$.browseGames.firstChild.offsetWidth+"px";document.body.appendChild(t)}document.body.appendChild(u);q[3]=r=u.scrollHeight},init:function(){if(domainsHash[firstBrowseCateg].rcat){idx=domainsHash[firstBrowseCateg].rcat.allDomIndex}DomBr.lastBrTag=domainsHash[firstBrowseCateg].tag;var a=DomBr.domHTML(domainsHash[firstBrowseCateg]);windows[Window.findRoomWindow]=windows[Window.findRoomWindow].replace_('<div id="browseGames"></div>','<div id="browseGames">'+a+"</div>")},browseCateg:function(a,c){if(domainsHash[a].rcat){a=domainsHash[a].rcat.allDomIndex}DomBr.lastBrTag=domainsHash[a].tag;var b=DomBr.domHTML(domainsHash[a]);if(typeof c=="string"){b=b.replace(RX.elem.table,c)}_s($.browseGames,"innerHTML",b);Hash.reHash()},updateDomainFilter:function(b,a){setTimeout(function(){DomBr._updateDomainFilter(b,a)},10)},_updateDomainFilter:function(c,a){var b;if(c){var d=Util.domainsWhichContain(c,a);b=DomBr.makeDomainTable(d.list,d.more,a,c)}else{b=DomBr.makeDomainTable(a.subcat)}b=UI.fromHTML(b);$.browseGames.firstChild.replaceChild(b,$.browseGames.firstChild.lastChild)},showSubMatch:function(a,b){var c=Util.domainsWhichContain(b,domainsHash[a]);DomBr.browseCateg(a,DomBr.makeDomainTable(c.list,c.more,domainsHash[a],b));Field.setValue($_("DomBrFilter"),b)}};var soundObj=false;var soundTimeout=null;var Sound={node:null,nodes:{},timeouts:{},soundTypes:["application/x-mplayer2","application/x-ms-wmp","audio/mpeg","audio/mp3","audio/mpeg3"],objectType:null,init:function(){Sound.node=document.getElementById("audioHolder");if(isIE){Sound.play=Sound.playIE}else{for(var a=0;Sound.objectType=Sound.soundTypes[a];a++){if(navigator.mimeTypes[Sound.objectType]&&navigator.mimeTypes[Sound.objectType].enabledPlugin){break}}if(Sound.objectType){Sound.play=Sound.playObject}else{if(typeof Audio!="undefined"){Sound.play=Sound.playAudio}else{Chat.addServerMsg(Strings.noAudioSupport);variables.hasSound=false;AJ.sound=false}}}if(constants.sounds.applications[constants.appName]){var c=constants.sounds.applications[constants.appName];for(var b in c){constants.sounds[b]=c[b]}}},play:function(a){},stop:function(a){return;if(Sound.nodes[a].parentNode){_o(Sound.nodes[a])}Sound.timeouts[a]=null},playIE:function(b){if(!AJ.sound){return}var a;if(!constants.sounds[b]){return}a=document.createElement("bgsound");a.loop=1;a.src=constants.sounds[b].src;Sound.nodes[b]=a;_an(Sound.node,a);var c=Sound.timeouts[b]=setTimeout(function(){if(c!==Sound.timeouts[b]){return}Sound.stop(b)},constants.sounds[b].length)},playAudio:function(a){if(!AJ.sound){return}if(!constants.sounds[a]){return}var b=Sound.nodes[a];if(b){b.play()}else{(b=Sound.nodes[a]=new Audio(constants.sounds[a].src)).onload=function(){b.play()}}},playObject:function(b){if(!AJ.sound){return}if(!constants.sounds[b]){return}var d=constants.sounds[b].src;var a=Sound.nodes[b]||(Sound.nodes[b]=UI.fromHTML('<object id="sound_'+b+'" data="'+constants.sounds[b].src+'" type="'+Sound.objectType+'"><param name="filename" value="'+d+'" /><param name="URL" value="'+d+'" /><param name="SRC" value="'+d+'" /><param name="autoStart" value="1" /><param name="autoPlay" value="1" /><param name="loop" value="0" /><embed src="'+d+'" type="'+Sound.objectType+'" autostart="1" loop="0" hidden="1"></embed></object>'));_an(Sound.node,a);var c=Sound.timeouts[b]=setTimeout(function(){if(c!==Sound.timeouts[b]){return}Sound.stop(b)},constants.sounds[b].length)}};function playSound(a){Sound.play(a);return;if(!AJ.sound){return}if(soundObj){stopSound()}if(document.body.currentStyle){soundObj=document.createElement("bgsound");soundObj.src=constants.sounds[a].src}else{soundObj=document.createElement("embed");soundObj.hidden=true;soundObj.type="audio/x-mpeg";soundObj.autoplay=true;soundObj.src=constants.sounds[a].src}soundObj.id="soundObj";document.body.appendChild(soundObj);soundTimeout=setTimeout(function(){soundTimeout=null;stopSound()},constants.sounds[a].length)}function stopSound(){Sound.stop(id)}var Map={map:[],mapObj:0,mapCtx:null,canvasHighlight:false,high:-1,fixedColors:[],drawOnShow:false,imgMap:null,img:null,imgMapInner:null,shown:false,initialized:false,init:function(){as(!Map.initialized,"Map already initialized!");Map.initialized=true;$.mapC=document.createElement("canvas");$.mapC.id="mapC";$.mapC.setAttribute("width",variables.mapWidth);$.mapC.setAttribute("height",variables.mapHeight);if(isIE){$.mapC=G_vmlCanvasManager.initElement($.mapC)}Map.mapCtx=$.mapC.getContext("2d");Map.mapCtx.strokeStyle="rgb(255,255,255)";Map.canvasHighlight=Map.mapCtx.getImageData&&(typeof Map.mapCtx.getImageData(1,1,1,1).data!="undefined")&&(typeof Map.mapCtx.getImageData(1,1,1,1).data[0]=="number");Map.canvasHighlight=!!Map.canvasHighlight;Map.mapCtx.lineCap="round";$.mapC.onclick=Map.canvasClick;if(Map.canvasHighlight){$.mapC.onmousemove=Map.canvasMove}_an(document.getElementById("mapparent"),$.mapC);_s($.mapC.style,"display","none");Map.imgMap=document.getElementsByTagName("map")[0];Map.img=document.getElementById("canvasImg")},empty:function(){Map.map=[];Map.fixedColors=[];Map.drawOnShow=false},clearHighlight:function(){if(!Map.fixedColors.length){return}Map.fixedColors=[];if(PlayZone.isGame()){Map.drawMap()}},setFixedColor:function(b,a){Map.fixedColors[b]=a;if(PlayZone.isGame()){Map.drawMap()}},setMap:function(a){if(a==Map.map){return}Map.map=a;Map.fixedColors=[];Map.drawMap()},tryHide:function(){if(Map.shown){Map.hide()}Map.drawOnShow=false},tryShow:function(){if(!Map.shown){Map.show()}},hide:function(){Map.shown=false;_s($.mapC.style,"display","none");if(!Map.canvasHighlight){_s(Map.img.style,"display","none")}},show:function(){Map.shown=true;_s($.mapC.style,"display","");if(!Map.canvasHighlight){_s(Map.img.style,"display","")}},drawMap:function(){if(variables.currentWindow!="play"){Map.drawOnShow=true;return}if(!Map.shown){Map.show()}Map.drawOnShow=false;if(UI.beforeApplyOnce.indexOf(Map._drawMap)<0){UI.beforeApplyOnce.push(Map._drawMap)}},_drawMap:function(){Map.scale();var c=Map.mapCtx;c.save();c.clearRect(0,0,$.mapC.offsetWidth,$.mapC.offsetHeight);m=Map.map;Map.imgMapInner="";for(var h=0;h<m.length;h++){if(!Map.map[h].length){continue}var f,e,a;if(Map.fixedColors[h]){f=Map.fixedColors[h][0];e=Map.fixedColors[h][1];a=Map.fixedColors[h][2]}else{if(!Map.canvasHighlight){f=e=a=0}else{f=Math.floor(h/16);e=Math.floor((h-f*16)/4);a=h-f*16-e*4}f+=200;e+=200;a+=200}c.fillStyle="rgb("+f+","+e+","+a+")";Map.drawPath(h,true)}c.restore();if(!Map.canvasHighlight){if(isIE){Map.mapObj=$.mapC.firstChild.childNodes.length}var d;d=offsetBox(getStyle($.mapC).display!="none"?$.mapC:$.mapC.parentNode.nextSibling);d[2]=parseInt(_g($.mapC.style,"width"),10);d[3]=parseInt(_g($.mapC.style,"height"),10);UI._positionOverBox(Map.img,d);_s(Map.img.style,"display","");Map.imgMap.innerHTML=Map.imgMapInner;Map.imgMapInner="";Map._checkMapPosition()}},_checkMapPosition:function(){UI.afterApplyOnce.push(function(){var a=offsetBox($.mapC);if(a[0]!=_g(Map.img.style,"left")||a[1]!=_g(Map.img.style,"top")){_s(Map.img.style,"left",a[0]+"px");_s(Map.img.style,"top",a[1]+"px")}})},scale:function(){if(!Map.map.scaleX||(Map.map.scaleX!=$.mapC.originalWidth||Map.map.scaleY!=$.mapC.originalHeight)){Map.map.scaleX=$.mapC.originalWidth||($.mapC.originalWidth=($.mapC.offsetWidth||parseFloat($.mapC.getAttribute("width"))));Map.map.scaleY=$.mapC.originalHeight||($.mapC.originalHeight=($.mapC.offsetHeight||parseFloat($.mapC.getAttribute("height"))));as(Map.map.scaleX&&Map.map.scaleY);var e=Map.map;if(!e.length){return}var b,a,f=b=(e[0][0]||e[1][0])[1],d=a=(e[0][0]||e[1][0])[2];var p,n,g,c,l;for(p=0;p<e.length;p++){for(n=0;n<e[p].length;n++){g=e[p][n];if(!g.length){continue}l=g[0]==3?6:2;for(c=g.length-2;c>0;c-=l){if(g[c]<f){f=g[c]}else{if(g[c]>b){b=g[c]}}if(g[c+1]<d){d=g[c+1]}else{if(g[c+1]>a){a=g[c+1]}}}}}var z=b-f,v=a-d;var u=e.scaleX;var q=e.scaleY;if(z>v){$.mapC.style.height=($.mapC.height=Math.ceil(v*q/z))+"px";v=z}else{$.mapC.style.height=($.mapC.height=Math.ceil(v*q/z))+"px";z=v}Map.mapCtx.strokeStyle="rgb(255,255,255)";if(e.scale==z){return}e.scale=z;f--;d--;var t=function(h){return(h-f)/z*u};var r=function(h){return(h-d)/v*q};for(p=0;p<e.length;p++){for(n=0;n<e[p].length;n++){for(g=1;g<e[p][n].length-1;g+=2){e[p][n][g]=t(e[p][n][g]);e[p][n][g+1]=r(e[p][n][g+1])}}}}},drawPath:function(t,f){var u=Map.map;if(!u[t].length){return[null,null,null,null]}var B,v=Map.mapCtx;var q=[u[t][0][1],u[t][0][1],u[t][0][2],u[t][0][2]];var n=function(l){if(l<q[0]){q[0]=l}else{if(l>q[1]){q[1]=l}}return l};var k=function(l){if(l<q[2]){q[2]=l}else{if(l>q[3]){q[3]=l}}return l};var C,z,a='" />';f=f&&!Map.canvasHighlight;if(f){C=z='<area href="#" shape="poly" onmouseover="if (Map.high != '+t+") Map.highlight("+t+');" onmouseout="if (Map.high == '+t+') Map.highlight(-1);" onclick="Map.canvasClick(arguments && arguments[0] || event);" coords="'}v.beginPath();var h=-1,g=-1,e,d,A,w,c,b;for(B=0;B<u[t].length;B++){switch(u[t][B][0]){case"M":case 1:for(A=0,w=u[t][B].length-1;A<w;A+=2){c=n(u[t][B][A+1]);b=k(u[t][B][A+2]);v.moveTo(c,b);if(f&&(e=Math.round(c))!=h&&(d=Math.round(b))!=g){if(B){C+=a+C}C+=e+","+d;h=e;g=d}}break;case"L":case 2:for(A=0,w=u[t][B].length-1;A<w;A+=2){c=n(u[t][B][A+1]);b=k(u[t][B][A+2]);v.lineTo(c,b);if(f&&(e=Math.round(c))!=h&&(d=Math.round(b))!=g){C+=", "+e+","+d;h=e;g=d}}break;case"C":case 3:for(A=0,w=u[t][B].length-1;A<w;A+=6){c=n(u[t][B][A+5]);b=k(u[t][B][A+6]);v.bezierCurveTo(u[t][B][A+1],u[t][B][A+2],u[t][B][A+3],u[t][B][A+4],c,b);if(f&&(e=Math.round(c))!=h&&(d=Math.round(b))!=g){C+=", "+e+","+d;h=e;g=d}}break;default:Util.alert("Unsupported path command: "+u[t][B]);break}}if(f){C+=a;if(C.length<50000){Map.imgMapInner+=C}else{v.fillStyle="rgb(255, 180, 180)"}}v.closePath();v.fill();v.stroke();return q},highlight:function(c){if(c==0){c=-1}if(Map.high==c){return}var d=Map.mapCtx;d.save();if(Map.high>-1){var h;if(isIE){while(Map.mapObj<$.mapC.firstChild.childNodes.length){$.mapC.firstChild.removeChild($.mapC.firstChild.lastChild)}}else{var f,e,a;if(Map.fixedColors[Map.high]){f=Map.fixedColors[Map.high][0];e=Map.fixedColors[Map.high][1];a=Map.fixedColors[Map.high][2]}else{if(!Map.canvasHighlight){f=e=a=0}else{f=Math.floor(Map.high/16);e=Math.floor((Map.high-f*16)/4);a=Map.high-f*16-e*4}f+=200;e+=200;a+=200}d.fillStyle="rgb("+f+","+e+","+a+")";Map.drawPath(Map.high)}}Map.high=c;if(c>-1){if(Map.fixedColors[Map.high]){var f,e,a;f=Map.fixedColors[Map.high][0];e=Map.fixedColors[Map.high][1];a=Map.fixedColors[Map.high][2];f+=20;e+=20;a+=20;if(f>255){f=255}if(e>255){e=255}if(a>255){a=255}d.fillStyle="rgb("+f+","+e+","+a+")"}else{d.fillStyle="rgb(180, 180, 180)"}var f=Map.drawPath(c);if(isIE){d.strokeStyle="rgb(0,0,0)";if(f[0]<10){f[0]=0}else{f[0]-=10}if(f[2]<10){f[2]=0}else{f[0]-=10}if(f[1]+20<$.mapC.offsetWidth){f[1]+=20}else{f[1]=$.mapC.offsetWidth}if(f[3]+20<$.mapC.offsetHeight){f[3]+=20}else{f[3]=$.mapC.offsetHeight}d.strokeRect(f[0],f[2]-10,f[1]-f[0],f[3]-f[2]);d.strokeStyle="rgb(255,255,255)"}}d.restore()},canvasMove:function(){if(!Map.map.length||!Map.canvasHighlight){return}var h=arguments&&arguments[0]||event;var g=offsetBox($.mapC,null,true);var d=Math.round(h.clientX-g[0]);var k=Math.round(h.clientY-g[1]);var c;if(d<0||k<0||d>=g[2]||k>=g[3]){c=-1}else{var e=Map.mapCtx.getImageData(d,k,1,1).data;if(e[0]==180&&e[1]==180&&e[2]==180){return}c=(e[0]-200)*16+(e[1]-200)*4+e[2]-200;if(c<0||c>=Map.map.length){var a=function(b){if(b>255){return 255}return b};for(var f=0;f<Map.map.length;f++){if(Map.fixedColors[f]&&((Map.fixedColors[f][0]==e[0]&&Map.fixedColors[f][1]==e[1]&&Map.fixedColors[f][2]==e[2])||(a(Map.fixedColors[f][0]+20)==e[0]&&a(Map.fixedColors[f][1]+20)==e[1]&&a(Map.fixedColors[f][2]+20)==e[2]))){c=f;break}}if(c<0||c>=Map.map.length){c=-1}}}if(Map.high!=c){Map.highlight(c)}},canvasClick:function(){if(PlayZone.isGame()&&(!Quiz.timerInterval||(question&&question.expired))){return}var a=arguments&&arguments[0]||event;if(Map.canvasHighlight){Map.canvasMove(a)}if(Map.high>0){Quiz.answer(Map.high-1)}}};var Util={};var $_=function(a){return $_.cache[a]||($_.cache[a]=document.getElementById(a))};$_.cache={};$_.clear=function(a){if($_.cache[a]){delete $_.cache[a]}};var parseJSON,encodeJSON;if(window.JSON&&JSON.parse){parseJSON=JSON.parse}else{parseJSON=function(str){return eval("("+str+")")}}function getDocument(a){return a.contentDocument||(a.contentWindow&&a.contentWindow.document)||(window.frames[a.id]&&window.frames[a.id].document)}Util.getShortestElemPath=function(b){if(!b){return String(b)}if(!b.tagName){return"CSSDeclaration"}var c="";while(1){var a=b.className?"."+b.className.replace(/\s+/g,"."):"";if(b.id){a="#"+b.id+a;if(b.id.indexOf("generated")<0){return a+c}}c=b.tagName+a+c;if(b.parentNode){c=" > *["+$A(b.parentNode.childNodes).indexOf(b)+"]:"+c;b=b.parentNode}else{return"(no parent) "+c}}};function escapeHTML(a){return a.replace(RX.chr.ampg,"&amp;").replace(RX.chr.ltg,"&lt;").replace(RX.chr.gtg,"&gt;")}Util.checkFeatures=function(){for(var c=0;c<features.list.length;c++){var b=getStyle(document.getElementById("feature"+features.list[c]));for(var a=0;a<features.props[c].length;a++){if(b[features.props[c][a]]){features[features.list[c]]=a+1;break}}}features.editing=!!document.getElementById("featureedit").contentEditable;_o(document.getElementById("featureCheck"))};Util.avatarIframeLoaded=function(){Util.restoreAvatarImg();var a=getDocument(this);a=a&&a.body.innerHTML;if(a){Request.callbacks.iP({p:a})}};Util.bodyKeydown=function(d){var c=d.charCode||d.keyCode;if(c==8||c==32){var e=d.target||d.srcElement;var a=e.tagName.toLowerCase();var b=e.contentEditable=="true"||e.contentEditable==true;if(a!="input"&&a!="textarea"&&!b){stopEvt(d);return false}}else{if(c==27){stopEvt(d);return false}else{if(c==67&&d.altKey&&!d.shiftKey&&!d.ctrlKey&&!d.metaKey){if(variables.curFocus==$.msg){if(variables.windowBeforeAltC){Window.show(variables.windowBeforeAltC);variables.focusAfterWindowShow=variables.prevFocus}else{variables.prevFocus.focus()}}else{variables.windowBeforeAltC=variables.currentWindow!="play"?variables.currentWindow:null;if(variables.windowBeforeAltC){Window.show("play");variables.focusAfterWindowShow=$.msg}else{$.msg.focus()}}}}}};Util.focusMovedTo=function(a){variables.prevFocus=variables.curFocus;variables.curFocus=a};Util.updateMoneyLeft=function(){if(!currentRoom.roomInfo.bet){return}var b;if(currentRoom.roomInfo.lobby){b=currentRoom.roomInfo.bet*currentRoom.users.length}else{b=currentRoom.money;for(var a=0;a<currentRoom.users.length;a++){b-=currentRoom.users[a].winnings}}_sC($.moneyLeft,"innerHTML",Util.sprintf(Strings.moneyLeft,Util.printMoney(b)))};Util.getQuestionImagePath=function(a){return RX.general.isUrl.test(a)?a:("qimg/"+a)};Util.getImageForTags=function(a){var d="images/clear.gif",c=1/0;for(var b=0;b<a.length;b++){if(domainsHash.byTag[a[b]]&&domainsHash.byTag[a[b]].imageGrade<c){c=domainsHash.byTag[a[b]].imageGrade;d=domainsHash.byTag[a[b]].qimg}}return d};Util.cacheImg=function(a){if(variables.cachedImgs.indexOf_(a)==-1){variables.cachedImgs.push(a);_i($.precacheDiv,"beforeEnd",'<img onload="if (this.parentNode) this.parentNode.removeChild(this);" src="'+a+'" />')}};Util.loadScript=function(a,c){if(variables.loadedScripts.indexOf_(a)==-1){variables.loadedScripts.push(a);var b=document.createElement("script");b.type="text/javascript";b.loadDone=false;b.onreadystatechange=function(){if("complete"==b.readyState){b.onload()}};b.onload=function(){if(b.loadDone){return}b.loadDone=true;if(c){c.call(b)}Util.tryRemoveSelf(this)};b.src=a;_an(document.body.previousSibling,b)}};Util.tryRemoveSelf=function(){if(this.parentNode){this.parentNode.removeChild(this)}};Util.setSkin=function(a){$_("skinCSS").href=getSkinPath(a);Util.saveCookie("skin",a)};Util.retThisValue=function(){return this.value};Util.getPageIdByName=function(a){};Util.togglePanel=function(a){if(RX.cls.left.test(_g(a.parentNode,"className"))){if(!parseFloat(_g(a.parentNode.style,"left"))){_r(a.firstChild,"className",RX.cls.expanded,"collapsed");Animate.slideLeft(a.parentNode,a.previousSibling.offsetWidth,0.5).keep=true}else{_r(a.firstChild,"className",RX.cls.collapsed,"expanded");Animate.slideRight(a.parentNode,-parseFloat(_g(a.parentNode.style,"left")),0.5).keep=true}}else{if(RX.cls.right.test(_g(a.parentNode,"className"))){if(!parseFloat(_g(a.parentNode.style,"right"))){_r(a.firstChild,"className",RX.cls.expanded,"collapsed");Animate.slideRightPropRight(a.parentNode,a.nextSibling.offsetWidth,0.5).keep=true}else{_r(a.firstChild,"className",RX.cls.collapsed,"expanded");Animate.slideLeftPropRight(a.parentNode,-parseFloat(_g(a.parentNode.style,"right")),0.5).keep=true}}else{throwError("Is the panel left or right?")}}};Util.initDomains=function(){fullDomainsHash=Util.makeDomainsHash(fullDomains);simpleDomainsHash=Util.makeDomainsHash(simpleDomains);if(Util.read("fullDomains")){domains=fullDomains;domainsHash=fullDomainsHash}else{domains=simpleDomains;domainsHash=simpleDomainsHash}};Util.fullDomains=function(a){if(typeof a=="undefined"){Util.info("Bad Call. Usage: Util.fullDomains(boolean);","Full Domains");return}if(!a&&domains==fullDomains){domains=simpleDomains;domainsHash=simpleDomainsHash;Util.save("fullDomains",null);if(makeCustomShown){_s($.domainTreeHolder,"innerHTML",HTML.parse(HTML.makeTreeFromDomain(domainsHash[0].subcat),{tree:true,checkbox:true}))}}else{if(a&&domains==simpleDomains){domains=fullDomains;domainsHash=fullDomainsHash;Util.save("fullDomains",1);if(makeCustomShown){_s($.domainTreeHolder,"innerHTML",HTML.parse(HTML.makeTreeFromDomain(domainsHash[0].subcat),{tree:true,checkbox:true}))}}}};Util.makeDomainsHash=function(c){var g=[];var b=[],e,f;for(e=0;e<c.length;e++){b.push(c[e]);c[e].level=1;c[e].path="_"+e;c[e].imageGrade=1}g.push({label:Strings.globalTagName,qname:Strings.globalTagName,tag:Strings.globalTag,path:"",level:0,subcat:c});f=0;while(f<b.length){if(b[f].parentCat){b[f].qname=b[f].parentCat.qname+" > "+b[f].label;b[f].level=b[f].parentCat.level+1}else{b[0].qname=b[f].label}g.push(b[f]);if(b[f].subcat){for(e=0;e<b[f].subcat.length;e++){b[f].subcat[e].parentCat=b[f];b[f].subcat[e].path=b[f].path+"_"+e;if(!b[f].subcat[e].qimg){b[f].subcat[e].qimg=b[f].qimg;b[f].subcat[e].imageGrade=b[f].imageGrade+1}else{b[f].subcat[e].imageGrade=1}if(!b[f].subcat[e].image){b[f].subcat[e].image=b[f].image}}b.splice.apply(b,[0,f+1].concat(b[f].subcat));f=-1}f++}for(e=0;e<g[0].subcat.length;e++){g[0].subcat[e].parentCat=g[0]}for(e=g.length-1;e>=0;e--){g[e].subdepth=1;if(g[e].subcat){for(f=0;f<g[e].subcat.length;f++){if(g[e].subcat[f].subdepth>=g[e].subdepth){g[e].subdepth=g[e].subcat[f].subdepth+1}}}}g.byTag={};g.byPath={};g.tagList=[];g.normalizedTagList=[];var d=[],a;for(e=0;e<g.length;e++){g[e].allDomIndex=e;g[e].slabel=g[e].label.toLowerCase();g.byPath[g[e].path]=g[e];if(g[e].tag){if(!g.byTag[g[e].tag]){g.byTag[g[e].tag]=g[e];g.tagList.push(g[e].tag);g.normalizedTagList.push({tag:g[e].tag,value:g[e].tag.normalize(),toString:Util.retThisValue})}}else{if(g[e].ref){d.push(g[e])}else{throwError("Domain without tag! %o",g[e])}}}for(e=0;e<d.length;e++){d[e].tag=d[e].ref;if(!g.byTag[d[e].tag]){throwError("Domain referenced but not found: "+d[e].tag)}a=d[e].rcat=g.byTag[d[e].tag];if(!a.vref){a.vref=[]}a.vref.push(d[e]);d[e].subcat=a.subcat;d[e].subdepth=a.subdepth;if(a.tooltip&&!d[e].tooltip){d[e].tooltip=a.tooltip}}g.sortedTagList=g.tagList.clone().sort();g.normalizedTagList.sort();console.log('%o unique categories + %o doubles (symlinks) + virtual ("By genre", etc.)',g.tagList.length,d.length);return g};Util.tagsWhichBeginWith=function(g){var e=[],b=" "+g.normalize(),f,a,d=g.length;if(!g){e=fullDomainsHash.tagList.clone().sort()}else{for(var c=0;f=fullDomainsHash.normalizedTagList[c];c++){if(f.value.indexOf(g)==0){e.push("<b>"+f.tag.substr(0,d)+"</b>"+f.tag.substr(d))}else{if((a=f.value.indexOf(b))>-1){e.push(f.tag.substr(0,a)+" <b>"+f.tag.substr(a+1,d)+"</b>"+f.tag.substr(a+1+d))}}}}return e};Util.domainsWhichContain=function(g,h){var e=[],c=" "+g,d,b;if(!h){h=fullDomainsHash[0]}for(d=0;d<fullDomainsHash.tagList.length;d++){if(fullDomainsHash.tagList[d].indexOf(g)==0||fullDomainsHash.tagList[d].indexOf(c)>-1||fullDomainsHash.byTag[fullDomainsHash.tagList[d]].slabel.indexOf(g)==0||fullDomainsHash.byTag[fullDomainsHash.tagList[d]].slabel.indexOf(c)>-1){e.push(fullDomainsHash.tagList[d])}}e.sort();var f=[],a=[];for(d=0;d<e.length;d++){e[d]=fullDomainsHash.byTag[e[d]];f[d]=Util.domainParents(e[d]);a[d]=[];if(!f[d].contains(h)||e[d]==h){e.splice(d,1);f.splice(d,1);a.splice(d,1);d--}}for(d=0;d<e.length;d++){for(b=d+1;b<e.length;b++){if(f[b].contains(e[d])){a[d].push(e[b]);a[d]=a[d].concat(a[b]);a.splice(b,1);f.splice(b,1);e.splice(b,1);b--}else{if(f[d].contains(e[b])){a[b].push(e[d]);a[b]=a[b].concat(a[d]);a.splice(d,1);f.splice(d,1);e.splice(d,1);d--;break}}}}return{list:e,more:a}};Util.domainParents=function(c){if(c.domainParents){return c.domainParents}var b=[],a;var d=[c];while(d.length){for(a=0;a<d.length;a++){if(b.indexOf(d[a])==-1){b.push(d[a])}else{d.splice(a,1);a--;continue}if(d[a].vref){d=d.concat(d[a].vref)}if(d[a].parentCat){d[a]=d[a].parentCat}else{d.splice(a,1);a--}}}return c.domainParents=b};Util.parentTags=function(d){if(d.parentTags){return d.parentTags}if(!d.parentCat){return[]}var a=[d.parentCat],c=[Strings.globalTag],b;if(d.vref){a=a.concat(d.vref.pluck("parentCat"))}for(b=0;b<a.length;b++){c.push(a[b].tag);c=c.concat(Util.parentTags(a[b]))}c=c.uniq1();c.shift();return d.parentTags=c};Util.relatedTags=function(d){if(d.relatedTags){return d.relatedTags}if(!d.parentCat){return[]}var a=[d.parentCat],c=[d.tag],b;if(d.vref){a=a.concat(d.vref.pluck("parentCat"))}for(b=0;b<a.length;b++){c=c.concat(a[b].subcat.pluck("tag"))}c=c.uniq1();c.shift();return d.relatedTags=c};Util.parseSmileys=function(c){for(var b=0,a=smileys.length;b<a;b++){c=c.replace(smileys[b][0],'<span class="sprite" style="'+smileys[b][1]+'"></span>')}return c};Util.locations={createGame:["findGame","tfJCG",1],findGame:["findGame","tfJCG",0],paymentHistory:["settings","tFS",1]};Util.navigate=function(c){var b,a=arguments.length;if(Util.locations[c]){Util.navigate.apply(Util,Util.locations[c]);return}if(c&&!$[c]){Window.show(c)}for(b=1;b<a;b+=2){if(typeof arguments[b+1]=="number"){TabFolder.setPageByIdx(document.getElementById(arguments[b]),arguments[b+1])}else{TabFolder.setPageByTitle(document.getElementById(arguments[b]),arguments[b+1])}}if(c&&variables.currentWindow!=c){Window.show(c)}};Util.isVisible=function(c,a){if(Util.locations[c]){c=Util.locations[c]}else{if(typeof c=="string"){c=[c]}}if(variables.currentWindow!=c[0]){return false}if(!a){for(var b=1;b<c.length;b+=2){if(TabFolder.getIndex($[c[b]]||document.getElementById(c[b]))!=c[b+1]){return false}}}return true};Util.getWindow=function(a){return Util.locations[a][0]};Util.debugMap=function(b,a){PlayZone.mapDebugQuestion.mId=a;PlayZone.showMapDebug();Util.loadScript(b,function(){Map.setMap(constants.maps[a]);Map.drawMap()})};Util.displayNone=function(a){_s((a||this).style,"display","none")};Util.toggleDisplay=function(a){_s(a.style,"display",_g(a.style,"display")=="none"?"":"none")};Util.sprintf=function(h){if(!h){throwError("sprintf requires at least one argument");return"Don't know, don't care."}var c,g=/%(?:(\d+)%)?(%|s|i|nth|m|(?:.(\d+))?f)/g,b=1;var f=true;while(c=g.exec(h)){var d;if(c[2]=="%"){d="%"}else{if(b==arguments.length&&c[2]!="%"&&!c[1]){throwError("No more arguments to print.");break}var a=c[1]?arguments[+c[1]]:arguments[b++];if(c[1]){f=false}switch(c[2].charAt(c[2].length-1)){case"s":d=String(a);break;case"i":d=String(Math.floor(a));break;case"f":var e=a;if(c[3]){e=e.toFixed(c[3]-0)}d=String(e);break;case"h":if(c[2]=="nth"){d=Strings.nth(a);break}case"m":d=Util.printMoney(a);break;default:throwError('Unrecognized sprintf param: "'+c[2]+'"');d="[UNKNOWN]";break}}h=h.substring(0,g.lastIndex-c[0].length)+d+h.substring(g.lastIndex);g.lastIndex=g.lastIndex+d.length-c[0].length}if(f&&b!=arguments.length){throwError(arguments.length-b+" arguments to printf were not consumed.")}return h};Util.scrollTop=function(d,a,b){if(arguments.length==0){d=0}if(arguments.length<2){a=0}var c=-offsetBox(document.body,null,true)[1];if(Math.abs(d-c)<=a){return}Util.scrollTop.scrollingTo=d;Util.scrollTop.scrollingFrom=c;if(!Util.scrollTop.scrolling){Util.scrollTop.scrolling=true;Animation.add(Util.scrollTop.animator,Util.scrollTop,b||Util.scrollTop.speed)}};Util.scrollTop.speed=1;Util.scrollTop.animator=function(a){if(a>=1){scroll(0,Util.scrollTop.scrollingTo);Util.scrollTop.scrolling=false}else{scroll(0,Math.round(Util.scrollTop.scrollingFrom+a*(Util.scrollTop.scrollingTo-Util.scrollTop.scrollingFrom)))}};function ls(d,a,b){if(arguments.length==2){b=a;a=" "}if(typeof d!="string"){d=String(d)}var e=b-d.length+1;if(e>1){d=new Array(e).join(a)+d}return d}Util.approxTimeDelay=function(a){var b;return a<0?Strings.now+"!":a<1000?"1 "+Strings.seconds.one:a<60000?((b=Math.round(a/1000))+" "+(b!=1?Strings.seconds.more:Strings.seconds.one)):(b=Math.round(a/60000))+" "+(b!=1?Strings.minutes.more:Strings.minutes.one)};function getTime(b,a){if(!b){b=new Date()}if(!a){a=" "}return ls(b.getHours(),a,2)+":"+ls(b.getMinutes(),a,2)+":"+ls(b.getSeconds(),a,2)}function getDateTime(b,a){if(!b){b=new Date()}if(!a){a=" "}return b.getFullYear()+"-"+ls(b.getMonth()+1,a,2)+"-"+ls(b.getDate(),a,2)+" "+ls(b.getHours(),a,2)+":"+ls(b.getMinutes(),a,2)+":"+ls(b.getSeconds(),a,2)}Util.getNiceDateTime=function(k){if(!k){k=new Date()}var b="0";var h="";for(var c=0,a=Strings.niceDateTimeFormat.length;c<a;c++){var f=Strings.niceDateTimeFormat.charAt(c);var e=f;while(c<a-1&&Strings.niceDateTimeFormat.charAt(c+1)==f){c++;e+=f}if(c<a-1&&Strings.niceDateTimeFormat.charAt(c+1)=="n"){c++;e+="n"}switch(e){case"ss":h+=ls(k.getSeconds(),"0",2);break;case"s":h+=k.getSeconds();break;case"mm":h+=ls(k.getMinutes(),"0",2);break;case"m":h+=k.getMinutes();break;case"hh":h+=ls(k.getHours()%12,"0",2);break;case"h":h+=k.getHours()%12;break;case"HH":h+=ls(k.getHours(),"0",2);break;case"H":h+=k.getHours();break;case"tt":h+=k.getHours()>=12?"PM":"AM";break;case"t":h+=k.getHours()>=12?"P":"A";break;case"yyyy":h+=k.getFullYear();break;case"yyy":h+=k.getFullYear()%1000;break;case"yy":h+=k.getFullYear()%100;break;case"y":h+=k.getFullYear()%10;break;case"d":h+=k.getDate();break;case"dn":h+=Strings.nth(k.getDate());break;case"dd":h+=ls(k.getDate(),"0",2);break;case"ddn":h+=Strings.nth(ls(k.getDate(),"0",2));break;case"ddd":h+=Strings.dayNames[k.getDay()].substr(0,3);break;case"dddd":h+=Strings.dayNames[k.getDay()];break;case"M":h+=k.getMonth+1;break;case"MM":h+=ls(k.getMonth()+1,"0",2);break;case"MMM":h+=Strings.monthNames[k.getMonth()].substr(0,3);break;case"MMMM":h+=Strings.monthNames[k.getMonth()];break;case"z":var g=(k.getTimezoneOffset()/60)|0;h+=(g>=0?"-":"+")+Math.abs(g);break;case"zz":var g=(k.getTimezoneOffset()/60)|0;h+=(g>=0?"-":"+")+ls(Math.abs(g),"0",2);break;case"zzz":var g=(k.getTimezoneOffset()/60)|0;h+=(g>=0?"-":"+")+ls(Math.abs(g),"0",2)+":"+ls(Math.abs(k.getTimezoneOffset()-g*60),"0",2);break;default:h+=e;break}}return h};Util.setLag=function(a){AJ.lag=a;if(Quiz.timerInterval){Quiz.tick()}};Util.signed=function(a){return a>0?"+"+a:String(a)};if(variables.storage){Util._store=function(a,b){if(b===null){if(variables.storage.removeItem){variables.storage.removeItem(a)}else{delete variables.storage[a]}}else{variables.storage[a]=b}};Util._load=function(a){var b=variables.storage[a];if(b&&b.value){b=b.value}return b||null}}Util.initStorage=function(){if(!variables.storage){if(isIE){variables.storage=document.getElementById("userData");userData.addBehavior("#default#userData");userData.load("AJsettings");Util._store=function(a,b){if(b===null){variables.storage.removeAttribute("_"+a)}else{variables.storage.setAttribute("_"+a,b)}variables.storage.save("AJsettings")};Util._load=function(a){return variables.storage.getAttribute("_"+a)||null}}else{Util._store=Util.store=Util._load=Util.load=function(a,b){return null};Util.read=Util.readCookie;Util.save=Util.saveCookie}}};Util.load=function(a){var b=Util._load(a);if(b){b=parseJSON(b)}return b};Util.readCookie=getCookie;Util.saveCookie=setCookie;Util.read=function(a){return Util._load(a)};Util.save=function(a,b){Util._store(a,b)};Util.loadOldSettings=function(){var a;if(Util.read("no_sound")){Settings.change("sound",0);Util.save("no_sound",null)}if(Util.read("noAnimations")){Settings.change("animations",0);Util.save("noAnimations",null)}if(Util.read("noBigAnimations")){Settings.change("animations",Settings.values.animations&1);Util.save("noBigAnimations",null)}if(Util.read("timestamps")){Settings.change("timestamps",1);Util.save("timestamps",null)}if(a=Util.read("noActivity")){Settings.change("activity",a);Util.save("noActivity",null)}if(Util.read("depositPopup")){Settings.change("depositPopup",1);Util.save("depositPopup",null)}};Util.alert=function(a){Alert.show(a)};Util.info=function(b,a){InfoBox.show(null,a||constants.appName,b)};Util.isEnter=function(b){var a=b.charCode||b.keyCode;return a==13};Util.receiveMessage=function(b){var d=String(b.data);if(b.source==window&&d==Util.zeroTimeout.messageText){Util.zeroTimeout.execute();return}if(d.charAt(0)=="#"){d=d.substr(1)}if(d.substr(0,8)=="notify;"){d=d.substr(8)}else{return}var a;if(!Merchants.paymentStage&&(a=d.match(RX.other.msgPayed))){Util.info(Strings.depositSuccess,Strings.accountBalance);Window.show("depositsuccess");Util.scrollTop();try{if(pageTracker){pageTracker._trackEvent("User","DepositedMoney")}}catch(c){throwError("Google Analytics failed on tracking event.",true)}}};Util.setLang=function(a){if(LStrings[a]){Util._applyLang(a)}else{Util.loadScript("languages/strings."+a+".js",function(){if(LStrings[a]){Util._applyLang(a)}else{Util.alert(Strings.ftll)}})}};Util._applyLang=function(e){AJ.prevLang=AJ.curLang;AJ.curLang=e;Strings=LStrings[e].js;var c,g=LStrings[e].html;var h=[];for(var k in windows){if(!{}[k]){h.push(k)}}var d=h.length;for(var b in g){if(!{}[b]){if(c=document.getElementById(b)){_s(c,"innerHTML",g[b])}else{for(var f=0;f<d;f++){var a=new RegExp('<span id="'+b+'">.*?</span>');if(a.test(windows[h[f]])){windows[h[f]]=windows[h[f]].replace(a,'<span id="'+b+'">'+g[b]+"</span>");break}}}}}Questions.makeTableHeader();Util._applyLangInline()};Util._applyLangInline=function(){var c=LStrings[AJ.curLang].inline;Window.langSetTitle("terms",c.inlineTitleToU);Window.langSetTitle("settings",c.inlineTitleSettings);Window.langSetTitle("resetPass",c.inlineTitleResetPass);Window.langSetTitle("qreview",c.inlineTitleReview);Window.langSetTitle("privacy",c.inlineTitlePP);Window.langSetTitle("contact",c.inlineTitleContact);Window.langSetTitle("copyright",c.inlineTitleCopyright);Window.langSetTitle("login",c.inlineTitleLogin);Window.langSetTitle("findGame",c.inlineTitleFindAndCreateGame);if(typeof currentRoom=="undefined"||!currentRoom){Window.langSetTitle("play",c.inlineTitlePlay)}TabFolder.langSetPageTitle("tfJCG",0,c.inlineJCFindGame,"findGame");TabFolder.langSetPageTitle("tfJCG",1,c.inlineJCCreateGame,"findGame");TabFolder.langSetPageTitle("tFFG",0,c.inlineFBrowse,"findGame");TabFolder.langSetPageTitle("tFFG",1,c.inlineFRecent,"findGame");TabFolder.langSetPageTitle("tFFG",2,c.inlineFSearch,"findGame");TabFolder.langSetPageTitle("tFS",0,c.inlineSProfile,"settings");TabFolder.langSetPageTitle("tFS",1,c.inlineSBalance,"settings");TabFolder.langSetPageTitle("tFS",2,c.inlineQPage1,"settings");TabFolder.langSetPageTitle("tFS",3,c.inlineQPage2,"settings");Field.langSetTitle("feedbackMessage",c.inlineEnterFBTooltip,"index");Field.langSetTitle("changeNickInput",c.inlineNewNick,"index");Field.langSetTitle("oldPass",c.inlineSOldPass,"settings");Field.langSetTitle("newPass1",c.inlineSNewPass,"settings");Field.langSetTitle("newPass2",c.inlineSNewPass2,"settings");Field.langSetTitle("userInfoEmail",c.inlineSEmail,"settings");Field.langSetTitle("userInfoFirstName",c.inlineSFirstName,"settings");Field.langSetTitle("userInfoSurName",c.inlineSSurName,"settings");Field.langSetTitle("rpUser",c.inlineRPUser,"resetPass");Field.langSetTitle("rpEmail",c.inlineRPEmail,"resetPass");Field.langSetTitle("rpCode",c.inlineRPCode,"resetPass");Field.langSetTitle("msg",c.inlinePCMsg,"play");Field.langSetTitle("ansText",c.inlinePEnterAns,"play");Field.langSetTitle("custTitle",c.inlineCTitle,"findGame");Field.langSetTitle("fRF",c.inlineFFilter,"findGame");Field.langSetHint("changeNickInput",c.inlineChNickHint,"index");Field.langSetHint("createUsername",c.inlineLUserHint,"login");Field.langSetHint("createPassword",c.inlineLPassHint,"login");Checkbox.langSetTitle("cbAnimations",c.inlineSEnableAnimTooltip,"settings");Checkbox.langSetTitle("cbBigAnimations",c.inlineSEnableBigAnimTooltip,"settings");Checkbox.langSetTitle("cRschoice",c.inlineCSC,"findGame");Checkbox.langSetTitle("cRmchoice",c.inlineCMC,"findGame");Button.langSetTitle("dontKnowBtn",c.inlinePGiveUpDesc,"play");Button.langSetTitle("btnSendMsg",c.inlinePCSend,"play");Button.langSetTitle("btnClearLog",c.inlinePCClear,"play");Button.langSetTitle("btnViewLog",c.inlinePCLog,"play");RadioSet.langSetText("userInfoSex",c.inlineSSex,"settings");RadioSet.langSetText("nQ1Diff",c.inlineQDiffVal,"settings");RadioSet.langSetText("nQ1QuestionType",c.inlineQTypeVal,"settings");RadioSet.langSetText("custDiff",c.inlineCDiffVal,"findGame");RadioSet.langSetText("custAIs",c.inlineCAI,"findGame");RadioSet.langSetTitles("nQ1Diff",c.inlineQDiffTitles,"settings");RadioSet.langSetTitles("custDiff",c.inlineCDiffTitle,"findGame");Slider.langSetOver("custPlayers",c.inlineCUnlimited,"findGame");Slider.langSetUnder("custBet",c.inlineCFree,"findGame");Slider.langSetUnder("fRBet",c.inlineCFree,"findGame");$.sound.title=c.inlineIToggleSound;if($_("nQ1ImgPic")){$_("nQ1ImgPic").alt=c.inlineQImgPrvw}else{windows.settings=windows.settings.replace(/(<img\s+id="nQ1ImgPic"[^>]*?alt=")[^"]*?"/,"$1"+c.inlineQImgPrvw+'"')}Util.updateCreateGameTitle();if(document.getElementById("custDom")){if(_g(document.getElementById("custDom"),"value")==LStrings[AJ.prevLang].inline.inlineCTagAll){TagList.setValue(document.getElementById("custDom"),[c.inlineCTagAll])}}else{if(as(windows.findGame)){windows.findGame=windows.findGame.replace(/(<aj:tagList\s*id="custDom"[^>]*?value=")[^"]*?"/,"$1"+c.inlineCTagAll+'"')}}var b;for(var a=0;b=LanguageLists[a];a++){if(_g((b=document.getElementById(b)),"value")==AJ.prevLang&&!LanguageList.isReadOnly(b)){LanguageList.setLang(b,AJ.curLang)}}Util.initLang()};Util.initLang=function(){Util.updateJoinRoomPopup();_s($.lastModified,"innerHTML",Util.getNiceDateTime(AJ.lastModified));Util.initSimpleAddQCheckboxes()};Util.initSimpleAddQCheckboxes=function(){if(!$.nQKwBasic){return}var a="",b=_g($.nQ1Keywords,"value").split(",");var d=b.indexOf(simpleDomainsHash[0].tag);if(d>-1){b.splice(d,1)}for(var c=1;c<simpleDomainsHash.length;c++){d=b.indexOf(simpleDomainsHash[c].tag);if(d>-1){b.splice(d,1)}a+="<aj:checkbox "+(d>-1?'checked="checked" ':"")+"action=\"TagList[(Checkbox.isChecked(this) ? 'add' : 'remove') + 'Tag']($.nQ1Keywords, '"+simpleDomainsHash[c].tag+"'); \">"+simpleDomainsHash[c].label+"</aj:checkbox>"}a+='<aj:checkbox checked="checked" action="var tags = Checkbox.getTextNode(this).innerHTML.split(\', \'); for (var i = 0; i < tags.length; i++) TagList.removeTag($.nQ1Keywords, tags[i]);" style="'+(b.length?"":"display: none;")+'">'+b.join(", ")+"</aj:checkbox>";_s($.nQKwBasic,"innerHTML",HTML.parse(a,{checkbox:true}))};Util.updateSimpleAddQCheckboxes=function(){var c=_g($.nQ1Keywords,"value").split(",");if(c.length==1&&c[0]==""){c.pop()}var b=c.indexOf(simpleDomainsHash[0].tag);if(b>-1){c.splice(b,1)}for(var d=1;d<simpleDomainsHash.length;d++){b=c.indexOf(simpleDomainsHash[d].tag);if(b>-1){c.splice(b,1);Checkbox.check($.nQKwBasic.childNodes[d-1])}else{Checkbox.uncheck($.nQKwBasic.childNodes[d-1])}}if(c.length){var a=$.nQKwBasic.lastChild;_s(a.style,"display","");_s(Checkbox.getTextNode(a),"innerHTML",c.join(", "));Checkbox.check(a)}else{_s($.nQKwBasic.lastChild.style,"display","none")}};Util.getAvatarOptionsHTML=function(a){var b='<img class="avatarOption" onclick="User.setAvatar(\'this.src\');" alt="Avatar" src="'+constants.avatarPath+'this.src" />';var d="";for(var c=0;c<a.length;c++){d+=b.replace(RX.other.thisSrcg,a[c])}return d};Util.getExtraAvatarOptions=function(){var b=AJ.previousAvatars.clone();var a=AJ.avatar&&AJ.avatar.substr(constants.avatarPath.length);if(a&&a!=constants.avatars.none&&!constants.avatars.extra.contains(a)){b.push(a)}return b};Util.tryUpdateAvatarOptions=function(){if($.settings){var b=$_("extraAvatars").childNodes[constants.avatars.extra.length+1];while(b){_o(b);b=b.nextSibling}var a=Util.getExtraAvatarOptions();if(a.length){_i($_("extraAvatars"),"beforeEnd",Util.getAvatarOptionsHTML(a))}}};Util.showGuestStuff=function(){_ra($.pointsWon,"className",RX.cls.disabled," disabled");_sC($.signup.style,"display","");_sC($.signin.style,"display","");_sC($.signoff.style,"display","none");_sC($_("loginBeforeJoinGameWrapper").style,"display","");if($.updateUserInfoArea){Util.updateItemsInSettings()}AJ.avatar=Util.getAvatar(AJ.username);_s($.avatar,"src",AJ.avatar);if($.avatarStatus){_s($.avatarStatus,"innerHTML",'<img src="'+AJ.avatar+'" alt="Avatar"/>')}if(variables.currentWindow=="settings"){if(TabFolder.getIndex($.tFS)!=0){TabFolder.setPageByIdx($.tFS,0)}}};Util.showUserStuff=function(){_rT($.pointsWon,"className",RX.cls.disabled,"");_sC($_("loginBeforeJoinGameWrapper").style,"display","none");_sC($.signup.style,"display","none");_sC($.signin.style,"display","none");_sC($.signoff.style,"display","");if(variables.currentWindow=="settings"){repositionAvatarUpload()}_s($.avatar,"src",AJ.avatar);if($.avatarStatus){_s($.avatarStatus,"innerHTML",'<img src="'+AJ.avatar+'" alt="Avatar"/>')}if($.settings){Util.updateItemsInSettings();Questions.showAll()}variables.changeNickBalloon=false;Balloons.changeNick.hide()};Util.updateItemsInSettings=function(){var a=AJ.userType?"":"none";_sC($.updateUserInfoArea.style,"display",a);_sC($.updateUserInfoArea2.style,"display",a);_sC($.uAF.style,"display",a);_sC($.tFS.style,"display",a)};Util.windowFocus=function(a){AJ.focused=true;Activity.windowFocus(a)};Util.windowBlur=function(a){AJ.focused=false;Activity.windowBlur(a)};Util.updateVotingStatus=function(){var b=0;for(var a=0;a<currentRoom.users.length;a++){if(currentRoom.users[a].ready){b++}}_sC($.votingStatus,"innerHTML",Util.sprintf(Strings.votingStatus,b,currentRoom.users.length-b))};Util.initRoom=function(a){Window.setTitle("play",escapeHTML(currentRoom.title));if(a){Quiz.clearQuestion(false,Strings.lobbyPressStart);Util.updateVotingStatus()}else{Quiz.clearQuestion(null,'<span style="font-size: smaller" class="info">'+Strings.waitQ+"</span>")}Quiz.updateQuestionPosition();UserList.refreshUsers();_sC($.moneyWon.style,"display",currentRoom.roomInfo.bet?"":"none");_sC($.readyInfoPaid.style,"display",currentRoom.roomInfo.bet?"":"none");UI.afterApplyOnce.push(Chat.updateHeight)};Util.objectsMatch=function(c,b){if(typeof c!="object"||typeof b!="object"){return c==b}if(c instanceof Array||b instanceof Array){if(c.length!=b.length){return false}for(var a=0;a<c.length;a++){if(c[a]!=b[a]){return false}}}else{for(var a in c){if(c[a]!=b[a]){return false}}for(var a in b){if(c[a]!=b[a]){return false}}}return true};Util.joinGameMenu=function(b,a){if(!arguments.callee.menu){arguments.callee.menu=Menu.createFromObj(arguments.callee.menuObj)}Menu.popUnder(arguments.callee.menu,a);if(b){stopEvt(b)}};Util.updateJoinRoomPopup=function(){var c=LStrings[AJ.curLang].inline;var d={list:[{name:c.inlineFBrowse,action:"Util.navigate(Window.findRoomWindow, 'tFFG', 0);"},{name:c.inlineFRecent,action:"Util.navigate(Window.findRoomWindow, 'tFFG', 1);"},{name:c.inlineFSearch,action:"Util.navigate(Window.findRoomWindow, 'tFFG', 2);"}]};if(recentRooms.length){d.list.push({name:"-"});for(var b=0,a;a=recentRooms[b];b++){d.list.push({name:a.title,action:"Quiz.setRoom({id: '"+a.id+"'});"})}}if(Util.joinGameMenu.menu){Menu.destroy(Util.joinGameMenu.menu)}Util.joinGameMenu.menu=Menu.createFromObj(d)};Util.getDateFromJSON=function(a){if(!a||a=="undefined"){return null}if(typeof a=="string"){a=parseJSON(a)}if(typeof a=="number"){return new Date(a<Util.getDateFromJSON.maxSec?a*1000:a)}switch(a.length){case 0:return null;case 1:return new Date(a[0]);case 2:return new Date(a[0],a[1]);case 3:return new Date(a[0],a[1],a[2]);case 4:return new Date(a[0],a[1],a[2],a[3]);case 5:return new Date(a[0],a[1],a[2],a[3],a[4]);case 6:return new Date(a[0],a[1],a[2],a[3],a[4],a[5]);default:return new Date(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}};Util.getDateFromJSON.maxSec=Math.pow(10,12);Util.getPagingHTML=function(b,g,l,p,d,k){var n=g,f,e,c,h=[],a;as(b%n===0);if(!b&&l<=g){return Util.sprintf(d,l)}a=0;g=n;f=b;e=f-g;while(f>0){c=Util.sprintf(p,e>=0?e+1:1,f);c='<span class="link" onclick="'+k+"("+e+');">'+c+"</span>";h.push(c);a++;f=e;if(a%4==0){g*=10}e-=g}h.reverse();c=Util.sprintf(p,b+1,Math.min(b+n,l));h.push(c);a=0;g=n;f=b+g;e=f+g;while(f<l){c=Util.sprintf(p,f+1,e<l?e:l);c='<span class="link" onclick="'+k+"("+f+');">'+c+"</span>";h.push(c);a++;f=e;if(a%4==0){g*=10}e+=g}return h.join(" ")};Util.getAvatar=function(c,b){var a=constants.avatarPath;if(b&&b!="undefined"){return a+b}if(!c||RX.other.guest.test(c)){return a+constants.avatars.guest}return a+constants.avatars.none};Util.printMoney=function(d,b){var a="";if(d<0){a="-";d=-d}var e=currencies[b?b:constants.defaultCurrency];var c=a+String(Math.floor(d/100))+((d%100)?"."+ls(d%100,"0",2):"");return e.sign?(e.sign+c):(c+" "+(d==100?e.singular:e.plural))};Util.eventIsInside=function(node,event){var txt="";if(!node.onmouseenter){txt+="node.onmouseenter = function() {"+node.getAttribute("onmouseenter")+"};"}if(!node.onmouseenter){txt+="node.onmouseleave = function() {"+node.getAttribute("onmouseleave")+"};"}if(txt){eval(txt)}var secondNode=event.relatedTarget;if(node==secondNode){return true}if(node.contains(secondNode)){return true}return false};Util.getLoadingImg=function(){return'<img style="margin: 5px" src="icons/ajax-loader.gif" class="load" alt="'+Strings.loadingAlt+'"/>'};Util.uploadAvatar=function(){$_("avatarUploadPlayerId").value=AJ.playerId;$_("avatarUploadServerId").value=AJ.serverId;$.avatarStatus.innerHTML=Util.getLoadingImg();$.uAF.submit()};Util.restoreAvatarImg=function(){$.avatarStatus.innerHTML='<img alt="Avatar" src="'+AJ.avatar+'" />'};Util.windowElements={index:["thisisidle","avatar","nick","signoff","signin","signup","changeNickDiv","changeNickInput","precacheDiv","page","rankContainer","rank","lastModified","disablingOverlay","langPicker","feedback","feedbackContent","feedbackFrom","feedbackTitle","feedbackEmail","feedbackMessage","sound","timerContainer","timer","timerMessage","user","moneyWon","pointsWon","moneyLeft","gamerCardBalance"],home:["homeTopUsersLoader","homeTopUsers"],play:["userList","returnToGame","gameMessage","answerButtons","answerCheckboxes","chatHistory","btnToggleReady","votingStatus","pendingChat","chatText","sortButtons","sorted","sortSubmit","ansHint","ansText","textAnswer","btnText","checkboxSubmit","addQfromPreview","qKeywords","qLang","waitBreak","waitBreakEOM","waitBreakEOMMessage","waitBreakState","waitBreakAnswer","msg","dontKnowDiv","waitShowMore","eomPaidGameMessage","readyInfoPaid","answerCheckboxesHolder","sortButtonsHolder","question_outer","questionAnswers","sideInfoContainer","tagsContainer","chatContainer","questionContainer","waitBreakInter","qtext","qimage","proximity"],qreview:["qHistory"],login:["createUsername","createPassword"],findGame:["fRF","fRL","fRBet","domainTreeHolder","htmlCNoMoney","findGameLoader","custTitle"],settings:["tFS","tFP","cbAnimations","cbBigAnimations","cbTimestamps","cbActivity","cbActivityOthers","cbDepositPopup","btnChangePass","updateUserInfoArea","updateUserInfoArea2","btnUpdateInfo","uAF","avatarStatus","btnUploadAvatar","noQuestions","nQKwBasic","nQ1Keywords","questionsPaging","paymentHistoryPages","paymentHistoryContent","paymentHistoryLoader","btnMakeDepositMB","btnCancelDepositMB","btnBackDepositMB","btnMakeDepositEP","btnCancelDepositEP","btnBackDepositEP","btnMakeDepositMP","btnCancelDepositMP","btnBackDepositMP","incomingPayment","btnExtractMoneyBookers","sldrExtractMB","htmlSExtractEmail","htmlSExtractNoEmail","htmlSExtractNoMoney"]};Util.windowPayElements={findGame:true,makeCustom:true};Util.findElements=function(a){if(!Util.windowElements[a]){return}var c=Util.windowElements[a];for(var b=0,d="";d=c[b];b++){if(!($[d]=document.getElementById(d))){console.error("Unable to find element #"+d+" for window "+a)}}};Util.setPayElements=function(b,c){if(Util.windowPayElements[b]===true){Util.windowPayElements[b]=getElementsByClassName($[b].lastChild,"no-pay").concat(getElementsByClassName($[b].lastChild,"yes-pay")).concat(getElementsByClassName($[b].lastChild,"no-pay-reverse")).concat(getElementsByClassName($[b].lastChild,"yes-pay-reverse"))}var e=Util.windowPayElements[b],d;if(!e||!e.length){return}var a=c?"yes-pay":"no-pay",f;for(d=0;f=e[d];d++){_r(f,"className",RX.cls.yesNoPay,a)}};Util.balanceElements=["iBalance"];Util.updateBalances=function(){var b=Util.printMoney(AJ.balance);for(var a=0,c;c=Util.balanceElements[a];a++){_s($_(c),"innerHTML",b)}Account.updateGameSliders();Account.updateBalanceSliders()};Util.positionTimer=function(){UI._positionOverBox($.timerContainer,offsetBox(document.getElementById("timerSpacer")));variables.positionedTimer=true};Util.getVariableFromStringPath=function(d,a){d=d.split(".");var c=a||window;var b=0;while(d[b]){as(c,"Util.getVariableFromStringPath: path is broken");c=c[d[b]];b++}return c};Util.formatters={printMoney:function(a){return typeof a=="string"?a:Util.printMoney(a*100)},printMoneyMerchant:function(c,d){var g=Merchants.providers[d];c*=(g.payMult||1)*100;var f=Util.printMoney(c,g.currency);if(g.fixedTax||g.percentTax){var a=c*(g.percentTax||0)/100;var e="";if(g.fixedTax){if((g.fixedTaxCurrency||constants.defaultCurrency)===(g.currency||constants.defaultCurrency)){a+=g.fixedTax}else{e=" \u2212 "+Util.printMoney(g.fixedTax,g.fixedTaxCurrency||constants.defaultCurrency)}}if(a|1){a=(a+1)|0}var b=c-a;f+=" ("+Util.printMoney(b,g.currency)+e+")"}return f},printMoneyMB:function(a){if(typeof a=="string"){return a}return Util.formatters.printMoneyMerchant(a,"MoneyBookers")},printMoneyEP:function(a){if(typeof a=="string"){return a}return Util.formatters.printMoneyMerchant(a,"ePayment")},printMoneyMP:function(a){if(typeof a=="string"){return a}return Util.formatters.printMoneyMerchant(a,"MobilPay")},printPlayers:function(a){return typeof a=="string"?a:a==1?("1 "+Strings.players.one):(a+" "+Strings.players.more)}};Util.formatters.printMoney.reverse=Util.formatters.printPlayers.reverse=Util.formatters.printMoneyMB.reverse=function(a){return parseFloat(a)};Util.formatters.printMoneyEP.reverse=function(a){return parseFloat(a)/Merchants.providers.ePayment.payMult};Util.formatters.printMoneyMP.reverse=function(a){return parseFloat(a)/Merchants.providers.MobilPay.payMult};Util.getPreviousSiblingsContentLength=function(b){var a=0;while(b.previousSibling){b=b.previousSibling;if(b.nodeType==3){a+=b.data.length}else{a+=b.innerHTML.stripTags().length}}return a};Util.getStars=function(a){return a<300?0:a<3000?0.5:Math.min(5,Math.log(a/1000)/Math.log(3)|0)};Util.onresize=function(){Alert.scheduleResize();UserList.updateHeight();if(variables.currentWindow=="play"){Util.positionTimer()}else{variables.positionedTimer=false}};Util.isolateScroll=function(a){if(a.attachEvent){a.attachEvent("onmousewheel",Util.isolateScrollCallback,false)}else{if(a.addEventListener){a.addEventListener("DOMMouseScroll",Util.isolateScrollCallback,false);a.addEventListener("mousewheel",Util.isolateScrollCallback,false)}}};Util.isolateScrollCallback=function(b){var a=b.detail?b.detail*-1:b.wheelDelta/40;if(a<0&&this.scrollTop+this.offsetHeight>=this.scrollHeight){stopEvt(b)}if(a>0&&this.scrollTop===0){stopEvt(b)}};Util.preventLocationRedirect=function(){if(Util.preventLocationRedirect.interval){return}Util.preventLocationRedirect.count=0;Util.preventLocationRedirect.interval=setInterval(Util.preventLocationRedirect.check,1);window.onbeforeunload=Util.preventLocationRedirect.beforeUnload};Util.preventLocationRedirect.count=0;Util.preventLocationRedirect.url="http://"+location.host+"/204";Util.preventLocationRedirect.check=function(){if(Util.preventLocationRedirect.count>0){Util.preventLocationRedirect.count-=2;window.top.location=Util.preventLocationRedirect.url}};Util.preventLocationRedirect.beforeUnload=function(){Util.preventLocationRedirect.count++};Util.stopPreventLocationRedirect=function(){if(Util.preventLocationRedirect.interval){clearInterval(Util.preventLocationRedirect.interval);Util.preventLocationRedirect.interval=null}};Util.setPromoUrl=function(){var a=document.getElementById("referrerPromoUrl");if(!a){return}_s(a,"innerHTML",AJ.userType?escapeHTML(location.protocol+"//"+location.host+"/#referrer:"+AJ.username):Strings.referrerPromoNeedsRegistration)};Util.setReferrer=function(a){AJ.referrer=a;Window.show("referred")};Util.setSelection=function(f,e,d,c){var a;if(window.getSelection){a=window.getSelection()}else{if(document.selection){a=document.selection.createRange()}}if(document.createRange){var b=document.createRange();b.setStart(f,e);b.setEnd(d,c);a.removeAllRanges();a.addRange(b)}else{if(f.createTextRange){var b=f.createTextRange();b.collapse(true);b.moveStart("character",e);b.moveEnd("character",c-e);b.select()}}};Util.getSelectionObj=function(){var a;if(window.getSelection){return window.getSelection()}else{if(document.selection){return document.selection.createRange()}}return null};Util.getSelection=function(e){var b,f=Util.getSelectionObj();if(!f){return null}var h,g,d,c;if(f.anchorNode){h=f.anchorNode;g=f.anchorOffset;d=f.focusNode;c=f.focusOffset}else{if(f.getBookmark){var a=f.compareEndPoints("StartToEnd",f)==0;if(!a){f.collapse(true)}g=f.getBookmark().charCodeAt(2)-2;h=f.parentElement();f=Util.getSelectionObj();var a=f.compareEndPoints("StartToEnd",f)==0;if(!a){f.collapse(false)}c=f.getBookmark().charCodeAt(2)-2;d=f.parentElement()}else{return null}}if(h.nodeType==3){g+=Util.getPreviousSiblingsContentLength(h);h=h.parentNode}if(d.nodeType==3){c+=Util.getPreviousSiblingsContentLength(d);d=d.parentNode}return[h,g,d,c]};Util.updateActivity=function(){Settings.change("activity",Checkbox.isChecked($.cbActivity)+2*Checkbox.isChecked($.cbActivityOthers))};Util.updateAnimations=function(){Settings.change("animations",Checkbox.isChecked($.cbAnimations)+2*Checkbox.isChecked($.cbBigAnimations))};Util.updateCreateGameTitle=function(){if($[Window.makeRoomWindow]){var b;var a=(b=currentRoom)&&(b=b.users[b.indexByUser[AJ.username]])&&b.displayedUsername||AJ.username;Field.setValue($.custTitle,Util.sprintf(Strings.roomName,a))}};Util.updateTopUsers=function(){if(!AJ.playerId){return}var a=new Date().valueOf();if(a-Util.updateTopUsers.lastUpdate<30*1000){return}Util.updateTopUsers.lastUpdate=a;_s($.homeTopUsersLoader.style,"display","");Request.topUsers(0,18)};Util.updateTopUsers.lastUpdate=0;Util.updateUsername=function(c){if(AJ.username==c){return}AJ.username=c;AJ.usernameRx=new RegExp("\\b"+AJ.username.replace(RX.other.nonAlphaNumeric,"\\$&")+"\\b");var a;var b=(a=AJ.username.match(RX.other.extractGuestNick))?Util.sprintf(Strings.guestUser,a[1]):AJ.username;_s($.nick,"innerHTML",escapeHTML(b));Util.updateCreateGameTitle()};Util.whois=function(b){if(typeof b=="string"){b=b.split(",")}for(var a=0;a<b.length;a++){if(!variables.watchList.contains(b[a])){variables.watchList.push(b[a])}}Request.whois(b)};Util.clearCookies=function(){var a=[];if(variables.storage&&variables.storage.length){for(b=0;b<variables.storage.length;b++){a.push(variables.storage[b])}}for(b=0;b<a.length;b++){Util.save(a[b],null)}var c=document.cookie.match(/\w+=/g),b;if(c){for(b=0;c[b];b++){deleteCookie(c[b].substr(0,c[b].length-1))}}Util.info("Cookies and all other private data saved in your browser has been purged.",constants.appName)};function gaSSDSLoad(d){var b=(("https:"==document.location.protocol)?"https://ssl.":"http://www."),a;a=document.createElement("script");var c=function(){if(!a.onloadDone){a.onloadDone=true;if(typeof _gat!="undefined"){pageTracker=_gat._getTracker(d)}if(pageTracker){pageTracker._trackPageview()}else{console.log("Google Analytics failed")}var f=document.cookie.match(/(^|;\s*)\w+=/g)||[];for(var e=0;e<f.length;e++){if(f.indexOf("__")==0){deleteCookie(f[e].substr(0,f[e].length-1))}}}};a.onload=function(){c()};a.onreadystatechange=function(){if("complete"===a.readyState){c()}};a.src=b+"google-analytics.com/ga.js";a.type="text/javascript";a.onloadDone=false;document.getElementsByTagName("head")[0].appendChild(a)}function injectLiveSearch(){var a=document.createElement("script");a.loadDone=false;a.onreadystatechange=function(){if("loaded"==a.readyState){a.onload()}};a.onload=function(){if(a.loadDone){return}a.loadDone=true;if(variables.currentWindow=="settings"){OnLoadSearch()}};a.type="text/javascript";a.src="livesearch.js";document.getElementsByTagName("head")[0].appendChild(a)}Util.setupFacebookHighlight=function(){var b=document.getElementById("hNavFacebook").parentNode.parentNode;var c=getStyle(b).backgroundColor;var a="#FFE800";Animation.addTransition(b,"backgroundColor",c,a,"",true).after(Animation.getNewTransition(b,"backgroundColor",a,c))};Util.init=function(){Util.hexToInt.init();Util.zeroTimeout.init()};Util.hexToInt=function(b){if(!Util.hexToInt.cache[b]){var c=0;for(var a=0;a<b.length;a++){c=c*16+Util.hexToInt.digits[b.charAt(a)]}Util.hexToInt.cache[b]=c}return Util.hexToInt.cache[b]};Util.hexToInt.digits={};Util.hexToInt.cache={};Util.hexToInt.init=function(){for(var a=0;a<9;a++){Util.hexToInt.digits[a]=a}Util.hexToInt.digits.A=Util.hexToInt.digits.a=10;Util.hexToInt.digits.B=Util.hexToInt.digits.b=11;Util.hexToInt.digits.C=Util.hexToInt.digits.c=12;Util.hexToInt.digits.D=Util.hexToInt.digits.d=13;Util.hexToInt.digits.E=Util.hexToInt.digits.e=14;Util.hexToInt.digits.F=Util.hexToInt.digits.f=15};function throwError(c,b){var a=c+" [Call Stack: "+Util.getStackTrace()+"].";console.error(a);if(!b){Util.info(constants.release?Strings.clientError:c,Strings.Error)}if(variables.exceptions.indexOf_(a)==-1){variables.exceptions.push(a);Request.exception(a)}if(!constants.release&&!b){throw new Error(c)}}Util.stackTraceClasses=["Account","Activity","Alert","Algorithms","Animate","Animation","Animations","Balloon","BrowserUpdate","Button","ButtonList","Chat","Checkbox","DomBr","events","Field","Graph","Grid","HTML","Hash","InfoBox","LanguageList","Map","Menu","Merchants","PlayZone","ProgressBar","QuestionHistory","Questions","Quiz","RadioSet","Request","Request.callbacks","Rooms","Slider","Sound","TabFolder","TagList","ToolTip","TreeToggle","UI","User","UserCache","UserList","Util","Util.Color","Util.zeroTimeout","Window"];Util.getStackTrace=function(){var l=[];if(!Util.getStackTrace.first){Util.getStackTrace.first=true;for(var g=0;g<Util.stackTraceClasses.length;g++){var c=Util.getVariableFromStringPath(Util.stackTraceClasses[g]);for(var a in c){var h=c[a];if(typeof h=="function"&&!h.name){h._name=Util.stackTraceClasses[g]+"."+a}}}}try{arguments.callee.caller}catch(d){return Util.getStackTraceOld()}var l=[];var k=arguments.callee.caller;k=k&&k.caller;var b=[k];while(k){var f=$A(k.arguments).join(", ");l.push((k._name||k.name||"???")+"("+f+")");k=k.caller;if(b.contains(k)){l.push((k._name||k.name||"???")+" (again)");break}b.push(k)}return l.join(", ")};Util.getStackTraceOld=function(){var l=[];var c=false;try{d.dont.exist+=0}catch(g){if(g.stack){var n=g.stack.split("\n");l=n.slice(3);l.shift();c=true}else{if(window.opera&&g.message){var n=g.message.split("\n");for(var d=0,f=n.length;d<f;d++){if(n[d].match(/^\s*[A-Za-z0-9\-_\$]+\(/)){var k=n[d];if(n[d+1]){k+=" at "+n[d+1];d++}l.push(k)}}l=l.slice(3);c=true}}}if(!c){var b=arguments.callee.caller;while(b){var h=b.toString();var a=h.substring(h.indexOf("function")+8,h.indexOf("("))||"anonymous";l.push(a);b=b.caller}}return l.join(", ")};Util.Color={translated:{},fromCssColor:function(c){if(c instanceof Array){return c}if(!Util.Color.translated[c]){var b,a;if(a=c.match(RX.cssColors.hex3)){b=[Util.hexToInt(a[1]+a[1]),Util.hexToInt(a[2]+a[2]),Util.hexToInt(a[3]+a[3])]}else{if(a=c.match(RX.cssColors.hex6)){b=[Util.hexToInt(a[1]),Util.hexToInt(a[2]),Util.hexToInt(a[3])]}else{if(a=c.match(RX.cssColors.rgb)){b=[+a[1],+a[2],+a[3]]}}}Util.Color.translated[c]=b}return Util.Color.translated[c]},compose:function(c,b,a){return[c[0]+((b[0]-c[0])*a|0),c[1]+((b[1]-c[1])*a|0),c[2]+((b[2]-c[2])*a|0)]},toCssColor:function(a){return"rgb("+a.join(",")+")"}};Util.zeroTimeout={};Util.zeroTimeout.messageText="zero-timeout-message";Util.zeroTimeout.count=1;Util.zeroTimeout.add=function(a){Util.zeroTimeout.queue.push(a);setTimeout(Util.zeroTimeout.execute,0);return Util.zeroTimeout.count++};Util.zeroTimeout.addUsingMessage=function(a){Util.zeroTimeout.queue.push(a);window.postMessage(Util.zeroTimeout.messageText,"*");return Util.zeroTimeout.count++};Util.zeroTimeout.clear=function(a){var b=Util.zeroTimeout.count-a-1;if(b>=0&&b<Util.zeroTimeout.queue.length){Util.zeroTimeout.queue[b]=null}};Util.zeroTimeout.queue=[];Util.zeroTimeout.execute=function(){var a;do{a=Util.zeroTimeout.queue.shift()}while(!a&&Util.zeroTimeout.queue.length);if(a){a()}};Util.zeroTimeout.init=function(){if("postMessage" in window){Util.zeroTimeout.add=Util.zeroTimeout.addUsingMessage}};if(!this.JSON){JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z"};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}})();var Activity={curTitle:"",activityStr:"",fullTitle:"",activityTick:0,activityInterval:null,windowFocus:function(){variables.windowIsActive=true;if(Activity.activityStr){Activity.activityStr="";Activity.activityTick=0;clearInterval(Activity.activityInterval);Activity.activityInterval=null;Activity.updateTitle(Activity.curTitle)}Settings.reapply("animations","sound")},windowBlur:function(){variables.windowIsActive=false;Settings.reapply("animations","sound")},toggleActivity:function(){if(!Activity.activityInterval){return}Activity.activityTick++;if(Activity.activityTick%2){document.title=Activity.curTitle}else{document.title=Activity.fullTitle}},notify:function(a){if(variables.windowIsActive){return}Activity.activityStr=a=a.replace(RX.chr.rampg,"&").replace(RX.chr.rltg,"<").replace(RX.chr.rgtg,">");document.title=Activity.fullTitle=Activity.curTitle+" ["+a+"]";if(!Activity.activityInterval){Activity.activityInterval=setInterval(Activity.toggleActivity,1000)}},updateTitle:function(a){Activity.curTitle=a=a.replace(RX.chr.rampg,"&").replace(RX.chr.rltg,"<").replace(RX.chr.rgtg,">");if(Activity.activityStr){Activity.fullTitle=a+" ["+Activity.activityStr+"]"}else{document.title=a}}};var Animations={fadeFromTo:function(b){if(b>=1){if(typeof this.nextFadeTo!="undefined"){this.fadeFrom=this.fadeTo;this.fadeTo=this.nextFadeTo;delete this.nextFadeTo;_r(this,"className",RX.cls.opac,"opac"+Math.round(this.fadeFrom));Animation.add(Animations.fadeFromTo,this,0.5);return}this.fading=false;if(!this.fadeTo){_s(this.style,"display","none");_r(this,"className",RX.cls.opac,"opac")}else{if(this.fadeTo==100){_r(this,"className",RX.cls.opac,"opac")}else{_r(this,"className",RX.cls.opac,"opac"+Math.round(this.fadeTo))}}}else{var a="opac"+Math.round(this.fadeFrom+b*(this.fadeTo-this.fadeFrom));if(_g(this,"className").indexOf(a)==-1){_r(this,"className",RX.cls.opac,a)}}}};var Animate={generalDirections:{horizontal:{before:"left",after:"right"},vertical:{before:"up",after:"down"},Horizontal:{before:"Left",after:"Right"},Vertical:{before:"Up",after:"Down"}},directionBody:{Left:"Width",Right:"Width",Up:"Height",Down:"Height"},directionProp:{},directionFlows:{},complementary:{height:"width",Height:"Width",width:"height",Width:"Height",left:"top",Left:"Top",right:"bottom",Right:"Bottom",top:"left",Top:"Left",bottom:"right",Bottom:"Right"},init:function(){var a;a=Animate.directionProp;a.left=a.Left=a.right=a.Right="left";a.up=a.Up=a.down=a.Down="top";a=Animate.directionFlows;a.left=a.Left=a.up=a.Up=false;a.right=a.Right=a.down=a.Down=true},fade:function(a,d,c,b){c*=100;if(!AJ.animations){c=Math.round(c);if(!c){_r(a,"className",RX.cls.opac,"opac");_s(a.style,"display","none")}else{if(c==100){_r(a,"className",RX.cls.opac,"opac")}else{_r(a,"className",RX.cls.opac,"opac"+c)}}return null}if(a.fading){a.nextFadeTo=c;return null}d*=100;_r(a,"className",RX.cls.opac,"opac"+Math.round(d));a.fadeFrom=d;a.fadeTo=c;a.fading=true;return Animation.add(Animations.fadeFromTo,a,b)},blind:function(d,l,h,c,b){if(!AJ.animations){return Animation.decoyTransition(d)}var e=d.offsetHeight;var g=l.offsetHeight;var f=getStyle(l).marginTop;if(f&&(f=f.match(RX.units.px))){g+=f[1]-0}var k;UI.makeExtraHeight(d);_s(d.style,"height",e-d.extraHeight+"px");if(b){k=Animate.fadeOutClone(l,c?c*0.75:0.75)}var a;if(!d._blind_checked&&(a=getStyle(d).minHeight)&&(parseFloat(a)>0)){console.warn("Blind animation cannot be used on elements with min-height. Removing min-height for %o",d);_s(d.style,"minHeight","0")}d._blind_checked=true;UI.afterApplyOnce.push(function(){var t,p,q=e+h.offsetHeight-g;var r=getStyle(h).marginTop;if(r&&(r=r.match(RX.units.px))){q+=r[1]-0}if(e!=q){p=q==0;e-=d.extraHeight;q-=d.extraHeight;if(e<0){e=0}if(q<0){q=0}t=Animation.getTransition(d,"height");if(t){q=t.end+d.extraHeight+h.offsetHeight-g;if(t.end!=q){t.begin=e;t.end=q;t.speed=(c||1)*Animation.speed;var n=new Date().valueOf();t.after=Animation._after}}else{t=Animation.addTransition(d,"height",e,q,"px",false,c)}if(p){t.after(Util.displayNone)}d.blinding=true;if(k){e=e-d.offsetHeight+k.offsetHeight;q=q-d.offsetHeight+k.offsetHeight;p=q==0;UI.makeExtraHeight(k);e-=k.extraHeight;q-=k.extraHeight;if(e<0){e=0}if(q<0){q=0}t=Animation.addTransition(k,"height",e,q,"px",true,c);if(p){t.after(Util.Util.displayNone)}k.blinding=true}}})},blindDown:function(b,d){if(!AJ.animations){_s(b.style,"display","");return Animation.decoyTransition(b)}var c=Animation.getTransition(b,"height");if(c){if(c.end==b.scrollHeight-b.extraHeight){return}c.begin=b.offsetHeight-b.extraHeight;c.end=b.scrollHeight-b.extraHeight;c.speed=(d||1)*Animation.speed;var a=new Date().valueOf();c.beginTime=a+(a-c.beginTime)-c.speed;c.after=Animation._after;return}UI.makeExtraHeight(b);_sC(b.style,"display","");_s(b.style,"visibility","hidden");_s(b.style,"position","absolute");UI.afterApplyOnce.push(function(){_s(b.style,"height","0px");_s(b.style,"visibility","");_s(b.style,"position","");Animation.addTransition(b,"height",0,b.offsetHeight-b.extraHeight,"px",false,d)})},blindUp:function(b,e){if(!AJ.animations){_s(b.style,"display","none");return Animation.decoyTransition(b)}var d=Animation.getTransition(b,"height");if(d){if(d.end==0){return}d.begin=b.offsetHeight-b.extraHeight;d.end=0;d.speed=(e||1)*Animation.speed;var a=new Date().valueOf();d.beginTime=a+(a-d.beginTime)-d.speed;d.after=Util.displayNone;return}UI.makeExtraHeight(b);var f=_g(b.style,"height");if(f){f=parseFloat(f)}else{f=b.offsetHeight-b.extraHeight}var c=Animation.addTransition(b,"height",f,0,"px",false,e);c.after=Util.displayNone;return c},fadeOutClone:function(c,d){UI.makeExtraHeight(c);UI.makeExtraWidth(c);var a=c.cloneNode(true);var b=offsetBox(c);b[2]-=c.extraWidth;b[3]-=c.extraHeight;UI.positionOverBox(a,b);_an(document.body,a);Animate.fade(a,1,0,d).after(_o);return a},slideLeft:function(a,d,b){var c=parseFloat(_g(a.style,"left")||"0");return Animation.addTransition(a,"left",c,c-d,"px",false,b)},slideRight:function(a,d,b){var c=parseFloat(_g(a.style,"left")||"0");return Animation.addTransition(a,"left",c,c+d,"px",false,b)},slideLeftPropRight:function(b,d,c){var a=parseFloat(_g(b.style,"right")||"0");return Animation.addTransition(b,"right",a,a+d,"px",false,c)},slideRightPropRight:function(b,d,c){var a=parseFloat(_g(b.style,"right")||"0");return Animation.addTransition(b,"right",a,a-d,"px",false,c)},slideUp:function(a,d,b){var c=parseFloat(_g(a.style,"top")||"0");return Animation.addTransition(a,"top",c,c-d,"px",false,b)},slidePush:function(e,n,k,d){var l=e.parentNode;if(l!=n.parentNode){throwError("slidePush: elements do not have the same parent!")}if(!AJ.animations){_s(e.style,"display","none");_s(n.style,"display","");return Animation.decoyTransition(n)}var g=true,q=n.nextSibling;while(q){if(q==e){g=false;break}else{q=q.nextSibling}}if(Animate.generalDirections[k]){if(g){k=Animate.generalDirections[k].before}else{k=Animate.generalDirections[k].after}}d=d||1;var b=e["offset"+Animate.directionBody[k]];UI.makeExtraHeight(l);UI.makeExtraWidth(l);UI.makeExtraHeight(e);UI.makeExtraWidth(e);var p=Animate.directionBody[k],c=p.toLowerCase();_s(e.style,"display","inline-block");_s(e.style,c,e["offset"+p]-e["extra"+p]+"px");_s(n.style,"display","inline-block");_s(n.style,c,e["offset"+p]-e["extra"+p]+"px");if(Animate.directionFlows[k]){_s(e.style,Animate.directionProp[k],-b+"px");_s(n.style,Animate.directionProp[k],-b+"px")}var a=Animate["slide"+k](e,b,d);e.slidingOut=true;a.afterEnd=function(){_s(e.style,"display","none");e.slidingOut=false;UI.clearProps(e,c)};var f=Animate["slide"+k](n,b,d);f.related=a;f.afterEnd=UI.clearProps.bind(UI,n,"display",c);var h=l["offset"+Animate.complementary[p]];_s(n.style,"position","absolute");_s(n.style,"visibility","hidden");UI.afterApplyOnce.push(function(){var u=h-l["extra"+Animate.complementary[p]];var t=n["offset"+Animate.complementary[p]];var r=Animation.addTransition(l,Animate.complementary[c],u,t,"px",false,d);r.beginTime=f.beginTime;r.beforeBegin=UI.clearProps.bind(null,n,"visibility","position")});return f},removeRow:function(b){var c=document.createElement("div");var a=b.parentNode;while(a.tagName.toLowerCase()!="table"){a=a.parentNode}_s(c,"innerHTML",'<table class="'+_g(a,"className")+'" cellspacing="0" cellpadding="0" style="width: 100%"><tbody><tr>'+b.innerHTML.replace("working","")+"</tr></tbody></table>");_an(document.body,c);UI.positionOverBox(c,offsetBox(b));_s(b.style,"fontSize","0px");_s(b.style,"height",b.offsetHeight+"px");UI.afterApplyOnce.push(Animate._removeRowPart2.bind(Animate,b,c,$A_(b.childNodes).pluck_("offsetWidth")))},_removeRowPart2:function(e,g,d){Animate.blindUp(e).after=_oC;Animate.blindUp(g).after=_oC;var c=g.firstChild.rows[0];UI.makeExtraWidth(c.cells[0]);var b=c.cells[0].extraWidth;for(var a=0,f;f=c.cells[a];a++){_s(f.style,"width",d[a]-b+"px")}}};var QuestionHistory={typeClass:["schoice","mchoice","sort","text","number","map"],init:function(){windows.qreview=windows.qreview.replace_('<div id="qHistory"></div>','<div id="qHistory">'+QuestionHistory.getHTML(previousQuestions)+"</div>")},show:function(){_sC($.qHistory,"innerHTML",QuestionHistory.getHTML(previousQuestions))},updateLast:function(){QuestionHistory.removeLast();QuestionHistory.addLast()},addLast:function(){_i($.qHistory,"afterBegin",QuestionHistory.getHTML([previousQuestions.last()]))},removeFirst:function(){_o($.qHistory.lastChild)},removeLast:function(){_o($.qHistory.firstChild)},getHTML:function(b){var e="",f,d,k=0,g;for(d=b.length-1;d>=0;d--){k++;g=b[d];var a=QuestionHistory.typeClass[g.type];if(g.EOM){a+=" eom"}var h="";if(typeof g.lA=="undefined"){if(g!=question||Quiz.waiting){h=Strings.unanswered+" "+(g.answerMsg||"");a+=" unanswered"}else{h=Strings.notAnsweredYet;a+=" current"}}else{if(g.lA==dontKnow){h=g.answerMsg||Strings.youDidntKnow;a+="notKnown"}else{a+=g.userRightAnswer?" rightAnswer":" badAnswer";h=g.type==5?(g.userRightAnswer?Strings.rightAnswer:Strings.wrongAnswer):g.answerMsg}}f='<div class="'+a+'"><div class="metadata">'+Util.sprintf(Strings.qHistMeta,Strings.qTypes[g.type],g.kw.joina(),languages.nameFromId[g.lang])+"</div>"+g.text+"<br />"+(g.type<3?(g.type<2?Strings.availableAnswers:Strings.itemsToSort)+g.answers.joina()+"<br />":"")+h+(g.info?"<br />"+g.info:"")+"</div>";e+=f}return e}};var InfoBox={defaultTimer:20,slideHeight:100,speed:1,boxes:{},hideTimer:{},div:null,nextAutoIdx:0,init:function(){InfoBox.div=document.getElementById("infoboxes")},show:function(g,c,a,f){if(typeof f!="number"){f=InfoBox.defaultTimer}if(!g){g="UnnamedInfoBox"+(InfoBox.nextAutoIdx++)}var e,d=0;if(InfoBox.boxes[g]){if(InfoBox.hideTimer[g]){clearTimeout(InfoBox.hideTimer[g])}e=InfoBox.boxes[g];d=e.offsetHeight;var b=e;e=e.cloneNode(true);InfoBox.hide(b);InfoBox.boxes[g]=e;InfoBox.setBoxContent(g,c,a);_an(InfoBox.div,e)}else{e=InfoBox._create(g,c,a)}if(f){InfoBox.hideTimer[g]=setTimeout(InfoBox.tryHide.bind(InfoBox,g),f*1000)}InfoBox._show(e,InfoBox.slideHeight-d)},_show:function(a,b){if(AJ.animations){Animation.addTransition(a,"top",b,0,"px",false,InfoBox.speed);Animate.fade(a,0,1,InfoBox.speed)}},tryHide:function(a){if(InfoBox.boxes[a]){InfoBox.hide(InfoBox.boxes[a]);delete InfoBox.boxes[a];if(InfoBox.hideTimer[a]){clearTimeout(InfoBox.hideTimer[a])}}},hide:function(a){if(a.hiding){return}a.hiding=true;if(_io(a)){_cAn2(a)}else{if(AJ.animations){Animation.clear(a);UI.makeExtraHeight(a);Animation.addTransition(a,"height",a.offsetHeight-a.extraHeight,0,"px",false,InfoBox.speed).after(_o)}else{_o(a)}}},setBoxContent:function(c,b,a){_s(InfoBox.boxes[c].firstChild,"innerHTML",b);_s(InfoBox.boxes[c].lastChild,"innerHTML",a)},setBoxBody:function(b,a){_s(InfoBox.boxes[b].lastChild,"innerHTML",a)},clicked:function(a){InfoBox.tryHide(a.getAttribute("infoBoxName"))},_create:function(d,c,a){var b=UI.fromHTML('<div class="infobox opac" infoBoxName="'+d+'" onclick="InfoBox.clicked(this);"><div class="title">'+c+'</div><div class="content">'+a+"</div></div>");InfoBox.boxes[d]=b;_an(InfoBox.div,b);return b}};var Alert={element:null,container:null,footer:null,visible:false,enableOnClose:null,scheduledResize:false,init:function(){Alert.element=document.getElementById("alertElement");Alert.container=document.getElementById("alertContainer");Alert.footer=document.getElementById("alertFooter")},show:function(a){as(Alert.element);if(Alert.visible){Alert.addMsg(a);return}Alert.enableOnClose=_g($.disablingOverlay.style,"display");if(Alert.enableOnClose){_s($.disablingOverlay.style,"display","")}Alert.visible=true;_s(Alert.container,"innerHTML",'<div class="alertMessage">'+a+"</div>");_s(Alert.element.style,"visibility","hidden");_s(Alert.element.style,"display","");_sC(Alert.footer.style,"display","");UI.afterApplyOnce.push(Alert._afterShow)},_afterShow:function(){Alert.scheduledResize=false;_s(Alert.element.style,"top",(document.body.parentNode.offsetHeight-Alert.element.offsetHeight)/2+"px");_s(Alert.element.style,"visibility","");UI.toFocus=$_("btnCloseAlert")},addMsg:function(a){_i(Alert.container,"beforeEnd",'<div class="alertMessage">'+a+"</div>");UI.afterApplyOnce.push(Alert._afterShow)},hide:function(){_s(Alert.element.style,"display","none");if(Alert.enableOnClose){_s($.disablingOverlay.style,"display","none")}Alert.visible=false},removeItem:function(a){as(Alert.visible,"[Alert.removeItem] Alert.visible");if(Alert.container.childNodes.length==1){Alert.hide();return}while(a&&!RX.cls.alertMessage.test(_g(a,"className"))){a=a.parentNode}if(!a){as(false,"[Alert.removeItem] !domRef ?!");return}Animate.blindUp(a).after(_o)},activeChoices:[],choice:function(b,f,e){var a=Alert.activeChoices.length;Alert.activeChoices.push(e);var d=b+"<br />";for(var c=0;c<f.length;c++){d+='<aj:button action="Alert._answerChoice('+a+", "+c+', this)">'+f[c]+"</aj:button>"}d=HTML.parse(d,{button:true});Alert.show(d);_s(Alert.footer.style,"display","none")},_answerChoice:function(d,f,c){if(_io(c)){return}Alert.activeChoices[d](f);Alert.activeChoices[d]=null;var e=c.parentNode.parentNode.childNodes.length==1;_o(c.parentNode);var a=true;for(var b=0;b<Alert.activeChoices.length;b++){if(Alert.activeChoices[b]){a=false;e=false;break}}if(e){Alert.hide()}else{if(a){_s(Alert.footer.style,"display","")}UI.afterApplyOnce.push(Alert._afterShow)}},scheduleResize:function(){if(Alert.scheduledResize){return}Alert.scheduledResize=true;setTimeout(Alert._afterShow,50)}};var RadioSet={onclick:function(d,c){var b=c.id.split("_"),f=b[0],e=b[1];var a=document.getElementById(f);if(a.value!="$val"){Button.release(document.getElementById(f+"_"+_g(a,"value")));_s(a,"value",e);Button.press(c);if(a.onchange){a.onchange()}}},value:function(a){return _g(document.getElementById(a),"value")},setValue:function(b,a){document.getElementById(b+"_"+a).onclick()},setText:function(d,c){if(typeof c=="string"){c=c.split(",")}for(var b=0;b<c.length;b++){var a=c[b].split(":");if(as(document.getElementById(d+"_"+a[0]))){Button.setText(document.getElementById(d+"_"+a[0]),a[1])}}},langSetText:function(c,a,b){if(RadioSets[c]){RadioSet.setText(c,a)}else{if(windows[b]){var d=new RegExp('(<aj:radioSet\\s+id="'+c+'"[^>]+values=")[^"]*"');as(d.test(windows[b]));windows[b]=windows[b].replace(d,"$1"+a+'"')}else{console.warn("Unable to changle text for RadioSet %o to %o (page %o).",c,a,b)}}},setTitles:function(c,d){if(typeof d=="string"){d=d.split(":")}var b=RadioSets[c];for(var a=0;a<d.length;a++){if(as(document.getElementById(c+"_"+b[a]))){Button.setTitle(document.getElementById(c+"_"+b[a]),d[a])}}},langSetTitles:function(c,b,a){if(RadioSets[c]){RadioSet.setTitles(c,b)}else{if(windows[a]){var d=new RegExp('(<aj:radioSet\\s+id="'+c+'"[^>]+titles=")[^"]*"');as(d.test(windows[a]));windows[a]=windows[a].replace(d,"$1"+b+'"')}else{console.warn("Unable to changle text for RadioSet %o to %o (page %o).",c,b,a)}}}};var ProgressBar={setValue:function(a,b){_s(a.firstChild.style,"width",b+"%")}};var Slider={margin:10,jumpDistance:10,showLabelDelay:100,active:null,ignoreNextKey:false,getStyle:function(d,c,a,b,e){if(d==null||(typeof d=="undefined")){return"left: 0;"}else{b=!!b;e=!!e;return"left: "+Slider.getPosition(d=="under"||d=="over"?d:d-0,c-0,a-0,b,e)+"%;"}},getPosition:function(f,e,a,d,g){f=Slider.limitValue(f,e,a,d,g);if(f=="under"){return 0}else{if(f=="over"){return 100}else{var c=a-e;var b=c+(d?c/10:0)+(g?c/10:0);return !b?50:((f-e+(d?c/10:0))/b*100).toFixed(2)}}},limitValue:function(d,c,a,b,e){if(b&&(d=="under"||d<c)){return"under"}if(e&&(d=="over"||d>a)){return"over"}if(d=="under"||d<=c||isNaN(d)){return c}if(d=="over"||d>=a){return a}as(typeof d=="number",'Slider.limitValue: "'+d+'" is not a number!');return(d+0.5)|0},setActive:function(a){Slider.active=Slider.getProperties(a);_a(Slider.active.handles[Slider.active.activeHandle],"className"," active");Util.focusMovedTo(a)},clearActive:function(a){if(Slider.active&&Slider.active.slider==a){_r(Slider.active.handles[Slider.active.activeHandle],"className",RX.cls.active,"");Slider.active=null}},getProperties:function(e){var f=e.nextSibling.nextSibling;var a=e.nextSibling;var c=$A(f.childNodes);var b=e.formatter||e.getAttribute("formatter");if(typeof b=="string"){e.formatter=Util.getVariableFromStringPath(b)}var d={slider:e,handles:c,activeHandle:0,labelHolder:a,label:a.firstChild,formatter:e.formatter||String,min:e.getAttribute("min")-0,max:e.getAttribute("max")-0,under:e.getAttribute("under"),over:e.getAttribute("over"),length:f.offsetWidth};d.visibleP=100+(d.under?10:0)+(d.over?10:0);return Slider._updateValueProps(d)},_updateValueProps:function(b){b.values=_g(b.slider,"value").split(RX.other.intervalDash);b.valuesP=[];for(var a=0;a<b.handles.length;a++){b.valuesP[a]=parseFloat(_g(b.handles[a].style,"left"))}return b},onFocus:function(a){if(!Slider.active||Slider.active.slider!=a.firstChild){Slider.setActive(a.firstChild)}},onBlur:function(a){Slider.clearActive(a.firstChild)},onMouseOver:function(b,a){return;if(b.mouseOutTimeout){clearTimeout(b.mouseOutTimeout);b.mouseOutTimeout=null}else{_s(b.nextSibling.style,"zIndex",-1);Tooltip.show(b.nextSibling.nextSibling.childNodes.length==1?b.nextSibling.nextSibling.firstChild:b.nextSibling.nextSibling,_g(b.nextSibling.firstChild,"innerHTML"))}},onMouseOut:function(d,c){return;var b=offsetBox(d.parentNode);var a=pointerX(c),e=pointerY(c);if(a>b[0]&&a<b[0]+b[2]&&e>b[1]&&e<b[1]+b[3]){return}if(d.mouseOutTimeout){clearTimeout(d.mouseOutTimeout)}d.labelTimeout=setTimeout(Slider._mouseOutTimeout.bind(Slider,d),Slider.showLabelDelay)},_mouseOutTimeout:function(a){_s(a.nextSibling.nextSibling.style,"zIndex","");Tooltip.hide()},grabHandle:function(c,b){var a=c.parentNode.parentNode.firstChild;if(Slider.isDisabled(a)){return}if(!Slider.active||Slider.active.slider!=a){c.parentNode.parentNode.focus();if(!Slider.active||Slider.active.slider!=a){c.parentNode.parentNode.onfocus()}}else{Slider._updateValueProps(Slider.active)}var d=Slider.active.handles.indexOf_(c);if(Slider.active.activeHandle!=d){_r(Slider.active.handles[Slider.active.activeHandle],"className",RX.cls.active,"");_a(Slider.active.handles[d],"className"," active");Slider.active.activeHandle=d}Slider.active.mouse=pointerX(b);Slider.active.startPercent=Slider.active.valuesP[Slider.active.activeHandle]/100;document.body.onmousemove=Slider.documentMouseMove;stopEvt(b)},release:function(){delete Slider.active.mouse;delete Slider.active.startPercent;document.body.onmousemove=null},documentMouseMove:function(){var c=arguments&&arguments[0]||event,b;var a=pointerX(c);if(typeof Slider.active.mouse!="number"){Slider.release();return}var d=(Slider.active.startPercent+(a-Slider.active.mouse)/Slider.active.length)*Slider.active.visibleP;if(d<0){d=0}else{if(d>Slider.active.visibleP){d=Slider.active.visibleP}}if(Slider.active.under){d-=10}if(d<=-Slider.margin/2&&Slider.active.under){d="under"}else{if(d>=100+Slider.margin/2&&Slider.active.over){d="over"}else{if(d<=0){d=Slider.active.min}else{if(d>=100){d=Slider.active.max}else{d=Slider.active.min+(Slider.active.max-Slider.active.min)*d/100;d=(d+0.5)|0}}}}Slider._setValue(Slider.active,d,Slider.active.activeHandle)},handleKey:function(b){var a=b.charCode||b.keyCode;if(Slider.ignoreNextKey){Slider.ignoreNextKey=false;return}as(Slider.active);if(Slider.isDisabled(Slider.active.slider)&&a!=9){return}var c=Slider.active.values[Slider.active.activeHandle],d=null;switch(a){case 37:if(c!="under"){if(c=="over"){d=Slider.active.max}else{if(c-0>Slider.active.min){d=c-1}else{if(Slider.active.under&&c!="under"){d="under"}}}}break;case 39:if(c!="over"){if(c=="under"){d=Slider.active.min}else{if(c<Slider.active.max){d=c-0+1}else{if(Slider.active.over&&c!="over"){d="over"}}}}break;case 36:if(Slider.active.under){if(c!="under"){d="under"}}else{if(c!=Slider.active.min){d=Slider.active.min}}break;case 35:if(Slider.active.over){if(c!="over"){d="over"}}else{if(c!=Slider.active.max){d=Slider.active.max}}break;case 34:if(c!="under"){var e=null;if(c=="over"){e=Slider.active.max-Slider.jumpDistance+1}else{e=c-Slider.jumpDistance}e=e|0;if(e<Slider.active.min){if(Slider.active.under&&e<=Slider.active.min-Slider.jumpDistance/2){e="under"}else{e=Slider.active.min}}d=e}break;case 33:if(c!="over"){var e=null;if(c=="under"){e=Slider.active.min-0+Slider.jumpDistance-1}else{e=c-0+Slider.jumpDistance}e=e|0;if(e>Slider.active.max){if(Slider.active.over&&e>=Slider.active.max+Slider.jumpDistance/2){e="over"}else{e=Slider.active.max}}d=e}break;case 9:if(!b.shiftKey){if(Slider.active.activeHandle<Slider.active.values.length-1){_r(Slider.active.handles[Slider.active.activeHandle],"className",RX.cls.active,"");Slider.active.activeHandle++;_a(Slider.active.handles[Slider.active.activeHandle],"className"," active")}else{return}}else{if(Slider.active.activeHandle){_r(Slider.active.handles[Slider.active.activeHandle],"className",RX.cls.active,"");Slider.active.activeHandle--;_a(Slider.active.handles[Slider.active.activeHandle],"className"," active")}else{return}}break;default:return}if(d!=null){Slider._setValue(Slider.active,d,Slider.active.activeHandle)}stopEvt(b);return false},trySetValue:function(d,e){if(typeof d=="string"){d=$_(d)}e=e.split(RX.other.intervalDash);var c=(Slider.active&&Slider.active.slider==d)?Slider.active:Slider.getProperties(d);for(var b=0;b<e.length;b++){if(c.under&&(e[b]==c.under||e[b]=="under")){e[b]="under"}else{if(c.over&&(e[b]==c.over||e[b]=="over")){e[b]="over"}else{if(c.formatter.reverse){e[b]=c.formatter.reverse(e[b])}else{if(RX.general.natural.test(e[b])){e[b]=e[b]-0}else{throwError('Unable to understand slider value "'+ +e[b]+'"')}}}}e[b]=Slider.limitValue(e[b],c.min,c.max,c.under,c.over)}var a=e[e.length-1];while(e.length<c.values.length){e.push(a)}_sC(c.label,"value",c.label.oldValue);for(var b=0;b<c.values.length;b++){Slider._setValue(c,e[b],b)}},setValue:function(b,d,c){as(b||Slider.active,"Slider.setValue: No active slider. Hello?");var a=(!b||(Slider.active&&b==b.active.slider))?Slider.active:Slider.getProperties(b);d=Slider.limitValue(d,a.min,a.max,a.under,a.over);Slider._setValue(a,d,c?c:0)},_setValue:function(a,c,b){switch(c){case"under":for(i=0;i<=b;i++){if(a.values[i]!="under"){Slider._setOneValue(a,"under",i)}}break;case"over":for(i=a.values.length-1;i>=b;i--){if(a.values[i]!="over"){Slider._setOneValue(a,"over",i)}}break;default:for(i=0;i<b;i++){if(a.values[i]!="under"&&a.values[i]>c){Slider._setOneValue(a,c,i)}}for(i=a.values.length-1;i>b;i--){if(a.values[i]!="over"&&a.values[i]<c){Slider._setOneValue(a,c,i)}}Slider._setOneValue(a,c,b)}if(a.slider.onchange){a.slider.onchange()}},_setOneValue:function(c,e,d){if(c.values[d]==String(e)){return}var a=_g(c.label,"value").split(RX.other.intervalDash);a[d]=c.formatter(e=="under"?c.under:e=="over"?c.over:e);a=a.join(" \u2013 ");_s(c.label,"value",a);c.values[d]=String(e);_s(c.slider,"value",c.values.join(" \u2013 "));var b=Slider.getPosition(e,c.min,c.max,c.under,c.over);_s(c.handles[d].style,"left",b+"%");if(Tooltip.lastBind==c.handles[0]||Tooltip.lastBind==c.handles[0].parentNode){UI.afterApplyOnce.push(Slider._updateTooltip.bind(Slider,a,c))}},getValue:function(a){return _g(a,"value")},getValues:function(a){return _g(a,"value").split(RX.other.intervalDash)},getMin:function(a){return Slider.getProperties(a).min},_updateTooltip:function(a,b){if(Tooltip.lastBind==b.handles[0]){Tooltip.updateText(a);Tooltip.updatePosition(b.handles[0])}else{if(Tooltip.lastBind==b.handles[0].parentNode){Tooltip.updateText(a)}}},isDisabled:function(a){return RX.cls.disabled.test(_g(a.parentNode,"className"))},disable:function(a){_a(a.parentNode,"className"," disabled")},enable:function(a){_r(a.parentNode,"className",RX.cls.disabled,"")},setMaxValue:function(d,e){var c=Slider.getProperties(d);var b=c.max;if(c.max==e){return}d.setAttribute("max",e);c.max=e;for(var a=0;a<c.values.length;a++){var f=c.values[a]-0;f=f==b?e:Math.min(f,e);c.values[a]="";Slider._setValue(c,f,a)}},langSetUnder:function(a,d,b){var c;if(c=document.getElementById(a)){if(_g(c,"value").indexOf("under")>-1){var d=_g(c,"value").replace(RX.other.underg,d);if(d.indexOf("over")>-1){d=d.replace(RX.other.overg,c.getAttribute("over"))}_s(c.nextSibling.nextSibling.firstChild,"innerHTML",d)}c.setAttribute("under",d)}else{as(windows[b]);var e=new RegExp('(<aj:slider\\s*id="'+a+'"[^>]*?under=")[^"]*?"');windows[b]=windows[b].replace(e,"$1"+d+'"')}},langSetOver:function(a,d,b){var c;if(c=document.getElementById(a)){if(_g(c,"value").indexOf("over")>-1){var d=_g(c,"value").replace(RX.other.overg,d);if(d.indexOf("under")>-1){d=d.replace(RX.other.underg,c.getAttribute("under"))}_s(c.nextSibling.nextSibling.firstChild,"innerHTML",d)}c.setAttribute("over",d)}else{as(windows[b]);var e=new RegExp('(<aj:slider\\s*id="'+a+'"[^>]*?over=")[^"]*?"');windows[b]=windows[b].replace(e,"$1"+d+'"')}}};var Graph={eomGraph:null,eomGraphCtx:null,fullGraph:null,fullGraphCtx:null,initialized:false,init:function(){as(!Graph.initialized,"Graph already initialized!");Graph.initialized=true;Graph.eomGraph=document.createElement("canvas");Graph.eomGraph.id="eomGraph";Graph.eomGraph.setAttribute("width",variables.eomGraphWidth);Graph.eomGraph.setAttribute("height",variables.eomGraphHeight);if(isIE){Graph.eomGraph=G_vmlCanvasManager.initElement(Graph.eomGraph)}Graph.eomGraphCtx=Graph.eomGraph.getContext("2d");Graph.eomGraph.onclick=Graph.clicked;_an(document.getElementById("eomGraphHolder"),Graph.eomGraph);Graph.fullGraph=document.createElement("canvas");Graph.fullGraph.setAttribute("width",document.documentElement.offsetWidth);Graph.fullGraph.setAttribute("height",document.documentElement.offsetHeight);if(isIE){Graph.fullGraph=G_vmlCanvasManager.initElement(Graph.fullGraph)}Graph.fullGraphCtx=Graph.fullGraph.getContext("2d");Graph.fullGraph.onclick=Graph.clicked;_s(Graph.fullGraph.style,"display","none");_s(Graph.fullGraph.style,"position","fixed");_s(Graph.fullGraph.style,"top","0px");_s(Graph.fullGraph.style,"left","0px");_an(document.body,Graph.fullGraph);if(!Graph.eomGraphCtx.fillText&&Graph.eomGraphCtx.mozDrawText){Graph.eomGraphCtx.fillText=Graph.deprecatedFF30DrawText}},clicked:function(){var b=this;if(b===Graph.fullGraph){_s(Graph.fullGraph.style,"display","none")}else{if(b===Graph.eomGraph){var a=document.documentElement.offsetWidth;var c=document.documentElement.offsetHeight;Graph.fullGraph.setAttribute("width",a);Graph.fullGraph.setAttribute("height",c);_s(Graph.fullGraph.style,"width",a+"px");_s(Graph.fullGraph.style,"height",c+"px");_s(Graph.fullGraph.style,"display","");Graph.drawEomGraph(true)}}},deprecatedFF30DrawText:function(d,b,e){this.mozTextStyle=this.font;if(this.textAlign=="right"){var c=this.mozMeasureText(d);b-=c}else{if(this.textAlign=="middle"){var c=this.mozMeasureText(d);b-=c/2}}if(this.textBaseline=="middle"){var a=parseFloat(this.font);e+=a/2}else{if(this.textBaseline!="bottom"&&this.textBaseline!="alphabetic"){var a=parseFloat(this.font);e+=a}}this.translate(b,e);this.mozDrawText(d);this.translate(-b,-e)},drawEomGraph:function(D){var w=50;var N=50;var f=10;var aa=2;var g=30;var l=30;var am=15;var v=18;var b="Calibri, Verdana, Tahoma, Arial, sans-serif";var I=1.2;var J=2;var ae=4;var R=5;var k=v;var P=v*2;var z=v/2;var Y=D?Graph.fullGraph:Graph.eomGraph;var A=D?Graph.fullGraphCtx:Graph.eomGraphCtx;if(isIE){Y.firstChild.style.width=getStyle(Y).width;Y.firstChild.style.height=getStyle(Y).height}var U=Y.getAttribute("width")-0;var ai=Y.getAttribute("height")-0;var ar=U-w-aa;var e=ai-N-f;var ao=currentRoom.scoreHistory.scores;var C=ae;var al,ak;for(al=0;al<ao.length;al++){for(ak=0;ak<ao[al].length;ak++){if(typeof ao[al][ak]=="number"&&ao[al][ak]>C){C=ao[al][ak]}}}var X=1;while(C>10){C=C/10;X*=10}C=(C==(C|0))?C:((C+1)|0);C*=X;var u=(ar/(ao.length-1))|0;var p=u*ao.length;var ag=C?e/C:ai;var H=C/ae;var af=H/R;A.save();if(!D){A.clearRect(0,0,U,ai)}else{A.fillStyle="#F0F0F0";A.fillRect(0,0,U,ai)}A.textBaseline="middle";var M=[];A.lineWidth=1;A.strokeStyle="Black";A.beginPath();A.moveTo(w,f);A.lineTo(w,f+e);A.lineTo(w+ar,f+e);A.stroke();A.font=am+"px "+b;A.textAlign="right";var L=af;for(al=1;L<C+0.1;al++){var V=f+e-L*ag;A.beginPath();A.moveTo(w,V);if(al%R){A.lineTo(w-5,V)}else{A.lineTo(w-10,V)}A.stroke();if(!(al%R)){A.strokeStyle="rgba(0,0,0,0.3)";A.beginPath();A.moveTo(w,V);A.lineTo(w+ar,V);A.stroke();A.strokeStyle="Black";A.fillText(Math.round(L),w-am,V)}L+=af}for(al=0;al<ao.length;al++){M.push(w+al*u);if(al){A.beginPath();A.moveTo(M[al],f+e);A.lineTo(M[al],f+e+5);A.stroke()}}A.lineWidth=3;A.textAlign="left";var ad=[],aq=[],d=[],ac=[];for(al=0;al<currentRoom.scoreHistory.usernames.length;al++){aq[al]=0;for(ak=0;ak<ao.length;ak++){if(ao[ak][al]>aq[al]){aq[al]=ao[ak][al]}}ak=0;while(ak<ad.length&&aq[ad[ak]]>=aq[al]){ak++}ad.splice(ak,0,al)}for(al=0;al<ad.length;al++){d[ad[al]]=al}var aj=function(aw,x,y,ay){var ax=x+". "+currentRoom.scoreHistory.userInfo[currentRoom.scoreHistory.indexByUser[y]].displayedUsername+" ("+ay+" "+Strings.points.more;if(currentRoom.roomInfo.bet&&typeof currentRoom.indexByUser[y]==="number"){ax+=", "+Util.printMoney(currentRoom.users[currentRoom.indexByUser[y]].winnings)}ax+=")";ac[aw]=ax};var T=[],F=0,K=1,ab=aq[0];if(!D){for(var al=0;al<ad.length&&aq[ad[al]]&&(al<3||aq[ad[al]]===aq[ad[al-1]]);al++){if(aq[ad[al]]!=ab){K=al+1;ab=aq[ad[al]]}T[ad[al]]=true;aj(ad[al],K,currentRoom.scoreHistory.usernames[ad[al]],ab);F++}}else{for(var al=0;al<ad.length;al++){if(aq[ad[al]]){if(aq[ad[al]]!=ab){K=al+1;ab=aq[ad[al]]}T[ad[al]]=true;aj(ad[al],K,currentRoom.scoreHistory.usernames[ad[al]],ab);F++}}}if(!T[currentRoom.scoreHistory.indexByUser[AJ.username]]){var an=currentRoom.scoreHistory.indexByUser[AJ.username];T[an]=true;if(aq[an]!=ab){K=d[an];while(K&&aq[ad[K]]==aq[ad[K-1]]){K--}K++;ab=aq[an]}d[an]=F;ad[F]=an;aj(an,K,currentRoom.scoreHistory.usernames[an],ab)}A.font=v+"px "+b;for(al=currentRoom.scoreHistory.usernames.length-1;al>=0;al--){if(T[al]){A.strokeStyle=A.fillStyle=currentRoom.scoreHistory.userInfo[al].userColor;var B=w+g+l;A.beginPath();var V=(d[al]+1.5)*I*v;A.moveTo(w+g,V);A.lineTo(B,V);A.stroke();var h=currentRoom.scoreHistory.userInfo[al].avatarImage;if(h.height&&h.width){var t=k,E=k;if(h.heigth>h.width){t=k/h.height*h.width}else{E=k/h.width*h.height}A.drawImage(h,B+z,V-z,t,E)}A.fillText(ac[al],B+P,V)}}A.lineWidth=J;var Z=4;var O=u/Z;for(var al=ad.length-1;al>=0;al--){if(T[al]){A.strokeStyle=currentRoom.scoreHistory.userInfo[al].userColor;if(currentRoom.scoreHistory.usernames[al]===AJ.username){A.lineWidth=J*2}var c=[];for(var ak=0;ak<ao.length;ak++){c[ak]=typeof ao[ak][al]==="number"?f+e-ao[ak][al]*ag:null}c.push(null);var ah=false,S=null,Q=null,a=null;for(var ak=0;ak<ao.length;ak++){if(typeof ao[ak][al]==="number"){var W=M[ak],V=c[ak];if(ah){var n=c[ak]-c[ak-1];var G=c[ak+1]!==null?c[ak+1]-c[ak]:n;var ap=a!==null?a:n;var au=Math.max(n*2,G);var r=M[ak-1]+O;var av=c[ak-1]+ap/Z;var q=W-O;var at=V-au/Z;a=au;A.bezierCurveTo(r,av,q,at,W,V)}else{if(c[ak+1]!==null){ah=true;A.beginPath();A.moveTo(W,V)}else{A.strokeRect(W-1,V-1,3,3)}}}else{if(ah){ah=false;a=null;A.stroke()}}}if(ah){ah=false;a=null;A.stroke()}if(currentRoom.scoreHistory.usernames[al]===AJ.username){A.lineWidth=J}}}A.restore()}};var PlayZone={mapDebugQuestion:{q:"Click a shape to have it's index written in the chat.",t:5,k:["debug"],mId:-1,l:0},displayedQ:null,isGame:function(){return !PlayZone.displayedQ||PlayZone.displayedQ==Quiz.q},isMapDebug:function(){return PlayZone.displayedQ==PlayZone.mapDebugQuestion},isPreview:function(){return PlayZone.displayedQ==Questions.q},showMessage:function(a,b){_s($.gameMessage,"innerHTML",(a?'<img style="margin: 5px" src="icons/ajax-loader.gif" class="load" alt="'+Strings.loadingAlt+'"/>':"")+b);UI.afterApplyOnce.push(Chat.updateHeight);PlayZone.paint()},showQuestion:function(a){PlayZone.displayedQ=a;if(a.t==3||a.t==4){Field.empty($.ansText)}_sC($.returnToGame.style,"display",a!=Quiz.q?"":"none");PlayZone.paint()},newGameQuestion:function(b,a){if(PlayZone.displayedQ==a){PlayZone.showQuestion(b)}else{_sC($.gameMessage.style,"display","none")}Map.clearHighlight()},showMapDebug:function(){PlayZone.lastPaintState=null;PlayZone.showQuestion(PlayZone.mapDebugQuestion);if(variables.currentWindow!="play"){Window.show("play")}},returnToGame:function(){PlayZone.displayedQ=Quiz.q||null;if(Quiz.q&&(Quiz.q.t==3||Quiz.q.t==4)){Field.empty($.ansText)}_sC($.returnToGame.style,"display","none");_sC($.addQfromPreview.style,"display","none");PlayZone.paint()},lastPaintQ:null,lastPaintState:null,paint:function(a){if(!a&&variables.currentWindow!="play"){return}if(!UI.beforeApplyOnce.contains(PlayZone._paint)){UI.beforeApplyOnce.push(PlayZone._paint);if(!UI.timer){UI.scheduleTimer()}}},_paint:function(){var b;var a=PlayZone.displayedQ;if(!PlayZone.displayedQ){if(!currentRoom){b=-3}else{if(currentRoom.roomInfo.lobby){b=-2}else{b=-1}}}else{if(!PlayZone.isGame()){b=0}else{if(question.EOM&&question.EOM!="wait"){b=3}else{if(typeof question.rightAnswer!="undefined"){b=2}else{if(lastAnswer!=null){b=1}else{if(question){b=0}else{throwError("PlayZone.paint: unable to determine state")}}}}}}if(PlayZone.lastPaintQ==a&&PlayZone.lastPaintState==b){return}PlayZone.lastPaintQ=a;PlayZone.lastPaintState=b;_sC($.gameMessage.style,"display",(b<0||!Quiz.q)?"":"none");PlayZone._visibleState(b,a&&a.t);if(b==3){PlayZone._paintEOM();Map.tryHide()}else{if(b>=0){PlayZone._paintQuestion(a,b);if(b>0){PlayZone._paintBreak(a,b)}}else{Map.tryHide()}}},_paintEOM:function(){},_paintQuestion:function(d,c){var b=null;if(c>0&&d!=question.srvObj){throwError("PlayZone._paintQuestion: question-pointer inconsistency detected")}if(PlayZone["_paintAnswers"+d.t]){b=PlayZone["_paintAnswers"+d.t](d,c)}_s($.qtext,"innerHTML",(PlayZone.isGame?question.position+'<span class="count">/'+currentRoom.roomInfo.questionCount+"</span>: ":"")+d.q);var a=d.im?Util.getQuestionImagePath(d.im):(d.t<5?Util.getImageForTags(d.k):"");_s($.qimage,"src",a);_sC($.qimage.style,"display",a?"":"none");_r($.question_outer,"className",RX.cls.no_ads,d.im&&d.im.substring(0,4)=="ads/"?"ads":"noads");_sC($.proximity.style,"display",(typeof d.tn==="number")?"inline-block":"none");_s($.proximity,"innerHTML",(typeof d.tn==="number")?Util.sprintf(Strings.qProximity,d.tn):"");LanguageList.setLang($.qLang,languages.codeFromId[d.l]);TagList.setValue($.qKeywords,d.k);UI.afterApplyOnce.push(Chat.updateHeight);if(b&&!Field.activeElem){UI.toFocus=b}if(d.t==5){Map.tryShow()}else{Map.tryHide()}if(typeof d.mId!="undefined"){if(constants.maps[d.mId]){Map.setMap(constants.maps[d.mId]);Map.drawMap()}else{if(Map.map.length){Map.empty()}}}},_paintAnswers0:function(a,b){var h,p,k="",c=a.a?a.a.length:-1,r=0,f=[],l=[];var e=PlayZone.isGame()?variables.currentAnswer:null;var d=PlayZone.isGame()?[question.rightAnswer]||[]:PlayZone.isPreview()?a.ra.map(function(t,q){return a.a.indexOf(t)+1}):[];var n=[];var g=!!b;for(h=a.a.length-1;h>=0;h--){l[h]='<span class="hotkey">'+(h+1)+"</span>"+a.a[h];f[h]=b>=2?(n[h]=d.contains(h+1))?"rightAnswer":"wrongAnswer":"";if(b){if(f[h]){f[h]+=" "}f[h]+="disabled";if(e==h){f[h]+=" userAnswer"}}}for(h=0;h<c&&(p=document.getElementById("ab"+h));h++){r++;_ra(p,"className",RX.other.duArAwAg," "+f[h]);Button.getButtonObject(p).disabled=g;_sC(p.style,"height","");_sC(p,"innerHTML",l[h]);if(n[h]){Button.startHighlight(p,"rightAnswer")}else{Button.stopHighlight(p)}if(b){Button.mouseout(p)}}for(h=c;p=document.getElementById("ab"+h);h++){Button.stopHighlight(p);_o(p)}for(h=r;h<c;h++){k+='<aj:button id="ab'+h+'" class="'+f[h]+" answer"+h+'" action="Quiz.answer('+h+');">'+l[h]+"</aj:button>"}if(k){k=HTML.parse(k,{button:true});_i($.answerButtons,"beforeEnd",k);UI.afterApplyOnce.push(function(){for(h=r;h<c;h++){if(n[h]){Button.startHighlight(document.getElementById("ab"+h),"rightAnswer")}}})}return document.getElementById("ab0")||"ab0"},_paintAnswers1:function(a,b){var g,n,h="",c=a.a.length,p=0,f=[],k=[];var e=PlayZone.isGame()?variables.currentAnswer:[];var d=PlayZone.isGame()?question.rightAnswer||[]:PlayZone.isPreview()?a.ra.map(function(r,q){return a.a.indexOf(r)+1}):[];var l=[];for(g=c-1;g>=0;g--){k[g]='<span class="hotkey">'+(g+1)+"</span>"+a.a[g];f[g]=b>=2?(l[g]=d.contains(g+1))?"rightAnswer":"wrongAnswer":"";if(b){if(f[g]){f[g]+=" "}f[g]+="disabled";if(e.contains(g)){f[g]+=" checked userAnswer"}}}for(g=0;g<c&&(n=document.getElementById("cb"+g));g++){p++;_ra(n,"className",RX.other.cduArAwAg," "+f[g]);delete n.checkboxObject;_sC(n.style,"height","");_sC(Checkbox.getTextNode(n),"innerHTML",k[g]);if(l[g]){Button.startHighlight(n,"rightAnswer")}else{Button.stopHighlight(n)}if(b){Checkbox.mouseout(n)}}_ra($.checkboxSubmit,"className",RX.cls.disabled,b==0?"":" disabled");for(g=c;n=document.getElementById("cb"+g);g++){Button.stopHighlight(n);_o(n)}for(g=p;g<c;g++){h+='<aj:checkbox id="cb'+g+'" action="if (Checkbox.isChecked(this)) { if (PlayZone.isGame()) variables.currentAnswer.push('+g+"); _a(this, 'className', ' userAnswer'); } else { if (PlayZone.isGame()) variables.currentAnswer.splice(variables.currentAnswer.indexOf("+g+"), 1); _r(this, 'className', /userAnswer/, ''); }\" class=\""+f[g]+" answer"+g+'">'+k[g]+"</aj:checkbox>"}if(h){h=HTML.parse(h,{checkbox:true});_i($.answerCheckboxesHolder,"beforeEnd",h);UI.afterApplyOnce.push(function(){for(g=p;g<c;g++){if(l[g]){Button.startHighlight(document.getElementById("cb"+g),"rightAnswer")}}})}if(b==0){Button.startHighlight($.checkboxSubmit)}else{Button.stopHighlight($.checkboxSubmit)}return document.getElementById("cb0")||"cb0"},_paintAnswers2:function(n,d){var v="",g="",y,e=false,h=[],x=[],l=[],c=n.a.length;var f=d==0?"":"disabled";var a=d==0?"":" disabled";var b=PlayZone.isGame()?variables.currentAnswer:[];for(y=0;y<n.a.length;y++){x[y]='<span class="hotkey">'+(y+1)+"</span>"+n.a[y];h[y]='<aj:button id="sb'+y+'" class="'+f+'" action="Quiz.sortBtnClick(this);">'+x[y]+"</aj:button>"}var t=$A($.sorted.childNodes),z=0,r=b[0],w=[],u=[],k;for(y=0;y<t.length;y++){var p=t[y].id.match(RX.other.sbD)[1]-0;if(p>=n.a.length){_o(t[y])}else{if(!b.contains(p)){_an($.sortButtonsHolder,t[y]);_sC(t[y],"innerHTML",x[p]);_ra(t[y],"className",RX.cls.disabled,a);l[p]=true}else{if(p==r){_sC(t[y],"innerHTML",x[p]);_ra(t[y],"className",RX.cls.disabled,a);l[p]=true;z++;r=b[z]}else{w.push(t[y]);u.push(p)}}}}t=$A($.sortButtonsHolder.childNodes);for(y=0;y<t.length;y++){var p=t[y].id.match(RX.other.sbD)[1]-0;if(p>=n.a.length){_o(t[y])}else{if(!b.contains(p)){_sC(t[y],"innerHTML",x[p]);_ra(t[y],"className",RX.cls.disabled,a);l[p]=true}else{w.push(t[y]);u.push(p)}}}while(typeof r=="number"){if((k=u.indexOf(r))>-1&&!e){_an($.sorted,w[k]);_sC(w[k],"innerHTML",x[r]);_ra(w[k],"className",RX.cls.disabled,a)}else{e=true;if(k>-1){_o(w[k])}v+=h[r]}l[r]=true;z++;r=b[z]}_ra($.sortSubmit,"className",RX.cls.disabled,d==0?"":" disabled");for(y=0;y<c;y++){if(!l[y]){g+=h[y]}}_sC($.sortSubmit.style,"display",b.length==n.a.length?"":"none");if(v){_i($.sorted,"beforeEnd",HTML.parse(v,{button:true}))}if(g){_i($.sortButtonsHolder,"beforeEnd",HTML.parse(g,{button:true}))}return document.getElementById("sb0")||"sb0"},_paintAnswers3:function(b,a){$.ansText._maxLength=b.m.length;_ra($.btnText,"className",RX.cls.disabled,a==0?"":" disabled");if(a==0){Field.enable($.ansText)}else{Field.disable($.ansText)}_sC($.ansHint,"innerHTML",makeAnswerMask(b.m,Field.value($.ansText)));return $.ansText},_paintAnswers4:function(b,a){$.ansText._maxLength=100;_ra($.btnText,"className",RX.cls.disabled,a==0?"":" disabled");if(a==0){Field.enable($.ansText);Button.startHighlight($.btnText)}else{Field.disable($.ansText);Button.stopHighlight($.btnText)}return $.ansText},_paintBreak:function(b,a){},_visibleState:function(b,a){_sC($_("startGameArea").style,"display",b==-2?"":"none");_sC($.questionAnswers.style,"display",(b>=0&&b<=2)?"":"none");_sC($.qKeywords.parentNode.style,"display",b<0?"none":"");_sC($.waitBreak.style,"display",b>0?"":"none");_sC($.waitBreakInter.style,"display",(b==1||b==2)?"":"none");_sC($.waitBreakState.style,"display",b==2?"":"none");_sC($.waitShowMore.style,"display",b==2&&question.info?"":"none");_sC($.waitBreakEOM.style,"display",b==3?"":"none");_sC($.eomPaidGameMessage.style,"display",b==3&&currentRoom.roomInfo.bet?"":"none");var c=b>=0&&b<3;_sC($.answerButtons.style,"display",(c&&a==0)?"":"none");_sC($.answerCheckboxes.style,"display",(c&&a==1)?"":"none");_sC($.sortButtons.style,"display",(c&&a==2)?"":"none");_sC($.textAnswer.style,"display",(c&&(a==3||a==4))?"":"none");_sC($.ansHint.style,"display",a==3?"":"none");_sC($.dontKnowDiv.style,"visibility",b==0?"":"hidden");_sC($.tagsContainer.style,"display",(b>=0&&b<3)?"":"none");var d="";switch(b){case 0:d=Strings.timerAnswer;break;case 1:d=Strings.timerWaitAnswer;break;case 2:d=(variables.wasEOMbefore?Strings.timerEOM:Strings.timerNextQuestion);break;case 3:if(!currentRoom.roomInfo.bet){d=Strings.timerNextRound}break}_s($.timerMessage,"innerHTML",d)},updateGameQuestionMask:function(a){if(PlayZone.isGame()){PlayZone.lastState=null;PlayZone.paint()}}};var ButtonList={stockButtonPre:'<aj:button class="empty" action="ButtonList.action(this);">',stockButtonNotEmptyPre:'<aj:button action="ButtonList.action(this);">',stockButtonPost:"</aj:button>",focusedBtn:null,ignoreNextGlobalClick:false,setup:function(a){if(!features.editing){$[a.id]=a;return}var b='<div class="buttonList">'+HTML.parse(ButtonList.stockButtonPre+Strings.buttonAddInvite+ButtonList.stockButtonPost,{button:true})+"</div>";_i(a,"afterEnd",b);UI.afterApplyOnce.push(ButtonList._setupUI.bind(ButtonList,a))},_setupUI:function(c){_o(c);var d=c.id;c=c.nextSibling;_s(c,"id",d);$[d]=c;var a=$A(c.childNodes);for(var b=0;b<a.length;b++){ButtonList._setupBtn(a[b])}},_setupBtn:function(a){a.contentEditable=true;a.checkEmpty=ButtonList._checkEmpty.bind(ButtonList,a);a.onmousedown=null;a.onmouseup=null;_r(a,"className",RX.cls.unselectable,"editable");a.onkeydown=ButtonList.buttonKeyDown;a.onkeyup=ButtonList.buttonKeyUp;a.onfocus=ButtonList.buttonFocus;a.onblur=ButtonList.buttonBlur;a.onclick=ButtonList.buttonClick},globalClick:function(a){if(ButtonList.ignoreNextGlobalClick){ButtonList.ignoreNextGlobalClick=false}else{if(ButtonList.focusedBtn){ButtonList.focusedBtn.onblur(a)}}},setValue:function(f,g){if(f.tagName.toLowerCase()=="textarea"){_s(f,"value",g.join("\n"));return}var a=$A(f.childNodes);a.pop();var d,h=a.length,k=g.length;var e="",b=0;if(f.updatingButtonList){for(d=0;d<h;d++){_oC(a[d])}_ci(f.lastChild,"beforeBegin");h=0;d=0}else{for(d=k;d<h;d++){_o(a[d])}for(d=0;d<k&&d<h;d++){Button.setText(a[d],g[d])}}b=k-d;for(;d<k;d++){e+=ButtonList.stockButtonNotEmptyPre+g[d]+ButtonList.stockButtonPost}var c=f.updatingButtonList={};if(e){_i(f.lastChild,"beforeBegin",HTML.parse(e,{button:true}));UI.afterApplyOnce.push(function(){if(f.updatingButtonList!=c){return}delete f.updatingButtonList;var l=f.lastChild;while(b){b--;l=l.previousSibling;ButtonList._setupBtn(l)}})}else{UI.afterApplyOnce.push(function(){if(f.updatingButtonList!=c){return}delete f.updatingButtonList})}},getValue:function(e){if(e.tagName.toLowerCase()=="textarea"){var f=_g(e,"value").trim();return f?f.split("\n"):[]}var c=[],b=$A(e.childNodes);for(var d=0,a=b.length-1;d<a;d++){c.push(Button.getText(b[d]).stripTags())}return c},buttonClick:function(a){if(!a){a=window.event}ButtonList.ignoreNextGlobalClick=true;this.onfocus(a)},_checkEmpty:function(b,h){var g=b.innerHTML;var f=RX.cls.empty.test(_g(b,"className"))||!g;var c=g.split(RX.other.newLineWhatever).compact();var l=false;if(!f&&c.length>1){var a=!h&&Util.getSelection(b);var k=g.stripTags().length;g=c.pop();var e="";for(var d=0;d<c.length;d++){e+=ButtonList.stockButtonNotEmptyPre+c[d]+ButtonList.stockButtonPost}_i(b,"beforeBegin",HTML.parse(e,{button:true}));_s(b,"innerHTML",g);UI.afterApplyOnce.push(function(){var p=c.length,q=b;while(p--){b=b.previousSibling;ButtonList._setupBtn(b)}b=q;if(a&&a[0]==b){if(a[2]!=b){a[2]=b;a[3]=k}a[1]=Math.max(a[1]-k+g.length,0);a[3]=Math.max(a[3]-k+g.length,0);if(a[3]<a[1]){a[3]=a[1]}Util.setSelection.apply(Util,a)}});l=a&&a[0]==b;f=!!g}if(!b.nextSibling&&!f){_i(b,"afterEnd",HTML.parse(ButtonList.stockButtonPre+Strings.buttonAddInvite+ButtonList.stockButtonPost,{button:true}));UI.afterApplyOnce.push(function(){ButtonList._setupBtn(b.nextSibling)})}if(b.nextSibling&&f&&RX.cls.empty.test(_g(b.nextSibling,"className"))){console.log("_checkEmpty: removing nextSibling (AddInvite)");_oC(b.nextSibling)}if(l){UI._apply(12)}b.checkScheduled=false},buttonFocus:function(b){if(!b){b=window.event}var a=this;if(ButtonList.focusedBtn){ButtonList.focusedBtn.onblur(b)}if(RX.cls.empty.test(_g(a,"className"))){if(!UI.timer){a.className=a.className.replace(RX.cls.empty,"");a.innerHTML=""}else{_r(a,"className",RX.cls.empty,"");_s(a,"innerHTML","");UI._apply(27)}}ButtonList.focusedBtn=a},buttonBlur:function(d){if(!d){d=window.event}var c=this;if(!c.parentNode.updatingButtonList){ButtonList._checkEmpty(c,true);var a=_g(c,"innerHTML");var b=a&&a.stripTags();if(b!=a){a=b;_s(c,"innerHTML",a)}if(!a){if(c.nextSibling&&!_io(c.nextSibling)){_o(c)}else{_ci(c,"afterEnd");_a(c,"className"," empty");_s(c,"innerHTML",Strings.buttonAddInvite)}}}if(ButtonList.focusedBtn==c){ButtonList.focusedBtn=null}},buttonKeyDown:function(c){if(!c){c=window.event}var b=this;var a=c.charCode||c.keyCode;switch(a){case 9:if(ButtonList.focusedBtn==b){b.onblur(c)}break;case 13:if(b.nextSibling&&b.nextSibling){b.nextSibling.focus();if(ButtonList.focusedBtn!=b.nextSibling){b.nextSibling.onfocus()}}break;case 38:if(b.previousSibling){stopEvt(c);return false}break;case 40:if(b.previousSibling){stopEvt(c);return false}break}if(!b.checkScheduled){setTimeout(b.checkEmpty,10);b.checkScheduled=true}},buttonKeyUp:function(c){if(!c){c=window.event}var b=this;var a=c.charCode||c.keyCode;if(a==9&&ButtonList.focusedBtn!=b){b.onfocus(c)}}};var Merchants={providers:{MoneyBookers:{stage2:{pay_to_email:"moneybookersdev1@sabou.org",recipient_description:constants.appName,transaction_id:"$TransactionID;",return_url:"http://"+location.host+"/appFeedback.html#payed:$TransactionID;",return_url_target:3,cancel_url:"http://"+location.host+"/appFeedback.html#cancelPayment:$TransactionID;",cancel_url_target:3,status_url:"http://"+location.host+"/moneybookers_status",status_url2:"echipa@"+constants.appDomain,language:"$Language;",hide_login:1,merchant_fields:"AJ_Username",AJ_Username:"$Username;",firstname:"$FirstName;",lastname:"$LastName;",date_of_birth:"$BirthDate;",state:"$State;",country:"$Country;",amount:"$PayAmount;",currency:"$PayCurrency;"},fixedTax:29,fixedTaxCurrency:"EUR",percentTax:1.9,url:"https://www.moneybookers.com/app/payment.pl",alias:"MB"},ePayment:{stage2:{PRODS:"3904206",QTY:"$PayAmount;",INFO3904206:"$Username;",LANG:"$Language;",LANGUAGES:"$Language;"},payMult:21,locationBastard:true,percentTax:5.36,url:"https://secure.epayment.ro/order/checkout.php",formMethod:"GET",alias:"EP"},MobilPay:{stage1:{y:"mpay",t:"SMS$PayAmount;E",u:"$Username;"},stage2:{data:"d",env_key:"k"},payMult:5,currency:"EUR",fixedTax:120,url:"http://sandboxsecure.mobilpay.ro",alias:"MP"}},safeLocation:null,init:function(){Merchants.safeLocation=typeof document.body.style.MozTransform==="string"},fillVariables:function(e,h,d,c){var a,b=0,g="";while(a=RX.other.payFormVariable.exec(e)){var f="";switch(a[1]){case"PayAmount":f=d;break;case"PayCurrency":f=c.name;break;case"TransactionID":f=h;break;case"Language":f=AJ.curLang.toUpperCase();break;case"Username":f=AJ.username;break;case"FirstName":f=Account.firstName;break;case"LastName":f=Account.surName;break;case"BirthDate":f=(Account.birthDate||"").replace(/\D/g,"");break;case"Country":f=Account.country;break;case"State":f=Account.state;break;case"Email":f=Account.email;break;default:throwError("Unknown merchant variable: "+a[1])}if(b<a.index){g+=e.substring(b,a.index)}g+=f;b=a.index+a[0].length}if(b<e.length){g+=e.substr(b)}return g},transactions:0,lastPayFromMerchant:null,paymentStage:0,payFromMerchant:function(g){var h=Merchants.providers[g];as(h,"Unknown merchant services provider: "+g);var d=$["btnMakeDeposit"+h.alias];var a=$["btnCancelDeposit"+h.alias];var c=$["btnBackDeposit"+h.alias];var f=$_("sldrDeposit"+h.alias);var e=Slider.getValue(f),b=currencies[h.currency||constants.defaultCurrency];Slider.disable(f);Button.disable(d);Button.disable(c);_sC(d.style,"display","none");_sC(a.style,"display","");Merchants.lastPayFromMerchant=g;Merchants.paymentStage=1;if(h.stage1){Merchants.goStage1(g,e*(h.payMult||1),b)}else{Merchants.goStage2(g,{amount:e,currency:b})}},goStage1:function(a,d,f){var g=Merchants.providers[a];var e=[],k=[];for(var h in g.stage1){if(!{}[h]&&h!="y"){e.push(h);k.push(g.stage1[h])}}k=Merchants.fillVariables(k.join("\0"),null,d,f).split("\0");var b=[];for(var c=0;c<e.length;c++){b.push(e[c],k[c])}Request.queue(g.stage1.y,b)},goStage2:function(d,e){var k=Merchants.providers[d];var f=Merchants.transactions++;var b=Settings.values.depositPopup||(!Merchants.safeLocation&&k.locationBastard);var p=[],n=[];for(var l in k.stage2){if(!{}[l]){p.push(l);n.push(e&&e[k.stage2[l]]||k.stage2[l])}}n=Merchants.fillVariables(n.join("\0"),f,e.amount,e.currency).split("\0");if(b&&k.formMethod!="POST"){var a=k.url;var h=a.indexOf("?")<0;if(h){a+="?"}for(var g=0;g<p.length;g++){a+=(h?(h=false)||"":"&")+p[g]+"="+encodeURIComponent(n[g])}var b=window.open(a,"AnswerJoyDeposit"+d,"");if(b){Merchants.endPayFromMerchant(d,null);return}}var c='<form id="transaction'+f+'" action="'+k.url+'" method="'+(k.formMethod||"POST")+'" target="'+(b?"_blank":"incomingPayment")+'">';for(var g=0;g<p.length;g++){c+='<input type="hidden" name="'+p[g]+'" value="'+n[g]+'" />'}c+="</form>";_i(document.body,"beforeEnd",c);UI.afterApplyOnce.push(Merchants._afterFormInjected);Merchants.paymentStage=2},_popup:null,_afterFormInjected:function(){var a=document.getElementById("transaction"+(Merchants.transactions-1));a.submit();_o(a);if(a.target=="incomingPayment"){Animate.blindDown($.incomingPayment);Merchants.paymentStage=3}else{Merchants.endPayFromMerchant(Merchants.lastPayFromMerchant,null)}},checkLoadIncoming:function(){var a=$.incomingPayment;var f="unknown page";try{f=(a.contentWindow||a.contentDocument.parentWindow).location.href||"no page"}catch(c){f="merchant page"}var d=RX.other.messagePayed.test(f);var b=RX.other.messagePayCancelled.test(f);if(d||b){Merchants.endPayFromMerchant(Merchants.lastPayFromMerchant,d)}},cancelPayFromMerchant:function(a){Merchants.endPayFromMerchant(a)},endPayFromMerchant:function(g,k){if(k!=null){Util.info(k?Strings.depositSuccess:Strings.depositCancel,Strings.accountBalance);if(k){Window.show("depositsuccess");Util.scrollTop();try{if(pageTracker){pageTracker._trackEvent("User","DepositedMoney")}}catch(f){throwError("Google Analytics failed on tracking event.",true)}}}var h=Merchants.providers[g];var c=$["btnMakeDeposit"+h.alias];var a=$["btnCancelDeposit"+h.alias];var b=$["btnBackDeposit"+h.alias];var d=$_("sldrDeposit"+h.alias);Slider.enable(d);Button.enable(c);Button.enable(b);_sC(c.style,"display","");_sC(a.style,"display","none");if(Merchants.paymentStage>=3){Animate.blindUp($.incomingPayment)}Merchants.lastPayFromMerchant=null;Merchants.paymentStage=0},payToMerchant:function(c){var b=Slider.getValue($.sldrExtractMB)*100;var a=Account.email;if(b>AJ.balance){Util.info(Util.sprintf(Strings.extractCash,b));return}var d=Merchants.providers[c];Request.payMe(b,a,c)}};var Account={firstName:null,surName:null,email:null,sex:null,birthDate:null,country:null,state:null,points:0.1,paymentHistory:[],paymentHistoryLength:0,displayedPaymentStart:-1,displayedPaymentEnd:-1,maxDisplayedPaymentSize:10,pointsAnimation:null,pointsAnimationSpeed:2,pointsAnimationActive:false,init:function(){Account.pointsAnimation=Animation.getNewAnimation(Account.animatePoints,$.pointsWon);Account.pointsAnimation.timing="liniar"},setup:function(a){Account.firstName=a&&a.n||"";Account.surName=a&&a.sn||"";Account.email=a&&a.e||"";Account.sex=a&&a.m||0;Account.birthDate=a&&a.bi||"";Account.country=a&&a.co||"";Account.state=a&&a.st||"";Account.paymentHistory=[];Account.paymentHistoryLength=a&&a.ph||0;Account.displayedPaymentStart=-1;Account.displayedPaymentEnd=-1;if($.settings){Field.empty(document.getElementById("oldPass"));Field.empty(document.getElementById("newPass1"));Field.empty(document.getElementById("newPass2"))}_sC($.gamerCardBalance.style,"display",AJ.userType?"":"none");if(a.s&&a.s!="undefined"){Settings.load(a.s)}Account.updateValuesInSettings();Account.updateDisplayedPaymentHistory();Util.setPromoUrl()},updateValuesInSettings:function(){if($.settings){Field.setValue($_("userInfoEmail"),Account.email);Field.setValue($_("userInfoFirstName"),Account.firstName);Field.setValue($_("userInfoSurName"),Account.surName);var a=UI.toFocus;$_("userInfoSex_"+Account.sex).onclick();UI.toFocus=a;Field.setValue($_("userInfoBirthDate"),Account.birthDate);Field.setValue($_("userInfoCountry"),Account.country);Field.setValue($_("userInfoState"),Account.state);if(Account.email){_s($.htmlSExtractEmail,"innerHTML",Util.sprintf(LStrings[AJ.curLang].html.htmlSExtractEmail,Account.email));_sC($.htmlSExtractEmail.style,"display","");_sC($.htmlSExtractNoEmail.style,"display","none");if(Button.isDisabled($.btnExtractMoneyBookers)&&AJ.balance>=Slider.getMin($.sldrExtractMB)*100){Button.enable($.btnExtractMoneyBookers)}}else{_sC($.htmlSExtractEmail.style,"display","none");_sC($.htmlSExtractNoEmail.style,"display","");if(!Button.isDisabled($.btnExtractMoneyBookers)){Button.disable($.btnExtractMoneyBookers)}}Account.checkInfoChanged()}else{events.addAfterWindowShowCallback("settings",Account.updateValuesInSettings)}},addPaymentInfo:function(d,b,a){var c=[new Date(),d.ammount,d.type];if(d.type<=3){c.push(b,a)}else{c.push(null,null,b)}Account.paymentHistory[Account.paymentHistoryLength++]=c;if(Account.displayedPaymentEnd==Account.paymentHistoryLength-1){Account.displayedPaymentEnd++;if(Account.displayedPaymentStart+Account.maxDisplayedPaymentSize<=Account.displayedPaymentEnd){Account.displayedPaymentStart+=Account.maxDisplayedPaymentSize}Account.updateDisplayedPaymentHistory()}},updatePaymentInfoFromServer:function(b){for(var a=0;a<b.h.length;a++){b.h[a][0]=Util.getDateFromJSON(b.h[a][0]);Account.paymentHistory[b.b+a]=b.h[a]}if((b.b>=Account.displayedPaymentStart&&b.b<Account.displayedPaymentEnd)||(b.b+b.h.length>=Account.displayedPaymentStart&&b.b+b.h.length<Account.displayedPaymentEnd)){Account.updateDisplayedPaymentHistory()}},viewPaymentHistory:function(a){Account.displayedPaymentStart=a;Account.displayedPaymentEnd=Math.min(a+10,Account.paymentHistoryLength);Account.updateDisplayedPaymentHistory()},updateDisplayedPaymentHistory:function(){if(!Util.isVisible("paymentHistory",true)){events.addAfterWindowShowCallback(Util.getWindow("paymentHistory"),Account.updateDisplayedPaymentHistory);return}if(!UI.beforeApplyOnce.contains(Account._updateDisplayedPaymentHistory)){UI.beforeApplyOnce.push(Account._updateDisplayedPaymentHistory);if(!UI.timer){UI.scheduleTimer()}}},_updateDisplayedPaymentHistory:function(){var f;var c=false;if(Account.paymentHistoryLength){f="";var b=Account.displayedPaymentStart,d=Account.displayedPaymentEnd;if(b<0){d=Account.displayedPaymentEnd=Account.paymentHistoryLength;b=Account.displayedPaymentStart=Math.max(d-(d%Account.maxDisplayedPaymentSize||Account.maxDisplayedPaymentSize),0)}var k,h;for(var e=b;e<d;e++){if(!Account.paymentHistory[e]){if(!c){c=true;k=e}h=e}else{var a=Account.paymentHistory[e];var g=[Strings.paymentHistory[a[2]],'<span class="money">'+Util.printMoney(a[1])+"</span>"];if(a[2]<4){g.push('<span class="account">'+a[3]+"</span>",'<span class="merchant">'+a[4]+"</span>")}f+='<div class="pH'+a[2]+'"><span class="timestamp">'+Util.getNiceDateTime(a[0])+"</span> "+Util.sprintf.apply(Util,g)+"</div>"}}_s($.paymentHistoryPages,"innerHTML",Util.getPagingHTML(b,Account.maxDisplayedPaymentSize,Account.paymentHistoryLength,Strings.pHInterval,Strings.pHAll,"Account.viewPaymentHistory"))}else{f=Strings.pH0;_sC($.paymentHistoryPages,"innerHTML","")}if(c){_sC($.paymentHistoryLoader.style,"display","");_sC($.paymentHistoryContent,"innerHTML","");Request.paymentHistory(k,h-k+1)}else{_sC($.paymentHistoryLoader.style,"display","none");_s($.paymentHistoryContent,"innerHTML",f)}},updateGameSliders:function(){if(!Util.isVisible("findGame",true)){events.addAfterWindowShowCallback(Util.getWindow("findGame"),Account.updateGameSliders);return}if(AJ.balance<100){_sC($.htmlCNoMoney.style,"display","")}else{_sC($.htmlCNoMoney.style,"display","none");Slider.setMaxValue($.fRBet,(AJ.balance/100)|0);Slider.setMaxValue($_("custBet"),(AJ.balance/100)|0)}},updateBalanceSliders:function(){if(!Util.isVisible("paymentHistory",true)){events.addAfterWindowShowCallback(Util.getWindow("paymentHistory"),Account.updateBalanceSliders);return}if(AJ.balance<Slider.getMin($.sldrExtractMB)*100){Button.disable($.btnExtractMoneyBookers);_sC($.htmlSExtractNoMoney.style,"display","")}else{Slider.setMaxValue($.sldrExtractMB,(AJ.balance/100)|0);_sC($.htmlSExtractNoMoney.style,"display","none");if(Button.isDisabled($.btnExtractMoneyBookers)&&Account.email){Button.enable($.btnExtractMoneyBookers)}}},newPoints:0,lastPointsUsername:null,lastPointsRank:0,chatPointsMsgParse:{progressBar:true},updatePoints:function(b){if(Account.points==b){return}Account.newPoints=b-Account.points;Account.points=b;var d=Util.getStars(b);if(Account.lastPointsUsername!=AJ.username){Account.lastPointsUsername=AJ.username;Account.lastPointsRank=d}else{if(Account.lastPointsRank<d){Account.lastPointsRank=d;Balloon.show((d>=1)?Strings.receivedStar:Strings.receivedHalfStar,$.rankContainer,"receivedStarBalloon")}if(d<5){var c=(d<1?0:Math.pow(3,d))*1000;var a=Math.pow(3,(d+1)+0)*1000;Chat.addActivity(HTML.parse(Util.sprintf(Strings.receivedPoints,(b-c)/a*100,(d+1)|0),Account.chatPointsMsgParse),AJ.username,"stars")}}_s($.rank.style,"width",d*20+"%");if(!AJ.animations){_s($.pointsWon,"innerHTML",Util.sprintf(Strings.kpoints,b))}else{if(Account.pointsAnimationActive){Account.pointsAnimation.beginTime=+(new Date())}else{Animation.addAnimation(Account.pointsAnimation,Account.pointsAnimationSpeed);Account.pointsAnimationActive=true}}},animatePoints:function(a){var b;if(a>=1){Account.pointsAnimationActive=false;b=Account.points}else{b=Account.points-Math.round((1-a)*Account.newPoints)}_s($.pointsWon,"innerHTML",Util.sprintf(Strings.kpoints,b))},updateAccInfo:function(){Request.updateAccInfo(Field.value(document.getElementById("userInfoEmail")),Field.value(document.getElementById("userInfoFirstName")),Field.value(document.getElementById("userInfoSurName")),document.getElementById("userInfoSex").value-0,Field.value($_("userInfoBirthDate")),Field.value($_("userInfoCountry")),Field.value($_("userInfoState")));Account.checkInfoChanged()},countryUpdated:function(){var a=Field.value($_("userInfoCountry"));_s($_("settingsStateArea").style,"display",states[a]?"":"none");HTML.setOptions($_("userInfoState"),states[a]||[""],Account.state);Account.checkInfoChanged()},checkInfoChanged:function(){if(!$.settings){return}if(Button.isDisabled($.btnUpdateInfo)){if(Account.infoChanged()){Button.enable($.btnUpdateInfo);Button.startHighlight($.btnUpdateInfo)}}else{if(!Account.infoChanged()){Button.stopHighlight($.btnUpdateInfo);Button.disable($.btnUpdateInfo)}}},infoChanged:function(){return(Account.email!=Field.value($_("userInfoEmail")))||(Account.firstName!=Field.value($_("userInfoFirstName")))||(Account.surName!=Field.value($_("userInfoSurName")))||(Account.sex!=_g($_("userInfoSex"),"value")-0)||(Account.birthDate!=Field.value($_("userInfoBirthDate")))||(Account.country!=Field.value($_("userInfoCountry")))||(Account.state!=Field.value($_("userInfoState")))}};var UserList={lastAnswerFadeDelay:1,extraHeight:240,minHeight:394,maxHeight:600,selfStatus:null,lastAnswerFadeTimeout:null,refreshUsers:function(){var b=$.userList.firstChild;_cAn($.userList);_cIn($.userList);while(b){var a=currentRoom.users[currentRoom.indexByUser[b.username]];if(!a||!a.domNodes||b!==a.domNodes.mainNode){_oC(b)}b=b.nextSibling}UserList.sortUsers(true);UserList.addNewUsers()},_getMainClassForUserInfo:function(c,a){var d=c.username===AJ.username;var b="scoreDiv place"+c.place;if(d){b+=" scoreSelf"}b+=(c.prevScore==c.score?" scoreSame":c.prevScore<c.score?" scoreMore":" scoreLess");if(currentRoom.roomInfo.lobby){b+=c.ready?" ready":" notReady"}b+=" user"+(d?"self":c.userPos);if(c.userCache.idleSince){b+=" idle"}if(c.userCache.isGuest){b+=" guest"}if(c.userCache.stars==0.5){b+=" star05"}else{b+=" star"+c.userCache.stars}if(UserList.lastAnswerFadeTimeout){if(currentRoom.users[a].userLastAnswer){b+=currentRoom.users[a].userLastAnswer.right?" rightAnswer":" wrongAnswer";if(question.type==0){b+=" answer"+currentRoom.users[a].userLastAnswer.a}}else{b+=" noAnswer"}}return b},addNewUsers:function(){var e=currentRoom.roomInfo.bet?"":' style="display: none;"';for(var d=0;d<currentRoom.users.length;d++){var a=currentRoom.users[d];if(a.domNodes){continue}var c=a.domNodes={};var g=a.prevScore,f=a.score;var b=a.username===AJ.username;c.mainNode=UI.fromHTML('<div class="'+UserList._getMainClassForUserInfo(a,d)+'"><img class="scoreAvatar" src="'+a.avatar+'" /><div class="scorePoints">'+f+'<span class="scoreIndicator">('+Util.signed(f-g)+')</span></div><div class="scoreUsername">'+escapeHTML(a.displayedUsername)+'</div><div class="scoreMoney"'+e+">"+Util.printMoney(a.winnings)+'</div><div class="lastAnswer opac" style="display: none;"><span class="summary"></span><span class="overflow"></span><span class="time"></span></div><div style="clear: both"></div></div>');c.mainNode.username=a.username;c.lastAnswer=c.mainNode.childNodes[4];c.lastAnswerSummary=c.lastAnswer.firstChild;c.lastAnswerExtra=c.lastAnswer.childNodes[1];c.lastAnswerTime=c.lastAnswer.childNodes[2];c.avatar=c.mainNode.firstChild;c.username=c.mainNode.childNodes[2];c.pointsText=c.mainNode.childNodes[1].firstChild;c.scoreIndicator=c.mainNode.childNodes[1].lastChild;c.scoreMoney=c.mainNode.childNodes[3];_an($.userList,c.mainNode);a.avatarImage=new Image();_s(a.avatarImage,"src",a.avatar)}},removeUsers:function(c){nextUser:for(var b=0;b<c.length;b++){for(var a=0;a<currentRoom.users.length;a++){if(currentRoom.users[a].username==c[b]){if(currentRoom.users[a].domNodes){_oC(currentRoom.users[a].domNodes.mainNode);currentRoom.users[a].domNodes.mainNode.username=c[a]+"--REMOVED-USER"}continue nextUser}}}},updateUserInfo:function(b){if(!b){for(var a=0;a<currentRoom.users.length;a++){UserList.updateOneUserInfo(a)}}else{if(typeof b==="string"){UserList.updateOneUserInfo(currentRoom.indexByUser[b])}else{for(var a=0;a<b.length;a++){UserList.updateOneUserInfo(currentRoom.indexByUser[b[a]])}}}},updateOneUserInfo:function(a){var b=currentRoom.users[a];b.domNodes.mainNode.username=b.username;_sC(b.domNodes.username,"innerHTML",escapeHTML(b.displayedUsername));_sC(b.domNodes.mainNode,"className",UserList._getMainClassForUserInfo(b,a));_sC(b.domNodes.avatar,"src",b.avatar);_sC(b.domNodes.pointsText,"nodeValue",b.score);_sC(b.domNodes.scoreIndicator,"innerHTML",Util.signed(b.score-b.prevScore));_sC(b.domNodes.scoreMoney,"innerHTML",Util.printMoney(b.winnings))},updateSelfStatus:function(){var a=currentRoom.indexByUser[AJ.username];if(a==0){if(currentRoom.users.length>1&&currentRoom.users[0].score==currentRoom.users[1].score){a=2}else{a=1}}else{if(currentRoom.users[0].score==currentRoom.users[a].score){a=2}else{a=3}}if(a!=UserList.selfStatus){if((UserList.selfStatus!=null||a!=3)&&question&&(question.position!=1||a!=2)){Chat.addActivity(Strings.leadMsgs[a-1],AJ.username)}UserList.selfStatus=a}},_userSortFn:function(c,b){var a=(c.score===b.score)?(c.isGuest!=b.isGuest)?(c.isGuest-b.isGuest):(b.displayedUsername.toLowerCase()>c.displayedUsername.toLowerCase()?-1:1):(b.score-c.score);return a},sortUsers:function(f){var d,b=currentRoom.users.length,c;currentRoom.users.sort(UserList._userSortFn);var d=0;while(d<currentRoom.users.length){var a=d+1;var e=currentRoom.users[d].score;if(!e){a=0}do{currentRoom.indexByUser[currentRoom.users[d].username]=d;currentRoom.users[d++].place=a}while(currentRoom.users[d]&&currentRoom.users[d].score==e)}UserList.updateSelfStatus();if(!f){UserList._updateUserOrder()}},_updateUserOrder:function(){_cAn($.userList);_cIn($.userList);var f=[],a=$A($.userList.childNodes);for(var d=0;d<a.length;d++){if(!_io(a[d])){f.push(a[d].username)}}var e=currentRoom.users.pluck("username");var h=Algorithms.longestCommonSubsequence(f,e);if(h.length===e.length){return}var g=0,c=h[g]&&currentRoom.users[currentRoom.indexByUser[h[g]]].domNodes.mainNode||null;for(var d=0;d<currentRoom.users.length;d++){var b=currentRoom.users[d];_sC(b.domNodes.mainNode,"className",UserList._getMainClassForUserInfo(b,d));if(b.username==h[g]){g++;c=h[g]&&currentRoom.users[currentRoom.indexByUser[h[g]]].domNodes.mainNode||null}else{_in($.userList,b.domNodes.mainNode,c)}}},showLastAnswer:function(h){if(this.lastAnswerFadeTimeout){clearTimeout(this.lastAnswerFadeTimeout);this.lastAnswerFadeTimeout=null}var g=this.lastAnswerFadeTimeout=setTimeout(function(){if(g==UserList.lastAnswerFadeTimeout){UserList.lastAnswerFadeTimeout=null;UserList.fadeLastAnswers()}},h);for(var d=0;d<currentRoom.users.length;d++){var b=currentRoom.users[d];_sC(b.domNodes.mainNode,"className",UserList._getMainClassForUserInfo(b,d));_r(b.domNodes.lastAnswer,"className",RX.cls.opac,"opac");_s(b.domNodes.lastAnswer.style,"display","");if(currentRoom.users[d].userLastAnswer){var f;var a="";switch(question.type){case 0:case 3:case 4:f=String(currentRoom.users[d].userLastAnswer.a);break;case 1:case 2:f=currentRoom.users[d].userLastAnswer.a.length;if(currentRoom.users[d].userLastAnswer.a.length){a=currentRoom.users[d].userLastAnswer.a.join(", ")}break;case 5:f="&nbsp;";break;default:f=currentRoom.users[d].userLastAnswer.a}var e=currentRoom.users[d].userLastAnswer.t|0;var c=((currentRoom.users[d].userLastAnswer.t-e)*1000)|0;_sC(b.domNodes.lastAnswerSummary,"innerHTML",f);_sC(b.domNodes.lastAnswerExtra,"innerHTML",a);_sC(b.domNodes.lastAnswerTime,"innerHTML",e+"s&nbsp;"+ls(c,"&nbsp;",3)+"ms")}}},fadeLastAnswers:function(){if(UserList.lastAnswerFadeTimeout){clearTimeout(UserList.lastAnswerFadeTimeout);UserList.lastAnswerFadeTimeout=null}for(var a=0;a<currentRoom.users.length;a++){Animate.fade(currentRoom.users[a].domNodes.lastAnswer,100,0,UserList.lastAnswerFadeDelay)}},updateHeight:function(){_s($.userList.style,"height",Math.min(Math.max(document.documentElement.offsetHeight-UserList.extraHeight,UserList.minHeight),UserList.maxHeight)+"px");Chat.updateHeight()}};var Idle={idle:false,lastActivity:0,init:function(){setTimeout(Idle.check,variables.idleDelay);globalEvents.onmousemove.push(Idle.mousemove);globalEvents.onmousedown.push(Idle.mousedown);globalEvents.onkeydown.push(Idle.keydown)},check:function(){var a=new Date().valueOf();if(a-Idle.lastActivity>=variables.idleDelay){Idle.setIdle(true)}else{setTimeout(Idle.check,variables.idleDelay-a+Idle.lastActivity)}},mousemove:function(a){Idle.isActive()},mousedown:function(a){Idle.isActive()},keydown:function(a){Idle.isActive()},isActive:function(){var a=new Date().valueOf();Idle.lastActivity=a;if(Idle.idle){Idle.setIdle(false)}},setIdle:function(a){if(Idle.idle==a){return}if(a){Idle.idle=true;Idle.sendIdleToServer(variables.idleDelay/1000);Idle.userIdle()}else{Idle.idle=false;setTimeout(Idle.check,variables.idleDelay);Idle.sendIdleToServer(variables.currentWindow=="play"?null:0);Idle.userNotIdle()}},userIdle:function(){_a($.thisisidle,"className","visible");Settings.reapply("animations")},userNotIdle:function(){_r($.thisisidle,"className",/\bvisible\b/,"");Settings.reapply("animations")},sendIdleAfterConnectValue:null,sendIdleToServer:function(a){if(Request.connected){Request.idle(a);Idle.updateIdleAfterConnectValue=null}else{if(Idle.updateIdleAfterConnectValue==null){Request.afterConnect.push(Idle.updateIdleAfterConnect)}Idle.sendIdleAfterConnectValue=a}},updateIdleAfterConnect:function(){if(Idle.updateIdleAfterConnectValue==null){return}Request.idle(Idle.sendIdleAfterConnectValue);delete Idle.sendIdleAfterConnectValue}};var Settings={list:[],defaults:{},values:{},noCookieHash:{},hash:{},reverseHash:{},cookies:false,str:"{}",init:function(){if(Util.save==Util.saveCookie){Settings.cookies=true}Settings.add("activity","a",1);Settings.add("animations","b",3);Settings.add("depositPopup","d",0);Settings.add("sound","s",1);Settings.add("timestamps","t",0)},add:function(c,b,d,a){Settings.list.push(c);Settings.defaults[c]=d;Settings.values[c]=Util.load(b)||d;Settings.hash[c]=b;Settings.reverseHash[b]=c;if(a){Settings.noCookieHash[c]=true}Settings.apply[c](Settings.values[c])},value:function(a){return Settings.values[a]},change:function(a,b){if(Settings.values[a]==b){return}Settings.values[a]=b;Settings.apply[a](b);if(!Settings.cookies||!noCookieHash[a]){Util.save(Settings.hash[a],b==Settings.defaults[a]?null:b)}Settings.scheduleSave()},scheduledSave:false,scheduleSave:function(){if(!Settings.scheduledSave){Settings.scheduledSave=setTimeout(Settings.save,200)}},save:function(){if(!Request.connected){Request.afterConnect.push(Settings.saveAfterConnect);return}Settings.scheduledSave=false;var c=[];for(var b=0;b<Settings.list.length;b++){var a=Settings.list[b];var d=Settings.values[a];if(d==Settings.defaults[a]){continue}c.push(Settings.hash[a]+":"+d)}c="{"+c.join(",")+"}";if(Settings.str==c){return}Settings.str=c;if(AJ.userType){Request.saveSettings(c)}},saveAfterConnect:function(){Settings.save()},load:function(d){Settings.str=d;var c=parseJSON(d);for(var b=0;b<Settings.list.length;b++){var a=Settings.list[b];Settings.change(a,c[Settings.hash[a]]||Settings.defaults[a])}},reapply:function(){for(var a=0;a<arguments.length;a++){Settings.apply[arguments[a]](Settings.values[arguments[a]])}},apply:{activity:function(a){_ra($.chatText,"className",RX.cls.hideActivityBoth,!(a&1)?" hideActivity":a==1?" hideActivityOthers":"");if($.cbActivity){if(a&1){Checkbox.check($.cbActivity);Checkbox.enable($.cbActivityOthers)}else{Checkbox.uncheck($.cbActivity);Checkbox.disable($.cbActivityOthers)}if(a&2){Checkbox.check($.cbActivityOthers)}else{Checkbox.uncheck($.cbActivityOthers)}}},animations:function(a){a=variables.windowIsActive&&!Idle.idle&&a||0;AJ.animations=a&1;AJ.bigAnimations=a&1&&a&2;if($.cbAnimations){if(a&1){Checkbox.check($.cbAnimations);if(Checkbox.isDisabled($.cbBigAnimations)){Checkbox.enable($.cbBigAnimations)}}else{Checkbox.uncheck($.cbAnimations);if(!Checkbox.isDisabled($.cbBigAnimations)){Checkbox.disable($.cbBigAnimations)}}if(a&2){Checkbox.check($.cbBigAnimations)}else{Checkbox.uncheck($.cbBigAnimations)}}},depositPopup:function(a){if($.cbDepositPopup){if(a){Checkbox.check($.cbDepositPopup)}else{Checkbox.uncheck($.cbDepositPopup)}}},sound:function(a){a=variables.hasSound&&variables.windowIsActive&&a;AJ.sound=a;_s($.sound,"className",a?"on":"off")},timestamps:function(b){if(b){_rT($.chatText,"className",RX.cls.hideTimestamps,"")}else{var a=_g($.chatText,"className");if(!RX.cls.hideTimestamps.test(a)){_s($.chatText,"className",a+" hideTimestamps")}}if($.cbTimestamps){if(b){Checkbox.check($.cbTimestamps)}else{Checkbox.uncheck($.cbTimestamps)}}}}};var UserCache={users:{},init:function(){UserCache.getNewUserCacheObject.prototype=UserCache.userCacheObjectPrototype},add:function(a){if(!UserCache.users.hasOwnProperty(a)){UserCache.users[a]=new UserCache.getNewUserCacheObject(a)}return UserCache.users[a]},getNewUserCacheObject:function(b){var a=b.match(RX.other.extractGuestNick);this.username=b;this.avatar=a?constants.avatarPath+constants.avatars.guest:null;this.displayName=a?Util.sprintf(Strings.guestUser,a[1]):b;this.isGuest=!!a},userCacheObjectPrototype:{idleSince:null,firstName:"",lastRoomName:null,lastRoomId:null,points:null,rank:null,roomName:null,roomid:null,sex:0,stars:0,addPoints:function(a){if(!this.isGuest){this.setPoints(this.points+a)}},setAvatar:function(a){this.avatar=a},setLastRoom:function(a,b){this.lastRoomName=a;this.lastRoomId=b},setPoints:function(a){this.points=a;this.stars=Util.getStars(a)},setRoom:function(a,b){this.roomName=a;this.roomId=b;if(a){this.setLastRoom(null,null)}},setRank:function(a){this.rank=a},userLeftRoom:function(a){this.setLastRoom(this.roomName,this.roomId);this.setRoom(null,null);if(this.isGuest){delete UserCache.users[this.username]}}},known:function(a){return UserCache.users.hasOwnProperty(a)},setAvatar:function(b,a){UserCache.users[b].setAvatar(a)},userLeftRoom:function(a){UserCache.users[a].userLeftRoom()},handleServerUpdate:function(d){var b=[];for(var c=0;c<d.u.length;c++){if(currentRoom&&currentRoom.indexByUser.hasOwnProperty(d.u[c])){b.push(d.u[c])}var a=UserCache.add(d.u[c]);if(d.i){a.idleSince=d.i[c]?new Date().valueOf()-d.i[c]*1000:null}if(d.p){a.setPoints(d.p[c])}if(d.r){a.setRank(d.r[c])}if(d.n){a.firstName=d.n[c]}if(d.rn){a.setRoom(d.rn[c],d.ri[c])}if(variables.watchList.contains(a.username)){Chat.addServerMsg(Strings.whois(a))}}if(currentRoom){UserList.updateUserInfo(d.u)}if(d.p&&UserCache.users[AJ.username]&&UserCache.users[AJ.username].points!=Account.points){Account.updatePoints(UserCache.users[AJ.username].points)}},handleWelcomeMessage:function(b){var a=UserCache.add(b.u);if(b.a){a.setAvatar(b.a)}a.firstName=Account.firstName;a.setPoints(b.sc||0);a.sex=b.m||0;if(currentRoom&&currentRoom.indexByUser.hasOwnProperty(b.u)){UserList.updateUserInfo(b.u)}}};var hexcase=0;var b64pad="";var chrsz=8;function hex_md5(a){return binl2hex(core_md5(str2binl(a),a.length*chrsz))}function b64_md5(a){return binl2b64(core_md5(str2binl(a),a.length*chrsz))}function str_md5(a){return binl2str(core_md5(str2binl(a),a.length*chrsz))}function hex_hmac_md5(a,b){return binl2hex(core_hmac_md5(a,b))}function b64_hmac_md5(a,b){return binl2b64(core_hmac_md5(a,b))}function str_hmac_md5(a,b){return binl2str(core_hmac_md5(a,b))}function md5_vm_test(){return hex_md5("abc")=="900150983cd24fb0d6963f7d28e17f72"}function core_md5(t,l){t[l>>5]|=128<<((l)%32);t[(((l+64)>>>9)<<4)+14]=l;var r=1732584193;var q=-271733879;var p=-1732584194;var n=271733878;for(var g=0;g<t.length;g+=16){var k=r;var h=q;var f=p;var e=n;r=md5_ff(r,q,p,n,t[g+0],7,-680876936);n=md5_ff(n,r,q,p,t[g+1],12,-389564586);p=md5_ff(p,n,r,q,t[g+2],17,606105819);q=md5_ff(q,p,n,r,t[g+3],22,-1044525330);r=md5_ff(r,q,p,n,t[g+4],7,-176418897);n=md5_ff(n,r,q,p,t[g+5],12,1200080426);p=md5_ff(p,n,r,q,t[g+6],17,-1473231341);q=md5_ff(q,p,n,r,t[g+7],22,-45705983);r=md5_ff(r,q,p,n,t[g+8],7,1770035416);n=md5_ff(n,r,q,p,t[g+9],12,-1958414417);p=md5_ff(p,n,r,q,t[g+10],17,-42063);q=md5_ff(q,p,n,r,t[g+11],22,-1990404162);r=md5_ff(r,q,p,n,t[g+12],7,1804603682);n=md5_ff(n,r,q,p,t[g+13],12,-40341101);p=md5_ff(p,n,r,q,t[g+14],17,-1502002290);q=md5_ff(q,p,n,r,t[g+15],22,1236535329);r=md5_gg(r,q,p,n,t[g+1],5,-165796510);n=md5_gg(n,r,q,p,t[g+6],9,-1069501632);p=md5_gg(p,n,r,q,t[g+11],14,643717713);q=md5_gg(q,p,n,r,t[g+0],20,-373897302);r=md5_gg(r,q,p,n,t[g+5],5,-701558691);n=md5_gg(n,r,q,p,t[g+10],9,38016083);p=md5_gg(p,n,r,q,t[g+15],14,-660478335);q=md5_gg(q,p,n,r,t[g+4],20,-405537848);r=md5_gg(r,q,p,n,t[g+9],5,568446438);n=md5_gg(n,r,q,p,t[g+14],9,-1019803690);p=md5_gg(p,n,r,q,t[g+3],14,-187363961);q=md5_gg(q,p,n,r,t[g+8],20,1163531501);r=md5_gg(r,q,p,n,t[g+13],5,-1444681467);n=md5_gg(n,r,q,p,t[g+2],9,-51403784);p=md5_gg(p,n,r,q,t[g+7],14,1735328473);q=md5_gg(q,p,n,r,t[g+12],20,-1926607734);r=md5_hh(r,q,p,n,t[g+5],4,-378558);n=md5_hh(n,r,q,p,t[g+8],11,-2022574463);p=md5_hh(p,n,r,q,t[g+11],16,1839030562);q=md5_hh(q,p,n,r,t[g+14],23,-35309556);r=md5_hh(r,q,p,n,t[g+1],4,-1530992060);n=md5_hh(n,r,q,p,t[g+4],11,1272893353);p=md5_hh(p,n,r,q,t[g+7],16,-155497632);q=md5_hh(q,p,n,r,t[g+10],23,-1094730640);r=md5_hh(r,q,p,n,t[g+13],4,681279174);n=md5_hh(n,r,q,p,t[g+0],11,-358537222);p=md5_hh(p,n,r,q,t[g+3],16,-722521979);q=md5_hh(q,p,n,r,t[g+6],23,76029189);r=md5_hh(r,q,p,n,t[g+9],4,-640364487);n=md5_hh(n,r,q,p,t[g+12],11,-421815835);p=md5_hh(p,n,r,q,t[g+15],16,530742520);q=md5_hh(q,p,n,r,t[g+2],23,-995338651);r=md5_ii(r,q,p,n,t[g+0],6,-198630844);n=md5_ii(n,r,q,p,t[g+7],10,1126891415);p=md5_ii(p,n,r,q,t[g+14],15,-1416354905);q=md5_ii(q,p,n,r,t[g+5],21,-57434055);r=md5_ii(r,q,p,n,t[g+12],6,1700485571);n=md5_ii(n,r,q,p,t[g+3],10,-1894986606);p=md5_ii(p,n,r,q,t[g+10],15,-1051523);q=md5_ii(q,p,n,r,t[g+1],21,-2054922799);r=md5_ii(r,q,p,n,t[g+8],6,1873313359);n=md5_ii(n,r,q,p,t[g+15],10,-30611744);p=md5_ii(p,n,r,q,t[g+6],15,-1560198380);q=md5_ii(q,p,n,r,t[g+13],21,1309151649);r=md5_ii(r,q,p,n,t[g+4],6,-145523070);n=md5_ii(n,r,q,p,t[g+11],10,-1120210379);p=md5_ii(p,n,r,q,t[g+2],15,718787259);q=md5_ii(q,p,n,r,t[g+9],21,-343485551);r=safe_add(r,k);q=safe_add(q,h);p=safe_add(p,f);n=safe_add(n,e)}return Array(r,q,p,n)}function md5_cmn(h,e,d,c,g,f){return safe_add(bit_rol(safe_add(safe_add(e,h),safe_add(c,f)),g),d)}function md5_ff(g,f,n,l,e,k,h){return md5_cmn((f&n)|((~f)&l),g,f,e,k,h)}function md5_gg(g,f,n,l,e,k,h){return md5_cmn((f&l)|(n&(~l)),g,f,e,k,h)}function md5_hh(g,f,n,l,e,k,h){return md5_cmn(f^n^l,g,f,e,k,h)}function md5_ii(g,f,n,l,e,k,h){return md5_cmn(n^(f|(~l)),g,f,e,k,h)}function core_hmac_md5(c,f){var e=str2binl(c);if(e.length>16){e=core_md5(e,c.length*chrsz)}var a=Array(16),d=Array(16);for(var b=0;b<16;b++){a[b]=e[b]^909522486;d[b]=e[b]^1549556828}var g=core_md5(a.concat(str2binl(f)),512+f.length*chrsz);return core_md5(d.concat(g),512+128)}function safe_add(a,d){var c=(a&65535)+(d&65535);var b=(a>>16)+(d>>16)+(c>>16);return(b<<16)|(c&65535)}function bit_rol(a,b){return(a<<b)|(a>>>(32-b))}function str2binl(d){var c=Array();var a=(1<<chrsz)-1;for(var b=0;b<d.length*chrsz;b+=chrsz){c[b>>5]|=(d.charCodeAt(b/chrsz)&a)<<(b%32)}return c}function binl2str(c){var d="";var a=(1<<chrsz)-1;for(var b=0;b<c.length*32;b+=chrsz){d+=String.fromCharCode((c[b>>5]>>>(b%32))&a)}return d}function binl2hex(c){var b=hexcase?"0123456789ABCDEF":"0123456789abcdef";var d="";for(var a=0;a<c.length*4;a++){d+=b.charAt((c[a>>2]>>((a%4)*8+4))&15)+b.charAt((c[a>>2]>>((a%4)*8))&15)}return d}function binl2b64(d){var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var f="";for(var b=0;b<d.length*4;b+=3){var e=(((d[b>>2]>>8*(b%4))&255)<<16)|(((d[b+1>>2]>>8*((b+1)%4))&255)<<8)|((d[b+2>>2]>>8*((b+2)%4))&255);for(var a=0;a<4;a++){if(b*8+a*6>d.length*32){f+=b64pad}else{f+=c.charAt((e>>6*(3-a))&63)}}}return f}var hexcase=0;var b64pad="";var chrsz=8;function hex_sha1(a){return binb2hex(core_sha1(str2binb(a),a.length*chrsz))}function b64_sha1(a){return binb2b64(core_sha1(str2binb(a),a.length*chrsz))}function str_sha1(a){return binb2str(core_sha1(str2binb(a),a.length*chrsz))}function hex_hmac_sha1(a,b){return binb2hex(core_hmac_sha1(a,b))}function b64_hmac_sha1(a,b){return binb2b64(core_hmac_sha1(a,b))}function str_hmac_sha1(a,b){return binb2str(core_hmac_sha1(a,b))}function sha1_vm_test(){return hex_sha1("abc")=="a9993e364706816aba3e25717850c26c9cd0d89d"}function core_sha1(A,q){A[q>>5]|=128<<(24-q%32);A[((q+64>>9)<<4)+15]=q;var B=Array(80);var z=1732584193;var y=-271733879;var v=-1732584194;var u=271733878;var r=-1009589776;for(var l=0;l<A.length;l+=16){var p=z;var n=y;var k=v;var h=u;var f=r;for(var g=0;g<80;g++){if(g<16){B[g]=A[l+g]}else{B[g]=rol(B[g-3]^B[g-8]^B[g-14]^B[g-16],1)}var C=safe_add(safe_add(rol(z,5),sha1_ft(g,y,v,u)),safe_add(safe_add(r,B[g]),sha1_kt(g)));r=u;u=v;v=rol(y,30);y=z;z=C}z=safe_add(z,p);y=safe_add(y,n);v=safe_add(v,k);u=safe_add(u,h);r=safe_add(r,f)}return Array(z,y,v,u,r)}function sha1_ft(e,a,g,f){if(e<20){return(a&g)|((~a)&f)}if(e<40){return a^g^f}if(e<60){return(a&g)|(a&f)|(g&f)}return a^g^f}function sha1_kt(a){return(a<20)?1518500249:(a<40)?1859775393:(a<60)?-1894007588:-899497514}function core_hmac_sha1(c,f){var e=str2binb(c);if(e.length>16){e=core_sha1(e,c.length*chrsz)}var a=Array(16),d=Array(16);for(var b=0;b<16;b++){a[b]=e[b]^909522486;d[b]=e[b]^1549556828}var g=core_sha1(a.concat(str2binb(f)),512+f.length*chrsz);return core_sha1(d.concat(g),512+160)}function safe_add(a,d){var c=(a&65535)+(d&65535);var b=(a>>16)+(d>>16)+(c>>16);return(b<<16)|(c&65535)}function rol(a,b){return(a<<b)|(a>>>(32-b))}function str2binb(d){var c=Array();var a=(1<<chrsz)-1;for(var b=0;b<d.length*chrsz;b+=chrsz){c[b>>5]|=(d.charCodeAt(b/chrsz)&a)<<(32-chrsz-b%32)}return c}function binb2str(c){var d="";var a=(1<<chrsz)-1;for(var b=0;b<c.length*32;b+=chrsz){d+=String.fromCharCode((c[b>>5]>>>(32-chrsz-b%32))&a)}return d}function binb2hex(c){var b=hexcase?"0123456789ABCDEF":"0123456789abcdef";var d="";for(var a=0;a<c.length*4;a++){d+=b.charAt((c[a>>2]>>((3-a%4)*8+4))&15)+b.charAt((c[a>>2]>>((3-a%4)*8))&15)}return d}function binb2b64(d){var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var f="";for(var b=0;b<d.length*4;b+=3){var e=(((d[b>>2]>>8*(3-b%4))&255)<<16)|(((d[b+1>>2]>>8*(3-(b+1)%4))&255)<<8)|((d[b+2>>2]>>8*(3-(b+2)%4))&255);for(var a=0;a<4;a++){if(b*8+a*6>d.length*32){f+=b64pad}else{f+=c.charAt((e>>6*(3-a))&63)}}}return f}var dbits;var canary=244837814094590;var j_lm=((canary&16777215)==15715070);function BigInteger(e,d,f){if(e!=null){if("number"==typeof e){this.fromNumber(e,d,f)}else{if(d==null&&"string"!=typeof e){this.fromString(e,256)}else{this.fromString(e,d)}}}}function nbi(){return new BigInteger(null)}function am1(f,a,b,e,h,g){while(--g>=0){var d=a*this[f++]+b[e]+h;h=Math.floor(d/67108864);b[e++]=d&67108863}return h}function am2(f,r,t,e,p,a){var k=r&32767,q=r>>15;while(--a>=0){var d=this[f]&32767;var g=this[f++]>>15;var b=q*d+g*k;d=k*d+((b&32767)<<15)+t[e]+(p&1073741823);p=(d>>>30)+(b>>>15)+q*g+(p>>>30);t[e++]=d&1073741823}return p}function am3(f,r,t,e,p,a){var k=r&16383,q=r>>14;while(--a>=0){var d=this[f]&16383;var g=this[f++]>>14;var b=q*d+g*k;d=k*d+((b&16383)<<14)+t[e]+p;p=(d>>28)+(b>>14)+q*g;t[e++]=d&268435455}return p}if(j_lm&&(navigator.appName=="Microsoft Internet Explorer")){BigInteger.prototype.am=am2;dbits=30}else{if(j_lm&&(navigator.appName!="Netscape")){BigInteger.prototype.am=am1;dbits=26}else{BigInteger.prototype.am=am3;dbits=28}}BigInteger.prototype.DB=dbits;BigInteger.prototype.DM=((1<<dbits)-1);BigInteger.prototype.DV=(1<<dbits);var BI_FP=52;BigInteger.prototype.FV=Math.pow(2,BI_FP);BigInteger.prototype.F1=BI_FP-dbits;BigInteger.prototype.F2=2*dbits-BI_FP;var BI_RM="0123456789abcdefghijklmnopqrstuvwxyz";var BI_RC=new Array();var rr,vv;rr="0".charCodeAt(0);for(vv=0;vv<=9;++vv){BI_RC[rr++]=vv}rr="a".charCodeAt(0);for(vv=10;vv<36;++vv){BI_RC[rr++]=vv}rr="A".charCodeAt(0);for(vv=10;vv<36;++vv){BI_RC[rr++]=vv}function int2char(a){return BI_RM.charAt(a)}function intAt(b,a){var d=BI_RC[b.charCodeAt(a)];return(d==null)?-1:d}function bnpCopyTo(b){for(var a=this.t-1;a>=0;--a){b[a]=this[a]}b.t=this.t;b.s=this.s}function bnpFromInt(a){this.t=1;this.s=(a<0)?-1:0;if(a>0){this[0]=a}else{if(a<-1){this[0]=a+DV}else{this.t=0}}}function nbv(a){var b=nbi();b.fromInt(a);return b}function bnpFromString(h,c){var e;if(c==16){e=4}else{if(c==8){e=3}else{if(c==256){e=8}else{if(c==2){e=1}else{if(c==32){e=5}else{if(c==4){e=2}else{this.fromRadix(h,c);return}}}}}}this.t=0;this.s=0;var g=h.length,d=false,f=0;while(--g>=0){var a=(e==8)?h[g]&255:intAt(h,g);if(a<0){if(h.charAt(g)=="-"){d=true}continue}d=false;if(f==0){this[this.t++]=a}else{if(f+e>this.DB){this[this.t-1]|=(a&((1<<(this.DB-f))-1))<<f;this[this.t++]=(a>>(this.DB-f))}else{this[this.t-1]|=a<<f}}f+=e;if(f>=this.DB){f-=this.DB}}if(e==8&&(h[0]&128)!=0){this.s=-1;if(f>0){this[this.t-1]|=((1<<(this.DB-f))-1)<<f}}this.clamp();if(d){BigInteger.ZERO.subTo(this,this)}}function bnpClamp(){var a=this.s&this.DM;while(this.t>0&&this[this.t-1]==a){--this.t}}function bnToString(c){if(this.s<0){return"-"+this.negate().toString(c)}var e;if(c==16){e=4}else{if(c==8){e=3}else{if(c==2){e=1}else{if(c==32){e=5}else{if(c==4){e=2}else{return this.toRadix(c)}}}}}var g=(1<<e)-1,n,a=false,h="",f=this.t;var l=this.DB-(f*this.DB)%e;if(f-->0){if(l<this.DB&&(n=this[f]>>l)>0){a=true;h=int2char(n)}while(f>=0){if(l<e){n=(this[f]&((1<<l)-1))<<(e-l);n|=this[--f]>>(l+=this.DB-e)}else{n=(this[f]>>(l-=e))&g;if(l<=0){l+=this.DB;--f}}if(n>0){a=true}if(a){h+=int2char(n)}}}return a?h:"0"}function bnNegate(){var a=nbi();BigInteger.ZERO.subTo(this,a);return a}function bnAbs(){return(this.s<0)?this.negate():this}function bnCompareTo(b){var d=this.s-b.s;if(d!=0){return d}var c=this.t;d=c-b.t;if(d!=0){return d}while(--c>=0){if((d=this[c]-b[c])!=0){return d}}return 0}function nbits(a){var c=1,b;if((b=a>>>16)!=0){a=b;c+=16}if((b=a>>8)!=0){a=b;c+=8}if((b=a>>4)!=0){a=b;c+=4}if((b=a>>2)!=0){a=b;c+=2}if((b=a>>1)!=0){a=b;c+=1}return c}function bnBitLength(){if(this.t<=0){return 0}return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM))}function bnpDLShiftTo(c,b){var a;for(a=this.t-1;a>=0;--a){b[a+c]=this[a]}for(a=c-1;a>=0;--a){b[a]=0}b.t=this.t+c;b.s=this.s}function bnpDRShiftTo(c,b){for(var a=c;a<this.t;++a){b[a-c]=this[a]}b.t=Math.max(this.t-c,0);b.s=this.s}function bnpLShiftTo(k,e){var b=k%this.DB;var a=this.DB-b;var g=(1<<a)-1;var f=Math.floor(k/this.DB),h=(this.s<<b)&this.DM,d;for(d=this.t-1;d>=0;--d){e[d+f+1]=(this[d]>>a)|h;h=(this[d]&g)<<b}for(d=f-1;d>=0;--d){e[d]=0}e[f]=h;e.t=this.t+f+1;e.s=this.s;e.clamp()}function bnpRShiftTo(g,d){d.s=this.s;var e=Math.floor(g/this.DB);if(e>=this.t){d.t=0;return}var b=g%this.DB;var a=this.DB-b;var f=(1<<b)-1;d[0]=this[e]>>b;for(var c=e+1;c<this.t;++c){d[c-e-1]|=(this[c]&f)<<a;d[c-e]=this[c]>>b}if(b>0){d[this.t-e-1]|=(this.s&f)<<a}d.t=this.t-e;d.clamp()}function bnpSubTo(d,f){var e=0,g=0,b=Math.min(d.t,this.t);while(e<b){g+=this[e]-d[e];f[e++]=g&this.DM;g>>=this.DB}if(d.t<this.t){g-=d.s;while(e<this.t){g+=this[e];f[e++]=g&this.DM;g>>=this.DB}g+=this.s}else{g+=this.s;while(e<d.t){g-=d[e];f[e++]=g&this.DM;g>>=this.DB}g-=d.s}f.s=(g<0)?-1:0;if(g<-1){f[e++]=this.DV+g}else{if(g>0){f[e++]=g}}f.t=e;f.clamp()}function bnpMultiplyTo(c,e){var b=this.abs(),f=c.abs();var d=b.t;e.t=d+f.t;while(--d>=0){e[d]=0}for(d=0;d<f.t;++d){e[d+b.t]=b.am(0,f[d],e,d,0,b.t)}e.s=0;e.clamp();if(this.s!=c.s){BigInteger.ZERO.subTo(e,e)}}function bnpSquareTo(d){var a=this.abs();var b=d.t=2*a.t;while(--b>=0){d[b]=0}for(b=0;b<a.t-1;++b){var e=a.am(b,a[b],d,2*b,0,1);if((d[b+a.t]+=a.am(b+1,2*a[b],d,2*b+1,e,a.t-b-1))>=a.DV){d[b+a.t]-=a.DV;d[b+a.t+1]=1}}if(d.t>0){d[d.t-1]+=a.am(b,a[b],d,2*b,0,1)}d.s=0;d.clamp()}function bnpDivRemTo(n,h,g){var z=n.abs();if(z.t<=0){return}var k=this.abs();if(k.t<z.t){if(h!=null){h.fromInt(0)}if(g!=null){this.copyTo(g)}return}if(g==null){g=nbi()}var d=nbi(),a=this.s,l=n.s;var x=this.DB-nbits(z[z.t-1]);if(x>0){z.lShiftTo(x,d);k.lShiftTo(x,g)}else{z.copyTo(d);k.copyTo(g)}var u=d.t;var b=d[u-1];if(b==0){return}var p=b*(1<<this.F1)+((u>1)?d[u-2]>>this.F2:0);var C=this.FV/p,B=(1<<this.F1)/p,A=1<<this.F2;var w=g.t,v=w-u,f=(h==null)?nbi():h;d.dlShiftTo(v,f);if(g.compareTo(f)>=0){g[g.t++]=1;g.subTo(f,g)}BigInteger.ONE.dlShiftTo(u,f);f.subTo(d,d);while(d.t<u){d[d.t++]=0}while(--v>=0){var c=(g[--w]==b)?this.DM:Math.floor(g[w]*C+(g[w-1]+A)*B);if((g[w]+=d.am(0,c,g,v,0,u))<c){d.dlShiftTo(v,f);g.subTo(f,g);while(g[w]<--c){g.subTo(f,g)}}}if(h!=null){g.drShiftTo(u,h);if(a!=l){BigInteger.ZERO.subTo(h,h)}}g.t=u;g.clamp();if(x>0){g.rShiftTo(x,g)}if(a<0){BigInteger.ZERO.subTo(g,g)}}function bnMod(b){var c=nbi();this.abs().divRemTo(b,null,c);if(this.s<0&&c.compareTo(BigInteger.ZERO)>0){b.subTo(c,c)}return c}function Classic(a){this.m=a}function cConvert(a){if(a.s<0||a.compareTo(this.m)>=0){return a.mod(this.m)}else{return a}}function cRevert(a){return a}function cReduce(a){a.divRemTo(this.m,null,a)}function cMulTo(a,c,b){a.multiplyTo(c,b);this.reduce(b)}function cSqrTo(a,b){a.squareTo(b);this.reduce(b)}Classic.prototype.convert=cConvert;Classic.prototype.revert=cRevert;Classic.prototype.reduce=cReduce;Classic.prototype.mulTo=cMulTo;Classic.prototype.sqrTo=cSqrTo;function bnpInvDigit(){if(this.t<1){return 0}var a=this[0];if((a&1)==0){return 0}var b=a&3;b=(b*(2-(a&15)*b))&15;b=(b*(2-(a&255)*b))&255;b=(b*(2-(((a&65535)*b)&65535)))&65535;b=(b*(2-a*b%this.DV))%this.DV;return(b>0)?this.DV-b:-b}function Montgomery(a){this.m=a;this.mp=a.invDigit();this.mpl=this.mp&32767;this.mph=this.mp>>15;this.um=(1<<(a.DB-15))-1;this.mt2=2*a.t}function montConvert(a){var b=nbi();a.abs().dlShiftTo(this.m.t,b);b.divRemTo(this.m,null,b);if(a.s<0&&b.compareTo(BigInteger.ZERO)>0){this.m.subTo(b,b)}return b}function montRevert(a){var b=nbi();a.copyTo(b);this.reduce(b);return b}function montReduce(a){while(a.t<=this.mt2){a[a.t++]=0}for(var c=0;c<this.m.t;++c){var b=a[c]&32767;var d=(b*this.mpl+(((b*this.mph+(a[c]>>15)*this.mpl)&this.um)<<15))&a.DM;b=c+this.m.t;a[b]+=this.m.am(0,d,a,c,0,this.m.t);while(a[b]>=a.DV){a[b]-=a.DV;a[++b]++}}a.clamp();a.drShiftTo(this.m.t,a);if(a.compareTo(this.m)>=0){a.subTo(this.m,a)}}function montSqrTo(a,b){a.squareTo(b);this.reduce(b)}function montMulTo(a,c,b){a.multiplyTo(c,b);this.reduce(b)}Montgomery.prototype.convert=montConvert;Montgomery.prototype.revert=montRevert;Montgomery.prototype.reduce=montReduce;Montgomery.prototype.mulTo=montMulTo;Montgomery.prototype.sqrTo=montSqrTo;function bnpIsEven(){return((this.t>0)?(this[0]&1):this.s)==0}function bnpExp(h,k){if(h>4294967295||h<1){return BigInteger.ONE}var f=nbi(),a=nbi(),d=k.convert(this),c=nbits(h)-1;d.copyTo(f);while(--c>=0){k.sqrTo(f,a);if((h&(1<<c))>0){k.mulTo(a,d,f)}else{var b=f;f=a;a=b}}return k.revert(f)}function bnModPowInt(b,a){var c;if(b<256||a.isEven()){c=new Classic(a)}else{c=new Montgomery(a)}return this.exp(b,c)}BigInteger.prototype.copyTo=bnpCopyTo;BigInteger.prototype.fromInt=bnpFromInt;BigInteger.prototype.fromString=bnpFromString;BigInteger.prototype.clamp=bnpClamp;BigInteger.prototype.dlShiftTo=bnpDLShiftTo;BigInteger.prototype.drShiftTo=bnpDRShiftTo;BigInteger.prototype.lShiftTo=bnpLShiftTo;BigInteger.prototype.rShiftTo=bnpRShiftTo;BigInteger.prototype.subTo=bnpSubTo;BigInteger.prototype.multiplyTo=bnpMultiplyTo;BigInteger.prototype.squareTo=bnpSquareTo;BigInteger.prototype.divRemTo=bnpDivRemTo;BigInteger.prototype.invDigit=bnpInvDigit;BigInteger.prototype.isEven=bnpIsEven;BigInteger.prototype.exp=bnpExp;BigInteger.prototype.toString=bnToString;BigInteger.prototype.negate=bnNegate;BigInteger.prototype.abs=bnAbs;BigInteger.prototype.compareTo=bnCompareTo;BigInteger.prototype.bitLength=bnBitLength;BigInteger.prototype.mod=bnMod;BigInteger.prototype.modPowInt=bnModPowInt;BigInteger.ZERO=nbv(0);BigInteger.ONE=nbv(1);function bnClone(){var a=nbi();this.copyTo(a);return a}function bnIntValue(){if(this.s<0){if(this.t==1){return this[0]-this.DV}else{if(this.t==0){return -1}}}else{if(this.t==1){return this[0]}else{if(this.t==0){return 0}}}return((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0]}function bnByteValue(){return(this.t==0)?this.s:(this[0]<<24)>>24}function bnShortValue(){return(this.t==0)?this.s:(this[0]<<16)>>16}function bnpChunkSize(a){return Math.floor(Math.LN2*this.DB/Math.log(a))}function bnSigNum(){if(this.s<0){return -1}else{if(this.t<=0||(this.t==1&&this[0]<=0)){return 0}else{return 1}}}function bnpToRadix(c){if(c==null){c=10}if(this.signum()==0||c<2||c>36){return"0"}var f=this.chunkSize(c);var e=Math.pow(c,f);var k=nbv(e),l=nbi(),h=nbi(),g="";this.divRemTo(k,l,h);while(l.signum()>0){g=(e+h.intValue()).toString(c).substr(1)+g;l.divRemTo(k,l,h)}return h.intValue().toString(c)+g}function bnpFromRadix(n,h){this.fromInt(0);if(h==null){h=10}var f=this.chunkSize(h);var g=Math.pow(h,f),e=false,a=0,l=0;for(var c=0;c<n.length;++c){var k=intAt(n,c);if(k<0){if(n.charAt(c)=="-"&&this.signum()==0){e=true}continue}l=h*l+k;if(++a>=f){this.dMultiply(g);this.dAddOffset(l,0);a=0;l=0}}if(a>0){this.dMultiply(Math.pow(h,a));this.dAddOffset(l,0)}if(e){BigInteger.ZERO.subTo(this,this)}}function bnpFromNumber(f,e,h){if("number"==typeof e){if(f<2){this.fromInt(1)}else{this.fromNumber(f,h);if(!this.testBit(f-1)){this.bitwiseTo(BigInteger.ONE.shiftLeft(f-1),op_or,this)}if(this.isEven()){this.dAddOffset(1,0)}while(!this.isProbablePrime(e)){this.dAddOffset(2,0);if(this.bitLength()>f){this.subTo(BigInteger.ONE.shiftLeft(f-1),this)}}}}else{var d=new Array(),g=f&7;d.length=(f>>3)+1;e.nextBytes(d);if(g>0){d[0]&=((1<<g)-1)}else{d[0]=0}this.fromString(d,256)}}function bnToByteArray(){var b=this.t,c=new Array();c[0]=this.s;var e=this.DB-(b*this.DB)%8,f,a=0;if(b-->0){if(e<this.DB&&(f=this[b]>>e)!=(this.s&this.DM)>>e){c[a++]=f|(this.s<<(this.DB-e))}while(b>=0){if(e<8){f=(this[b]&((1<<e)-1))<<(8-e);f|=this[--b]>>(e+=this.DB-8)}else{f=(this[b]>>(e-=8))&255;if(e<=0){e+=this.DB;--b}}if((f&128)!=0){f|=-256}if(a==0&&(this.s&128)!=(f&128)){++a}if(a>0||f!=this.s){c[a++]=f}}}return c}function bnEquals(b){return(this.compareTo(b)==0)}function bnMin(b){return(this.compareTo(b)<0)?this:b}function bnMax(b){return(this.compareTo(b)>0)?this:b}function bnpBitwiseTo(c,h,e){var d,g,b=Math.min(c.t,this.t);for(d=0;d<b;++d){e[d]=h(this[d],c[d])}if(c.t<this.t){g=c.s&this.DM;for(d=b;d<this.t;++d){e[d]=h(this[d],g)}e.t=this.t}else{g=this.s&this.DM;for(d=b;d<c.t;++d){e[d]=h(g,c[d])}e.t=c.t}e.s=h(this.s,c.s);e.clamp()}function op_and(a,b){return a&b}function bnAnd(b){var c=nbi();this.bitwiseTo(b,op_and,c);return c}function op_or(a,b){return a|b}function bnOr(b){var c=nbi();this.bitwiseTo(b,op_or,c);return c}function op_xor(a,b){return a^b}function bnXor(b){var c=nbi();this.bitwiseTo(b,op_xor,c);return c}function op_andnot(a,b){return a&~b}function bnAndNot(b){var c=nbi();this.bitwiseTo(b,op_andnot,c);return c}function bnNot(){var b=nbi();for(var a=0;a<this.t;++a){b[a]=this.DM&~this[a]}b.t=this.t;b.s=~this.s;return b}function bnShiftLeft(b){var a=nbi();if(b<0){this.rShiftTo(-b,a)}else{this.lShiftTo(b,a)}return a}function bnShiftRight(b){var a=nbi();if(b<0){this.lShiftTo(-b,a)}else{this.rShiftTo(b,a)}return a}function lbit(a){if(a==0){return -1}var b=0;if((a&65535)==0){a>>=16;b+=16}if((a&255)==0){a>>=8;b+=8}if((a&15)==0){a>>=4;b+=4}if((a&3)==0){a>>=2;b+=2}if((a&1)==0){++b}return b}function bnGetLowestSetBit(){for(var a=0;a<this.t;++a){if(this[a]!=0){return a*this.DB+lbit(this[a])}}if(this.s<0){return this.t*this.DB}return -1}function cbit(a){var b=0;while(a!=0){a&=a-1;++b}return b}function bnBitCount(){var c=0,a=this.s&this.DM;for(var b=0;b<this.t;++b){c+=cbit(this[b]^a)}return c}function bnTestBit(b){var a=Math.floor(b/this.DB);if(a>=this.t){return(this.s!=0)}return((this[a]&(1<<(b%this.DB)))!=0)}function bnpChangeBit(c,b){var a=BigInteger.ONE.shiftLeft(c);this.bitwiseTo(a,b,a);return a}function bnSetBit(a){return this.changeBit(a,op_or)}function bnClearBit(a){return this.changeBit(a,op_andnot)}function bnFlipBit(a){return this.changeBit(a,op_xor)}function bnpAddTo(d,f){var e=0,g=0,b=Math.min(d.t,this.t);while(e<b){g+=this[e]+d[e];f[e++]=g&this.DM;g>>=this.DB}if(d.t<this.t){g+=d.s;while(e<this.t){g+=this[e];f[e++]=g&this.DM;g>>=this.DB}g+=this.s}else{g+=this.s;while(e<d.t){g+=d[e];f[e++]=g&this.DM;g>>=this.DB}g+=d.s}f.s=(g<0)?-1:0;if(g>0){f[e++]=g}else{if(g<-1){f[e++]=this.DV+g}}f.t=e;f.clamp()}function bnAdd(b){var c=nbi();this.addTo(b,c);return c}function bnSubtract(b){var c=nbi();this.subTo(b,c);return c}function bnMultiply(b){var c=nbi();this.multiplyTo(b,c);return c}function bnDivide(b){var c=nbi();this.divRemTo(b,c,null);return c}function bnRemainder(b){var c=nbi();this.divRemTo(b,null,c);return c}function bnDivideAndRemainder(b){var d=nbi(),c=nbi();this.divRemTo(b,d,c);return new Array(d,c)}function bnpDMultiply(a){this[this.t]=this.am(0,a-1,this,0,0,this.t);++this.t;this.clamp()}function bnpDAddOffset(b,a){while(this.t<=a){this[this.t++]=0}this[a]+=b;while(this[a]>=this.DV){this[a]-=this.DV;if(++a>=this.t){this[this.t++]=0}++this[a]}}function NullExp(){}function nNop(a){return a}function nMulTo(a,c,b){a.multiplyTo(c,b)}function nSqrTo(a,b){a.squareTo(b)}NullExp.prototype.convert=nNop;NullExp.prototype.revert=nNop;NullExp.prototype.mulTo=nMulTo;NullExp.prototype.sqrTo=nSqrTo;function bnPow(a){return this.exp(a,new NullExp())}function bnpMultiplyLowerTo(b,f,e){var d=Math.min(this.t+b.t,f);e.s=0;e.t=d;while(d>0){e[--d]=0}var c;for(c=e.t-this.t;d<c;++d){e[d+this.t]=this.am(0,b[d],e,d,0,this.t)}for(c=Math.min(b.t,f);d<c;++d){this.am(0,b[d],e,d,0,f-d)}e.clamp()}function bnpMultiplyUpperTo(b,e,d){--e;var c=d.t=this.t+b.t-e;d.s=0;while(--c>=0){d[c]=0}for(c=Math.max(e-this.t,0);c<b.t;++c){d[this.t+c-e]=this.am(e-c,b[c],d,0,0,this.t+c-e)}d.clamp();d.drShiftTo(1,d)}function Barrett(a){this.r2=nbi();this.q3=nbi();BigInteger.ONE.dlShiftTo(2*a.t,this.r2);this.mu=this.r2.divide(a);this.m=a}function barrettConvert(a){if(a.s<0||a.t>2*this.m.t){return a.mod(this.m)}else{if(a.compareTo(this.m)<0){return a}else{var b=nbi();a.copyTo(b);this.reduce(b);return b}}}function barrettRevert(a){return a}function barrettReduce(a){a.drShiftTo(this.m.t-1,this.r2);if(a.t>this.m.t+1){a.t=this.m.t+1;a.clamp()}this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);while(a.compareTo(this.r2)<0){a.dAddOffset(1,this.m.t+1)}a.subTo(this.r2,a);while(a.compareTo(this.m)>=0){a.subTo(this.m,a)}}function barrettSqrTo(a,b){a.squareTo(b);this.reduce(b)}function barrettMulTo(a,c,b){a.multiplyTo(c,b);this.reduce(b)}Barrett.prototype.convert=barrettConvert;Barrett.prototype.revert=barrettRevert;Barrett.prototype.reduce=barrettReduce;Barrett.prototype.mulTo=barrettMulTo;Barrett.prototype.sqrTo=barrettSqrTo;function bnModPow(u,f){var p=u.bitLength(),h,b=nbv(1),y;if(p<=0){return b}else{if(p<18){h=1}else{if(p<48){h=3}else{if(p<144){h=4}else{if(p<768){h=5}else{h=6}}}}}if(p<8){y=new Classic(f)}else{if(f.isEven()){y=new Barrett(f)}else{y=new Montgomery(f)}}var q=new Array(),d=3,v=h-1,a=(1<<h)-1;q[1]=y.convert(this);if(h>1){var C=nbi();y.sqrTo(q[1],C);while(d<=a){q[d]=nbi();y.mulTo(C,q[d-2],q[d]);d+=2}}var l=u.t-1,A,x=true,c=nbi(),B;p=nbits(u[l])-1;while(l>=0){if(p>=v){A=(u[l]>>(p-v))&a}else{A=(u[l]&((1<<(p+1))-1))<<(v-p);if(l>0){A|=u[l-1]>>(this.DB+p-v)}}d=h;while((A&1)==0){A>>=1;--d}if((p-=d)<0){p+=this.DB;--l}if(x){q[A].copyTo(b);x=false}else{while(d>1){y.sqrTo(b,c);y.sqrTo(c,b);d-=2}if(d>0){y.sqrTo(b,c)}else{B=b;b=c;c=B}y.mulTo(c,q[A],b)}while(l>=0&&(u[l]&(1<<p))==0){y.sqrTo(b,c);B=b;b=c;c=B;if(--p<0){p=this.DB-1;--l}}}return y.revert(b)}function bnGCD(c){var b=(this.s<0)?this.negate():this.clone();var h=(c.s<0)?c.negate():c.clone();if(b.compareTo(h)<0){var e=b;b=h;h=e}var d=b.getLowestSetBit(),f=h.getLowestSetBit();if(f<0){return b}if(d<f){f=d}if(f>0){b.rShiftTo(f,b);h.rShiftTo(f,h)}while(b.signum()>0){if((d=b.getLowestSetBit())>0){b.rShiftTo(d,b)}if((d=h.getLowestSetBit())>0){h.rShiftTo(d,h)}if(b.compareTo(h)>=0){b.subTo(h,b);b.rShiftTo(1,b)}else{h.subTo(b,h);h.rShiftTo(1,h)}}if(f>0){h.lShiftTo(f,h)}return h}function bnpModInt(e){if(e<=0){return 0}var c=this.DV%e,b=(this.s<0)?e-1:0;if(this.t>0){if(c==0){b=this[0]%e}else{for(var a=this.t-1;a>=0;--a){b=(c*b+this[a])%e}}}return b}function bnModInverse(f){var l=f.isEven();if((this.isEven()&&l)||f.signum()==0){return BigInteger.ZERO}var k=f.clone(),h=this.clone();var g=nbv(1),e=nbv(0),p=nbv(0),n=nbv(1);while(k.signum()!=0){while(k.isEven()){k.rShiftTo(1,k);if(l){if(!g.isEven()||!e.isEven()){g.addTo(this,g);e.subTo(f,e)}g.rShiftTo(1,g)}else{if(!e.isEven()){e.subTo(f,e)}}e.rShiftTo(1,e)}while(h.isEven()){h.rShiftTo(1,h);if(l){if(!p.isEven()||!n.isEven()){p.addTo(this,p);n.subTo(f,n)}p.rShiftTo(1,p)}else{if(!n.isEven()){n.subTo(f,n)}}n.rShiftTo(1,n)}if(k.compareTo(h)>=0){k.subTo(h,k);if(l){g.subTo(p,g)}e.subTo(n,e)}else{h.subTo(k,h);if(l){p.subTo(g,p)}n.subTo(e,n)}}if(h.compareTo(BigInteger.ONE)!=0){return BigInteger.ZERO}if(n.compareTo(f)>=0){return n.subtract(f)}if(n.signum()<0){n.addTo(f,n)}else{return n}if(n.signum()<0){return n.add(f)}else{return n}}var lowprimes=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509];var lplim=(1<<26)/lowprimes[lowprimes.length-1];function bnIsProbablePrime(e){var d,b=this.abs();if(b.t==1&&b[0]<=lowprimes[lowprimes.length-1]){for(d=0;d<lowprimes.length;++d){if(b[0]==lowprimes[d]){return true}}return false}if(b.isEven()){return false}d=1;while(d<lowprimes.length){var a=lowprimes[d],c=d+1;while(c<lowprimes.length&&a<lplim){a*=lowprimes[c++]}a=b.modInt(a);while(d<c){if(a%lowprimes[d++]==0){return false}}}return b.millerRabin(e)}function bnpMillerRabin(f){var g=this.subtract(BigInteger.ONE);var c=g.getLowestSetBit();if(c<=0){return false}var h=g.shiftRight(c);f=(f+1)>>1;if(f>lowprimes.length){f=lowprimes.length}var b=nbi();for(var e=0;e<f;++e){b.fromInt(lowprimes[e]);var l=b.modPow(h,this);if(l.compareTo(BigInteger.ONE)!=0&&l.compareTo(g)!=0){var d=1;while(d++<c&&l.compareTo(g)!=0){l=l.modPowInt(2,this);if(l.compareTo(BigInteger.ONE)==0){return false}}if(l.compareTo(g)!=0){return false}}}return true}BigInteger.prototype.chunkSize=bnpChunkSize;BigInteger.prototype.toRadix=bnpToRadix;BigInteger.prototype.fromRadix=bnpFromRadix;BigInteger.prototype.fromNumber=bnpFromNumber;BigInteger.prototype.bitwiseTo=bnpBitwiseTo;BigInteger.prototype.changeBit=bnpChangeBit;BigInteger.prototype.addTo=bnpAddTo;BigInteger.prototype.dMultiply=bnpDMultiply;BigInteger.prototype.dAddOffset=bnpDAddOffset;BigInteger.prototype.multiplyLowerTo=bnpMultiplyLowerTo;BigInteger.prototype.multiplyUpperTo=bnpMultiplyUpperTo;BigInteger.prototype.modInt=bnpModInt;BigInteger.prototype.millerRabin=bnpMillerRabin;BigInteger.prototype.clone=bnClone;BigInteger.prototype.intValue=bnIntValue;BigInteger.prototype.byteValue=bnByteValue;BigInteger.prototype.shortValue=bnShortValue;BigInteger.prototype.signum=bnSigNum;BigInteger.prototype.toByteArray=bnToByteArray;BigInteger.prototype.equals=bnEquals;BigInteger.prototype.min=bnMin;BigInteger.prototype.max=bnMax;BigInteger.prototype.and=bnAnd;BigInteger.prototype.or=bnOr;BigInteger.prototype.xor=bnXor;BigInteger.prototype.andNot=bnAndNot;BigInteger.prototype.not=bnNot;BigInteger.prototype.shiftLeft=bnShiftLeft;BigInteger.prototype.shiftRight=bnShiftRight;BigInteger.prototype.getLowestSetBit=bnGetLowestSetBit;BigInteger.prototype.bitCount=bnBitCount;BigInteger.prototype.testBit=bnTestBit;BigInteger.prototype.setBit=bnSetBit;BigInteger.prototype.clearBit=bnClearBit;BigInteger.prototype.flipBit=bnFlipBit;BigInteger.prototype.add=bnAdd;BigInteger.prototype.subtract=bnSubtract;BigInteger.prototype.multiply=bnMultiply;BigInteger.prototype.divide=bnDivide;BigInteger.prototype.remainder=bnRemainder;BigInteger.prototype.divideAndRemainder=bnDivideAndRemainder;BigInteger.prototype.modPow=bnModPow;BigInteger.prototype.modInverse=bnModInverse;BigInteger.prototype.pow=bnPow;BigInteger.prototype.gcd=bnGCD;BigInteger.prototype.isProbablePrime=bnIsProbablePrime;var RSAPublicKey=Class.create({initialize:function(b,a){this.modulus=new BigInteger(b,16);this.encryptionExponent=new BigInteger(a,16)},getModulus:function(){return this.modulus},getEncryptionExponent:function(){return this.encryptionExponent}});var UTF8=new (Class.create({encode:function(d){d=d.replace(/\r\n/g,"\n");var c="";for(var b=0;b<d.length;b++){var a=d.charCodeAt(b);if(a<128){c+=String.fromCharCode(a)}else{if((a>127)&&(a<2048)){c+=String.fromCharCode((a>>6)|192);c+=String.fromCharCode((a&63)|128)}else{c+=String.fromCharCode((a>>12)|224);c+=String.fromCharCode(((a>>6)&63)|128);c+=String.fromCharCode((a&63)|128)}}}return c},decode:function(d){var b="";var c=0;var a=$c1=$c2=0;while(c<d.length){a=d.charCodeAt(c);if(a<128){b+=String.fromCharCode(a);c++}else{if((a>191)&&(a<224)){$c2=d.charCodeAt(c+1);b+=String.fromCharCode(((a&31)<<6)|($c2&63));c+=2}else{$c2=d.charCodeAt(c+1);$c3=d.charCodeAt(c+2);b+=String.fromCharCode(((a&15)<<12)|(($c2&63)<<6)|($c3&63));c+=3}}}return b}}))();var Base64=new (Class.create({initialize:function(){this.base64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},encode:function(b){if(!b){return false}var d="";var k,f,c;var h,g,e,a;var l=0;do{k=b.charCodeAt(l++);f=b.charCodeAt(l++);c=b.charCodeAt(l++);h=k>>2;g=((k&3)<<4)|(f>>4);e=((f&15)<<2)|(c>>6);a=c&63;if(isNaN(f)){e=a=64}else{if(isNaN(c)){a=64}}d+=this.base64.charAt(h)+this.base64.charAt(g)+this.base64.charAt(e)+this.base64.charAt(a)}while(l<b.length);return d},decode:function(g){if(!g){return false}g=g.replace(/[^A-Za-z0-9\+\/\=]/g,"");var d="";var e,c,b,a;var f=0;do{e=this.base64.indexOf(g.charAt(f++));c=this.base64.indexOf(g.charAt(f++));b=this.base64.indexOf(g.charAt(f++));a=this.base64.indexOf(g.charAt(f++));d+=String.fromCharCode((e<<2)|(c>>4));if(b!=64){d+=String.fromCharCode(((c&15)<<4)|(b>>2))}if(a!=64){d+=String.fromCharCode(((b&3)<<6)|a)}}while(f<g.length);return d}}))();var Hex=new (Class.create({initialize:function(){this.hex="0123456789abcdef"},encode:function(d){if(!d){return false}var a="";var b;var c=0;do{b=d.charCodeAt(c++);a+=this.hex.charAt((b>>4)&15)+this.hex.charAt(b&15)}while(c<d.length);return a},decode:function(c){if(!c){return false}c=c.replace(/[^0-9abcdef]/g,"");var a="";var b=0;do{a+=String.fromCharCode(((this.hex.indexOf(c.charAt(b++))<<4)&240)|(this.hex.indexOf(c.charAt(b++))&15))}while(b<c.length);return a}}))();var ASN1Data=Class.create({initialize:function(a){this.error=false;this.data=this.parse(a)},hasError:function(){return this.error},getData:function(){return this.data},parse:function(c){if(!c){this.error=true;return null}var b=[];while(c.length>0){var a=c.charCodeAt(0);c=c.substr(1);var f=0;if((a&31)==5){c=c.substr(1)}else{if(c.charCodeAt(0)&128){var e=c.charCodeAt(0)&127;c=c.substr(1);if(e>0){f=c.charCodeAt(0)}if(e>1){f=((f<<8)|c.charCodeAt(1))}if(e>2){this.error=true;return null}c=c.substr(e)}else{f=c.charCodeAt(0);c=c.substr(1)}}var d="";if(f){if(f>c.length){this.error=true;return null}d=c.substr(0,f);c=c.substr(f)}if(a&32){b.push(this.parse(d))}else{b.push(this.value((a&128)?4:(a&31),d))}}return b},value:function(e,d){if(e==1){return d?true:false}else{if(e==2){return d}else{if(e==3){return this.parse(d.substr(1))}else{if(e==5){return null}else{if(e==6){var b=[];var l=d.charCodeAt(0);b.push(Math.floor(l/40));b.push(l-b[0]*40);var f=[];var g=0;var k;for(k=1;k<d.length;k++){var c=d.charCodeAt(k);f.push(c&127);if(c&128){g++}else{var h;var a=0;for(h=0;h<f.length;h++){a+=f[h]*Math.pow(128,g--)}b.push(a);g=0;f=[]}}return b.join(".")}}}}}return null}});var RSA=new (Class.create({initialize:function(){},getPublicKey:function(b,a){return new RSAPublicKey(b,a)},encrypt:function(a,b){if(!b){return false}a=this.pkcs1pad2(a,(b.getModulus().bitLength()+7)>>3);if(!a){return false}a=a.modPowInt(b.getEncryptionExponent(),b.getModulus());if(!a){return false}a=a.toString(16);return Base64.encode(Hex.decode(a))},pkcs1pad2:function(a,c){if(c<a.length+11){return null}var b=[];var d=a.length-1;while(d>=0&&c>0){b[--c]=a.charCodeAt(d--)}b[--c]=0;while(c>2){b[--c]=Math.floor(Math.random()*254)+1}b[--c]=2;b[--c]=0;return new BigInteger(b)}}))();var keyStr="-----BEGIN PUBLIC KEY-----AAAAB3NzaC1yc2EAAAABIwAAAQEAxciqZy9srF9UEtmK57AmlLmJ5SOV0EmsoHkVl+bcdtgercMy9vSZ4Zyvbf/yEXP1KOPzcqauZafAy65A1BrhdBDBy4gfYbR7cb+Q9Y6zgQ11ciMJVWKUQEbvGGcsbxHs3aXoYl1CSymzpGhUROnSd1pKiQgbscc0gLuLmvv/z0SNGGM45N62DRWOQanzf1FoRjZorvmgcnTN9Jx0ABbW0gm+GoXxK0IzzQpeqidYTCgpAosv/a53Iw/eGPSDcCE7z8Mdk1f90/oVmfIGK2LQsDPsgIZQ2xg0o6eh5HMf1HlGrsV8UTPcOMYAsERsnz0191UQ8iv98/d8VcF+oQayfQ==-----END PUBLIC KEY-----";var keyModulus="c5c8aa672f6cac5f5412d98ae7b02694b989e52395d049aca0791597e6dc76d81eadc332f6f499e19caf6dfff21173f528e3f372a6ae65a7c0cbae40d41ae17410c1cb881f61b47b71bf90f58eb3810d757223095562944046ef18672c6f11ecdda5e8625d424b29b3a4685444e9d2775a4a89081bb1c73480bb8b9afbffcf448d186338e4deb60d158e41a9f37f5168463668aef9a07274cdf49c740016d6d209be1a85f12b4233cd0a5eaa27584c2829028b2ffdae77230fde18f48370213bcfc31d9357fdd3fa1599f2062b62d0b033ec808650db1834a3a7a1e4731fd47946aec57c5133dc38c600b0446c9f3d35f75510f22bfdf3f77c55c17ea106b27d";var keyExp="23";var pubKey=RSA.getPublicKey(keyModulus,keyExp);var BrowserUpdate={browsers:["Microsoft<br />Internet Explorer 8","Mozilla<br />Firefox 3.6","Apple<br />Safari 4","Opera Software<br />Opera 10.10","Google<br />Chrome 4"],links:["http://www.microsoft.com/windows/Internet-explorer/default.aspx","http://www.mozilla.com/firefox/","http://www.apple.com/safari/download/","http://www.opera.com/download/","http://www.google.com/chrome"],imgs:["background: url('images/png.png') -305px -24px; width: 79px; height: 80px; display: inline-block;","background: url('images/png.png') -54px -24px; width: 83px; height: 80px; display: inline-block;","background: url('images/png.png') -230px -24px; width: 74px; height: 80px; display: inline-block;","background: url('images/png.png') -138px -24px; width: 92px; height: 80px; display: inline-block;","background: url('images/png.png') -385px -24px; width: 84px; height: 80px; display: inline-block;"],dom:null,init:function(){if(window.oldIE){BrowserUpdate.show()}},show:function(){if(!BrowserUpdate.dom){BrowserUpdate.buildUI()}_s(BrowserUpdate.dom.style,"display","");_s($.disablingOverlay.style,"display","")},hide:function(){_s(BrowserUpdate.dom.style,"display","none");_s($.disablingOverlay.style,"display","none")},buildUI:function(){var c="browser";if(/MSIE\s*\d/.test(navigator.userAgent)){c="Internet Explorer"}else{if(/Firefox\/\d/.test(navigator.userAgent)){c="Firefox";BrowserUpdate.setFirstBrowser(1)}else{if(/Safari\/\d/.test(navigator.userAgent)){c="Safari";BrowserUpdate.setFirstBrowser(2)}}}var b="<h1>"+Util.sprintf(Strings.oldBrowserH,c)+"</h1>"+Strings.oldBrowserMsg+'<div class="browserIconHolder">';for(var a=0;a<BrowserUpdate.browsers.length;a++){b+='<a class="browserIcon" target="_blank" href="'+BrowserUpdate.links[a]+'"><div style="text-align: center"><span style="'+BrowserUpdate.imgs[a]+'">&nbsp;</span></div><hr /><span>'+BrowserUpdate.browsers[a]+"</span></a>"}b+="</div><div>"+Strings.oldBrowserRecommend+'</div><img id="newBrowserScreenshot" src="'+Strings.newBrowserScreenshot+'" /><div style="text-align: center;">'+HTML.parse('<aj:button action="BrowserUpdate.hide()">'+Strings.oldBrowserDismiss+"</aj:button>",{button:true})+"</div>";BrowserUpdate.dom=document.createElement("div");_s(BrowserUpdate.dom,"className","browserUpdate expanded");_s(BrowserUpdate.dom,"innerHTML",b);_an(document.body,BrowserUpdate.dom)},setFirstBrowser:function(a){BrowserUpdate.browsers=BrowserUpdate.browsers.splice(a,1).concat(BrowserUpdate.browsers);BrowserUpdate.links=BrowserUpdate.links.splice(a,1).concat(BrowserUpdate.links);BrowserUpdate.imgs=BrowserUpdate.imgs.splice(a,1).concat(BrowserUpdate.imgs)}};function canInit(){return !isIE||typeof G_vmlCanvasManager!="undefined"}if(window.initOnLoad){(function(){if(canInit()){init()}else{setTimeout(arguments.callee,1)}})()};