/*    HTTP Host:  b.static.ak.fbcdn.net                                        */
/*    Generated:  February 9th 2010 11:09:12 AM PST                            */
/*      Machine:  10.16.139.108                                                */
/*       Source:  Backing Store                                                */
/*     Location:  js/2jlirgtlsg8ww40g.pkg.js h:1k5xuzdk                        */
/*       Locale:  nu_ll                                                        */
/*         Path:  js/2jlirgtlsg8ww40g.pkg.js                                   */

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

function Scroller(_L0){this.canvas=_L0;this.scrollZone=50;this.velocity=100;this.coefficient=1;}Scroller.findScrollParent=function(el){var sty;el=el.parentNode;while(el){if(el.scrollHeight!=el.offsetTop){sty=CSS.getStyle(el,'overflowY');if(sty=='scroll'||sty=='auto')return el;}el=el.parentNode;}return document.body;};Scroller.prototype.activate=function(){this.activate=bagofholding;this.event=Event.listen(document,'mousemove',this._onmousemove.bind(this));this.interval=this._intervalHandler.bind(this).recur(50);this.cursor=null;};Scroller.prototype.deactivate=function(){delete this.activate;this.event&&this.event.remove();this.event=null;clearInterval(this.interval);};Scroller.prototype._onmousemove=function(_L0){this.cursor=new Vector2.getEventPosition(_L0);};Scroller.prototype._intervalHandler=function(){if(!this.cursor)return;var _L0=this.canvas==document.body?Rect.getViewportBounds():Rect(this.canvas);var _L1=new Rect(this.cursor.y-_L0.t,_L0.r-this.cursor.x,_L0.b-this.cursor.y,this.cursor.x-_L0.l);var _L2=new Vector2(0,0);if(_L1.t<_L1.b&&_L1.t<this.scrollZone){_L2.y=-this.scrollZone+_L1.t;}else if(_L1.b<this.scrollZone)_L2.y=this.scrollZone-_L1.b;_L2.y=this._doMath(_L2.y);if(_L1.l<_L1.r&&_L1.l<this.scrollZone){_L2.x=-this.scrollZone+_L1.l;}else if(_L1.r<this.scrollZone)_L2.x=this.scrollZone-_L1.r;_L2.x=this._doMath(_L2.x);if(_L2.x||_L2.y){_L2.scrollElementBy(this.canvas);if(document.body==this.canvas)this.cursor=this.cursor.add(_L2);Arbiter.inform('scroller/scroll',this.cursor);}};Scroller.prototype._doMath=function(_L0){return Math.floor(Math.pow((_L0>=0?Math.min(_L0,this.scrollZone):Math.max(_L0,-this.scrollZone))/this.scrollZone*this.velocity,this.coefficient));};
var Drag={};Drag.currentDraggable=null;Drag.grab=function(_L0){if(Drag.currentDraggable)Drag._onmouseup();_L0.lastDragOver=null;Drag.attachDragEvents();Drag.currentDraggable=_L0;};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(_L0,_L1){(Drag.droppables[_L0]=Drag.droppables[_L0]||[]).push(_L1);};Drag.removeDroppable=function(_L0,_L1){Drag.droppables[_L0]=Drag.droppables[_L0].filter(function(a){return a!=_L1;});};Drag._onmousemove=function(_L0,_L1){if(!Drag.currentDraggable)return;var _L2=_L1||Vector2.getEventPosition(_L0),_L3=Drag.currentDraggable,_L4=Drag.droppables[_L3.namespace];if(_L3.namespace&&_L3.active&&_L4){var _L5={};_L4.each(function(_Lb){_L5[_Lb.zIndex]=_Lb.zIndex;});var _L6=[];for(var i in _L5)_L6.push(_L5[i]);_L6.sort();var _L8=_L3.lastDragOver,_L9=null;for(var z=_L6.length;z>=0;z--)if(_L8&&_L8.dom!=null&&_L8.zIndex==_L6[z]&&_L8.pointInside(_L2)){_L9=_L8;break;}else for(var i=0;i<_L4.length;i++){if(_L6[z]!=_L4[i].zIndex)continue;if(_L8!=_L4[i]&&_L3.dom!=_L4[i].dom&&_L4[i].pointInside(_L2)){_L9=_L4[i];z=-1;break;}}if(_L9&&_L9!=_L8)_L9.ondragover(_L3);if(_L9)_L9.ondragmove(_L3,_L2.sub(Vector2.getElementPosition(_L9.dom)));_L3.lastDragOver=_L9;}Drag.currentDraggable._onmousemove(_L2);};Drag._onmouseup=function(e){document.onselectstart=null;if(Drag.currentDraggable){Drag.currentDraggable._ondrop();Drag.currentDraggable=null;}};function Draggable(_L0){if(!_L0)throw new Error('Element should be a DOM node');if(this==window){if(_L0 instanceof Array){var _L1=[];_L0.each(function(_L2){_L1.push(new Draggable(_L2));});return new Collection(Draggable,_L1);}else return new Draggable(_L0);}else{this.data={};this.handles=[];this.dom=_L0;this.boundingBox=null;this.addHandle(this.dom);}}Draggable.prototype.destroy=function(){this.handles.each(function(_L0){this.removeHandle(_L0.obj);}.bind(this));this.data=this.dom=null;};Draggable.prototype._onclick=function(_L0){if(this.active)return Event.kill(_L0);};Draggable.prototype._ongrab=function(_L0){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';_L0.sub(this.cursorPositionVector).setElementPosition(this.dom);}};Draggable.prototype._onmousedown=function(_L0){var _L1=$E(_L0).getTarget();if(DOM.isNode(_L1,['input','select','textarea','object','embed']))return true;var _L2=Vector2.getEventPosition(_L0);this.draggableInitialVector=Vector2.getElementPosition(this.dom);this.cursorPositionVector=_L2.sub(this.draggableInitialVector);Drag.grab(this,_L0);if(this.gutter){this.cursorInitialVector=_L2;}else{this._setActive(true);this._ongrab(_L2);}return Event.kill(_L0);};Draggable.prototype._onmousemove=function(_L0){if(!this.active)if(_L0.distanceTo(this.cursorInitialVector)>=this.gutter){this._setActive(true);this._ongrab(_L0);}if(this.active){var _L1=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 _L2=_L0.sub(_L1).sub(this.cursorPositionVector);if(this.boundingBox){var box=Rect.newFromVectors(_L2,Vector2.getElementDimensions(this.dom));box=box.boundWithin(this.boundingBox);_L2=box.getPositionVector(box);if(this.boundingBox.w()==0){var _L4=new Vector2(this.draggableInitialVector.x,_L2.y,'document');}else if(this.boundingBox.h()==0){var _L4=new Vector2(_L2.x,this.draggableInitialVector.y,'document');}else var _L4=_L2;}else var _L4=_L2;_L4.setElementPosition(this.dom);this.ondrag(_L0);}};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(_L0){this.boundingBox=_L0;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(_L0){this.absolute=_L0;return this;};Draggable.prototype.ondrag=bagofholding;Draggable.prototype.setDragHandler=function(_L0){this.ondrag=_L0;return this;};Draggable.prototype.ongrab=bagofholding;Draggable.prototype.setGrabHandler=function(_L0){this.ongrab=_L0;return this;};Draggable.prototype.ondrop=bagofholding;Draggable.prototype.setDropHandler=function(_L0){this.ondrop=_L0;return this;};Draggable.prototype.gutter=0;Draggable.prototype.setGutter=function(_L0){this.gutter=_L0;return this;};Draggable.prototype.setNamespace=function(_L0){this.namespace=_L0;return this;};Draggable.prototype.handles=null;Draggable.prototype.addHandle=function(_L0){if(this.handles.length==1&&this.handles[0].obj==this.dom)this.removeHandle(this.dom);this.handles.push({obj:_L0,evt:[Event.listen(_L0,'mousedown',this._onmousedown.bind(this)),Event.listen(_L0,'click',this._onclick.bind(this)),Event.listen(_L0,'drag',Event.kill),Event.listen(_L0,'selectstart',Event.kill)]});return this;};Draggable.prototype.removeHandle=function(_L0){this.handles=this.handles.filter(function(a){if(a.obj!=_L0){return true;}else{a.evt.each(function(evt){evt.remove();});return false;}});};Draggable.prototype.getDOM=function(){return this.dom;};Draggable.prototype.setKey=function(key,_L1){this.data[key]=_L1;return this;};Draggable.prototype.getKey=function(key){return this.data[key];};Draggable.prototype._setActive=function(_L0){this.dom.activeDrag=this.active=_L0;for(var i=0;i<this.handles.length;i++)this.handles[i].obj.activeDrag=_L0;};function Droppable(_L0){if(!_L0)throw new Error('Element should be a DOM node');if(this==window){if(_L0 instanceof Array){var _L1=[];_L0.each(function(_L2){_L1.push(new Droppable(_L2));});return new Collection(Droppable,_L1);}else return new Droppable(_L0);}else{this.data={};this.dom=_L0;this.namespace=null;}}Droppable.prototype.destroy=function(){if(this.namespace)Drag.removeDroppable(this.namespace,this);this.data=this.dom=null;};Droppable.prototype.setNamespace=function(_L0){if(this.namespace)Drag.removeDroppable(_L0,this);this.namespace=_L0;Drag.addDroppable(_L0,this);return this;};Droppable.prototype.zIndex=0;Droppable.prototype.setZIndex=function(_L0){this.zIndex=_L0;return this;};Droppable.prototype.pointInside=function(_L0){var _L1=Vector2.getElementPosition(this.dom);return _L1.x<=_L0.x&&this.dom.offsetWidth+_L1.x>_L0.x&&_L1.y<=_L0.y&&this.dom.offsetHeight+_L1.y>_L0.y;};Droppable.prototype.ondragover=bagofholding;Droppable.prototype.setDragOverHandler=function(_L0){this.ondragover=_L0;return this;};Droppable.prototype.ondragmove=bagofholding;Droppable.prototype.setDragMoveHandler=function(_L0){this.ondragmove=_L0;return this;};Droppable.prototype.ondrop=bagofholding;Droppable.prototype.setDropHandler=function(_L0){this.ondrop=_L0;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(_L0){this.boundingBox=_L0;for(var k in this.draggables)this.draggables[k].setBoundingBox(this.boundingBox);return this;};SortableGroup.prototype.setDroppable=function(val){this.isDroppable=val;return this;};SortableGroup.prototype._initializeAdded=function(key,obj){if(this.rootNode===null){this.rootNode=obj.parentNode;if(!this.linkedGroups.placeholder){this.linkedGroups.placeholder=this.placeholder=$N(obj.tagName,{className:'dragPlaceholder',style:{padding:'0px'}});}else this.placeholder=this.linkedGroups.placeholder;}else if(this.rootNode!=obj.parentNode)throw new Error('All sortables of a collection must share the same parentNode');if(key in this.draggables)throw new Error('All sortables must have a unique key');};SortableGroup.prototype.addSortable=function(key,obj,_L2){this._initializeAdded(key,obj);this.sortables[key]=obj;this.draggables[key]=(new Draggable(obj)).setNamespace(this.namespace).setGutter(this.gutter).setUseAbsolute(true).setGrabHandler(this.grabHandler.bind(this,key)).setDropHandler(this.dropHandler.bind(this,key)).setKey('key',key).setBoundingBox(this.boundingBox);if(_L2)this.draggables[key].addHandle(_L2);this.droppables[key]=(new Droppable(obj)).setNamespace(this.namespace).setDragOverHandler(this._dragOverHandlerShim.bind(null,this,key));return this;};SortableGroup.prototype.addEmptyMessage=function(obj,_L1){var key='placeholder';if(obj.parentNode!=_L1)_L1.appendContent(obj);this._initializeAdded(key,obj);this.hasEmptyMessage=true;this.sortables[key]=obj;this.droppables[key]=(new Droppable(obj)).setNamespace(this.namespace).setDragOverHandler(this._dragOverHandlerShim.bind(null,this,key));return this;};SortableGroup.prototype.setNeverEmpty=function(_L0){this.neverEmpty=_L0;};SortableGroup.prototype.link=function(_L0){_L0.linkedGroups=this.linkedGroups;if(!this.linkedGroups.length)this.linkedGroups.push(this);this.linkedGroups.push(_L0);for(var i=0;i<this.linkedGroups.length;i++)if(this.linkedGroups[i].namespace!=this.namespace){this.linkedGroups[i].namespace=this.namespace;for(var j in this.linkedGroups[i].droppables){this.linkedGroups[i].droppables[j].setNamespace(this.namespace);this.linkedGroups[i].draggables[j].setNamespace(this.namespace);}}return this;};SortableGroup.prototype.getOrder=function(){if(!this.rootNode)return [];var ret=[],_L1=this.rootNode.childNodes;for(var i=0;i<_L1.length;i++)for(var k in this.sortables)if(this.sortables[k]==_L1[i]){ret.push(k);break;}return ret;};SortableGroup.prototype.migrateLinkedSortable=function(key){for(var i=0;i<this.linkedGroups.length;i++)if(key in this.linkedGroups[i].draggables){this.sortables[key]=this.linkedGroups[i].sortables[key];this.draggables[key]=this.linkedGroups[i].draggables[key];this.draggables[key].setGrabHandler(this.grabHandler.bind(this,key)).setDropHandler(this.dropHandler.bind(this,key));this.droppables[key]=this.linkedGroups[i].droppables[key];this.droppables[key].setDragOverHandler(this._dragOverHandlerShim.bind(null,this,key));delete this.linkedGroups[i].sortables[key];delete this.linkedGroups[i].draggables[key];delete this.linkedGroups[i].droppables[key];return true;}return false;};SortableGroup.prototype.setLinkJumpHandler=function(_L0){this.linkedGroups.onlinkjump=_L0;return this;};SortableGroup.prototype.onorderchange=bagofholding;SortableGroup.prototype.setOrderChangeHandler=function(_L0){this.onorderchange=_L0;return this;};SortableGroup.prototype.ongrabcallback=bagofholding;SortableGroup.prototype.setGrabCallback=function(_L0){this.ongrabcallback=_L0;return this;};SortableGroup.prototype._checkLastRemaining=function(_L0){var _L1=this.hasEmptyMessage?2:1;return this.neverEmpty&&this.rootNode.childNodes.length==_L1;};SortableGroup.prototype.grabHandler=function(_L0){if(this._checkLastRemaining()){this.draggables[_L0].killDrag();return;}CSS.setClass(this.placeholder,this.sortables[_L0].className);CSS.addClass(this.placeholder,'droppable_placeholder');CSS.addClass(this.sortables[_L0],'drag');Vector2.getElementDimensions(this.sortables[_L0]).setElementDimensions(this.placeholder);this.rootNode.insertBefore(this.placeholder,this.sortables[_L0]);this.ongrabcallback(_L0);if(!this.isDroppable){var _L1=this.sortables[_L0];this.anchor=_L1.nextSibling;if(!this.anchor){this.anchor=$N('div');_L1.parentNode.appendChild(this.anchor);}}};SortableGroup.prototype.ondropcallback=bagofholding;SortableGroup.prototype.setDropCallback=function(_L0){this.ondropcallback=_L0;return this;};SortableGroup.prototype.dropHandler=function(_L0){if(this._checkLastRemaining()){this.draggables[_L0].resetPosition();return;}CSS.removeClass(this.sortables[_L0],'drag');this.draggables[_L0].resetPosition();this.rootNode.insertBefore(this.sortables[_L0],this.placeholder);this.rootNode.removeChild(this.placeholder);for(var i=0;i<this.linkedGroups.length;i++)if(this.linkedGroups[i].anchor)delete this.linkedGroups[i].anchor;this.ondropcallback(_L0);this.onorderchange();};SortableGroup.prototype._dragOverHandlerShim=function(_L0,_L1,_L2){_L0.dragOverHandler(_L1,_L2.getKey('key'));};SortableGroup.prototype.dragOverHandler=function(_L0,_L1){if(!this.isDroppable&&!this.anchor)return;var _L2=false;if(!(_L1 in this.draggables)){if(!this.migrateLinkedSortable(_L1))throw new Error('Draggable dropped onto a foreign droppable!');_L2=true;}var _L3=true,_L4=this.rootNode.childNodes,_L5=this.sortables[_L1],_L6=this.sortables[_L0];if(!this.anchor){var l=_L4.length;for(var i=0;i<l;i++)if(_L4[i]==_L6){break;}else if(_L4[i]==_L5){_L3=false;break;}}else _L6=this.anchor;if(_L3||this.anchor){this.rootNode.insertBefore(this.placeholder,_L6);}else this.rootNode.insertBefore(this.placeholder,_L6.nextSibling);this.rootNode.insertBefore(_L5,this.placeholder);this.ondragover(_L5,_L6);if(_L2)this.linkedGroups.onlinkjump.call(this,_L1);};SortableGroup.prototype.ondragover=bagofholding;SortableGroup.prototype.setDragOverCallback=function(_L0){this.ondragover=_L0;return this;};SortableGroup.prototype.destroy=function(){for(var k in this.droppables)this.droppables[k].destroy();for(var k in this.draggables)this.draggables[k].destroy();this.droppables=this.draggables=this.rootNode=null;this.linkedGroups.remove(this);for(var i=0;i<this.linkedGroups.length;i++)this.linkedGroups[i].linkedGroups=this.linkedGroups;};SortableGroup.prototype.removeSortable=function(key){if(key in this.sortables){this.draggables[key].destroy();this.droppables[key].destroy();delete this.draggables[key];delete this.droppables[key];delete this.sortables[key];}};SortableGroup.prototype.keyExists=function(key){return this.sortables[key];};
function typeaheadpro(obj,_L1,_L2){if(!typeaheadpro.hacks){typeaheadpro.should_check_missing_events=ua.safari()<500;typeaheadpro.should_simulate_keypress=(ua.ie()<8)||(ua.safari()>500&&ua.safari()<523||ua.safari()>=525);if(typeaheadpro.should_use_iframe==undefined)typeaheadpro.should_use_iframe=typeaheadpro.should_simulate_keypress;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,_L2||{});this.obj=obj;this.obj.typeahead=this;this.obj.onfocus=this._onfocus.bind(this);this.obj.onblur=chain(this.obj.onblur,this._onblur.bind(this));this.obj.onchange=this._onchange.bind(this);this.obj.onkeyup=function(_L3){return this._onkeyup(_L3||window.event);}.bind(this);this.obj.onkeydown=function(_L3){return this._onkeydown(_L3||window.event);}.bind(this);this.obj.onkeypress=function(_L3){return this._onkeypress(_L3||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(_L3){return this.typeahead_icon_onclick(_L3||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(_L3){return this.dropdown_onmousedown(_L3||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(_L1)this.set_source(_L1);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.dirty_instances=function(){if(typeaheadpro.instances)typeaheadpro.instances.forEach(function(_L0){_L0.update_status(typeaheadpro.STATUS_BLOCK_ON_SOURCE_BOOTSTRAP);if(_L0.source)_L0.source.is_ready=false;});};typeaheadpro.prototype.set_source=function(_L0){this.source=_L0;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 _L0=this.obj.value;if(_L0!=this.old_value){this.dirty_results();this.old_value=_L0;if(this.old_value==='')this._onselect(false);}}};typeaheadpro.prototype._onkeyup=function(e){e=$E(e);this.last_key=e?e.keyCode:-1;if(this.key_down==this.last_key)this.key_down=0;var _L1=true;switch(this.last_key){case KEYS.ESC:this.selectedindex=-1;this._onselect(false);this.hide();e.stop();_L1=false;break;}return _L1;};typeaheadpro.prototype._onkeydown=function(e){e=$E(e);this.key_down=this.last_key=e?e.keyCode:-1;this.interactive=true;switch(this.last_key){case 33:case 34: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(e.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(e){e=$E(e);var _L1=1;this.last_key=e?Event.getKeyCode(e):-1;this.interactive=true;switch(this.last_key){case 33:_L1=this.max_display;case KEYS.UP:this.set_suggestion(_L1>1&&this.selectedindex>0&&this.selectedindex<_L1?0:this.selectedindex-_L1);this.last_key_suggestion=(new Date()).getTime();return false;case 34:_L1=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+_L1?this.suggestions.length-1:this.selectedindex+_L1);this.last_key_suggestion=(new Date()).getTime();}return false;case KEYS.RETURN:var ret=null;if(typeof(this.submit_keydown_return)=='undefined'){ret=this.submit_keydown_return=this._onsubmit(this.get_current_selection());}else{ret=this.submit_keydown_return;delete this.submit_keydown_return;}return ret;default:setTimeout(bind(this,'check_value'),this.source.check_limit);break;}return true;};typeaheadpro.prototype._onchange=function(){this.changed=true;};typeaheadpro.prototype._onfound=function(obj){return this.onfound?this.onfound.call(this,obj):true;};typeaheadpro.prototype._onsubmit=function(obj){if(this.onsubmit){var ret=this.onsubmit.call(this,obj);if(ret&&this.obj.form){if(!this.obj.form.onsubmit||this.obj.form.onsubmit())this.obj.form.submit();return false;}return ret;}else{this.advance_focus();return false;}};typeaheadpro.prototype._onselect=function(obj){var _L1=(function(){if(this.onselect)this.onselect.call(this,obj);}).bind(this);if(obj.no_email){var _L2=new AsyncRequest().setData({action:'require',require_field:'email',uid:obj.i}).setMethod('GET').setReadOnly(true).setURI('/friends/ajax/external.php');new Dialog().setCloseHandler(function(_L3){var _L4=this.getUserData();if(_L4){_L1();}else _L3.set_value('');}.bind(null,this)).setAsync(_L2).show();}else _L1();};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(_L0){if(this.last_dropdown_mouse&&this.last_dropdown_mouse>(new Date()).getTime()-10&&this.is_showing_suggestions()){Event.kill(_L0);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.select_suggestion(this.selectedindex);this.hide();this.update_class();if(this.clear_value_on_blur&&!this.get_value()){var _L1=this.allow_placeholders?this.source.gen_noinput():'';this.set_value(_L1?_L1:'');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(_L0){this.stop_hiding=true;this.focus();setTimeout(function(){this.toggle_icon_list();}.bind(this),50);Event.kill(_L0);return false;};typeaheadpro.prototype.dropdown_onmousedown=function(_L0){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(_L0){if(!this.visible)return;if((new Date()).getTime()-this.last_key_suggestion>50)this.set_suggestion(_L0);};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(_L0){this.stop_suggestion_select=false;if(!this.suggestions||this.suggestions.length<=_L0)return;var _L1=this.get_suggestion_node(this.selectedindex);this.selectedindex=(_L0<=-1)?-1:_L0;var _L2=this.get_suggestion_node(this.selectedindex);if(_L1){CSS.removeClass(_L1,'typeahead_selected');CSS.addClass(_L1,'typeahead_not_selected');}if(_L2){CSS.removeClass(_L2,'typeahead_not_selected');CSS.addClass(_L2,'typeahead_selected');}this.recalc_scroll();this._onfound(this.get_current_selection());};typeaheadpro.prototype.get_suggestion_node=function(_L0){var _L1=this.list.childNodes;return _L0==-1?null:_L1[Math.floor(_L0/this.render_block_size)].childNodes[_L0%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(_L0){if(!this.stop_suggestion_select&&this.current_selecting!=_L0)this.current_selecting=_L0;var _L1=true;if(!this.suggestions||_L0==undefined||_L0===false||this.suggestions.length<=_L0||_L0<0){this._onfound(false);this._onselect(false);this.selectedindex=-1;this.set_class('');_L1=false;}else{this.selectedindex=_L0;var _L2=this.suggestions[_L0].ty;if(_L2!='web'&&_L2!='search')this.set_value(this.suggestions[_L0].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(!_L1&&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(_L0){this.obj.value=_L0;};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(_L0,_L1,_L2){if(!_L0)_L0=[];this.suggestion_count=_L0.length;if(!_L2){this.status=typeaheadpro.STATUS_IDLE;this.add_cache(_L1,_L0);}this.clear_render_timeouts();if(this.get_value()==this.results_text){return;}else if(!_L2){this.results_text=typeahead_source.flatten_string(_L1);if(this.enumerate&&trim(this.results_text)!='')this.enumerate=false;}var _L3=-1;if(this.selectedindex!=-1){var _L4=this.suggestions[this.selectedindex].i;for(var i=0,l=_L0.length;i<l;i++)if(_L0[i].i==_L4){_L3=i;break;}}if(_L3==-1&&this.auto_select&&_L0.length){_L3=0;this._onfound(_L0[0]);}this.selectedindex=_L3;this.suggestions=_L0;if(!_L2)this.real_suggestions=_L0;if(_L0.length){var _L7=[],_L8=Math.ceil(_L0.length/this.render_block_size),_L9={},_La,_Lb=null;DOM.empty(this.list);for(var i=0;i<_L8;i++)this.list.appendChild(document.createElement('div'));if(_L3>-1){_La=Math.floor(_L3/this.render_block_size);_L9[_La]=true;if(_L3%this.render_block_size>this.render_block_size/2){_L9[_La+1]=true;}else if(_La!=0)_L9[_La-1]=true;}else _L9[0]=true;for(var _Lc in _L9){this.render_block(_Lc);sample=this.list.childNodes[_Lc].firstChild;}this.show();if(_L8){var _Ld=sample.offsetHeight;this.render_timeouts=[];for(var i=1;i<_L8;i++)if(!_L9[i]){this.list.childNodes[i].style.height=_Ld*Math.min(this.render_block_size,_L0.length-i*this.render_block_size)+'px';this.render_timeouts.push(setTimeout(this.render_block.bind(this,i),700+i*50));}}}else{this.selectedindex=-1;this.set_message(this.status==typeaheadpro.STATUS_IDLE?this.source.gen_nomatch():this.source.gen_loading());this._onfound(false);}this.recalc_scroll();if(!_L2&&this.results_text!=typeahead_source.flatten_string(this.get_value()))this.dirty_results();};typeaheadpro.prototype.render_block=function(_L0,_L1){var _L2=this.suggestions,_L3=this.selectedindex,_L4=this.get_value(),_L5=this.instance,_L6=[],_L7=this.list.childNodes[_L0];for(var i=_L0*this.render_block_size,l=Math.min(_L2.length,(_L0+1)*this.render_block_size);i<l;i++){_L6.push('<div class="');if(_L3==i){_L6.push('typeahead_suggestion typeahead_selected');}else _L6.push('typeahead_suggestion typeahead_not_selected');if(i>0&&_L2[i-1].o<0&&_L2[i].o>=0)_L6.push(' typeahead_delimiter');_L6.push('" onmouseover="typeaheadpro.instances[',_L5,'].mouse_set_suggestion(',i,')" ','onmousedown="var instance=typeaheadpro.instances[',_L5,']; instance.select_suggestion(',i,');instance.hide();Event.kill(event);">',this.source.gen_html(_L2[i],_L4),'</div>');}_L7.innerHTML=_L6.join('');_L7.style.height='auto';CSS.addClass(_L7,'typeahead_suggestions');};typeaheadpro.prototype.clear_render_timeouts=function(){if(this.render_timeouts){for(var i=0;i<this.render_timeouts.length;i++)clearTimeout(this.render_timeouts[i]);this.render_timeouts=null;}};typeaheadpro.prototype.recalc_scroll=function(){var cn=this.list.firstChild;if(!cn)return;if(cn.childNodes.length>this.max_display){var _L1=cn.childNodes[this.max_display-1];var _L2=_L1.offsetTop+_L1.offsetHeight;this.dropdown.style.height=_L2+'px';var _L3=this.get_suggestion_node(this.selectedindex);if(_L3){var _L4=this.dropdown.scrollTop;if(_L3.offsetTop<_L4){this.dropdown.scrollTop=_L3.offsetTop;}else if(_L3.offsetTop+_L3.offsetHeight>_L2+_L4)this.dropdown.scrollTop=_L3.offsetTop+_L3.offsetHeight-_L2;}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(_L0){return this.cache[typeahead_source.flatten_string(_L0)];};typeaheadpro.prototype.add_cache=function(_L0,_L1){if(this.source.cache_results)this.cache[typeahead_source.flatten_string(_L0)]=_L1;};typeaheadpro.prototype.update_status=function(_L0){this.status=_L0;this.dirty_results();};typeaheadpro.prototype.set_class=function(_L0){CSS.setClass(this.obj,(this.obj.className.replace(/typeahead_[^\s]+/g,'')+' '+_L0).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 _L0=(new Date()).getTime();var _L1=false;if(this.last_search<=(_L0-this.source.search_limit)&&this.status==typeaheadpro.STATUS_IDLE){_L1=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-(_L0-this.last_search));if(this.source.allow_fake_results&&this.real_suggestions&&!_L1){var _L2=typeahead_source.tokenize(this.get_value()).sort(typeahead_source._sort);var _L3=[];for(var i=0;i<this.real_suggestions.length;i++)if(typeahead_source.check_match(_L2,this.real_suggestions[i].t+' '+this.real_suggestions[i].n))_L3.push(this.real_suggestions[i]);if(_L3.length){this.found_suggestions(_L3,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 _L0;if((_L0=this.search_cache(this.get_value()))===undefined&&!(_L0=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(_L0,this.get_value(),false);return true;};typeaheadpro.prototype.set_message=function(_L0){this.clear_render_timeouts();if(_L0){this.list.innerHTML='<div class="typeahead_message">'+_L0+'</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(_L0){var _L1=this.obj.form?get_all_form_inputs(this.obj.form):get_all_form_inputs();var _L2=[];_L2._insert=_L0?_L2.push:_L2.unshift;var _L3=!_L0;for(var i=0;i<_L1.length;i++)if(!_L0&&_L1[i]==this.obj){_L3=false;}else if(_L3&&_L1[i].type!='hidden'&&_L1[i].tabIndex!=-1&&_L1[i].offsetParent){_L2._insert(_L1[i]);}else if(_L1[i]==this.obj)_L3=true;setTimeout(function(){for(var i=0;i<this.length;i++)try{if(this[i].offsetParent){this[i].focus();setTimeout(function(){try{this.focus();}catch(e){}}.bind(this[i]),0);return;}}catch(e){}}.bind(_L2?_L2:[]),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(_L0){if(this.showing_icon_list){this.showing_icon_list=false;this.source.showing_icon_list=false;if(!_L0)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(e){if(this.obj)this.obj.blur(e);};typeaheadpro.kill_typeahead=function(obj){if(obj.typeahead){if(!this.anchor_block)obj.parentNode.removeChild(obj.nextSibling);obj.parentNode.removeChild(obj.nextSibling);if(obj.typeahead.source)obj.typeahead.source=obj.typeahead.source.owner=null;obj.onfocus=obj.onblur=obj.onkeypress=obj.onkeyup=obj.onkeydown=obj.typeahead=null;}};
function typeahead_source(){}typeahead_source.prototype.cache_results=false;typeahead_source.prototype.enumerable=false;typeahead_source.prototype.allow_fake_results=false;typeahead_source.prototype.search_limit=10;typeahead_source.prototype.check_limit=10;typeahead_source.prototype.bootstrap=bagofholding;typeahead_source.check_match=function(_L0,_L1){_L1=typeahead_source.tokenize(_L1);for(var i=0,il=_L0.length;i<il;i++)if(_L0[i].length){var _L4=false;for(var j=0,jl=_L1.length;j<jl;j++)if(_L1[j].length>=_L0[i].length&&_L1[j].substring(0,_L0[i].length)==_L0[i]){_L4=true;_L1[j]='';break;}if(!_L4)return false;}return true;};typeahead_source.tokenize=function(_L0,_L1,_L2){return (_L2?_L0:typeahead_source.flatten_string(_L0)).split(_L1?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(_L0){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};_L0=_L0.toLowerCase();for(var i in typeahead_source.accents)_L0=_L0.replace(typeahead_source.accents[i],i);return _L0;};typeahead_source.prototype.set_owner=function(obj){this.owner=obj;if(this.is_ready)this.owner.update_status(typeaheadpro.STATUS_IDLE);};typeahead_source.prototype.ready=function(){if(this.owner&&!this.is_ready){this.is_ready=true;this.owner.update_status(typeaheadpro.STATUS_IDLE);}else this.is_ready=true;};typeahead_source.highlight_found=function(_L0,_L1){var _L2=[];resultv=typeahead_source.tokenize(_L0,true,true);_L0=typeahead_source.tokenize(_L0,true);_L1=typeahead_source.tokenize(_L1);_L1.sort(typeahead_source._sort);for(var i=0,il=resultv.length;i<il;i++){var _L5=false;for(var j=0,jl=_L1.length;j<jl;j++)if(_L1[j]&&_L0[i].lastIndexOf(_L1[j],0)!=-1){_L2.push('<em>',htmlspecialchars(resultv[i].substring(0,_L1[j].length)),'</em>',htmlspecialchars(resultv[i].substring(_L1[j].length,resultv[i].length)));_L5=true;break;}if(!_L5)_L2.push(htmlspecialchars(resultv[i]));}return _L2.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("Nema rezultata pretrage");};typeahead_source.prototype.gen_loading=function(){return this.text_loading!=null?this.text_loading:_tx("U\u010ditavanje...");};typeahead_source.prototype.gen_placeholder=function(){return this.text_placeholder!=null?this.text_placeholder:_tx("Po\u010dni pisanje...");};typeahead_source.prototype.gen_noinput=function(){return this.text_noinput!=null?this.text_noinput:_tx("Po\u010dni pisanje...");};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();};
if(typeof deconcept=="undefined")var deconcept={};if(typeof deconcept.util=="undefined")deconcept.util={};if(typeof deconcept.SWFObjectUtil=="undefined")deconcept.SWFObjectUtil={};deconcept.SWFObject=function(swf,id,w,h,ver,c,_L6,_L7,_L8,_L9){if(!document.getElementById)return;this.DETECT_KEY=_L9?_L9:'detectflash';this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params={};this.variables={};this.attributes=[];this.fallback_html='';this.fallback_js_fcn=function(){};if(swf)this.setAttribute('swf',swf);if(id)this.setAttribute('id',id);if(w)this.setAttribute('width',w);if(h)this.setAttribute('height',h);this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(ver){if(!(ver instanceof Array))ver=[ver];var x;ver.each(function(ii){x=new deconcept.PlayerVersion(ii.toString().split('.'));if(x.major==this.installedVer.major){this.setAttribute('version',x);return;}else if(!this.getAttribute('version')||x.major<this.getAttribute('version').major)this.setAttribute('version',x);}.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(c)this.addParam('bgcolor',c);var q=_L6?_L6:'high';this.addParam('quality',q);this.setAttribute('useExpressInstall',false);this.setAttribute('doExpressInstall',false);var xir=(_L7)?_L7:window.location;this.setAttribute('xiRedirectUrl',xir);this.setAttribute('redirectUrl','');if(_L8)this.setAttribute('redirectUrl',_L8);};deconcept.SWFObject.prototype={useExpressInstall:function(_L0){this.xiSWFPath=!_L0?"/swf/expressinstall.swf":_L0;this.setAttribute('useExpressInstall',true);},setAttribute:function(_L0,_L1){this.attributes[_L0]=_L1;},getAttribute:function(_L0){return this.attributes[_L0]||"";},addParam:function(_L0,_L1){this.params[_L0]=_L1;},getParams:function(){return this.params;},addVariable:function(_L0,_L1){this.variables[_L0]=_L1;},getVariable:function(_L0){return this.variables[_L0]||"";},getVariables:function(){return this.variables;},getVariablePairs:function(){var _L0=[];var key;var _L2=this.getVariables();for(key in _L2)_L0[_L0.length]=key+"="+_L2[key];return _L0;},getSWFHTML:function(){var _L0="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute('swf',this.xiSWFPath);}_L0='<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')||"")+'"';_L0+=' id="'+htmlspecialchars(this.getAttribute('id'))+'" name="'+htmlspecialchars(this.getAttribute('id'))+'" ';var _L1=this.getParams();for(var key in _L1)_L0+=htmlspecialchars(key)+'="'+htmlspecialchars(_L1[key])+'" ';var _L3=this.getVariablePairs().join("&");if(_L3.length>0)_L0+='flashvars="'+_L3+'"';_L0+='/>';}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute('swf',this.xiSWFPath);}_L0='<object id="'+this.getAttribute('id')+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute('width')+'" height="'+this.getAttribute('height')+'" style="'+(this.getAttribute('style')||"")+'">';_L0+='<param name="movie" value="'+this.getAttribute('swf')+'" />';var _L1=this.getParams();for(var key in _L1)_L0+='<param name="'+key+'" value="'+_L1[key]+'" />';var _L3=this.getVariablePairs().join("&");if(_L3.length>0)_L0+='<param name="flashvars" value="'+_L3+'" />';_L0+="</object>";}return _L0;},write:function(_L0){if(this.getAttribute('useExpressInstall')){var _L1=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_L1)&&!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 n=(typeof _L0=='string')?document.getElementById(_L0):_L0;if(this.skipDetect||this.getAttribute('doExpressInstall')||this.installedVer.versionIsValid(this.getAttribute('version'))){n.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);n.innerHTML=this.fallback_html;}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _L0=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){for(k=0;k<navigator.plugins.length;k++)try{x=navigator.plugins[k];if(x.name=='Shockwave Flash'){PlayerVersion_tmp=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));if(typeof _L0=='undefined'||PlayerVersion_tmp.major>_L0.major||(PlayerVersion_tmp.major==_L0.major&&(PlayerVersion_tmp.minor>_L0.minor||(PlayerVersion_tmp.minor==_L0.minor&&PlayerVersion_tmp.rev>_L0.rev))))_L0=PlayerVersion_tmp;}}catch(honk){}}else if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _L2=3;while(axo)try{_L2++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_L2);_L0=new deconcept.PlayerVersion([_L2,0,0]);}catch(e){axo=null;}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_L0=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_L0.major==6)return _L0;}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null)_L0=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}return _L0;};deconcept.PlayerVersion=function(_L0){this.major=_L0[0]!=null?parseInt(_L0[0]):0;this.minor=_L0[1]!=null?parseInt(_L0[1]):0;this.rev=_L0[2]!=null?parseInt(_L0[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major)return false;if(this.major>fv.major)return true;if(this.minor<fv.minor)return false;if(this.minor>fv.minor)return true;if(this.rev<fv.rev)return false;return true;};deconcept.util={getRequestParameter:function(_L0){var q=document.location.search||document.location.hash;if(_L0==null)return q;if(q){var _L2=q.substring(1).split("&");for(var i=0;i<_L2.length;i++)if(_L2[i].substring(0,_L2[i].indexOf("="))==_L0)return _L2[i].substring((_L2[i].indexOf("=")+1));}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _L0=document.getElementsByTagName("OBJECT");for(var i=_L0.length-1;i>=0;i--){_L0[i].style.display='none';for(var x in _L0[i])if(typeof _L0[i][x]=='function')_L0[i][x]=function(){};}};if(!document.getElementById&&document.all)document.getElementById=function(id){return document.all[id];};var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;var flash_update_dialog_shown=false;function spawn_flash_update_dialog(_L0,_L1){if(flash_update_dialog_shown)return;flash_update_dialog_shown=true;new AsyncRequest().setURI('/ajax/flash_update_dialog.php').setData({have_version:_L0,need_version:_L1}).setMethod('GET').setReadOnly(true).send();}function setFlashFallback(id,_L1){var _L2=ge(id);var _L3=deconcept.SWFObjectUtil.getPlayerVersion();var _L4;_L1.each(function(ii){ii=new deconcept.PlayerVersion(ii.toString().split('.'));if(ii.major==_L3.major){_L4=ii;return;}else if(typeof _L4=='undefined'||ii.major<_L4.major)_L4=ii;}.bind(this));if(_L2&&_L3.major>0){var _L5=_L3.major+'.'+_L3.minor+'.'+_L3.rev;var _L6=_L4.major+'.'+_L4.minor+'.'+_L4.rev;_L2.innerHTML=_tx("Potreban je Flash {required-version} da biste pregledali sljede\u0107i sadr\u017eaj. Va\u0161a trenutna verzija je {current-version}. Molimo skinite posljednju verziju Flash Playera.",{'required-version':_L6,'current-version':_L5});}}function getFlashPlayer(){goURI('http://get.adobe.com/flashplayer');return false;}

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