var Debug={write:function(text){if(jsDebug&&!Object.isUndefined(window.console)){console.log(text);}},dir:function(values){if(jsDebug&&!Object.isUndefined(window.console)&&!Prototype.Browser.IE&&!Prototype.Browser.Opera){console.dir(values);}},error:function(text){if(jsDebug&&!Object.isUndefined(window.console)){console.error(text);}},warn:function(text){if(jsDebug&&!Object.isUndefined(window.console)){console.warn(text);}},info:function(text){if(jsDebug&&!Object.isUndefined(window.console)){console.info(text);}}};Prototype.Browser.IE6=Prototype.Browser.IE&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==6;Prototype.Browser.IE7=Prototype.Browser.IE&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==7;Prototype.Browser.IE8=Prototype.Browser.IE&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==8;Prototype.Browser.IE9=Prototype.Browser.IE&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==9;Prototype.Browser.Chrome=Prototype.Browser.WebKit&&(navigator.userAgent.indexOf('Chrome/')>-1);function isBody(element){return element.nodeName.toUpperCase()==='BODY';} function isHtml(element){return element.nodeName.toUpperCase()==='HTML';} function isDocument(element){return element.nodeType===Node.DOCUMENT_NODE;} function isDetached(element){return element!==document.body&&!Element.descendantOf(element,document.body);} Element.Methods.getOffsetParent=function(element){element=$(element);if(isDocument(element)||isDetached(element)||isBody(element)||isHtml(element)) return $(document.body);if(Prototype.Browser.IE){if(element.offsetParent&&element.offsetParent!=document.body&&Element.getStyle(element.offsetParent,'position')!='static')return $(element.offsetParent);if(element==document.body)return $(element);}else{var isInline=(Element.getStyle(element,'display')==='inline');if(!isInline&&element.offsetParent&&Element.getStyle(element.offsetParent,'position')!='static')return $(element.offsetParent);} while((element=element.parentNode)&&element!==document.body){if(Element.getStyle(element,'position')!=='static'){return isHtml(element)?$(document.body):$(element);}} return $(document.body);} window.IPBoard=Class.create({namePops:[],topicPops:[],vars:[],lang:[],templates:[],editors:$A(),initDone:false,initialize:function() {Debug.write("IPB js is loading...");document.observe("dom:loaded",function(){this.Cookie.init();Ajax.Responders.register({onLoading:function(handler){if(!Object.isUndefined(handler['options']['hideLoader'])&&handler['options']['hideLoader']!=false){return;} if(!$('ajax_loading')){if(!ipb.templates['ajax_loading']){return;} $('ipboard_body').insert(ipb.templates['ajax_loading']);} var effect=new Effect.Appear($('ajax_loading'),{duration:0.2});},onComplete:function(){if(!$('ajax_loading')||!$('ajax_loading').visible()){return;} var effect=new Effect.Fade($('ajax_loading'),{duration:0.2});if(!Object.isUndefined(ipb.hoverCard)){ipb.hoverCardRegister.postAjaxInit();} $$("[data-clicklaunch]").invoke('clickLaunch');},onSuccess:function(){if(!Object.isUndefined(ipb.hoverCard)){ipb.hoverCardRegister.postAjaxInit();}},onFailure:function(t) {if(!$('ajax_loading')||!$('ajax_loading').visible()){return;} var effect=new Effect.Fade($('ajax_loading'),{duration:0.2});if(!Object.isUndefined(ipb.global)) {ipb.global.showInlineNotification(ipb.lang['ajax_failure']);}},onException:function(t,exception) {if(!$('ajax_loading')||!$('ajax_loading').visible()){return;} var effect=new Effect.Fade($('ajax_loading'),{duration:0.2});Debug.error(exception);if(!Object.isUndefined(ipb.global)) {}}});ipb.delegate.initialize();ipb.initDone=true;}.bind(this));},positionCenter:function(elem,dir) {if(!$(elem)){return;} elem_s=$(elem).getDimensions();window_s=document.viewport.getDimensions();window_offsets=document.viewport.getScrollOffsets();center={left:((window_s['width']-elem_s['width'])/2),top:((window_s['height']-elem_s['height'])/2)};if(typeof(dir)=='undefined'||(dir!='h'&&dir!='v')) {$(elem).setStyle('top: '+center['top']+'px; left: '+center['left']+'px');} else if(dir=='h') {$(elem).setStyle('left: '+center['left']+'px');} else if(dir=='v') {$(elem).setStyle('top: '+center['top']+'px');} $(elem).setStyle('position: fixed');},showModal:function() {if(!$('ipb_modal')) {this.createModal();} this.modal.show();},hideModal:function() {if(!$('ipb_modal')){return;} this.modal.hide();},createModal:function() {this.modal=new Element('div',{id:'ipb_modal'}).hide().addClassName('modal');this.modal.setStyle("width: 100%; height: 100%; position: fixed; top: 0px; left: 0px; overflow: hidden; z-index: 1000; opacity: 0.2");$('ipboard_body').insert({bottom:this.modal});},editorInsert:function(content,editorid) {if(!editorid){var editor=ipb.textEditor.getEditor();}else{var editor=ipb.textEditor.getEditor(editorid);} if(Object.isUndefined(editor)) {var editor=ipb.textEditor.getEditor();} editor.insert(content);}});IPBoard.prototype.delegate={store:$A(),initialize:function() {document.observe('click',function(e){if(Event.isLeftClick(e)||Prototype.Browser.IE||ipb.vars['is_touch']) {var elem=null;var handler=null;var target=ipb.delegate.store.find(function(item){elem=e.findElement(item['selector']);if(elem){handler=item;return true;}else{return false;}});if(!Object.isUndefined(target)) {if(handler) {Debug.write("Firing callback for selector "+handler['selector']);handler['callback'](e,elem,handler['params']);}}}});},register:function(selector,callback,params) {ipb.delegate.store.push({selector:selector,callback:callback,params:params});}};IPBoard.prototype.Cookie={store:[],initDone:false,set:function(name,value,sticky) {var expires='';var path='/';var domain='';if(!name) {return;} if(sticky) {if(sticky==1) {expires="; expires=Wed, 1 Jan 2020 00:00:00 GMT";} else if(sticky==-1) {expires="; expires=Thu, 01-Jan-1970 00:00:01 GMT";} else if(sticky.length>10) {expires="; expires="+sticky;}} if(ipb.vars['cookie_domain']) {domain="; domain="+ipb.vars['cookie_domain'];} if(ipb.vars['cookie_path']) {path=ipb.vars['cookie_path'];} document.cookie=ipb.vars['cookie_id']+name+"="+escape(value)+"; path="+path+expires+domain+';';ipb.Cookie.store[name]=value;Debug.write("Set cookie: "+ipb.vars['cookie_id']+name+"="+value+"; path="+path+expires+domain+';');},get:function(name) {if(ipb.Cookie.initDone!==true) {ipb.Cookie.init();} if(ipb.Cookie.store[name]) {return ipb.Cookie.store[name];} return'';},doDelete:function(name) {Debug.write("Deleting cookie "+name);ipb.Cookie.set(name,'',-1);},init:function() {if(ipb.Cookie.initDone) {return true;} skip=['session_id','ipb_admin_session_id','member_id','pass_hash'];cookies=$H(document.cookie.replace(" ",'').toQueryParams(";"));if(cookies) {cookies.each(function(cookie){cookie[0]=cookie[0].strip();if(ipb.vars['cookie_id']!='') {if(!cookie[0].startsWith(ipb.vars['cookie_id'])) {return;} else {cookie[0]=cookie[0].replace(ipb.vars['cookie_id'],'');}} if(skip[cookie[0]]) {return;} else {ipb.Cookie.store[cookie[0]]=unescape(cookie[1]||'');Debug.write("Loaded cookie: "+cookie[0]+" = "+cookie[1]);}});} ipb.Cookie.initDone=true;}};IPBoard.prototype.validate={isFilled:function(elem) {if(!$(elem)){return null;} return!$F(elem).blank();},isNumeric:function(elem) {if(!$(elem)){return null;} return $F(elem).match(/^[\d]+?$/);},isMatching:function(elem1,elem2) {if(!$(elem1)||!$(elem2)){return null;} return $F(elem1)==$F(elem2);},email:function(elem) {if(!$(elem)){return null;} if($F(elem).match(/^.+@.+\..{2,4}$/)){return true;}else{return false;}}};IPBoard.prototype.Autocomplete=Class.create({initialize:function(id,options) {this.id=$(id).id;this.timer=null;this.last_string='';this.internal_cache=$H();this.pointer=0;this.items=$A();this.observing=true;this.objHasFocus=null;this.options=Object.extend({min_chars:3,multibox:false,global_cache:false,goToUrl:false,classname:'ipb_autocomplete',templates:{wrap:new Template("
    "),item:new Template("
  • #{itemvalue}
  • ")}},arguments[1]||{});if(!$(this.id)){Debug.error("Invalid textbox ID");return false;} this.obj=$(this.id);if(!this.options.url) {Debug.error("No URL specified for autocomplete");return false;} $(this.obj).writeAttribute('autocomplete','off');this.buildList();$(this.obj).observe('focus',this.timerEventFocus.bindAsEventListener(this));$(this.obj).observe('blur',this.timerEventBlur.bindAsEventListener(this));$(this.obj).observe('keypress',this.eventKeypress.bindAsEventListener(this));},eventKeypress:function(e) {if(![Event.KEY_TAB,Event.KEY_UP,Event.KEY_DOWN,Event.KEY_LEFT,Event.KEY_RIGHT,Event.KEY_RETURN].include(e.keyCode)){return;} console.log(e.shiftKey);if(e.shiftKey===true){return;} if($(this.list).visible()) {switch(e.keyCode) {case Event.KEY_TAB:case Event.KEY_RETURN:this.selectCurrentItem(e);break;case Event.KEY_UP:case Event.KEY_LEFT:this.selectPreviousItem(e);break;case Event.KEY_DOWN:case Event.KEY_RIGHT:this.selectNextItem(e);break;} Event.stop(e);}},selectCurrentItem:function(e) {var current=$(this.list).down('.active');this.unselectAll();if(!Object.isUndefined(current)) {var itemid=$(current).id.replace(this.id+'_ac_item_','');if(!itemid){return;} if(this.options.goToUrl&&$(current).readAttribute('data-url')) {window.location=$(current).readAttribute('data-url');return false;} var value=this.items[itemid].replace('&','&').replace(/'/g,"'").replace(/>/g,'>').replace(/</g,'<').replace(/!/g,'!');if(this.options.multibox) {if($F(this.obj).indexOf(',')!==-1) {var pieces=$F(this.obj).split(',');pieces[pieces.length-1]='';$(this.obj).value=pieces.join(',')+' ';} else {$(this.obj).value='';$(this.obj).focus();} $(this.obj).value=$F(this.obj)+value+', ';} else {$(this.obj).value=value;var effect=new Effect.Fade($(this.list),{duration:0.3});}} $(this.obj).focus();if(Prototype.Browser.IE) {if($(this.obj).createTextRange) {var r=$(this.obj).createTextRange();r.moveStart("character",$(this.obj).value.length);r.select();}}},selectThisItem:function(e) {this.unselectAll();var items=$(this.list).immediateDescendants();var elem=Event.element(e);while(!items.include(elem)) {elem=elem.up();} $(elem).addClassName('active');},selectPreviousItem:function(e) {var current=$(this.list).down('.active');this.unselectAll();if(Object.isUndefined(current)) {this.selectFirstItem();} else {var prev=$(current).previous();if(prev){$(prev).addClassName('active');} else {this.selectLastItem();}}},selectNextItem:function(e) {var current=$(this.list).down('.active');this.unselectAll();if(Object.isUndefined(current)){this.selectFirstItem();} else {var next=$(current).next();if(next){$(next).addClassName('active');} else {this.selectFirstItem();}}},selectFirstItem:function() {if(!$(this.list).visible()){return;} this.unselectAll();$(this.list).firstDescendant().addClassName('active');},selectLastItem:function() {if(!$(this.list).visible()){return;} this.unselectAll();var d=$(this.list).immediateDescendants();var l=d[d.length-1];if(l) {$(l).addClassName('active');}},unselectAll:function() {$(this.list).childElements().invoke('removeClassName','active');},timerEventBlur:function(e) {window.clearTimeout(this.timer);this.eventBlur.bind(this).delay(0.6,e);},timerEventFocus:function(e) {this.timer=this.eventFocus.bind(this).delay(0.4,e);},eventBlur:function(e) {this.objHasFocus=false;if($(this.list).visible()) {var effect=new Effect.Fade($(this.list),{duration:0.3});}},eventFocus:function(e) {if(!this.observing){Debug.write("Not observing keypress");return;} this.objHasFocus=true;this.timer=this.eventFocus.bind(this).delay(0.6,e);var curValue=this.getCurrentName();if(curValue==this.last_string){return;} if(curValue.length");},boot:function() {$A(document.getElementsByTagName("script")).findAll(function(s) {return(s.src&&s.src.match(/ipb\.js(\?.*)?$/));}).each(function(s){var path=s.src.replace(/ipb\.js(\?.*)?$/,'');var includes=s.src.match(/\?.*load=([a-zA-Z0-9_,]*)/);if(!Object.isUndefined(includes)&&includes!=null&&includes[1]) {includes[1].split(',').each(function(include) {if(include) {Loader.require(path+"ips."+include);}});}});}};var callback={afterOpen:function(popup){try{$('pj_'+$(elem).identify()+'_input').activate();} catch(err){}}};Element.addMethods({defaultize:function(element,lang) {if(ipb.global._supportsPlaceholder==null){ipb.global._supportsPlaceholder=(function(){var i=document.createElement('input');return'placeholder'in i;})();} if(ipb.global._supportsPlaceholder){if($F(element)==lang||$F(element).empty()){$(element).removeClassName('inactive').writeAttribute('placeholder',lang).value='';}}else{if($F(element)==lang||$F(element).empty()){$(element).addClassName('inactive').value=lang;} $(element).observe('focus',function(e){if($(element).hasClassName('inactive')&&($F(element)==''||$F(element)==lang)){$(element).removeClassName('inactive').value='';}else{$(element).removeClassName('inactive');}}).observe('blur',function(e){if($F(element).empty()){$(element).addClassName('inactive').value=lang;}});var form=$(element).up('form');if(!Object.isUndefined(form)){$(form).observe('submit',function(e){if($(element).hasClassName('inactive')){$(element).value='';}});}}},clickLaunch:function(element) {var _callback=$(element).readAttribute("data-clicklaunch");var _scope='global';try{var _try=$(element).readAttribute("data-scope");_scope=(_try)?_try.replace("ipb.",''):_scope;}catch(e){};if($(element).retrieve('clickevent')){try{$(element).retrieve('clickevent').stop();}catch(err){};} var click=$(element).on('click',function(e){Event.stop(e);ipb[_scope][_callback](element,e);});$(element).store('clickevent',click);},confirmAction:function(element) {var _text=$(element).readAttribute("data-confirmaction");var _ok='';if(element.tagName=='FORM') {_ok="$('"+element.id+"').submit()";} else {_ok='window.location=\''+element.readAttribute('href')+'\'';} if(!_text||_text=='true') {_text=ipb.lang['gbl_confirm_desc'];} var _options={type:'pane',modal:true,initial:'

    '+ipb.lang['gbl_confirm_text']+'

    '+_text+'


    '+ipb.lang['gbl_confirm_cancel']+'   '+ipb.lang['gbl_confirm_ok']+'
    ',hideAtStart:false,w:'300px',h:150};if(element.tagName=='FORM') {if(!Object.isUndefined(ipb.global.popups['conact'])) {ipb.global.popups['conact'].kill();} ipb.global.popups['conact']=new ipb.Popup('confirm',_options);} else {$(element).on('click',function(e) {Event.stop(e);if(!Object.isUndefined(ipb.global.popups['conact'])) {ipb.global.popups['conact'].kill();} ipb.global.popups['conact']=new ipb.Popup('confirm',_options);});}},tooltip:function(element,options){options=Object.extend({template:new Template(""),position:'auto',content:$(element).readAttribute("data-tooltip"),animate:true,overrideBrowser:true,delay:0.4},options);var show=function(e){if(options.delay&&!options._still_going){return;} if(!options.content){return;} var id=$(element).identify();if(!$(id+'_tooltip')){$(document.body).insert({'bottom':options.template.evaluate({'id':id+'_tooltip','content':options.content})});} if(options.overrideBrowser&&$(element).hasAttribute('title')){$(element).writeAttribute("data-title",$(element).readAttribute('title')).writeAttribute("title",false);} var tooltip=$(id+'_tooltip').setStyle({position:'absolute'});var layout=$(element).getLayout();var position=$(element).cumulativeOffset();var dims=$(id+'_tooltip').getDimensions();var docDim=$(document.body).getLayout();if(options.position=='auto'){if(position.left+(layout.get('padding-box-width')/2)-(dims.width/2)<0){options.position='right';}else if(position.left+(dims.width/2)>docDim.get('width')){options.position='left';}else{options.position='top';}} Debug.write(dims);switch(options.position){case'top':$(tooltip).setStyle({top:(position.top-dims.height-1)+'px',left:(position.left+(layout.get('padding-box-width')/2)-(dims.width/2))+'px'}).addClassName('top');break;case'bottom':$(tooltip).setStyle({top:(position.top+layout.get('padding-box-height')+1)+'px',left:(position.left+(layout.get('padding-box-width')/2)-(dims.width/2))+'px'}).addClassName('bottom');break;case'left':$(tooltip).setStyle({top:(position.top-(layout.get('padding-box-height')/2))+'px',left:(position.left-dims.width-3)+'px'}).addClassName('left');break;case'right':$(tooltip).setStyle({top:(position.top-(layout.get('padding-box-height')/2))+'px',left:(position.left+layout.get('padding-box-width')-3)+'px'}).addClassName('right');break;} if(options.animate){new Effect.Appear($(tooltip),{duration:0.3,queue:'end'});}else{$(tooltip).show();}},hide=function(e){var id=$(element).identify();if(!$(id+'_tooltip')){return;} if(options.animate){new Effect.Fade($(id+'_tooltip'),{duration:0.2,queue:'end'});}else{$(id+'_tooltip').hide();}};$(element).observe("mouseenter",function(e){if(options.delay){options._still_going=true;show.delay(options.delay,e);}else{show(e);}}).observe("click",function(e){options._still_going=false;hide();}).observe("mouseleave",function(e) {options._still_going=false;hide();});}});var _global=window.IPBoard;_global.prototype.global={searchTimer:[],searchLastQuery:'',rssItems:[],reputation:{},popups:{},ac_cache:$H(),pageJumps:$H(),pageJumpMenus:$H(),boardMarkers:$H(),searchResults:$H(),tidPopOpen:0,activeTab:'forums',userCards:null,inlineNotification:{timers:[]},_supportsPlaceholder:null,init:function() {Debug.write("Initializing ips.global.js");document.observe("dom:loaded",function(){ipb.global.initEvents();});},initEvents:function() {ipb.delegate.register(".warn_link",ipb.global.displayWarnLogs);ipb.delegate.register(".mini_friend_toggle",ipb.global.toggleFriend);ipb.delegate.register(".__topic_preview",ipb.global.topicPreview);ipb.delegate.register('.bbc_spoiler_show',ipb.global.toggleSpoiler);ipb.delegate.register('a[rel~="external"]',ipb.global.openNewWindow);ipb.delegate.register('._repLikeMore',ipb.global.repLikeMore);ipb.delegate.register('a[rel~="quickNavigation"]',ipb.global.openQuickNavigation);if($('sign_in')&&!$('sign_in').hasClassName('no_ajax')){$('sign_in').on('click',ipb.global.inlineSignin);} if($('rss_feed')){ipb.global.buildRSSmenu();} if(!Object.isUndefined(ipb.vars['notificationData'])) {new ipb.Popup('navigation_popup',{type:'modal',initial:ipb.templates['notificationTemplate'].evaluate(ipb.vars['notificationData']),hideAtStart:false,w:'600px',h:250});} if($('backtotop')){$('backtotop').observe("click",function(e){Event.stop(e);window.scroll(0,0);});} ipb.global.buildPageJumps();ipb.global.initUserCards();if(!Object.isUndefined(ipb.templates['inlineMsg'])&&ipb.templates['inlineMsg']!=''){ipb.global.showInlineNotification(ipb.templates['inlineMsg']);} if($('search-box')){ipb.global.contextualSearch();} if($('user_link')){new ipb.Menu($('user_link'),$('user_link_menucontent'));} if($('new_skin')){new ipb.Menu($('new_skin'),$('new_skin_menucontent'));} if($('new_language')){new ipb.Menu($('new_language'),$('new_language_menucontent'));} if($('mark_all_read')){new ipb.Menu($('mark_all_read'),$('mark_all_read_menucontent'));} $$("[data-tooltip]").invoke('tooltip');$$("[data-clicklaunch]").invoke('clickLaunch');$$("[data-confirmaction]").invoke('confirmAction');if($('statusUpdateGlobal')){$('statusUpdateGlobal').defaultize(ipb.lang['global_status_update']);$('statusSubmitGlobal').observe('click',ipb.global.statusUpdated);} $$('a.resized_img').each(function(elem) {if($(elem).previous('a.bbc_url')) {var test=$(elem).previous('a.bbc_url');if(!test.innerHTML.length) {$(elem).writeAttribute('href',test.href);$(elem).writeAttribute('rel',test.rel);test.remove();}}});if(!Object.isUndefined(ipb.hoverCard)&&ipb.vars['is_touch']===false) {var ajaxUrl=ipb.vars['base_url']+"app=core&module=ajax§ion=tags&do=getTagsAsPopUp&md5check="+ipb.vars['secure_hash'];ipb.hoverCardRegister.initialize('tagsPopUp',{'w':'500px','delay':750,'position':'auto','ajaxUrl':ajaxUrl,'getId':true,'setIdParam':'key'});}},lightBoxIsOff:function() {$$('span[rel*="lightbox"]').each(function(elem) {if(!$(elem).down('a')) {$(elem).down('img').on('click',function(e,el){window.open(el.src)});}});},saveSocialShareDefaults:function(elem,e) {var services={};$$('._share_x_').each(function(elem){services[elem.id.replace(/share_x_/,'')]=(elem.checked)?1:0;});new Ajax.Request(ipb.vars['base_url']+"app=core§ion=sharelinks&module=ajax&do=savePostPrefs&md5check="+ipb.vars['secure_hash'],{method:'post',evalJSON:'force',parameters:services,onSuccess:function(t) {if(Object.isUndefined(t.responseJSON)) {alert(ipb.lang['action_failed']);return;} if(!Object.isUndefined(t.responseJSON['error'])) {alert(t.responseJSON['error']);} else {}}});}, /*! statusUpdated */ statusUpdated:function(e) {Event.stop(e);if($('statusUpdateGlobal').value.length<2||$('statusUpdateGlobal').value==ipb.lang['prof_update_default']) {return false;} var su_Twitter=$('su_TwitterGlobal')&&$('su_TwitterGlobal').checked?1:0;var su_Facebook=$('su_FacebookGlobal')&&$('su_FacebookGlobal').checked?1:0;new Ajax.Request(ipb.vars['base_url']+"app=members§ion=status&module=ajax&do=new&md5check="+ipb.vars['secure_hash']+"&skin_group=boards&return=json&smallSpace=1",{method:'post',evalJSON:'force',parameters:{content:$('statusUpdateGlobal').value.encodeParam(),su_Twitter:su_Twitter,su_Facebook:su_Facebook},onSuccess:function(t) {if(Object.isUndefined(t.responseJSON)) {alert(ipb.lang['action_failed']);return;} if(t.responseJSON['error']) {alert(t.responseJSON['error']);} else {try{if($('status_wrapper')) {var memberId=0;try {memberId=$('status_wrapper').readAttribute('data-member');} catch(err){} if(!memberId||(memberId==ipb.vars['member_id'])) {$('status_wrapper').innerHTML=t.responseJSON['html']+$('status_wrapper').innerHTML;if(ipb.status.myLatest) {if($('statusWrap-'+ipb.status.myLatest)) {$('statusWrap-'+ipb.status.myLatest).hide();}}}} ipb.menus.closeAll(e,true);ipb.global.showInlineNotification(ipb.lang['status_updated']);} catch(err) {Debug.error('Logging error: '+err);}}}});},changeSkin:function(element,e) {Debug.dir(element);var skinId=$(element).readAttribute('data-skinid');var url=ipb.vars['base_url']+'app=core&module=ajax§ion=skin&do=change&skinId='+skinId+'&secure_key='+ipb.vars['secure_hash'];Debug.write(url);new Ajax.Request(url,{method:'get',onSuccess:function(t) {if(t.responseJSON['status']=='ok') {window.location=window.location;window.location.reload(true);} else {ipb.global.errorDialogue(ipb.lang['ajax_failure']);}}});Event.stop(e);return false;},getInboxList:function(element,e) {if(Object.isUndefined(ipb.global.popups['inbox'])) {ipb.global.popups['inbox']=true;ipb.menus.closeAll(e);$(element).identify();$(element).addClassName('ipbmenu');$('ipboard_body').insert(ipb.templates['header_menu'].evaluate({id:'user_inbox_link_menucontent'}));$('user_inbox_link_menucontent').setStyle('width: 300px').update("
    ");var _newMenu=new ipb.Menu($(element),$("user_inbox_link_menucontent"));_newMenu.doOpen();var url=ipb.vars['base_url']+'app=members&module=ajax§ion=messenger&do=getInboxDropDown';Debug.write(url);new Ajax.Request(url,{method:'post',evalJSON:'force',hideLoader:true,parameters:{secure_key:ipb.vars['secure_hash']},onSuccess:function(t) {if(t.responseJSON['error']) {if(t.responseJSON['__board_offline__']) {ipb.global.errorDialogue(ipb.lang['board_offline']);ipb.menus.closeAll(e);}} else {$('user_inbox_link_menucontent').update(t.responseJSON['html']);try {$(element).down('.ipsHasNotifications').fade({afterFinish:function(){$(element).down('.ipsHasNotifications').show().addClassName('ipsHasNotifications_blank');}});}catch(acold){}}}});} Event.stop(e);return false;},getNotificationsList:function(element,e) {Event.stop(e);if(Object.isUndefined(ipb.global.popups['notification'])) {ipb.global.popups['notification']=true;ipb.menus.closeAll(e);$(element).identify();$(element).addClassName('ipbmenu');$('ipboard_body').insert(ipb.templates['header_menu'].evaluate({id:'user_notifications_link_menucontent'}));$('user_notifications_link_menucontent').setStyle('width: 300px').update("
    ");var _newMenu=new ipb.Menu($(element),$("user_notifications_link_menucontent"));_newMenu.doOpen();var url=ipb.vars['base_url']+'app=core&module=ajax§ion=notifications&do=getlatest';Debug.write(url);new Ajax.Request(url,{method:'post',evalJSON:'force',hideLoader:true,parameters:{secure_key:ipb.vars['secure_hash']},onSuccess:function(t) {if(t.responseJSON['error']) {if(t.responseJSON['__board_offline__']) {ipb.global.errorDialogue(ipb.lang['board_offline']);ipb.menus.closeAll(e);}} else {$('user_notifications_link_menucontent').update(t.responseJSON['html']);try {$(element).down('.ipsHasNotifications').fade({afterFinish:function(){$(element).down('.ipsHasNotifications').show().addClassName('ipsHasNotifications_blank');}});}catch(acold){}}}});} return false;},openQuickNavigation:function(e) {Event.stop(e);if(ipb.global.popups['quickNav']){ipb.global.popups['quickNav'].show();}else{var url=ipb.vars['base_url']+"app=core&module=ajax§ion=navigation&secure_key="+ipb.vars['secure_hash']+"&inapp="+ipb.vars['active_app'];ipb.global.popups['quickNav']=new ipb.Popup('navigation_popup',{type:'modal',ajaxURL:url,hideAtStart:false,w:'600px',h:460});ipb.delegate.register('a[rel~="ipsQuickNav"]',ipb.global.quickNavTabClick);} return false;},launchPhotoEditor:function(elem,e) {Event.stop(e);if(!Object.isUndefined(ipb.global.popups['photoEditor'])) {ipb.global.popups['photoEditor'].kill();} var url=ipb.vars['base_url']+"&app=members&module=ajax§ion=photo&do=show&secure_key="+ipb.vars['secure_hash'];ipb.global.popups['photoEditor']=new ipb.Popup('photo_popup',{type:'pane',modal:true,ajaxURL:url,hideAtStart:false,evalJs:'force',w:'750px',h:500});return false;},quickNavTabClick:function(e,elem) {Event.stop(e);app=elem.readAttribute('data-app');var url=ipb.vars['base_url']+"app=core&module=ajax§ion=navigation&secure_key="+ipb.vars['secure_hash']+"&do=panel&inapp="+app;new Ajax.Request(url.replace(/&/g,'&'),{method:'get',evalJSON:'force',hideLoader:true,onSuccess:function(t) {$('ipsNav_content').update(t.responseText);$$('a[rel~="ipsQuickNav"]').each(function(link) {link.up('li').removeClassName('active');var _app=link.readAttribute('data-app');if(_app==app) {link.up('li').addClassName('active');}});}});return false;},ajaxPagination:function(element,url) {new Ajax.Request(url.replace(/&/g,'&'),{method:'get',evalJSON:'force',hideLoader:true,onSuccess:function(t) {$(element).update(t.responseText);}});return false;},inlineSignin:function(e) {if(ipb.vars['is_touch']){return;} if(!$('inline_login_form')) {return;} Event.stop(e);if(ipb.global.loginRedirect) {window.location=ipb.global.loginRedirect;return;} new ipb.Popup('sign_in_popup',{type:'pane',initial:$('inline_login_form').show(),hideAtStart:false,hideClose:false,defer:false,modal:true,w:'600px'},{afterShow:function(pop){try{$('ips_username').focus();}catch(err){}}});},forumMarkRead:function(elem,e) {Event.stop(e);var id=$(elem).readAttribute("data-fid");if(!id){return;} var url=ipb.vars['base_url']+'&app=forums&module=ajax&secure_key='+ipb.vars['secure_hash']+'§ion=forums&do=markRead&fid='+id;new Ajax.Request(url,{method:'get',evalJSON:'force',onSuccess:function(t) {if(t.responseText=='no_forum'||t.responseText=='no_permission'){alert(ipb.lang['mark_read_forum']);return;} $$('.__topic').each(function(topic) {if($(topic).hasClassName('unread')) {var tid=$(topic).readAttribute("data-tid");if(tid) {ipb.global.topicRemoveUnreadElements(tid);}}});}});},topicMarkRead:function(elem,e) {Event.stop(e);var id=$(elem).readAttribute("data-tid");if(!id){return;} var row=$('trow_'+id);var url=ipb.vars['base_url']+'&app=forums&module=ajax&secure_key='+ipb.vars['secure_hash']+'§ion=topics&do=markRead&tid='+id;new Ajax.Request(url,{method:'get',evalJSON:'force',onSuccess:function(t) {if(t.responseText=='no_topic'||t.responseText=='no_permission'){alert(ipb.lang['mark_read_topic']);return;} $(elem).remove();ipb.global.topicPreview(e,row.down('.__topic_preview'));ipb.global.topicRemoveUnreadElements(id);}});},topicRemoveUnreadElements:function(tid) {$('trow_'+tid).removeClassName('unread').down('.col_f_icon').select('a img').invoke('remove');},topicPreview:function(e,elem) {Event.stop(e);var toggle=$(elem).down(".expander");var row=$(elem).up(".__topic");var id=$(row).readAttribute("data-tid");if(!id){return;} if($(row).readAttribute('loadingPreview')=='yes'){return;} $(row).writeAttribute('loadingPreview','yes');if($("topic_preview_"+id)) {if($("topic_preview_wrap_"+id).visible()) {new Effect.BlindUp($("topic_preview_wrap_"+id),{duration:0.3,afterFinish:function(){$('topic_preview_'+id).hide();}});row.removeClassName('highlighted');$(toggle).addClassName('closed').removeClassName('loading').removeClassName('open').writeAttribute('title',ipb.lang['open_tpreview']);} else {$('topic_preview_'+id).show();new Effect.BlindDown($("topic_preview_wrap_"+id),{duration:0.3});row.addClassName('highlighted');$(toggle).addClassName('open').removeClassName('loading').removeClassName('closed').writeAttribute('title',ipb.lang['close_tpreview']);} $(row).writeAttribute('loadingPreview','no');} else {var url=ipb.vars['base_url']+'&app=forums&module=ajax&secure_key='+ipb.vars['secure_hash']+'§ion=topics&do=preview&tid='+id;if(ipb.global.searchResults[id]){url+='&pid='+ipb.global.searchResults[id]['pid']+'&searchTerm='+ipb.global.searchResults[id]['searchterm'];} $(toggle).addClassName('loading').removeClassName('closed').removeClassName('open');new Ajax.Request(url,{method:'get',evalJSON:'force',onSuccess:function(t) {if(t.responseText=='no_topic'||t.responseText=='no_permission'){alert(ipb.lang['no_permission_preview']);$(toggle).addClassName('open').removeClassName('loading').removeClassName('closed').writeAttribute('title',ipb.lang['close_tpreview']);$(row).writeAttribute('loadingPreview','no');return;} if(row.tagName=="TR") {var count=row.childElements().size();var newrow=new Element('tr',{'class':'preview','id':'topic_preview_'+id});var newcell=new Element('td',{'colspan':count});var wrap=new Element('div',{'id':'topic_preview_wrap_'+id}).hide().update(new Element('div'));row.insert({after:newrow.insert(newcell.insert(wrap))});} else {var wrap=new Element('div',{'id':'topic_preview_wrap_'+id}).hide().update(new Element('div'));row.insert({after:wrap});} wrap.update(t.responseText).relativize();new Effect.BlindDown(wrap,{duration:0.3});row.addClassName('highlighted');$(toggle).addClassName('open').removeClassName('loading').removeClassName('closed').writeAttribute('title',ipb.lang['close_tpreview']);$(row).writeAttribute('loadingPreview','no');}});}},activateMainMenu:function() {if($("nav_other_apps")&&$("community_app_menu")){var start=totalW=$("nav_other_apps").getWidth()+20;var menuWidth=$("community_app_menu").getWidth();$("community_app_menu").select("li.skip_moremenu").each(function(elem){totalW+=$(elem).measure('margin-box-width');});$("community_app_menu").select("li:not(#nav_other_apps,.submenu_li)").each(function(elem){if($(elem).hasClassName('skip_moremenu')) {return;} totalW+=$(elem).measure('margin-box-width');if(totalW>=menuWidth) {if(!$("more_apps_menucontent")){$$("body")[0].insert("");} $(elem).addClassName('submenu_li').removeClassName('left');$("more_apps_menucontentul").insert(elem);}});if($("more_apps_menucontent")) {$("nav_other_apps").show();new ipb.Menu($('more_apps'),$('more_apps_menucontent'));} Debug.write(menuWidth);}},initUserCards:function() {if(!Object.isUndefined(ipb.hoverCard)&&ipb.vars['is_touch']===false&&ipb.vars['member_group']['g_mem_info']==1) {var ajaxUrl=ipb.vars['base_url']+'&app=members&module=ajax&secure_key='+ipb.vars['secure_hash']+'§ion=card';if(ipb.topic!==undefined&&ipb.topic.forum_id!==undefined) {ajaxUrl+="&f="+ipb.topic.forum_id;} ipb.hoverCardRegister.initialize('member',{'w':'500px','delay':750,'position':'auto','ajaxUrl':ajaxUrl,'getId':true,'setIdParam':'mid'});}},showInlineNotification:function(content,options) {options=(Object.isUndefined(options))?{}:options;options.showClose=(Object.isUndefined(options.manualClose))?false:options.showClose;options.neverClose=(Object.isUndefined(options.neverClose))?false:options.neverClose;options.displayForSeconds=(Object.isUndefined(options.displayForSeconds))?5:options.displayForSeconds;if($('ipsGlobalNotification')) {var span=$('ipsGlobalNotification').down('span');new Effect.Fade(span,{duration:0.8,afterFinish:function(){span.replace(new Element('span').update(content));new Effect.Appear($('ipsGlobalNotification').down('span'),{duration:0.8});}});} else {if($('ipbwrapper')) {$('ipbwrapper').insert(new Element('div',{id:'ipsGlobalNotification'}).update(ipb.templates['global_notify'].evaluate({'message':content})));} else {$('ipboard_body').insert(new Element('div',{id:'ipsGlobalNotification'}).update(ipb.templates['global_notify'].evaluate({'message':content,'close':ipb.templates['global_notify_close']})));} new Effect.Appear('ipsGlobalNotification',{duration:1.5});if(options.showClose) {$('ipsGlobalNotification').insert(new Element('div',{id:'ipsGlobalNotification_close'}));$('ipsGlobalNotification_close').observe('click',ipb.global.closeInlineNotification);} else if($('ipsGlobalNotification_close')) {$('ipsGlobalNotification_close').observe('click',ipb.global.closeInlineNotification);}} $('ipsGlobalNotification').on('click','span a',ipb.global.closeInlineNotification);if(options.neverClose!==true) {try{clearTimeout(ipb.global.inlineNotification['timers']['close']);} catch(e){} ipb.global.inlineNotification['timers']['close']=setTimeout(ipb.global.closeInlineNotification,options.displayForSeconds*1000);}},closeInlineNotification:function() {if($('ipsGlobalNotification_close')){$('ipsGlobalNotification_close').stopObserving('click');} try{clearTimeout(ipb.global.inlineNotification['timers']['close']);} catch(e){} new Effect.Fade('ipsGlobalNotification',{duration:1.0});setTimeout(function(){$('ipsGlobalNotification').remove();},2000);},errorDialogue:function(text) {errContent="

    "+ipb.lang['error_occured']+"

    "+text+"

    ";new ipb.Popup('generic__errorDialogue',{type:'pane',initial:errContent,stem:true,hideAtStart:false,hideClose:false,defer:false,warning:false,w:400});},okDialogue:function(text) {okContent="

    "+ipb.lang['success']+"

    "+text+"

    ";new ipb.Popup('generic__okDialogue',{type:'pane',initial:okContent,stem:true,hideAtStart:false,hideClose:false,defer:false,w:400});},contextualSearch:function() {if(!$('search_options')&&!$('search_options_menucontent')){return;} if(!$('main_search')) {return;} $('main_search').defaultize(ipb.lang['search_default_value']);$('search').select('.submit_input').find(function(elem){$(elem).value='';});var update=function(noSelect) {var checked=$('search_options_menucontent').select('input').find(function(elem){return $(elem).checked;});if(Object.isUndefined(checked)){checked=$('search_options_menucontent').select('input:first')[0];if(!checked){return;} checked.checked=true;} $('search_options').show().update($(checked).up('label').readAttribute('title')||'');if(noSelect!=true){$('main_search').focus();} return true;};update(true);$('search_options_menucontent').select('input').invoke('observe','click',update);},fetchTid:function(e) {var elem=Event.element(e);elem.identify();if(!elem.hasClassName('__topic')) {elem=elem.up('.__topic');} var id=elem.id;if(!id||!$(id)) {return 0;} var m=$(id).className.match('__tid([0-9]+)');var tid=m[1];return tid;},displayWarnLogs:function(e,elem) {mid=elem.id.match('warn_link_([0-9a-z]+)_([0-9]+)')[2];if(Object.isUndefined(mid)){return;} if(parseInt(mid)==0){return false;} Event.stop(e);var _url=ipb.vars['base_url']+'&app=core&module=ajax&secure_key='+ipb.vars['secure_hash']+'§ion=warn&do=view&mid='+mid;warnLogs=new ipb.Popup('warnLogs',{type:'pane',modal:false,w:'500px',h:500,ajaxURL:_url,hideAtStart:false,close:'.cancel'});},toggleFriend:function(e,elem) {Event.stop(e);var id=$(elem).id.match('friend_(.*)_([0-9]+)');if(Object.isUndefined(id[2])){return;} var isFriend=($(elem).hasClassName('is_friend'))?1:0;var urlBit=(isFriend)?'remove':'add';var url=ipb.vars['base_url']+"app=members§ion=friends&module=ajax&do="+urlBit+"&member_id="+id[2]+"&md5check="+ipb.vars['secure_hash'];new Ajax.Request(url,{method:'get',onSuccess:function(t) {switch(t.responseText) {case'pp_friend_timeflood':alert(ipb.lang['cannot_readd_friend']);Event.stop(e);break;case"pp_friend_already":alert(ipb.lang['friend_already']);Event.stop(e);break;case"error":return true;break;default:var newIcon=(isFriend)?ipb.templates['m_add_friend'].evaluate({id:id[2]}):ipb.templates['m_rem_friend'].evaluate({id:id[2]});var friends=$$('.mini_friend_toggle').each(function(fr){if($(fr).id.endsWith('_'+id[2])) {if(isFriend){$(fr).removeClassName('is_friend').addClassName('is_not_friend').update(newIcon);}else{$(fr).removeClassName('is_not_friend').addClassName('is_friend').update(newIcon);}}});new Effect.Highlight($(elem),{startcolor:ipb.vars['highlight_color']});document.fire('ipb:friendRemoved',{friendID:id[2]});Event.stop(e);break;}}});},toggleFlagSpammer:function(memberId,flagStatus) {if(flagStatus==true) {if(confirm(ipb.lang['set_as_spammer'])) {var tid=0;var fid=0;var sid=0;if(typeof(ipb.topic)!='undefined') {tid=ipb.topic.topic_id;fid=ipb.topic.forum_id;sid=ipb.topic.start_id;} window.location=ipb.vars['base_url']+'app=core&module=modcp&do=setAsSpammer&member_id='+memberId+'&t='+tid+'&f='+fid+'&st='+sid+'&auth_key='+ipb.vars['secure_hash'];return false;} else {return false;}} else {alert(ipb.lang['is_spammer']);return false;}},toggleSpoiler:function(e,button) {Event.stop(e);var returnvalue=$(button).up('.bbc_spoiler').down('.bbc_spoiler_wrapper').down('.bbc_spoiler_content').toggle();if(returnvalue.visible()){$(button).value=ipb.lang['spoiler_hide'];}else{$(button).value=ipb.lang['spoiler_show'];}},buildRSSmenu:function() {$$('link').each(function(link) {if(link.readAttribute('type')=="application/rss+xml") {ipb.global.rssItems.push(ipb.templates['rss_item'].evaluate({url:link.readAttribute('href'),title:link.readAttribute('title')}));}});if(ipb.global.rssItems.length>0) {rssmenu=ipb.templates['rss_shell'].evaluate({items:ipb.global.rssItems.join("\n")});$('rss_feed').insert({after:rssmenu});new ipb.Menu($('rss_feed'),$('rss_menu'));} else {$('rss_feed').hide();}},repPopUp:function(e,repId,repApp,repType) {if(ipb.global.popups['rep_'+repId]){ipb.global.popups['rep_'+repId].kill();} var _url=ipb.vars['base_url']+'&app=core&module=ajax&secure_key='+ipb.vars['secure_hash']+'§ion=reputation&do=view&repApp='+repApp+'&repType='+repType+'&repId='+repId;ipb.global.popups['rep_'+repId]=new ipb.Popup('rep_'+repId,{type:'balloon',stem:true,attach:{target:e,position:'auto'},hideAtStart:false,ajaxURL:_url,w:'300px',h:400});},closePMpopup:function(e) {if($('pm_notification')) {new Effect.Parallel([new Effect.Fade($('pm_notification')),new Effect.BlindUp($('pm_notification'))],{duration:0.5});} Event.stop(e);},markReadPMpopup:function(e) {if($('pm_notification')) {var elem=Event.findElement(e,'a');var href=elem.href.replace(/&/g,'&')+'&ajax=1';new Ajax.Request(href+"&md5check="+ipb.vars['secure_hash'],{method:'get',evalJSON:'force',onSuccess:function(t){}});new Effect.Parallel([new Effect.Fade($('pm_notification')),new Effect.BlindUp($('pm_notification'))],{duration:0.5});} Event.stop(e);return false;},initGD:function() {$('gd-antispam').observe('click',ipb.global.generateNewImage);if($('gd-image-link')) {$('gd-image-link').observe('click',ipb.global.generateNewImage);}},generateImageExternally:function(elem) {if(!$(elem)){return;} $(elem).observe('click',ipb.global.generateNewImage);},generateNewImage:function(e) {img=$('gd-antispam');Event.stop(e);oldSrc=img.src.toQueryParams();oldSrc=$H(oldSrc).toObject();if(!oldSrc['captcha_unique_id']){Debug.error("No captcha ID found");} new Ajax.Request(ipb.vars['base_url']+"app=core&module=global§ion=captcha&do=refresh&captcha_unique_id="+oldSrc['captcha_unique_id']+'&secure_key='+ipb.vars['secure_hash'],{method:'get',onSuccess:function(t) {oldSrc['captcha_unique_id']=t.responseText;img.writeAttribute({src:ipb.vars['base_url']+$H(oldSrc).toQueryString()});$('regid').value=t.responseText;}});},registerReputation:function(id,url,rating) {if(!$(id)){return;} var rep_up=$(id).down('.rep_up');var rep_down=$(id).down('.rep_down');var domLikeStripId=($(url.domLikeStripId))?$(url.domLikeStripId):false;var sendUrl=ipb.vars['base_url']+'&app=core&module=ajax§ion=reputation&do=add_rating&app_rate='+url.app+'&type='+url.type+'&type_id='+url.typeid+'&secure_key='+ipb.vars['secure_hash'];if($(rep_up)){$(rep_up).observe('click',ipb.global.repRate.bindAsEventListener(this,1,id));} if($(rep_down)){$(rep_down).observe('click',ipb.global.repRate.bindAsEventListener(this,-1,id));} ipb.global.reputation[id]={obj:$(id),domLikeStripId:domLikeStripId,url:url,sendUrl:sendUrl,currentRating:rating||0};Debug.write("Registered reputation");},repRate:function(e) {Event.stop(e);var type=$A(arguments)[1];var id=$A(arguments)[2];var value=(type==1)?1:-1;if(!ipb.global.reputation[id]){return;}else{var rep=ipb.global.reputation[id];} Debug.write(rep.sendUrl+'&rating='+value);new Ajax.Request(rep.sendUrl+'&rating='+value,{method:'get',onSuccess:function(t) {if(t.responseJSON['status']=='ok') {try{rep.obj.down('.rep_up').up('li').hide();rep.obj.down('.rep_down').up('li').hide();if(t.responseJSON['canRepUp']===true) {rep.obj.down('.rep_up').up('li').show();} if(t.responseJSON['canRepDown']===true) {rep.obj.down('.rep_down').up('li').show();}}catch(err){Debug.error(err);} var rep_display=rep.obj.down('.rep_show');if(rep_display) {['positive','negative','zero'].each(function(c){rep_display.removeClassName(c);});var newValue=parseInt(t.responseJSON['rating']);if(newValue>0) {rep_display.addClassName('positive');} else if(newValue<0) {rep_display.addClassName('negative');} else {rep_display.addClassName('zero');} rep_display.update(newValue);} if($(rep.domLikeStripId.id)) {if(t.responseJSON['likeData'].formatted!==false) {$(rep.domLikeStripId.id).update(t.responseJSON['likeData'].formatted).show();} else {$(rep.domLikeStripId.id).update('').hide();}}} else {if(t.responseJSON['error']=='nopermission'||t.responseJSON['error']=='no_permission') {ipb.global.errorDialogue(ipb.lang['no_permission']);} else {ipb.global.errorDialogue(t.responseJSON['error']);}}}});},repLikeMore:function(e,elem) {Event.stop(e);try {var id=elem.readAttribute('data-id');var app=elem.readAttribute('data-app');var type=elem.readAttribute('data-type');} catch(e) {Debug.error(e);} if(!Object.isUndefined(ipb.global.popups['likeMore'])) {ipb.global.popups['likeMore'].kill();} var popid='setfave_'+id;var _url=ipb.vars['base_url']+'&app=core&module=ajax§ion=reputation&do=more&secure_key='+ipb.vars['secure_hash']+'&f_app='+app+'&f_type='+type+'&f_id='+id;Debug.write(_url);ipb.global.popups['likeMore']=new ipb.Popup(popid,{type:'pane',ajaxURL:_url,stem:false,hideAtStart:false,h:500,w:'450px'});},convertSize:function(size) {var kb=1024;var mb=1024*1024;var gb=1024*1024*1024;if(sizescreenDim.width){diff=menuDim.width-sourceDim.width;pos.left=_sourcePos.left-diff+this.options.offsetX;}else{pos.left=(_sourcePos.left)+this.options.offsetX;} if((_sourcePos.top+menuDim.height)>screenDim.height){pos.top=_sourcePos.top-menuDim.height+this.options.offsetY;}else{pos.top=_sourcePos.top+sourceDim.height+this.options.offsetY;} $(this.target).setStyle('top: '+(pos.top-1)+'px; left: '+pos.left+'px;');} else {if(_a!=_b) {if((realSourcePos.left+menuDim.width)>screenDim.width){diff=menuDim.width-sourceDim.width;pos.left=_sourcePos.left-diff+this.options.offsetX;}else{if(Prototype.Browser.IE7){pos.left=(_sourcePos.left)+this.options.offsetX;}else{pos.left=(_sourcePos.left)+this.options.offsetX;}} if((((realSourcePos.top+sourceDim.height)+menuDim.height)>screenDim.height)&&(_sourcePos.top-menuDim.height+this.options.offsetY)>0) {pos.top=_sourcePos.top-menuDim.height+this.options.offsetY;}else{pos.top=_sourcePos.top+sourceDim.height+this.options.offsetY;}} else {Debug.write("MENU: source offset EQUALS target offset");if((realSourcePos.left+menuDim.width)>screenDim.width){diff=menuDim.width-sourceDim.width;pos.left=sourcePos.left-diff+this.options.offsetX;}else{pos.left=sourcePos.left+this.options.offsetX;} if((((realSourcePos.top+sourceDim.height)+menuDim.height)>screenDim.height)&&(_sourcePos.top-menuDim.height+this.options.offsetY)>0) {pos.top=sourcePos.top-menuDim.height+this.options.offsetY;}else{pos.top=sourcePos.top+sourceDim.height+this.options.offsetY;}} $(this.target).setStyle('top: '+(pos.top-1)+'px; left: '+pos.left+'px;');} $(this.source).addClassName('menu_active');Debug.write("Menu position: "+pos.top+" x "+pos.left);new Effect.Appear($(this.target),{duration:0.2,afterFinish:function(e){if(Object.isFunction(this.callbacks['afterOpen'])) {this.callbacks['afterOpen'](this);}}.bind(this)});Event.observe(document,'keypress',this.checkKeyPress.bindAsEventListener(this));},checkKeyPress:function(e) {if(e.keyCode==Event.KEY_ESC) {this.doClose();}},mouseOutClose:function() {this.doClose();},doClose:function() {new Effect.Fade($(this.target),{duration:0.3,afterFinish:function(e){if(Object.isFunction(this.callbacks['afterClose'])) {this.callbacks['afterClose'](this);}}.bind(this)});this.source.removeClassName('menu_active');},targetClick:function(e) {if(!this.options.stopClose){this.doClose();}},eventClick:function(e,elem) {if(this.options['eventType']=='click') {Event.stop(e);if($(this.target).visible()){if(Object.isFunction(this.callbacks['beforeClose'])) {this.callbacks['beforeClose'](this);} this.doClose();}else{ipb.menus.closeAll($(this.source).id);if(Object.isFunction(this.callbacks['beforeOpen'])) {this.callbacks['beforeOpen'](this);} this.doOpen(elem);}}},eventOver:function() {if(this.options['eventType']=='mouseover') {if(!$(this.target).visible()){ipb.menus.closeAll($(this.source).id);if(Object.isFunction(this.callbacks['beforeOpen'])) {this.callbacks['beforeOpen'](this);} this.doOpen();}}}});_popup=window.IPBoard;_popup.prototype.Popup=Class.create({initialize:function(id,options,callbacks) {this.id='';this.wrapper=null;this.inner=null;this.stem=null;this.options={};this.timer=[];this.ready=false;this.visible=false;this._startup=null;this.hideAfterSetup=false;this.eventPairs={'mouseover':'mouseout','mousedown':'mouseup'};this._tmpEvent=null;this.id=id;this.options=Object.extend({type:'pane',w:'500px',modal:false,modalOpacity:0.4,hideAtStart:true,delay:{show:0,hide:0},defer:false,hideClose:false,black:false,warning:false,evalJs:true,closeContents:ipb.templates['close_popup']},arguments[1]||{});this.callbacks=callbacks||{};if(this.options.defer&&$(this.options.attach.target)) {this._defer=this.init.bindAsEventListener(this);$(this.options.attach.target).observe(this.options.attach.event,this._defer);if(this.eventPairs[this.options.attach.event]) {this._startup=function(e){this.hideAfterSetup=true;this.hide();}.bindAsEventListener(this);$(this.options.attach.target).observe(this.eventPairs[this.options.attach.event],this._startup);}} else {this.init();}},init:function() {try{Event.stopObserving($(this.options.attach.target),this.options.attach.event,this._defer);if($(this.options.attach.target)) {var toff=$(this.options.attach.target).positionedOffset();var menu=$(this.options.attach.target).up('.ipbmenu_content');if(toff.top==0&&toff.left==0||$(menu)) {this.options.type='modal';this.options.attach={};}}}catch(err){} this.wrapper=new Element('div',{'id':this.id+'_popup'}).setStyle('z-index: 10001').hide().addClassName('popupWrapper');this.inner=new Element('div',{'id':this.id+'_inner'}).addClassName('popupInner');if(this.options.black) {this.inner.addClassName('black_mode');} if(this.options.warning) {this.inner.addClassName('warning_mode');} if(this.options.w){this.inner.setStyle('width: '+this.options.w);} this.wrapper.insert(this.inner);if(this.options.hideClose!=true) {this.closeLink=new Element('div',{'id':this.id+'_close'}).addClassName('popupClose').addClassName('clickable');this.closeLink.update(this.options.closeContents);this.closeLink.observe('click',this.hide.bindAsEventListener(this));this.wrapper.insert(this.closeLink);if(this.options.black||this.options.warning) {this.closeLink.addClassName('light_close_button');}} $$('body')[0].insert(this.wrapper);if(this.options.classname){this.wrapper.addClassName(this.options.classname);} if(this.options.initial){this.update(this.options.initial);} if(Object.isFunction(this.callbacks['beforeAjax'])) {this.callbacks['beforeAjax'](this);} if(this.options.ajaxURL){this.updateAjax();setTimeout(this.continueInit.bind(this),80);}else{this.ready=true;this.continueInit();}},continueInit:function() {if(!this.ready) {setTimeout(this.continueInit.bind(this),80);return;}

    Virtyal Server

    Информация о пользователе

    Привет, Гость! Войдите или зарегистрируйтесь.


    Вы здесь » Virtyal Server » Информация


    Информация

    Вы не имеете прав для просмотра этих форумов.

    Вы здесь » Virtyal Server » Информация


    Рейтинг форумов | Создать форум бесплатно