
/*  ------------------------------------------------------------------------
                                TongXue | zh_cn.js
    ------------------------------------------------------------------------  */



// Locale: zh_cn
var _string_table = {"sh:loading":"加载中...","sh:cancel-button":"取消","sh:submit-button":"提交","sh:ok-button":"确定","sh:confirm-button":"确定","sh:close-button":"关闭","sh:download-button":"下载","sh:required":"This field is required.","sh:error-occurred":"发生一处错误.","sh:session-timeout":"您未登录的时间过长,请重新登录.","sh:password-prompt":"密码:","sh:hide-link":"隐藏","sh:show-link":"显示","sh:undo":"自动","sh:delete":"删除","fb:newsfeed":"News Feed","fb:minifeed":"Mini-Feed","dt:monthdate":"{month} {date}","dt:january":"一月","dt:february":"二月","dt:march":"三月","dt:april":"四月","dt:may":"五月","dt:june":"六月","dt:july":"七月","dt:august":"八月","dt:september":"九月","dt:october":"十月","dt:november":"十一月","dt:december":"十二月","dt:jan":"Jan","dt:feb":"Feb","dt:mar":"Mar","dt:apr":"Apr","dt:jun":"Jun","dt:jul":"Jul","dt:aug":"Aug","dt:sep":"Sep","dt:oct":"Oct","dt:nov":"Nov","dt:dec":"Dec","dt:monday":"星期一","dt:tuesday":"星期二","dt:wednesday":"星期三","dt:thursday":"星期四","dt:friday":"星期五","dt:saturday":"星期六","dt:sunday":"星期天","dt:mon":"Mon","dt:tue":"Tue","dt:wed":"Wed","dt:thu":"Thu","dt:fri":"Fri","dt:sat":"Sat","dt:sun":"Sun","dt:today":"今天","dt:yesterday":"昨天","ac01":"需要使用此功能设置访问权限. 如果你不想设置你的访问权限, 不用理会此功能.","ac02":"您必须选取复选框来设置这些功能的优先权. 如果你不想设置, 点击取消.","ads01":"您提交的信息有一处错误.","ads02":"网络新鲜事","ads03":"网络新鲜事将被自动添加.","ads04":"There was an error processing your action.","ads05":"You have not finished creating your ad.If you leave this page, your ad will not be saved.","ads:primary-link":"Make this your primary credit card.","ads:remove-link":"Remove this card from your account.","ads:primary-dialog-1":"This is your primary credit card. We will attempt to bill invoices against your primary credit card first. However, in the event that a payment fails, we will attempt to bill other credit cards associated with your account.","ads:primary-dialog-2":"You cannot edit or remove your primary credit card.  In order to remove this card, you must first make another verified credit card the primary card.  To edit the billing details for this card, add it again and then remove the original entry for the card.","ads:verified-dialog-1":"This is a verified credit card. The information you have provided has passed verification, so you can designate this credit card as your primary credit card.","ads:verified-dialog-2":"If you make this credit card your primary credit card, then invoices will attempt to billed against it first. However, if a payment were to fail, we would attempt to bill other credit cards associated with your account.","ads:verified-dialog-3":"You cannot delete this credit card because it is the only verified credit card associated with your account.","ads:unverified-dialog-1":"This is an unverified credit card. The information that you have provided has not passed verification, so you cannot designate this credit card as your primary credit card.","ads:unverified-dialog-2":"In order to pass verification, you must remove this credit card and add it back with the correct information.","ads:unverified-dialog-3":"You cannot remove this credit card because it is the only credit card associated with your account. In order to pass verification, you will need to add a new credit card.","ads:edit-title-add":"Add Credit Card","ads:edit-action-add":"Save Credit Card","ads:remove-title":"Remove Credit Card","ads:remove-action":"Remove","ads:remove-dialog":"Are you sure that you want to remove this card from your account?","ads:primary-title":"Change Primary Credit Card","ads:primary-action":"Make Primary","ads:primary-dialog":"Are you sure that you want to make this your primary card?","ads:info-title":"Credit Card Information","ads:show-details":"show details","ads:hide-details":"hide details","ads:csc-text":"A Card Security Code (CSC) is a security feature of debit and credit cards that helps fight credit card fraud.  The following images illustrate where to find the CSC code on your Visa, Mastercard, Discover, or American Express card.","ads:csc-title":"What's a CSC code?","ads:cap-warning-title":"There is a chance that your ad's title may not meet our capitalization guidelines and could cause your ad to be rejected. Your ad may not include excessive or incorrect capitalization. Acronyms, however, may be capitalized. If you believe your ad uses standard and proper capitalization, please disregard this message.","ads:cap-warning-body":"There is a chance that your ad's body may not meet our capitalization guidelines and could cause your ad to be rejected. Your ad may not include excessive or incorrect capitalization. Acronyms, however, may be capitalized. If you believe your ad uses standard and proper capitalization, please disregard this message.","ads:cap-warning-both":"There is a chance that your ad's title and body may not meet our capitalization guidelines and could cause your ad to be rejected. Your ad may not include excessive or incorrect capitalization. Acronyms, however, may be capitalized. If you believe your ad uses standard and proper capitalization, please disregard this message.","af01":"加载中...","af02":"Close","af03":"加为好友","af04":"确认","af05":"不关心","af06":"不知道","af07":"取消","af08":"好友请求","amd01":"对不起, 现在不能完成此项操作.","amd02":"Show on profile","amd03":"Hide from profile","ame01":"Delete Track?","ame02":"删除","ame03":"上传音频文件的时候发生了一处错误. 请重新尝试.","ame04":"音频文件已成功上传.","ame05":"An error occurred while uploading your audio artwork. 请重新尝试.","ame06":"Audio Artwork Uploaded.","amu01":"你必须确认你有权限在上传文件之前就可以发布此文件.","ap01":"Away: {away-msg}","ap02":"在线","ap03":"手机","ap04":"离线","ap05":"Idle","apps01":"Getting results...","apps:remove-title":"移除 {功能名}?","apps:remove-body":"当你移除此功能时,它将不在你的文档、功能菜单、{以及功能链接的编辑出版页面}里出现.如果你想要重新使用此功能, 你将需要重新添加此功能.","apps:remove-edit-link":"功能编辑","apps:remove-prompt":"你想要移除 {功能名}?","apps:remove-button":"移除","apps:page-title":"为什么我不能将此功能添加到我的个人主页?","apps:page-body":"Facebook applications for Pages can be specialized for certain Page categories (e.g. Restaurants or Bands). Either you have no Pages that fit the category of this application, or you have already added this application to your eligible Pages.","arev:close-button":"关闭","arev:delete-button":"删除","arev:post-button":"请求","arev:post-success":"请求成功.","arev:required-fields":"You have not filled out all the required fields.","arev:no-rating":"You must choose a star rating","at01":"Attach","base01":"更多","base02":"收缩","cal:createSuccess":"{event_title} has been created.","cal:accept":"接受","cal:decline":"拒绝","cal:decideLater":"考虑一下","cal:newItem":"New Calendar Item","cal:rsvpAccepted":"The calendar item has been accepted.","cal:rsvpDeclined":"The calendar item has been removed from your calendar.","cal:rsvpRequested":"Your RSVP status has been set to undecided.","cal:rsvpDefault":"Your RSVP status has been changed.","cal:deleteWarningTitle":"Delete Item?","cal:deleteWarningMessage":"Are you sure that you want to delete this item?  If you delete this item all of the attendees will be notified.  This action CANNOT be undone.","can01":"Report","can02":"取消","can03":"Application Reported","can04":"谢谢","cc01":"There was a problem getting a new captcha for you. 请点击你浏览器上的重新加载按钮.","cd01":"Remove Card?","cd02":"Are you sure you want to remove this credit card from your account?","cd03":"Remove","cf01":"Please use mm\/dd\/yyyy format for date.","cf02":"Please include your birth day, month, and year","cf03":"There was a problem submitting your message. Please send an email to {cs-info-email}","cf04":"请完善你的超级好友","cf05":"To find this info on a PC right click My Computer and select \"Properties;\" On a  Mac click on the Apple in the upper left hand corner and select \"About this Mac\"","cf06":"怎样查看我的计算机处理器的类型?","cf07":"怎样查看我的计算机的内存容量?","cf08":"我的照片被编辑了吗?","cf09":"照片中被编辑的实例去除红眼或者在Photoshop里面编辑它.","chb01":"不能重新找回朋友列表.","chb02":"{number-available} Available","chd01":"聊天","chd02":"显示\/隐藏 {聊天} 窗口","chd03":"关闭 {聊天} 窗口","chd04":"隐藏 {聊天} 窗口","chd05":"从{名字}获得新消息!","chd06":"新消息!","chs01":"Couldn't set {Chat} availability","chs02":"Couldn't set your {Mini-Feed} privacy","cht01":"不能找回聊天记录","cht02":"消息不能发送:","cht03":"发送:","cht04":"更新 {时间}","cht05":"发消息给 {名字}","cht06":"You are not available to chat.","cht07":"{name} is not available to chat.","cf:friend_title":"You have a friend request.","cf:ignore-button":"Ignore Request","ci:user-request":"This user will receive your friend request shortly.","ci:users-request":"These users will receive your friend requests shortly.","ci:user-success":"成功! 一个好友请求已被发送给你的朋友. 如果你的朋友确认你们的好友关系, 你们将可以看到彼此的主页.","ci:users-success":"成功! 好友请求将被发送给(数字)位朋友，如果他们确认你们的好友关系，你们将可以看到彼此的个人主页.","cm01":"入学时间:","de01":"确认提交前你必须选取入学的年份.","de02":"你的功能公告被我们的用户标识为垃圾邮件, 意思是，未添加你的功能的用户不能看到你的公告.","de03":"To reduce your spam level, we recommend only sending notifications to users when a friend explicitly takes an action that directly affects that specific user - 例如, our applications have notifications like \"[name] tagged you in a photo.\" or \"[name] wrote on your Wall.\"","de04":"You can request to unblock it, but keep in mind your ability to do so will be on a sliding scale.","de05":"Specifically, the first time you can unblock your application immediately, but every consecutive time you will be forced to wait an additional 30 days longer than you waited for the previous unblock.  So please make sure that it is no longer as spammy <b>before<\/b> requesting to unblock it.","de06":"Remember, if your application is blocked again, you will have to wait for a longer period of time, so please be careful!","de07":"Unblock Application?","de08":"Yes, unblock it","de09":"Please return here in approximately {days-left} days, and you will be allowed to unblock your application.  Please email developers-help@facebook.com if you have any further questions.","de10":"Your application has been blocked","de11":"The spamminess score reflects our users' reactions to your application's notifications (sent via notifications.send).  If your score goes above a certain limit, users who have not added your application will not be able to see its notifications.","de12":"What is \"spamminess\"?","ded01":"Untitled Track","ded02":"edit","ded03":"delete","ded04":"No tracks in album","dep01":"取消","dg01":"清除回答","dr01":"删除这个模板?","dr02":"删除模板?","dr03":"删除","ea01":"公告设置","ea02":"选择 <strong>开<\/strong> Email地址用来接收当有操作发生的提醒.","ea03":"选择 <strong>每天日记<\/strong> 一个email每天用来接收你所有的新鲜事提醒.","ea04":"选择<strong>关<\/strong>　来停止用于接收所有提示的Email.","ea05":"你输入的名字已经是你的名字.","ea06a":"移除Email地址","ea06b":"移除这个email address, please enter your Facebook password.","ea07a":"Change Contact Email Address","ea07b":"To change your contact email地址, 请输入你在网学网帐号的密码.","ea08a":"修改安全提示问题","ea08b":"修改安全提示问题, 输入你在网学网帐号的密码.","eb01":"Delete Badge?","eb02":"Are you sure you want to delete this badge?","eb03":"删除","eb04":"Error loading badge.","eb05":"Cannot remove the last item.","ec01":"Follow the simple steps below to create a working skeleton for your Application.","ec02":"Step 1: Download Facebook's PHP Library","ec03":"Extract this archive into a directory on your hosting server where you can host and run PHP code (let's call this directory MY_DIR)","ec04":"Step 2: Create An 'index.php' File","ec05":"It should look like this, and should also go into MY_DIR:","ec06":"Step 3: Test Your Application","ec07":"You're almost done!","ec08":"Head over to your Canvas Page URL to test your application:","ec09":"Now we just need to know where your application is hosted.","ec10":"Edit Settings","ec11":"{edit_settings} for your application and enter the <b>Callback URL<\/b> that corresponds to the MY_DIR directory","ec12":"Quick Creation Guide For '{app_name}'","ec13":"Done","ec14":"We just need to know two more things. {edit_settings} for your application and enter:","ec15":"The <b>Callback URL<\/b> - where your app is hosted.","ec16":"The <b>Canvas Page URL<\/b> - the apps.facebook.com\/yourapp URL for your application.","ec17":"We just need you to specify the <b>apps.facebook.com\/yourapp<\/b> URL for your application. {edit_settings} for your app and choose a <b>Canvas Page URL<\/b>.","eev01":"游客列表","eev02":"the wall","eev03":"videos","eev04":"photos","eev05":"用户可以将自己添加到游客列表，以及邀请其它人加入活动. 每个人都可以看到活动的信息.","eev06":"只有你邀请的人才会显示在游客列表中.  用户也可以请求被邀请. 所有人都可以看到活动的时间及信息.","eev07":"活动不会出现在搜索结果里. 只有你邀请的人才能看到活动的信息.","eev08":"请确认活动开始及结束的时间.","eev09":"在同学网，一个活动从开始到结束只能持续31天.","eev10":"一个没有开始的活动不用考虑结束.","eev11":"只有那些被邀请的人才可以看到下面的信息:","eev12":"活动名称","eev13":"活动网络","eev14":"活动组办主","eev15":"活动类型","eev16":"活动地点","eev17":"城市","eev18":"电话","efg01":"名字","efg02":"描述","efg03":"请填写所有必填信息.","efg04":"你必须提供一个问题.","efg05":"你必须提供至少两个答案.","efg06":"你必须提供一个问题还有至少两个答案.","efg07":"在群组里隐藏","efg08":"在群组里显示","efg09":"这个投票显示在群组里.","efg10":"你可以设置在群组里隐藏此投票或者让它显示.","efg11":"此投票在群组里隐藏.","efg12":"你可以设置此投票在群组里显示或让它隐藏.","eg01":"讨论区","eg02":"留言板","eg03":"视频","eg04":"相册","eg05":"posted items","eg06":"所有人可以加入或邀请他人加入.所有人可以看到群组的信息.","eg07":"需要批准才能允许他人加入群组. 所有人可以看到群组的信.","eg08":"在搜索结果或者该群组成员的个人主页都不会显示该群组的信息. 加入群组只能通过被邀请的方式,只有群组成员可以看到群组的信息.","eg09":"请填写所有必填信息","eg10":"你没有为该用户填写一个标题!","eg11":"名字","eg12":"网络","eg13":"描述","eg14":"群组类型","eg15":"只有群组成员可以看到以下的信息:","el01":"{thing-1}被请求.","el02":"{thing-1} 和 {thing-2}被请求.","el03":"{thing-1}, {thing-2}, 以及 {thing-3} 被请求.","el04":"{thing-1}, {thing-2}, {thing-3}, 以及 {thing-4} 被请求.","el05":"{thing-1}, {thing-2}, {thing-3}, 以及 {数字} 其它的事件被请求.","el06":"{thing-1} 出现问题.","el07":"{thing-1} 以及 {thing-2} 出现问题.","el08":"{thing-1}, {thing-2}, and {thing-3}出现问题.","el09":"{thing-1}, {thing-2}, {thing-3}, 以及{thing-4} 出现问题.","el10":"{thing-1}, {thing-2}, {thing-3},以及 {num} 以及地方出现问题.","el11":"Country","el12":"国家","el13":"省","eobj:gp":"设置让此群组显示有网络页面及搜索结果页面.","eobj:ev":"设置让此活动显示在网络页面及搜索结果页面.","eobj1":"{item1} 可见","eobj2":"{item1} 以及 {item2}可见","eobj3":"{item1}, {item2} 以及 {item3} 可见","eobj4":"{item1}, {item2}, {item3} 以及  {item4}可见","eobj5":"{item1}, {item2}, {item3}, {item4} 以及 {item5} 可见","eobj6":"{item1}, {item2}, {item3}, {item4}, {item5} 以及 {item6} 可见","eobj7":"{item1}, {item2}, {item3}, {item4}, {item5}, {item6} 以及 {item7} 可见","ep01":"Type your major or minor","epi01":"发生一些错误.请稍后重试.","ev01":"You are attending.","ev02":"You may be attending.","ev03":"You are not attending.","evp01":"Remove event?","evp02":"你确定要从{event-name}移除你的成员?","evp03":"移除","fa01":"你必须指定一个SWF文件夹.","fa02":"你必须指定一个预览图片文件夹.","fa03":"你必须指定一个宽度","fa04":"你必须指定一个高度","fbjs01":"加载好友列表...","fbjs02":"tel:","fbjs03":"刚刚更新过","fbjs04":"加载好友列表...","fbjs05":"你将要添加{name}为你的好友. 我们也将通告给{name}, 他(她)将确认你们的好友关系.","fbjs06":"您还没有写任何消息,所以我们不能发送!","fbjs07":"对不起,有一处错误提醒,我们不能发送你的消息.","fbjs08":"搜索...","fg:saved-setting":"保存设置.","fg:reset-settings":"重新设置.","fg:restored-setting":"还原设置.","fl01":"列表中还没有添加好友.","fl02":"列表中存在一个好友.","fl03":"列表中存在 {count} 个好友.","fl04":"新列表","fl05":"从列表中移除?","fl06":"你确定要从好友列表中将 {name} 移除吗?","fl07":"从列表中移除","fl08":"从好友里移除","fl10":"移除好友?","fl11":"你确定要将{name}移除吗? {name} 将不会被告之.","fl12":"移除好友","fl13":"列表已经被更新.","fl14":"栅格","fl15":"搜索结果","fl16":"添加到列表...","fl17":"添加到 \"{list}\"","fl18":"对不起,发生一处错误.","flash:upgrade-required":"Flash播放器更新请求","flash:upgrade-explanation":"Flash {required-version} is required to view this content. Your current version is {current-version}.请下载最新版的Flash播放器.","fp00":"remove","fp01":"不能完成添加好友. 您的好友数目超过了此设置数目的上限,.","fp02":"移除好友里发生了一处错误.","fp03":"保存设置.","fp04":"重新设置.","fp05":"还原设置.","fph00":"如何使用?","fph01":"每天有很多你好友的新鲜事提醒,设置分类可以帮助你更快找到你更关心的内容.","fph02":"存储:","fph03":"Moving a slider all the way to the top means that you will see that story type more often, provided your friends are taking that action.","fph04":"Moving a slider all the way to the bottom means that you will see that story type less often, but you may see it on occasion.","fph05":"Moving all the sliders down to the bottom will not turn off News Feed.","fph06":"These sliders are pretty sensitive, and your News Feed tastes may change - you may want to readjust your preferences from time to time.","fph07":"关闭","gft01":"删除礼物?","gft02":"你确定要删除这个礼物吗?  它会从你的个人主页及本页面中移除. 此操作一旦完成不能还原.","gft03":"删除","gft04":"设置礼物为隐私,别人不可见?","gft05":"你确定要设置礼物为隐私,只有发送者与接受者可见吗?  . 此操作一旦完成不可还原.","gft06":"设置成为隐私","gp01":"移除群组成员?","gp02":"你正在从只剩下你一个人的群组中移除自己,如果你将自己移除,那么这个群组将被删除.","gp03":"你是群组唯一的管理员,你正在尝试将自己移除这个群组,一旦操作成功,你将无法再次拿回这些特权. 管理员的身份将被群组里的其它用户来接替.","gp04":"你是群组的管理员,你现在正试图将自己移除这个群组. 一旦操作成功,你将无法再次拿回这些特权.","gp05":"你确定要将自己从(群组名)中将自己移除吗?","gp06":"移除","gp07":"加入","gp08":"你想要加入(群组名)?","gp09":"添加群组成员?","gs:no-suggestions":"There are no suggestions, this may be because you are logged out.","gs:please-login":"Please log in for country options.","gsh01":"只显示那些还没有拥有的礼物的名字","he01":"大学名字:","he02":"大学Email:","he03":"高中名字:","he04":"高中Email:<br \/><small>(optional)<\/small>","he05":"公司名字:","he06":"公司Email:","he07":"地区名字:","he08":"网络名字:","he09":"网络Email:","hm01":"我不喜欢","hm02":"我喜欢","hm03":"取消","hm04":"你的反馈信息可以让我们给你更好的新鲜事提示的内容.想要取消, 请再次点击按钮图标.此操作其它用户不可见.","hm05":"icon","hm07":"thumbs up icon","hm10":"x icon","inbox:are-you-sure-delete-single":"确定要删除这封信件?","inbox:are-you-sure-delete-plural":"确定要删除这些信件?","inbox:this-will-remove-messages":"这样将会移除相关消息。","inbox:delete-thread-title":"删除信件","inbox:delete-button":"删除","inbox:security-check":"安全检查","inbox:MSG_ERR_NO_BODY":"站内信内容不能为空。","inbox:MSG_ERR_TOO_LONG":"内容太长了...","inbox:MSG_ERR_NO_RECIP":"你必须填写至少一个收件人.","inv01":"你正在试图将自己从这个(实体类型)中将自己移除.","inv02":"你正在试图将(用户名)从(实体类型)中移除.","inv03":"由于你是这个实体里的最后一个成员,如果你将自己从实体中移除将会使得这个实体被删除.","inv04":"你将不能获得特权除非别人再次邀请你成为管理员.","inv05":"你确定要将自己移除吗?","inv06":"你确定要将(用户名)移除吗?","inv07":"你确定要将(用户名)添加为管理员? 它将会使(用户名)在这个实体中跟你有一样的权限.","inv08":"你正在试图去除自己的管理员身份.","inv09":"你想要去除(用户名)的管理员身份.","inv10":"你正在试图去除自己的管理员身份?","inv11":"你想要去除(用户名)的管理员身?","inv12":"移除管理员身份","inv13":"升为管理员","inv14":"移除","inv15":"永远禁止","inv16":"只显示(成员标签)","inv17":"Showing {display-count} out of {total-count} {member-label}","inv18":"还没有一个人发出过邀请.","inv19":"{未知数目} 成员还没有发出过邀请.","inv20":"不能添加用户.","inv21":"请稍后重试.","inv22":"一个弹出框被阻止.","iphone:done":"完成","iphone:edit":"编辑","iphone:to:":"To:","iphone:send":"通话","iphone:reply":"答复","iphone:stop":"挂断","iphone:cannot-delete-thread":"Sorry, there was an error and we cannot delete the thread.","iphone:are-you-sure-cancel":"Are you sure you want to cancel and lose what you've written?","iphone:sorry-there-was-an-error":"对不起,由于出现错误程序,我们不能发送你的信息.","iue:dl-common-instructions":"网络多媒体对象技术控制区文件下载可以使文件下载变得又快又方便. 你可以选择你需要的文件,然后轻松点击\"下载\"按钮就可以了.安装程序需要花费几分钟,请耐心等待.","iue:dl-not-winxp-sp2":"安装File Downloader, 请重新载入页面,当你看到程序安装的对话框的时候点击\"是的\" 按钮.","iue:dl-winxp-sp2":"安装File Downloader, please click the Information Bar. After page reloads click \"Yes\" when you see the control installation dialog.","iue:install-instructions":"Please install the <b>Active X Control<\/b>. This control enables you to upload photos quickly and easily.<br><br>You should be seeing a prompt, either in the form of a pop-up window or a yellow bar at the top of this window. Confirm that you would like to <b>install<\/b> the Active X Control. Installation might take a few minutes; please be patient.<br><br>If the Active X Control is incompatible with your computer or you don't want to install it, you can always use our {Simple Uploader}. It will enable you to create albums, but it won't be as fast or as easy as the Active X Control.","iue:simple-uploader":"Simple Uploader","ip01":"See all...","in01":"in Ones","in10":"in Tens","in100":"in Hundreds","in1k":"in Thousands","in10k":"in Tens of Thousands","in100k":"in Hundreds of Thousands","in1m":"in Millions","in10m":"in Tens of Millions","in100m":"in Hundreds of Millions","in1b":"in Billions","mb01":"The box cannot be placed any higher in this column.","mb02":"This box cannot be moved into this column.","mb03":"Move profile boxes below this line, and they will only appear in the extended version of your profile.","mc01":"移除列表?","mc02":"Did this listing result in a success?","mc03":"是","mc04":"否","mc05":"移除","mc06":"移除视频?","mc07":"你确定要移除视频吗?","mc08":"视频","mc09":"好的","mfs00":"Add <strong>up to {limit}<\/strong> of your friends by clicking on their pictures below.","mfs01":"You have already selected the maximum number of friends for the day.","mfs02":"You have no unselected friends.","mfs03":"You may only select {maximum} friends.","mfs04":"You have no selected friends.","mfs05":"Only {remaining-friends} more","mfs06":"Limit is {limit}","mfs07":"You are viewing 1 friend in {network}","mfs08":"You are viewing {count} friends in {network}","mfs09":"你还没有选择任何人.","mfs10":"You have already selected {maximum} people.","mo01":"在这里输入文本","mo02":"预览? 您还没有输入任何的文字.","mo03":"对不起! 程序发生某种错误,请重试.","mo04":"没有关于这份文本的回答!","moba01":"你确定要移除这个电话号码?","moba02":"你将不能再使用这个电话号码接收同学网的电话\新鲜事提示及上传图片到同学网.","moba03":"Remove Phone","moba04":"You must confirm this phone to receive notifications or upload any photos and videos to Facebook.","mob:confirmed":"Your mobile phone has been confirmed.","mob:error":"Sorry, an unknown error occurred. Please try again.","ms:turn-off-sms-title":"Do you want to stop receiving sms from {app_name}?","ms:turn-off-sms-content":"This will turn off sms from this application.","ms:turn-off-sms-button":"Turn off","ms:mark-sms-spam-button":"Turn off and mark spam","ms:turn-on-sms-title":"Do you want to enable sms from {app_name}?","ms:turn-on-sms-content":"This will enable sms from this application.","ms:turn-on-sms-button":"Enable","na01":"Leave {network_name} Network","na02":"Leave Network","na03":"Make {network_name} Network Primary","na04":"Make Primary","na05":"{network_name} Network Settings","na06":"保存设置","na07":"修改地区网络","na08":"修改网络","notif:hidden":" {application-name} 提示已经被隐藏。","notif:hide-and-mark-button":"Hide all and mark spam","notif:hide-button":"隐藏全部","notif:hide-desc":"这样会隐藏同一类型的全部提示。","notif:hide-title":"你要隐藏全部{application-name}提示 ?","notif:mark-as-spam":"Mark {application-name} as spam","notif:marked-spam":"Notifications from {application-name} are now marked as spam.","notif:marked-spam-undo":"Undo marking as spam","notif:remove":"Remove the application {application-name}","notif:remove-button":"移除","notif:remove-desc":"当你移除此功能,它将不再显示在你的个人主页,功能菜单以及功能编辑页面. 如果你想重新使用此功能,你可以重新添加此功能.","notif:remove-failed":"对不起,移除此功能.","notif:remove-succeeded":"此功能 <strong>{功能名}<\/strong> 已被移除.","notif:remove-title":"你确定要移除 {功能名}?","notif:report-button":"Report Spam","notif:report-desc":"This will also hide all notifications from this application.","notif:report-title":"Report notifications from {application-name} as spam?","notif:sent-button":"Submit Report","notif:sent-desc":"What is the reason for reporting this notification?","notif:sent-did-not-do":"I didn't do the action specified in the notification.","notif:sent-did-not-want":"I did this action but did not want to send a notification.","notif:sent-reported":"This sent notifications has been reported.","notif:sent-title":"Report a notification sent by {application-name}?","notif:spam-button":"Remove {application-name}","notif:spam-desc":"You told us the notification sent by <b>{application-name}<\/b>\n                                           was spam. In addition to hiding\n                                           notifications from this application, would you also like to\n                                           remove this application from your account?","notif:no-remove-button":"隐藏提示","notif:spam-title":"Spam Report submitted.","ns01":"Looking for Facebook in your area? Select a region above.","nt01":"您确认要删除日志{note-link}?","nt02":"删除这篇日志将同时删除日志相关的评论和照片","nt03":"删除日志","nt04":"删除","nt05":"程序错误将无法删除你的日志,请稍后重试.","nu00":"照片 {数字}","pc01":"Terms of Use","pc02":"你确定你已经上传这张照片并且没有违反我们的{磁盘操作系统链接}.","pc03":"点击复选框确认.","pf01":"你确定要移除 {功能名}?","pf02":"你可以从{页面}中删除此功能.","pf03":"对不起,移除功能失败.","pf04":"页面","pg01":"保存","pg02":"添加","pg03":"这为什么是必须的?","pg04":"为了将音乐上传到你的页面, we need you to submit a valid form of identification that identifies you, the admin of the Page. By submitting a valid form of identification, you are confirming that you either own the copyright to the content you will be uploading or that you are authorized by the copyright owner to upload that copyrighted content to your Page. Please note that you can black out any sensitive information on your identification if you wish, other than your name and picture. We currently only accept photo passports, school IDs, and drivers licenses.","pgd01":"Do you want to block {name}?","pgd02":"You can remove this box from the page","pgd03":"对不起,阻止此用户失败.","pgm:delete-title":"删除页面?","pgm:delete-button":"删除","pk01":"确定","pk02":"Displaying the only poke.","pk03":"不能为你提供什么.","pk04":"Displaying all {number} pokes.","pk05":"Displaying pokes {start} - {end} of {total}.","po01":"加入 {网络名} 网络","po02":"加入","po03":"You must have a valid <strong>{network-name}<\/strong> email address to join this network.  Please enter it below.","pwst:strength":"密码长度","pwst:too_short":"太短","pwst:weak":"弱","pwst:medium":"中","pwst:strong":"强","pwst:help_title":"创建一个强的密码","pwst:help_intro":"当你创建一个密码,请记住下面的信息:","pwst:help_body_1":"密码<strong>不应该<\/strong>包涵你的名字.","pwst:help_body_2":"密码 <strong>不应该<\/strong> 包括一个通用的单词.","pwst:help_body_3":"密码<strong>应该<\/strong> 包括一个或多个数字.","pwst:help_body_4":"密码 <strong>应该<\/strong> 包括大写及小写两种字母.","pwst:help_body_5":"密码 <strong>应该<\/strong> 最少有八位.","pl01":"是","pl02":"否","pl03":"完全同意","pl04":"同意","pl05":"中立","pl06":"不同意","pl07":"坚决不同意","pl08":"24 小时","pl09":"4 小时","pl10":"30 分钟","pls01":"记录投票...","pls02":"对不起,获取结果发生错误,请重新载入后重试.","pp01":"编辑隐私设置","pp02":"作为朋友列表保存","ptc01":"创建个人主页头像","ptc02":"你确定选用这些照片作为你的个人主页头像吗?","ptc03":"是的","pu01":"你必须指定上传文件.","pu02":"你必须指定至少一个文件上传.","pu03":"你必须确认在你未上传之前可以发布这些图片.","pu04":"安装图片上传工具,请等待.","pu05":"同学网上传","pu06":"上传失败. 点击我的相册重新尝试.","pu07":"上传成功!","pu08":"全部选中","pu09":"全部不选中","pu10":"上传","pu11":"取消","pu12":"小时","pu13":"分钟","pu14":"分钟","pu15":"KB","pu16":"MB","pu17":"加载文件","pu18":"不能到达服务器","pu19":"取消上传","pu20":"全部上传","pu21":"上传失败","pu22":"取消","pu23":"关闭","pu24":"全部上传结束自动关闭","pu25":"估计剩余时间","pu26":"准备文件","pu27":"发送文件","pu28":"请等待反应","pu29":"请等待重新反应","pu30":"顺时针旋转","pu31":"逆时针旋转","pu32":"未找到服务器","pu33":"未知错误","pr01":"发生了一个未知的错误.","pr02":"你的会话超时. 请 {重新登陆}.","pr03":"同学网聊天失败","pr04":"无法连接.","pr05":"未知错误.","pr06":"收件箱 ({未知_数字})","pr07":"收件箱","pr08":"无法连接. 请检查你的网络连接.","pr09":"聊天: {聊天错误}","pr10":"Down for maintenance.","prf:remove-applink":"删除链接","prf:remove-app":"移除功能","prf:remove-box":"删除邮箱","prf:error-box":"对不起, 移除个人主页的邮箱失败.","prf:error-applink":"对不起,删除个人页面的链接失败.","prf:error-app":"对不起,移除此功能失败.","prf:just-hide-story":"Just Hide Story","prf:hide-story":"Hide Story","prf:didnt-do":"I didn't do this","prf:error-hide-mf":"Sorry, hiding this story failed.","prf01":"Show More Profile Boxes","prf02":"Show Fewer Profile Boxes","prf03":"You can remove this link or remove this application from your account.","prf04":"你想要从{功能名}移除链接吗?","prf05":"You can remove this application box from your profile or remove this application from your account entirely.","prf06":"你想要移除 {功能名}?","prf07":"Are you sure you want to hide this Mini-Feed story?","prf08":"Hiding will remove the story from {whose} Mini-Feed and prevent anyone from seeing it.","prf09":"Inaccurate application story","prf10":"You told us the story published by this application was inaccurate.  Thanks for the feedback.  In addition to hiding the story, would you also like to remove this application from your account entirely?","prf11":"If you are removing this because it is inaccurate, click on \"I didn't do this\".","prf12":"1 story","prf13":"{count} stories","prf14":"Profile Layout","prf15":"You can edit the layout of your profile at any time. Simply use your mouse to drag and drop boxes anywhere on your profile.<br\/><br\/>Please note that you cannot move your Mini-Feed or Friends box. Also, some boxes may be restricted to either the right or left column of the profile.","prf17":"Public Listing","prf18":"Your public listing contains some information about you that may be viewed by people outside of Facebook.<br\/><br\/>If you allow people to view your public listing, people not logged in to Facebook can view it at this URL:","prf20":"You can control who can see your public listing on your {search-privacy-link}.","prf21":"搜索隐私页面","prf22":"Profile","prf23":"Learn more about the Wall","prf24":"Here is what a Wall post looks like:","prf25":"Edit Extended Profile","prf26":"Move Boxes","prf27":"You have {count} boxes on your profile. To keep your profile uncluttered, you have the option to move specific boxes to the <b>extended portion<\/b> of your profile. You and your friends will be able to click through at any time to see the boxes you move.<br \/><br \/><b>Which profile boxes should only appear in your extended profile?<\/b>","prf28":"The profile boxes you selected have been moved to your extended profile.","prf29":"Scroll to the bottom of your profile and look for the link to \"Show more profile boxes.\" You can change which boxes appear in your extended profile at any time by dragging and dropping boxes, or by using the {edit_extended_profile_link} link found at the bottom of your profile.","re01":"你必须从列表中选择你的高中.","re02":"你的密码至少六位.","re03":"请选择一个更安全的密码.","re04":"需要一个完整的生日日期.","re05":"You must agree to the Terms of Use","rec07":"获取视觉挑战","rec08":"获取声觉挑战","rec09":"获取一个新的挑战","rec10":"输入两个字:","rec11":"输入八个数字:","rec12":"帮助","rec13":"不能听到声音?","rec14":"不正确,请重试.","rec16":"This is a standard security test that we use to prevent spammers from creating fake accounts and spamming users.","rec17":"Our captchas are provided by {provider_link}.","rec18":"安全检查","rf:remove-friend":"移除好友","rf:add-to-friends":"添加为好友","rf:zero-friends":"好友","rf:one-friend":"好友","rf:many-friends":"好友","rf:zero":"no","rq01":"no more relationship requests.","rq02":"确认网络","rq03":"删除活动?","rq04":"你确定要从你的请求中删除(活动名)?","rq05":"删除活动","rq06":"不要删除","sa01":"What you're looking at is a Social Ad.  Advertisers provide the text, and Facebook pairs it with a relevant social action that your friend has taken.  Social Ads mean advertisements become more interesting and more tailored to you and your friends.   These respect all privacy rules; advertisers <strong>never<\/strong> have access to personal information about you or your friends.  If you have more questions, check out the {FAQ}.","sa02":"Social Ads","sa03":"Why is a story about my friend here?","sa04":"FAQ","sa05":"Okay","sh01":"Invalid URL","sh02":"Sorry, you have entered an invalid URL.","sh03":"Share","sh04":"You've successfully installed the bookmarklet.","sh05":"Click it on an external site to share it with your friends.","sh06":"Delete Comment?","sh07":"Are you sure you want to delete this comment?","sh08":"删除","sh09":"取消","sh10":"Are you sure you want to delete this item?","sh11":"Deleting this item will also remove all its comments.","sh12":"Delete Item","sh13":"You must specifiy at least one recipient for this message.","si:form-validate":"Please make sure you have filled in both fields before continuing.","si:unavailable":"{=Facebook} could not log you in at this time.","sm01":"Can't load friend detail editor.  Check your Internet connection and try again in a few moments.","sm02":"Couldn't submit form:","sm03":"从好友中删除","sm04":"请求确认","sm05":"Present","sp01":"更新&nbsp;刚才","sp03":"你的状态已清除.","sp04":"点这里记录点滴心情<br /><span style='color:#B3B3B3;text-decoration:underline;'>[编辑]</span>","sp05":"清除状态...","sp06":"你的状态已清除.","sp07":"更新状态...","sp08":"几分钟以前&nbsp;","sp09":"状态更新失败.","sp10":"删除","sr01":"Create a Remix","sr02":"Edit a Remix","sr03":"不需要保存直接关闭","sre01":"请输入你完整的生日日期.","sre02":"你没有在文本框里正确输入.","sre03":"Accepting Terms of Use and Privacy Policy","sre04":"注册同学网","sre05":"请输入你完整的名字.","sre06":"你必须提供你的全名.","sre07":"名字包涵了过多的字符.","sre08":"名字包涵了不正常的字符.","sre09":"名字包涵了太多重复的字.","sre10":"名字包涵了过多的字符.","sre11":"名字包涵了过多的特殊字符.","sre12":"名字包括了过多的省略号.","sre13":"名字包涵了过多的下划线.","sre14":"The name contains too many periods.","sre15":"请输入你的Email地址","sre16":"请输入一个正常的Email地址","sre17":"请创建同学网上帐号的密码","sre18":"应该选用更安全的密码.  请重新输入.","sre19":"你的密码至少需要六位. 请重新输入.","sre20":"请输入你真实的生日日期.","sre21":"你的密码没有匹配. 请重新输入.","st01":"时间","ta01":"没找到相匹配的内容","ta02":"加载中...","ta03":"开始输入...","ta04":"输入一个好友的名字","ta05":"输入好友名字","ta06":"没有找到好友","ta07":"输入城市，公司，学校或地域的名称。","ta08":"Type your major or minor","ta09":"输入关键字","ta10":"输入地区","ta11":"输入时间.","ta12":"不能添加列表.","ta13":"你最多可以给20人发送信息.","ta14":"Start typing a language...","tp01":"这张照片的标记已达到上限。","tp02":"我","ts01":"不能保存标记， 一张照片最多有30个标记，如果要添加一个标记，您必须先删除一个标记。","ts02":"你可以继续标记这张照片。","ts03":"您可以继续请求标记这张照片。","ts04":"标记完成后，点击 \"标记完成\" 按钮继续浏览照片。","ts05":"There was an error tagging this photo. Try again later.","ts06":"标记(自己)已经保存。","ts07":"标记( {name} )已经保存。","ts08":"标记( 自己 )已经发送给 {photo-owner} 请求批准。","ts09":"标记( {name} )已发送给 {photo-owner} 请求批准。","typeahead_ns:no-matches":"没有找到匹配内容","typeahead_ns:search-elsewhere":"在其它地方搜索...","updates:mark-as-spam-title":"Do you want to mark updates from {sender-name} as spam?","updates:mark-as-spam-content":"By marking this as spam, you will no longer receive updates from {sender-name}. You can change this setting at any time.","updates:mark-as-spam-button":"Mark As Spam","ua01":"Are you sure you want to remove this story from publication?","ua02":"Removing this story will prevent it from appearing in your Mini-Feed or in your friends' News Feeds.  If you did not take this action, please click on \"I didn't do this\".","ua03":"False external website story","ua04":"You've said that an external website sent a story to your profile about an action you did not take.  Would you like to block this website from sending any more stories to your profile?","ua:reject":"Remove Story","ua:did-not-do":"I didn't do this","ua:just-reject":"Just Remove Story","ua:block-source":"Block Website","vc01":"Make Profile Video","vp01":"Sorry, your video couldn't be rotated. Please try again later.","vt01":"Yes, I have already registered","vt02":"No","vu01":"Invalid extension","vu02":"帮助页面","vu03":"对不起, 这不是我们支持的视频文件. 我们现在只支持下面几种格式类型:","vu04":"如果你需要帮助, 请点击我们的 {=帮助页面}.","vu05":"Terms of Service","vu06":"同意","vu07":"不同意","vu08":"{current-MB} MB of {total-MB} MB ({KB-per-second} KB\/sec)","vu09":"取消上传","vu10":"取消上传","vu11":"不上传","vu12":"你确定要取消上传视频文件吗?","vu13":"A pop-up blocker may be disabling the Mobile verification window.","vu14":"上传成功","vu15":"完成视频文件编辑后, 点击 \"保存信息\" 继续","vut01":"估计剩余时间:{数字} 小时, {num-minutes} 分钟 ","vut02":"估计剩余时间:{数字} 小时, {num-minutes} 分钟 ","vut03":"估计剩余时间:{数字} 小时","vut04":"剩余1 小时, {num-minutes}分钟","vut05":"剩余1 小时, 1 分钟","vut06":"剩余一小时","vut07":"{num-minutes} minutes remaining","vut08":"1 minute remaining","vut09":"{num-seconds} seconds remaining","vut10":"1 second remaining","wp01":"保存中...","wp02":"留言失败.","wp03":"请重试.","wp04":"保存成功!","wp05":"显示 {number} of {wall-total-link}.","wp06":"{number} 条留言","wp07":"Displaying the only 2 wall posts.","wp08":"显示所有 {number} 留言.","wp09":"显示唯一条留言.","wp10":"没有留言.","wz01":"请求失败.","wz02":"A confirmation email has been sent.  Follow the confirmation link in that email to complete this step.","sh14":"选择缩略图","sh15":"无图"};





/*  ------------------------------------------------------------------------
                                TongXue | intl.js
    ------------------------------------------------------------------------  */




function intl_translation_init(){addEventBase(document.body,'mousedown',intl_translation_onmousedown);addEventBase(document.body,'mouseout',intl_translation_onmouseout);}
function intl_get_translatable_parent(obj){while(obj.parentNode){if(obj.className=='intl-translatable'||obj.className=='intl-authored'||obj.className=='intl-translated'){return obj;}
obj=obj.parentNode;}
return null;}
var intl_translation_last_mousedown=null;function intl_translation_onclick(e){var target=event_get_target(e);if(target.intl_ignore_click){target.intl_ignore_click=false;return event_abort(e)||event_prevent(e);}
target=intl_get_translatable_parent(target);if(!target){return;}
var modes={'intl-authored':0,'intl-translated':1,'intl-translatable':2};var hash=null,mode=null,locale=null;var data=target.getAttribute('intl_data').split(':');mode=modes[target.className];hash=data[0];locale=data[1];intl_show_dialog(target,mode,hash,locale);target.intl_click_delay=false;return event_abort(e)||event_prevent(e);}
function intl_translation_onmousedown(e){intl_translation_last_mousedown=event_get_target(e);var target=intl_get_translatable_parent(intl_translation_last_mousedown);if(!target){return;}
if(!target.intl_bootstrapped){target.intl_bootstrapped=true;addEventBase(target,'click',intl_translation_onclick);}
target.intl_click_delay=true;setTimeout(function(){if(target.intl_click_delay){intl_translation_last_mousedown.intl_ignore_click=true;while(intl_translation_last_mousedown.parentNode){if(intl_translation_last_mousedown!=target){if(intl_translation_last_mousedown.onclick&&intl_translation_last_mousedown.onclick()===false){break;}
if(intl_translation_last_mousedown.tagName=='A'){goURI(intl_translation_last_mousedown.href);}}
intl_translation_last_mousedown=intl_translation_last_mousedown.parentNode;}}},400);}
function intl_translation_onmouseout(e){var target=event_get_target(e);target.intl_click_delay=false;}
function intl_show_dialog(clickedElement,c,h,l){var dialog=new contextual_dialog('intl_inline_translation_dialog');dialog.set_context(clickedElement);var u=document.location;dialog.show_ajax_dialog('/ajax/intl/inline_translation_dialog.php'
+'?u='+u
+'&c='+c
+'&h='+h
+'&l='+l);}
function intl_submit_translation_dialog(clickedElement,h,l,v){var location=new String(document.location);var strings=location.split('&p=');var p=0;if(strings[1]){p=strings[1];}
var s=null;var i=null;var id1=location.search(/&id=/);var id2=null;if((id2=location.search(/&popular/))!=-1){s='popular';}else if((id2=location.search(/&disputed/))!=-1){s='disputed';}else if((id2=location.search(/&recent/))!=-1){s='recent';}
if(id1&&id2){i=location.substr(id1+4,id2-(id1+4));}
var dialog=new contextual_dialog('intl_submit_translation_dialog');dialog.set_context(clickedElement);dialog.show_ajax_dialog('/ajax/intl/submit_translation_dialog.php'
+'?h='+h
+'&l='+l
+'&i='+i
+'&s='+s
+'&p='+p
+'&v='+v);}
function intl_delete_translation_dialog(clickedElement,h,l,v){var dialog=new contextual_dialog('intl/delete_translation_dialog');dialog.set_context(clickedElement);dialog.show_ajax_dialog('/ajax/intl/delete_translation_dialog.php'
+'?h='+h
+'&l='+l
+'&v='+v);}
function intl_report_translation_dialog(clickedElement,h,t,l){onResponse=function(asyncResponse){var report_dialog=asyncResponse.getPayload();var dialog=new contextual_dialog();function onSubmit(){var c=$('report_dialog_code').value;new AsyncRequest().setURI('/ajax/intl/do_report.php').setData({'hash':h,'translation_id':t,'locale':l,'report_code':c}).setHandler(function(){dialog.hide();}).setErrorHandler(function(){dialog.hide();}).send();}
dialog.set_context(clickedElement);dialog.show_choice(report_dialog['title'],report_dialog['markup'],'Report',onSubmit,'Cancel',function(){dialog.hide();return false;});}
onError=function(asyncResponse){}
new AsyncRequest().setURI('/ajax/intl/report_translation_dialog.php').setData({'hash':h,'translation_id':t,'locale':l}).setHandler(bind(this,onResponse)).setErrorHandler(bind(this,'onError')).send();}
function intl_vote_translation_dialog(clickedElement,t,l){var dialog=new contextual_dialog('intl/vote_translation_dialog');dialog.set_context(clickedElement);dialog.show_ajax_dialog('/ajax/intl/vote_translation_dialog.php'
+'?t='+t
+'&l='+l);}
function intl_reload_page_locale(obj){var locale=obj.options[obj.selectedIndex].value;var location=new String(document.location);var prefix=location.split('&locale=');var redirect=prefix[0]+'&locale='+locale;document.location=redirect;}
function intl_show_highlight_schemes(){show(ge('highlight_schemes'));}
function intl_hide_highlight_schemes(){hide(ge('highlight_schemes'));}
function intl_set_locale(obj){var locale=obj.options[obj.selectedIndex].value;(new AsyncRequest()).setURI('/ajax/intl/save_locale.php').setData({locale:locale}).setHandler(function(){document.location.reload();}).send();}
function intl_set_sortby(obj){var sortby=obj.options[obj.selectedIndex].value;var location=new String(document.location);location=location.replace(/&recent/g,"");location=location.replace(/&disputed/g,"");location=location.replace(/&popular/g,"");var parts=location.split('&p=');if(parts.length==2){document.location=parts[0]+'&'+sortby+'&p='+parts[1];}else{document.location=location+'&'+sortby;}}
function intl_set_xmode(obj){var checked=obj.checked;var xmode=1;if(checked==false){xmode=0;}
(new AsyncRequest()).setURI('/ajax/intl/save_xmode.php').setData({xmode:xmode}).setHandler(function(){document.location.reload();}).send();}
function intl_set_pmode(obj){var checked=obj.checked;var pmode=1;if(checked==false){pmode=0;}
(new AsyncRequest()).setURI('/ajax/intl/save_xmode.php').setData({pmode:pmode}).setHandler(function(){document.location.reload();}).send();}
function votes_noun(val){if(((val)==1)||((val)==-1)){var nouns='vote';}else{var nouns='votes'}
return nouns;}
function intl_do_vote(native_hash,locale,translation_id,vote){ajax=new Ajax();ajax.onDone=function(ajaxObj,response){eval(response);var total=data_votes;var ups=data_up;var downs=Math.abs(data_down);$('total_'+native_hash+'_'+translation_id).innerHTML=(total);$('vtext_'+native_hash+'_'+translation_id).innerHTML=votes_noun(total);show($('total_'+native_hash+'_'+translation_id));show($('vtext_'+native_hash+'_'+translation_id));$('ups_'+native_hash+'_'+translation_id).innerHTML=(ups)+' '+' up,';$('downs_'+native_hash+'_'+translation_id).innerHTML=(downs)+' '+' down';if(vote==1){var ids=tr_ids[native_hash];for(i=0;i<ids.length;i++){c_name=$('voteup_'+native_hash+'_'+ids[i]).className;if(c_name=='upselect'&&ids[i]!=translation_id){$('voteup_'+native_hash+'_'+ids[i]).className='upover';cur_vote=($('ups_'+native_hash+'_'+ids[i]).innerHTML.split(' up,'))[0];$('ups_'+native_hash+'_'+ids[i]).innerHTML=(cur_vote-1)+' '+' up,';}}
$('voteup_'+native_hash+'_'+translation_id).className='upselect';$('votedown_'+native_hash+'_'+translation_id).className='downover';}
if(vote==-1){$('votedown_'+native_hash+'_'+translation_id).className='downselect';$('voteup_'+native_hash+'_'+translation_id).className='upover';}}
ajax.onFail=function(ajaxObj){}
var params="hash="+native_hash
+"&vote="+vote
+"&locale="+locale
+"&translation_id="+translation_id;ajax.post('/ajax/intl/do_vote.php',params);}
function tx(str,args){str=_string_table[str];if(args){if(typeof args!='object'){Util.error('intl.js: the 2nd argument must be a keyed array (not a string) for tx('+str+', ...)');}else{for(var key in args){var regexp=new RegExp('\{'+key+'\}',"g");str=str.replace(regexp,args[key]);}}}
return str;}
function intl_translation_dialog(native_str,form,anchors,tokens,glossary,rules){this.form=form;this.textarea=form.getElementsByTagName('textarea')[0];this.anchors=[];this.anchor_states=[];this.tokens=tokens;this.glossary=glossary;this.rules=rules;this.native_str=native_str;if(anchors){anchors=anchors.getElementsByTagName('a');for(var i=0;i<anchors.length;i++){this.anchors.push(anchors[i]);anchors[i].onclick=this.insert_token.bind(null,this);this.anchor_states.push(false);}}
this.textarea.onkeypress=this.refresh_tokens.bind(this);this.textarea.onkeyup=this.refresh_tokens.bind(this);this.form.intl_submit.onclick=this.submit_click.bind(this);}
intl_translation_dialog.prototype.insert_token=function(that){var index=that.get_anchor_index(this),textarea=that.textarea,pos=get_caret_position(that.textarea).end;textarea.value=textarea.value.substring(0,pos)+that.tokens[index]+textarea.value.substring(pos);textarea.focus();that.anchor_states[index]=true;hide(this);return false;}
intl_translation_dialog.prototype.get_anchor_index=function(anchor){for(var i=0;i<this.anchors.length;i++){if(this.anchors[i]==anchor){return i;}}
return-1;}
intl_translation_dialog.prototype.refresh_tokens=function(){var active_tokens=/{[^}]+}/g,token=null,tokens={};for(var i=0;i<this.tokens.length;i++){tokens[this.tokens[i]]=false;}
while(token=active_tokens.exec(this.textarea.value)){tokens[token[0]]=true;}
for(var i=0;i<this.anchors.length;i++){if(tokens[this.tokens[i]]!=this.anchor_states[i]){this.anchor_states[i]=!this.anchor_states[i];(this.anchor_states[i]?hide:show)(this.anchors[i]);}}}
intl_translation_dialog.prototype.check_tokens=function(){for(var i=0;i<this.anchor_states.length;i++){if(!this.anchor_states[i]){return false;}}
return true;}
intl_translation_dialog.prototype.rule_canon=function(native_str,translated){var words=translated.toLowerCase().split(/\b([^\s]+?)\b/);if(this.glossary){for(var i=0;i<this.glossary.length;i++){if(array_indexOf(words,this.glossary[i])==-1){return'Recommended glossary translations not used.';}}}}
intl_translation_dialog.prototype.rule_punctuation=function(native_str,translated){var punctuation=[',','.','?','!',';',':'];for(var i=0;i<punctuation.length;i++){if(substr_count(native_str,punctuation[i])!=substr_count(translated,punctuation[i])){return'Punctuation mismatch. Did you forget a period or other punctuation?';}}}
intl_translation_dialog.prototype.rule_capitalization=function(native_str,translated){if(((native_str.substring(0,1).toLowerCase()!=native_str.substring(0,1))!=(translated.substring(0,1).toLowerCase()!=translated.substring(0,1)))&&(native_str.substring(0,1)+translated.substring(0,1)).indexOf('{')==-1){return'Capitalization mismatch. Make sure the casing of your translation is accurate.';}}
intl_translation_dialog.prototype.check_warnings=function(native_str,translated){var warnings=[];for(var i=0;i<this.rules.length;i++){var warning=this['rule_'+this.rules[i]](native_str,translated);if(warning){warnings.push(warning);}}
return warnings.length?warnings:null;}
intl_translation_dialog.prototype.translation_submit=function(){var form=ge('intl_ajax');var status;var onResponse=function(asyncResponse){var result=asyncResponse.getPayload();status=result['status'];}
new AsyncRequest().setURI('/ajax/intl/do_translation.php').setData({'hash':form.hash.value,'translation':form.translation.value,'loc':form.loc.value,'charset_test':form.charset_test.value}).setHandler(onResponse).setErrorHandler(function(){dialog.hide();}).setOption('asynchronous',false).send();if(status=='exists'||status=='exists-self'){var person_str=(status=='exists-self')?'You have':'Someone has';var dialog=(new pop_dialog()).show_choice('Duplicate Translation','Sorry! '+person_str+' already submited the same translation.','Edit Translation',function(){dialog.hide();}.bind(this),'Review Translations',function(){var form=ge('intl_ajax');document.location='/translations/?vote&hash='+form.hash.value;});}else if(status=='not-utf8'){var dialog=(new pop_dialog()).show_message('Unsupported Encoding',"Your web browser appears to be set to send data to Facebook in "+"a format our servers don't understand. Please set your browser to "+"use UTF-8 (Unicode). In most browsers this is in a menu item called "+'"Encoding" or "Character Encoding" or "Text Encoding", most often '+'under the "View" menu.');}else if(status=='empty'){var dialog=(new pop_dialog()).show_message('No Translation',"Oops! Looks like you didn't type in a translation.");}else if(status!='ok'){Util.error('Bad status = "'+status+'" for hash "'+form.hash.value+'" trans "'+form.translation.value+'"');location.href=this.form.ref.value;}else{location.href=this.form.ref.value;}
return status;}
intl_translation_dialog.prototype.submit_click=function(){var person,warnings;var status;if(!this.check_tokens()){var dialog=(new pop_dialog()).show_message('Unused Tokens','You did not use all the tokens while translating this string. '+'Please make sure you maintain all text in curly braces ( <b>{example}</b> ) in the translation.');}else if(warnings=this.check_warnings(this.native_str,this.textarea.value)){var dialog=(new pop_dialog()).show_choice('Translation Warning','There may be a problem with your translation! '+'The translation you provided failed the following style check'+(warnings.length==1?'':'s')+': <br />'+'<ul><li>'+warnings.join('</li><li>')+'</li></ul><br />'+'It\'s ok to ignore '+(warnings.length==1?'this warning':'these warnings')+' if it makes sense given the context of the phrase, but please make sure that this is the case.','Submit Translation',function(){dialog.hide();this.translation_submit();generic_dialog.get_dialog(this.form).hide();}.bind(this),'Review Translation',function(){dialog.hide();});}else{this.translation_submit();}}
function intl_show_legal_dialog(){var dialog=new pop_dialog();dialog.show_choice('Terms Applicable to Translate Facebook'
+'<br/><small>Date of Last Revision: December 13, 2007</small>','The Translate Facebook application collects translations, comments, suggestions, ideas, feedback and other information ("Submissions") from you and other users in connection with Facebook\'s language translation project to provide Facebook access in multiple languages (the "Project").'
+'<br/><br/>You understand that your participation in the Project is for the benefit of the Facebook user community as it will allow users whose participation is currently limited by language to more fully participate.  You acknowledge that your participation in the Project is entirely voluntary, and you understand that no monetary or other compensation will be given to persons, including you, for Submissions.  You may provide as much or as little input into the Project as you wish and can cease contributing to the Project at any time.'
+'<br/><br/>In consideration of Facebook\'s permitting you to participate in the Project and the benefits to the Facebook user community of which you are a member, you acknowledge and agree that any Submissions that you provide to Facebook will be owned by Facebook.  Accordingly, you irrevocably assign to Facebook all right, title and interest, including all intellectual property rights, in and to all Submissions, and Facebook is entitled to the unrestricted use and dissemination of these Submissions for any purpose, commercial or otherwise, without acknowledgment, consent or monetary or other tangible compensation to you.  To the extent that the foregoing assignment is or becomes invalid or unenforceable to any degree or for any reason, you grant Facebook an irrevocable, perpetual, exclusive, fully-paid-up, royalty-free, worldwide right and license, with the right to sublicense, to use, reproduce, display, perform, create derivative works of, distribute and otherwise exploit the Submissions in any manner.'
+'<br/><br/>Please note: Translate Facebook is subject to and governed by these Additional Terms Applicable to Translate Facebook (the "Additional Terms") as well as the <a href="/terms.php">Facebook Terms of Use</a>. In the event of any conflict between these Additional Terms and the Facebook Terms of Use, these Additional Terms control. Capitalized terms that are not defined in these Additional Terms will have the definitions provided them in the Terms of Use.  Facebook reserves the right, in our sole discretion, to change, modify, add, or delete portions of these Additional Terms at any time without further notice. If we do this, we will post the changes to these Additional Terms on this page and will indicate at the top of this page the date these terms were last revised. You agree to waive any specific notice of such changes, and your continued use and operation of Translate Facebook after any such changes constitutes your acceptance of the new Additional Terms. It is your responsibility to regularly check the Site to determine if there have been changes to these Additional Terms.','Close',function(){generic_dialog.get_dialog(this).hide()});}
function intl_disable_rooster_save(obj){var save=document.getElementById('install_translation_app');save.disabled=!obj.checked;var container=document.getElementById('install_container');if(obj.checked){container.style.display='block';}else{container.style.display='none';}}
function intl_confirm_rooster_and_install_app(uid,divid){document.location='add.php?api_key=efa7a7045708fcadede8d705e39b1642';}
function substr_count(haystack,needle){var count=0,pos=haystack.indexOf(needle);while(pos!=-1){count++;pos=haystack.indexOf(needle,pos+1);}
return count;}
function intl_help_preview(obj){var dialog=new contextual_dialog();dialog.set_context(obj);dialog.show_message('Preview Mode','Check this box to see Facebook using the '+'translations that are currently most highly voted. '+'Some messages may still be in English if Facebook '+'has not been fully translated into your language yet.'+'<br/><br/>'+'If you see a translation that looks wrong, you can '+'click the "Translate While Browsing" box that is '+'available when you are in preview mode; that will '+'allow you to vote on any of the existing translations '+'you see, or suggest new ones of your own.','Okay',function(){dialog.hide();});}
function intl_help_translate(obj){var dialog=new contextual_dialog();dialog.set_context(obj);dialog.show_message('Translate While Browsing','Check this box to vote on translations or suggest '+'new ones of your own while you use Facebook. '+'<br/><br/>'+'With this box checked, clicking on any underlined '+'phrase will give you a small translation control '+'panel. If you want to click on a link to go to '+'another page, rather than to see the control '+'panel, just hold down the mouse button for '+'at least 1 second.'+'<br/><br/>'+'Red underlined phrases have not been translated yet. '+'Yellow underlined phrases were translated by you. '+'Green underlined phrases were translated by someone '+'else.','Okay',function(){dialog.hide();});}




/*  ------------------------------------------------------------------------
                                TongXue | base.js
    ------------------------------------------------------------------------  */




try{if(window.fbJavascriptLibrariesHaveLoaded){Util.error('You have double-included base.js and possibly other Javascript files; '+'it may be in a package. This will cause you great unhappiness. Each '+'file should be included at most once.');}
window.fbJavascriptLibrariesHaveLoaded=true;}catch(ignored){}
function gen_unique(){return++gen_unique._counter;}
gen_unique._counter=0;function ge(id){if(typeof(id)=='undefined'){Util.error('Tried to get an undefined element!');return null;}
var obj;if(typeof(id)=='string'){obj=document.getElementById(id);if(!(ua.ie()>=7)){return obj;}
if(!obj){return null;}else if(typeof(obj.id)=='string'&&obj.id==id){return obj;}else{var candidates=document.getElementsByName(id);if(!candidates||!candidates.length){return null;}
var maybe=[];for(var ii=0;ii<candidates.length;ii++){var c=candidates[ii];if(!c.id&&id){continue;}
if(typeof(c.id)=='string'&&c.id!=id){continue;}
maybe.push(candidates[ii]);}
if(maybe.length!=1){Util.error('ge() failed in a bizarre complicated edge case. Check comments.');return null;}
return maybe[0];}}else{return id;}
return null;}
function $(){var el=ge.apply(null,arguments);if(!el){Util.warn('Tried to get element %q, but it is not present in the page. (Use ge() '+'to test for the presence of an element.)',arguments[0]);}
return el;}
function show(){for(var i=0;i<arguments.length;i++){var element=ge(arguments[i]);if(element&&element.style)element.style.display='';}
return false;}
function hide(){for(var i=0;i<arguments.length;i++){var element=ge(arguments[i]);if(element&&element.style)element.style.display='none';}
return false;}
function shown(el){el=ge(el);return(el.style.display!='none'&&!(el.style.display==''&&el.offsetWidth==0));}
function toggle(){for(var i=0;i<arguments.length;i++){var element=$(arguments[i]);element.style.display=get_style(element,"display")=='block'?'none':'block';}
return false;}
function is_descendent(base_obj,target_id){var target_obj=ge(target_id);if(base_obj==null)return;while(base_obj!=target_obj){if(base_obj.parentNode){base_obj=base_obj.parentNode;}else{return false;}}
return true;}
function get_style(object,prop){function hyphenate(prop){return prop.replace(/[A-Z]/g,function(match){return'-'+match.toLowerCase();});}
if(window.getComputedStyle){return window.getComputedStyle(object,null).getPropertyValue(hyphenate(prop));}
if(document.defaultView&&document.defaultView.getComputedStyle){var computedStyle=document.defaultView.getComputedStyle(object,null);if(computedStyle)
return computedStyle.getPropertyValue(hyphenate(prop));if(prop=="display")
return"none";Util.error("Can't retrieve requested style %q due to a bug in Safari",prop);}
if(object.currentStyle){return object.currentStyle[prop];}
return object.style[prop];}
function close_more_list(){var list_expander=ge('expandable_more');if(list_expander){list_expander.style.display='none';removeEventBase(document,'click',list_expander.offclick,list_expander.id);}
var sponsor=ge('ssponsor');if(sponsor){sponsor.style.position='';}
var link_obj=ge('more_link');if(link_obj){link_obj.innerHTML=tx('base01');link_obj.className='expand_link more_apps';}}
function expand_more_list(){var list_expander=ge('expandable_more');var more_link=ge('more_section');if(more_link){remove_css_class_name(more_link,'highlight_more_link');}
if(list_expander){list_expander.style.display='block';list_expander.offclick=function(e){if(!is_descendent(event_get_target(e),'sidebar_content')){close_more_list();}}.bind(list_expander);addEventBase(document,'click',list_expander.offclick,list_expander.id);}
var sponsor=ge('ssponsor');if(sponsor){sponsor.style.position='static';}
var link_obj=ge('more_link');if(link_obj){link_obj.innerHTML=tx('base02');link_obj.className='expand_link less_apps';}}
function toggle_more_list(){var list_expander=ge('expandable_more');if(!list_expander){return false;}
if(list_expander.style.display=='none'){expand_more_list();}else{close_more_list();}}
function remove_node(node){if(node.removeNode){node.removeNode(true);}else{for(var ii=node.childNodes.length-1;ii>=0;ii--){remove_node(node.childNodes[ii]);}
node.parentNode.removeChild(node);}
return null;}
function create_hidden_input(name,value){var new_input=document.createElement('input');new_input.name=name;new_input.id=name;new_input.value=value;new_input.type='hidden';return new_input;}
function has_css_class_name(elem,cname){return(elem&&cname)?new RegExp('\\b'+trim(cname)+'\\b').test(elem.className):false;}
function swap_css_class_name(elements,class1,class2){for(var i=0;i<elements.length;i++){var element=ge(elements[i]);if(element.className.indexOf(class1)!=-1){element.className=element.className.replace(class1,class2);}else{element.className=element.className.replace(class2,class1);}}}
function add_css_class_name(elem,cname){if(elem&&cname){if(elem.className){if(has_css_class_name(elem,cname)){return false;}else{elem.className+=' '+trim(cname);return true;}}else{elem.className=cname;return true;}}else{return false;}}
function remove_css_class_name(elem,cname){if(elem&&cname&&elem.className){cname=trim(cname);var old=elem.className;elem.className=elem.className.replace(new RegExp('\\b'+cname+'\\b'),'');return elem.className!=old;}else{return false;}}
function toggle_css_class_name(elem,cname){if(has_css_class_name(elem,cname)){remove_css_class_name(elem,cname);}else{add_css_class_name(elem,cname);}}
function set_inner_html(obj,html){var dummy='<span style="display:none">&nbsp</span>';html=html.replace('<style',dummy+'<style');html=html.replace('<STYLE',dummy+'<STYLE');html=html.replace('<script',dummy+'<script');html=html.replace('<SCRIPT',dummy+'<SCRIPT');obj.innerHTML=html;eval_inner_js(obj);addSafariLabelSupport(obj);}
function eval_inner_js(obj){var scripts=obj.getElementsByTagName('script');for(var i=0;i<scripts.length;i++){if(scripts[i].src){var script=document.createElement('script');script.type='text/javascript';script.src=scripts[i].src;document.body.appendChild(script);}else{try{eval_global(scripts[i].innerHTML);}catch(e){if(typeof console!='undefined'){console.error(e);}}}}}
function eval_global(js){var obj=document.createElement('script');obj.type='text/javascript';try{obj.innerHTML=js;}catch(e){obj.text=js;}
document.body.appendChild(obj);}
var KEYS={BACKSPACE:8,TAB:9,RETURN:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};var KeyCodes={Up:63232,Down:63233,Left:63234,Right:63235};function mouseX(event)
{return event.pageX||(event.clientX+
(document.documentElement.scrollLeft||document.body.scrollLeft));}
function mouseY(event)
{return event.pageY||(event.clientY+
(document.documentElement.scrollTop||document.body.scrollTop));}
function pageScrollX()
{return document.body.scrollLeft||document.documentElement.scrollLeft;}
function pageScrollY()
{return document.body.scrollTop||document.documentElement.scrollTop;}
function elementX(obj){if(ua.safari()<500&&obj.tagName=='TR'){obj=obj.firstChild;}
var left=obj.offsetLeft;var op=obj.offsetParent;while(obj.parentNode&&document.body!=obj.parentNode){obj=obj.parentNode;left-=obj.scrollLeft;if(op==obj){if(ua.safari()<500&&obj.tagName=='TR'){left+=obj.firstChild.offsetLeft;}else{left+=obj.offsetLeft;}
op=obj.offsetParent;}}
return left;}
function elementY(obj){if(ua.safari()<500&&obj.tagName=='TR'){obj=obj.firstChild;}
var top=obj.offsetTop;var op=obj.offsetParent;while(obj.parentNode&&document.body!=obj.parentNode){obj=obj.parentNode;top-=obj.scrollTop;if(op==obj){if(ua.safari()<500&&obj.tagName=='TR'){top+=obj.firstChild.offsetTop;}else{top+=obj.offsetTop;}
op=obj.offsetParent;}}
return top;}
function getElementsByTagNames(list,obj){if(!obj)var obj=document;var tagNames=list.split(',');var resultArray=new Array();for(var i=0;i<tagNames.length;i++){var tags=obj.getElementsByTagName(tagNames[i]);for(var j=0;j<tags.length;j++){resultArray.push(tags[j]);}}
var testNode=resultArray[0];if(!testNode)return[];if(testNode.sourceIndex){resultArray.sort(function(a,b){return a.sourceIndex-b.sourceIndex;});}
else if(testNode.compareDocumentPosition){resultArray.sort(function(a,b){return 3-(a.compareDocumentPosition(b)&6);});}
return resultArray;}
function get_all_form_inputs(root_element){if(!root_element){root_element=document;}
return getElementsByTagNames('input,select,textarea,button',root_element);}
function get_form_select_value(select){return select.options[select.selectedIndex].value;}
function set_form_select_value(select,value){for(var i=0;i<select.options.length;++i){if(select.options[i].value==value){select.selectedIndex=i;break;}}}
function get_form_attr(form,attr){var val=form[attr];if(typeof val=='object'&&val.tagName=='INPUT'){var pn=val.parentNode,ns=val.nextSibling,node=val;pn.removeChild(node);val=form[attr];ns?pn.insertBefore(node,ns):pn.appendChild(node);}
return val;}
function serialize_form_helper(data,name,value){var match=/([^\]]+)\[([^\]]*)\](.*)/.exec(name);if(match){data[match[1]]=data[match[1]]||{};if(match[2]==''){var i=0;while(data[match[1]][i]!=undefined){i++;}}else{i=match[2];}
if(match[3]==''){data[match[1]][i]=value;}else{serialize_form_helper(data[match[1]],i.concat(match[3]),value);}}else{data[name]=value;}}
function serialize_form(obj){var data={};var elements=obj.tagName=='FORM'?obj.elements:get_all_form_inputs(obj);for(var i=elements.length-1;i>=0;i--){if(elements[i].name&&!elements[i].disabled){if(!(elements[i].type=='radio'||elements[i].type=='checkbox')||elements[i].checked||(!elements[i].type||elements[i].type=='text'||elements[i].type=='password'||elements[i].type=='hidden'||elements[i].tagName=='TEXTAREA'||elements[i].tagName=='SELECT')){serialize_form_helper(data,elements[i].name,elements[i].value);}}}
return data;}
function is_button(element){var tagName=element.tagName.toUpperCase();if(tagName=='BUTTON'){return true;}
if(tagName=='INPUT'&&element.type){var type=element.type.toUpperCase();return type=='BUTTON'||type=='SUBMIT';}
return false;}
function autogrow_textarea(obj){var padding=15;var shadow_div_id='shadow_'+obj.id;var shadow_div;if(!(shadow_div=ge(shadow_div_id))){shadow_div=document.createElement('div');shadow_div.id=shadow_div_id;shadow_div.style.position="absolute";shadow_div.style.left="-10000px";shadow_div.style.top="-10000px";shadow_div.style.fontSize=get_style(obj,'fontSize')+'px';shadow_div.style.fontFamily=get_style(obj,'fontFamily');shadow_div.style.width=parseInt(obj.clientWidth-8)+'px';obj.setAttribute('startHeight',obj.clientHeight);obj.parentNode.appendChild(shadow_div);}
var clientHeight=obj.clientHeight;shadow_div.innerHTML=htmlspecialchars(obj.value).replace(/[\n]/g,'<br />&nbsp;');var shadowHeight=shadow_div.clientHeight;var to_height;var startHeight=obj.getAttribute('startHeight');if(shadowHeight<startHeight){to_height=startHeight;}else{to_height=shadowHeight+padding;}
if(to_height&&to_height!=clientHeight){obj.style.height=to_height+'px';}}
function textarea_maxlength(obj,length){if(obj.maxlength||!length){return;}
obj.maxlength=length;var callback=textarea_maxlength_truncate.bind(null,obj,length);addEventBase(obj,'keydown',callback);addEventBase(obj,'keypress',callback);addEventBase(obj,'keyup',callback);setInterval(callback,150);}
function textarea_maxlength_truncate(obj,length,event){if(obj.value.length>length){obj.value=obj.value.substring(0,length);}else if(obj.value.length==length){var key=event_get_keypress_keycode(event);var ok_keys=[KEYS.LEFT,KEYS.RIGHT,KEYS.UP,KEYS.DOWN,KEYS.BACKSPACE,KEYS.DELETE,KEYS.ESC]
if(array_indexOf(ok_keys,key)==-1){event_prevent(event);}}}
function addEventBase(obj,type,fn,name_hash)
{if(obj.addEventListener){obj.addEventListener(type,fn,false);}
else if(obj.attachEvent)
{var fn_name=type+fn+name_hash;obj["e"+fn_name]=fn;obj[fn_name]=function(){obj["e"+fn_name](window.event);}
obj.attachEvent("on"+type,obj[fn_name]);}
return fn;}
function removeEventBase(obj,type,fn,name_hash)
{if(obj.removeEventListener){obj.removeEventListener(type,fn,false);}
else if(obj.detachEvent)
{var fn_name=type+fn+name_hash;if(obj[fn_name]){obj.detachEvent("on"+type,obj[fn_name]);obj[fn_name]=null;obj["e"+fn_name]=null;}}}
function placeholderSetup(id){var el=ge(id);if(!el)return;if(el.type=='search')return;var ph=el.getAttribute("placeholder");if(!ph||ph=="")
return;if(el.value==ph)
el.value="";el.is_focused=(el.value!="");if(!el.is_focused){el.value=ph;el.style.color='#777';el.is_focused=0;}
addEventBase(el,'focus',placeholderFocus);addEventBase(el,'blur',placeholderBlur);}
function placeholderFocus(){if(!this.is_focused){this.is_focused=1;this.value='';this.style.color='#000';var rs=this.getAttribute("radioselect");if(rs&&rs!=""){var re=document.getElementById(rs);if(!re){return;}
if(re.type!='radio')return;re.checked=true;}}}
function placeholderBlur(){var ph=this.getAttribute("placeholder")
if(this.is_focused&&ph&&this.value==""){this.is_focused=0;this.value=ph;this.style.color='#777';}}
function placeholderGetValue(id){var el=ge(id);if(!el){return;}
return el.getAttribute("placeholder");}
function setFlashFallback(id,required_version){var fallback=ge(id);var version=deconcept.SWFObjectUtil.getPlayerVersion();if(fallback&&version['major']>0){var current_version=version['major']+'.'+version['minor']+'.'+version['rev'];fallback.innerHTML=tx('flash:upgrade-explanation',{'required-version':required_version,'current-version':current_version});}}
function getFlashPlayer(){goURI('http://adobe.com/go/getflashplayer');return false;}
function optional_drop_down_menu(arrow,link,menu,event,arrow_class,arrow_old_class,on_click_callback,off_click_callback)
{if(menu.style.display=='none'){menu.style.display='block';var old_arrow_classname=arrow_old_class?arrow_old_class:arrow.className;if(link){link.className='active';}
arrow.className=arrow_class?arrow_class:'global_menu_arrow_active';var justChanged=true;var shim=ge(menu.id+'_iframe');if(shim){shim.style.top=menu.style.top;shim.style.right=menu.style.right;shim.style.display='block';shim.style.width=(menu.offsetWidth+2)+'px';shim.style.height=(menu.offsetHeight+2)+'px';}
menu.offclick=function(e){if(!justChanged){hide(this);if(link){link.className='';}
arrow.className=old_arrow_classname;var shim=ge(menu.id+'_iframe');if(shim){shim.style.display='none';shim.style.width=menu.offsetWidth+'px';shim.style.height=menu.offsetHeight+'px';}
if(off_click_callback){off_click_callback(e);}
removeEventBase(document,'click',this.offclick,menu.id);}else{justChanged=false;}}.bind(menu);if(on_click_callback){on_click_callback();}
addEventBase(document,'click',menu.offclick,menu.id);}
return false;}
function position_app_switcher(){var switcher=ge('app_switcher');var menu=ge('app_switcher_menu');menu.style.top=(switcher.offsetHeight-1)+'px';menu.style.right='0px';}
function hover_tooltip(object,hover_link,hover_class,offsetX,offsetY){if(object.tooltip){var tooltip=object.previousSibling;tooltip.style.display='block';return;}else{object.parentNode.style.position="relative";var tooltip=document.createElement('div');tooltip.className="tooltip_pro "+hover_class;tooltip.style.left=-9999+'px';tooltip.style.display='block';tooltip.innerHTML='<div class="tooltip_text"><span>'+hover_link+'</span></div>'+'<div class="tooltip_pointer"></div>';object.parentNode.insertBefore(tooltip,object);while(tooltip.firstChild.firstChild.offsetWidth<=0){1;}
var TOOLTIP_PADDING=16;var offsetWidth=tooltip.firstChild.firstChild.offsetWidth+TOOLTIP_PADDING;tooltip.style.width=offsetWidth+'px';tooltip.style.display='none';tooltip.style.left=offsetX+object.offsetLeft-((offsetWidth-6-object.offsetWidth)/2)+'px';tooltip.style.top=offsetY+'px';tooltip.style.display='block';object.tooltip=true;object.onmouseout=function(e){hover_clear_tooltip(object)};}}
function hover_clear_tooltip(object){var tooltip=object.previousSibling;tooltip.style.display='none';}
function addSafariLabelSupport(base){if(ua.safari()<500){var labels=(base||document.body).getElementsByTagName("label");for(i=0;i<labels.length;i++){labels[i].addEventListener('click',addLabelAction,true);}}}
function addLabelAction(event){var id=this.getAttribute('for');var item=null;if(id){item=document.getElementById(id);}else{item=this.getElementsByTagName('input')[0];}
if(!item||event.srcElement==item){return;}
if(item.type=='checkbox'){item.checked=!item.checked;}else if(item.type=='radio'){var radios=document.getElementsByTagName('input');for(i=0;i<radios.length;i++){if(radios[i].name==item.name&&radios[i].form==item.form){radios.checked=false;}}
item.checked=true;}else{item.focus();}
if(item.onclick){item.onclick(event);}}
function escapeURI(u)
{if(encodeURIComponent){return encodeURIComponent(u);}
if(escape){return escape(u);}}
function goURI(href){window.location.href=href;}
function is_email(email){return/^([\w!.%+\-])+@([\w\-])+(?:\.[\w\-]+)+$/.test(email);}
function getViewportWidth(){var width=0;if(document.documentElement&&document.documentElement.clientWidth){width=document.documentElement.clientWidth;}
else if(document.body&&document.body.clientWidth){width=document.body.clientWidth;}
else if(window.innerWidth){width=window.innerWidth-18;}
return width;};function getViewportHeight(){var height=0;if(window.innerHeight){height=window.innerHeight-18;}
else if(document.documentElement&&document.documentElement.clientHeight){height=document.documentElement.clientHeight;}
else if(document.body&&document.body.clientHeight){height=document.body.clientHeight;}
return height;};function getPageScrollHeight(){var height;if(typeof(window.pageYOffset)=='number'){height=window.pageYOffset;}else if(document.body&&document.body.scrollTop){height=document.body.scrollTop;}else if(document.documentElement&&document.documentElement.scrollTop){height=document.documentElement.scrollTop;}
if(isNaN(height))return 0;return height;};function getRadioFormValue(obj){for(i=0;i<obj.length;i++){if(obj[i].checked){return obj[i].value;}}
return null;}
function getTableRowShownDisplayProperty(){if(ua.ie()){return'inline';}else{return'table-row';}}
function showTableRow()
{for(var i=0;i<arguments.length;i++){var element=ge(arguments[i]);if(element&&element.style)element.style.display=getTableRowShownDisplayProperty();}
return false;}
function getParentRow(el){el=ge(el);while(el.tagName&&el.tagName!="TR"){el=el.parentNode;}
return el;}
function stopPropagation(e){if(!e)var e=window.event;e.cancelBubble=true;if(e.stopPropagation){e.stopPropagation();}}
function show_standard_status(status){s=ge('standard_status');if(s){var header=s.firstChild;header.innerHTML=status;show('standard_status');}}
function hide_standard_status(){s=ge('standard_status');if(s){hide('standard_status');}}
function adjustImage(obj,stop_word,max){var block=obj.parentNode;while(get_style(block,'display')!='block'&&block.parentNode){block=block.parentNode;}
var width=block.offsetWidth;if(obj.offsetWidth>width){try{if(ua.ie()){var img_div=document.createElement('div');img_div.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+obj.src.replace('"','%22')+'", sizingMethod="scale")';img_div.style.width=width+'px';img_div.style.height=Math.floor(((width/obj.offsetWidth)*obj.offsetHeight))+'px';if(obj.parentNode.tagName=='A'){img_div.style.cursor='pointer';}
obj.parentNode.insertBefore(img_div,obj);obj.parentNode.removeChild(obj);}else{throw 1;}}catch(e){obj.style.width=width+'px';}}
remove_css_class_name(obj,'img_loading');}
function imageConstrainSize(src,maxX,maxY,placeholderid){var image=new Image();image.onload=function(){if(image.width>0&&image.height>0){var width=image.width;var height=image.height;if(width>maxX||height>maxY){var desired_ratio=maxY/maxX;var actual_ratio=height/width;if(actual_ratio>desired_ratio){width=width*(maxY/height);height=maxY;}else{height=height*(maxX/width);width=maxX;}}
var placeholder=ge(placeholderid);var newimage=document.createElement('img');newimage.src=src;newimage.width=width;newimage.height=height;placeholder.parentNode.insertBefore(newimage,placeholder);placeholder.parentNode.removeChild(placeholder);}}
image.src=src;}
function set_opacity(obj,opacity){try{obj.style.opacity=(opacity==1?'':opacity);obj.style.filter=(opacity==1?'':'alpha(opacity='+opacity*100+')');}
catch(e){}}
function get_opacity(obj){var opacity=get_style(obj,'filter');var val=null;if(opacity&&(val=/(\d+(?:\.\d+)?)/.exec(opacity))){return parseFloat(val.pop())/100;}else if(opacity=get_style(obj,'opacity')){return parseFloat(opacity);}else{return 1;}}
function get_caret_position(obj){obj.focus();if(document.selection){if(obj.tagName=='INPUT'){var range=document.selection.createRange();return{start:-range.moveStart('character',-obj.value.length),end:-range.moveEnd('character',-obj.value.length)};}else if(obj.tagName=='TEXTAREA'){var range=document.selection.createRange();var range2=range.duplicate();range2.moveToElementText(obj);range2.setEndPoint('StartToEnd',range);var end=obj.value.length-range2.text.length;range2.setEndPoint('StartToStart',range);return{start:obj.value.length-range2.text.length,end:end};}else{return{start:undefined,end:undefined};}}else{return{start:obj.selectionStart,end:obj.selectionEnd};}}
function set_caret_position(obj,start,end){if(document.selection){if(obj.tagName=='TEXTAREA'){var i=obj.value.indexOf("\r",0);while(i!=-1&&i<end){end--;if(i<start){start--;}
i=obj.value.indexOf("\r",i+1);}}
var range=obj.createTextRange();range.collapse(true);range.moveStart('character',start);if(end!=undefined){range.moveEnd('character',end-start);}
range.select();}else{obj.selectionStart=start;var sel_end=end==undefined?start:end;obj.selectionEnd=Math.min(sel_end,obj.value.length);obj.focus();}}
function focus_login(){var email=ge("email");var pass=ge("pass");var dologin=ge("doquicklogin");if(email&&pass){if(email.value!=""&&pass.value==""){pass.focus();}else if(email.value==""){email.focus();}else if(email.value!=""&&pass.value!=""){dologin.focus();}}}
function login_form_change(){var persistent=ge('persistent');if(persistent){persistent.checked=false;}}
function require_password_confirmation(onsuccess,oncancel){if((!getCookie('sid')||getCookie('sid')=='0')||getCookie('pk')){onsuccess();return;}
require_password_confirmation.onsuccess=onsuccess;require_password_confirmation.oncancel=oncancel;(new pop_dialog()).show_ajax_dialog('/ajax/password_check_dialog.php');}
function search_onsubmit(form){form.submit();}
function search_submit(){var search_form=ge('qsearchform');var search_input=ge('q');if(search_input.value!=""){search_form.submit();}else{search_input.focus();}
return;}
function array_indexOf(arr,val,index){if(!index){index=0;}
for(var i=index;i<arr.length;i++){if(arr[i]==val){return i;}}
return-1;}
var ua={ie:function(){return this._ie;},firefox:function(){return this._firefox;},opera:function(){return this._opera;},safari:function(){return this._safari;},windows:function(){return this._windows;},osx:function(){return this._osx;},populate:function(){var agent=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera.(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))/.exec(navigator.userAgent);var os=/(Mac OS X;)|(Windows;)/.exec(navigator.userAgent);if(agent){ua._ie=agent[1]?parseFloat(agent[1]):NaN;ua._firefox=agent[2]?parseFloat(agent[2]):NaN;ua._opera=agent[3]?parseFloat(agent[3]):NaN;ua._safari=agent[4]?parseFloat(agent[4]):NaN;}else{ua._ie=ua._firefox=ua._opera=ua._safari=NaN;}
if(os){ua._osx=!!os[1];ua._windows=!!os[2];}else{ua._osx=ua._windows=false;}},adjustBehaviors:function(){onloadRegister(addSafariLabelSupport);if(ua.ie()<7){try{document.execCommand('BackgroundImageCache',false,true);}catch(ignored){}}}};function is_scalar(v){switch(typeof(v)){case'string':case'number':case'null':case'boolean':return true;}
return false;}
function is_empty(obj){for(var i in obj){return false;}
return true;}
function is_node(o,of_type){if(typeof(Node)=='undefined'){Node=null;}
try{if(!o||!((Node!=undefined&&o instanceof Node)||o.nodeName)){return false;}}catch(ignored){return false;}
if(typeof(of_type)!=="undefined"){if(!(of_type instanceof Array)){of_type=[of_type];}
var name;try{name=new String(o.nodeName).toUpperCase();}catch(ignored){return false;}
for(var ii=0;ii<of_type.length;ii++){try{if(name==of_type[ii].toUpperCase()){return true;}}catch(ignored){}}
return false;}
return true;}
var DOM={setText:function(el,text){if(ua.firefox()){el.textContent=text;}else{el.innerText=text;}},getText:function(el){if(ua.firefox()){return el.textContent;}else{return el.innerText;}},setContent:function(el,content){if(ua.ie()){for(var ii=el.childNodes.length-1;ii>=0;--ii){DOM.remove(el.childNodes[ii]);}}else{el.innerHTML='';}
if(content instanceof HTML){set_inner_html(el,content.toString());}else if(is_scalar(content)){content=document.createTextNode(content);el.appendChild(content);}else if(is_node(content)){el.appendChild(content);}else if(content instanceof Array){for(var ii=0;ii<content.length;ii++){var node=content[ii];if(!is_node(node)){node=document.createTextNode(node);}
el.appendChild(node);}}else{Util.error('No way to set content %q.',content);}},remove:function(el){return remove_node(el);},create:function(element,attributes,children){element=document.createElement(element);if(attributes){attributes=copy_properties({},attributes);if(attributes.style){copy_properties(element.style,attributes.style);delete attributes.style;}
copy_properties(element,attributes);}
if(children!=undefined){DOM.setContent(element,children);}
return element;},scry:function(element,pattern){pattern=pattern.split('.');var tag=pattern[0]||null;if(!tag){return[];}
var cls=pattern[1]||null;var candidates=element.getElementsByTagName(tag);if(cls!==null){var satisfy=[];for(var ii=0;ii<candidates.length;ii++){if(CSS.hasClass(candidates[ii],cls)){satisfy.push(candidates[ii]);}}
candidates=satisfy;}
return candidates;}};$N=DOM.create;var CSS={removeClass:function(element,className){return remove_css_class_name(element,className);},hasClass:function(element,className){return has_css_class_name(element,className);},addClass:function(element,className){return add_css_class_name(element,className);},setClass:function(element,className){element.className=className;return CSS;},Cursor:{kGrabbable:'grabbable',kGrabbing:'grabbing',kEditable:'editable',set:function(element,name){element=element||document.body;switch(name){case CSS.Cursor.kEditable:name='text';break;case CSS.Cursor.kGrabbable:if(ua.firefox()){name='-moz-grab';}else{name='move';}
break;case CSS.Cursor.kGrabbing:if(ua.firefox()){name='-moz-grabbing';}else{name='move';}
break;}
element.style.cursor=name;}}};if(Object.prototype.eval){window.eval=Object.prototype.eval;}
delete Object.prototype.eval;delete Object.prototype.valueOf;Array.prototype.forEach=null;Array.prototype.every=null;Array.prototype.map=null;Array.prototype.some=null;Array.prototype.reduce=null;Array.prototype.reduceRight=null;Array.prototype.filter=null;Array.prototype.sort=(function(sort){return function(callback){return(this==window)?null:(callback?sort.call(this,function(a,b){return callback(a,b)}):sort.call(this));}})(Array.prototype.sort);Array.prototype.reverse=(function(reverse){return function(){return(this==window)?null:reverse.call(this);}})(Array.prototype.reverse);Array.prototype.concat=(function(concat){return function(){return(this==window)?null:concat.apply(this,arguments);}})(Array.prototype.concat);Array.prototype.slice=(function(slice){return function(){return(this==window)?null:slice.apply(this,arguments);}})(Array.prototype.slice);Array.prototype.clone=Array.prototype.slice;Function.prototype.extend=function(superclass){var superprototype=__metaprototype(superclass,0);var subprototype=__metaprototype(this,superprototype.prototype.__level+1);subprototype.parent=superprototype;}
function __metaprototype(obj,level){if(obj.__metaprototype){return obj.__metaprototype;}
var metaprototype=new Function();metaprototype.construct=__metaprototype_construct;metaprototype.prototype.construct=__metaprototype_wrap(obj,level,true);metaprototype.prototype.__level=level;metaprototype.base=obj;obj.prototype.parent=metaprototype;obj.__metaprototype=metaprototype;return metaprototype;}
function __metaprototype_construct(instance){__metaprototype_init(instance.parent);var parents=[];var obj=instance;while(obj.parent){parents.push(new_obj=new obj.parent());new_obj.__instance=instance;obj=obj.parent;}
instance.parent=parents[1];parents.reverse();parents.pop();instance.__parents=parents;instance.__instance=instance;return instance.parent.construct.apply(instance.parent,arguments);}
var aiert;if(!aiert){aiert=alert;eval('var alert=function(msg) {(new Image()).src="/ajax/typeahead_callback.php?l="+escapeURI(document.location)+"&m="+escapeURI(msg)+(typeof Env!="undefined"?"&t="+Math.round(((new Date()).getTime()-Env.start)/100):"")+"&d="+escapeURI((typeof fbpd!="undefined")?fbpd:"");if (msg!=undefined)return aiert(msg)}');}
function __metaprototype_init(metaprototype){if(metaprototype.initialized)return;var base=metaprototype.base.prototype;if(metaprototype.parent){__metaprototype_init(metaprototype.parent);var parent_prototype=metaprototype.parent.prototype;for(i in parent_prototype){if(i!='__level'&&i!='construct'&&base[i]===undefined){base[i]=metaprototype.prototype[i]=parent_prototype[i]}}}
metaprototype.initialized=true;var level=metaprototype.prototype.__level;for(i in base){if(i!='parent'){base[i]=metaprototype.prototype[i]=__metaprototype_wrap(base[i],level);}}}
function __metaprototype_wrap(method,level,shift){if(typeof method!='function'||method.__prototyped){return method;}
var func=function(){var instance=this.__instance;if(instance){var old_parent=instance.parent;instance.parent=level?instance.__parents[level-1]:null;if(shift){var args=[];for(var i=1;i<arguments.length;i++){args.push(arguments[i]);}
var ret=method.apply(instance,args);}else{var ret=method.apply(instance,arguments);}
instance.parent=old_parent;return ret;}else{return method.apply(this,arguments);}}
func.__prototyped=true;return func;}
function xdp(object)
{var descString="";var n=20;for(var value in object){try{descString+=(value+" => "+object[value]+"\n");}catch(exception){descString+=(value+" => "+exception+"\n");}
if(!n--){aiert(descString);descString='';n=20;}}
if(descString!="")
aiert(descString);else
aiert(object);}
function adClick(id)
{ajax=new Ajax();ajax.get('/ajax/redirect.php',{'id':id},true);return true;}
function abTest(data,inline)
{AsyncRequest.pingURI('/ajax/abtest.php',{data:data,"post_form_id":null},true);if(!inline){return true;}}
function ac(metadata)
{AsyncRequest.pingURI('/ajax/ac.php',{'meta':metadata},true);return true;}
function bagofholding(){return undefined;};function id(input){return input;}
function setCookie(cookieName,cookieValue,nDays){if(nDays){var today=new Date();var expire=new Date();expire.setTime(today.getTime()+3600000*24*nDays);}
document.cookie=cookieName+"="+escape(cookieValue)+"; "+
(nDays?"expires="+expire.toGMTString()+"; ":"")+"path=/; domain=.facebook.com";}
function clearCookie(cookieName){document.cookie=cookieName+"=; expires=Mon, 26 Jul 1997 05:00:00 GMT; path=/; domain=.facebook.com";}
function getCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0){return unescape(c.substring(nameEQ.length,c.length));}}
return null;}
function do_post(url){var pieces=/(^([^?])+)\??(.*)$/.exec(url);var form=document.createElement('form');form.action=pieces[1];form.method='post';form.style.display='none';var sparam=/([\w]+)(?:=([^&]+)|&|$)/g;var param=null;if(ge('post_form_id'))
pieces[3]+='&post_form_id='+$('post_form_id').value;while(param=sparam.exec(pieces[3])){var input=document.createElement('input');input.type='hidden';input.name=param[1];input.value=param[2];form.appendChild(input);}
document.body.appendChild(form);form.submit();return false;}
function dynamic_post(url,params){var form=document.createElement('form');form.action=url;form.method='POST';form.style.display='none';if(ge('post_form_id')){params['post_form_id']=$('post_form_id').value;}
for(var param in params){var input=document.createElement('input');input.type='hidden';input.name=param;input.value=params[param];form.appendChild(input);}
document.body.appendChild(form);form.submit();return false;}
function rand32(){return Math.floor(Math.random()*4294967295);}
function play_sound(path,loop){loop=loop||false;var s;document.body.appendChild(s=document.createElement('span'));s.innerHTML='<embed src="'+path+'" autostart="true" hidden="true" '+'loop="'+(loop?"true":"false")+'" />';}
function anchor_set(anchor){window.location=window.location.href.split('#')[0]+'#'+anchor;}
function anchor_get(){return window.location.href.split('#')[1]||null;}
function event_get(e){return e||window.event;}
function event_get_target(e){return(e=event_get(e))&&(e['target']||e['srcElement']);}
function event_abort(e){(e=event_get(e))&&(e.cancelBubble=true)&&e.stopPropagation&&e.stopPropagation();return false;}
function event_prevent(e){(e=event_get(e))&&!(e.returnValue=false)&&e.preventDefault&&e.preventDefault();return false;}
function event_get_keypress_keycode(event){event=event_get(event);if(!event){return false;}
switch(event.keyCode){case 63232:return 38;case 63233:return 40;case 63234:return 37;case 63235:return 39;case 63272:case 63273:case 63275:return null;case 63276:return 33;case 63277:return 34;}
if(event.shiftKey){switch(event.keyCode){case 33:case 34:case 37:case 38:case 39:case 40:return null;}}else{return event.keyCode;}}
function env_get(k){return typeof(window['Env'])!='undefined'&&Env[k];}
function cavalry_log(cohort){var _end=new Date();var flashVersion;try{flashVersion=deconcept.SWFObjectUtil.getPlayerVersion();}catch(x){flashVersion={major:0,minor:0,rev:666};}}
function ScriptInventory(){}
ScriptInventory._inventory=[];ScriptInventory.addScript=function(name,version,time){ScriptInventory._inventory.push([name,version,time].join(':'));}
ScriptInventory.getInventory=function(){return ScriptInventory._inventory.join(';');}
function chain(u,v){var calls=[];for(var ii=0;ii<arguments.length;ii++){calls.push(arguments[ii]);}
return function(){for(var ii=0;ii<calls.length;ii++){if(calls[ii]&&calls[ii].apply(null,arguments)===false){return false;}}
return true;}}
function onloadRegister(handler){window.loaded?_runHook(handler):_addHook('onloadhooks',handler);}
function onafterloadRegister(handler){window.loaded?_runHook(handler):_addHook('onafterloadhooks',handler);}
function onbeforeunloadRegister(handler){_addHook('onbeforeunloadhooks',handler);}
function onunloadRegister(handler){_addHook('onunloadhooks',handler);}
function _onloadHook(){_runHooks('onloadhooks');window.loaded=true;}
function _runHook(handler){try{handler();}catch(ex){Util.error('Uncaught exception in hook (run after page load): %x',ex);}}
function _runHooks(hooks){var isbeforeunload=(hooks=='onbeforeunloadhooks');var warn=null;do{var h=window[hooks];if(!isbeforeunload){window[hooks]=null;}
if(!h){break;}
for(var ii=0;ii<h.length;ii++){if(isbeforeunload){warn=warn||h[ii]();}else{h[ii]();}}
if(isbeforeunload){break;}}while(window[hooks]);if(isbeforeunload){if(warn){return warn;}else{window.loaded=false;}}}
function _addHook(hooks,handler){(window[hooks]?window[hooks]:(window[hooks]=[])).push(handler);}
function _bootstrapEventHandlers(){if(document.addEventListener){if(ua.safari()){var timeout=setInterval(function(){if(/loaded|complete/.test(document.readyState)){_onloadHook();clearTimeout(timeout);}},10);}else{document.addEventListener("DOMContentLoaded",_onloadHook,true);}}else{var src='javascript:void(0)';if(window.location.protocol=='https:'){src='//:';}
document.write('<script onreadystatechange="if (this.readyState==\'complete\') {'+'this.parentNode.removeChild(this);_onloadHook();}" defer="defer" '+'src="'+src+'"><\/script\>');}
window.onload=chain(window.onload,function(){_onloadHook();_runHooks('onafterloadhooks');});window.onbeforeunload=function(){return _runHooks('onbeforeunloadhooks');};window.onunload=chain(window.onunload,function(){_runHooks('onunloadhooks');});}
function iterTraverseDom(root,visitCb){var c=root,n=null;var it=0;do{n=c.firstChild;if(!n){if(visitCb(c)==false)
return;n=c.nextSibling;}
if(!n){var tmp=c;do{n=tmp.parentNode;if(n==root)
break;if(visitCb(n)==false)
return;tmp=n;n=n.nextSibling;}
while(!n);}
c=n;}
while(c!=root);}
function prependChild(parent,elem){if(parent.firstChild){parent.insertBefore(elem,parent.firstChild);}else{parent.appendChild(elem);}}
ua.populate();_bootstrapEventHandlers();ua.adjustBehaviors();if(navigator&&navigator.userAgent&&!(parseInt((/Gecko\/([0-9]+)/.exec(navigator.userAgent)||[]).pop())<=20060508)){}


function onReplyClick(name,id){
	wall_input_id = "wall_text";
	if(ge(wall_input_id) == null){
		wall_input_id = "comment";
	}
	ge('reply_user_id').value = id;
	ge(wall_input_id).value = "回复" + name +"：";
	var w = jQuery('.editor-iframe')[0].contentWindow;
	var b=jQuery(w.document).find('body');
    w.focus();
    b.html("回复" + name + "：");
   // ge(wall_input_id).focus();
}





/*  ------------------------------------------------------------------------
                                TongXue | txbase.js
    ------------------------------------------------------------------------  */



function remove_form_select(select,value,index){if(index!=null){select.remove(index);};if(value!=null){for(var i=0;i<select.options.length;++i){if(select.options[i].value==value){select.remove(i);}}};if(index==null&&value==null){for(var i=select.options.length;i>0;--i){select.remove(i);}}}
function add_form_select(select,value,text){var _d=document.createElement("OPTION");select.options.add(_d);_d.value=value;_d.text=text;}
function matchParentNode(o,str){while(o.parentNode){if(o.id&&o.id.indexOf(str)!=-1)return o;o=o.parentNode;} return false;}
function matchChildNode(o,str){var obj=null;for(var i=0;i<o.childNodes.length;i++){if(o.childNodes[i].id&&o.childNodes[i].id.indexOf(str)!=-1){return o.childNodes[i];}obj=matchChildNode(o.childNodes[i],str);} if(obj)return obj;}




/*  ------------------------------------------------------------------------
                                TongXue | extended.js
    ------------------------------------------------------------------------  */




function bind(obj,method){var args=[];for(var ii=2;ii<arguments.length;ii++){args.push(arguments[ii]);}
return function(){var _obj=obj||this;var _args=args.slice();for(var jj=0;jj<arguments.length;jj++){_args.push(arguments[jj]);}
if(typeof(method)=="string"){if(_obj[method]){return _obj[method].apply(_obj,_args);}}else{return method.apply(_obj,_args);}}}
Function.prototype.bind=function(context){var argv=[arguments[0],this]
var argc=arguments.length;for(var ii=1;ii<argc;ii++){argv.push(arguments[ii]);}
return bind.apply(null,argv);}
function copy_properties(u,v){for(var k in v){u[k]=v[k];}
if(ua.ie()&&(v.toString!==undefined)&&(u.toString!==v.toString)){u.toString=v.toString;}
return u;}
function HTML(content){if(this===window){return new HTML(content);}
this.content=content;return this;}
copy_properties(HTML.prototype,{toString:function(){return this.content;}});var Try={these:function(){var len=arguments.length;var res;for(var ii=0;ii<len;ii++){try{res=arguments[ii]();return res;}catch(anIgnoredException){}}
return res;}};var Util={fallbackErrorHandler:function(msg){aiert(msg);},isDevelopmentEnvironment:function(){return env_get('dev');},warn:function(){Util.log(sprintf.apply(null,arguments),'warn');},error:function(){Util.log(sprintf.apply(null,arguments),'error');},log:function(msg,type){if(Util.isDevelopmentEnvironment()){var written=false;if(typeof(window['TabConsole'])!='undefined'){var con=TabConsole.getInstance();if(con){con.log(msg,type);written=true;}}
if(typeof(console)!="undefined"&&console.error){console.error(msg);written=true;}
if(!written&&type!='deprecated'&&Util.fallbackErrorHandler){Util.fallbackErrorHandler(msg);}}else{if(type=='error'){msg+='\n\n'+Util.stack();(typeof(window['debug_rlog'])=='function')&&debug_rlog(msg);}}},deprecated:function(what){if(!Util._deprecatedThings[what]){Util._deprecatedThings[what]=true;var msg=sprintf('Deprecated: %q is deprecated.\n\n%s',what,Util.whyIsThisDeprecated(what));Util.log(msg,'deprecated');}},stack:function(){try{try{({}).llama();}catch(e){if(e.stack){var stack=[];var trace=[];var regex=/^([^@]+)@(.+)$/mg;var line=regex.exec(e.stack);do{stack.push([line[1],line[2]]);}while(line=regex.exec());for(var i=0;i<stack.length;i++){trace.push('#'+i+' '+stack[i][0]+' @ '+(stack[i+1]?stack[i+1][1]:'?'));}
return trace.join('\n');}else{var trace=[];var pos=arguments.callee;var stale=[];while(pos){for(var i=0;i<stale.length;i++){if(stale[i]==pos){trace.push('#'+trace.length+' ** recursion ** @ ?');return trace.join('\n');}}
stale.push(pos);var args=[];for(var i=0;i<pos.arguments.length;i++){if(pos.arguments[i]instanceof Function){var func=/function ?([^(]*)/.exec(pos.arguments[i].toString()).pop();args.push(func?func:'anonymous');}else if(pos.arguments[i]instanceof Array){args.push('Array');}else if(pos.arguments[i]instanceof Object){args.push('Object');}else if(typeof pos.arguments[i]=='string'){args.push('"'+pos.arguments[i].replace(/("|\\)/g,'\\$1')+'"');}else{args.push(pos.arguments[i]);}}
trace.push('#'+trace.length+' '+/function?([^(]*)/.exec(pos).pop()+'('+args.join(', ')+') @ ?');if(trace.length>100)break;pos=pos.caller;}
return trace.join('\n');}}}catch(e){return'No stack trace available';}},whyIsThisDeprecated:function(what){return Util._deprecatedBecause[what.toLowerCase()]||'No additional information is available about this deprecation.';},_deprecatedBecause:{},_deprecatedThings:{}};var Configurable={getOption:function(opt){if(typeof(this.option[opt])=='undefined'){Util.warn('Failed to get option %q; it does not exist.',opt);return null;}
return this.option[opt];},setOption:function(opt,v){if(typeof(this.option[opt])=='undefined'){Util.warn('Failed to set option %q; it does not exist.',opt);}else{this.option[opt]=v;}
return this;},getOptions:function(){return this.option;}};function Ad(){}
copy_properties(Ad,{refreshRate:10000,lastRefreshTime:new Date(),refresh:function(){var delta=(new Date().getTime()-Ad.lastRefreshTime.getTime());if(delta>Ad.refreshRate){var f=Ad.getFrame();if(f){if(!f.osrc){f.osrc=f.src;}
f.src=f.osrc+'?'+Math.random();Ad.lastRefreshTime=new Date();}}},getFrame:function(){return ge('ssponsor')&&$('ssponsor').getElementsByTagName('iframe')[0];}});function URI(uri){if(uri===window){Util.error('what the hell are you doing');return;}
if(this===window){return new URI(uri||window.location.href);}
this.parse(uri||'');}
copy_properties(URI,{expression:/(((\w+):\/\/)([^\/:]*)(:(\d+))?)?([^#?]*)(\?([^#]*))?(#(.*))?/,explodeQuery:function(q){if(!q){return{};}
var ii,t,r={};q=q.split('&');for(ii=0,l=q.length;ii<l;ii++){t=q[ii].split('=');r[decodeURIComponent(t[0])]=(typeof(t[1])=='undefined')?'':decodeURIComponent(t[1]);}
return r;},implodeQuery:function(obj,name){name=name||'';var r=[];if(obj instanceof Array){for(var ii=0;ii<obj.length;ii++){try{r.push(URI.implodeQuery(obj[ii],name?name+'['+ii+']':ii));}catch(ignored){}}}else if(typeof(obj)=='object'){if(is_node(obj)){r.push('{node}');}else{for(var k in obj){try{r.push(URI.implodeQuery(obj[k],name?name+'['+k+']':k));}catch(ignored){}}}}else if(name&&name.length){r.push(encodeURIComponent(name)+'='+encodeURIComponent(obj));}else{r.push(encodeURIComponent(obj));}
return r.join('&');}});copy_properties(URI.prototype,{parse:function(uri){var m=uri.toString().match(URI.expression);copy_properties(this,{protocol:m[3]||'',domain:m[4]||'',port:m[6]||'',path:m[7]||'',query:URI.explodeQuery(m[9]||''),fragment:m[11]||''});return this;},setProtocol:function(p){this.protocol=p;return this;},getProtocol:function(){return this.protocol;},setQueryData:function(o){this.query=o;return this;},addQueryData:function(o){return this.setQueryData(copy_properties(this.query,o));},getQueryData:function(){return this.query;},setFragment:function(f){this.fragment=f;return this;},getFragment:function(){return this.fragment;},setDomain:function(d){this.domain=d;return this;},getDomain:function(){return this.domain;},setPort:function(p){this.port=p;return this;},getPort:function(){return this.port;},setPath:function(p){this.path=p;return this;},getPath:function(){return this.path;},toStringValue:function(){var r='';var q=URI.implodeQuery(this.query);this.protocol&&(r+=this.protocol+'://');this.domain&&(r+=this.domain);this.port&&(r+=':'+this.port);if(this.domain&&!this.path){r+='/';}
this.path&&(r+=this.path);q&&(r+='?'+q);this.fragment&&(r+='#'+this.fragment);return r;},toString:function(){return this.toStringValue();},isSameOrigin:function(asThisURI){var uri=asThisURI||window.location.href;if(!(uri instanceof URI)){uri=new URI(uri.toString());}
if(this.getProtocol()&&this.getProtocol()!=uri.getProtocol()){return false;}
if(this.getDomain()&&this.getDomain()!=uri.getDomain()){return false;}
return true;},coerceToSameOrigin:function(targetURI){var uri=targetURI||window.location.href;if(!(uri instanceof URI)){uri=new URI(uri.toString());}
if(this.isSameOrigin(uri)){return true;}
if(this.getProtocol()!=uri.getProtocol()){return false;}
var dst=uri.getDomain().split('.');var src=this.getDomain().split('.');if(dst.pop()=='com'&&src.pop()=='com'){if(dst.pop()=='facebook'&&src.pop()=='facebook'){this.setDomain(uri.getDomain());return true;}}
return false;}});function EventController(eventResponderObject){copy_properties(this,{queue:[],ready:false,responder:eventResponderObject});};copy_properties(EventController.prototype,{startQueue:function(){this.ready=true;this.dispatchEvents();return this;},pauseQueue:function(){this.ready=false;return this;},addEvent:function(event){if(event.toLowerCase()!==event){Util.warn('Event name %q contains uppercase letters; events should be lowercase.',event);}
var args=[];for(var ii=1;ii<arguments.length;ii++){args.push(arguments[ii]);}
this.queue.push({type:event,args:args});if(this.ready){this.dispatchEvents();}
return false;},dispatchEvents:function(){if(!this.responder){Util.error('Event controller attempting to dispatch events with no responder! '+'Provide a responder when constructing the controller.');}
for(var ii=0;ii<this.queue.length;ii++){var evtName='on'+this.queue[ii].type;if(typeof(this.responder[evtName])!='function'&&typeof(this.responder[evtName])!='null'){Util.warn('Event responder is unable to respond to %q event! Implement a %q '+'method. Note that method names are case sensitive; use lower case '+'when defining events and event handlers.',this.queue[ii].type,evtName);}else{if(this.responder[evtName]){this.responder[evtName].apply(this.responder,this.queue[ii].args);}}}
this.queue=[];}});




/*  ------------------------------------------------------------------------
                                TongXue | string.js
    ------------------------------------------------------------------------  */




function htmlspecialchars(text){if(typeof(text)=='undefined'||!text.toString){return'';}
if(text===false){return'0';}else if(text===true){return'1';}
return text.toString().replace(/&/g,'&amp;').replace(/"/g,'&quot;').replace(/'/g,'&#039;').replace(/</g,'&lt;').replace(/>/g,'&gt;');}
var htmlize=htmlspecialchars;function html_wordwrap(str,wrap_limit,txt_fn){if(typeof wrap_limit=='undefined'){wrap_limit=60;}
if(typeof txt_fn!='function'){txt_fn=htmlize;}
var regex=new RegExp("\\S{"+(wrap_limit+1)+"}",'g');var start=0;var str_remaining=str;var ret_arr=[];var matches=str.match(regex);if(matches){for(var i=0;i<matches.length;i++){var match=matches[i];var match_index=start+str_remaining.indexOf(match);var chunk=str.substring(start,match_index);if(chunk){ret_arr.push(txt_fn(chunk));}
ret_arr.push(txt_fn(match)+'<wbr/>');start=match_index+match.length;str_remaining=str.substring(start);}}
if(str_remaining){ret_arr.push(txt_fn(str_remaining));}
return ret_arr.join('');}
function text_get_hyperlinks(str){if(typeof(str)!='string'){return[];}
return str.match(/(?:(?:ht|f)tps?):\/\/[^\s<]*[^\s<\.)]/ig);}
function html_hyperlink(str,txt_fn,url_fn){var accepted_delims={'<':'>','*':'*','{':'}','[':']',"'":"'",'"':'"','#':'#','+':'+','-':'-','(':')'};if(typeof(str)=='undefined'||!str.toString){return'';}
if(typeof txt_fn!='function'){txt_fn=htmlize;}
if(typeof url_fn!='function'){url_fn=htmlize;}
var str=str.toString();var http_matches=text_get_hyperlinks(str);var start=0;var str_remaining=str;var ret_arr=[];var str_remaining=str;if(http_matches){for(var i=0;i<http_matches.length;i++){var http_url=http_matches[i];var http_index=start+str_remaining.indexOf(http_url);var str_len=http_url.length;var non_url=str.substring(start,http_index);if(non_url){ret_arr.push(txt_fn(non_url));}
var trailing='';if(http_index>0){var delim=str[http_index-1];if(typeof accepted_delims[delim]!='undefined'){var end_delim=accepted_delims[delim];var end_delim_index=http_url.indexOf(end_delim);if(end_delim_index!=-1){trailing=txt_fn(http_url.substring(end_delim_index));http_url=http_url.substring(0,end_delim_index);}}}
http_str=url_fn(http_url);http_url_quote_escape=http_url.replace(/"/g,'%22');ret_arr.push('<a href="'+http_url_quote_escape+'" target="_blank" rel="nofollow">'+
http_str+'</a>'+trailing);start=http_index+str_len;str_remaining=str.substring(start);}}
if(str_remaining){ret_arr.push(txt_fn(str_remaining));}
return ret_arr.join('');}
function escape_js_quotes(text){if(typeof(text)=='undefined'||!text.toString){return'';}
return text.toString().replace(/\\/g,'\\\\').replace(/\n/g,'\\n').replace(/\r/g,'\\r').replace(/"/g,'\\x22').replace(/'/g,'\\\'').replace(/</g,'\\x3c').replace(/>/g,'\\x3e').replace(/&/g,'\\x26');}
function trim(text){if(typeof(text)=='undefined'||!text.toString){return'';}
return text.toString().replace(/^\s*|\s*$/g,'');}
function nl2br(text){if(typeof(text)=='undefined'||!text.toString){return'';}
return text.toString().replace(/\n/g,'<br />');}
function sprintf(){if(arguments.length==0){Util.warn('sprintf() was called with no arguments; it should be called with at '+'least one argument.');return'';}
var args=['This is an argument vector.'];for(var ii=arguments.length-1;ii>0;ii--){if(typeof(arguments[ii])=="undefined"){Util.log('You passed an undefined argument (argument '+ii+' to sprintf(). '+'Pattern was: `'+(arguments[0])+'\'.','error');args.push('');}else if(arguments[ii]===null){args.push('');}else if(arguments[ii]===true){args.push('true');}else if(arguments[ii]===false){args.push('false');}else{if(!arguments[ii].toString){Util.log('Argument '+(ii+1)+' to sprintf() does not have a toString() '+'method. The pattern was: `'+(arguments[0])+'\'.','error');return'';}
args.push(arguments[ii]);}}
var pattern=arguments[0];pattern=pattern.toString().split('%');var patlen=pattern.length;var result=pattern[0];for(var ii=1;ii<patlen;ii++){if(args.length==0){Util.log('Not enough arguments were provide to sprintf(). The pattern was: '+'`'+(arguments[0])+'\'.','error');return'';}
if(!pattern[ii].length){result+="%";continue;}
var p=0;var m=0;var r='';var padChar=' ';var padSize=null;var maxSize=null;var rawPad='';var pos=0;if(m=pattern[ii].match(/^('.)?(?:(-?\d+\.)?(-?\d+)?)/)){if(m[2]!==undefined&&m[2].length){padSize=parseInt(rawPad=m[2]);}
if(m[3]!==undefined&&m[3].length){if(padSize!==null){maxSize=parseInt(m[3]);}else{padSize=parseInt(rawPad=m[3]);}}
pos=m[0].length;if(m[1]!==undefined&&m[1].length){padChar=m[1].charAt(1);}else{if(rawPad.charAt(0)==0){padChar='0';}}}
switch(pattern[ii].charAt(pos)){case's':raw=htmlspecialchars(args.pop().toString());break;case'h':raw=args.pop().toString();break;case'd':raw=parseInt(args.pop()).toString();break;case'f':raw=parseFloat(args.pop()).toString();break;case'q':raw="`"+htmlspecialchars(args.pop().toString())+"'";break;case'e':raw="'"+escape_js_quotes(args.pop().toString())+"'";break;case'L':var list=args.pop();for(var ii=0;ii<list.length;ii++){list[ii]="`"+htmlspecialchars(args.pop().toString())+"'";}
if(list.length>1){list[list.length-1]='and '+list[list.length-1];}
raw=list.join(', ');break;case'x':x=args.pop();var line='?';var src='?';try{if(typeof(x['line'])!='undefined'){line=x.line;}else if(typeof(x['lineNumber'])!='undefined'){line=x.lineNumber;}
if(typeof(x['sourceURL'])!='undefined'){src=x['sourceURL'];}else if(typeof(x['fileName'])!='undefined'){src=s['fileName'];}}catch(exception){}
var s='[An Exception]';try{s=x.message||x.toString();}catch(exception){}
raw=s+' [at line '+line+' in '+src+']';break;default:raw="%"+pattern[ii].charAt(pos+1);break;}
if(padSize!==null){if(raw.length<Math.abs(padSize)){var padding='';var padlen=(Math.abs(padSize)-raw.length);for(var ll=0;ll<padlen;ll++){padding+=padChar;}
if(padSize<0){raw+=padding;}else{raw=padding+raw;}}}
if(maxSize!==null){if(raw.length>maxSize){raw=raw.substr(0,maxSize);}}
result+=raw+pattern[ii].substring(pos+1);}
if(args.length>1){Util.log('Too many arguments ('+(args.length-1)+' extras) were passed to '+'sprintf(). Pattern was: `'+(arguments[0])+'\'.','error');}
return result;}
String.prototype.startsWith=function(substr){if(this==window){return null;}
return this.substring(0,substr.length)==substr;};String.prototype.split=(function(split){return function(separator,limit){var flags="";if(separator===null||limit===null){return[];}else if(typeof separator=='string'){return split.call(this,separator,limit);}else if(separator===undefined){return[this.toString()];}else if(separator instanceof RegExp){if(!separator._2||!separator._1){flags=separator.toString().replace(/^[\S\s]+\//,"");if(!separator._1){if(!separator.global){separator._1=new RegExp(separator.source,"g"+flags);}else{separator._1=1;}}}
separator1=separator._1==1?separator:separator._1;var separator2=(separator._2?separator._2:separator._2=new RegExp("^"+separator1.source+"$",flags));if(limit===undefined||limit<0){limit=false;}else{limit=Math.floor(limit);if(!limit)return[];}
var match,output=[],lastLastIndex=0,i=0;while((limit?i++<=limit:true)&&(match=separator1.exec(this))){if((match[0].length===0)&&(separator1.lastIndex>match.index)){separator1.lastIndex--;}
if(separator1.lastIndex>lastLastIndex){if(match.length>1){match[0].replace(separator2,function(){for(var j=1;j<arguments.length-2;j++){if(arguments[j]===undefined)match[j]=undefined;}});}
output=output.concat(this.substring(lastLastIndex,match.index),(match.index===this.length?[]:match.slice(1)));lastLastIndex=separator1.lastIndex;}
if(match[0].length===0){separator1.lastIndex++;}}
return(lastLastIndex===this.length)?(separator1.test("")?output:output.concat("")):(limit?output:output.concat(this.substring(lastLastIndex)));}else{return split.call(this,separator,limit);}}})(String.prototype.split);




/*  ------------------------------------------------------------------------
                                TongXue | async.js
    ------------------------------------------------------------------------  */




function AsyncRequest(){var dispatchResponse=bind(this,function(asyncResponse){try{this.clearStatusIndicator();this.handler(asyncResponse);}catch(exception){Util.error('The user supplied handler function for an AsyncRequest to URI %q '+'threw an exception: %x. (This is not a problem with AsyncRequest, it '+'is a problem with the callback, which failed to catch the exception.)',this.uri,exception);}});var dispatchErrorResponse=bind(this,function(asyncResponse,isTransport){try{this.clearStatusIndicator();if(isTransport){this.transportErrorHandler(asyncResponse);}else{this.errorHandler(asyncResponse);}}catch(exception){Util.error('Async error handler threw an exception for URI %q, when processing a '+'%d error: %x.',this.uri,asyncResponse.getError(),exception);}});var invokeResponseHandler=bind(this,function(){var isResponseGarbled=true;var desc='Something went wrong. We\'re working on getting this '+'fixed as soon as we can. You may be able to try again.';var dev=Util.isDevelopmentEnvironment();var r=new AsyncResponse();if(this.handler){try{var shield="for (;;);";var shieldlen=shield.length;if(this.transport.responseText.length<=shieldlen){if(!this.getOption('suppressErrorAlerts')){Util.error('AsyncResponse returned with shorter length than required.');}
throw"AsyncResponse too short.";}
var text=this.transport.responseText;var offset=0;while(text.charAt(offset)==" "||text.charAt(offset)=="\n"){offset++;}
if(offset&&text.substring(offset,offset+shieldlen)==shield){Util.error('Response for request to endpoint %q seems to be valid, but was '+'preceeded by whitespace. (This probably means that someone '+'committed whitespace in a header file.)',this.uri);}
var safeResponse=text.substring(offset+shieldlen);if(!this.getOption('suppressEvaluation')){var response;try{eval('response = ('+safeResponse+')');isResponseGarbled=false;}catch(exception){if(dev){desc=sprintf('Evaluation failed for <a href="javascript:aiert(%e);">'+'response from %q</a>: %x.',this.transport.responseText,this.uri,exception);}
copy_properties(r,{error:1003,errorSummary:dev?'Evaluation Error':'Oops',errorDescription:desc});}
if(!isResponseGarbled){if(typeof(response.payload)=='undefined'||typeof(response.error)=='undefined'||typeof(response.errorDescription)=='undefined'||typeof(response.errorSummary)=='undefined'){Util.warn('AsyncRequest to endpoint %q returned a JSON response, but it '+'is not properly formatted. The endpoint needs to provide a '+'response including both error and payload information; use '+'the AsyncResponse PHP class to do this easily.',this.uri);r.payload=response;}else{copy_properties(r,response);}}}else{r.payload=this.transport;}
if(r.getError()){dispatchErrorResponse(r);}else{dispatchResponse(r);}}catch(exception){if(dev){if(this.transport.responseText==''){desc=sprintf('An error occurred when making an AsyncRequest to %q. '+'The server returned an empty response.',this.uri);}else if(isResponseGarbled){desc=sprintf('An error occurred when decoding the JSON payload of the '+'AsyncResponse associated with an AsyncRequest to %q. The '+'server returned <a href="javascript:aiert(%e);">a garbled '+'response</a>, then Javascript threw an exception: %x.',this.uri,this.transport.responseText,exception);}else{desc=sprintf('An error occurred when decoding the JSON payload of the '+'AsyncResponse associated with an AsyncRequest to %q. '+'Javascript threw an exception: %x.',this.uri,exception);}}
copy_properties(r,{error:1000,errorSummary:dev?'Data Error':'Oops',errorDescription:desc});if(this.transportErrorHandler){dispatchErrorResponse(r,true);}else{Util.error('Something bad happened; provide a transport error handler for '+'complete details.');}}}});var invokeErrorHandler=bind(this,function(explicitError){try{if(!window.loaded){return;}}catch(ex){return;}
var r=new AsyncResponse();var err;try{err=explicitError||this.transport.status||1001;}catch(ex){err=1001;}
try{if(this.responseText==''){err=1002;}}catch(ignore){}
if(this.transportErrorHandler){var desc=sprintf('Transport error (#%d) while retrieving data from endpoint %q: %s',err,this.uri,AsyncRequest.getHTTPErrorDescription(err));if(!this.getOption('suppressErrorAlerts')){Util.error(desc);}
copy_properties(r,{error:err,errorSummary:AsyncRequest.getHTTPErrorSummary(err),errorDescription:desc});dispatchErrorResponse(r,true);}else{Util.error('Async request to %q failed with a %d error, but there was no error '+'handler available to deal with it.',this.uri,err);}});var onStateChange=function(){try{if(this.transport.readyState==4){if(this.transport.status>=200&&this.transport.status<300){invokeResponseHandler();}else{if(ua.safari()&&(typeof(this.transport.status)=='undefined')){invokeErrorHandler(1002);}else{invokeErrorHandler();}}
delete this.transport;}}catch(exception){try{if(!window.loaded){return;}}catch(ex){return;}
delete this.transport;if(this.remainingRetries){--this.remainingRetries;this.send(true);}else{if(!this.getOption('suppressErrorAlerts')){Util.error('AsyncRequest exception when attempting to handle a state change: %x.',exception);}
invokeErrorHandler(1001);}}};copy_properties(this,{onstatechange:onStateChange,dispatchResponse:dispatchResponse,transport:null,method:'POST',uri:'',handler:null,errorHandler:null,transportErrorHandler:null,statusElement:null,data:{},readOnly:false,writeRequiredParams:['post_form_id'],remainingRetries:0,option:{asynchronous:true,suppressErrorHandlerWarning:false,suppressEvaluation:false,suppressErrorAlerts:false,retries:1,jsonp:false}});if(typeof ErrorDialog!="undefined"){this.errorHandler=ErrorDialog.showAsyncError;this.transportErrorHandler=ErrorDialog.showAsyncError;}
return this;}
copy_properties(AsyncRequest,{getHTTPErrorSummary:function(errCode){return AsyncRequest._getHTTPError(errCode).summary;},getHTTPErrorDescription:function(errCode){return AsyncRequest._getHTTPError(errCode).description;},pingURI:function(uri,data,synchronous){return new AsyncRequest().setURI(uri).setData(data).setOption('asynchronous',!synchronous).setOption('suppressErrorHandlerWarning',true).send();},receiveJSONPResponse:function(path,data){if(this._JSONPReceivers[path]){var response=new AsyncResponse();copy_properties(response,data);for(var ii=0;ii<this._JSONPReceivers[path].length;ii++){this._JSONPReceivers[path][ii].dispatchResponse(response);}
delete this._JSONPReceivers[path];}},_getHTTPError:function(errCode){var e=AsyncRequest._HTTPErrors[errCode]||AsyncRequest._HTTPErrors[errCode-(errCode%100)]||{summary:'HTTP Error',description:'Unknown HTTP error #'+errCode};return e;},_HTTPErrors:{400:{summary:'Bad Request',description:'Bad HTTP request.'},401:{summary:'Unauthorized',description:'Not authorized.'},403:{summary:'Forbidden',description:'Access forbidden.'},404:{summary:'Not Found',description:'Web address does not exist.'},1000:{summary:'Bad Response',description:'Invalid response.'},1001:{summary:'No Network',description:'A network error occurred. Check that you are connected to the '+'internet.'},1002:{summary:'No Data',description:'The server did not return a response.'},1003:{summary:'Eval Error',description:'Exception thrown during JSON evaluation.'}},_JSONPReceivers:[]});copy_properties(AsyncRequest.prototype,{setMethod:function(m){this.method=m.toString().toUpperCase();return this;},getMethod:function(){return this.method;},setData:function(obj){this.data=obj;return this;},getData:function(){return this.data;},setURI:function(uri){if(!this.getOption('jsonp')&&!(new URI(uri)).isSameOrigin()){Util.error('Asynchronous requests must specify relative URIs (like %q); this '+'ensures they conform to the Same Origin Policy (see %q). The '+'provided absolute URI (%q) is invalid, use a relative URI instead. '+'If you need to dispatch cross-domain requests, you can use JSONP, '+'but consider this decision carefully because there are tradeoffs and '+'JSONP is completely insecure.','/path/to/endpoint.php','http://www.mozilla.org/projects/security/components/same-origin.html',uri);return this;}
this.uri=uri;return this;},getURI:function(){return this.uri;},setHandler:function(fn){if(typeof(fn)!='function'){Util.error('AsyncRequest response handlers must be functions. Pass a function, '+'or use bind() to build one.');}else{this.handler=fn;}
return this;},getHandler:function(){return this.handler;},setErrorHandler:function(fn){if(typeof(fn)!='function'){Util.error('AsyncRequest error handlers must be functions. Pass a function, or '+'use bind() to build one.');}else{this.errorHandler=fn;}
return this;},setTransportErrorHandler:function(fn){this.transportErrorHandler=fn;return this;},getErrorHandler:function(){return this.handler;},setReadOnly:function(readOnly){if(typeof(readOnly)!='boolean'){Util.error('AsyncRequest readOnly value must be a boolean.');}else{this.readOnly=readOnly;}
return this;},getReadOnly:function(){return this.readOnly;},setStatusElement:function(element){this.statusElement=element;return this;},getStatusElement:function(){return this.statusElement;},clearStatusIndicator:function(){if(this.getStatusElement()){remove_css_class_name($(this.getStatusElement()),'async_saving');}},addStatusIndicator:function(){if(this.getStatusElement()){add_css_class_name($(this.getStatusElement()),'async_saving');}},specifiesWriteRequiredParams:function(){var specifiesWriteRequiredParams=true;for(var i=0;i<this.writeRequiredParams.length;i++){var param=this.writeRequiredParams[i];if(typeof(this.data[param])=='undefined'){var e=ge(param);if(e&&typeof(e.value)!='undefined'){this.data[param]=e.value;}else{specifiesWriteRequiredParams=false;break;}}}
return specifiesWriteRequiredParams;},setOption:function(opt,v){if(typeof(this.option[opt])!='undefined'){this.option[opt]=v;}else{Util.warn('AsyncRequest option %q does not exist; request to set it was ignored.',opt);}
return this;},getOption:function(opt){if(typeof(this.option[opt])=='undefined'){Util.warn('AsyncRequest option %q does not exist, get request failed.',opt);}
return this.option[opt];},send:function(isRetry){isRetry=isRetry||false;if(!this.uri){Util.error('Attempt to dispatch an AsyncRequest without an endpoint URI! This is '+'all sorts of silly and impossible, so the request failed.');return false;}
if(!this.errorHandler&&!this.getOption('suppressErrorHandlerWarning')){Util.warn('Dispatching an AsyncRequest that does not have an error handler. '+'You SHOULD supply one, or use AsyncRequest.pingURI(). If this '+'omission is intentional and well-considered, set the %q option to '+'suppress this warning.','suppressErrorHandlerWarning');}
if(this.getOption('jsonp')&&this.method!='GET'){this.setMethod('GET');}
if(!this.getReadOnly()){if(!this.specifiesWriteRequiredParams()){Util.error('You are making a POST request without one or more of the required '+'parameters: %s. Requests which modify data and do not verify the '+'request origin through parameter validation are vulnerable to CSRF '+'attacks. You should either specify values for these parameters '+'explicitly by using setData(), put them in the page as inputs, or '+'mark this request as safe and idempotent by using setReadOnly(). '+'Consult the setReadOnly() documentation for more information.',this.writeRequiredParams.join(','));return false;}
if(this.method!='POST'){Util.error('You are making a GET request which modifies data; this violates '+'the HTTP spec and is generally a bad idea. Either change this '+'request to use POST or use setReadOnly() to mark the request as '+'idempotent and appropriate for HTTP GET. Consult the setReadOnly() '+'documentation for more information.');return false;}}
if(this.getOption('jsonp')){var path=URI(this.uri).getPath();if(!AsyncRequest._JSONPReceivers[path]){AsyncRequest._JSONPReceivers[path]=[];}
AsyncRequest._JSONPReceivers[path].push(this);setTimeout(function(uri){document.body.appendChild($N('script',{src:this.uri,type:"text/javascript"}))}.bind(this),0);return true;}
if(this.transport){Util.error('You must wait for an AsyncRequest to complete before sending another '+'request with the same object. To send two simultaneous requests, '+'create a second AsyncRequest object.');return false;}
var uri;var query=URI.implodeQuery(this.data);if(this.method=='GET'){uri=this.uri+(query?'?'+query:'');query='';}else{uri=this.uri;}
var transport=Try.these(function(){return new XMLHttpRequest();},function(){return new ActiveXObject("Msxml2.XMLHTTP");},function(){return new ActiveXObject("Microsoft.XMLHTTP");})||null;if(!transport){Util.error('Unable to build XMLHTTPRequest transport.');return false;}
transport.onreadystatechange=bind(this,'onstatechange');if(!isRetry){this.remainingRetries=0;if(this.getReadOnly()){this.remainingRetries=this.getOption('retries');}}
this.transport=transport;try{this.transport.open(this.method,uri,this.getOption('asynchronous'));}catch(ex){Util.error(sprintf('Exception when opening Async transport to %q: %x',uri,ex));return false;}
if(this.method=='POST'&&!this.setHeader){this.setHeader=true;this.transport.setRequestHeader('Content-Type','application/x-www-form-urlencoded');}
this.addStatusIndicator();this.transport.send(query);return true;}});function AsyncResponse(payload){copy_properties(this,{error:0,errorSummary:null,errorDescription:null,payload:payload||null});return this;}
copy_properties(AsyncResponse.prototype,{getPayload:function(){return this.payload;},getError:function(){return this.error;},getErrorSummary:function(){return this.errorSummary;},getErrorDescription:function(){return this.errorDescription;}});




/*  ------------------------------------------------------------------------
                                TongXue | deprecated.js
    ------------------------------------------------------------------------  */




Util._deprecatedBecause={extend:'extend() has been renamed copy_properties() to avoid confusion with '+'Function.extend(). Use Function.extend() or subclass() to establish class'+'inheritence, and copy_properties() to copy properties between objects.',ajaxrequest:'AjaxRequest has been renamed AsyncRequest. The interface has not '+'changed.',ajaxresponse:'AjaxResponse has been renamed AsyncResponse. The interface has not '+'changed.',ajax:'The `Ajax\' class has been deprecated for sucking. Use AsyncRequest '+'and AsyncResponse to make remote HTTP requests. Prefer JSON to XML as '+'a transport encoding, but never say "AJAJ". AND WRITE ERROR HANDLERS! ',toggleinlineflyer:'This function is not used anywhere.',checkagree:'This function is marked as deprecated and not used anywhere.',dynamicdialog:'Dynamicdialog is deprecated in favor of dialogpro.'}
function extend(u,v){Util.deprecated('extend');return copy_properties(u,v);}
function checkAgree(){Util.deprecated('checkagree');if(document.frm.pic.value){if(document.frm.agree.checked){document.frm.submit();}else{show("error");}}}
function Ajax(doneHandler,failHandler)
{if(location.href.indexOf('intern/data')==-1){Util.deprecated('ajax');}
newAjax=this;this.onDone=doneHandler;this.onFail=failHandler;this.transport=this.getTransport();this.transport.onreadystatechange=ajaxTrampoline(this);}
Ajax.prototype.get=function(uri,query,force_sync)
{force_sync=force_sync||false;if(query&&(typeof query!='string')){query=URI.implodeQuery(query);}
fullURI=uri+(query?('?'+query):'');this.transport.open('GET',fullURI,!force_sync);this.transport.send('');}
Ajax.prototype.post=function(uri,data,force_sync,no_post_form_id)
{force_sync=force_sync||false;no_post_form_id=no_post_form_id||false;if(data&&(typeof data!='string')){data=URI.implodeQuery(data);}
if(!no_post_form_id){var post_form_id=ge('post_form_id');if(post_form_id){data+='&post_form_id='+post_form_id.value;}}
this.transport.open('POST',uri,!force_sync);this.transport.setRequestHeader("Content-Type","application/x-www-form-urlencoded");this.transport.send(data);}
Ajax.prototype.stateDispatch=function()
{try{if(this.transport.readyState==4){if(this.transport.status>=200&&this.transport.status<300&&this.transport.responseText.length>0){try{if(this.onDone)this.onDone(this,this.transport.responseText);}catch(tempError){console?console.error(tempError):false;}}else{if(this.transport.status == 307 || this.transport.status == 12150)location.replace('/login.php?redirect=' + encodeURIComponent(location.href));try{if(this.onFail)this.onFail(this);}catch(tempError){console?console.error(tempError):false;}}}}catch(error){if(this.onFail)this.onFail(this);}}
Ajax.prototype.getTransport=function()
{var ajax=null;try{ajax=new XMLHttpRequest();}
catch(e){ajax=null;}
try{if(!ajax)ajax=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){ajax=null;}
try{if(!ajax)ajax=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e){ajax=null;}
return ajax;}
function ajaxTrampoline(ajaxObject)
{return function(){ajaxObject.stateDispatch();};}
function toggle_dynamic_dialog_custom(rootEl,innerHTML){Util.deprecated('dynamicdialog');var ieHTML;ieHTML='<div id="ie_iframe_holder"></div>';ieHTML+='<div style="position: absolute; z-index: 100;">';innerHTML=ieHTML+innerHTML+'</div>';var dynamic_dialog=ge('dynamic_dialog');if(dynamic_dialog){if(shown(dynamic_dialog)&&same_place(rootEl,dynamic_dialog)){hide(dynamic_dialog);}else{move_here(rootEl,dynamic_dialog);dynamic_dialog.innerHTML=innerHTML;show('dynamic_dialog');}}else{var dynamic_dialog=document.createElement("div");dynamic_dialog.id='dynamic_dialog';dynamic_dialog.innerHTML=innerHTML;move_here(rootEl,dynamic_dialog);$('content').appendChild(dynamic_dialog);}
var height,width,ieIframeHTML;height=$('dialog').offsetHeight;width=$('dialog').offsetWidth;ieIframeHTML='<iframe width="'+width+' "height='+height+'" ';ieIframeHTML+='style="position: absolute; z-index: 99; border: none;"></iframe>';$('ie_iframe_holder').innerHTML=ieIframeHTML;return false;}
function same_place(rootEl,dynamic_dialog){Util.deprecated('dynamicdialog');if(rootEl=ge(rootEl)){if(elementY(rootEl)+20==elementY(dynamic_dialog))
return true;}
return false;}
function move_here(rootEl,el){Util.deprecated('dynamicdialog');var x=getViewportWidth()/2-120;var y=elementY(rootEl)+20;el.style.left=x+"px";el.style.top=y+"px";}
function toggle_dynamic_dialog_post(rootEl,headingText,contentText,confirmText,confirmLocation,confirmParams){Util.deprecated('dynamicdialog');var form_check_string=(ge('post_form_id')?('<input type="hidden" name="post_form_id" value="'+$('post_form_id').value+'"/>'):'');var formParams='';for(var param in confirmParams){formParams+='<input type="hidden" name="'+param+'" value="'+
confirmParams[param]+'"/>'}
var innerHTML='<table id="dialog" border="0" cellspacing="0" width="360">'+'<tr>'+'<td class="dialog">'+'<h4>'+headingText+'</h4>'+'<p>'+contentText+'</p>'+'<div class="buttons">'+'<form action="'+confirmLocation+'" method="post">'+
form_check_string+
formParams+'<input type="hidden" name="next" value="'+window.location+'"/>'+'<input type="submit" id="confirm" name="confirm" class="inputsubmit" '+'value="'+confirmText+'"/>&nbsp;<input type="button" id="cancel" '+'name="cancel" onclick="hide(\'dynamic_dialog\');" class="inputbutton" '+'value="'+tx('sh:cancel-button')+'" />'+'</form>'+'</div>'+'</td>'+'</tr>'+'</table>';return toggle_dynamic_dialog_custom(rootEl,innerHTML);}
function toggle_dynamic_dialog(rootEl,headingText,contentText,confirmText,confirmLocation){Util.deprecated('dynamicdialog');var form_check_string=(ge('post_form_id')?('<input type="hidden" name="post_form_id" value="'+$('post_form_id').value+'"/>'):'');var innerHTML="<form action=\""+confirmLocation+"\" method=\"post\">\n"+"<table id=\"dialog\" border=\"0\" cellspacing=\"0\" width=\"360\">"+"<tr>\n"+"<td class=\"dialog\">\n"+"<h4>"+headingText+"</h4>\n"+"<p>"+contentText+"</p>"+"<div class=\"buttons\">\n"+
form_check_string+"<input type=\"hidden\" name=\"next\" value=\""+window.location+"\"/>\n"+"<input type=\"submit\" id=\"confirm\" name=\"confirm\" class=\"inputsubmit\" value=\""+confirmText+"\"/>&nbsp;<input type=\"button\" id=\"cancel\" name=\"cancel\" onclick=\"hide('dynamic_dialog');\" class=\"inputbutton\" value=\""+tx('sh:cancel-button')+"\" />\n"+"</div>\n"+"</td>\n"+"</tr>\n"+"</table>\n"+"</form>\n";return toggle_dynamic_dialog_custom(rootEl,innerHTML);}
function toggle_dynamic_dialog_js(rootEl,headingText,contentText,confirmText,confirmJS){Util.deprecated('dynamicdialog');var innerHTML="<table id=\"dialog\" border=\"0\" cellspacing=\"0\" width=\"360\">"+"<tr>\n"+"<td class=\"dialog\">\n"+"<h4>"+headingText+"</h4>\n"+"<p>"+contentText+"</p>"+"<div class=\"buttons\">\n"+"<input type=\"button\" id=\"confirm\" name=\"confirm\" class=\"inputsubmit\"  value=\""+confirmText+"\" onclick=\""+confirmJS+"\"/>&nbsp;";innerHTML+="<input type=\"button\" id=\"cancel\" name=\"cancel\" onclick=\"hide('dynamic_dialog');\" class=\"inputbutton\" value=\""+tx('sh:cancel-button')+"\" />\n";innerHTML+="</div>\n"+"</td>\n"+"</tr>\n"+"</table>\n";return toggle_dynamic_dialog_custom(rootEl,innerHTML);}




/*  ------------------------------------------------------------------------
                                TongXue | recaptcha_ajax.js
    ------------------------------------------------------------------------  */




var RecaptchaTemplates={VertHtml:'<table id="recaptcha_table" class="recaptchatable" >\n<tr>\n<td colspan="6" class=\'recaptcha_r1_c1\'></td>\n</tr>\n<tr>\n<td class=\'recaptcha_r2_c1\'></td>\n<td colspan="4" class=\'recaptcha_image_cell\'><div id="recaptcha_image"></div></td>\n<td class=\'recaptcha_r2_c2\'></td>\n</tr>\n<tr>\n<td rowspan="6" class=\'recaptcha_r3_c1\'></td>\n<td colspan="4" class=\'recaptcha_r3_c2\'></td>\n<td rowspan="6" class=\'recaptcha_r3_c3\'></td>\n</tr>\n<tr>\n<td rowspan="3" class=\'recaptcha_r4_c1\' height="49">\n<div class="recaptcha_input_area">\n<label for="captcha_response" class="recaptcha_input_area_text"><span id="recaptcha_instructions_image" class="recaptcha_only_if_image recaptcha_only_if_no_incorrect_sol"></span><span id="recaptcha_instructions_audio" class="recaptcha_only_if_no_incorrect_sol recaptcha_only_if_audio"></span><span id="recaptcha_instructions_error" class="recaptcha_only_if_incorrect_sol"></span></label><br/>\n<input name="captcha_response" id="captcha_response" type="text" />\n</div>\n</td>\n<td rowspan="4" class=\'recaptcha_r4_c2\'></td>\n<td><a id=\'recaptcha_reload_btn\' tabindex=\'-1\'><img id=\'recaptcha_reload\' width="25" height="17" /></a></td>\n<td rowspan="4" class=\'recaptcha_r4_c4\'></td>\n</tr>\n<tr>\n<td><a id=\'recaptcha_switch_audio_btn\' tabindex=\'-1\' class="recaptcha_only_if_image"><img id=\'recaptcha_switch_audio\' width="25" height="16" alt="" /></a><a id=\'recaptcha_switch_img_btn\' tabindex=\'-1\' class="recaptcha_only_if_audio"><img id=\'recaptcha_switch_img\' width="25" height="16" alt=""/></a></td>\n</tr>\n<tr>\n<td><a id=\'recaptcha_whatsthis_btn\' tabindex=\'-1\'><img id=\'recaptcha_whatsthis\' width="25" height="16" /></a></td>\n</tr>\n<tr>\n<td class=\'recaptcha_r7_c1\'></td>\n<td class=\'recaptcha_r8_c1\'></td>\n</tr>\n</table>\n',VertCss:'.recaptchatable td img {\n/* see http://developer.mozilla.org/en/docs/Images%2C_Tables%2C_and_Mysterious_Gaps */\ndisplay: block;\n}\n.recaptchatable .recaptcha_r1_c1 { background: url(IMGROOT/sprite.png) -0px -63px no-repeat; width: 318px; height: 9px; }\n.recaptchatable .recaptcha_r2_c1 { background: url(IMGROOT/sprite.png) -18px -0px no-repeat; width: 9px; height: 57px; }\n.recaptchatable .recaptcha_r2_c2 { background: url(IMGROOT/sprite.png) -27px -0px no-repeat; width: 9px; height: 57px; }\n.recaptchatable .recaptcha_r3_c1 { background: url(IMGROOT/sprite.png) -0px -0px no-repeat; width: 9px; height: 63px; }\n.recaptchatable .recaptcha_r3_c2 { background: url(IMGROOT/sprite.png) -18px -57px no-repeat; width: 300px; height: 6px; }\n.recaptchatable .recaptcha_r3_c3 { background: url(IMGROOT/sprite.png) -9px -0px no-repeat; width: 9px; height: 63px; }\n.recaptchatable .recaptcha_r4_c1 { background: url(IMGROOT/sprite.png) -43px -0px no-repeat; width: 171px; height: 49px; }\n.recaptchatable .recaptcha_r4_c2 { background: url(IMGROOT/sprite.png) -36px -0px no-repeat; width: 7px; height: 57px; }\n.recaptchatable .recaptcha_r4_c4 { background: url(IMGROOT/sprite.png) -214px -0px no-repeat; width: 97px; height: 57px; }\n.recaptchatable .recaptcha_r7_c1 { background: url(IMGROOT/sprite.png) -43px -49px no-repeat; width: 171px; height: 8px; }\n.recaptchatable .recaptcha_r8_c1 { background: url(IMGROOT/sprite.png) -43px -49px no-repeat; width: 25px; height: 8px; }\n.recaptchatable .recaptcha_image_cell center img { height:57px;}\n.recaptchatable .recaptcha_image_cell center { height:57px;}\n.recaptchatable .recaptcha_image_cell {\nbackground-color:white; height:57px;\n}\n/* some people break their style sheet, we need to clean up after them */\n#recaptcha_area, #recaptcha_table {\nwidth: 318px !important;\n}\n.recaptchatable, #recaptcha_area tr, #recaptcha_area td, #recaptcha_area th {\nmargin:0px !important;\nborder:0px !important;\npadding:0px !important;\nborder-collapse: collapse !important;\nvertical-align: middle !important;\n}\n.recaptchatable * {\nmargin:0px;\npadding:0px;\nborder:0px;\nfont-family:helvetica,sans-serif;\nfont-size:8pt;\ncolor:black;\nposition:static;\ntop:auto;\nleft:auto;\nright:auto;\nbottom:auto;\ntext-align:left !important;\n}\n.recaptchatable #recaptcha_image {\nmargin:auto;\n}\n.recaptchatable img {\nborder:0px !important;\nmargin:0px !important;\npadding:0px !important;\n}\n.recaptchatable a, .recaptchatable a:hover {\n-moz-outline:none;\nborder:0px !important;\npadding:0px !important;\ntext-decoration:none;\ncolor:blue;\nbackground:none !important;\nfont-weight: normal;\n}\n.recaptcha_input_area {\nposition:relative !important;\nwidth:146px !important;\nheight:45px !important;\nmargin-left:20px !important;\nmargin-right:5px !important;\nmargin-top:4px !important;\nbackground:none !important;\n}\n.recaptchatable label.recaptcha_input_area_text {\nmargin:0px !important;  \npadding:0px !important;\nposition:static !important;\ntop:auto !important;\nleft:auto !important;\nright:auto !important;\nbottom:auto !important;\nbackground:none !important;\nheight:auto !important;\nwidth:auto !important;\n}\n.recaptcha_theme_red label.recaptcha_input_area_text,\n.recaptcha_theme_white label.recaptcha_input_area_text {\ncolor:black !important;\n}\n.recaptcha_theme_blackglass label.recaptcha_input_area_text {\ncolor:white !important;\n}\n.recaptchatable #captcha_response  {\nwidth:145px !important;\nposition:absolute !important;\nbottom:7px !important;\npadding:0px !important;\nmargin:0px !important;\nfont-size:10pt;\n}\n.recaptcha_theme_blackglass #captcha_response,\n.recaptcha_theme_white #captcha_response {\nborder: 1px solid gray;\n}\n.recaptcha_theme_red #captcha_response {\nborder:1px solid #cca940;\n}\n.recaptcha_audio_cant_hear_link {\nfont-size:7pt;\ncolor:black;\n}\n.recaptchatable {\nline-height:1em;\n}\n#recaptcha_instructions_error {\ncolor:red !important;\n}\n',CleanHtml:'<table id="recaptcha_table" class="recaptchatable">\n<tr height="73">\n<td class=\'recaptcha_image_cell\' width="302"><center><div id="recaptcha_image"></div></center></td>\n<td style="padding: 10px 7px 7px 7px;">\n<a id=\'recaptcha_reload_btn\' tabindex=\'-1\'><img id=\'recaptcha_reload\' width="25" height="18" alt="" /></a>\n<a id=\'recaptcha_switch_audio_btn\' tabindex=\'-1\' class="recaptcha_only_if_image"><img id=\'recaptcha_switch_audio\' width="25" height="15" alt="" /></a><a id=\'recaptcha_switch_img_btn\' tabindex=\'-1\' class="recaptcha_only_if_audio"><img id=\'recaptcha_switch_img\' width="25" height="15" alt=""/></a>\n<a id=\'recaptcha_whatsthis_btn\' tabindex=\'-1\'><img id=\'recaptcha_whatsthis\' width="25" height="16" /></a>\n</td>\n<td style="padding: 18px 7px 18px 7px;">\n<img id=\'recaptcha_logo\' alt="" width="71" height="36" />\n</td>\n</tr>\n<tr>\n<td style="padding-left: 7px;">\n<div class="recaptcha_input_area" style="padding-top: 2px; padding-bottom: 7px;">\n<input style="border: 1px solid #3c3c3c; width: 302px;" name="captcha_response" id="captcha_response" type="text" />\n</div>\n</td>\n<td></td>\n<td style="padding: 4px 7px 12px 7px;">\n<img id="recaptcha_tagline" width="71" height="17" />\n</td>\n</tr>\n</table>\n',CleanCss:'.recaptchatable td img {\ndisplay: block;\n}\n.recaptchatable .recaptcha_image_cell center img { height:57px;}\n.recaptchatable .recaptcha_image_cell center { height:57px;}\n.recaptchatable .recaptcha_image_cell {\nbackground-color:white; height:57px; \npadding: 7px !important;\n}\n.recaptchatable, #recaptcha_area tr, #recaptcha_area td, #recaptcha_area th {\nmargin:0px !important;\nborder:0px !important;\nborder-collapse: collapse !important;\nvertical-align: middle !important;\n}\n.recaptchatable * {\nmargin:0px;\npadding:0px;\nborder:0px;\ncolor:black;\nposition:static;\ntop:auto;\nleft:auto;\nright:auto;\nbottom:auto;\ntext-align:left !important;\n}\n.recaptchatable #recaptcha_image {\nmargin:auto;\nborder: 1px solid #dfdfdf !important;\n}\n.recaptchatable a img {\nborder:0px;\n}\n.recaptchatable a, .recaptchatable a:hover {\n-moz-outline:none;\nborder:0px !important;\npadding:0px !important;\ntext-decoration:none;\ncolor:blue;\nbackground:none !important;\nfont-weight: normal;\n}\n.recaptcha_input_area {\nposition:relative !important;\nbackground:none !important;\n}\n.recaptchatable label.recaptcha_input_area_text {\nborder:1px solid #dfdfdf !important;\nmargin:0px !important;  \npadding:0px !important;\nposition:static !important;\ntop:auto !important;\nleft:auto !important;\nright:auto !important;\nbottom:auto !important;\n}\n.recaptcha_theme_red label.recaptcha_input_area_text,\n.recaptcha_theme_white label.recaptcha_input_area_text {\ncolor:black !important;\n}\n.recaptcha_theme_blackglass label.recaptcha_input_area_text {\ncolor:white !important;\n}\n.recaptchatable #captcha_response  {\nfont-size:11pt;\n}\n.recaptcha_theme_blackglass #captcha_response,\n.recaptcha_theme_white #captcha_response {\nborder: 1px solid gray;\n}\n.recaptcha_theme_red #captcha_response {\nborder:1px solid #cca940;\n}\n.recaptcha_audio_cant_hear_link {\nfont-size:7pt;\ncolor:black;\n}\n.recaptchatable {\nline-height:1em;\nborder: 1px solid #dfdfdf !important;\n}\n.recaptcha_error_text {\ncolor:red;\n}\n'};var RecaptchaStr;function create_captcha(){setTimeout(function(){Recaptcha.create("6LezHAAAAAAAADqVjseQ3ctG3ocfQs2Elo1FTa_a","recaptchadiv_view",{theme:"custom",callback:Recaptcha.focus_response_field})},0);}
function recaptcha_init_str(){RecaptchaStr={visual_challenge:tx('rec07'),audio_challenge:tx('rec08'),refresh_btn:tx('rex09'),instructions_visual:tx('rec10'),instructions_audio:tx('rec11'),help_btn:tx('rec12'),cant_hear_this:tx('rec14'),incorrect_try_again:"Incorrect. Try again."};}
var RecaptchaOptions;var RecaptchaDefaultOptions={tabindex:0,theme:'red',callback:null,lang:'en',custom_theme_widget:null};var Recaptcha={widget:null,timer_id:-1,style_set:false,theme:null,type:'image',ajax_verify_cb:null,$:function(id){if(typeof(id)=="string"){return document.getElementById(id);}
else{return id;}},create:function(public_key,element,options){Recaptcha.destroy();if(element){Recaptcha.widget=Recaptcha.$(element);}
Recaptcha._init_options(options);Recaptcha._call_challenge(public_key);},destroy:function(){var challengefield=Recaptcha.$('recaptcha_challenge_field');if(challengefield){challengefield.parentNode.removeChild(challengefield);}
if(Recaptcha.timer_id!=-1){clearInterval(Recaptcha.timer_id);}
Recaptcha.timer_id=-1;var imagearea=Recaptcha.$('recaptcha_image');if(imagearea){imagearea.innerHTML="";}
if(Recaptcha.widget){if(Recaptcha.theme!="custom"){Recaptcha.widget.innerHTML="";}else{Recaptcha.widget.style.display="none";}
Recaptcha.widget=null;}},focus_response_field:function(){var $=Recaptcha.$;var field=$('captcha_response');try{field.focus();}catch(ignored){}},get_challenge:function(){if(typeof(RecaptchaState)=="undefined"){return null;}
return RecaptchaState.challenge;},get_response:function(){var $=Recaptcha.$;var field=$('captcha_response');if(!field){return null;}
return field.value;},ajax_verify:function(callback){Recaptcha.ajax_verify_cb=callback;var scriptURL=Recaptcha._get_api_server()+"/ajaxverify"+"?c="+encodeURIComponent(Recaptcha.get_challenge())+"&response="+encodeURIComponent(Recaptcha.get_response());Recaptcha._add_script(scriptURL);},_ajax_verify_callback:function(data){Recaptcha.ajax_verify_cb(data);},_get_api_server:function(){var protocol=window.location.protocol;var server;if(typeof(_RecaptchaOverrideApiServer)!="undefined"){server=_RecaptchaOverrideApiServer;}else if(protocol=='https:'){server="api-secure.recaptcha.net";}else{server="api.recaptcha.net";}
return protocol+"//"+server;},_call_challenge:function(public_key){var scriptURL=Recaptcha._get_api_server()+"/challenge?k="+public_key+"&ajax=1&cachestop="+Math.random();if(typeof(RecaptchaOptions.extra_challenge_params)!="undefined"){scriptURL+="&"+RecaptchaOptions.extra_challenge_params;}
Recaptcha._add_script(scriptURL);},_add_script:function(scriptURL){var scriptTag=document.createElement("script");scriptTag.type="text/javascript";scriptTag.src=scriptURL;Recaptcha._get_script_area().appendChild(scriptTag);},_get_script_area:function(){var parentElement=document.getElementsByTagName("head");if(!parentElement||parentElement.length<1){parentElement=document.body;}
else{parentElement=parentElement[0];}
return parentElement;},_init_options:function(opts){var comb_opt=RecaptchaDefaultOptions;var user_opts=opts||{};for(var p in user_opts){comb_opt[p]=user_opts[p];}
RecaptchaOptions=comb_opt;},challenge_callback:function(){var element=Recaptcha.widget;Recaptcha._reset_timer();if(window.addEventListener){window.addEventListener('unload',function(e){Recaptcha.destroy();},false);}
if(Recaptcha._is_ie()&&window.attachEvent){window.attachEvent('onbeforeunload',function(){});}
if(navigator.userAgent.indexOf("KHTML")>0){var iframe=document.createElement('iframe');iframe.src="about:blank";iframe.style.height="0px";iframe.style.width="0px";iframe.style.visibility="hidden";iframe.style.border="none";var textNode=document.createTextNode("This frame prevents back/forward cache problems in Safari.");iframe.appendChild(textNode);document.body.appendChild(iframe);}
Recaptcha._finish_widget();},_add_css:function(css){var styleTag=document.createElement("style");styleTag.type="text/css";if(styleTag.styleSheet){if(navigator.appVersion.indexOf("MSIE 5")!=-1){document.write("<style type='text/css'>"+css+"</style>");}
else{styleTag.styleSheet.cssText=css;}}else if(navigator.appVersion.indexOf("MSIE 5")!=-1){document.write("<style type='text/css'>"+css+"</style>");}
else{var textNode=document.createTextNode(css);styleTag.appendChild(textNode);}
Recaptcha._get_script_area().appendChild(styleTag);},_set_style:function(css){if(Recaptcha.style_set){return;}
Recaptcha.style_set=true;Recaptcha._add_css(css+"\n\n"+".recaptcha_is_showing_audio .recaptcha_only_if_image,"+".recaptcha_isnot_showing_audio .recaptcha_only_if_audio,"+".recaptcha_had_incorrect_sol .recaptcha_only_if_no_incorrect_sol,"+".recaptcha_nothad_incorrect_sol .recaptcha_only_if_incorrect_sol"+"{display:none !important}");},_init_builtin_theme:function(){var $=Recaptcha.$;var $_=RecaptchaStr;var $ST=RecaptchaState;var css,html,imgfmt;var server_no_slash=$ST.server;if(server_no_slash[server_no_slash.length-1]=="/")
server_no_slash=server_no_slash.substring(0,server_no_slash.length-1);var IMGROOT=server_no_slash+"/img/"+Recaptcha.theme;if(Recaptcha.theme=='clean'){css=RecaptchaTemplates.CleanCss;html=RecaptchaTemplates.CleanHtml;imgfmt='png';}
else{css=RecaptchaTemplates.VertCss;html=RecaptchaTemplates.VertHtml;imgfmt='gif';}
css=css.replace(/IMGROOT/g,IMGROOT);Recaptcha._set_style(css);Recaptcha.widget.innerHTML="<div id='recaptcha_area'>"+html+"</div>";$('recaptcha_reload').src=IMGROOT+"/refresh."+imgfmt;$('recaptcha_switch_audio').src=IMGROOT+"/audio."+imgfmt;$('recaptcha_switch_img').src=IMGROOT+"/text."+imgfmt;$('recaptcha_whatsthis').src=IMGROOT+"/help."+imgfmt;if(Recaptcha.theme=='clean'){$('recaptcha_logo').src=IMGROOT+"/logo."+imgfmt;$('recaptcha_tagline').src=IMGROOT+"/tagline."+imgfmt;}
$('recaptcha_reload').alt=$_.refresh_btn;$('recaptcha_switch_audio').alt=$_.audio_challenge;$('recaptcha_switch_img').alt=$_.visual_challenge;$('recaptcha_whatsthis').alt=$_.help_btn;$('recaptcha_reload_btn').href="javascript:Recaptcha.reload ();";$('recaptcha_reload_btn').title=$_.refresh_btn;$('recaptcha_switch_audio_btn').href="javascript:Recaptcha.switch_type('audio');";$('recaptcha_switch_audio_btn').title=$_.audio_challenge;$('recaptcha_switch_img_btn').href="javascript:Recaptcha.switch_type('image');";$('recaptcha_switch_img_btn').title=$_.visual_challenge;$('recaptcha_whatsthis_btn').href=Recaptcha._get_help_link();$('recaptcha_whatsthis_btn').target="_blank";$('recaptcha_whatsthis_btn').title=$_.help_btn;$('recaptcha_whatsthis_btn').onclick=function(){Recaptcha.showhelp();return false;};$('recaptcha_table').className="recaptchatable "+"recaptcha_theme_"+Recaptcha.theme;if($("recaptcha_instructions_image")){$("recaptcha_instructions_image").appendChild(document.createTextNode($_.instructions_visual));}
if($("recaptcha_instructions_audio")){$("recaptcha_instructions_audio").appendChild(document.createTextNode($_.instructions_audio));}
if($("recaptcha_instructions_error")){$("recaptcha_instructions_error").appendChild(document.createTextNode($_.incorrect_try_again));}},_finish_widget:function(){var $=Recaptcha.$;var $_=RecaptchaStr;var $ST=RecaptchaState;var $OPT=RecaptchaOptions;var theme=$OPT.theme;switch(theme){case'red':case'white':case'blackglass':case'clean':case'custom':break;default:theme='red';break;}
if(!Recaptcha.theme){Recaptcha.theme=theme;}
if(Recaptcha.theme!="custom"){Recaptcha._init_builtin_theme();}else{Recaptcha._set_style("");}
var challengeField=document.createElement("input");challengeField.type="password";challengeField.setAttribute("autocomplete","off");challengeField.style.display="none";challengeField.name="recaptcha_challenge_field";challengeField.id="recaptcha_challenge_field";$('captcha_response').parentNode.insertBefore(challengeField,$('captcha_response'));$('captcha_response').setAttribute("autocomplete","off");$('recaptcha_image').style.width='300px';$('recaptcha_image').style.height='57px';Recaptcha.should_focus=false;Recaptcha._set_challenge($ST.challenge,'image');if($OPT.tabindex){$('captcha_response').tabIndex=$OPT.tabindex;}
if(Recaptcha.widget){Recaptcha.widget.style.display='';}
if($OPT.callback){$OPT.callback();}},switch_type:function(new_type){var $C=Recaptcha;$C.type=new_type;$C.reload($C.type=='audio'?'a':'v');},reload:function(reason){var $C=Recaptcha;var $=$C.$;var $ST=RecaptchaState;if(typeof(reason)=="undefined")
reason='r';var scriptURL=$ST.server+"reload?c="+$ST.challenge+"&k="+$ST.site+"&reason="+reason+"&type="+$C.type;if(typeof(RecaptchaOptions.extra_challenge_params)!="undefined"){scriptURL+="&"+RecaptchaOptions.extra_challenge_params;}
$C.should_focus=reason!='t';$C._add_script(scriptURL);},finish_reload:function(new_challenge,type){RecaptchaState.is_incorrect=false;Recaptcha._set_challenge(new_challenge,type);},_set_challenge:function(new_challenge,type)
{var $C=Recaptcha;var $ST=RecaptchaState;var $=$C.$;$ST.challenge=new_challenge;$C.type=type;$('recaptcha_challenge_field').value=$ST.challenge;$('recaptcha_challenge_field').defaultValue=$ST.challenge;$('recaptcha_image').innerHtml="";if(type=='audio'){var wavurl=$ST.server+"image?c="+$ST.challenge;var httpwavurl=wavurl;if(httpwavurl.indexOf("https://")==0){httpwavurl="http://"+httpwavurl.substring(8);}
var embedCode;if($C._is_ie()){embedCode='<object height="40" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" src="'+httpwavurl+'" ><param name="URL" value="'+httpwavurl+'"><param name="autoStart" value="true"><param name="uimode" value="mini"></object>';}else{embedCode='<EMBED SRC="'+wavurl+'" height="40" bgcolor="white" AUTOSTART="true"/>';}
var cantHearCode='<br/><a class="recaptcha_audio_cant_hear_link" target="_blank" href="'+httpwavurl+'">'+RecaptchaStr.cant_hear_this+'</a>';$("recaptcha_image").innerHTML=embedCode+cantHearCode;}else if(type=='image'){var imageurl=$ST.server+'image?c='+$ST.challenge;$('recaptcha_image').innerHTML="<img style='display:block;' height='57' width='300' src='"+imageurl+"'/>";}
Recaptcha._css_toggle("recaptcha_had_incorrect_sol","recaptcha_nothad_incorrect_sol",$ST.is_incorrect);Recaptcha._css_toggle("recaptcha_is_showing_audio","recaptcha_isnot_showing_audio",type=='audio');$C._clear_input();if($C.should_focus){$C.focus_response_field();}
$C._reset_timer();},_reset_timer:function(){var $ST=RecaptchaState;clearInterval(Recaptcha.timer_id);Recaptcha.timer_id=setInterval("Recaptcha.reload('t');",($ST.timeout-60*5)*1000);},showhelp:function(){window.open(Recaptcha._get_help_link(),"recaptcha_popup","width=460,height=570,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes");},_clear_input:function(){var resp=Recaptcha.$('captcha_response');resp.value="";},_displayerror:function(msg){var $=Recaptcha.$;$('recaptcha_image').innerHTML='';$('recaptcha_image').appendChild(document.createTextNode(msg));},reloaderror:function(msg){Recaptcha._displayerror(msg);},_is_ie:function(){return(navigator.userAgent.indexOf("MSIE")>0)&&!window.opera;},_css_toggle:function(classT,classF,isset){var element=Recaptcha.widget;if(!element)
element=document.body;var classname=element.className;classname=classname.replace(new RegExp("(^|\\s+)"+classT+"(\\s+|$)"),' ');classname=classname.replace(new RegExp("(^|\\s+)"+classF+"(\\s+|$)"),' ');classname+=" "+(isset?classT:classF);element.className=classname;},_get_help_link:function(){var lang=RecaptchaOptions.lang;return'http://recaptcha.net/popuphelp/'+(lang=='en'?"":(lang+".html"));}};function captcha_whatsthis(obj){var dialog=new contextual_dialog();dialog.set_context(obj);var provider_link='<a onclick="window.open(\'http://recaptcha.net/popuphelp/\',\'recaptcha_popup\',\'width=460,height=570,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes\')">'+'ReCaptcha</a>';var content='<div class="captcha_popup" style="padding: 5px;">'+
tx('rec16')+'<br/><br/>'+
tx('rec17',{'provider_link':provider_link})+'</div>';dialog.show_message(tx('rec18'),content);dialog.reset_iframe();}




/*  ------------------------------------------------------------------------
                                TongXue | toolbar.js
    ------------------------------------------------------------------------  */



function select_sub_menu(obj){
	var MAX_WIDTH=415;
	if(typeof(window.PRE_SUB)!='undefined'){ pre_obj=window.PRE_SUB;remove_css_class_name(pre_obj,'view');}
	window.PRE_SUB=obj;
	add_css_class_name(obj,'view');
	var l=elementX(obj)-elementX(ge('navigation'));
	var w1=(obj.offsetWidth-20)/2;
    ge('sub_nav_content').innerHTML=ge(obj.id.replace('nav_','sub_')).innerHTML;
	//ge('nav_sub_notice').style.left=l+w1+'px';
	var w2=ge('sub_nav_content').offsetWidth;
	ge('sub_nav_content').style.left=(MAX_WIDTH-w2)*(l+w1)/MAX_WIDTH+'px';
}




/*  ------------------------------------------------------------------------
                                TongXue | apps_menu.js
    ------------------------------------------------------------------------  */




var MAX_APP_LIST_END=275;var MAX_SIDENAV_LINKS=7;var MOVING_THRESHOLD=10;var saved_message=null;function track_moveable(container_obj,link_obj){link_obj.ondrag=function(e){event.cancelBubble=true;return false;}.bind(this);;this.listContainer=container_obj;this.link=link_obj;this.listContainer.onmousedown=function(e){return this._onclick(e?e:window.event);}.bind(this);}
track_moveable.prototype._onclick=function(e){this.clickMouseY=mouseY(e);document.onselectstart=function(e){return false;};document.onmousemove=function(e){return this._track_move(e?e:window.event)}.bind(this);document.onmouseup=function(e){this._track_drop(e?e:window.event)}.bind(this);return false;}
track_moveable.prototype._track_move=function(e){if(Math.abs(mouseY(e)-this.clickMouseY)>MOVING_THRESHOLD){var moveable=new moveable_app(this.listContainer,this.link);moveable._onclick(null,this.clickMouseY);}}
track_moveable.prototype._track_drop=function(e){document.onmouseout=document.onmouseup=document.onmousemove=document.onclick=null;this.link.onclick=function(e){return true;};}
function moveable_app(container_obj,link_obj){this.listContainer=container_obj;this.link=link_obj;this.listContainer.onmousedown=function(e){return this._onclick(e?e:window.event);}.bind(this);}
moveable_app.prototype._onclick=function(e,mouseYCoord){add_css_class_name(this.listContainer,'floating_container');var app_list_node=ge('app_list');this.listContainer.lowerBoundY=elementY(app_list_node.firstChild?app_list_node.firstChild:app_list_node);this.oldListID=this.listContainer.parentNode.parentNode.id;this.justOpened=false;var app_non_nav_list_node=ge('app_non_nav_list');this.listContainer.upperBoundY=elementY(app_non_nav_list_node.lastChild?app_non_nav_list_node.lastChild:app_non_nav_list_node);var listContainerHeight=(ua.ie()||ua.safari())?this.listContainer.offsetHeight:this.listContainer.offsetHeight-1;this.listContainer.parentNode.style.height=(listContainerHeight)+'px';this.listContainer.top=elementY(this.listContainer);mouseYCoord=mouseYCoord?mouseYCoord:mouseY(e);this.mouseOffset=mouseYCoord-this.listContainer.top;this.listContainer.style.top=this.listContainer.top+'px';document.onmousemove=function(e){return this._move(e?e:window.event)}.bind(this);document.onmouseup=function(e){this._drop(e?e:window.event)}.bind(this);this._calculateBoundaries();return false;}
moveable_app.prototype._calculateBoundaries=function(){var list=this.listContainer.parentNode.parentNode;var previousListItem=this.listContainer.parentNode.previousSibling;this.listContainer.prevList=null;this.listContainer.previousNodeY=null;if(previousListItem){this.listContainer.previousNodeY=elementY(previousListItem)+7;this.newList=false;}else if(list.id=='app_non_nav_list'){this.listContainer.prevList=ge('app_list');var elementPos=null;if(this.listContainer.prevList.lastChild){elementPos=this.listContainer.prevList.lastChild;}else{elementPos=this.listContainer.prevList;}
this.newList=true;this.listContainer.previousNodeY=elementY(elementPos)+20;}
var nextListItem=this.listContainer.parentNode.nextSibling;this.listContainer.nextList=null;this.listContainer.nextNodeY=null;if(nextListItem){this.listContainer.nextNodeY=elementY(nextListItem)-7;this.newList=false;}else if(list.id=='app_list'){this.listContainer.nextList=ge('app_non_nav_list');var elementPos=null;this.newList=true;if(this.listContainer.nextList.parentNode.style.display=='none'){this.justOpened=true;this.listContainer.nextNodeY=elementY(ge('more_link'))-18;}else{if(this.listContainer.nextList.firstChild){elementPos=this.listContainer.nextList.firstChild;}else{elementPos=this.listContainer.nextList;}
this.listContainer.nextNodeY=elementY(elementPos)-20;}}}
moveable_app.prototype._move=function(e){this.listContainer.top=mouseY(e)-this.mouseOffset;var oldParent=this.listContainer.parentNode;if(this.listContainer.nextNodeY&&this.listContainer.top>this.listContainer.nextNodeY){if(this.listContainer.nextList==null){var newParent=oldParent.nextSibling;newParent.appendChild(this.listContainer);oldParent.style.height=null;oldParent.appendChild(newParent.firstChild);}else{if(this.newList){expand_more_list();var newParent=document.createElement('div');newParent.className='list_item';this.listContainer.nextList.insertBefore(newParent,this.listContainer.nextList.firstChild);newParent.appendChild(this.listContainer);oldParent.parentNode.removeChild(oldParent);}}}
else if(this.listContainer.previousNodeY&&this.listContainer.top<this.listContainer.previousNodeY){if(this.listContainer.prevList==null){var newParent=oldParent.previousSibling;newParent.appendChild(this.listContainer);oldParent.style.height=null;oldParent.appendChild(newParent.firstChild);}else{var newParent=document.createElement('div');newParent.className='list_item';this.listContainer.prevList.appendChild(newParent);newParent.appendChild(this.listContainer);oldParent.parentNode.removeChild(oldParent);}}
if(this.listContainer.parentNode!=oldParent){oldParent.style.height=null;this.listContainer.parentNode.style.height=(this.listContainer.offsetHeight-1)+'px';this._calculateBoundaries();}
if((is_first_child(this.listContainer.parentNode,'app_list')&&this.listContainer.top<elementY(this.listContainer.parentNode))||(is_last_child(this.listContainer.parentNode,'app_non_nav_list')&&this.listContainer.top>elementY(this.listContainer.parentNode))){this.listContainer.style.top=(elementY(this.listContainer.parentNode)+1)+'px';}else{this.listContainer.style.top=this.listContainer.top+'px';}
return false;}
function is_first_child(elem,parent){return(elem.parentNode.id==parent)&&(elem.parentNode.firstChild==elem);}
function is_last_child(elem,parent){return(elem.parentNode.id==parent)&&(elem.parentNode.lastChild==elem);}
function onload_side_nav_check(){enforce_app_list_limits_and_save(false,'onload_side_nav');}
function enforce_app_list_limits_and_save(force_save,context){var display_list='';var app_list_node=ge('app_list');var more_apps_node=ge('app_non_nav_list');var more_list='';var max_reached=false;var extra_pixel_amount=0;var rearrange_message=ge('rearrange_message');if(rearrange_message){extra_pixel_amount=rearrange_message.offsetHeight+6;}
var threshold=MAX_APP_LIST_END+elementY(ge('sidebar'))+extra_pixel_amount;while(elementY(app_list_node)+app_list_node.offsetHeight>threshold||app_list_node.childNodes.length>MAX_SIDENAV_LINKS){if(more_apps_node.firstChild){more_apps_node.insertBefore(app_list_node.lastChild,more_apps_node.firstChild);}else{more_apps_node.appendChild(app_list_node.lastChild);}
max_reached=true;}
if(max_reached||force_save){for(var i=0;i<app_list_node.childNodes.length;i++){if(i!=0){display_list+=':';}
display_list+=app_list_node.childNodes[i].firstChild.id;}
for(var i=0;i<more_apps_node.childNodes.length;i++){if(i!=0){more_list+=':';}
more_list+=more_apps_node.childNodes[i].firstChild.id;}
var ajax=new Ajax(function(obj,text){eval(text);});var post_vars={'display_list':display_list,'more_list':more_list,'context':context};ajax.post('/ajax/apps_menu.php',post_vars);}}
moveable_app.prototype._drop=function(e){remove_css_class_name(this.listContainer,'floating_container');this.listContainer.style.top=null;this.listContainer.parentNode.style.height=null;enforce_app_list_limits_and_save(true,'rearrange_order');if(this.listContainer.parentNode.parentNode.id!='app_non_nav_list'&&this.justOpened){window.setTimeout('close_more_list()',500);}
document.onmouseout=document.onmouseup=document.onmousemove=document.onclick=null;if(this.link){this.link.onclick=function(e){return false;};}
return false;}
function change_status_message(className,messageContent){var message=ge('rearrange_message');message.className=className;message.innerHTML=messageContent;}
function move_lists(obj,to_list_id,changeFunction,front_of_list){to_list_obj=ge(to_list_id);if(changeFunction){changeFunction(obj);}
if(front_of_list){to_list_obj.insertBefore(obj,to_list_obj.firstChild);}else{to_list_obj.appendChild(obj);}}
var apps_menu_timout_id;function try_expand(obj){if(has_css_class_name(obj,'more_apps')){apps_menu_timout_id=window.setTimeout('expand_more_list()',500);}else{}}
function untry_expand(){window.clearTimeout(apps_menu_timout_id);}




/*  ------------------------------------------------------------------------
                                TongXue | typeaheadpro.js
    ------------------------------------------------------------------------  */




function typeaheadpro(obj,source,properties){if(!typeaheadpro.hacks){typeaheadpro.should_check_missing_events=ua.safari()<500;typeaheadpro.should_use_iframe=typeaheadpro.should_simulate_keypress=ua.ie()||(ua.safari()>500&&ua.safari()<523);typeaheadpro.should_use_overflow=ua.opera()<9.5||ua.safari()<500;typeaheadpro.hacks=true;}
typeaheadpro.instances=(typeaheadpro.instances||[]);typeaheadpro.instances.push(this);this.instance=typeaheadpro.instances.length-1;copy_properties(this,properties||{});this.obj=obj;this.obj.typeahead=this;this.obj.onfocus=this._onfocus.bind(this);this.obj.onblur=chain(this.obj.onblur,this._onblur.bind(this));this.obj.onchange=this._onchange.bind(this);this.obj.onkeyup=function(event){return this._onkeyup(event||window.event);}.bind(this);this.obj.onkeydown=function(event){return this._onkeydown(event||window.event);}.bind(this);this.obj.onkeypress=function(event){return this._onkeypress(event||window.event);}.bind(this);this.focused=this.obj.offsetWidth?true:false;this.anchor=this.setup_anchor();this.dropdown=document.createElement('div');this.dropdown.className='typeahead_list';if(!this.focused){this.dropdown.style.display='none';}
this.anchor_block=this.anchor_block||this.anchor.tagName.toLowerCase()=='div';if(this.should_use_absolute){document.body.appendChild(this.dropdown);this.dropdown.className+=' typeahead_list_absolute';}else{if(this.anchor.nextSibling){this.anchor.parentNode.insertBefore(this.dropdown,this.anchor.nextSibling);}else{this.anchor.parentNode.appendChild(this.dropdown);}
if(!this.anchor_block){this.anchor.parentNode.insertBefore(document.createElement('br'),this.dropdown);}}
this.dropdown.appendChild(this.list=document.createElement('div'));this.dropdown.onmousedown=function(event){return this.dropdown_onmousedown(event||window.event);}.bind(this);if(typeaheadpro.should_use_iframe&&!typeaheadpro.iframe){typeaheadpro.iframe=document.createElement('iframe');typeaheadpro.iframe.src="/common/blank.html";typeaheadpro.iframe.className='typeahead_iframe';typeaheadpro.iframe.style.display='none';typeaheadpro.iframe.frameBorder=0;document.body.appendChild(typeaheadpro.iframe);}
this.results_text='';this.last_key_suggestion=0;this.status=typeaheadpro.STATUS_BLOCK_ON_SOURCE_BOOTSTRAP;this.clear_placeholder();if(source){this.set_source(source);}
if(this.source){this.selectedindex=-1;if(this.focused){this.show();this._onkeyup();this.set_class('');this.capture_submit();}}else{this.hide();}}
typeaheadpro.prototype.enumerate=false;typeaheadpro.prototype.interactive=false;typeaheadpro.prototype.changed=false;typeaheadpro.prototype.render_block_size=50;typeaheadpro.STATUS_IDLE=0;typeaheadpro.STATUS_WAITING_ON_SOURCE=1;typeaheadpro.STATUS_BLOCK_ON_SOURCE_BOOTSTRAP=2;typeaheadpro.prototype.should_use_absolute=false;typeaheadpro.prototype.max_results=0;typeaheadpro.prototype.max_display=10;typeaheadpro.prototype.allow_placeholders=true;typeaheadpro.prototype.auto_select=true;typeaheadpro.prototype.set_source=function(source){this.source=source;this.source.set_owner(this);this.status=typeaheadpro.STATUS_IDLE;this.cache={};this.last_search=0;this.suggestions=[];}
typeaheadpro.prototype.setup_anchor=function(){return this.obj;}
typeaheadpro.prototype.destroy=function(){this.clear_render_timeouts();if(!this.anchor_block&&this.anchor.nextSibling.tagName.toLowerCase()=='br'){this.anchor.parentNode.removeChild(this.anchor.nextSibling);}
if(this.dropdown){this.dropdown.parentNode.removeChild(this.dropdown);}
this.obj.onfocus=this.obj.onblur=this.obj.onkeyup=this.obj.onkeydown=this.obj.onkeypress=null;this.obj.parentNode.removeChild(this.obj);this.anchor=this.obj=this.obj.typeahead=this.dropdown=null;delete typeaheadpro.instances[this.instance];}
typeaheadpro.prototype._onkeyup=function(e){this.last_key=e?e.keyCode:-1;if(this.key_down==this.last_key){this.key_down=0;}
switch(this.last_key){case 27:this.selectedindex=-1;this._onselect(false);this.hide();break;case undefined:case 0:case 13:case 37:case 38:case 39:case 40:break;default:this.dirty_results();if(typeaheadpro.should_check_missing_events){setTimeout(function(){this.dirty_results()}.bind(this),50);}
break;}}
typeaheadpro.prototype._onkeydown=function(e){this.key_down=this.last_key=e?e.keyCode:-1;this.interactive=true;switch(this.last_key){case 33:case 34:case 38:case 40:if(typeaheadpro.should_simulate_keypress){this._onkeypress({keyCode:this.last_key});}
return false;case 9:this.select_suggestion(this.selectedindex);this.advance_focus();break;case 13:if(this.select_suggestion(this.selectedindex)){this.hide();}
if(typeof(this.submit_keydown_return)!='undefined'){this.submit_keydown_return=this._onsubmit(this.get_current_selection());}
return this.submit_keydown_return;}}
typeaheadpro.prototype._onkeypress=function(e){var multiplier=1;this.last_key=e?event_get_keypress_keycode(e):-1;this.interactive=true;switch(this.last_key){case 33:multiplier=this.max_display;case 38:this.set_suggestion(multiplier>1&&this.selectedindex>0&&this.selectedindex<multiplier?0:this.selectedindex-multiplier);this.last_key_suggestion=(new Date()).getTime();return false;case 34:multiplier=this.max_display;case 40:if(trim(this.get_value())==''&&!this.enumerate){this.enumerate=true;this.results_text=null;this.dirty_results();}else{this.set_suggestion(this.suggestions.length<=this.selectedindex+multiplier?this.suggestions.length-1:this.selectedindex+multiplier);this.last_key_suggestion=(new Date()).getTime();}
return false;case 13:var ret=null;if(typeof(this.submit_keydown_return)=='undefined'){ret=this.submit_keydown_return=this._onsubmit(this.get_current_selection());}else{ret=this.submit_keydown_return;delete this.submit_keydown_return;}
return ret;}
return true;}
typeaheadpro.prototype._onchange=function(){this.changed=true;}
typeaheadpro.prototype._onfound=function(obj){return this.onfound?this.onfound.call(this,obj):true;}
typeaheadpro.prototype._onsubmit=function(obj){if(this.onsubmit){var ret=this.onsubmit.call(this,obj);if(ret&&this.obj.form){if(!this.obj.form.onsubmit||this.obj.form.onsubmit()){this.obj.form.submit();}
return false;}
return ret;}else{this.advance_focus();return false;}}
typeaheadpro.prototype._onselect=function(obj){if(this.onselect){this.onselect.call(this,obj);}}
typeaheadpro.prototype._onfocus=function(){if(this.last_dropdown_mouse>(new Date()).getTime()-10||this.focused){return;}
this.focused=true;this.changed=false;this.clear_placeholder();this.results_text='';this.set_class('');this.dirty_results();this.show();this.capture_submit();}
typeaheadpro.prototype._onblur=function(event){if(this.last_dropdown_mouse&&this.last_dropdown_mouse>(new Date()).getTime()-10){event_prevent(event);setTimeout(function(){this.focus()}.bind(this.obj),0);return false;}
this.focused=false;if(this.changed&&!this.interactive){this.dirty_results();this.changed=false;return;}
if(!this.suggestions){this._onselect(false);}else if(this.selectedindex>=0){this.select_suggestion(this.selectedindex);}
this.hide();this.update_class();if(!this.get_value()){var noinput=this.allow_placeholders?'':this.source.gen_noinput();this.set_value(noinput?noinput:'');this.set_class('typeahead_placeholder')}}
typeaheadpro.prototype.dropdown_onmousedown=function(event){this.last_dropdown_mouse=(new Date()).getTime();}
typeaheadpro.prototype.mouse_set_suggestion=function(index){if(!this.visible){return;}
if((new Date()).getTime()-this.last_key_suggestion>50){this.set_suggestion(index);}}
typeaheadpro.prototype.capture_submit=function(){if(!typeaheadpro.should_check_missing_events)return;if((!this.captured_form||this.captured_substitute!=this.captured_form.onsubmit)&&this.obj.form){this.captured_form=this.obj.form;this.captured_event=this.obj.form.onsubmit;this.captured_substitute=this.obj.form.onsubmit=function(){return((this.key_down&&this.key_down!=13&&this.key_down!=9)?this.submit_keydown_return:(this.captured_event?this.captured_event.apply(arguments,this.captured_form):true))?true:false;}.bind(this);}}
typeaheadpro.prototype.set_suggestion=function(index){if(!this.suggestions||this.suggestions.length<=index){return}
var old_node=this.get_suggestion_node(this.selectedindex);this.selectedindex=(index<=-1)?-1:index;var cur_node=this.get_suggestion_node(this.selectedindex);if(old_node){old_node.className=old_node.className.replace(/\btypeahead_selected\b/,'typeahead_not_selected');}
if(cur_node){cur_node.className=cur_node.className.replace(/\btypeahead_not_selected\b/,'typeahead_selected');}
this.recalc_scroll();this._onfound(this.get_current_selection());}
typeaheadpro.prototype.get_suggestion_node=function(index){var nodes=this.list.childNodes;return index==-1?null:nodes[Math.floor(index/this.render_block_size)].childNodes[index%this.render_block_size];}
typeaheadpro.prototype.get_current_selection=function(){return this.selectedindex==-1?false:this.suggestions[this.selectedindex];}
typeaheadpro.prototype.update_class=function(){if(this.suggestions&&this.selectedindex!=-1&&typeahead_source.flatten_string(this.get_current_selection().t)==typeahead_source.flatten_string(this.get_value())){this.set_class('typeahead_found');}else{this.set_class('');}}
typeaheadpro.prototype.select_suggestion=function(index){if(!this.suggestions||index==undefined||index===false||this.suggestions.length<=index||index<0){this._onfound(false);this._onselect(false);this.selectedindex=-1;this.set_class('');}else{this.selectedindex=index;this.set_value(this.suggestions[index].t);this.set_class('typeahead_found');this._onfound(this.suggestions[this.selectedindex]);this._onselect(this.suggestions[this.selectedindex]);}
if(!this.interactive){this.hide();this.obj.blur();}
return true;}
typeaheadpro.prototype.set_value=function(value){this.obj.value=value;}
typeaheadpro.prototype.get_value=function(){return this.obj.value;}
typeaheadpro.prototype.found_suggestions=function(suggestions,text,fake_data){if(!fake_data){this.status=typeaheadpro.STATUS_IDLE;this.add_cache(text,suggestions);}
this.clear_render_timeouts();if(this.get_value()==this.results_text){return;}else if(!fake_data){this.results_text=typeahead_source.flatten_string(text);if(this.enumerate&&trim(this.results_text)!=''){this.enumerate=false;}}
var current_selection=-1;if(this.selectedindex!=-1){var selected_id=this.suggestions[this.selectedindex].i;for(var i=0,l=suggestions.length;i<l;i++){if(suggestions[i].i==selected_id){current_selection=i;break;}}}
if(current_selection==-1&&this.auto_select&&suggestions.length){current_selection=0;this._onfound(suggestions[0]);}
this.selectedindex=current_selection;this.suggestions=suggestions;if(!fake_data){this.real_suggestions=suggestions;}
if(suggestions.length){var html=[],blocks=Math.ceil(suggestions.length/this.render_block_size),must_render={},firstblock,samplenode=null;this.list.innerHTML='';for(var i=0;i<blocks;i++){this.list.appendChild(document.createElement('div'));}
if(current_selection>-1){firstblock=Math.floor(current_selection/this.render_block_size);must_render[firstblock]=true;if(current_selection%this.render_block_size>this.render_block_size/2){must_render[firstblock+1]=true;}else if(firstblock!=0){must_render[firstblock-1]=true;}}else{must_render[0]=true;}
for(var node in must_render){this.render_block(node);sample=this.list.childNodes[node].firstChild;}
this.show();if(blocks){var suggestion_height=sample.offsetHeight;this.render_timeouts=[];for(var i=1;i<blocks;i++){if(!must_render[i]){this.list.childNodes[i].style.height=suggestion_height*Math.min(this.render_block_size,suggestions.length-i*this.render_block_size)+'px';this.list.childNodes[i].style.width='1px';this.render_timeouts.push(setTimeout(this.render_block.bind(this,i),700+i*50));}}}}else{this.selectedindex=-1;this.set_message(this.status==typeaheadpro.STATUS_IDLE?this.source.gen_nomatch():this.source.gen_loading());this._onfound(false);}
this.recalc_scroll();if(!fake_data&&this.results_text!=typeahead_source.flatten_string(this.get_value())){this.dirty_results();}}
typeaheadpro.prototype.render_block=function(block,stack){var suggestions=this.suggestions,selectedindex=this.selectedindex,text=this.get_value(),instance=this.instance,html=[],node=this.list.childNodes[block];for(var i=block*this.render_block_size,l=Math.min(suggestions.length,(block+1)*this.render_block_size);i<l;i++){html.push('<div class="');if(selectedindex==i){html.push('typeahead_suggestion typeahead_selected');}else{html.push('typeahead_suggestion typeahead_not_selected');}
html.push('" onmouseout="typeaheadpro.instances[',instance,'].mouse_set_suggestion(-1)" ','onmouseover="typeaheadpro.instances[',instance,'].mouse_set_suggestion(',i,')" ','onmousedown="typeaheadpro.instances[',instance,'].select_suggestion(',i,'); event_abort(event);">',this.source.gen_html(suggestions[i],text),'</div>');}
node.innerHTML=html.join('');node.style.height='auto';node.style.width='auto';}
typeaheadpro.prototype.clear_render_timeouts=function(){if(this.render_timeouts){for(var i=0;i<this.render_timeouts.length;i++){clearTimeout(this.render_timeouts[i]);}
this.render_timeouts=null;}}
typeaheadpro.prototype.recalc_scroll=function(){var cn=this.list.firstChild;if(!cn){return;}
if(cn.childNodes.length>this.max_display){var last_child=cn.childNodes[this.max_display-1];var height=last_child.offsetTop+last_child.offsetHeight;this.dropdown.style.height=height+'px';var selected=this.get_suggestion_node(this.selectedindex);if(selected){var scrollTop=this.dropdown.scrollTop;if(selected.offsetTop<scrollTop){this.dropdown.scrollTop=selected.offsetTop;}else if(selected.offsetTop+selected.offsetHeight>height+scrollTop){this.dropdown.scrollTop=selected.offsetTop+selected.offsetHeight-height;}}
if(!typeaheadpro.should_use_overflow){this.dropdown.style.overflowY='scroll';this.dropdown.style.overflowX='hidden';}}else{this.dropdown.style.height='auto';if(!typeaheadpro.should_use_overflow){this.dropdown.style.overflowY='hidden';}}}
typeaheadpro.prototype.search_cache=function(text){return this.cache[typeahead_source.flatten_string(text)];}
typeaheadpro.prototype.add_cache=function(text,results){if(this.source.cache_results){this.cache[typeahead_source.flatten_string(text)]=results;}}
typeaheadpro.prototype.update_status=function(status){this.status=status;this.dirty_results();}
typeaheadpro.prototype.set_class=function(name){this.obj.className=(this.obj.className.replace(/typeahead_[^\s]+/g,'')+' '+name).replace(/ {2,}/g,' ');}
typeaheadpro.prototype.dirty_results=function(){if(!this.enumerate&&trim(this.get_value())==''){this.results_text='';this.set_message(this.source.gen_placeholder());this.suggestions=[];this.selectedindex=-1;return;}else if(this.results_text==typeahead_source.flatten_string(this.get_value())){return;}else if(this.status==typeaheadpro.STATUS_BLOCK_ON_SOURCE_BOOTSTRAP){this.set_message(this.source.gen_loading());return;}
var time=(new Date).getTime();var updated=false;if(this.last_search<=(time-this.source.search_limit)&&this.status==typeaheadpro.STATUS_IDLE){updated=this.perform_search();}else{if(this.status==typeaheadpro.STATUS_IDLE){if(!this.search_timeout){this.search_timeout=setTimeout(function(){this.search_timeout=false;if(this.status==typeaheadpro.STATUS_IDLE){this.dirty_results();}}.bind(this),this.source.search_limit-(time-this.last_search));}}}
if(this.source.allow_fake_results&&this.real_suggestions&&!updated){var ttext=typeahead_source.tokenize(this.get_value()).sort(typeahead_source._sort);var fake_results=[];for(var i=0;i<this.real_suggestions.length;i++){if(typeahead_source.check_match(ttext,this.real_suggestions[i].t+' '+this.real_suggestions[i].n)){fake_results.push(this.real_suggestions[i]);}}
if(fake_results.length){this.found_suggestions(fake_results,this.get_value(),true);}else{this.selectedindex=-1;this.set_message(this.source.gen_loading());}}}
typeaheadpro.prototype.perform_search=function(){if(this.get_value()==this.results_text){return true;}
var results;if((results=this.search_cache(this.get_value()))===undefined&&!(results=this.source.search_value(this.get_value()))){this.status=typeaheadpro.STATUS_WAITING_ON_SOURCE;this.last_search=(new Date).getTime();return false;}
this.found_suggestions(results,this.get_value(),false);return true;}
typeaheadpro.prototype.set_message=function(text){this.clear_render_timeouts();if(text){this.list.innerHTML='<div class="typeahead_message">'+text+'</div>';this.reset_iframe();}else{this.hide();}
this.recalc_scroll();}
typeaheadpro.prototype.reset_iframe=function(){if(!typeaheadpro.should_use_iframe){return}
if(this.should_use_absolute){typeaheadpro.iframe.style.top=this.dropdown.style.top;typeaheadpro.iframe.style.left=this.dropdown.style.left;}else{typeaheadpro.iframe.style.top=elementY(this.dropdown)+'px';typeaheadpro.iframe.style.left=elementX(this.dropdown)+'px';}
typeaheadpro.iframe.style.width=this.dropdown.offsetWidth+'px';typeaheadpro.iframe.style.height=this.dropdown.offsetHeight+'px';typeaheadpro.iframe.style.display='';}
typeaheadpro.prototype.advance_focus=function(){var inputs=this.obj.form?get_all_form_inputs(this.obj.form):get_all_form_inputs();var next_inputs=false;for(var i=0;i<inputs.length;i++){if(next_inputs){if(inputs[i].type!='hidden'&&inputs[i].tabIndex!=-1&&inputs[i].offsetParent){next_inputs.push(inputs[i]);}}else if(inputs[i]==this.obj){next_inputs=[];}}
setTimeout(function(){for(var i=0;i<this.length;i++){try{if(this[i].offsetParent){this[i].focus();setTimeout(function(){try{this.focus();}catch(e){}}.bind(this[i]),0);return;}}catch(e){}}}.bind(next_inputs?next_inputs:[]),0);}
typeaheadpro.prototype.clear_placeholder=function(){if(this.obj.className.indexOf('typeahead_placeholder')!=-1){this.set_value('');this.set_class('');}}
typeaheadpro.prototype.clear=function(){this.set_value('');this.set_class('');this.selectedindex=-1;this.enumerate=false;this.dirty_results();}
typeaheadpro.prototype.hide=function(){this.visible=false;if(this.should_use_absolute){this.dropdown.style.display='none';}else{this.dropdown.style.visibility='hidden';}
this.clear_render_timeouts();if(typeaheadpro.should_use_iframe){typeaheadpro.iframe.style.display='none';}}
typeaheadpro.prototype.show=function(){this.visible=true;if(this.focused){if(this.should_use_absolute){this.dropdown.style.top=elementY(this.anchor)+this.anchor.offsetHeight+'px';this.dropdown.style.left=elementX(this.anchor)+'px';}
this.dropdown.style.width=(this.anchor.offsetWidth-2)+'px';this.dropdown.style[this.should_use_absolute?'display':'visibility']='';if(typeaheadpro.should_use_iframe){typeaheadpro.iframe.style.display='';this.reset_iframe();}}}
typeaheadpro.prototype.focus=function(){this.obj.focus();}
typeaheadpro.kill_typeahead=function(obj){if(obj.typeahead){if(!this.should_use_absolute&&!this.anchor_block){obj.parentNode.removeChild(obj.nextSibling);}
obj.parentNode.removeChild(obj.nextSibling);if(obj.typeahead.source){obj.typeahead.source=obj.typeahead.source.owner=null;}
obj.onfocus=obj.onblur=obj.onkeypress=obj.onkeyup=obj.onkeydown=obj.typeahead=null;}}
function tokenizer(obj,typeahead_source,nofocus,max_selections,properties){if(ua.safari()<500){tokenizer.valid_arrow_count=0;tokenizer.valid_arrow_event=function(){return tokenizer.valid_arrow_count++%2==0};}else{tokenizer.valid_arrow_event=function(){return true};}
this.obj=obj;this.obj.tokenizer=this;this.typeahead_source=typeahead_source;while(!/\btokenizer\b/.test(this.obj.className)){this.obj=this.obj.parentNode;}
this.tab_stop=this.obj.getElementsByTagName('input')[0];this.inputs=[];this.obj.onmousedown=function(event){return this._onmousedown(event?event:window.event)}.bind(this);this.tab_stop.onfocus=function(event){return this._onfocus(event?event:window.event)}.bind(this);this.tab_stop.onblur=function(event){return this.tab_stop_onblur(event?event:window.event)}.bind(this);this.tab_stop.onkeydown=function(event){return this.tab_stop_onkeydown(event?event:window.event)}.bind(this);if(!nofocus&&elementY(this.obj)>0){this._onfocus();}
this.max_selections=max_selections;copy_properties(this,properties||{});}
tokenizer.is_empty=function(obj){if(has_css_class_name(obj,'tokenizer_locked')){return obj.getElementsByTagName('input').length==0;}else{return(!obj.tokenizer||obj.tokenizer.count_names()==0);}}
tokenizer.prototype.get_token_values=function(){var r=[];var inputs=this.obj.getElementsByTagName('input');for(var i=0;i<inputs.length;++i){if(inputs[i].value){r.push(inputs[i].value);}}
return r;}
tokenizer.prototype.get_token_strings=function(){var r=[];var tokens=this.obj.getElementsByTagName('a');for(var i=0;i<tokens.length;++i){if(typeof tokens[i].token!='undefined'){r.push(tokens[i].token.text);}}
return r;}
tokenizer.prototype.clear=function(){var tokens=this.obj.getElementsByTagName('a');for(var i=tokens.length-1;i>=0;--i){if(typeof tokens[i].token!='undefined'){tokens[i].token.remove();}}}
tokenizer.prototype._onmousedown=function(event){setTimeout(function(){if(!this.inputs.length){if(this.max_selections>this.count_names()){new tokenizer_input(this);}else{var tokens=this.obj.getElementsByTagName('a');for(var i=tokens.length-1;i>=0;i--){if(typeof tokens[i].token!='undefined'){tokens[i].token.select();break;}}}}else{this.inputs[0].focus();}}.bind(this),0);event?event.cancelBubble=true:false;return false;}
tokenizer.prototype._onfocus=function(event){if(this.tab_stop_ignore_focus){this.tab_stop_ignore_focus=false;return;}
this._onmousedown();}
tokenizer.prototype.tab_stop_onblur=function(event){this.selected_token?this.selected_token.deselect():false;}
tokenizer.prototype.tab_stop_onkeydown=function(event){if(!event.keyCode||!this.selected_token){return;}
switch(event.keyCode){case 8:case 46:var tok=this.selected_token;var prev=tok.element.previousSibling;if(prev&&prev.input){prev.input.element.focus();}else{new tokenizer_input(this,tok.element);}
tok.remove();return false;case 37:if(!tokenizer.valid_arrow_event()){break;}
var tok=this.selected_token;var prev=tok.element.previousSibling;if(prev&&prev.input){prev.input.element.focus();}else if(this.max_selections>this.count_names()){new tokenizer_input(this,tok.element);}else{return false;}
tok.deselect();return false;case 39:if(!tokenizer.valid_arrow_event()){break;}
var tok=this.selected_token;var next=tok.element.nextSibling;if(next&&next.input){next.input.focus();}else if(this.max_selections>this.count_names()){new tokenizer_input(this,tok.element.nextSibling);}else{return false;}
tok.deselect();return false;}}
tokenizer.prototype.count_names=function(plus){var inputs=this.obj.getElementsByTagName('input');var uniq={};var count=0;for(var i=0;i<inputs.length;i++){if(inputs[i].type=='hidden'&&!uniq[inputs[i].value]){uniq[inputs[i].value]=true;++count;}}
if(plus){for(var j=0;j<plus.length;j++){if(!uniq[plus[j]]){uniq[plus[j]]=true;++count;}}}
return count;}
tokenizer.prototype.disable=function(){this.tab_stop.parentNode.removeChild(this.tab_stop);this.obj.className+=' tokenizer_locked';}
function tokenizer_input(tokenizer,caret){if(!tokenizer_input.hacks){tokenizer_input.should_use_borderless_hack=ua.safari();tokenizer_input.should_use_shadow_hack=ua.ie()||ua.opera();tokenizer_input.hacks=true;}
this.tokenizer=tokenizer;this.obj=document.createElement('input');this.obj.input=this;this.obj.tabIndex=-1;this.obj.size=1;this.obj.onmousedown=function(event){(event?event:window.event).cancelBubble=true}.bind(this);this.shadow=document.createElement('span');this.shadow.className='tokenizer_input_shadow';this.element=document.createElement('div');this.element.className='tokenizer_input'+(tokenizer_input.should_use_borderless_hack?' tokenizer_input_borderless':'');this.element.appendChild(document.createElement('div'));this.element.firstChild.appendChild(this.obj);(tokenizer_input.should_use_shadow_hack?document.body:this.element.firstChild).appendChild(this.shadow);caret?tokenizer.obj.insertBefore(this.element,caret):tokenizer.obj.appendChild(this.element);this.tokenizer.tab_stop.disabled=true;this.update_shadow();this.update_shadow=this.update_shadow.bind(this);this.tokenizer.inputs.push(this);this.parent.construct(this,this.obj,this.tokenizer.typeahead_source);if(this.focused){this.focus();this.obj.select();}
setInterval(this.update_shadow.bind(this),100);}
tokenizer_input.extend(typeaheadpro);tokenizer_input.prototype.gen_nomatch=tokenizer_input.prototype.gen_loading=tokenizer_input.prototype.gen_placeholder=tokenizer_input.prototype.gen_noinput='';tokenizer_input.prototype.max_display=8;tokenizer_input.prototype.setup_anchor=function(){return this.tokenizer.obj;}
tokenizer_input.prototype.update_shadow=function(){try{var val=this.obj.value;}catch(e){return};if(this.shadow_input!=val){this.shadow.innerHTML=htmlspecialchars((this.shadow_input=val)+'^_^');if(tokenizer_input.should_use_shadow_hack){this.obj.style.width=this.shadow.offsetWidth+'px';this.obj.value=val;}}}
tokenizer_input.prototype._onblur=function(){if(this.parent._onblur()===false){return false;}
if(this.changed&&!this.interactive){this.dirty_results();this.changed=false;return;}
if(this.changed||this.interactive){this.select_suggestion(this.selectedindex);}
setTimeout(function(){this.disabled=false}.bind(this.tokenizer.tab_stop),1000);this.destroy();}
tokenizer_input.prototype._onfocus=function(){this.tokenizer.tab_stop.disabled=true;this.parent._onfocus();return true;}
tokenizer_input.prototype._onkeydown=function(event){switch(event.keyCode){case 13:break;case 37:case 8:if(this.get_selection_start()!=0||this.obj.value!=''){break;}
var prev=this.element.previousSibling;if(prev&&prev.token){setTimeout(prev.token.select.bind(prev.token),0);}
break;case 39:case 46:if(this.get_selection_start()!=this.obj.value.length){break;}
var next=this.element.nextSibling;if(next&&next.token){setTimeout(next.token.select.bind(next.token),0);}
break;case 188:this._onkeydown({keyCode:9});return false;case 9:if(this.obj.value){this.advance_focus();this._onkeydown({keyCode:13});return false;}else if(!event.shiftKey){this.advance_focus();this.parent._onkeydown(event);return false;}
break;}
return this.parent._onkeydown(event);}
tokenizer_input.prototype._onkeypress=function(event){switch(event.keyCode){case 9:return false;}
setTimeout(this.update_shadow,0);return this.parent._onkeypress(event);}
tokenizer_input.prototype.select_suggestion=function(index){if(this.suggestions&&index>=0&&this.suggestions.length>index){var inputs=this.tokenizer.obj.getElementsByTagName('input');var id=this.suggestions[index].i;for(i=0;i<inputs.length;i++){if(inputs[i].name=='ids[]'&&inputs[i].value==id){return false;}}}
return this.parent.select_suggestion(index);}
tokenizer_input.prototype.get_selection_start=function(){if(this.obj.selectionStart!=undefined){return this.obj.selectionStart;}else{return Math.abs(document.selection.createRange().moveStart('character',-1024));}}
tokenizer_input.prototype.onselect=function(obj){if(obj){var inputs=this.tokenizer.obj.getElementsByTagName('input');for(i=0;i<inputs.length;i++){if(inputs[i].name=='ids[]'&&inputs[i].value==obj.i){return false;}}
new token(obj,this.tokenizer,this.element);if(this.tokenizer.max_selections>this.tokenizer.count_names()){this.clear();}else{this.destroy();this.hide=function(){};return false;}}
if(obj){this.tokenizer._ontokenadded(obj);}
this.tokenizer.typeahead_source.onselect_not_found.call(this);return false;}
tokenizer.prototype._ontokenadded=function(obj){if(this.ontokenadded){this.ontokenadded.call(this,obj);}}
tokenizer.prototype._ontokenremoved=function(obj){if(this.ontokenremoved){this.ontokenremoved.call(this,obj);}}
tokenizer.prototype._ontokennotfound=function(text){if(this.ontokennotfound){this.ontokennotfound.call(this,text);}}
tokenizer_input.prototype._onsubmit=function(){return false;}
tokenizer_input.prototype.capture_submit=function(){return false;}
tokenizer_input.prototype.clear=function(){this.parent.clear();this.update_shadow();}
tokenizer_input.prototype.destroy=function(){if(tokenizer_input.should_use_shadow_hack){this.shadow.parentNode.removeChild(this.shadow);}
this.element.parentNode.removeChild(this.element);this.element=null;var index=array_indexOf(this.tokenizer.inputs,this);if(index!=-1){this.tokenizer.inputs.splice(index,1);}
this.tokenizer=this.element=this.shadow=null;this.parent.destroy();return null;}
function token(obj,tokenizer,caret){if(obj.is&&(tokenizer.count_names(obj.is)>tokenizer.max_selections)){(new contextual_dialog).set_context(tokenizer.obj).show_prompt(tx('ta12'),tx('ta13')).fade_out(500,1500);return null;}
this.tokenizer=tokenizer;this.element=document.createElement('a');this.element.className='token';this.element.href='#';this.element.tabIndex=-1;this.element.onclick=function(event){return this._onclick(event?event:window.event)}.bind(this);this.element.onmousedown=function(event){(event?event:window.event).cancelBubble=true;return false};this.render_obj(obj);this.obj=obj;this.element.token=this;caret?this.tokenizer.obj.insertBefore(this.element,caret):this.tokenizer.obj.appendChild(this.element);}
token.prototype.render_obj=function(obj){var inputs='';if(obj.np){var fb_protected='';}else{var fb_protected='fb_protected="true" ';}
if(obj.e){inputs=['<input type="hidden" ',fb_protected,'name="emails[]" value="',obj.e,'" />'].join('');}else if(obj.i){inputs=['<input type="hidden" ',fb_protected,'name="',this.tokenizer.obj.id,'[]" value="',obj.i,'" />'].join('');}else if(obj.is){for(var i=0,il=obj.is.length;i<il;i++){inputs+=['<input type="hidden" ',fb_protected,'name="',this.tokenizer.obj.id,'[]" value="',obj.is[i],'" />'].join('');}
this.explodable=true;this.n=obj.n;}
this.text=obj.t;this.element.innerHTML=['<span><span><span><span>',inputs,htmlspecialchars(obj.t),'<span onclick="this.parentNode.parentNode.parentNode.parentNode.parentNode.token.remove(true); event.cancelBubble=true; return false;" ','onmouseover="this.className=\'x_hover\'" onmouseout="this.className=\'x\'" class="x">&nbsp;</span>','</span></span></span></span>'].join('');}
token.prototype._onclick=function(event){var this_select_time=(new Date()).getTime();if(this.explodable&&this.tokenizer.last_select_time&&(this_select_time-this.tokenizer.last_select_time<1400)){var to_add=this.n;this.remove();var inputs=this.tokenizer.obj.getElementsByTagName('input');var already_ids={};for(var i=0;i<inputs.length;++i){if(inputs[i].name=='ids[]'){already_ids[inputs[i].value]=true;}}
for(var id in to_add){if(!already_ids[id]){new token({'t':to_add[id],'i':id},this.tokenizer);}}}else{this.select();}
this.tokenizer.last_select_time=this_select_time;event.cancelBubble=true;return false;}
token.prototype.select=function(again){if(this.tokenizer.selected_token&&!again){this.tokenizer.selected_token.deselect();}
this.element.className=trim(this.element.className.replace('token_selected',''))+' token_selected';this.tokenizer.tab_stop_ignore_focus=true;if(this.tokenizer.tab_stop.disabled){this.tokenizer.tab_stop.disabled=false;}
this.tokenizer.tab_stop.focus();this.tokenizer.selected_token=this;if(again!==true){setTimeout(function(){this.select(true)}.bind(this),0);}else{setTimeout(function(){this.tab_stop_ignore_focus=false}.bind(this.tokenizer),0);}}
token.prototype.remove=function(focus){this.element.parentNode.removeChild(this.element);this.element.token=null;this.tokenizer.selected_token=null;if(focus){this.tokenizer._onmousedown();}
if(this.obj){this.tokenizer._ontokenremoved(this.obj);}if(this.onRemove)this.onRemove.call(this);}
token.prototype.deselect=function(){this.element.className=trim(this.element.className.replace('token_selected',''));this.tokenizer.selected_token=null;}
function typeahead_source(){}
typeahead_source.prototype.cache_results=false;typeahead_source.prototype.enumerable=false;typeahead_source.prototype.allow_fake_results=false;typeahead_source.prototype.search_limit=10;typeahead_source.check_match=function(search,value){value=typeahead_source.tokenize(value);for(var i=0,il=search.length;i<il;i++){if(search[i].length){var found=false;for(var j=0,jl=value.length;j<jl;j++){if(value[j].length>=search[i].length&&value[j].substring(0,search[i].length)==search[i]){found=true;value[j]='';break;}}
if(!found){return false;}}}
return true;}
//typeahead_source.tokenize=function(text,capture,noflatten){return(noflatten?text:typeahead_source.flatten_string(text)).split(capture?typeahead_source.normalizer_regex_capture:typeahead_source.normalizer_regex);}
typeahead_source.tokenize=function(text,capture,noflatten){return(noflatten?text:typeahead_source.flatten_string(text)).split('');}//中文单字匹配
typeahead_source.normalizer_regex_str='(?:(?:^| +)["\'.\\-]+ *)|(?: *[\'".\\-]+(?: +|$)|@| +)';typeahead_source.normalizer_regex=new RegExp(typeahead_source.normalizer_regex_str,'g');typeahead_source.normalizer_regex_capture=new RegExp('('+typeahead_source.normalizer_regex_str+')','g');typeahead_source.flatten_string=function(text){if(!typeahead_source.accents){typeahead_source.accents={a:/à|á|â|ã|ä|å/g,c:/ç/g,d:/ð/g,e:/è|é|ê|ë/g,i:/ì|í|î|ï/g,n:/ñ/g,o:/ø|ö|õ|ô|ó|ò/g,u:/ü|û|ú|ù/g,y:/ÿ|ý/g,ae:/æ/g,oe:/œ/g}}
text=text.toLowerCase();for(var i in typeahead_source.accents){text=text.replace(typeahead_source.accents[i],i);}
return text;}
typeahead_source.prototype.set_owner=function(obj){this.owner=obj;if(this.is_ready){this.owner.update_status(typeaheadpro.STATUS_IDLE);}}
typeahead_source.prototype.ready=function(){if(this.owner&&!this.is_ready){this.is_ready=true;this.owner.update_status(typeaheadpro.STATUS_IDLE);}else{this.is_ready=true;}}
typeahead_source.highlight_found=function(result,search){var html=[];resultv=typeahead_source.tokenize(result,true,true);result=typeahead_source.tokenize(result,true);search=typeahead_source.tokenize(search);search.sort(typeahead_source._sort);for(var i=0,il=resultv.length;i<il;i++){var found=false;for(var j=0,jl=search.length;j<jl;j++){if(search[j]&&result[i].lastIndexOf(search[j],0)!=-1){html.push('<em>',htmlspecialchars(resultv[i].substring(0,search[j].length)),'</em>',htmlspecialchars(resultv[i].substring(search[j].length,resultv[i].length)));found=true;break;}}
if(!found){html.push(htmlspecialchars(resultv[i]));}}
return html.join('');}
typeahead_source._sort=function(a,b){return b.length-a.length;}
typeahead_source.prototype.gen_nomatch=function(){return this.text_nomatch!=null?this.text_nomatch:tx('ta01');}
typeahead_source.prototype.gen_loading=function(){return this.text_loading!=null?this.text_loading:tx('ta02');}
typeahead_source.prototype.gen_placeholder=function(){return this.text_placeholder!=null?this.text_placeholder:tx('ta03');}
typeahead_source.prototype.gen_noinput=function(){return this.text_noinput!=null?this.text_noinput:tx('ta03');}
typeahead_source.prototype.onselect_not_found=function(){if(typeof this.tokenizer._ontokennotfound!='undefined'){this.tokenizer._ontokennotfound(this.obj.value);}
if(typeof this.tokenizer.onselect!='undefined'){return this.tokenizer.onselect();}}
function static_source(){this.values=null;this.index=null;this.exclude_ids={};this.parent.construct(this);}
static_source.extend(typeahead_source);static_source.prototype.enumerable=true;static_source.prototype.build_index=function(){var index=[];var values=this.values;var gen_id=values.length&&typeof values[0].i=='undefined';for(var i=0,il=values.length;i<il;i++){var tokens=typeahead_source.tokenize(values[i].t);for(var j=0,jl=tokens.length;j<jl;j++){index.push({t:tokens[j],o:values[i]});}
if(gen_id){values[i].i=i;}}
index.sort(function(a,b){return(a.t==b.t)?0:(a.t<b.t?-1:1)});this.index=index;this.ready();}
static_source.prototype._sort_text_obj=function(a,b){if(a.e&&!b.e){return 1;}
if(!a.e&&b.e){return-1;}
if(a.t==b.t){return 0;}
return a.t<b.t?-1:1}
static_source.prototype.search_value=function(text){if(!this.is_ready){return;}
var results;if(text==''){results=this.values;}else{var ttext=typeahead_source.tokenize(text).sort(typeahead_source._sort);var index=this.index;var lo=0;var hi=this.index.length-1;var p=Math.floor(hi/2);while(lo<=hi){if(index[p].t>=ttext[0]){hi=p-1;}else{lo=p+1;}
p=Math.floor(lo+((hi-lo)/2));}
var results=[];var stale_keys={};var check_ignore=typeof _ignoreList!='undefined';for(var i=lo;i<index.length&&index[i].t.lastIndexOf(ttext[0],0)!=-1;i++){var elem_id=index[i].o.flid?index[i].o.flid:index[i].o.i;if(typeof stale_keys[elem_id]!='undefined'){continue;}else{stale_keys[elem_id]=true;}
if((!check_ignore||!_ignoreList[elem_id])&&!this.exclude_ids[elem_id]&&(ttext.length==1||typeahead_source.check_match(ttext,index[i].o.t))){results.push(index[i].o);}}}
results.sort(this._sort_text_obj);if(this.owner.max_results){results=results.slice(0,this.owner.max_results);}
return results;}
static_source.prototype.set_exclude_ids=function(ids){this.exclude_ids=ids;}
function friend_source(get_param){this.parent.construct(this);if(friend_source.friends[get_param]){this.values=friend_source.friends[get_param];this.index=friend_source.friends_index[get_param];this.ready();}else{var ajax=new Ajax(function(obj,text){text=text.substring(9);eval(text);friend_source.friends[get_param]=this.values=friends;this.build_index();friend_source.friends_index[get_param]=this.index;}.bind(this));ajax.get('/ajax/typeahead_friends.php?_'+(new Date()).getTime()+'&'+get_param);}}
friend_source.extend(static_source);friend_source.prototype.text_noinput=friend_source.prototype.text_placeholder=tx('ta04');friend_source.friends={};friend_source.friends_index={};friend_source.prototype.cache_results=true;friend_source.prototype.gen_html=function(friend,highlight){var text=friend.n;if(typeof(friend.n)=="object"){var names=[];for(var k in friend.n){names.push(friend.n[k]);}
text=names.join(', ');}
return['<div>',typeahead_source.highlight_found(friend.t,highlight),'</div><div><small>',text,'</small></div>'].join('');}
friend_source.prototype.search_value=function(text){if(text=='\x5e\x5f\x5e'){return[{t:text,n:'\x6b\x65\x6b\x65',i:10,it:'http://static.ak.facebook.com/pics/t_default.jpg'}];}
return this.parent.search_value(text);}
function friend_and_email_source(get_param){get_param=get_param?get_param+'&include_emails=1':'';this.parent.construct(this,get_param);}
friend_and_email_source.extend(friend_source);friend_and_email_source.prototype.text_noinput=friend_and_email_source.prototype.text_placeholder=tx('ta05');friend_and_email_source.prototype.text_nomatch=tx('ta06');friend_and_email_source.prototype.onselect_not_found=function(){emails=this.results_text.split(/[,; ]/);for(var i=0;i<emails.length;i++){var text=emails[i].replace(/^\s+|\s+$/g,'');var email_regex=/.*\@.*\.[a-z]+$/;if(!email_regex.test(text)){continue;}
var email_entry={t:text,e:text};var new_token=new token(email_entry,this.tokenizer,this.element);var ajax=new Ajax(function(obj,text){text=(text.length>9)?text.substring(9):'';eval(text);if(obj){this.render_obj(obj);}}.bind(new_token));ajax.get('/ajax/typeahead_email.php?email='+encodeURIComponent(text));}
this.clear();}
function network_source(get_param){this.get_param=get_param?get_param:'';this.parent.construct(this);this.ready();}
network_source.extend(typeahead_source);network_source.prototype.cache_results=true;network_source.prototype.search_limit=200;network_source.prototype.text_placeholder=network_source.prototype.text_noinput=tx('ta07');network_source.prototype.base_uri='';network_source.prototype.allow_fake_results=true;network_source.prototype.search_value=function(text){this.search_text=text;var ajax=new Ajax(function(ajax,text){eval(text);this.owner.found_suggestions(results,this.search_text);}.bind(this),function(){this.owner.found_suggestions(false,this.search_text);}.bind(this));ajax.get('/ajax/typeahead_networks.php?_'+(new Date()).getTime()+'&'+this.get_param+'&q='+encodeURIComponent(text));}
network_source.prototype.gen_html=function(result,highlight){return['<div>',typeahead_source.highlight_found(result.t,highlight),'</div><div><small>',typeahead_source.highlight_found(result.l,highlight),'</small></div>'].join('');}
function extended_network_source(get_param){this.get_param=get_param?get_param:'';this.parent.construct(this);this.ready();}
extended_network_source.extend(network_source);extended_network_source.prototype.search_value=function(text){this.search_text=text;var ajax=new Ajax(function(ajax,text){eval(text);this.owner.found_suggestions(results,this.search_text);}.bind(this),function(){this.owner.found_suggestions(false,this.search_text);}.bind(this));var extraParams='';if(this.hs_ineligible){extraParams+='&hs_ineligible';}
if(this.geo_ineligible){extraParams+='&geo_ineligible';}
if(this.type){extraParams+='&type=';for(var i in this.type){extraParams+=this.type[i]+'_';}}
ajax.get('/ajax/typeahead_extended_networks.php?'+this.get_param+'&q='+encodeURIComponent(text)+'&network_type&show_email'+extraParams);}
function custom_source(options){this.parent.construct(this);this.values=options;this.build_index();}
custom_source.extend(static_source);custom_source.prototype.text_placeholder=custom_source.prototype.text_noinput=false;custom_source.prototype.gen_html=function(result,highlight){var html=['<div>',typeahead_source.highlight_found(result.t,highlight),'</div>'];if(result.s){html.push('<div><small>',htmlspecialchars(result.s),'</small></div>');}
return html.join('');}
function concentration_source(get_network){this.parent.construct(this,[]);this.network=get_network;if(!concentration_source.networks){concentration_source.networks=[];}else{for(var i=0,il=concentration_source.networks.length;i<il;i++){if(concentration_source.networks[i].n==this.network){this.values=concentration_source.networks[i].v;this.index=concentration_source.networks[i].i;this.ready();return;}}}
new AsyncRequest().setURI('/ajax/typeahead_concentrations.php?n='+this.network).setHandler(function(response){this.values=response.getPayload();this.build_index();concentration_source.networks.push({n:this.network,v:this.values,i:this.index});this.ready();}.bind(this)).send();}
concentration_source.extend(custom_source);concentration_source.prototype.noinput=false;concentration_source.prototype.text_placeholder=tx('ta08');concentration_source.prototype.allow_fake_results=true;function language_source(){this.parent.construct(this,[]);if(!language_source.languages){language_source.languages=[];}else{for(var i=0,il=language_source.languages.length;i<il;i++){this.values=language_source.languages[i].v;this.index=language_source.languages[i].i;this.ready();return;}}
new AsyncRequest().setURI('/ajax/typeahead_languages.php').setHandler(function(response){this.values=response.getPayload();this.build_index();language_source.languages.push({v:this.values,i:this.index});this.ready();}.bind(this)).send();}
language_source.extend(custom_source);language_source.prototype.noinput=false;language_source.prototype.text_placeholder=tx('ta14');language_source.prototype.allow_fake_results=false;function keyword_source(get_category){this.parent.construct(this,[]);this.category=get_category;if(!keyword_source.categories){keyword_source.categories=[];}else{for(var i=0,il=keyword_source.categories.length;i<il;i++){if(keyword_source.categories[i].c==this.category){this.values=keyword_source.categories[i].v;this.index=keyword_source.categories[i].i;this.ready();return;}}}
var ajax=new Ajax(function(obj,text){eval(text);this.values=_results;this.build_index();keyword_source.categories.push({c:this.category,v:this.values,i:this.index});this.ready();}.bind(this));ajax.get('/ajax/typeahead_keywords.php?c='+this.category);}
keyword_source.extend(custom_source);keyword_source.prototype.noinput=false;keyword_source.prototype.text_placeholder=tx('ta09');function regions_source(get_iso2){this.parent.construct(this,[]);this.country=get_iso2;this.reload();}
regions_source.extend(custom_source);regions_source.prototype.noinput=false;regions_source.prototype.text_placeholder=tx('ta10');regions_source.prototype.reload=function(){var ajax=new Ajax(function(obj,text){eval(text);this.values=_results;this.build_index();this.ready();}.bind(this));ajax.get('/ajax/typeahead_regions.php?c='+this.country);}
function time_source(get_param){this.get_param=get_param?get_param:'';this.status=0;this.parent.construct(this);}
time_source.extend(typeahead_source);time_source.prototype.cache_results=true;time_source.prototype.text_placeholder=time_source.prototype.text_noinput=tx('ta11');time_source.prototype.base_uri='';time_source.prototype.search_value=function(text){this.search_text=text;var ajax=new Ajax(function(ajax,text){eval(text);this.owner.found_suggestions(results,this.search_text,false);}.bind(this),function(){this.owner.found_suggestions(false,this.search_text,false);}.bind(this));ajax.get('/ajax/typeahead_time.php?'+this.get_param+'&q='+encodeURIComponent(text));}
time_source.prototype.gen_html=function(result,highlight){return['<div>',typeahead_source.highlight_found(result.t,highlight),'</div>'].join('');}
function dynamic_custom_source(async_url){this.async_url=async_url;this.parent.construct(this);}
dynamic_custom_source.extend(typeahead_source);dynamic_custom_source.cache_results=true;dynamic_custom_source.prototype.search_value=function(text){this.search_text=text;var r=new AsyncRequest().setURI(this.async_url).setData({'q':text}).setHandler(bind(this,function(r){eval('var results = ('+r.payload+')');this.owner.found_suggestions(results,this.search_text,false);})).setErrorHandler(bind(this,function(r){this.owner.found_suggestions(false,this.search_text,false);})).setReadOnly(true).send()}
dynamic_custom_source.prototype.gen_html=function(result,highlight){var html=['<div>',this.highlight_found(result.t,highlight),'</div>'];if(result.s){html.push('<div class="sub_result"><small>',result.s,'</small></div>');}
return html.join('');}
dynamic_custom_source.prototype.highlight_found=function(result,search){return typeahead_source.highlight_found(result,search);}




/*  ------------------------------------------------------------------------
                                TongXue | search_typeaheadpro.js
    ------------------------------------------------------------------------  */




function search_typeaheadpro(obj,source,properties){this.anchor_block=true;this.parent.construct(this,obj,source,properties);}
search_typeaheadpro.extend(typeaheadpro);search_typeaheadpro.prototype.auto_select=false;search_typeaheadpro.prototype.less_than_n_chars=false;search_typeaheadpro.prototype.show=function(){if(!this.less_than_n_chars){this.parent.show();this.dropdown.style.width='148px';}else{this.hide();}}
search_typeaheadpro.prototype.hide=function(){this.parent.hide();remove_css_class_name(ge('q'),'typeahead_border');}
search_typeaheadpro.prototype.found_suggestions=function(suggestions,text,fake_data){this.parent.found_suggestions(suggestions,text,fake_data);if(this.list.firstChild&&this.list.firstChild.firstChild){add_css_class_name(this.list.firstChild.firstChild,'blue_top_border');remove_css_class_name(this.list,'no_border_list');add_css_class_name(this.list.lastChild.lastChild,'blue_bottom_border');add_css_class_name(ge('q'),'typeahead_border');}else{remove_css_class_name(ge('q'),'typeahead_border');remove_css_class_name(ge('q'),'typeahead_border');add_css_class_name(this.list,'no_border_list');}}
function search_friend_source(get_param){this.parent.construct(this,get_param);new AsyncRequest().setMethod('GET').setReadOnly(true).setURI('/ajax/typeahead_search.php?'+get_param).setErrorHandler(function(){}).setHandler(function(response){this.values=response.getPayload().entries;this.build_index();}.bind(this)).send();}
search_friend_source.extend(static_source);search_friend_source.prototype.text_noinput=search_friend_source.prototype.text_placeholder=search_friend_source.prototype.text_nomatch='';search_friend_source.prototype.cache_results=true;search_friend_source.prototype.gen_html=function(friend,highlight){if(friend.it){return['<div class="icon" style="background-image: url(',friend.it,')">&nbsp;</div><div class="app_name">',typeahead_source.highlight_found(friend.t,highlight),'</div>'].join('');}else{return['<div>',typeahead_source.highlight_found(friend.t,highlight),'</div><div><small>',friend.n,'</small></div>'].join('');}}
search_friend_source.prototype.search_value=function(text){if(text.length>=1){this.owner.less_than_n_chars=false;return this.parent.search_value(text);}else if(this.is_ready){this.owner.less_than_n_chars=true;return[];}}
function search_typeahead_onsubmit(friend){if(friend){if(SEARCH_TYPEAHEAD_ONCLICK){if(!search_friend_source.already_logged){eval(SEARCH_TYPEAHEAD_ONCLICK);search_friend_source.already_logged=true;}}
if(friend.u.indexOf('?')!=-1){document.location=friend.u+'&ref=ts';}else{document.location=friend.u+'?ref=ts';}
return false;}}
search_friend_source.prototype._sort_text_obj=function(a,b){if(a.o!=b.o){return a.o-b.o;}else if(a.t==b.t){return 0;}
return a.t<b.t?-1:1}




/*  ------------------------------------------------------------------------
                                TongXue | dialogpro.js
    ------------------------------------------------------------------------  */




function generic_dialog(className,modal){this.className=className;this.content=null;this.obj=null;this.popup=null;this.overlay=null;this.modal=null;this.iframe=null;this.hidden_objects=[];if(modal==true){this.modal=true;}}
generic_dialog.dialog_stack=null;generic_dialog.prototype.should_hide_objects=ua.osx();generic_dialog.prototype.should_use_iframe=ua.ie()<7||(ua.osx()&&ua.firefox());generic_dialog.prototype.show_dialog=function(html){if(!this.obj){this.build_dialog();}
set_inner_html(this.content,html);var imgs=this.content.getElementsByTagName('img');for(var i=0;i<imgs.length;i++){imgs[i].onload=chain(imgs[i].onload,this.hide_objects.bind(this));}
this.show();this.focus_first_textbox();this.on_show_callback&&this.on_show_callback();return this;}
generic_dialog.prototype.focus_first_textbox=function(){function focus_textbox(node){var is_textbox=(node.tagName=="INPUT"&&node.type.toLowerCase()=="text")||(node.tagName=="TEXTAREA");if(is_textbox){try{if(elementY(node)>0&&elementX(node)>0){node.focus();return false;}}catch(e){};}
return true;}
iterTraverseDom(this.content,focus_textbox)}
generic_dialog.prototype.set_top=function(top){return this;}
generic_dialog.prototype.make_modal=function(){if(this.modal){return;}
this.modal=true;if(ua.ie()==7){this.build_iframe();}
this.build_overlay();this.reset_iframe();}
generic_dialog.prototype.show_loading=function(loading_html){return this.show_dialog('<div class="dialog_loading">'+loading_html+'</div>');}
generic_dialog.prototype.show_ajax_dialog_custom_loader=function(html,src,post_vars){this.show_loading(html);var async=new AsyncRequest().setOption('suppressEvaluation',true).setURI(src).setData(post_vars||{}).setHandler(function(response){this.show_dialog(response.getPayload().responseText);}.bind(this));if(!post_vars){async.setMethod('GET').setReadOnly(true);}
async.send();return this;}
generic_dialog.prototype.show_ajax_dialog=function(src,post_vars){post_vars=post_vars||false;var load=tx('sh:loading');return this.show_ajax_dialog_custom_loader(load,src,post_vars);}
generic_dialog.prototype.show_prompt=function(title,content){return this.show_dialog('<h2><span>'+title+'</span></h2><a class=close onclick="generic_dialog.get_dialog(this).fade_out(300);return false;" title="关闭" href="#"></a><div class="dialog_content">'+content+'</div>');}
generic_dialog.prototype.show_message=function(title,content,button){if(button==null){button=tx('sh:ok-button');}
return this.show_choice(title,content,button,function(){generic_dialog.get_dialog(this).fade_out(100)});}
generic_dialog.prototype.show_choice=function(title,content,button1,button1js,button2,button2js,buttons_msg,button3,button3js){var buttons='<div class="dialog_buttons" id="dialog_buttons">';if(typeof(buttons_msg)!='undefined'){buttons+='<div class="dialog_buttons_msg">';buttons+=buttons_msg;buttons+='</div>';}
buttons+='<input class="inputsubmit" type="button" value="'+button1+'" id="dialog_button1" />';if(button2){buttons+='<input class="inputsubmit" type="button" value="'+button2+'" id="dialog_button2" />';}
if(button3){buttons+='<input class="inputsubmit" type="button" value="'+button3+'" id="dialog_button3" />';}
this.show_prompt(title,this.content_to_markup(content)+buttons);var inputs=this.obj.getElementsByTagName('input');if(button3){button1obj=inputs[inputs.length-3];button2obj=inputs[inputs.length-2];button3obj=inputs[inputs.length-1];}else if(button2){button1obj=inputs[inputs.length-2];button2obj=inputs[inputs.length-1];}else{button1obj=inputs[inputs.length-1];}
if(button1js&&button1){if(typeof button1js=='string'){eval('button1js = function() {'+button1js+'}');}
button1obj.onclick=button1js;}
if(button2js&&button2){if(typeof button2js=='string'){eval('button2js = function() {'+button2js+'}');}
button2obj.onclick=button2js;}
if(button3js&&button3){if(typeof button3js=='string'){eval('button3js = function() {'+button3js+'}');}
button3obj.onclick=button3js;}
if(!this.modal){document.onkeyup=function(e){var keycode=(e&&e.which)?e.which:event.keyCode;var btn2_exists=(typeof button2obj!='undefined');var btn3_exists=(typeof button3obj!='undefined');var is_webkit=ua.safari();if(is_webkit&&keycode==13){button1obj.click();}
if(keycode==27){if(btn3_exists){button3obj.click();}else if(btn2_exists){button2obj.click();}else{button1obj.click();}}
document.onkeyup=function(){}}
button1obj.focus();}
return this;}
generic_dialog.prototype.show_choice_ajax=function(title,content_src,button1,button1js,button2,button2js,buttons_msg,button3,button3js,readonly){this.show_loading(tx('sh:loading'));var handler=function(response){this.show_choice(title,response.getPayload(),button1,button1js,button2,button2js,buttons_msg,button3,button3js);}.bind(this);var req=new AsyncRequest().setURI(content_src).setHandler(handler)
if(readonly==true){req.setReadOnly(true);}
req.send();return this;}
generic_dialog.prototype.show_form_ajax=function(title,src,button,reload_page_on_success){this.show_loading(tx('sh:loading'));var form_id='dialog_ajax_form__'+gen_unique();var preSubmitErrorHandler=function(dialog,response){if(response.getError()!=true){dialog.hide();ErrorDialog.showAsyncError(response);}else{dialog.show_choice(title,response.getPayload(),'Okay',function(){dialog.fade_out(200);});}}.bind(null,this);var preSubmitHandler=function(dialog,response){var contents='<form id="'+form_id+'" onsubmit="return false;">'+response.getPayload()+'</form>';dialog.show_choice(title,contents,button,submitHandler,tx('sh:cancel-button'),function(){dialog.fade_out(200);});}.bind(null,this);var submitHandler=function(){new AsyncRequest().setURI(src).setData(serialize_form(ge(form_id))).setHandler(postSubmitHandler).setErrorHandler(postSubmitErrorHandler).send();};var postSubmitHandler=function(dialog,response){dialog.show_choice(title,response.getPayload(),'Okay',function(){dialog.fade_out(200);});if(reload_page_on_success){window.location.reload();}else{setTimeout(function(){dialog.fade_out(500);},750);}}.bind(null,this);var postSubmitErrorHandler=function(dialog,response){if(response.getError()==1346001){preSubmitHandler(response);}else if(response.getError()!=true){ErrorDialog.showAsyncError(response);}else{preSubmitErrorHandler(response);}}.bind(null,this);new AsyncRequest().setURI(src).setReadOnly(true).setHandler(preSubmitHandler).setErrorHandler(preSubmitErrorHandler).send();return this;}
generic_dialog.prototype.show_form=function(title,content,button,target){content='<form action="'+target+'" method="post">'+this.content_to_markup(content);var post_form_id=ge('post_form_id');if(post_form_id){content+='<input type="hidden" name="post_form_id" value="'+post_form_id.value+'" />';}
content+='<div class="dialog_buttons"><input class="inputsubmit" name="confirm" type="submit" value="'+button+'" />';content+='<input type="hidden" name="next" value="'+htmlspecialchars(document.location.href)+'"/>';content+='<input class="inputsubmit" type="button" value="'+tx('sh:cancel-button')+'" onclick="generic_dialog.get_dialog(this).fade_out(100)" /></form>';this.show_prompt(title,content);return this;}
generic_dialog.prototype.content_to_markup=function(content){return(typeof content=='string')?'<div class="dialog_body">'+content+'</div>':'<div class="dialog_summary">'+content.summary+'</div><div class="dialog_body">'+content.body+'</div>';}
generic_dialog.prototype.hide=function(temporary){if(this.obj){this.obj.style.display='none';}
if(this.iframe){this.iframe.style.display='none';}
if(this.overlay){this.overlay.style.display='none';}
if(this.timeout){clearTimeout(this.timeout);this.timeout=null;return;}
if(this.hidden_objects.length){for(var i=0,il=this.hidden_objects.length;i<il;i++){this.hidden_objects[i].style.visibility='';}
this.hidden_objects=[];}
clearInterval(this.active_hiding);if(!temporary){if(generic_dialog.dialog_stack){var stack=generic_dialog.dialog_stack;for(var i=stack.length-1;i>=0;i--){if(stack[i]==this){stack.splice(i,1);}}
if(stack.length){stack[stack.length-1].show();}}
if(this.obj){this.obj.parentNode.removeChild(this.obj);this.obj=null;}}
return this;}
generic_dialog.prototype.fade_out=function(interval,timeout){if(!this.popup){return this;}
animation(this.obj).duration(timeout?timeout:0).checkpoint().to('opacity',0).hide().duration(interval?interval:350).ondone(this.hide.bind(this)).go();return this;}
generic_dialog.prototype.show=function(){if(this.obj&&this.obj.style.display){this.obj.style.visibility='hidden';this.obj.style.display='';this.reset_dialog();this.obj.style.visibility='';this.obj.dialog=this;}else{this.reset_dialog();}
this.hide_objects();clearInterval(this.active_hiding);this.active_hiding=setInterval(this.active_resize.bind(this),500);var stack=generic_dialog.dialog_stack?generic_dialog.dialog_stack:generic_dialog.dialog_stack=[];for(var i=stack.length-1;i>=0;i--){if(stack[i]==this){stack.splice(i,1);}else{stack[i].hide(true);}}
stack.push(this);return this;}
generic_dialog.prototype.enable_buttons=function(enable){var inputs=this.obj.getElementsByTagName('input');for(var i=0;i<inputs.length;i++){if(inputs[i].type=='button'||inputs[i].type=='submit'){inputs[i].disabled=!enable;}}}
generic_dialog.prototype.active_resize=function(){if(this.last_offset_height!=this.content.offsetHeight){this.hide_objects();this.last_offset_height=this.content.offsetHeight;}}
generic_dialog.prototype.hide_objects=function(){var hide=[],objects=[];var ad_locs=['',0,1,2,4,5,9,3];for(var i=0;i<ad_locs.length;i++){var ad_div=ge('ad_'+ad_locs[i]);if(ad_div!=null){hide.push(ad_div);}}
var rect={x:elementX(this.content),y:elementY(this.content),w:this.content.offsetWidth,h:this.content.offsetHeight};if(this.should_hide_objects){var iframes=document.getElementsByTagName('iframe');for(var i=0;i<iframes.length;i++){if(iframes[i].className.indexOf('share_hide_on_dialog')!=-1){objects.push(iframes[i]);}}}
var swfs=getElementsByTagNames('embed,object');for(var i=0;i<swfs.length;i++){if((swfs[i].getAttribute('wmode')||'').toLowerCase()!='transparent'||this.should_hide_objects){objects.push(swfs[i]);}}
for(var i=0;i<objects.length;i++){var node=objects[i].offsetHeight?objects[i]:objects[i].parentNode;swf_rect={x:elementX(node),y:elementY(node),w:node.offsetWidth,h:node.offsetHeight};if(!is_descendent(objects[i],this.content)&&rect.y+rect.h>swf_rect.y&&swf_rect.y+swf_rect.h>rect.y&&rect.x+rect.w>swf_rect.x&&swf_rect.x+swf_rect.w>rect.w&&array_indexOf(this.hidden_objects,node)==-1){hide.push(node);}}
for(var i=0;i<hide.length;i++){this.hidden_objects.push(hide[i]);hide[i].style.visibility='hidden';}}
generic_dialog.prototype.build_dialog=function(){if(!this.obj){this.obj=document.createElement('div');}
this.obj.className='generic_dialog'+(this.className?' '+this.className:'');this.obj.style.display='none';onloadRegister(function(){document.body.appendChild(this.obj);}.bind(this));if(this.should_use_iframe||(this.modal&&ua.ie()==7)){this.build_iframe();}
if(!this.popup){this.popup=document.createElement('div');this.popup.className='generic_dialog_popup';}
this.popup.style.left=this.popup.style.top='';this.obj.appendChild(this.popup);if(this.modal){this.build_overlay();}}
generic_dialog.prototype.build_iframe=function(){if(!this.iframe&&!(this.iframe=ge('generic_dialog_iframe'))){this.iframe=document.createElement('iframe');this.iframe.id='generic_dialog_iframe';}
this.iframe.frameBorder='0';onloadRegister(function(){document.body.appendChild(this.iframe);}.bind(this));}
generic_dialog.prototype.build_overlay=function(){this.overlay=document.createElement('div');this.overlay.id='generic_dialog_overlay';if(document.body.clientHeight>document.documentElement.clientHeight){this.overlay.style.height=document.body.clientHeight+'px';}else{this.overlay.style.height=document.documentElement.clientHeight+'px';}
onloadRegister(function(){document.body.appendChild(this.overlay);}.bind(this));}
generic_dialog.prototype.reset_dialog=function(){if(!this.popup){return;}
onloadRegister(function(){this.reset_dialog_obj();this.reset_iframe();}.bind(this));}
generic_dialog.prototype.reset_iframe=function(){if(!this.should_use_iframe&&!(this.modal&&ua.ie()==7)){return;}
if(this.modal){this.iframe.style.left='0px';this.iframe.style.top='0px';this.iframe.style.width='100%';if((document.body.clientHeight>document.documentElement.clientHeight)&&(document.body.clientHeight<10000)){this.iframe.style.height=document.body.clientHeight+'px';}else if((document.body.clientHeight<document.documentElement.clientHeight)&&(document.documentElement.clientHeight<10000)){this.iframe.style.height=document.documentElement.clientHeight+'px';}else{this.iframe.style.height='10000px';}}else{this.iframe.style.left=elementX(this.frame)+'px';this.iframe.style.top=elementY(this.frame)+'px';this.iframe.style.width=this.frame.offsetWidth+'px';this.iframe.style.height=this.frame.offsetHeight+'px';}
this.iframe.style.display='';}
generic_dialog.prototype.reset_dialog_obj=function(){}
generic_dialog.get_dialog=function(obj){while(!obj.dialog&&obj.parentNode){obj=obj.parentNode;}
return obj.dialog?obj.dialog:false;}
function pop_dialog(className,callback_function,modal){this.top=125;this.parent.construct(this,className,modal);this.on_show_callback=callback_function;}
pop_dialog.extend(generic_dialog);pop_dialog.prototype.build_dialog=function(){this.parent.build_dialog();this.obj.className+=' pop_dialog';this.popup.innerHTML='<table id="pop_dialog_table" class="pop_dialog_table">'+'<tr><td class="pop_topleft"></td><td class="pop_border"></td><td class="pop_topright"></td></tr>'+'<tr><td class="pop_border"></td><td class="pop_content" id="pop_content"></td><td class="pop_border"></td></tr>'+'<tr><td class="pop_bottomleft"></td><td class="pop_border"></td><td class="pop_bottomright"></td></tr>'+'</table>';this.frame=this.popup.getElementsByTagName('tbody')[0];this.content=this.popup.getElementsByTagName('td')[4];}
pop_dialog.prototype.reset_dialog_obj=function(){this.popup.style.top=(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop)+this.top+'px';}
pop_dialog.prototype.set_top=function(top){this.top=top;}
function contextual_dialog(className){this.parent.construct(this,className);}
contextual_dialog.extend(generic_dialog);contextual_dialog.prototype.set_context=function(obj){this.context=obj;return this;}
contextual_dialog.prototype.build_dialog=function(){this.parent.build_dialog();this.obj.className+=' contextual_dialog';this.popup.innerHTML='<div class="contextual_arrow"><span>^_^keke1</span></div><div class="contextual_dialog_content"></div>';this.arrow=this.popup.getElementsByTagName('div')[0];this.content=this.frame=this.popup.getElementsByTagName('div')[1];}
contextual_dialog.prototype.reset_dialog_obj=function(){var x=elementX(this.context);var center=(document.body.offsetWidth-this.popup.offsetWidth)/2;if(x<document.body.offsetWidth/2){this.arrow.className='contextual_arrow_rev';var left=Math.min(center,x+this.context.offsetWidth-this.arrow_padding_x);var arrow=x-left+this.context.offsetWidth+this.arrow_padding_x;}else{this.arrow.className='contextual_arrow';var left=Math.max(center,x-this.popup.offsetWidth+this.arrow_padding_x);var arrow=x-left-this.arrow_padding_x-this.arrow_width;}
this.popup.style.top=(elementY(this.context)+this.context.offsetHeight-this.arrow.offsetHeight+this.arrow_padding_y)+'px';this.popup.style.left=left+'px';this.arrow.style.backgroundPosition=arrow+'px';}
contextual_dialog.prototype._remove_resize_events=function(){if(this._scroll_events){for(var i=0;i<this._scroll_events.length;i++){removeEventBase(this._scroll_events[i].obj,this._scroll_events[i].event,this._scroll_events[i].func);}}
this._scroll_events=[];}
contextual_dialog.prototype.show=function(){this._remove_resize_events();var obj=this.context;while(obj){if(obj.id!='content'&&(obj.scrollHeight&&obj.offsetHeight&&obj.scrollHeight!=obj.offsetHeight)||(obj.scrollWidth&&obj.offsetWidth&&obj.scrollWidth!=obj.offsetWidth)){var evt={obj:obj,event:'scroll',func:this.reset_dialog_obj.bind(this)};addEventBase(evt.obj,evt.event,evt.func);}
obj=obj.parentNode;}
var evt={obj:window,event:'resize',func:this.reset_dialog_obj.bind(this)};addEventBase(evt.obj,evt.event,evt.func);this.parent.show();}
contextual_dialog.prototype.hide=function(temp){this._remove_resize_events();this.parent.hide(temp);}
contextual_dialog.prototype.arrow_padding_x=5;contextual_dialog.prototype.arrow_padding_y=10;contextual_dialog.prototype.arrow_width=13;function ErrorDialog(){this.parent.construct(this,'errorDialog',null,true);return this;};ErrorDialog.extend(pop_dialog);copy_properties(ErrorDialog.prototype,{showError:function(title,message){return this.show_message(title,message);}});copy_properties(ErrorDialog,{showAsyncError:function(response){try{return(new ErrorDialog()).showError(response.getErrorSummary(),response.getErrorDescription());}catch(ex){aiert(response);}}});




/*  ------------------------------------------------------------------------
                                TongXue | animation.js
    ------------------------------------------------------------------------  */




function animation(obj){if(this==window){return new animation(obj);}else{this.obj=obj;this._reset_state();this.queue=[];this.last_attr=null;}}
animation.resolution=20;animation.offset=0;animation.prototype._reset_state=function(){this.state={attrs:{},duration:500}}
animation.prototype.stop=function(){this._reset_state();this.queue=[];return this;}
animation.prototype._build_container=function(){if(this.container_div){this._refresh_container();return;}
if(this.obj.firstChild&&this.obj.firstChild.__animation_refs){this.container_div=this.obj.firstChild;this.container_div.__animation_refs++;this._refresh_container();return;}
var container=document.createElement('div');container.style.padding='0px';container.style.margin='0px';container.style.border='0px';container.__animation_refs=1;var children=this.obj.childNodes;while(children.length){container.appendChild(children[0]);}
this.obj.appendChild(container);this.obj.style.overflow='hidden';this.container_div=container;this._refresh_container();}
animation.prototype._refresh_container=function(){this.container_div.style.height='auto';this.container_div.style.width='auto';this.container_div.style.height=this.container_div.offsetHeight+'px';this.container_div.style.width=this.container_div.offsetWidth+'px';}
animation.prototype._destroy_container=function(){if(!this.container_div){return;}
if(!--this.container_div.__animation_refs){var children=this.container_div.childNodes;while(children.length){this.obj.appendChild(children[0]);}
this.obj.removeChild(this.container_div);}
this.container_div=null;}
animation.ATTR_TO=1;animation.ATTR_BY=2;animation.ATTR_FROM=3;animation.prototype._attr=function(attr,value,mode){attr=attr.replace(/-[a-z]/gi,function(l){return l.substring(1).toUpperCase();});var auto=false;switch(attr){case'background':this._attr('backgroundColor',value,mode);return this;case'margin':value=animation.parse_group(value);this._attr('marginBottom',value[0],mode);this._attr('marginLeft',value[1],mode);this._attr('marginRight',value[2],mode);this._attr('marginTop',value[3],mode);return this;case'padding':value=animation.parse_group(value);this._attr('paddingBottom',value[0],mode);this._attr('paddingLeft',value[1],mode);this._attr('paddingRight',value[2],mode);this._attr('paddingTop',value[3],mode);return this;case'backgroundColor':case'borderColor':case'color':value=animation.parse_color(value);break;case'opacity':value=parseFloat(value,10);break;case'height':case'width':if(value=='auto'){auto=true;}else{value=parseInt(value,10);}
break;case'borderWidth':case'lineHeight':case'fontSize':case'marginBottom':case'marginLeft':case'marginRight':case'marginTop':case'paddingBottom':case'paddingLeft':case'paddingRight':case'paddingTop':case'bottom':case'left':case'right':case'top':case'scrollTop':case'scrollLeft':value=parseInt(value,10);break;default:throw new Error(attr+' is not a supported attribute!');}
if(this.state.attrs[attr]===undefined){this.state.attrs[attr]={};}
if(auto){this.state.attrs[attr].auto=true;}
switch(mode){case animation.ATTR_FROM:this.state.attrs[attr].start=value;break;case animation.ATTR_BY:this.state.attrs[attr].by=true;case animation.ATTR_TO:this.state.attrs[attr].value=value;break;}}
animation.prototype.to=function(attr,value){if(value===undefined){this._attr(this.last_attr,attr,animation.ATTR_TO);}else{this._attr(attr,value,animation.ATTR_TO);this.last_attr=attr;}
return this;}
animation.prototype.by=function(attr,value){if(value===undefined){this._attr(this.last_attr,attr,animation.ATTR_BY);}else{this._attr(attr,value,animation.ATTR_BY);this.last_attr=attr;}
return this;}
animation.prototype.from=function(attr,value){if(value===undefined){this._attr(this.last_attr,attr,animation.ATTR_FROM);}else{this._attr(attr,value,animation.ATTR_FROM);this.last_attr=attr;}
return this;}
animation.prototype.duration=function(duration){this.state.duration=duration?duration:0;return this;}
animation.prototype.checkpoint=function(distance,callback){if(distance===undefined){distance=1;}
this.state.checkpoint=distance;this.state.checkpointcb=callback;this.queue.push(this.state);this._reset_state();return this;}
animation.prototype.blind=function(){this.state.blind=true;return this;}
animation.prototype.hide=function(){this.state.hide=true;return this;}
animation.prototype.show=function(){this.state.show=true;return this;}
animation.prototype.ease=function(ease){this.state.ease=ease;return this;}
animation.prototype.go=function(){var time=(new Date()).getTime();this.queue.push(this.state);for(var i=0;i<this.queue.length;i++){this.queue[i].start=time-animation.offset;if(this.queue[i].checkpoint){time+=this.queue[i].checkpoint*this.queue[i].duration;}}
animation.push(this);return this;}
animation.prototype._frame=function(time){var done=true;var still_needs_container=false;var whacky_firefox=false;for(var i=0;i<this.queue.length;i++){var cur=this.queue[i];if(cur.start>time){done=false;continue;}else if(cur.checkpointcb&&(cur.checkpoint*cur.duration+cur.start>time)){this._callback(cur.checkpointcb,time-cur.start-cur.checkpoint*cur.duration);cur.checkpointcb=null;}
if(cur.started===undefined){if(cur.show){this.obj.style.display='block';}
for(var a in cur.attrs){if(cur.attrs[a].start!==undefined){continue;}
switch(a){case'backgroundColor':case'borderColor':case'color':var val=animation.parse_color(get_style(this.obj,a=='borderColor'?'borderLeftColor':a));if(cur.attrs[a].by){cur.attrs[a].value[0]=Math.min(255,Math.max(0,cur.attrs[a].value[0]+val[0]));cur.attrs[a].value[1]=Math.min(255,Math.max(0,cur.attrs[a].value[1]+val[1]));cur.attrs[a].value[2]=Math.min(255,Math.max(0,cur.attrs[a].value[2]+val[2]));}
break;case'opacity':var val=get_opacity(this.obj);if(cur.attrs[a].by){cur.attrs[a].value=Math.min(1,Math.max(0,cur.attrs[a].value+val));}
break;case'height':case'width':var val=animation['get_'+a](this.obj);if(cur.attrs[a].by){cur.attrs[a].value+=val;}
break;case'scrollLeft':case'scrollTop':var val=(this.obj==document.body)?(document.documentElement[a]||document.body[a]):this.obj[a];if(cur.attrs[a].by){cur.attrs[a].value+=val;}
cur['last'+a]=val;break;default:var val=parseInt(get_style(this.obj,a),10);if(cur.attrs[a].by){cur.attrs[a].value+=val;}
break;}
cur.attrs[a].start=val;}
if((cur.attrs.height&&cur.attrs.height.auto)||(cur.attrs.width&&cur.attrs.width.auto)){if(ua.firefox()<3){whacky_firefox=true;}
this._destroy_container();for(var a in{height:1,width:1,fontSize:1,borderLeftWidth:1,borderRightWidth:1,borderTopWidth:1,borderBottomWidth:1,paddingLeft:1,paddingRight:1,paddingTop:1,paddingBottom:1}){if(cur.attrs[a]){this.obj.style[a]=cur.attrs[a].value+(typeof cur.attrs[a].value=='number'?'px':'');}}
if(cur.attrs.height&&cur.attrs.height.auto){cur.attrs.height.value=animation.get_height(this.obj);}
if(cur.attrs.width&&cur.attrs.width.auto){cur.attrs.width.value=animation.get_width(this.obj);}}
cur.started=true;if(cur.blind){this._build_container();}}
var p=(time-cur.start)/cur.duration;if(p>=1){p=1;if(cur.hide){this.obj.style.display='none';}}else{done=false;}
var pc=cur.ease?cur.ease(p):p;if(!still_needs_container&&p!=1&&cur.blind){still_needs_container=true;}
if(whacky_firefox&&this.obj.parentNode){var parentNode=this.obj.parentNode;var nextChild=this.obj.nextSibling;parentNode.removeChild(this.obj);}
for(var a in cur.attrs){switch(a){case'backgroundColor':case'borderColor':case'color':this.obj.style[a]='rgb('+
animation.calc_tween(pc,cur.attrs[a].start[0],cur.attrs[a].value[0],true)+','+
animation.calc_tween(pc,cur.attrs[a].start[1],cur.attrs[a].value[1],true)+','+
animation.calc_tween(pc,cur.attrs[a].start[2],cur.attrs[a].value[2],true)+')';break;case'opacity':set_opacity(this.obj,animation.calc_tween(pc,cur.attrs[a].start,cur.attrs[a].value));break;case'height':case'width':this.obj.style[a]=pc==1&&cur.attrs[a].auto?'auto':animation.calc_tween(pc,cur.attrs[a].start,cur.attrs[a].value,true)+'px';break;case'scrollLeft':case'scrollTop':var val=(this.obj==document.body)?(document.documentElement[a]||document.body[a]):this.obj[a];if(cur['last'+a]!=val){delete cur.attrs[a];}else{var diff=animation.calc_tween(pc,cur.attrs[a].start,cur.attrs[a].value,true)-val;if(a=='scrollLeft'){window.scrollBy(diff,0);}else{window.scrollBy(0,diff);}
cur['last'+a]=diff+val;}
break;default:this.obj.style[a]=animation.calc_tween(pc,cur.attrs[a].start,cur.attrs[a].value,true)+'px';break;}}
if(p==1){this.queue.splice(i--,1);this._callback(cur.ondone,time-cur.start-cur.duration);}}
if(whacky_firefox){parentNode[nextChild?'insertBefore':'appendChild'](this.obj,nextChild);}
if(!still_needs_container&&this.container_div){this._destroy_container();}
return!done;}
animation.prototype.ondone=function(fn){this.state.ondone=fn;return this;}
animation.prototype._callback=function(callback,offset){if(callback){animation.offset=offset;callback.call(this);animation.offset=0;}}
animation.calc_tween=function(p,v1,v2,whole){return(whole?parseInt:parseFloat)((v2-v1)*p+v1,10);}
animation.parse_color=function(color){var hex=/^#([a-f0-9]{1,2})([a-f0-9]{1,2})([a-f0-9]{1,2})$/i.exec(color);if(hex){return[parseInt(hex[1].length==1?hex[1]+hex[1]:hex[1],16),parseInt(hex[2].length==1?hex[2]+hex[2]:hex[2],16),parseInt(hex[3].length==1?hex[3]+hex[3]:hex[3],16)];}else{var rgb=/^rgba? *\(([0-9]+), *([0-9]+), *([0-9]+)(?:, *([0-9]+))?\)$/.exec(color);if(rgb){if(rgb[4]==='0'){return[255,255,255];}else{return[parseInt(rgb[1],10),parseInt(rgb[2],10),parseInt(rgb[3],10)];}}else if(color=='transparent'){return[255,255,255];}else{throw'Named color attributes are not supported.';}}}
animation.parse_group=function(value){var value=trim(value).split(/ +/);if(value.length==4){return value;}else if(value.length==3){return[value[0],value[1],value[2],value[1]];}else if(value.length==2){return[value[0],value[1],value[0],value[1]];}else{return[value[0],value[0],value[0],value[0]];}}
animation.get_height=function(obj){var pT=parseInt(get_style(obj,'paddingTop'),10),pB=parseInt(get_style(obj,'paddingBottom'),10),bT=parseInt(get_style(obj,'borderTopWidth'),10),bW=parseInt(get_style(obj,'borderBottomWidth'),10);return obj.offsetHeight-(pT?pT:0)-(pB?pB:0)-(bT?bT:0)-(bW?bW:0);}
animation.get_width=function(obj){var pL=parseInt(get_style(obj,'paddingLeft'),10),pR=parseInt(get_style(obj,'paddingRight'),10),bL=parseInt(get_style(obj,'borderLeftWidth'),10),bR=parseInt(get_style(obj,'borderRightWidth'),10);return obj.offsetWidth-(pL?pL:0)-(pR?pR:0)-(bL?bL:0)-(bR?bR:0);}
animation.push=function(instance){if(!animation.active){animation.active=[];}
animation.active.push(instance);if(!animation.timeout){animation.timeout=setInterval(animation.animate.bind(animation),animation.resolution);}}
animation.animate=function(){var done=true;var time=(new Date()).getTime();for(var i=0;i<animation.active.length;i++){if(animation.active[i]._frame(time)){done=false;}else{animation.active.splice(i--,1);}}
if(done){clearInterval(animation.timeout);animation.timeout=null;}}
animation.ease={}
animation.ease.begin=function(p){return p*p;}
animation.ease.end=function(p){p-=1;return-(p*p)+1;}
animation.ease.both=function(p){if(p<=0.5){return(p*p)*2;}else{p-=1;return(p*p)*-2+1;}}




/*  ------------------------------------------------------------------------
                                TongXue | validator.js
    ------------------------------------------------------------------------  */



﻿/*************************************************
	Validator v1.05
	code by 我佛山人
	wfsr@msn.com
*************************************************/
 Validator = {
	Require : /.+/,
	Email : /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
	Phone : /^((\(\d{2,3}\))|(\d{3}\-))?(\(0\d{2,3}\)|0\d{2,3}-)?[1-9]\d{6,7}(\-\d{1,4})?$/,
	Mobile : /^((\(\d{2,3}\))|(\d{3}\-))?13\d{9}$/,
	Url : /^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\':+!]*([^<>\"\"])*$/,
	IdCard : "this.IsIdCard(value)",
	Currency : /^\d+(\.\d+)?$/,
	Number : /^\d+$/,
	Zip : /^[1-9]\d{5}$/,
	QQ : /^[1-9]\d{4,8}$/,
	Integer : /^[-\+]?\d+$/,
	Double : /^[-\+]?\d+(\.\d+)?$/,
	English : /^[A-Za-z]+$/,
	Chinese :  /^[\u0391-\uFFE5]+$/,
	Username : /^[a-z]\w{3,}$/i,
	UnSafe : /^(([A-Z]*|[a-z]*|\d*|[-_\~!@#\$%\^&\*\.\(\)\[\]\{\}<>\?\\\/\'\"]*)|.{0,5})$|\s/,
	Safe   : /^[\w]{6,14}$/,
	IsSafe : function(str){return this.Safe.test(str);},
	SafeString : "this.IsSafe(value)",
	Filter : "this.DoFilter(value, getAttribute('accept'))",
	Limit : "this.limit(value.length,getAttribute('min'),  getAttribute('max'))",
	LimitB : "this.limit(this.LenB(value), getAttribute('min'), getAttribute('max'))",
	Date : "this.IsDate(value, getAttribute('min'), getAttribute('format'))",
	Repeat : "value == document.getElementsByName(getAttribute('to'))[0].value",
	Range : "getAttribute('min') < (value|0) && (value|0) < getAttribute('max')",
	Compare : "this.compare(value,getAttribute('operator'),getAttribute('to'))",
	Custom : "this.Exec(value, getAttribute('regexp'))",
	Group : "this.MustChecked(getAttribute('name'), getAttribute('min'), getAttribute('max'))",
	ErrorItem : [document.forms[0]],
	ErrorMessage : ["以下原因导致提交失败：\t\t\t\t"],
	Validate : function(theForm, mode){
		var obj = theForm || event.srcElement;
		var count = obj.elements.length;
		this.ErrorMessage.length = 1;
		this.ErrorItem.length = 1;
		this.ErrorItem[0] = obj;
		for(var i=0;i<count;i++){
			with(obj.elements[i]){
				var _dataType = getAttribute("dataType");
				if(typeof(_dataType) == "object" || typeof(this[_dataType]) == "undefined")  continue;
				this.ClearState(obj.elements[i]);
				if(getAttribute("require") == "false" && value == "") continue;
				switch(_dataType){
					case "IdCard" :
					case "Date" :
					case "Repeat" :
					case "Range" :
					case "Compare" :
					case "Custom" :
					case "Group" : 
					case "Limit" :
					case "LimitB" :
					case "SafeString" :
					case "Filter" :
						if(!eval(this[_dataType]))	{
							this.AddError(i, getAttribute("msg"));
						}
						break;
					default :
						if(!this[_dataType].test(value)){
							this.AddError(i, getAttribute("msg"));
						}
						break;
				}
			}
		}
		if(this.ErrorMessage.length > 1){
			mode = mode || 1;
			var errCount = this.ErrorItem.length;
			switch(mode){
			case 2 :
				for(var i=1;i<errCount;i++)
					this.ErrorItem[i].style.color = "red";
			case 1 :
				alert(this.ErrorMessage.join("\n"));
				this.ErrorItem[1].focus();
				break;
			case 3 :
				for(var i=1;i<errCount;i++){
				try{
					var span = document.createElement("SPAN");
					span.id = "__ErrorMessagePanel";
					span.style.color = "red";
					this.ErrorItem[i].parentNode.appendChild(span);
					span.innerHTML = this.ErrorMessage[i].replace(/\d+:/,"*");
					}
					catch(e){alert(e.description);}
				}
				this.ErrorItem[1].focus();
				break;
			default :
				alert(this.ErrorMessage.join("\n"));
				break;
			}
			return false;
		}
		return true;
	},
	limit : function(len,min, max){
		min = min || 0;
		max = max || Number.MAX_VALUE;
		return min <= len && len <= max;
	},
	LenB : function(str){
		return str.replace(/[^\x00-\xff]/g,"**").length;
	},
	ClearState : function(elem){
		with(elem){
			if(style.color == "red")
				style.color = "";
			var lastNode = parentNode.childNodes[parentNode.childNodes.length-1];
			if(lastNode.id == "__ErrorMessagePanel")
				parentNode.removeChild(lastNode);
		}
	},
	AddError : function(index, str){
		this.ErrorItem[this.ErrorItem.length] = this.ErrorItem[0].elements[index];
		this.ErrorMessage[this.ErrorMessage.length] = this.ErrorMessage.length + ":" + str;
	},
	Exec : function(op, reg){
		return new RegExp(reg,"g").test(op);
	},
	compare : function(op1,operator,op2){
		switch (operator) {
			case "NotEqual":
				return (op1 != op2);
			case "GreaterThan":
				return (op1 > op2);
			case "GreaterThanEqual":
				return (op1 >= op2);
			case "LessThan":
				return (op1 < op2);
			case "LessThanEqual":
				return (op1 <= op2);
			default:
				return (op1 == op2);            
		}
	},
	MustChecked : function(name, min, max){
		var groups = document.getElementsByName(name);
		var hasChecked = 0;
		min = min || 1;
		max = max || groups.length;
		for(var i=groups.length-1;i>=0;i--)
			if(groups[i].checked) hasChecked++;
		return min <= hasChecked && hasChecked <= max;
	},
	DoFilter : function(input, filter){
return new RegExp("^.+\.(?=EXT)(EXT)$".replace(/EXT/g, filter.split(/\s*,\s*/).join("|")), "gi").test(input);
	},
	IsIdCard : function(number){
		var date, Ai;
		var verify = "10x98765432";
		var Wi = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
		var area = ['','','','','','','','','','','','北京','天津','河北','山西','内蒙古','','','','','','辽宁','吉林','黑龙江','','','','','','','','上海','江苏','浙江','安微','福建','江西','山东','','','','河南','湖北','湖南','广东','广西','海南','','','','重庆','四川','贵州','云南','西藏','','','','','','','陕西','甘肃','青海','宁夏','新疆','','','','','','台湾','','','','','','','','','','香港','澳门','','','','','','','','','国外'];
		var re = number.match(/^(\d{2})\d{4}(((\d{2})(\d{2})(\d{2})(\d{3}))|((\d{4})(\d{2})(\d{2})(\d{3}[x\d])))$/i);
		if(re == null) return false;
		if(re[1] >= area.length || area[re[1]] == "") return false;
		if(re[2].length == 12){
			Ai = number.substr(0, 17);
			date = [re[9], re[10], re[11]].join("-");
		}
		else{
			Ai = number.substr(0, 6) + "19" + number.substr(6);
			date = ["19" + re[4], re[5], re[6]].join("-");
		}
		if(!this.IsDate(date, "ymd")) return false;
		var sum = 0;
		for(var i = 0;i<=16;i++){
			sum += Ai.charAt(i) * Wi[i];
		}
		Ai +=  verify.charAt(sum%11);
		return (number.length ==15 || number.length == 18 && number == Ai);
	},
	IsDate : function(op, formatString){
		formatString = formatString || "ymd";
		var m, year, month, day;
		switch(formatString){
			case "ymd" :
				m = op.match(new RegExp("^((\\d{4})|(\\d{2}))([-./])(\\d{1,2})\\4(\\d{1,2})$"));
				if(m == null ) return false;
				day = m[6];
				month = m[5]*1;
				year =  (m[2].length == 4) ? m[2] : GetFullYear(parseInt(m[3], 10));
				break;
			case "dmy" :
				m = op.match(new RegExp("^(\\d{1,2})([-./])(\\d{1,2})\\2((\\d{4})|(\\d{2}))$"));
				if(m == null ) return false;
				day = m[1];
				month = m[3]*1;
				year = (m[5].length == 4) ? m[5] : GetFullYear(parseInt(m[6], 10));
				break;
			default :
				break;
		}
		if(!parseInt(month)) return false;
		month = month==0 ?12:month;
		var date = new Date(year, month-1, day);
        return (typeof(date) == "object" && year == date.getFullYear() && month == (date.getMonth()+1) && day == date.getDate());
		function GetFullYear(y){return ((y<30 ? "20" : "19") + y)|0;}
	}
 }





/*  ------------------------------------------------------------------------
                                TongXue | error_data.js
    ------------------------------------------------------------------------  */




var
noErr=0,kError_ErrorTool_BadErrorName=1337001,kError_ErrorTool_DuplicateErrorName=1337002,kError_ErrorTool_BadNamespaceName=1337003,kError_ErrorTool_BadErrorID=1337004,kError_ErrorTool_DuplicateNamespaceName=1337005,kError_ErrorTool_BadNamespaceID=1337006,kError_ErrorTool_WriteFailed=1337007,kError_ErrorTool_BadServiceName=1337008,kError_ErrorTool_RequestFailed=1337009,kError_ErrorTool_TempWriteFailed=1337010,kError_ErrorTool_LintFailed=1337011,kError_Account_IncorrectPassword=1340001,kError_Account_NotAuthenticated=1340002,kError_Account_MissingPassword=1340003,kError_Profile_InvalidAttribute=1341001,kError_Database_WriteFailed=1342001,kError_Account_NotLoggedIn=1340004,kError_Global_ValidationError=1346001,kError_Mobile_Error=1347001,kError_Login_DownError=1348001,kError_Login_ExternalLoginError=1348002,kError_Login_NoCookies=1348003,kError_Login_DeveloperLoginError=1348004,kError_Login_ZiddioContestMessage=1348005,kError_Login_OneTimeCodeMessage=1348006,kError_Login_MustLogInToSeeMessage=1348007,kError_Platform_NotLoggedIn=1349001,kError_Platform_NoAppInfoForAppID=1349002,kError_Platform_LoginError=1349003,kError_Login_ReactivateAccountMessage=1348008,kError_Login_GenericError=1348009,kError_Login_CreatorAccountError=1348010,kError_Login_NotComfirmedError=1348012,kError_Login_AccountDeactivatedError=1348013,kError_Login_AccountMergedError=1348014,kError_Login_AccountMergingError=1348015,kError_TPS_NoTicketId=1350001,kError_TPS_InvalidTicketStatus=1350002,kError_TPS_FailedUpdateTicketStatus=1350003,kError_TPS_FailedUpdateTicketSubject=1350004,kError_TPS_FailedUpdateTicketOwner=1350005,kError_TPS_FailedUpdateTicketQueue=1350006,kError_Login_IncorrectEmailOrPasswordError=1348016,kError_Login_PasswordsCaseSensitiveSubError=1348017,kError_TPS_FailedCorrespondOut=1350007,kError_TPS_EmptyCorrespondence=1350008,kError_TPS_FailedTicketRefresh=1350009,kError_Registration_LoginViaReg=1351001,kError_TPS_WarnUserFailedBadParams=1350010,kError_TPS_WarnUserFailedBadCall=1350011,kError_debategroups_alreadyVoted=1352001,kError_Payment_CardAlreadyDisabled=1353001,kError_Payment_PaymentException=1353002,kError_Payment_InvalidRequest=1353003,kError_TPS_UserHasTicket=1350013,kError_TPS_TicketAssociateBadParams=1350014,kError_TPS_TicketAssociateFailed=1350015,kError_TPS_EmailHasTicket=1350016,kError_Level1_NotEnabled=1354001,kError_Level1_CouldNotConnectToQueueDB=1354002,kError_Level1_QueueCommitFailed=1354003,kError_Level1_TransactionBeginFailed=1354004,kError_Level1_DirtyQueueSelectFailed=1354005,kError_Level1_NoDirtyKeys=1354006,kError_Level1_DispatchCreationFailed=1354007,kError_Level1_DirtyQueueUpdateFailed=1354008,kError_Level1_TransactionCommitFailed=1354009,kError_Level1_DispatchQueueSelectFailed=1354010,kError_Level1_NothingToDispatch=1354011,kError_TPS_FailedConfirmUser=1350017,kError_TPS_FailedResetPassword=1350018,kError_TPS_UnknownSimpleCommand=1350019,kError_TPS_NameChangeFailed=1350020,kError_TPS_InvalidBdayDate=1350021,kError_TPS_InvalidBdayUserTooYoung=1350022,kError_TPS_InvalidBdayPedophile=1350023,kError_TPS_BdayChangeGeneralFailure=1350024,kError_TPS_TicketAssociateMergeFailed=1350025,kError_TPS_TicketAssociateSimpleFailed=1350026,kError_TPS_TicketAssociateUnspecifiedError=1350027,kError_TPS_TicketAssociateRemoveUIDFailed=1350028,kError_TPS_VerificationScoreUpdateFailed=1350029,kError_TPS_AffilAddUseReAdd=1350030,kError_TPS_AffilAddEmailRequired=1350031,kError_TPS_AffilAddFailed=1350032,kError_TPS_AffilConfirmFailed=1350033,kError_TPS_AffilRemoveFailed=1350034,kError_TPS_AffilPendingFailed=1350035,kError_TPS_AffilReaddFailure=1350036,kError_TPS_AffilsUpdateError=1350037,kError_TPS_AffilWidgetUnknownAction=1350038,kError_TPS_AccountChangeFailedDark=1350039,kError_Chat_SendPermissions=1356001,kError_Chat_NotAvailable=1356002,kError_Chat_SendOtherNotAvailable=1356003,kError_Chat_Unknown=1356004,kError_Async_NotLoggedIn=1357001,kError_Async_NotInternUser=1357002,kError_TPS_TicketAttachBadParams=1350040,kError_TPS_TicketAttachGetPendingFailed=1350041,kError_Chat_MessageTooLong=1356005,kError_Payment_RefundExceedsAmount=1353004,kError_Payment_RefundAmountNotSupported=1353005,kError_Database_DatabaseDown=1342002,kError_TPS_AffilAddHSUserTooOld=1350042,kError_Admanager_ActionFailed=1359001,kError_Admanager_UpdateFailed=1359002,kError_Calendar_LackEditPermission=1360001,kError_Calendar_GenericError=1360002,kError_CSDC_Disabled=1361001,kError_Calendar_CannotJoinPrivate=1360003,kError_Reviews_UpdateFailed=1362001,kError_Reviews_CreateFailed=1362002,kError_Global_FailedCaptcha=1346002,kError_Payment_RefundMerchantCheck=1353006,kError_Video_TagExists=1363001,kError_Video_TagFailed=1363002,kError_Video_TagLimitReached=1363003,kError_Calendar_CannotSeeItem=1360004,kError_Calendar_PrivateCalendar=1360005,kError_Async_LoginChanged=1357003,kError_Calendar_CannotInviteOthers=1360006,kError_Mobile_CarrierInputDuplicate=1347002,kError_Mobile_NoData=1347003,kError_Ratings_MissingRequiredParams=1365001,kError_Ratings_InvalidContest=1365002,kError_Ratings_InvalidTarget=1365003,kError_Ratings_ContestNotRunning=1365004,kError_Ratings_NoTargetsFound=1365005,kError_Ratings_TargetTrojan=1365006,kError_Ratings_InvalidScore=1365007,kError_TPS_TicketAddCCFailed=1350043,kError_TPS_TicketRemoveCCFailed=1350044,kError_TPS_QueueAddCCFailed=1350045,kError_TPS_QueueRemoveCCFailed=1350046,kError_TPS_NoQueueId=1350047,kError_TPS_CCEditNoActionSpecified=1350048,kError_Global_ContentError=1346003,kError_Mobile_StatusUpdatesPrivacy=1347004;




/*  ------------------------------------------------------------------------
                                TongXue | vector.js
    ------------------------------------------------------------------------  */




function Vector2(x,y,domain){copy_properties(this,{x:x,y:y,domain:domain||'pure'});};copy_properties(Vector2.prototype,{x:function(){return this.x;},y:function(){return this.y;},toString:function(){return'('+this.x+', '+this.y+')';},add:function(vx,vy){var x=this.x,y=this.y,l=arguments.length;if(l==1){if(vx.domain!='pure'){vx=vx.convertTo(this.domain);}
x+=vx.x;y+=vx.y;}else if(l==2){x+=vx;y+=arguments[1];}else{Util.warn('Vector2.add called with %d arguments, should be one (a vector) or '+'two (x and y coordinates).',l);}
return new Vector2(x,y,this.domain);},mul:function(sx,sy){if(typeof(sy)=="undefined"){sy=sx;}
return new Vector2(this.x*sx,this.y*sy,this.domain);},sub:function(v){var x=this.x,y=this.y,l=arguments.length;if(l==1){if(v.domain!='pure'){v=v.convertTo(this.domain);}
x-=v.x;y-=v.y;}else if(l==2){x-=v;y-=arguments[1];}else{Util.warn('Vector2.add called with %d arguments, should be one (a vector) or '+'two (x and y coordinates).',l);}
return new Vector2(x,y,this.domain);},distanceTo:function(v){return this.sub(v).magnitude();},magnitude:function(){return Math.sqrt((this.x*this.x)+(this.y*this.y));},toViewportCoordinates:function(){return this.convertTo('viewport');},toDocumentCoordinates:function(){return this.convertTo('document');},convertTo:function(newDomain){if(newDomain!='pure'&&newDomain!='viewport'&&newDomain!='document'){Util.error('Domain %q is not valid; legitimate coordinate domains are %q, %q, '+'%q.','pure','viewport','document');return new Vector2(0,0);}
if(newDomain==this.domain){return new Vector2(this.x,this.y,this.domain);}
if(newDomain=='pure'){return new Vector2(this.x,this.y);}
if(this.domain=='pure'){Util.error('Unable to covert a pure vector to %q coordinates; a pure vector is '+'abstract and does not exist in any document coordinate system. If '+'you need to hack around this, create the vector explicitly in some '+'document coordinate domain, by passing a third argument to the '+'constructor. But you probably don\'t, and are just using the class '+'wrong. Stop doing that.',newDomain);return new Vector2(0,0);}
var o=Vector2.getScrollPosition('document');var x=this.x,y=this.y;if(this.domain=='document'){x-=o.x;y-=o.y;}else{x+=o.x;y+=o.y;}
return new Vector2(x,y,newDomain);},setElementPosition:function(el){var p=this.convertTo('document');el.style.left=parseInt(p.x)+'px';el.style.top=parseInt(p.y)+'px';return this;},setElementDimensions:function(el){el.style.width=parseInt(this.x)+'px';el.style.height=parseInt(this.y)+'px';return this;},setElementWidth:function(el){el.style.width=this.x+'px';return this;}});copy_properties(Vector2,{compass:{east:'e',west:'w',north:'n',south:'s',center:'center',northeast:'ne',northwest:'nw',southeast:'se',southwest:'sw'},domainError:function(){Util.error('You MUST provide a coordinate system domain to Vector2.* functions. '+'Available domains are %q and %q. See the documentation for more '+'information.','document','viewport');},getEventPosition:function(e,domain){domain=domain||'document';e=event_get(e);return(new Vector2(mouseX(e),mouseY(e),'document').convertTo(domain));},getScrollPosition:function(domain){domain=domain||'document';return(new Vector2(pageScrollX(),pageScrollY(),'document').convertTo(domain));},getElementPosition:function(el,domain){domain=domain||'document';return(new Vector2(elementX(el),elementY(el),'document').convertTo(domain));},getElementDimensions:function(el){if(ua.safari()&&el.nodeName=='TR'){var tds=el.getElementsByTagName('td');var dimensions=Vector2.getElementCompassPoint(tds[tds.length-1],Vector2.compass.southeast).sub(Vector2.getElementPosition(tds[0]));return dimensions;}
var x=el.offsetWidth||0;var y=el.offsetHeight||0;return new Vector2(x,y);},getElementCompassPoint:function(el,which){which=which||Vector2.compass.southeast;var p=Vector2.getElementPosition(el);var d=Vector2.getElementDimensions(el);var c=Vector2.compass;switch(which){case c.east:return p.add(d.x,d.y*.5);case c.west:return p.add(0,d.y*.5);case c.north:return p.add(d.x*.5,0);case c.south:return p.add(d.x*.5,d.y);case c.center:return p.add(d.mul(.5));case c.northwest:return p;case c.northeast:return p.add(d.x,0);case c.southwest:return p.add(0,d.y);case c.southeast:return p.add(d);}
Util.error('Unknown compass point %s.',which);return p;},getViewportDimensions:function(){var x=(window&&window.innerWidth)||(document&&document.documentElement&&document.documentElement.clientWidth)||(document&&document.body&&document.body.clientWidth)||0;var y=(window&&window.innerHeight)||(document&&document.documentElement&&document.documentElement.clientHeight)||(document&&document.body&&document.body.clientHeight)||0;return new Vector2(x,y);},getDocumentDimensions:function(){var x=(document&&document.body&&document.body.scrollWidth)||(document&&document.documentElement&&document.documentElement.scrollWidth)||0;var y=(document&&document.body&&document.body.scrollHeight)||(document&&document.documentElement&&document.documentElement.scrollHeight)||0;return new Vector2(x,y);},scrollTo:function(v){if(!(v instanceof Vector2)){v=new Vector2(Vector2.getScrollPosition().x,Vector2.getElementPosition($(v)).y,'document');}
v=v.toDocumentCoordinates();if(window.scrollTo){window.scrollTo(v.x,v.y);}}});




/*  ------------------------------------------------------------------------
                                TongXue | poke.js
    ------------------------------------------------------------------------  */




function show_poke_dialog(to_uid,pokeback_obj,failed_captcha,poke_parent,refresh_display_obj){var dialog=new pop_dialog();dialog.show_dialog('<div class="dialog_loading">'+tx('sh:loading')+'</div>');ajax=new Ajax();ajax.onDone=function(ajax_obj,response_text){eval(response_text);if(typeof poke_init=='undefined'){return false;}
if(!poke_init.status||poke_init.warned){dialog.make_modal();}
if(poke_init.status){dialog.show_choice(poke_init.dialog_title,poke_init.dialog_contents,tx('pk01'),function(){ajax_post=new Ajax();ajax_post.onDone=function(ajax_post_obj,post_response_text){eval(post_response_text);if(typeof got_an_f!='undefined'){dialog.fade_out(100);show_poke_dialog(to_uid,null,true);return false;}
if(typeof poke_return=='undefined'){return false;}
if(pokeback_obj){var poke_parent_str=poke_parent||'sidebar_item pokes';hide_poke_obj(pokeback_obj,'ind_poke',poke_parent_str);if(refresh_display_obj){update_poke_summary(refresh_display_obj,'poke_start_index','poke_end_index','poke_total');}}
dialog.show_message(poke_init.dialog_title,poke_return.dialog_contents);if(poke_return.status){dialog.fade_out(500,1100);}};ajax_post.onFail=function(){}
var types = document.getElementsByName('poke_tpt');var poke_tpt = 9;for(i=0;i<types.length;i++){if(types[i].checked){poke_tpt = types[i].value;}}
var post_vars={'uid':to_uid,'pokeback':(pokeback_obj?'1':'0'),'poke_title':$('poke_title').value,'poke_tpt':poke_tpt};var captcha_form=ge('captcha_form');if(captcha_form){var captcha_elements=captcha_form.getElementsByTagName('input');for(var i=0;i<captcha_elements.length;i++){post_vars[captcha_elements[i].name]=captcha_elements[i].value;}}
dialog.enable_buttons(false);ajax_post.post('/ajax/poke.php',post_vars);},tx('sh:cancel-button'),function(){dialog.enable_buttons(false);generic_dialog.get_dialog(this).fade_out(100)});}else{dialog.show_message(poke_init.dialog_title,poke_init.dialog_contents);}}
ajax.onFail=function(){}
ajax.post('/ajax/poke.php',{'can_poke':to_uid,'pokeback':((typeof pokeback_obj!='undefined')?1:0),'failed_captcha':(failed_captcha?'1':'0')});return false;}
function update_poke_summary(display_obj,start,end,total){var start_count=$(start).innerHTML;var end_count=$(end).innerHTML-1;var total_count=$(total).innerHTML-1;$(end).innerHTML=end_count;$(total).innerHTML=total_count;$(display_obj).innerHTML=gen_poke_summary_text(start_count,end_count,total_count);}
function gen_poke_summary_text(start,end,total){if(total==1){return tx('pk02');}else if(total==0||end<start){return tx('pk03');}else if(end==total){return tx('pk04',{'number':total});}else{return tx('pk05',{'start':start,'end':end,'total':total});}}




/*  ------------------------------------------------------------------------
                                TongXue | addfriend.js
    ------------------------------------------------------------------------  */




function show_addfriend_dialog(to_uid,link_object,source){if(source===undefined){source='';}
return _show_addfriend_dialog(to_uid,link_object,source);}
function _show_addfriend_dialog(to_uid,link_object,source,failed_captcha,message){if(message===undefined){message='';}
var dialog=new pop_dialog();dialog.show_dialog('<div class="dialog_loading">'+tx('sh:loading')+'</div>');ajax=new Ajax();ajax.onDone=function(ajax_obj,response_text){eval(response_text);if(typeof addfriend_init=='undefined'){return false;}
if(addfriend_init.karmablocked||addfriend_init.karma_warned){dialog.make_modal();}
if(addfriend_init.karmablocked){dialog.show_choice(addfriend_init.dialog_title,addfriend_init.dialog_contents,tx('sh:close-button'),function(){generic_dialog.get_dialog(this).fade_out(100)});}else if(addfriend_init.status){dialog.show_choice(addfriend_init.dialog_title,addfriend_init.dialog_contents,tx('af03'),function(){ajax_post=new Ajax();ajax_post.onDone=function(ajax_post_obj,post_response_text){eval(post_response_text);if(typeof got_an_f!='undefined'){dialog.fade_out(100);_show_addfriend_dialog(to_uid,link_object,source,true,$('message').value);return false;}
if(typeof addfriend_return=='undefined'){return false;}
dialog.show_message(addfriend_init.dialog_title,addfriend_return.dialog_contents);if(addfriend_return.status){disableAddFriendLink(link_object);dialog.fade_out(500,1100);}else{dialog.show_choice(addfriend_init.dialog_title,addfriend_return.dialog_contents,tx('sh:confirm-button'),function(){ajax_confirmhs=new Ajax();ajax_confirmhs.onDone=function(ajax_confirmhs_obj,post_response_text){disableAddFriendLink(link_object);dialog.fade_out(100);};ajax_confirmhs.onFail=function(){}
var post_vars={'confirm_hs_pending':to_uid};ajax_confirmhs.post('/ajax/addfriend.php',post_vars);},tx('af05'),function(){ajax_rejecths=new Ajax();ajax_rejecths.onDone=function(ajax_rejecths_obj,post_response_text){disableAddFriendLink(link_object);dialog.fade_out(100);};ajax_rejecths.onFail=function(){}
var post_vars={'hs_confirm_reject':to_uid};ajax_rejecths.post('/ajax/addfriend.php',post_vars);},'',tx('af06'),function(){generic_dialog.get_dialog(this).fade_out(100)});}};ajax_post.onFail=function(){}
var post_vars={'uid':to_uid,'source':source,'message':$('message').value,'failed_captcha':(failed_captcha?'1':'0')};var captcha_form=ge('captcha_form');if(captcha_form){var captcha_elements=captcha_form.getElementsByTagName('input');for(var i=0;i<captcha_elements.length;i++){post_vars[captcha_elements[i].name]=captcha_elements[i].value;}}
ajax_post.post('/ajax/addfriend.php',post_vars);},tx('sh:cancel-button'),function(){generic_dialog.get_dialog(this).fade_out(100)});}else{dialog.show_message(addfriend_init.dialog_title,addfriend_init.dialog_contents);}}
ajax.onFail=function(){}
ajax.post('/ajax/addfriend.php',{'can_friend':to_uid,'message':message,'failed_captcha':(failed_captcha?'1':'0')});return false;}
function disableAddFriendLink(link_object){if(!link_object){return;}
var newNode=document.createElement("span");newNode.innerHTML=tx('af08');newNode.className="holder inactive";link_object.parentNode.replaceChild(newNode,link_object);}
function comment_check(content){return true;}

function click_inspect(ref){
    new Ajax().get('/ajax/page_click.php?ref=' + ref);
    return true;
}
function ajaxItemLoading(replaceid,height){
	if(height == null){
		height = 300;
	}
	ge(replaceid).innerHTML = '<table align=center width=100%><tr><td height='+height+'><div align=center><img src="http://site.tongxue.com/v4/images/animated_loading.gif" alt="载入中" /></div></td></tr></table>';	
}

function isUndefined(variable) {
	return typeof variable == 'undefined' ? true : false;
}

function ctrlEnter(event, btnId, onlyEnter) {
	if(isUndefined(onlyEnter)) onlyEnter = 0;
	if((event.ctrlKey || onlyEnter) && event.keyCode == 13) {
		$(btnId).click();
	}
}

function report(type,type_id){
	location.href = "/report/report.php?type=" + type + "&type_id=" + type_id + "&url=" + encodeURIComponent(document.location);
}