/*    HTTP Host:  static.ak.fbcdn.net                                          */
/*    Generated:  June 11th 2009 4:14:13 PM PDT                                */
/*      Machine:  10.16.140.109                                                */
/*       Source:  Global Cache                                                 */
/*     Location:  js/3ev5w1rjftmoo8so.pkg.js h:126ss0fg                        */
/*       Locale:  en_US                                                        */
/*         Path:  js/3ev5w1rjftmoo8so.pkg.js                                   */


function contact_dialog_async_with_form(app_id){var async=new AsyncRequest().setMethod('GET').setReadOnly(true).setData({'app_id':app_id}).setURI('/ajax/apps/contact_developer.php');new Dialog().setAsync(async).show();}

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(bounding_box){this.boundingBox=bounding_box;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,handle){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(handle){this.draggables[key].addHandle(handle);}
this.droppables[key]=(new Droppable(obj)).setNamespace(this.namespace).setDragOverHandler(this._dragOverHandlerShim.bind(null,this,key));return this;}
SortableGroup.prototype.addEmptyMessage=function(obj,root){var key='placeholder';if(obj.parentNode!=root){root.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(neverEmpty){this.neverEmpty=neverEmpty;}
SortableGroup.prototype.link=function(sortgroup){sortgroup.linkedGroups=this.linkedGroups;if(!this.linkedGroups.length){this.linkedGroups.push(this);}
this.linkedGroups.push(sortgroup);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=[],childNodes=this.rootNode.childNodes;for(var i=0;i<childNodes.length;i++){for(var k in this.sortables){if(this.sortables[k]==childNodes[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(func){this.linkedGroups.onlinkjump=func;return this;}
SortableGroup.prototype.onorderchange=bagofholding;SortableGroup.prototype.setOrderChangeHandler=function(func){this.onorderchange=func;return this;}
SortableGroup.prototype.ongrabcallback=bagofholding;SortableGroup.prototype.setGrabCallback=function(func){this.ongrabcallback=func;return this;}
SortableGroup.prototype._checkLastRemaining=function(draggable){var oneNodeLeft=this.hasEmptyMessage?2:1;return this.neverEmpty&&this.rootNode.childNodes.length==oneNodeLeft;}
SortableGroup.prototype.grabHandler=function(draggableKey){if(this._checkLastRemaining()){this.draggables[draggableKey].killDrag();return;}
CSS.setClass(this.placeholder,this.sortables[draggableKey].className);CSS.addClass(this.placeholder,'droppable_placeholder');CSS.addClass(this.sortables[draggableKey],'drag');Vector2.getElementDimensions(this.sortables[draggableKey]).setElementDimensions(this.placeholder);this.rootNode.insertBefore(this.placeholder,this.sortables[draggableKey]);this.ongrabcallback(draggableKey);if(!this.isDroppable){var sortable=this.sortables[draggableKey];this.anchor=sortable.nextSibling;if(!this.anchor){this.anchor=$N('div');sortable.parentNode.appendChild(this.anchor);}}}
SortableGroup.prototype.ondropcallback=bagofholding;SortableGroup.prototype.setDropCallback=function(func){this.ondropcallback=func;return this;}
SortableGroup.prototype.dropHandler=function(draggableKey){if(this._checkLastRemaining()){this.draggables[draggableKey].resetPosition();return;}
CSS.removeClass(this.sortables[draggableKey],'drag');this.draggables[draggableKey].resetPosition();this.rootNode.insertBefore(this.sortables[draggableKey],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(draggableKey);this.onorderchange();}
SortableGroup.prototype._dragOverHandlerShim=function(that,droppableKey,draggable){that.dragOverHandler(droppableKey,draggable.getKey('key'));};SortableGroup.prototype.dragOverHandler=function(droppableKey,draggableKey){if(!this.isDroppable&&!this.anchor){return;}
var jumped=false;if(!(draggableKey in this.draggables)){if(!this.migrateLinkedSortable(draggableKey)){throw new Error('Draggable dropped onto a foreign droppable!');}
jumped=true;}
var before=true,childNodes=this.rootNode.childNodes,draggable=this.sortables[draggableKey],droppable=this.sortables[droppableKey];if(!this.anchor){for(var i=0;i<childNodes.length;i++){if(childNodes[i]==droppable){break;}else if(childNodes[i]==draggable){before=false;break;}}}else{droppable=this.anchor;}
if(before||this.anchor){this.rootNode.insertBefore(this.placeholder,droppable);}else{this.rootNode.insertBefore(this.placeholder,droppable.nextSibling);}
this.rootNode.insertBefore(draggable,this.placeholder);this.ondragover(draggable,droppable);if(jumped){this.linkedGroups.onlinkjump.call(this,draggableKey);}}
SortableGroup.prototype.ondragover=bagofholding;SortableGroup.prototype.setDragOverCallback=function(func){this.ondragover=func;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 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.bootstrap=bagofholding;typeahead_source.check_match=function(search,value){value=typeahead_source.tokenize(value);for(var i=0,il=search.length;i<il;i++){if(search[i].length){var found=false;for(var j=0,jl=value.length;j<jl;j++){if(value[j].length>=search[i].length&&value[j].substring(0,search[i].length)==search[i]){found=true;value[j]='';break;}}
if(!found){return false;}}}
return true;}
typeahead_source.tokenize=function(text,capture,noflatten){return(noflatten?text:typeahead_source.flatten_string(text)).split(capture?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(text){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}}
text=text.toLowerCase();for(var i in typeahead_source.accents){text=text.replace(typeahead_source.accents[i],i);}
return text;}
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(result,search){var html=[];resultv=typeahead_source.tokenize(result,true,true);result=typeahead_source.tokenize(result,true);search=typeahead_source.tokenize(search);search.sort(typeahead_source._sort);for(var i=0,il=resultv.length;i<il;i++){var found=false;for(var j=0,jl=search.length;j<jl;j++){if(search[j]&&result[i].lastIndexOf(search[j],0)!=-1){html.push('<em>',htmlspecialchars(resultv[i].substring(0,search[j].length)),'</em>',htmlspecialchars(resultv[i].substring(search[j].length,resultv[i].length)));found=true;break;}}
if(!found){html.push(htmlspecialchars(resultv[i]));}}
return html.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("No matches found");}
typeahead_source.prototype.gen_loading=function(){return this.text_loading!=null?this.text_loading:_tx("Loading...");}
typeahead_source.prototype.gen_placeholder=function(){return this.text_placeholder!=null?this.text_placeholder:_tx("Start typing...");}
typeahead_source.prototype.gen_noinput=function(){return this.text_noinput!=null?this.text_noinput:_tx("Start typing...");}
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();}}

function static_source(){this.values=null;this.index=null;this.index_includes_hints=false;this.exclude_ids={};this.parent.construct(this);}
static_source.extend('typeahead_source');static_source.prototype.enumerable=true;static_source.prototype.filter_excluded=function(values){return values.filter((function(value){return!this.exclude_ids[value.i];}).bind(this));}
static_source.prototype.build_index=function(){var index=[];var values=this.values;var gen_id=values.length&&typeof values[0].i=='undefined';for(var i=0,il=values.length;i<il;i++){var tokens=typeahead_source.tokenize(values[i].t);for(var j=0,jl=tokens.length;j<jl;j++){index.push({t:tokens[j],o:values[i]});}
if(this.index_includes_hints&&values[i].s){var tokens=typeahead_source.tokenize(values[i].s);for(var j=0,jl=tokens.length;j<jl;j++){index.push({t:tokens[j],o:values[i]});}}
if(gen_id){values[i].i=i;}}
index.sort(function(a,b){return(a.t==b.t)?0:(a.t<b.t?-1:1)});this.index=index;this.ready();}
static_source.prototype._sort_text_obj=function(a,b){if(a.e&&!b.e){return 1;}
if(!a.e&&b.e){return-1;}
return a.t.localeCompare(b.t);}
static_source.prototype.search_value=function(text){if(!this.is_ready){return;}
var results;if(text==''){results=this.values;}else{var ttext=typeahead_source.tokenize(text).sort(typeahead_source._sort);var index=this.index;var lo=0;var hi=this.index.length-1;var p=Math.floor(hi/2);while(lo<=hi){if(index[p].t>=ttext[0]){hi=p-1;}else{lo=p+1;}
p=Math.floor(lo+((hi-lo)/2));}
var results=[];var stale_keys={};var check_ignore=typeof _ignoreList!='undefined';for(var i=lo;i<index.length&&index[i].t.lastIndexOf(ttext[0],0)!=-1;i++){var elem_id=index[i].o.flid?index[i].o.flid:index[i].o.i;if(typeof stale_keys[elem_id]!='undefined'){continue;}else{stale_keys[elem_id]=true;}
if((!check_ignore||!_ignoreList[elem_id])&&!this.exclude_ids[elem_id]&&(ttext.length==1||typeahead_source.check_match(ttext,index[i].o.t))){results.push(index[i].o);}}}
results.sort(this._sort_text_obj.bind(this));if(this.owner&&this.owner.max_results){results=results.slice(0,this.owner.max_results);}
return results;}
static_source.prototype.set_exclude_ids=function(ids){this.exclude_ids=ids;}

function fbpage_show_viewer_settings_dialog(fbpage_id,title){var src='/ajax/pages/viewer_settings.php?id='+fbpage_id;Dialog.showFormAjax(title,src,_tx("Save"),true);return false;}
function fbpage_set_fan_status(elem,fbpage_id,action_is_add,reload,handler,error_handler){handler=handler?handler:function(asyncResponse){_fbpage_show_change_status_feedback(elem,asyncResponse.getPayload());};var data={'fbpage_id':fbpage_id,'add':action_is_add,'reload':reload};var request=new AsyncRequest().setURI('/ajax/pages/fan_status.php').setData(data).setHandler(bind(this,handle_require_email_conf_response,handler,null,null));if(error_handler){request.setErrorHandler(error_handler);}
request.send();return false;}
function fbpage_set_favorite_status(elem,fbpage_id,action_is_add){var handler=function(){_fbpage_show_change_status_feedback(elem,this.getUserData());};var data={'fbpage_id':fbpage_id,'add':action_is_add};var async=new AsyncRequest().setMethod('POST').setURI('/ajax/pages/favorite_status.php').setData(data);new Dialog().setAsync(async).setCloseHandler(handler).show();return false;}
function _fbpage_show_change_status_feedback(elem,data){if(!data||!elem){return;}
if(data.reload){goURI(URI.getRequestURI());}else if(data.feedback){var newElem=document.createElement('span');newElem.innerHTML=data.feedback;CSS.setClass(newElem,'fan_status_inactive');elem.parentNode.replaceChild(newElem,elem);var handler=function(){if(data.can_repeat_action){newElem.parentNode.replaceChild(elem,newElem);}}
animation(newElem).duration(3000).checkpoint().to('backgroundColor','#FFFFFF').duration(1000).ondone(handler).go();}}
function fbpage_verification_reason_dialog(){new Dialog().setTitle(_tx("Why is this required?")).setBody(_tx("In order to upload music to your Page, we need you to submit a valid form of identification that identifies you, the admin of the Page. By submitting a valid form of identification, you are confirming that you either own the copyright to the content you will be uploading or that you are authorized by the copyright owner to upload that copyrighted content to your Page. Please note that you can black out any sensitive information on your identification if you wish, other than your name and picture. We currently only accept photo passports, school IDs, and drivers licenses.")).setButtons([Dialog.OK]).show();return false;}
function pages_show_block_app(app_id,action,source){var async=new AsyncRequest().setMethod('POST').setData({app_id:app_id,action:action,source:source}).setURI('/ajax/apps/block.php');new Dialog().setAsync(async).show();}
function pages_change_block_wording(app_id){hide('block_'+app_id);}
function pages_promote_sms_fanning(fan,vanity_url,shortcode){new Dialog().setTitle(_tx("Get more Fans through SMS")).setBody(_tx("Tell people to text \"{fan} {name}\" to {mobile-number} from their mobile phones, and they will be added as fans instantly. Standard charges may apply.",{'fan':fan,'name':vanity_url,'mobile-number':shortcode})).setButtons(Dialog.OK).show();return false;}
function fbpages_app_add(app_id){var async=new AsyncRequest().setURI('/ajax/apps/show_profile_add_dialog.php').setMethod('GET').setReadOnly(true).setData({profile_id:app_id});new Dialog().setAsync(async).show();return false;}
function fbpages_app_on_add(obj){var uri='/ajax/apps/add_to_profile.php';var data={profile_id:obj.profile_id,target_profile_id:obj.id};var handler=function(){ObjectBrowserController.getController(obj.element).removeItem(obj.id);};new AsyncRequest().setURI(uri).setMethod('POST').setData(data).setHandler(handler).send();}

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