/*======================================================================*\
|| #################################################################### ||
|| # vBulletin 4.0.0 Alpha 5
|| # ---------------------------------------------------------------- # ||
|| # Copyright ©2000-2009 Jelsoft Enterprises Ltd. All Rights Reserved. ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/
if(!window.console||!console.firebug){window.console={};var names=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];for(var i=0;i<names.length;++i){window.console[names[i]]=function(){}}}YAHOO.namespace("vBulletin");YAHOO.vBulletin.vB_XHTML_Ready=false;var vB_XHTML_Ready=new YAHOO.util.CustomEvent();YAHOO.util.Event.onAvailable("footer",function(){console.log("Fire vB_XHTML_Ready");vB_XHTML_Ready.fire();YAHOO.vBulletin.vB_XHTML_Ready=true});vB_XHTML_Ready.subscribe(init_breadcrumb);function init_breadcrumb(D){var C=YAHOO.util.Dom.get("breadcrumb");var B=C.getElementsByTagName("li");for(var A=0;A<B.length;A++){}}function register_inlinemod(D,G,C,B,F,A){var E=new InlineModCollection(B,B+"_imodsel",A);E.add_controls(YAHOO.util.Dom.getElementsByClassName(C,G,D),F)}function register_inlinemod_checkboxes(E,H,D,A,C,G,B){var F=new InlineModCollection(C,null,B);F.add_controls(YAHOO.util.Dom.getElementsByClassName(D,H,E),G);F.add_checkboxes(A)}YAHOO.namespace("vBulletin.imodcollections");function InlineModCollection(B,A,C){this.type=B;this.collection=new Array();if(typeof C=="undefined"){C="vbulletin_inline"}this.cookiename=C+this.type;this.selecteditems=this.fetch_ids();this.set_display_count(this.selecteditems.length);this.init_selector(A);YAHOO.vBulletin.imodcollections[B]=this}InlineModCollection.get=function(A){return YAHOO.vBulletin.imodcollections[A]};InlineModCollection.prototype.add_controls=function(D,E){if(typeof E=="undefined"){E=this.type+"_"}for(var B=0;B<D.length;B++){var A=D[B];var C=A.id.substr(E.length);this.add_control(new InlineModControl(A,C,this))}};InlineModCollection.prototype.add_checkboxes=function(B){var A=YAHOO.util.Dom.getElementsByClassName(this.type+"_checkall","input",B);for(var D=0;D<A.length;D++){var C=A[D];if(C.type=="checkbox"){YAHOO.util.Event.on(C,"click",this.set_from_checkbox,this,true)}}};InlineModCollection.prototype.add_control=function(A){if(PHP.in_array(A.itemid,this.selecteditems)!=-1){A.checkbox.checked=true;A.set_inlinemod_highlight()}this.collection.push(A)};InlineModCollection.prototype.init_selector=function(A){var D=YAHOO.util.Dom.get(A);if(D!=null){var B=D.getElementsByTagName("a");for(var C=0;C<B.length;C++){if(B[C].id&&B[C].id.substr(0,D.id.length)==D.id){YAHOO.util.Event.on(B[C],"click",this.set_all_selections,this,true)}}}};InlineModCollection.prototype.set_from_checkbox=function(C){var B=YAHOO.util.Event.getTarget(C);for(var A=0;A<this.collection.length;A++){this.collection[A].set_selection_from_checkbox(B)}this.update_collection_state()};InlineModCollection.prototype.set_all_selections=function(D){var B=YAHOO.util.Event.getTarget(D);if("a"!=B.tagName.toLowerCase()){B=YAHOO.util.Dom.getAncestorByTagName(B,"A")}console.log("Do:%s, ID:%s",B.innerHTML,B.id);var C=B.id.split(":");for(var A=0;A<this.collection.length;A++){this.collection[A].set_selection(C)}this.update_collection_state();YAHOO.util.Event.stopEvent(D);YAHOO.vBulletin.vBPopupMenu.close_all()};InlineModCollection.prototype.update_collection_state=function(){var B=new Array();for(var A=0;A<this.collection.length;A++){B.push(this.collection[A].itemid)}if(B.length){this.selecteditems=this.remove_items(this.selecteditems,B)}for(var A=0;A<this.collection.length;A++){if(this.collection[A].checkbox.checked){this.selecteditems.push(this.collection[A].itemid)}}this.set_cookie(this.selecteditems);this.set_display_count(this.selecteditems.length)};InlineModCollection.prototype.update_state=function(B,A){this.selecteditems=this.remove_items(this.selecteditems,new Array(B));if(A){this.selecteditems.push(B)}this.set_cookie(this.selecteditems);this.set_display_count(this.selecteditems.length)};InlineModCollection.prototype.remove_items=function(D,C){var B=new Array();for(var A=0;A<D.length;A++){if(D[A]!=""&&PHP.in_array(D[A],C)==-1){B.push(D[A])}}return B};InlineModCollection.prototype.set_cookie=function(B){var A=new Date();A.setTime(A.getTime()+3600000);set_cookie(this.cookiename,B.join("-"),A)};InlineModCollection.prototype.fetch_ids=function(){var A=fetch_cookie(this.cookiename);if(A!=null&&A!=""){A=A.split("-");if(A.length>0){return A}}return new Array()};InlineModCollection.prototype.set_display_count=function(A){var B=YAHOO.util.Dom.get(this.type+"_inlinemod_count");if(B){B.innerHTML=A}};function InlineModControl(A,B,D){var C=D.type+"_imod_checkbox_"+B;this.container=YAHOO.util.Dom.get(A);this.checkbox=YAHOO.util.Dom.get(C);this.itemid=B;this.collection=D;if(this.checkbox){this.set_inlinemod_state();YAHOO.util.Event.on(this.checkbox,"click",this.set_inlinemod_state,this,true)}else{console.warn("No inlinemod selection checkbox found for "+C)}}InlineModControl.prototype.init_collection=function(A){if(typeof YAHOO.vBulletin.imodcollection=="undefined"){YAHOO.vBulletin.imodcollection=new InlineModCollection(A)}return YAHOO.vBulletin.imodcollection};InlineModControl.prototype.set_selection_from_checkbox=function(A){if(A.value!="all"){if(A.value!=this.checkbox.value){return }}this.checkbox.checked=A.checked;this.set_inlinemod_highlight()};InlineModControl.prototype.set_selection=function(A){switch(A[1]){case"invert":this.checkbox.checked=!this.checkbox.checked;break;case"none":this.checkbox.checked=false;break;case"class":this.checkbox.checked=YAHOO.util.Dom.hasClass(this.container,A[2]);break;case"flag":if(typeof A[2]!=undefined&&!isNaN(A[2])){this.checkbox.checked=this.checkbox.value&A[2]}else{this.checkbox.checked=true}break;default:case"all":this.checkbox.checked=true;break}this.set_inlinemod_highlight()};InlineModControl.prototype.set_inlinemod_state=function(){this.collection.update_state(this.itemid,this.checkbox.checked);this.set_inlinemod_highlight()};InlineModControl.prototype.set_inlinemod_highlight=function(){var A=(this.checkbox.checked?"addClass":"removeClass");YAHOO.util.Dom[A](this.container,"imod_highlight");console.log("Set Inlinemod State for %s - %s",this.itemid,A)};vB_XHTML_Ready.subscribe(init_searchboxes);function init_searchboxes(){var B=YAHOO.util.Dom.getElementsByClassName("searchbox","input");for(var A=0;A<B.length;A++){new YAHOO.vBulletin.SearchBox(B[A])}}YAHOO.vBulletin.LoadScript=function(B,C){var A=document.createElement("script");YAHOO.util.Dom.setAttribute(A,"type","text/javascript");if(typeof (C)!="undefined"){if(A.readyState){A.onreadystatechange=function(){if(A.readyState=="loaded"||A.readyState=="complete"){A.onreadystatechange=null;C()}}}else{A.onload=function(){C()}}}YAHOO.util.Dom.setAttribute(A,"src",B+"?"+Math.floor(Math.random()*100000));document.getElementsByTagName("head")[0].appendChild(A)};YAHOO.vBulletin.LoadCss=function(A){var B=document.createElement("link");YAHOO.util.Dom.setAttribute(B,"type","text/css");YAHOO.util.Dom.setAttribute(B,"rel","stylesheet");YAHOO.util.Dom.setAttribute(B,"href",A);document.getElementsByTagName("head")[0].appendChild(B)};YAHOO.vBulletin.SearchBox=function(A){this.element=A;this.default_value=this.element.value;YAHOO.util.Event.on(this.element,"focus",this.focus_handler,this,true);YAHOO.util.Event.on(this.element,"blur",this.blur_handler,this,true)};YAHOO.vBulletin.SearchBox.prototype.focus_handler=function(A){if(this.element.value==this.default_value){this.element.value=""}this.element.select()};YAHOO.vBulletin.SearchBox.prototype.blur_handler=function(A){if(this.element.value==""){this.element.value=this.default_value}};vB_XHTML_Ready.subscribe(init_popupmenus);function init_popupmenus(){YAHOO.vBulletin.vBPopupMenu=new PopupFactory()}function PopupFactory(){this.menu_open=false;this.timeout=null;this.menuclose_timeout=null;this.popups=new Object();this.instrument();YAHOO.util.Event.on(document,"click",this.close_all,this,true)}PopupFactory.prototype.instrument=function(C){var B=YAHOO.util.Dom.getElementsByClassName("popupmenu",undefined,C);for(var A=0;A<B.length;A++){if(!YAHOO.util.Dom.hasClass(B[A],"popupcustom")){this.register(B[A])}}};PopupFactory.prototype.register=function(A){var B=YAHOO.util.Dom.generateId(A);this.popups[B]=new PopupMenu(A,this)};PopupFactory.prototype.register_menuobj=function(A){var B=YAHOO.util.Dom.generateId(A.container);this.popups[B]=A};PopupFactory.prototype.close_all=function(B){if(this.menu_open){for(var A in this.popups){this.popups[A].close_menu()}this.menu_open=false}};function PopupMenu(A,B){this.init(A,B)}PopupMenu.prototype.init=function(A,B){this.container=A;this.factory=B;this.display=false;this.menu=null;this.activate_menu();this.control=null;this.activate_control();this.locator=null;this.form=null;this.popup_form_elements=new Array()};PopupMenu.prototype.activate_menu=function(){var A=YAHOO.util.Dom.getElementsByClassName("popupbody","*",this.container);if(A.length){this.menu=A[0];YAHOO.util.Dom.generateId(this.menu);if(!YAHOO.util.Dom.hasClass(this.container,"nohovermenu")){YAHOO.util.Event.on(this.menu,"mouseover",this.cancel_menutimer,this,true);YAHOO.util.Event.on(this.menu,"mouseout",this.start_menutimer,this,true)}}else{}YAHOO.util.Dom.removeClass(A[0],"popuphover");YAHOO.util.Event.on(A[0],"click",this.cancel_close,this,true)};PopupMenu.prototype.activate_control=function(){var A=YAHOO.util.Dom.getElementsByClassName("popupctrl","",this.container);if(A.length){this.control=A[0];YAHOO.util.Dom.generateId(this.control);if(!YAHOO.util.Dom.hasClass(this.container,"noclick")){YAHOO.util.Event.on(this.control,"click",this.toggle_menu,this,true)}if(YAHOO.util.Dom.hasClass(this.container,"nohovermenu")){if(!YAHOO.util.Dom.hasClass(this.container,"nomouseover")){YAHOO.util.Event.on(this.control,"mouseover",this.mouseover,this,true);YAHOO.util.Event.on(this.control,"mouseout",this.mouseout,this,true)}}else{YAHOO.util.Event.on(this.control,"mouseover",this.open_hovermenu,this,true);YAHOO.util.Event.on(this.control,"mouseout",this.start_menutimer,this,true)}}};PopupMenu.prototype.cancel_close=function(A){YAHOO.util.Event.stopPropagation(A)};PopupMenu.prototype.mouseover=function(A){if(this.factory.menu_open){this.open_menu(A)}else{this.factory.timeout=YAHOO.lang.later(1000,this,"open_menu",[{e:A}])}};PopupMenu.prototype.mouseout=function(A){if(this.factory.timeout!=null){this.factory.timeout.cancel()}};PopupMenu.prototype.open_hovermenu=function(A){this.cancel_menutimer(A);this.open_menu(A)};PopupMenu.prototype.start_menutimer=function(A){this.factory.menuclose_timeout=YAHOO.lang.later(300,this,"close_menu",[{e:A}])};PopupMenu.prototype.cancel_menutimer=function(A){if(this.factory.menuclose_timeout!=null){this.factory.menuclose_timeout.cancel()}};PopupMenu.prototype.toggle_menu=function(A){if(this.display){this.close_menu()}else{this.open_menu(A)}YAHOO.util.Event.stopEvent(A)};PopupMenu.prototype.load_menu=function(A){YAHOO.util.Connect.asyncRequest("POST","load-popup.php?id="+this.container.id,{success:this.handle_menu_load,failure:null,timeout:null,scope:this,argument:{e:A}},"id="+this.container.id)};PopupMenu.prototype.handle_menu_load=function(A){alert("Load menu!")};PopupMenu.prototype.open_menu=function(B){if(YAHOO.lang.isNull(this.menu)){this.load_menu(B);return }if(this.factory.timeout!=null){this.factory.timeout.cancel()}this.factory.close_all();if(typeof (B)=="object"){var A=YAHOO.util.Event.getTarget(B)}else{var A=YAHOO.util.Dom.get(A)}if(A!=null){A=(YAHOO.util.Dom.hasClass(A,"popupctrl")?A:YAHOO.util.Dom.getAncestorByClassName(A,"popupctrl"))}this.set_display(true,A);this.factory.menu_open=true};PopupMenu.prototype.close_menu=function(){this.set_display(false);this.factory.menu_open=false};PopupMenu.prototype.set_display=function(C,B){if(YAHOO.lang.isNull(this.menu)){return }this.display=C;if(C&&YAHOO.env.ua.ie>0&&YAHOO.env.ua.ie<8){if(YAHOO.lang.isNull(this.locator)){var A=this.contains_form_elements(this.menu);if(A){console.log("Popup '%s' contains form elements",this.control.innerHTML);this.form=A.form}this.locator=this.menu.parentNode.insertBefore(document.createElement("div"),this.menu);YAHOO.util.Dom.addClass(this.locator,"popupbody");YAHOO.util.Dom.setStyle(this.locator,"visibility","hidden");YAHOO.util.Dom.setStyle(this.locator,"display","block");YAHOO.util.Dom.setStyle(this.locator,"margin","0");YAHOO.util.Dom.setStyle(this.locator,"padding","0");YAHOO.util.Dom.setStyle(this.locator,"border","none");YAHOO.util.Dom.setStyle(this.menu,"display","block");YAHOO.util.Dom.setStyle(this.locator,"width",this.menu.offsetWidth+"px");YAHOO.util.Dom.setStyle(this.locator,"height",this.menu.offsetHeight+"px");YAHOO.util.Dom.setStyle(this.menu,"display","none");this.menu.form=document.body.appendChild(document.createElement("form"));this.menu.form.appendChild(this.menu);if(this.form){YAHOO.util.Event.on(this.menu.form,"submit",this.handle_popup_form_submit,this,true);YAHOO.util.Event.on(this.menu.form,"reset",this.handle_popup_form_reset,this,true)}}if(this.check_menu(this.menu)){YAHOO.util.Dom.setStyle(this.menu,"display","block");YAHOO.util.Dom.setXY(this.menu,this.get_menu_position(B));this.set_control_style()}}else{if(C){if(this.check_menu(this.menu)){YAHOO.util.Dom.setStyle(this.menu,"display","block");this.set_offset(this.menu,B);this.set_control_style()}}else{YAHOO.util.Dom.setStyle(this.menu,"display","none");this.set_control_style()}}};PopupMenu.prototype.check_menu=function(C){if(!YAHOO.util.Dom.hasClass(C,"noempty")){return true}var A=this.menu.getElementsByTagName("li");if(A.length){for(var B=0;B<A.length;B++){if(!YAHOO.util.Dom.hasClass(A[B],"noempty")){return true}}}return false};PopupMenu.prototype.register_popup_form=function(A){var B=this.contains_form_elements(A);if(B){this.form=B.form}};PopupMenu.prototype.contains_form_elements=function(A){var B=null;B=A.getElementsByTagName("input");if(B.length){return B[0]}else{B=A.getElementsByTagName("textarea");if(B.length){return B[0]}else{B=A.getElementsByTagName("select");if(B.length){return B[0]}}}return false};PopupMenu.prototype.handle_popup_form_submit=function(D){YAHOO.util.Event.stopEvent(D);var C=YAHOO.util.Event.getTarget(D);for(var B=0;B<C.elements.length;B++){var A=C.elements[B];if(A.name){switch(A.tagName){case"textarea":case"select":this.replicate_form_value(A);break;case"input":default:switch(A.type){case"hidden":case"text":case"password":this.replicate_form_value(A);break;case"checkbox":case"radio":if(A.checked){this.replicate_form_value(A)}break}}}}this.form.submit()};PopupMenu.prototype.replicate_form_value=function(B){if(!this.form.elements[B.name]){var A=document.createElement("input");A.name=B.name;A.type="hidden";A.value=B.value;this.form.appendChild(A)}else{this.form.elements[B.name].value=B.value}};PopupMenu.prototype.handle_popup_form_reset=function(A){YAHOO.util.Event.getTarget(A).reset();this.form.reset()};PopupMenu.prototype.get_menu_position=function(B){YAHOO.util.Dom.setStyle(this.locator,"display","block");this.set_offset(this.locator,B);var A=YAHOO.util.Dom.getXY(this.locator);YAHOO.util.Dom.setStyle(this.locator,"display","none");return A};PopupMenu.prototype.set_offset=function(D,B){if(!B){return }var E=B.offsetHeight+"px";if(YAHOO.lang.isUndefined(D.oLeft)){D.oLeft=YAHOO.util.Dom.getStyle(D,"left");D.oRight=YAHOO.util.Dom.getStyle(D,"right")}YAHOO.util.Dom.setStyle(D,"top",E);YAHOO.util.Dom.setStyle(D,"left",D.oLeft);YAHOO.util.Dom.setStyle(D,"right",D.oRight);var A=YAHOO.util.Dom.getClientRegion();var C=YAHOO.util.Dom.getRegion(D);if(C.right>A.right){YAHOO.util.Dom.setStyle(D,"right","0px");YAHOO.util.Dom.setStyle(D,"left","auto");C=YAHOO.util.Dom.getRegion(D)}if(C.left<A.left){YAHOO.util.Dom.setStyle(D,"right","auto");YAHOO.util.Dom.setStyle(D,"left","0px");C=YAHOO.util.Dom.getRegion(D)}if(C.bottom>A.bottom){YAHOO.util.Dom.setStyle(D,"top",(C.bottom-C.top)*-1+"px");C=YAHOO.util.Dom.getRegion(D)}if(C.top<A.top){YAHOO.util.Dom.setStyle(D,"top",E)}};PopupMenu.prototype.set_control_style=function(){var A=(this.display?"addClass":"removeClass");YAHOO.util.Dom[A](this.control,"active")};vB_XHTML_Ready.subscribe(init_collapsers);function init_collapsers(){new vBCollapseFactory()}function vBCollapseFactory(){var A=YAHOO.util.Dom.getElementsByClassName("collapse","a");for(var B=0;B<A.length;B++){new vBCollapse(A[B],this)}}function vBCollapse(B,A){this.init(B,A)}vBCollapse.prototype.init=function(B,A){this.link=B;this.factory=A;this.targetid=null;this.target=null;this.image=null;var D=this.link.id.match(/^collapse_(.*)$/);this.targetid=D[1];this.target=YAHOO.util.Dom.get(this.targetid);var C=this.link.getElementsByTagName("img");this.image=C[0];if(this.target){YAHOO.util.Event.on(this.link,"click",this.toggle_collapse,this,true)}else{YAHOO.util.Dom.setStyle(this.link,"display","hidden")}};vBCollapse.prototype.toggle_collapse=function(A){YAHOO.util.Event.stopEvent(A);if(!is_regexp){return false}if(YAHOO.util.Dom.getStyle(this.target,"display")=="none"){YAHOO.util.Dom.setStyle(this.target,"display","");this.save_collapsed(false);if(this.image){var B=new RegExp("_collapsed\\.png$");this.image.src=this.image.src.replace(B,".png")}}else{YAHOO.util.Dom.setStyle(this.target,"display","none");this.save_collapsed(true);if(this.image){var B=new RegExp("\\.png$");this.image.src=this.image.src.replace(B,"_collapsed.png")}}return false};vBCollapse.prototype.save_collapsed=function(D){var C=fetch_cookie("vbulletin_collapse");var B=new Array();if(C!=null){C=C.split("\n");for(var A in C){if(YAHOO.lang.hasOwnProperty(C,A)&&C[A]!=this.targetid&&C[A]!=""){B[B.length]=C[A]}}}if(D){B[B.length]=this.targetid}expires=new Date();expires.setTime(expires.getTime()+(1000*86400*365));set_cookie("vbulletin_collapse",B.join("\n"),expires)};function PostBit_Init(A,B){console.log("PostBit Init: %d",B);YAHOO.vBulletin.vBPopupMenu.instrument(A);if(typeof vB_QuickEditor!="undefined"){vB_AJAX_QuickEdit_Init(A)}if(typeof vB_QuickReply!="undefined"){qr_init_buttons(A)}if(typeof mq_init!="undefined"){mq_init(A)}if(typeof init_reputation_popupmenus!="undefined"){init_reputation_popupmenus(A)}if(typeof inlineMod!="undefined"){im_init(A)}if(typeof vB_Lightbox!="undefined"){init_postbit_lightbox(A,false,true)}child_img_alt_2_title(A)};