/*
HTTP Host: static.ak.fbcdn.net
Generated: March 18th 2010 8:22:49 PM PDT
Machine: 10.16.140.110
Locale: nu_ll
Path: js/3chmwtx3xjwg0okw.pkg.js
*/

if (window.CavalryLogger) { CavalryLogger.start_js(["js\/3chmwtx3xjwg0okw.pkg.js"]); }

Base64={_initialized:false,_chars:null,_inv:null,_init:function(){Base64._chars=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"];Base64._inv={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,a:26,b:27,c:28,d:29,e:30,f:31,g:32,h:33,i:34,j:35,k:36,l:37,m:38,n:39,o:40,p:41,q:42,r:43,s:44,t:45,u:46,v:47,w:48,x:49,y:50,z:51,"0":52,"1":53,"2":54,"3":55,"4":56,"5":57,"6":58,"7":59,"8":60,"9":61,"+":62,"/":63};Base64._initialized=true;},encodeObject:function(a){return Base64.encode(JSON.encode(a));},decodeObject:function(a){return JSON.decode(Base64.decode(a));},_toUtf8:function(d){var c='';for(var b=0;b<d.length;b++){var a=d.charCodeAt(b);if(a<128){c+=String.fromCharCode(a);}else{if(a<2048){c+=String.fromCharCode((a>>6)|192);}else{if(a<65536){c+=String.fromCharCode((a>>12)|224);}else{c+=String.fromCharCode((a>>18)|240);c+=String.fromCharCode(((a>>12)&63)|128);}c+=String.fromCharCode(((a>>6)&63)|128);}c+=String.fromCharCode((a&63)|128);}}return c;},_fromUtf8:function(d){var c='';for(var b=0;b<d.length;b++){var a=d.charCodeAt(b);if(a<128){c+=String.fromCharCode(a);}else if(!(a<192))if(a<224&&d.length>b+1){c+=String.fromCharCode(((a&31)<<6)|(d.charCodeAt(++b)&63));}else if(a<240&&d.length>b+2){c+=String.fromCharCode(((a&15)<<12)|((d.charCodeAt(++b)&63)<<6)|(d.charCodeAt(++b)&63));}else if(a<248&&d.length>b+3)c+=String.fromCharCode(((a&7)<<18)|((d.charCodeAt(++b)&63)<<12)|((d.charCodeAt(++b)&63)<<6)|(d.charCodeAt(++b)&63));}return c;},encode:function(e){if(!Base64._initialized)Base64._init();e=Base64._toUtf8(e);var d='';var c='';var a=e.length%3;if(a>0)for(;a<3;a++){c+='=';e+="\0";}for(a=0;a<e.length;a+=3){var b=(e.charCodeAt(a)<<16)+(e.charCodeAt(a+1)<<8)+e.charCodeAt(a+2);b=[(b>>>18)&63,(b>>>12)&63,(b>>>6)&63,b&63];d+=Base64._chars[b[0]]+Base64._chars[b[1]]+Base64._chars[b[2]]+Base64._chars[b[3]];}return d.substring(0,d.length-c.length)+c;},decode:function(e){if(!Base64._initialized)Base64._init();e=e.replace(new RegExp('[^'+Base64._chars.join("")+'=]','g'),"");var c=(e.charAt(e.length-1)=='='?(e.charAt(e.length-2)=='='?'AA':'A'):"");var d="";e=e.substr(0,e.length-c.length)+c;for(var a=0;a<e.length;a+=4){var b=(Base64._inv[e.charAt(a)]<<18)+(Base64._inv[e.charAt(a+1)]<<12)+(Base64._inv[e.charAt(a+2)]<<6)+Base64._inv[e.charAt(a+3)];d+=String.fromCharCode((b>>>16)&255,(b>>>8)&255,b&255);}d=d.substring(0,d.length-c.length);return Base64._fromUtf8(d);}};
var Drag={};Drag.currentDraggable=null;Drag.grab=function(a){if(Drag.currentDraggable)Drag._onmouseup();a.lastDragOver=null;Drag.attachDragEvents();Drag.currentDraggable=a;};Drag.attachDragEvents=function(){document.onselectstart=function(){document.onselectstart=null;return false;};if(Drag.dragEventsAttached)return;Drag.dragEventsAttached=true;Arbiter.subscribe('scroller/scroll',Drag._onmousemove);Event.listen(document,{mousemove:Drag._onmousemove,mouseup:Drag._onmouseup});};Drag.droppables={};Drag.addDroppable=function(b,a){(Drag.droppables[b]=Drag.droppables[b]||[]).push(a);};Drag.removeDroppable=function(b,a){Drag.droppables[b]=Drag.droppables[b].filter(function(c){return c!=a;});};Drag._onmousemove=function(event,c){if(!Drag.currentDraggable)return;var d=c||Vector2.getEventPosition(event),b=Drag.currentDraggable,e=Drag.droppables[b.namespace];if(b.namespace&&b.active&&e){var j={};e.each(function(k){j[k.zIndex]=k.zIndex;});var i=[];for(var f in j)i.push(j[f]);i.sort();var g=b.lastDragOver,a=null;for(var h=i.length;h>=0;h--)if(g&&g.dom!=null&&g.zIndex==i[h]&&g.pointInside(d)){a=g;break;}else for(var f=0;f<e.length;f++){if(i[h]!=e[f].zIndex)continue;if(g!=e[f]&&b.dom!=e[f].dom&&e[f].pointInside(d)){a=e[f];h=-1;break;}}if(a&&a!=g)a.ondragover(b);if(a)a.ondragmove(b,d.sub(Vector2.getElementPosition(a.dom)));b.lastDragOver=a;}Drag.currentDraggable._onmousemove(d);};Drag._onmouseup=function(a){document.onselectstart=null;if(Drag.currentDraggable){Drag.currentDraggable._ondrop();Drag.currentDraggable=null;}};function Draggable(b){if(!b)throw new Error('Element should be a DOM node');if(this==window){if(b instanceof Array){var a=[];b.each(function(c){a.push(new Draggable(c));});return new Collection(Draggable,a);}else return new Draggable(b);}else{this.data={};this.handles=[];this.dom=b;this.boundingBox=null;this.addHandle(this.dom);}}Draggable.prototype.destroy=function(){this.handles.each(function(a){this.removeHandle(a.obj);}.bind(this));this.data=this.dom=null;};Draggable.prototype._onclick=function(event){if(this.active)return Event.kill(event);};Draggable.prototype._ongrab=function(a){this.ongrab();if(!this.scroller)this.scroller=new Scroller(Scroller.findScrollParent(this.dom));this.scroller.activate();if(this.active){if(!this.oldPosition)this.oldPosition=this.dom.style.position;this.dom.style.position=this.absolute?'absolute':'relative';a.sub(this.cursorPositionVector).setElementPosition(this.dom);}};Draggable.prototype._onmousedown=function(event){var a=$E(event).getTarget();if(DOM.isNode(a,['input','select','textarea','object','embed']))return true;var b=Vector2.getEventPosition(event);this.draggableInitialVector=Vector2.getElementPosition(this.dom);this.cursorPositionVector=b.sub(this.draggableInitialVector);Drag.grab(this,event);if(this.gutter){this.cursorInitialVector=b;}else{this._setActive(true);this._ongrab(b);}return Event.kill(event);};Draggable.prototype._onmousemove=function(d){if(!this.active)if(d.distanceTo(this.cursorInitialVector)>=this.gutter){this._setActive(true);this._ongrab(d);}if(this.active){var c=Vector2.getElementPosition(this.dom).sub(new Vector2(parseInt(this.dom.style.left?this.dom.style.left:CSS.getStyle(this.dom,'left'),10)||0,parseInt(this.dom.style.top?this.dom.style.top:CSS.getStyle(this.dom,'top'),10)||0));var e=d.sub(c).sub(this.cursorPositionVector);if(this.boundingBox){var a=Rect.newFromVectors(e,Vector2.getElementDimensions(this.dom));a=a.boundWithin(this.boundingBox);e=a.getPositionVector(a);if(this.boundingBox.w()==0){var b=new Vector2(this.draggableInitialVector.x,e.y,'document');}else if(this.boundingBox.h()==0){var b=new Vector2(e.x,this.draggableInitialVector.y,'document');}else var b=e;}else var b=e;b.setElementPosition(this.dom);this.ondrag(d);}};Draggable.prototype._ondrop=function(){this.scroller&&this.scroller.deactivate();if(this.active){(function(){this._setActive(false);}).bind(this).defer();this.ondrop();if(this.lastDragOver)this.lastDragOver.ondrop(this);}};Draggable.prototype.killDrag=function(){this._setActive(false);Drag._onmouseup();};Draggable.prototype.setBoundingBox=function(a){this.boundingBox=a;return this;};Draggable.prototype.resetPosition=function(){this.dom.style.position=this.oldPosition;this.oldPosition=null;this.dom.style.left=null;this.dom.style.top=null;return this;};Draggable.prototype.setUseAbsolute=function(a){this.absolute=a;return this;};Draggable.prototype.ondrag=bagofholding;Draggable.prototype.setDragHandler=function(a){this.ondrag=a;return this;};Draggable.prototype.ongrab=bagofholding;Draggable.prototype.setGrabHandler=function(a){this.ongrab=a;return this;};Draggable.prototype.ondrop=bagofholding;Draggable.prototype.setDropHandler=function(a){this.ondrop=a;return this;};Draggable.prototype.gutter=0;Draggable.prototype.setGutter=function(a){this.gutter=a;return this;};Draggable.prototype.setNamespace=function(a){this.namespace=a;return this;};Draggable.prototype.handles=null;Draggable.prototype.addHandle=function(a){if(this.handles.length==1&&this.handles[0].obj==this.dom)this.removeHandle(this.dom);this.handles.push({obj:a,evt:[Event.listen(a,'mousedown',this._onmousedown.bind(this)),Event.listen(a,'click',this._onclick.bind(this)),Event.listen(a,'drag',Event.kill),Event.listen(a,'selectstart',Event.kill)]});return this;};Draggable.prototype.removeHandle=function(a){this.handles=this.handles.filter(function(b){if(b.obj!=a){return true;}else{b.evt.each(function(c){c.remove();});return false;}});};Draggable.prototype.getDOM=function(){return this.dom;};Draggable.prototype.setKey=function(a,b){this.data[a]=b;return this;};Draggable.prototype.getKey=function(a){return this.data[a];};Draggable.prototype._setActive=function(b){this.dom.activeDrag=this.active=b;for(var a=0;a<this.handles.length;a++)this.handles[a].obj.activeDrag=b;};function Droppable(b){if(!b)throw new Error('Element should be a DOM node');if(this==window){if(b instanceof Array){var a=[];b.each(function(c){a.push(new Droppable(c));});return new Collection(Droppable,a);}else return new Droppable(b);}else{this.data={};this.dom=b;this.namespace=null;}}Droppable.prototype.destroy=function(){if(this.namespace)Drag.removeDroppable(this.namespace,this);this.data=this.dom=null;};Droppable.prototype.setNamespace=function(a){if(this.namespace)Drag.removeDroppable(a,this);this.namespace=a;Drag.addDroppable(a,this);return this;};Droppable.prototype.zIndex=0;Droppable.prototype.setZIndex=function(a){this.zIndex=a;return this;};Droppable.prototype.pointInside=function(b){var a=Vector2.getElementPosition(this.dom);return a.x<=b.x&&this.dom.offsetWidth+a.x>b.x&&a.y<=b.y&&this.dom.offsetHeight+a.y>b.y;};Droppable.prototype.ondragover=bagofholding;Droppable.prototype.setDragOverHandler=function(a){this.ondragover=a;return this;};Droppable.prototype.ondragmove=bagofholding;Droppable.prototype.setDragMoveHandler=function(a){this.ondragmove=a;return this;};Droppable.prototype.ondrop=bagofholding;Droppable.prototype.setDropHandler=function(a){this.ondrop=a;return this;};Droppable.prototype.getDOM=Draggable.prototype.getDOM;Droppable.prototype.setKey=Draggable.prototype.setKey;Droppable.prototype.getKey=Draggable.prototype.getKey;
function SortableGroup(){this.namespace='sortable'+(++SortableGroup.instanceCount);this.draggables={};this.droppables={};this.sortables={};this.linkedGroups=[];this.linkedGroups.onlinkjump=bagofholding;this.rootNode=null;this.boundingBox=null;this.neverEmpty=false;this.hasEmptyMessage=false;this.isDroppable=true;this.anchor=null;}SortableGroup.instanceCount=0;SortableGroup.prototype.gutter=15;SortableGroup.prototype.setBoundingBox=function(a){this.boundingBox=a;for(var b in this.draggables)this.draggables[b].setBoundingBox(this.boundingBox);return this;};SortableGroup.prototype.setDroppable=function(a){this.isDroppable=a;return this;};SortableGroup.prototype._initializeAdded=function(a,b){if(this.rootNode===null){this.rootNode=b.parentNode;if(!this.linkedGroups.placeholder){this.linkedGroups.placeholder=this.placeholder=$N(b.tagName,{className:'dragPlaceholder',style:{padding:'0px'}});}else this.placeholder=this.linkedGroups.placeholder;}else if(this.rootNode!=b.parentNode)throw new Error('All sortables of a collection must share the same parentNode');if(a in this.draggables)throw new Error('All sortables must have a unique key');};SortableGroup.prototype.addSortable=function(b,c,a){this._initializeAdded(b,c);this.sortables[b]=c;this.draggables[b]=(new Draggable(c)).setNamespace(this.namespace).setGutter(this.gutter).setUseAbsolute(true).setGrabHandler(this.grabHandler.bind(this,b)).setDropHandler(this.dropHandler.bind(this,b)).setKey('key',b).setBoundingBox(this.boundingBox);if(a)this.draggables[b].addHandle(a);this.droppables[b]=(new Droppable(c)).setNamespace(this.namespace).setDragOverHandler(this._dragOverHandlerShim.bind(null,this,b));return this;};SortableGroup.prototype.addEmptyMessage=function(b,c){var a='placeholder';if(b.parentNode!=c)c.appendContent(b);this._initializeAdded(a,b);this.hasEmptyMessage=true;this.sortables[a]=b;this.droppables[a]=(new Droppable(b)).setNamespace(this.namespace).setDragOverHandler(this._dragOverHandlerShim.bind(null,this,a));return this;};SortableGroup.prototype.setNeverEmpty=function(a){this.neverEmpty=a;};SortableGroup.prototype.link=function(c){c.linkedGroups=this.linkedGroups;if(!this.linkedGroups.length)this.linkedGroups.push(this);this.linkedGroups.push(c);for(var a=0;a<this.linkedGroups.length;a++)if(this.linkedGroups[a].namespace!=this.namespace){this.linkedGroups[a].namespace=this.namespace;for(var b in this.linkedGroups[a].droppables){this.linkedGroups[a].droppables[b].setNamespace(this.namespace);this.linkedGroups[a].draggables[b].setNamespace(this.namespace);}}return this;};SortableGroup.prototype.getOrder=function(){if(!this.rootNode)return [];var d=[],a=this.rootNode.childNodes;for(var b=0;b<a.length;b++)for(var c in this.sortables)if(this.sortables[c]==a[b]){d.push(c);break;}return d;};SortableGroup.prototype.migrateLinkedSortable=function(b){for(var a=0;a<this.linkedGroups.length;a++)if(b in this.linkedGroups[a].draggables){this.sortables[b]=this.linkedGroups[a].sortables[b];this.draggables[b]=this.linkedGroups[a].draggables[b];this.draggables[b].setGrabHandler(this.grabHandler.bind(this,b)).setDropHandler(this.dropHandler.bind(this,b));this.droppables[b]=this.linkedGroups[a].droppables[b];this.droppables[b].setDragOverHandler(this._dragOverHandlerShim.bind(null,this,b));delete this.linkedGroups[a].sortables[b];delete this.linkedGroups[a].draggables[b];delete this.linkedGroups[a].droppables[b];return true;}return false;};SortableGroup.prototype.setLinkJumpHandler=function(a){this.linkedGroups.onlinkjump=a;return this;};SortableGroup.prototype.onorderchange=bagofholding;SortableGroup.prototype.setOrderChangeHandler=function(a){this.onorderchange=a;return this;};SortableGroup.prototype.ongrabcallback=bagofholding;SortableGroup.prototype.setGrabCallback=function(a){this.ongrabcallback=a;return this;};SortableGroup.prototype._checkLastRemaining=function(a){var b=this.hasEmptyMessage?2:1;return this.neverEmpty&&this.rootNode.childNodes.length==b;};SortableGroup.prototype.grabHandler=function(a){if(this._checkLastRemaining()){this.draggables[a].killDrag();return;}CSS.setClass(this.placeholder,this.sortables[a].className);CSS.addClass(this.placeholder,'droppable_placeholder');CSS.addClass(this.sortables[a],'drag');Vector2.getElementDimensions(this.sortables[a]).setElementDimensions(this.placeholder);this.rootNode.insertBefore(this.placeholder,this.sortables[a]);this.ongrabcallback(a);if(!this.isDroppable){var b=this.sortables[a];this.anchor=b.nextSibling;if(!this.anchor){this.anchor=$N('div');b.parentNode.appendChild(this.anchor);}}};SortableGroup.prototype.ondropcallback=bagofholding;SortableGroup.prototype.setDropCallback=function(a){this.ondropcallback=a;return this;};SortableGroup.prototype.dropHandler=function(a){if(this._checkLastRemaining()){this.draggables[a].resetPosition();return;}CSS.removeClass(this.sortables[a],'drag');this.draggables[a].resetPosition();this.rootNode.insertBefore(this.sortables[a],this.placeholder);this.rootNode.removeChild(this.placeholder);for(var b=0;b<this.linkedGroups.length;b++)if(this.linkedGroups[b].anchor)delete this.linkedGroups[b].anchor;this.ondropcallback(a);this.onorderchange();};SortableGroup.prototype._dragOverHandlerShim=function(c,b,a){c.dragOverHandler(b,a.getKey('key'));};SortableGroup.prototype.dragOverHandler=function(f,d){if(!this.isDroppable&&!this.anchor)return;var h=false;if(!(d in this.draggables)){if(!this.migrateLinkedSortable(d))throw new Error('Draggable dropped onto a foreign droppable!');h=true;}var a=true,b=this.rootNode.childNodes,c=this.sortables[d],e=this.sortables[f];if(!this.anchor){var i=b.length;for(var g=0;g<i;g++)if(b[g]==e){break;}else if(b[g]==c){a=false;break;}}else e=this.anchor;if(a||this.anchor){this.rootNode.insertBefore(this.placeholder,e);}else this.rootNode.insertBefore(this.placeholder,e.nextSibling);this.rootNode.insertBefore(c,this.placeholder);this.ondragover(c,e);if(h)this.linkedGroups.onlinkjump.call(this,d);};SortableGroup.prototype.ondragover=bagofholding;SortableGroup.prototype.setDragOverCallback=function(a){this.ondragover=a;return this;};SortableGroup.prototype.destroy=function(){for(var b in this.droppables)this.droppables[b].destroy();for(var b in this.draggables)this.draggables[b].destroy();this.droppables=this.draggables=this.rootNode=null;this.linkedGroups.remove(this);for(var a=0;a<this.linkedGroups.length;a++)this.linkedGroups[a].linkedGroups=this.linkedGroups;};SortableGroup.prototype.removeSortable=function(a){if(a in this.sortables){this.draggables[a].destroy();this.droppables[a].destroy();delete this.draggables[a];delete this.droppables[a];delete this.sortables[a];}};SortableGroup.prototype.keyExists=function(a){return this.sortables[a];};
function typeaheadpro(a,c,b){if(!typeaheadpro.hacks){typeaheadpro.should_check_missing_events=ua.safari()<500;typeaheadpro.should_simulate_keypress=ua.ie()||(ua.safari()>500&&ua.safari()<523||ua.safari()>=525);if(typeaheadpro.should_use_iframe==undefined)typeaheadpro.should_use_iframe=ua.ie()<7;typeaheadpro.should_use_overflow=ua.opera()<9.5||ua.safari()<500;if(ua.firefox())this.activate_poll_on_focus_events=true;typeaheadpro.hacks=true;}typeaheadpro.instances=(typeaheadpro.instances||[]);typeaheadpro.instances.push(this);this.instance=typeaheadpro.instances.length-1;copy_properties(this,b||{});this.obj=a;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.want_icon_list=false;this.showing_icon_list=false;this.stop_suggestion_select=false;if(this.typeahead_icon_class&&this.typeahead_icon_get_return){this.typeahead_icon=document.createElement('div');CSS.addClass(this.typeahead_icon,'typeahead_list_icon');CSS.addClass(this.typeahead_icon,this.typeahead_icon_class);this.typeahead_icon.innerHTML='&nbsp;';this.setup_typeahead_icon();setTimeout(function(){this.focus();}.bind(this),50);this.typeahead_icon.onmousedown=function(event){return this.typeahead_icon_onclick(event||window.event);}.bind(this);}this.focused=this.focused||this.obj.offsetWidth?true:false;this.anchor=this.setup_anchor();this.dropdown=document.createElement('div');CSS.addClass(this.dropdown,'typeahead_list');if(!this.focused)this.dropdown.style.display='none';this.anchor_block=this.anchor_block||this.anchor.tagName.toLowerCase()=='div';DOMScroll.getScrollRoot().appendChild(this.dropdown);this.dropdown.className+=' typeahead_list_absolute';this.list=$N('div');this.dropdown.appendChild(this.list);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";CSS.setClass(typeaheadpro.iframe,'typeahead_iframe');typeaheadpro.iframe.style.display='none';typeaheadpro.iframe.frameBorder=0;DOMScroll.getScrollRoot().appendChild(typeaheadpro.iframe);}if(typeaheadpro.should_use_iframe&&typeaheadpro.iframe)typeaheadpro.iframe.style.zIndex=parseInt(CSS.getStyle(this.dropdown,'zIndex'))-1;this.log_data={kt:0,kp:0,sm:null,ty:0,f:1};this.results_text='';this.last_key_suggestion=0;this.status=typeaheadpro.STATUS_BLOCK_ON_SOURCE_BOOTSTRAP;this.clear_placeholder();if(c)this.set_source(c);if(this.source){this.selectedindex=-1;if(this.focused){this._onfocus();this.show();this._onkeyup();this.set_class('');this.capture_submit();}}else this.hide();onunloadRegister(this._onunload.bind(this),true);}typeaheadpro.prototype.enumerate=false;typeaheadpro.prototype.interactive=false;typeaheadpro.prototype.changed=false;typeaheadpro.prototype.render_block_size=50;typeaheadpro.prototype.typeahead_icon_class=false;typeaheadpro.prototype.typeahead_icon_get_return=false;typeaheadpro.prototype.old_value=null;typeaheadpro.prototype.poll_handle=null;typeaheadpro.prototype.activate_poll_on_focus_events=false;typeaheadpro.prototype.suggestion_count=0;typeaheadpro.STATUS_IDLE=0;typeaheadpro.STATUS_WAITING_ON_SOURCE=1;typeaheadpro.STATUS_BLOCK_ON_SOURCE_BOOTSTRAP=2;typeaheadpro.prototype.clear_value_on_blur=true;typeaheadpro.prototype.max_results=0;typeaheadpro.prototype.max_display=10;typeaheadpro.prototype.allow_placeholders=false;typeaheadpro.prototype.auto_select=true;typeaheadpro.prototype.auto_select_exactmatch=false;typeaheadpro.dirty_instances=function(){if(typeaheadpro.instances)typeaheadpro.instances.forEach(function(a){a.update_status(typeaheadpro.STATUS_BLOCK_ON_SOURCE_BOOTSTRAP);if(a.source)a.source.is_ready=false;});};typeaheadpro.prototype.set_source=function(a){this.source=a;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(){if(this.typeahead_icon){DOM.remove(this.typeahead_icon);this.toggle_icon_list=function(){};}this.clear_render_timeouts();if(!this.anchor_block&&this.anchor.nextSibling.tagName.toLowerCase()=='br')DOM.remove(this.anchor.nextSibling);if(this.dropdown)DOM.remove(this.dropdown);if(this.obj){this.obj.onfocus=this.obj.onblur=this.obj.onkeyup=this.obj.onkeydown=this.obj.onkeypress=this.obj.typeahead=null;DOM.remove(this.obj);}this.anchor=this.obj=this.dropdown=null;delete typeaheadpro.instances[this.instance];};typeaheadpro.prototype.check_value=function(){if(this.obj){var a=this.obj.value;if(a!=this.old_value){this.dirty_results();this.old_value=a;if(this.old_value==='')this._onselect(false);}}};typeaheadpro.prototype._onkeyup=function(a){a=$E(a);this.last_key=a?a.keyCode:-1;if(this.key_down==this.last_key)this.key_down=0;var b=true;switch(this.last_key){case KEYS.ESC:this.selectedindex=-1;this._onselect(false);this.hide();a.stop();b=false;break;}return b;};typeaheadpro.prototype._onkeydown=function(a){a=$E(a);this.key_down=this.last_key=a?a.keyCode:-1;this.interactive=true;switch(this.last_key){case KEYS.PAGE_UP:case KEYS.PAGE_DOWN:case KEYS.UP:case KEYS.DOWN:this.log_data.kt+=1;if(typeaheadpro.should_simulate_keypress)this._onkeypress({keyCode:this.last_key});return false;case KEYS.TAB:this.log_data.kt+=1;this.select_suggestion(this.selectedindex);if(a.shiftKey){this.reverse_focus();}else this.advance_focus();break;case KEYS.RETURN:this.log_data.sm='key_ret';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;case 229:if(!this.poll_handle)this.poll_handle=setInterval(this.check_value.bind(this),100);break;default:this.log_data.kp+=1;setTimeout(bind(this,'check_value'),this.source.check_limit);}};typeaheadpro.prototype._onkeypress=function(a){a=$E(a);var b=1;this.last_key=a?Event.getKeyCode(a):-1;this.interactive=true;switch(this.last_key){case KEYS.PAGE_UP:b=this.max_display;case KEYS.UP:this.set_suggestion(b>1&&this.selectedindex>0&&this.selectedindex<b?0:this.selectedindex-b);this.last_key_suggestion=(new Date()).getTime();return false;case KEYS.PAGE_DOWN:b=this.max_display;case KEYS.DOWN: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+b?this.suggestions.length-1:this.selectedindex+b);this.last_key_suggestion=(new Date()).getTime();}return false;case KEYS.RETURN:var c=null;if(typeof(this.submit_keydown_return)=='undefined'){c=this.submit_keydown_return=this._onsubmit(this.get_current_selection());}else{c=this.submit_keydown_return;delete this.submit_keydown_return;}a.stop();return c;default:setTimeout(bind(this,'check_value'),this.source.check_limit);break;}return true;};typeaheadpro.prototype._onchange=function(){this.changed=true;};typeaheadpro.prototype._onfound=function(a){return this.onfound?this.onfound.call(this,a):true;};typeaheadpro.prototype._onsubmit=function(a){if(this.onsubmit){var b=this.onsubmit.call(this,a);if(b&&this.obj.form){if(!this.obj.form.onsubmit||this.obj.form.onsubmit())this.obj.form.submit();return false;}return b;}else{this.advance_focus();return false;}};typeaheadpro.prototype._onselect=function(c){var b=(function(){if(this.onselect)this.onselect.call(this,c);}).bind(this);if(c.no_email){var a=new AsyncRequest().setData({action:'require',require_field:'email',uid:c.i}).setMethod('GET').setReadOnly(true).setURI('/friends/ajax/external.php');new Dialog().setCloseHandler(function(e){var d=this.getUserData();if(d){b();}else e.set_value('');}.bind(null,this)).setAsync(a).show();}else b();};typeaheadpro.prototype._onfocus=function(){if(!this.poll_handle&&this.activate_poll_on_focus_events)this.poll_handle=setInterval(this.check_value.bind(this),100);if(this.source)this.source.bootstrap();if(this.last_dropdown_mouse>(new Date()).getTime()-10||this.focused)return;if(this.changed)this.dirty_results();this.focused=true;this.changed=false;this.clear_placeholder();this.results_text='';this.set_class('');this.show();this.capture_submit();if(this.typeahead_icon)show(this.typeahead_icon);};typeaheadpro.prototype._onblur=function(event){if(this.last_dropdown_mouse&&this.last_dropdown_mouse>(new Date()).getTime()-10&&this.is_showing_suggestions()){Event.kill(event);setTimeout(function(){this.focus();}.bind(this),0);return false;}if(!this.stop_hiding){if(this.showing_icon_list)this.toggle_icon_list(true);}else{this.focus();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.auto_select||this.auto_select_exactmatch))this.select_suggestion(this.selectedindex);this.hide();this.update_class();if(this.clear_value_on_blur&&!this.get_value()){var a=this.allow_placeholders?this.source.gen_noinput():'';this.set_value(a?a:'');this.set_class('DOMControl_placeholder');}if(this.poll_handle){clearInterval(this.poll_handle);this.poll_handle=null;}};typeaheadpro.prototype._onunload=function(){if(typeaheadpro.instances[this.instance])this.hide();};typeaheadpro.prototype.typeahead_icon_onclick=function(event){this.stop_hiding=true;this.focus();setTimeout(function(){this.toggle_icon_list();}.bind(this),50);Event.kill(event);return false;};typeaheadpro.prototype.dropdown_onmousedown=function(event){this.last_dropdown_mouse=(new Date()).getTime();};typeaheadpro.prototype.setup_typeahead_icon=function(){this.typeahead_parent=document.createElement('div');CSS.addClass(this.typeahead_parent,'typeahead_parent');this.typeahead_parent.appendChild(this.typeahead_icon);this.obj.parentNode.insertBefore(this.typeahead_parent,this.obj);};typeaheadpro.prototype.mouse_set_suggestion=function(a){if(!this.visible)return;if((new Date()).getTime()-this.last_key_suggestion>50)this.set_suggestion(a);};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!=KEYS.RETURN&&this.key_down!=KEYS.TAB)?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(b){this.stop_suggestion_select=false;if(!this.suggestions||this.suggestions.length<=b)return;var c=this.get_suggestion_node(this.selectedindex);this.selectedindex=(b<=-1)?-1:b;var a=this.get_suggestion_node(this.selectedindex);if(c){CSS.removeClass(c,'typeahead_selected');CSS.addClass(c,'typeahead_not_selected');}if(a){CSS.removeClass(a,'typeahead_not_selected');CSS.addClass(a,'typeahead_selected');}this.recalc_scroll();this._onfound(this.get_current_selection());};typeaheadpro.prototype.get_suggestion_node=function(a){var b=this.list.childNodes;return a==-1?null:b[Math.floor(a/this.render_block_size)].childNodes[a%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(a){if(!this.stop_suggestion_select&&this.current_selecting!=a)this.current_selecting=a;var b=true;if(!this.suggestions||a==undefined||a===false||this.suggestions.length<=a||a<0){this._onfound(false);this._onselect(false);this.selectedindex=-1;this.set_class('');b=false;}else{this.selectedindex=a;var c=this.suggestions[a].ty;if(c!='web'&&c!='search')this.set_value(this.suggestions[a].t);this.set_class('typeahead_found');this._onfound(this.suggestions[this.selectedindex]);this._onselect(this.suggestions[this.selectedindex]);}if(!this.interactive){this.hide();this.blur();}this.current_selecting=null;if(!b&&this.ignore_invalid_suggestion)return false;return true;};typeaheadpro.prototype.is_showing_suggestions=function(){return (this.suggestions)&&(this.suggestions.length>0);};typeaheadpro.prototype.set_value=function(a){this.obj.value=a;};typeaheadpro.prototype.get_value=function(){if(this.showing_icon_list&&this.old_typeahead_value!=this.obj.value)this.toggle_icon_list();if(this.want_icon_list){return this.typeahead_icon_get_return;}else if(this.showing_icon_list)this.toggle_icon_list();return this.obj.value;};typeaheadpro.prototype.found_suggestions=function(m,n,c){if(!m)m=[];this.suggestion_count=m.length;if(!c){this.status=typeaheadpro.STATUS_IDLE;this.add_cache(n,m);}this.clear_render_timeouts();if(this.get_value()==this.results_text){return;}else if(!c){this.results_text=typeahead_source.flatten_string(n);if(this.enumerate&&trim(this.results_text)!='')this.enumerate=false;}var b=-1;if(this.selectedindex>0||(this.selectedindex==0&&!this.auto_select)){var k=this.suggestions[this.selectedindex].i;for(var f=0,g=m.length;f<g;f++)if(m[f].i==k){b=f;break;}}if(b==-1&&this.auto_select&&m.length){b=0;this._onfound(m[0]);}else if(this.auto_select_exactmatch&&m.length)if(n.toLowerCase()===m[0].t.toLowerCase()){b=0;this._onfound(m[0]);}else b=-1;this.selectedindex=b;this.suggestions=m;if(!c)this.real_suggestions=m;if(m.length){var e=[],a=Math.ceil(m.length/this.render_block_size),h={},d,j=null;DOM.empty(this.list);for(var f=0;f<a;f++)this.list.appendChild(document.createElement('div'));if(b>-1){d=Math.floor(b/this.render_block_size);h[d]=true;if(b%this.render_block_size>this.render_block_size/2){h[d+1]=true;}else if(d!=0)h[d-1]=true;}else h[0]=true;for(var i in h){this.render_block(i);sample=this.list.childNodes[i].firstChild;}this.show();if(a){var l=sample.offsetHeight;this.render_timeouts=[];for(var f=1;f<a;f++)if(!h[f]){this.list.childNodes[f].style.height=l*Math.min(this.render_block_size,m.length-f*this.render_block_size)+'px';this.render_timeouts.push(setTimeout(this.render_block.bind(this,f),700+f*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(!c&&this.results_text!=typeahead_source.flatten_string(this.get_value()))this.dirty_results();};typeaheadpro.prototype.render_block=function(a,h){var i=this.suggestions,g=this.selectedindex,j=this.get_value(),d=this.instance,b=[],f=this.list.childNodes[a];for(var c=a*this.render_block_size,e=Math.min(i.length,(a+1)*this.render_block_size);c<e;c++){b.push('<div class="');if(g==c){b.push('typeahead_suggestion typeahead_selected');}else b.push('typeahead_suggestion typeahead_not_selected');if(c>0&&i[c-1].o<0&&i[c].o>=0)b.push(' typeahead_delimiter');b.push('" onmouseover="typeaheadpro.instances[',d,'].mouse_set_suggestion(',c,')" ','onmousedown="var instance=typeaheadpro.instances[',d,']; instance.select_suggestion(',c,');instance.hide();Event.kill(event);">',this.source.gen_html(i[c],j),'</div>');}f.innerHTML=b.join('');f.style.height='auto';CSS.addClass(f,'typeahead_suggestions');};typeaheadpro.prototype.clear_render_timeouts=function(){if(this.render_timeouts){for(var a=0;a<this.render_timeouts.length;a++)clearTimeout(this.render_timeouts[a]);this.render_timeouts=null;}};typeaheadpro.prototype.recalc_scroll=function(){var a=this.list.firstChild;if(!a)return;if(a.childNodes.length>this.max_display){var c=a.childNodes[this.max_display-1];var b=c.offsetTop+c.offsetHeight;this.dropdown.style.height=b+'px';var e=this.get_suggestion_node(this.selectedindex);if(e){var d=this.dropdown.scrollTop;if(e.offsetTop<d){this.dropdown.scrollTop=e.offsetTop;}else if(e.offsetTop+e.offsetHeight>b+d)this.dropdown.scrollTop=e.offsetTop+e.offsetHeight-b;}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(a){return this.cache[typeahead_source.flatten_string(a)];};typeaheadpro.prototype.add_cache=function(b,a){if(this.source.cache_results)this.cache[typeahead_source.flatten_string(b)]=a;};typeaheadpro.prototype.update_status=function(a){this.status=a;this.dirty_results();};typeaheadpro.prototype.set_class=function(a){CSS.setClass(this.obj,(this.obj.className.replace(/typeahead_[^\s]+/g,'')+' '+a).replace(/ {2,}/g,' '));};typeaheadpro.prototype.dirty_results=function(){if(!this.enumerate&&this.get_value().trim()==''){DOM.empty(this.list);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 c=(new Date()).getTime();var e=false;if(this.last_search<=(c-this.source.search_limit)&&this.status==typeaheadpro.STATUS_IDLE){e=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-(c-this.last_search));if(this.source.allow_fake_results&&this.real_suggestions&&!e){var d=typeahead_source.tokenize(this.get_value()).sort(typeahead_source._sort);var a=[];for(var b=0;b<this.real_suggestions.length;b++)if(typeahead_source.check_match(d,this.real_suggestions[b].t+' '+this.real_suggestions[b].n))a.push(this.real_suggestions[b]);if(a.length){this.found_suggestions(a,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 a;if((a=this.search_cache(this.get_value()))===undefined&&!(a=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(a,this.get_value(),false);return true;};typeaheadpro.prototype.set_message=function(a){this.clear_render_timeouts();if(a){this.list.innerHTML='<div class="typeahead_message">'+a+'</div>';this.reset_iframe();}else this.hide();this.recalc_scroll();};typeaheadpro.prototype.reset_iframe=function(){if(!typeaheadpro.should_use_iframe)return;typeaheadpro.iframe.style.top=this.dropdown.style.top;typeaheadpro.iframe.style.left=this.dropdown.style.left;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(){return this._move_focus(true);};typeaheadpro.prototype.reverse_focus=function(){return this._move_focus(false);};typeaheadpro.prototype._move_focus=function(c){var b=this.obj.form?get_all_form_inputs(this.obj.form):get_all_form_inputs();var d=[];d._insert=c?d.push:d.unshift;var e=!c;for(var a=0;a<b.length;a++)if(!c&&b[a]==this.obj){e=false;}else if(e&&b[a].type!='hidden'&&b[a].tabIndex!=-1&&b[a].offsetParent){d._insert(b[a]);}else if(b[a]==this.obj)e=true;setTimeout(function(){for(var f=0;f<this.length;f++)try{if(this[f].offsetParent){this[f].focus();setTimeout(function(){try{this.focus();}catch(e){}}.bind(this[f]),0);return;}}catch(e){}}.bind(d?d:[]),0);this.blur();this.hide();};typeaheadpro.prototype.clear_placeholder=function(){if(this.obj.className.indexOf('DOMControl_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(){if(this.stop_hiding)return;this.visible=false;this.dropdown.style.display='none';this.clear_render_timeouts();if(typeaheadpro.should_use_iframe)typeaheadpro.iframe.style.display='none';};typeaheadpro.prototype.show=function(){this.visible=true;if(this.focused){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.display='';if(typeaheadpro.should_use_iframe){typeaheadpro.iframe.style.display='';this.reset_iframe();}}};typeaheadpro.prototype.toggle_icon_list=function(a){if(this.showing_icon_list){this.showing_icon_list=false;this.source.showing_icon_list=false;if(!a)this.focus();CSS.removeClass(this.typeahead_icon,'on_selected');this.want_icon_list=false;this.showing_icon_list=false;this.stop_suggestion_select=true;if(this.obj)this.dirty_results();}else{this.source.showing_icon_list=true;this.old_typeahead_value=this.obj.value;this.stop_suggestion_select=true;this.want_icon_list=true;this.dirty_results();this.focus();CSS.addClass(this.typeahead_icon,'on_selected');this.show();this.set_suggestion(-1);this.showing_icon_list=true;}setTimeout(function(){this.stop_hiding=false;}.bind(this),100);};typeaheadpro.prototype.focus=function(){this.obj.focus();};typeaheadpro.prototype.blur=function(a){if(this.obj)this.obj.blur(a);};typeaheadpro.kill_typeahead=function(a){if(a.typeahead){if(!this.anchor_block)a.parentNode.removeChild(a.nextSibling);a.parentNode.removeChild(a.nextSibling);if(a.typeahead.source)a.typeahead.source=a.typeahead.source.owner=null;a.onfocus=a.onblur=a.onkeypress=a.onkeyup=a.onkeydown=a.typeahead=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.escape_results=false;typeahead_source.prototype.search_limit=10;typeahead_source.prototype.check_limit=10;typeahead_source.prototype.bootstrap=bagofholding;typeahead_source.check_match=function(f,g){g=typeahead_source.tokenize(g);for(var b=0,c=f.length;b<c;b++)if(f[b].length){var a=false;for(var d=0,e=g.length;d<e;d++)if(g[d].length>=f[b].length&&g[d].substring(0,f[b].length)==f[b]){a=true;g[d]='';break;}if(!a)return false;}return true;};typeahead_source.tokenize=function(c,a,b){return (b?c:typeahead_source.flatten_string(c)).split(a?typeahead_source.normalizer_regex_capture:typeahead_source.normalizer_regex);};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(b){if(!typeahead_source.accents)typeahead_source.accents={a:/\u0430|\u00e0|\u00e1|\u00e2|\u00e3|\u00e4|\u00e5/g,b:/\u0431/g,c:/\u0446|\u00e7/g,d:/\u0434|\u00f0/g,e:/\u044d|\u0435|\u00e8|\u00e9|\u00ea|\u00eb/g,f:/\u0444/g,g:/\u0433/g,h:/\u0445/g,i:/\u0438|\u00ec|\u00ed|\u00ee|\u00ef/g,j:/\u0439/g,k:/\u043a/g,l:/\u043b/g,m:/\u043c/g,n:/\u043d|\u00f1/g,o:/\u043e|\u00f8|\u00f6|\u00f5|\u00f4|\u00f3|\u00f2/g,p:/\u043f/g,r:/\u0440/g,s:/\u0441/g,t:/\u0442/g,u:/\u0443|\u044e|\u00fc|\u00fb|\u00fa|\u00f9/g,v:/\u0432/g,y:/\u044b|\u00ff|\u00fd/g,z:/\u0437/g,ae:/\u00e6/g,oe:/\u0153/g,ts:/\u0446/g,ch:/\u0447/g,sh:/\u0448/g,ya:/\u044f/g};b=b.toLowerCase();for(var a in typeahead_source.accents)b=b.replace(typeahead_source.accents[a],a);return b;};typeahead_source.prototype.set_owner=function(a){this.owner=a;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(g,h){var b=[];resultv=typeahead_source.tokenize(g,true,true);g=typeahead_source.tokenize(g,true);h=typeahead_source.tokenize(h);h.sort(typeahead_source._sort);for(var c=0,d=resultv.length;c<d;c++){var a=false;for(var e=0,f=h.length;e<f;e++)if(h[e]&&g[c].lastIndexOf(h[e],0)!=-1){b.push('<em>',htmlspecialchars(resultv[c].substring(0,h[e].length)),'</em>',htmlspecialchars(resultv[c].substring(h[e].length,resultv[c].length)));a=true;break;}if(!a)b.push(htmlspecialchars(resultv[c]));}return b.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("\u0644\u0645 \u064a\u062a\u0645 \u0627\u0644\u0639\u062b\u0648\u0631 \u0639\u0644\u0649 \u0646\u062a\u0627\u0626\u062c \u0645\u0637\u0627\u0628\u0642\u0629");};typeahead_source.prototype.gen_loading=function(){return this.text_loading!=null?this.text_loading:_tx("\u062c\u0627\u0631\u064a \u0627\u0644\u062a\u062d\u0645\u064a\u0644...");};typeahead_source.prototype.gen_placeholder=function(){return this.text_placeholder!=null?this.text_placeholder:_tx("\u0627\u0628\u062f\u0623 \u0628\u0627\u0644\u0643\u062a\u0627\u0628\u0629...");};typeahead_source.prototype.gen_noinput=function(){return this.text_noinput!=null?this.text_noinput:_tx("\u0627\u0628\u062f\u0623 \u0628\u0627\u0644\u0643\u062a\u0627\u0628\u0629...");};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();};typeahead_source.prototype.gen_html=function(d,a){var b=['<div>',typeahead_source.highlight_found(d.t,a),'</div>'];if(d.s){var c=(this.escape_results?htmlspecialchars(d.s):d.s);b.push('<div class="sub_result"><small>',c,'</small></div>');}return b.join('');};
function UrlDetector(a){this.element=a;this.lastCharCount=0;this.lastScrapedURL=null;this.detectionInterval=null;this.suppressDetection=bagofholding;Event.listen(a,'focus',this.startDetectionInterval.bind(this));Event.listen(a,'blur',this.stopDetectionInterval.bind(this));var b=DOM.isNode(this.element,['input','textarea']);copy_properties(this,{getText:b?function(){return this.element.value;}:function(){return DOM.getText(this.element);},setText:b?function(c){this.element.value=c;}:function(c){DOM.setContent(this.element,c);}});}UrlDetector.mixin('Arbiter',{getText:bagofholding,setText:bagofholding,setSuppressDetectionCheck:function(a){this.suppressDetection=a;},startDetectionInterval:function(){if(this.detectionInterval||this.suppressDetection())return;this.detectionInterval=setInterval(this.detectionIntervalFire.bind(this),250);},stopDetectionInterval:function(){this.detectionInterval=clearInterval(this.detectionInterval);},detectionIntervalFire:function(){if(this.suppressDetection())return;var a=this.getText().length;if((a-this.lastCharCount)>5||(this.lastCharCount==0&&a>1))var b=true;this.lastCharCount=a;var c=this.detectUrl(b);if(c)this.inform('urlDetected',c);},detectUrl:function(c){var f='',e=this.getText(),d=endPos=-1;if(c){f=e.match(/www\.\S*/i);if(f){d=e.indexOf(f[0]);endPos=d+f[0].length;f="http://"+f[0];}else{var b=e.match(/(http|fb):\/\/\S*/i);if(b){f=b[0];d=e.indexOf(b[0]);endPos=d+b[0].length;}}}else{f=e.match(/www\.\S*[\s|\)|\!]/i);if(f){d=e.indexOf(f[0]);endPos=d+f[0].length;f="http://"+f[0];}else{var b=e.match(/(http|fb):\/\/\S*[\s|\)|\!]/i);if(b){f=b[0];d=e.indexOf(b[0]);endPos=d+b[0].length;}}}if(f){f=f.replace(/[\s|\)|\!]/g,'');var a=f.charAt(f.length-1);if(a.match(/[,|.]/))f=f.substr(0,f.length-1);if(f!=this.lastScrapedURL){this.lastScrapedURL=f;if(f.search('fb:')==0)this.setText(e.substr(0,d)+e.substr(endPos));}else f='';}return f;}});
function select_album(a){var b=$('selected_album');if(b.value&&ge(b.value))CSS.removeClass($(b.value),'selected_album');CSS.addClass(a,'selected_album');b.value=a.id;}
function search_selector_onfound(b){var a;if(!(a=ge('n')))return;a.value=b?b.i:-1;}function search_result_selector_onsubmit(a){$('search').init.value=ge('filter_init')?$('filter_init').value:'';$('search').sf.value=ge('filter_sf')?$('filter_sf').value:'';$('search').submit();this.hide();this.advance_focus();}function search_logged_ajax(a){new AsyncSignal('/ajax/search_log.php',a).send();}function search_log_2nd_action(a){new AsyncRequest().setURI('/ajax/search_log_2nd_action.php').setMethod('POST').setReadOnly(true).setContextData('clicktype',a).setContextData('source','profile_from_search').setHandler(function(){}).send();}function search_typeahead_log(a,b,d){if(!a)return;var c=a;if(b)c.evt=b;c.t=(new Date()).getTime();if(d)c.dt=c.t-d;new AsyncSignal('/ajax/typeahead_log.php',c).send();}var SearchDashboardKeyboardHandler=function(){return {right_arrow_key_handler:function(event,a){if(event.ctrlKey){if($('search_dashboard_next_session').href)goURI($('search_dashboard_next_session').href);}else if($('search_dashboard_next_query').href)goURI($('search_dashboard_next_query').href);return false;},left_arrow_key_handler:function(event,a){if(event.ctrlKey){if($('search_dashboard_prev_session').href)goURI($('search_dashboard_prev_session').href);}else if($('search_dashboard_prev_query').href)goURI($('search_dashboard_prev_query').href);return false;},right_arrow_key_filter:function(event,a){return true;}};}();
if(typeof deconcept=="undefined")var deconcept={};if(typeof deconcept.util=="undefined")deconcept.util={};if(typeof deconcept.SWFObjectUtil=="undefined")deconcept.SWFObjectUtil={};deconcept.SWFObject=function(h,d,j,c,i,a,f,l,g,b){if(!document.getElementById)return;this.DETECT_KEY=b?b:'detectflash';this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params={};this.variables={};this.attributes=[];this.fallback_html='';this.fallback_js_fcn=function(){};if(h)this.setAttribute('swf',h);if(d)this.setAttribute('id',d);if(j)this.setAttribute('width',j);if(c)this.setAttribute('height',c);this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(i){if(!(i instanceof Array))i=[i];var k;i.each(function(n){k=new deconcept.PlayerVersion(n.toString().split('.'));if(k.major==this.installedVer.major){this.setAttribute('version',k);return;}else if(!this.getAttribute('version')||k.major<this.getAttribute('version').major)this.setAttribute('version',k);}.bind(this));}if(!window.opera&&document.all&&this.installedVer.major>7)if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}if(a)this.addParam('bgcolor',a);var e=f?f:'high';this.addParam('quality',e);this.setAttribute('useExpressInstall',false);this.setAttribute('doExpressInstall',false);var m=(l)?l:window.location;this.setAttribute('xiRedirectUrl',m);this.setAttribute('redirectUrl','');if(g)this.setAttribute('redirectUrl',g);};deconcept.SWFObject.prototype={useExpressInstall:function(a){this.xiSWFPath=!a?"/swf/expressinstall.swf":a;this.setAttribute('useExpressInstall',true);},setAttribute:function(a,b){this.attributes[a]=b;},getAttribute:function(a){return this.attributes[a]||"";},addParam:function(a,b){this.params[a]=b;},getParams:function(){return this.params;},addVariable:function(a,b){this.variables[a]=b;},getVariable:function(a){return this.variables[a]||"";},getVariables:function(){return this.variables;},getVariablePairs:function(){var b=[];var a;var c=this.getVariables();for(a in c)b[b.length]=a+"="+c[a];return b;},getSWFHTML:function(){var d="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute('swf',this.xiSWFPath);}d='<embed type="application/x-shockwave-flash" src="'+htmlspecialchars(this.getAttribute('swf'))+'" width="'+htmlspecialchars(this.getAttribute('width'))+'" height="'+htmlspecialchars(this.getAttribute('height'))+'" style="'+htmlspecialchars(this.getAttribute('style')||"")+'"';d+=' id="'+htmlspecialchars(this.getAttribute('id'))+'" name="'+htmlspecialchars(this.getAttribute('id'))+'" ';var c=this.getParams();for(var a in c)d+=htmlspecialchars(a)+'="'+htmlspecialchars(c[a])+'" ';var b=this.getVariablePairs().join("&");if(b.length>0)d+='flashvars="'+b+'"';d+='/>';}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute('swf',this.xiSWFPath);}d='<object id="'+this.getAttribute('id')+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute('width')+'" height="'+this.getAttribute('height')+'" style="'+(this.getAttribute('style')||"")+'">';d+='<param name="movie" value="'+this.getAttribute('swf')+'" />';var c=this.getParams();for(var a in c)d+='<param name="'+a+'" value="'+c[a]+'" />';var b=this.getVariablePairs().join("&");if(b.length>0)d+='<param name="flashvars" value="'+b+'" />';d+="</object>";}return d;},write:function(a){if(this.getAttribute('useExpressInstall')){var b=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(b)&&!this.installedVer.versionIsValid(this.getAttribute('version'))){this.setAttribute('doExpressInstall',true);this.addVariable("MMredirectURL",escape(this.getAttribute('xiRedirectUrl')));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}var c=(typeof a=='string')?document.getElementById(a):a;if(this.skipDetect||this.getAttribute('doExpressInstall')||this.installedVer.versionIsValid(this.getAttribute('version'))){c.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute('redirectUrl')!="")document.location.replace(this.getAttribute('redirectUrl'));need_version=this.getAttribute('version').major+'.'+this.getAttribute('version').minor+'.'+this.getAttribute('version').rev;have_version=this.installedVer.major+'.'+this.installedVer.minor+'.'+this.installedVer.rev;this.fallback_js_fcn(have_version,need_version);c.innerHTML=this.fallback_html;}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var a=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){for(var d=0;d<navigator.plugins.length;d++)try{var e=navigator.plugins[d];if(e.name=='Shockwave Flash'){PlayerVersion_tmp=new deconcept.PlayerVersion(e.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));if(typeof a=='undefined'||PlayerVersion_tmp.major>a.major||(PlayerVersion_tmp.major==a.major&&(PlayerVersion_tmp.minor>a.minor||(PlayerVersion_tmp.minor==a.minor&&PlayerVersion_tmp.rev>a.rev))))a=PlayerVersion_tmp;}}catch(honk){}}else if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var b=1;var c=3;while(b)try{c++;b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+c);a=new deconcept.PlayerVersion([c,0,0]);}catch(e){b=null;}}else{try{var b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");a=new deconcept.PlayerVersion([6,0,21]);b.AllowScriptAccess="always";}catch(e){if(a.major==6)return a;}try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(b!=null)a=new deconcept.PlayerVersion(b.GetVariable("$version").split(" ")[1].split(","));}return a;};deconcept.PlayerVersion=function(a){this.major=a[0]!=null?parseInt(a[0]):0;this.minor=a[1]!=null?parseInt(a[1]):0;this.rev=a[2]!=null?parseInt(a[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(a){if(this.major<a.major)return false;if(this.major>a.major)return true;if(this.minor<a.minor)return false;if(this.minor>a.minor)return true;if(this.rev<a.rev)return false;return true;};deconcept.util={getRequestParameter:function(c){var d=document.location.search||document.location.hash;if(c==null)return d;if(d){var b=d.substring(1).split("&");for(var a=0;a<b.length;a++)if(b[a].substring(0,b[a].indexOf("="))==c)return b[a].substring((b[a].indexOf("=")+1));}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var b=document.getElementsByTagName("OBJECT");for(var a=b.length-1;a>=0;a--){b[a].style.display='none';for(var c in b[a])if(typeof b[a][c]=='function')b[a][c]=function(){};}};if(!document.getElementById&&document.all)document.getElementById=function(a){return document.all[a];};var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;var flash_update_dialog_shown=false;function spawn_flash_update_dialog(a,b){if(flash_update_dialog_shown)return;flash_update_dialog_shown=true;new AsyncRequest().setURI('/ajax/flash_update_dialog.php').setData({have_version:a,need_version:b}).setMethod('GET').setReadOnly(true).send();}function setFlashFallback(d,g){var b=ge(d);var a=deconcept.SWFObjectUtil.getPlayerVersion();var e;g.each(function(h){h=new deconcept.PlayerVersion(h.toString().split('.'));if(h.major==a.major){e=h;return;}else if(typeof e=='undefined'||h.major<e.major)e=h;}.bind(this));if(b&&a.major>0){var c=a.major+'.'+a.minor+'.'+a.rev;var f=e.major+'.'+e.minor+'.'+e.rev;b.innerHTML=_tx("Flash {required-version} is required to view this content. Your current version is {current-version}. Please download the latest Flash Player.",{'required-version':f,'current-version':c});}}function getFlashPlayer(){goURI('http://get.adobe.com/flashplayer');return false;}

if (window.Bootloader) { Bootloader.done(["js\/3chmwtx3xjwg0okw.pkg.js"]); }