if(typeof Meetup==="undefined"){Meetup={}}Meetup.DiscreteBase=function(){};Meetup.DiscreteBase.prototype.initialize=function(parent,ins,args){var i,root,funcInit=ins.init;for(i in Meetup.DiscreteBase){if(((i!=="prototype")||(i!=="constructor"))&&parent[i]===undefined){parent[i]=Meetup.DiscreteBase[i]}}ins.parent=parent;ins.bindedFunctions={};ins.elements={};ins.events={};ins.evPointers={};ins.boolHasTweener=(Meetup.Tweener===undefined)?false:true;ins.boolMSIE=(/msie/.test(navigator.userAgent.toLowerCase())&&!(/opera/.test(navigator.userAgent.toLowerCase())));root=Meetup.DiscreteHelper.buildRoot(document.body,ins.ROOT_CLASS_NAME,ins.SERIALIZED_HTML);ins.elements.root=root;delete ins.init;ins.initialize=Meetup.DiscreteHelper.bind(funcInit,ins);return ins.initialize.apply(ins,args)};Meetup.DiscreteBase.prototype.NAME="Meetup.DiscreteBase";Meetup.DiscreteBase.prototype.ROOT_CLASS_NAME="J_discreteBase";Meetup.DiscreteBase.prototype.EVENT_NAMES=["onBeforeShow","onAfterShow","onBeforeHide","onAfterHide"];Meetup.DiscreteBase.prototype.PUBLIC_METHODS=["attach","detach","discard","getRoot","hasDiscarded","hide","isShowing","opacity","dimension","offset","position","show","zIndex"];Meetup.DiscreteBase.prototype.SEC_FADE_IN=0.5;Meetup.DiscreteBase.prototype.SEC_FADE_OUT=0.5;Meetup.DiscreteBase.prototype.SERIALIZED_HTML='<div class="bg"></div><div class="display"></div><div class="interact"></div>';Meetup.DiscreteBase.prototype.TRANS_FADE_IN="easeOutQuart";Meetup.DiscreteBase.prototype.TRANS_FADE_OUT="easeOutQuart";Meetup.DiscreteBase.prototype.parent=null;Meetup.DiscreteBase.prototype.bindedFunctions=null;Meetup.DiscreteBase.prototype.elements=null;Meetup.DiscreteBase.prototype.events=null;Meetup.DiscreteBase.prototype.evPointers=null;Meetup.DiscreteBase.prototype.tween=null;Meetup.DiscreteBase.prototype.boolMSIE=false;Meetup.DiscreteBase.prototype.boolShowing=false;Meetup.DiscreteBase.prototype.boolDiscarded=false;Meetup.DiscreteBase.prototype.boolHasTweener=false;Meetup.DiscreteBase.prototype.x=0;Meetup.DiscreteBase.prototype.y=0;Meetup.DiscreteBase.prototype.w=0;Meetup.DiscreteBase.prototype.h=0;Meetup.DiscreteBase.prototype.alpha=0;Meetup.DiscreteBase.prototype.z=0;Meetup.DiscreteBase.prototype.offsetX=true;Meetup.DiscreteBase.prototype.offsetY=true;Meetup.DiscreteBase.prototype.attach=function(evName,func){var SEP=String.fromCharCode(31),reg=new RegExp(SEP+evName+SEP);if(this.eventsNames===undefined){this.eventsNames=[""].concat(this.EVENT_NAMES).concat([""]).join(SEP)}if(this.eventsNames.match(reg)===null){throw new Error("No event trigger exists: "+evName)}var evs=this.events[evName];if(evs===undefined){this.events[evName]=[];evs=this.events[evName]}evs[evs.length]=func};Meetup.DiscreteBase.prototype.detach=function(evName){var result=false;if(this.eventsNames===undefined){return result}if(this.events[evName]!==null){this.events[evName]=undefined;result=true}return result};Meetup.DiscreteBase.prototype.discard=function(){if(this.tween){this.tween.discard()}var obj,evName,i,len,MSD=MochiKit.Signal.disconnect,root=this.elements.root;for(evName in this.evPointers){obj=this.evPointers[evName];if(obj instanceof Array){for(i=0,len=obj.length;i<len;++i){MSD(obj[i])}}else{MSD(obj)}}root.parentNode.removeChild(root);this.events=null;this.evPointers=null;this.objContent=null;this.elements=null;this.boolDiscarded=true};Meetup.DiscreteBase.prototype.getRoot=function(){return(this.elements.root!==undefined)?this.elements.root:null};Meetup.DiscreteBase.prototype.hasDiscarded=function(){return this.boolDiscarded};Meetup.DiscreteBase.prototype.hide=function(){if(!this.boolShowing){return false}if(this.tween){this.tween.discard()}var i,len,opt,afterFunc,self=this,before=this.events.onBeforeHide,after=this.events.onAfterHide,root=this.elements.root,rootStyle=root.style,time=this.SEC_FADE_IN,trans=this.TRANS_FADE_IN;if(before){for(i=0,len=before.length;i<len;++i){before[i]()}}afterFunc=function(){rootStyle.display="none";self.tween=null;self.opacity(0);if(after){for(var j=0,men=after.length;j<men;++j){after[j]()}}};this.boolShowing=false;if(this.boolHasTweener){rootStyle.display="block";opt={opacity:0,transition:trans,time:time,onComplete:afterFunc};this.tween=Meetup.Tweener.addTween(root,opt)}else{afterFunc()}return true};Meetup.DiscreteBase.prototype.isShowing=function(){return this.boolShowing};Meetup.DiscreteBase.prototype.show=function(){if(this.boolShowing){return false}if(this.tween){this.tween.discard()}var i,len,opt,afterFunc,self=this,before=this.events.onBeforeShow,after=this.events.onAfterShow,root=this.elements.root,rootStyle=root.style,time=this.SEC_FADE_IN,trans=this.TRANS_FADE_IN;if(before){for(i=0,len=before.length;i<len;++i){before[i]()}}afterFunc=function(){self.tween=null;self.opacity(1);if(after){for(i=0,len=after.length;i<len;++i){after[i]()}}};this.boolShowing=true;if(this.boolHasTweener){this.opacity(0);rootStyle.display="block";opt={opacity:1,transition:trans,time:time,onComplete:afterFunc};this.tween=Meetup.Tweener.addTween(root,opt)}else{rootStyle.display="block";afterFunc()}return true};Meetup.DiscreteBase.prototype.dimension=function(w,h){if(arguments.length===0){return this.retrieveDimension()}throw new Error("please implement this: dimension")};Meetup.DiscreteBase.prototype.opacity=function(opa){if(arguments.length===0){return this.alpha}var flt_opa=parseFloat(opa);if(flt_opa>1){flt_opa=1}else{if(flt_opa<0){flt_opa=0}}this.alpha=flt_opa;MochiKit.Style.setStyle(this.elements.root,{opacity:flt_opa});return this.alpha};Meetup.DiscreteBase.prototype.offset=function(x,y){if(arguments.length!==0){var tmp;if(x===true){this.offsetX=true}else{tmp=Meetup.DiscreteHelper.getNumeric(x);if(tmp){this.offsetX=tmp}else{this.offsetX=0}}if(y===true){this.offsetY=true}else{tmp=Meetup.DiscreteHelper.getNumeric(y);if(tmp){this.offsetY=tmp}else{this.offsetY=0}}this.resetPosition()}return{x:this.offsetX,y:this.offsetY}};Meetup.DiscreteBase.prototype.position=function(x,y){if(arguments.length!==0){var coord,rs=this.elements.root.style;this.x=x;this.y=y;this.resetPosition();coord=this.translateCoordinate(this.x,this.y,this.w,this.h,this.offsetX,this.offsetY);rs.left=coord.x+"px";rs.top=coord.y+"px"}return{x:this.x,y:this.y}};Meetup.DiscreteBase.prototype.zIndex=function(z){if(arguments.length!==0){this.z=z;this.elements.root.style.zIndex=this.z}else{this.z=MochiKit.Style.getStyle(this.elements.root,"z-index")}return{z:this.z}};Meetup.DiscreteBase.prototype.bindEvents=function(isConnecting){var i,len,name,method,parent=this,methods=parent.EVENT_NAMES;isConnecting=isConnecting||false;for(i=0,len=methods.length;i<len;++i){name=methods[i];if(this[name]){this.bindedFunctions[name]=Meetup.DiscreteHelper.bind(this[name],this)}}for(i in this){if((typeof this[i]==="function")&&(i.match(/^on[A-Z]/)!==null)){this.bindedFunctions[i]=Meetup.DiscreteHelper.bind(this[i],this)}}};Meetup.DiscreteBase.prototype.embody=function(){var result=false,root=this.elements.root,MKS=MochiKit.Style;if(MKS.getStyle(root,"display")==="none"){MKS.setStyle(root,{visibility:"hidden",display:"block"});result=true}return result};Meetup.DiscreteBase.prototype.unembody=function(){var result=false,root=this.elements.root,MKS=MochiKit.Style;if(MKS.getStyle(root,"display")!=="none"){MKS.setStyle(root,{visibility:"visible",display:"none"});result=true}return result};Meetup.DiscreteBase.prototype.publicMethods=function(){var i,len,name,result={},methods=parent.PUBLIC_METHODS;for(i=0,len=methods.length;i<len;++i){name=methods[i];result[name]=Meetup.DiscreteHelper.bind(this[name],this)}return result};Meetup.DiscreteBase.prototype.resetPosition=function(skipEmbody){var dim,coord,rs=this.elements.root.style,result=false;skipEmbody=skipEmbody||false;if(!skipEmbody){result=this.embody(true)}dim=this.retrieveDimension(true);coord=this.translateCoordinate(this.x,this.y,dim.w,dim.h,this.offsetX,this.offsetY);rs.left=coord.x+"px";rs.top=coord.y+"px";if(result&&!skipEmbody){this.unembody();result=false}return result};Meetup.DiscreteBase.prototype.retrieveDimension=function(skipEmbody){skipEmbody=skipEmbody||false;var dim,flag=false;if(!skipEmbody){flag=this.embody()}dim=Meetup.DiscreteHelper.smoothMochiKitPixelObject(MochiKit.Style.getElementDimensions(this.elements.root));this.w=dim.w;this.h=dim.h;if(flag&&!skipEmbody){flag=this.unembody()}return{w:this.w,h:this.h}};Meetup.DiscreteBase.prototype.translateCoordinate=function(x,y,w,h,offsetX,offsetY){var left,top;if(offsetX===true){left=Math.floor(x-(w/2))}else{left=x+offsetX}if(offsetY===true){top=Math.floor(y-h/2)}else{top=y+offsetY}return{x:left,y:top}};Meetup.DiscreteHelper={};Meetup.DiscreteHelper.REGEX_ABSOLUTE_PATH=new RegExp("^(http|https)://");Meetup.DiscreteHelper.REGEX_CSS_IMAGE=new RegExp(/\(["]?(.*?)["]?\)$/);Meetup.DiscreteHelper.REGEX_TRIM=new RegExp(/^\s+|\s+$/g);Meetup.DiscreteHelper.REGEX_JS_NUM=new RegExp(/\-*\d*\.\d+|\-*\d+/);Meetup.DiscreteHelper.trim=function(str){return str.replace(Meetup.DiscreteHelper.REGEX_TRIM,"")};Meetup.DiscreteHelper.wrap=function(func,delay){delay=delay||1;return function(){window.setTimeout(func,delay)}};Meetup.DiscreteHelper.bind=function(func,context){return function(){var arr=Array.prototype.slice.apply(arguments,[0]);return func.apply(context,arr)}};Meetup.DiscreteHelper.buildRoot=function(parent,className,innerHTML){var root=MochiKit.DOM.createDOM("div",{"class":className});MochiKit.Style.setStyle(root,{display:"none",position:"absolute"});root.innerHTML=innerHTML;parent=parent||document.body;parent.appendChild(root);return root};Meetup.DiscreteHelper.clearChildElements=function(elm){if(elm.childNodes===undefined){throw new Error("You need to pass DOM Element.  You have passed:"+elm)}for(var i=0,len=elm.childNodes.length;i<len;++i){elm.removeChild(elm.childNodes[0])}};Meetup.DiscreteHelper.compileColor=function(arr){var i,val,hex,result=["#"];for(i=0;i<3;++i){if(arr[i]<0){val=0}else{if(arr[i]>255){val=255}else{val=Math.round(arr[i])}}hex=val.toString(16);if(hex.length<2){hex="0"+hex}result[result.length]=hex}return result.join("")};Meetup.DiscreteHelper.convertRgbHsv=function(r,g,b){var h,s,v,dR,dG,dB,_r=r/255,_g=g/255,_b=b/255,min=Math.min(_r,_g,_b),max=Math.max(_r,_g,_b),delta=max-min;v=max;if(delta===0){h=0;s=0}else{s=delta/max;dR=(((max-_r)/6)+(delta/2))/delta;dG=(((max-_g)/6)+(delta/2))/delta;dB=(((max-_b)/6)+(delta/2))/delta;if(_r===max){h=dB-dG}else{if(_g===max){h=(1/3)+dR-dB}else{h=(2/3)+dG-dR}}if(h<0){h+=1}else{if(h>1){h-=1}}}return[h,s,v]};Meetup.DiscreteHelper.convertHsvRgb=function(h,s,v){var r,g,b,_h,_i,_1,_2,_3;if(s===0){r=v;g=v;b=v}else{_h=h*6;_i=Math.floor(_h);_1=v*(1-s);_2=v*(1-s*(_h-_i));_3=v*(1-s*(1-(_h-_i)));if(_i===0){r=v;g=_3;b=_1}else{if(_i===1){r=_2;g=v;b=_1}else{if(_i===2){r=_1;g=v;b=_3}else{if(_i===3){r=_1;g=_2;b=v}else{if(_i===4){r=_3;g=_1;b=v}else{r=v;g=_1;b=_2}}}}}}return[Math.round(r*255),Math.round(g*255),Math.round(b*255)]};Meetup.DiscreteHelper.findParent=function(elm,tag,cls){var c=0,iter=elm,fpc=Meetup.DiscreteHelper.findParentCheck;tag=tag.toLowerCase();while(fpc(iter,tag,cls)===false){if(c>10){throw new Error("Too deep recursion")}iter=iter.parentNode;++c}return iter};Meetup.DiscreteHelper.findParentCheck=function(elm,tag,cls){var result=false;if(elm.tagName.toLowerCase()===tag){if(cls===undefined||cls===null||elm.className===String(cls)){result=true}}return result};Meetup.DiscreteHelper.getAbsolutePath=function(path){var e=document.createElement("div");e.innerHTML='<a href="'+path+'" />';return e.firstChild.href};Meetup.DiscreteHelper.getBackgroundImagePathByElement=function(elm){var arr,bgi=MochiKit.Style.getStyle(elm,"background-image");arr=bgi.match(Meetup.DiscreteHelper.REGEX_CSS_IMAGE);if(arr===null){return null}return arr[1].match(Meetup.DiscreteHelper.REGEX_ABSOLUTE_PATH)?Meetup.DiscreteHelper.getAbsolutePath(arr[1]):arr[1]};Meetup.DiscreteHelper.getImageInfoFromCSS=function(tag,classname){var elm,dim,path;if(classname.indexOf(".")>0){classname=classname.split(".").join(" ")}elm=MochiKit.DOM.createDOM(tag,{"class":classname});elm.style.visibility="hidden";elm.style.display="none";document.body.appendChild(elm);dim=MochiKit.Style.getElementDimensions(elm);path=MochiKit.Style.getStyle(elm,"background-image");document.body.removeChild(elm);return{path:path,dimension:dim}};Meetup.DiscreteHelper.getNumeric=function(inp){if((inp===null)||(inp===undefined)){return null}var result,tmp,strType=typeof inp;switch(strType){case"boolean":result=+inp;break;case"function":result=null;break;case"number":result=inp;break;case"object":if(result instanceof Array){tmp=inp.join(".").match(Meetup.DiscreteHelper.REGEX_JS_NUM)}else{tmp=inp.toString().match(Meetup.DiscreteHelper.REGEX_JS_NUM)}if(tmp){result=parseFloat(tmp[0])}else{result=null}break;case"string":tmp=inp.match(Meetup.DiscreteHelper.REGEX_JS_NUM);if(tmp){result=parseFloat(tmp[0])}else{result=null}break}return result};Meetup.DiscreteHelper.getTextDimension=function(text,target){target=target||document.body;var MSG=MochiKit.Style.getStyle,fontSize=MSG(target,"font-size"),fontWeight=MSG(target,"font-weight"),fontStyle=MSG(target,"font-style"),fontFamily=MSG(target,"font-family"),fontVariant=MSG(target,"font-variant"),letterSpacing=MSG(target,"letter-spacing"),wordSpacing=MSG(target,"word-spacing"),textTransform=MSG(target,"text-transform"),elm=document.createElement("tentative");elm.style.visibility="hidden";elm.style.display="inline";if(fontSize){elm.style.fontSize=fontSize}if(fontWeight){elm.style.fontWeight=fontWeight}if(fontStyle){elm.style.fontStyle=fontStyle}if(fontFamily){elm.style.fontFamily=fontFamily}if(fontVariant){elm.style.fontVariant=fontVariant}if(letterSpacing){elm.style.letterSpacing=letterSpacing}if(wordSpacing){elm.style.wordSpacing=wordSpacing}if(textTransform){elm.style.textTransform=textTransform}elm.innerHTML=text;document.body.appendChild(elm);var result=MochiKit.Style.getElementDimensions(elm);document.body.removeChild(elm);return Meetup.DiscreteHelper.smoothMochiKitPixelObject(result)};Meetup.DiscreteHelper.isDOMNode=function(obj){var result=false,str_type=typeof obj.getElementsByTagName;if(str_type==="function"){result=true}else{if(str_type==="object"){if(obj.nodeName){result=true}}}return result};Meetup.DiscreteHelper.loadImgAsync=function(abspath,onLoad){var tick=0,delay=20,timeout=2000,img=new Image();img.finish=false;var funcError=function(ev){if(img.finish){return}img.finish=true;throw new Error("The given file path doesn't seem to exist")};img.onabort=funcError;img.onerror=funcError;img.onload=function(ev){img.finish=true;if(window.opera&&!img.complete){throw new Error("Opera specific problem")}onLoad(img)};img.src=abspath;if(!img.finish&&timeout){setTimeout(function(){if(img.finish){return}if(img.complete){img.finish=true;if(img.width){return}throw new Error("Unknown problem")}if((tick+=delay)>timeout){img.finish=true;throw new Error("Timeout")}setTimeout(arguments.callee,delay)},0)}};Meetup.DiscreteHelper.parseColorValue=function(val){if(typeof val!=="string"||val===""||val==="transparent"){return[255,255,255]}var first=val.substring(0,1);if(first==="#"){return Meetup.DiscreteHelper.parseColorSharp(val)}else{if(first==="r"){return Meetup.DiscreteHelper.parseColorRGB(val)}}throw new Error("Unknown value type: "+val)};Meetup.DiscreteHelper.parseColorRGB=function(val){var arr=val.slice(4,-1).split(",");return[parseInt(arr[0],10),parseInt(arr[1],10),parseInt(arr[2],10)]};Meetup.DiscreteHelper.parseColorSharp=function(val){var result=[0,0,0],len=val.length;if(len===4){var r=val.substring(1,2),g=val.substring(2,3),b=val.substring(3);result[0]=parseInt((r+r),16);result[1]=parseInt((g+g),16);result[2]=parseInt((b+b),16)}else{result[0]=parseInt(val.substring(1,3),16);result[1]=parseInt(val.substring(3,5),16);result[2]=parseInt(val.substring(5,7),16)}return result};Meetup.DiscreteHelper.round=function(inp,dec){dec=dec||2;var p=Math.pow(10,dec);return Math.round(inp*p)/p};Meetup.DiscreteHelper.smoothMochiKitPixelObject=function(obj){var i,result={},MF=Math.floor;for(i in obj){if(obj.hasOwnProperty(i)){result[i]=MF(obj[i])}}return result};Meetup.DiscreteHelper.stringify=function(obj){return""+obj};Meetup.DiscreteHelper.swapBackgroundToFilter=function(elm,path,isScale){isScale=isScale||false;elm.style.backgroundImage="none";if(isScale){elm.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+path+'",sizingMethod="scale")'}else{elm.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+path+'")'}};Meetup.DiscreteHelper.swapElementsBackgroundToFilter=function(){if(!(/msie/.test(navigator.userAgent.toLowerCase())&&!/opera/.test(navigator.userAgent.toLowerCase()))){return}var i,len,tag,path,parent=Meetup.DiscreteHelper,arr=arguments;for(i=0,len=arr.length;i<len;++i){tag=arr[i];path=parent.getBackgroundImagePathByElement(tag);parent.swapBackgroundToFilter(tag,path)}};Meetup.DiscreteHelper.swapElementsBackgroundToFilterScaled=function(){if(!(/msie/.test(navigator.userAgent.toLowerCase())&&!/opera/.test(navigator.userAgent.toLowerCase()))){return}var i,len,tag,path,parent=Meetup.DiscreteHelper,arr=arguments;for(i=0,len=arr.length;i<len;++i){tag=arr[i];path=parent.getBackgroundImagePathByElement(tag);parent.swapBackgroundToFilter(tag,path,true)}};
