jQuery.cookie=function(a,c,b){if(typeof c!="undefined"){b=b||{};if(c===null){c="";b=$.extend({},b);b.expires=-1}var d="";if(b.expires&&(typeof b.expires=="number"||b.expires.toUTCString)){if(typeof b.expires=="number"){d=new Date;d.setTime(d.getTime()+b.expires*24*60*60*1E3)}else d=b.expires;d="; expires="+d.toUTCString()}var f=b.path?"; path="+b.path:"",e=b.domain?"; domain="+b.domain:"";b=b.secure?"; secure":"";document.cookie=[a,"=",encodeURIComponent(c),d,f,e,b].join("")}else{c=null;if(document.cookie&&
document.cookie!=""){b=document.cookie.split(";");for(d=0;d<b.length;d++){f=jQuery.trim(b[d]);if(f.substring(0,a.length+1)==a+"="){c=decodeURIComponent(f.substring(a.length+1));break}}}return c}};
jQuery.fn.textPlaceholder=function(a){a=a||"#AAA";return this.each(function(){var c=this;if(!(c.placeholder&&"placeholder"in document.createElement(c.tagName))){var b=c.style.color,d=c.getAttribute("placeholder"),f=$(c);if(c.value===""||c.value==d){c.value=d;c.style.color=a;f.data("placeholder-visible",true)}f.focus(function(){this.style.color=b;if(f.data("placeholder-visible")){f.data("placeholder-visible",false);this.value=""}});f.blur(function(){if(this.value===""){f.data("placeholder-visible",
true);this.value=d;this.style.color=a}else{this.style.color=b;f.data("placeholder-visible",false)}});c.form&&$(c.form).submit(function(){if(f.data("placeholder-visible"))c.value=""})}})};
(function(a){a.ui=a.ui||{};if(!a.ui.version){a.extend(a.ui,{version:"1.8.2",plugin:{add:function(c,b,d){c=a.ui[c].prototype;for(var f in d){c.plugins[f]=c.plugins[f]||[];c.plugins[f].push([b,d[f]])}},call:function(c,b,d){if((b=c.plugins[b])&&c.element[0].parentNode)for(var f=0;f<b.length;f++)c.options[b[f][0]]&&b[f][1].apply(c.element,d)}},contains:function(c,b){return document.compareDocumentPosition?c.compareDocumentPosition(b)&16:c!==b&&c.contains(b)},hasScroll:function(c,b){if(a(c).css("overflow")==
"hidden")return false;var d=b&&b=="left"?"scrollLeft":"scrollTop",f=false;if(c[d]>0)return true;c[d]=1;f=c[d]>0;c[d]=0;return f},isOverAxis:function(c,b,d){return c>b&&c<b+d},isOver:function(c,b,d,f,e,g){return a.ui.isOverAxis(c,d,e)&&a.ui.isOverAxis(b,f,g)},keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,
NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});a.fn.extend({_focus:a.fn.focus,focus:function(c,b){return typeof c==="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus();b&&b.call(d)},c)}):this._focus.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect",
"none")},scrollParent:function(){var c;c=a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",
1))}).eq(0);return/fixed/.test(this.css("position"))||!c.length?a(document):c},zIndex:function(c){if(c!==undefined)return this.css("zIndex",c);if(this.length){c=a(this[0]);for(var b;c.length&&c[0]!==document;){b=c.css("position");if(b=="absolute"||b=="relative"||b=="fixed"){b=parseInt(c.css("zIndex"));if(!isNaN(b)&&b!=0)return b}c=c.parent()}}return 0}});a.extend(a.expr[":"],{data:function(c,b,d){return!!a.data(c,d[3])},focusable:function(c){var b=c.nodeName.toLowerCase(),d=a.attr(c,"tabindex");return(/input|select|textarea|button|object/.test(b)?
!c.disabled:"a"==b||"area"==b?c.href||!isNaN(d):!isNaN(d))&&!a(c)["area"==b?"parents":"closest"](":hidden").length},tabbable:function(c){var b=a.attr(c,"tabindex");return(isNaN(b)||b>=0)&&a(c).is(":focusable")}})}})(jQuery);
(function(a){var c=a.fn.remove;a.fn.remove=function(b,d){return this.each(function(){if(!d)if(!b||a.filter(b,[this]).length)a("*",this).add(this).each(function(){a(this).triggerHandler("remove")});return c.call(a(this),b,d)})};a.widget=function(b,d,f){var e=b.split(".")[0],g;b=b.split(".")[1];g=e+"-"+b;if(!f){f=d;d=a.Widget}a.expr[":"][g]=function(h){return!!a.data(h,b)};a[e]=a[e]||{};a[e][b]=function(h,i){arguments.length&&this._createWidget(h,i)};d=new d;d.options=a.extend({},d.options);a[e][b].prototype=
a.extend(true,d,{namespace:e,widgetName:b,widgetEventPrefix:a[e][b].prototype.widgetEventPrefix||b,widgetBaseClass:g},f);a.widget.bridge(b,a[e][b])};a.widget.bridge=function(b,d){a.fn[b]=function(f){var e=typeof f==="string",g=Array.prototype.slice.call(arguments,1),h=this;f=!e&&g.length?a.extend.apply(null,[true,f].concat(g)):f;if(e&&f.substring(0,1)==="_")return h;e?this.each(function(){var i=a.data(this,b),j=i&&a.isFunction(i[f])?i[f].apply(i,g):i;if(j!==i&&j!==undefined){h=j;return false}}):this.each(function(){var i=
a.data(this,b);if(i){f&&i.option(f);i._init()}else a.data(this,b,new d(f,this))});return h}};a.Widget=function(b,d){arguments.length&&this._createWidget(b,d)};a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(b,d){this.element=a(d).data(this.widgetName,this);this.options=a.extend(true,{},this.options,a.metadata&&a.metadata.get(d)[this.widgetName],b);var f=this;this.element.bind("remove."+this.widgetName,function(){f.destroy()});this._create();
this._init()},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(b,d){var f=b,e=this;if(arguments.length===0)return a.extend({},e.options);if(typeof b==="string"){if(d===undefined)return this.options[b];f={};f[b]=d}a.each(f,function(g,
h){e._setOption(g,h)});return e},_setOption:function(b,d){this.options[b]=d;if(b==="disabled")this.widget()[d?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",d);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(b,d,f){var e=this.options[b];d=a.Event(d);d.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase();f=f||{};if(d.originalEvent){b=
a.event.props.length;for(var g;b;){g=a.event.props[--b];d[g]=d.originalEvent[g]}}this.element.trigger(d,f);return!(a.isFunction(e)&&e.call(this.element[0],d,f)===false||d.isDefaultPrevented())}}})(jQuery);
(function(a){a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var c=this;this.element.bind("mousedown."+this.widgetName,function(b){return c._mouseDown(b)}).bind("click."+this.widgetName,function(b){if(c._preventClickEvent){c._preventClickEvent=false;b.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(c){c.originalEvent=c.originalEvent||{};if(!c.originalEvent.mouseHandled){this._mouseStarted&&
this._mouseUp(c);this._mouseDownEvent=c;var b=this,d=c.which==1,f=typeof this.options.cancel=="string"?a(c.target).parents().add(c.target).filter(this.options.cancel).length:false;if(!d||f||!this._mouseCapture(c))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){b.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(c)&&this._mouseDelayMet(c)){this._mouseStarted=this._mouseStart(c)!==false;if(!this._mouseStarted){c.preventDefault();
return true}}this._mouseMoveDelegate=function(e){return b._mouseMove(e)};this._mouseUpDelegate=function(e){return b._mouseUp(e)};a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.browser.safari||c.preventDefault();return c.originalEvent.mouseHandled=true}},_mouseMove:function(c){if(a.browser.msie&&!c.button)return this._mouseUp(c);if(this._mouseStarted){this._mouseDrag(c);return c.preventDefault()}if(this._mouseDistanceMet(c)&&
this._mouseDelayMet(c))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,c)!==false)?this._mouseDrag(c):this._mouseUp(c);return!this._mouseStarted},_mouseUp:function(c){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=c.target==this._mouseDownEvent.target;this._mouseStop(c)}return false},_mouseDistanceMet:function(c){return Math.max(Math.abs(this._mouseDownEvent.pageX-
c.pageX),Math.abs(this._mouseDownEvent.pageY-c.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
(function(a){a.ui=a.ui||{};var c=/left|center|right/,b=/top|center|bottom/,d=a.fn.position,f=a.fn.offset;a.fn.position=function(e){if(!e||!e.of)return d.apply(this,arguments);e=a.extend({},e);var g=a(e.of),h=(e.collision||"flip").split(" "),i=e.offset?e.offset.split(" "):[0,0],j,l,m;if(e.of.nodeType===9){j=g.width();l=g.height();m={top:0,left:0}}else if(e.of.scrollTo&&e.of.document){j=g.width();l=g.height();m={top:g.scrollTop(),left:g.scrollLeft()}}else if(e.of.preventDefault){e.at="left top";j=l=
0;m={top:e.of.pageY,left:e.of.pageX}}else{j=g.outerWidth();l=g.outerHeight();m=g.offset()}a.each(["my","at"],function(){var k=(e[this]||"").split(" ");if(k.length===1)k=c.test(k[0])?k.concat(["center"]):b.test(k[0])?["center"].concat(k):["center","center"];k[0]=c.test(k[0])?k[0]:"center";k[1]=b.test(k[1])?k[1]:"center";e[this]=k});if(h.length===1)h[1]=h[0];i[0]=parseInt(i[0],10)||0;if(i.length===1)i[1]=i[0];i[1]=parseInt(i[1],10)||0;if(e.at[0]==="right")m.left+=j;else if(e.at[0]==="center")m.left+=
j/2;if(e.at[1]==="bottom")m.top+=l;else if(e.at[1]==="center")m.top+=l/2;m.left+=i[0];m.top+=i[1];return this.each(function(){var k=a(this),o=k.outerWidth(),p=k.outerHeight(),n=a.extend({},m);if(e.my[0]==="right")n.left-=o;else if(e.my[0]==="center")n.left-=o/2;if(e.my[1]==="bottom")n.top-=p;else if(e.my[1]==="center")n.top-=p/2;n.left=parseInt(n.left);n.top=parseInt(n.top);a.each(["left","top"],function(q,r){a.ui.position[h[q]]&&a.ui.position[h[q]][r](n,{targetWidth:j,targetHeight:l,elemWidth:o,
elemHeight:p,offset:i,my:e.my,at:e.at})});a.fn.bgiframe&&k.bgiframe();k.offset(a.extend(n,{using:e.using}))})};a.ui.position={fit:{left:function(e,g){var h=a(window);h=e.left+g.elemWidth-h.width()-h.scrollLeft();e.left=h>0?e.left-h:Math.max(0,e.left)},top:function(e,g){var h=a(window);h=e.top+g.elemHeight-h.height()-h.scrollTop();e.top=h>0?e.top-h:Math.max(0,e.top)}},flip:{left:function(e,g){if(g.at[0]!=="center"){var h=a(window);h=e.left+g.elemWidth-h.width()-h.scrollLeft();var i=g.my[0]==="left"?
-g.elemWidth:g.my[0]==="right"?g.elemWidth:0,j=-2*g.offset[0];e.left+=e.left<0?i+g.targetWidth+j:h>0?i-g.targetWidth+j:0}},top:function(e,g){if(g.at[1]!=="center"){var h=a(window);h=e.top+g.elemHeight-h.height()-h.scrollTop();var i=g.my[1]==="top"?-g.elemHeight:g.my[1]==="bottom"?g.elemHeight:0,j=g.at[1]==="top"?g.targetHeight:-g.targetHeight,l=-2*g.offset[1];e.top+=e.top<0?i+g.targetHeight+l:h>0?i+j+l:0}}}};if(!a.offset.setOffset){a.offset.setOffset=function(e,g){if(/static/.test(a.curCSS(e,"position")))e.style.position=
"relative";var h=a(e),i=h.offset(),j=parseInt(a.curCSS(e,"top",true),10)||0,l=parseInt(a.curCSS(e,"left",true),10)||0;i={top:g.top-i.top+j,left:g.left-i.left+l};"using"in g?g.using.call(e,i):h.css(i)};a.fn.offset=function(e){var g=this[0];if(!g||!g.ownerDocument)return null;if(e)return this.each(function(){a.offset.setOffset(this,e)});return f.call(this)}}})(jQuery);window.freebase=window.fb={};
(function(a,c){c.dispatch=function(b,d,f,e){if(typeof d!=="function")return false;b=a.event.fix(b||window.event);f||(f=[]);e||(e=this);return d.apply(e,[b].concat(f))}})(jQuery,window.freebase);
(function(a,c){function b(g,h){var i=g.indexOf("|"+h+"_");if(i!=-1){i=i+2+h.length;var j=g.indexOf("|",i);if(j!=-1)return decodeURIComponent(g.substr(i,j-i))}return null}var d=a.cookie("metaweb-user-info");if(d){var f=b(d,"g"),e=b(d,"u");(d=b(d,"p"))||(d="/user/"+this.name);c.user={guid:f,name:e,id:d}}if(c.user){f=a("#nav-username a:first");if(f.length){f[0].href+=c.user.id;f.text(c.user.name)}a("#signedin").show()}else a("#signedout").show()})(jQuery,window.freebase);
(function(a){a(function(){var c=a("#SearchBox .SearchBox-input,#global-search-input"),b=acre.freebase.site_host;c.suggest({service_url:b,soft:true,category:"object",parent:"#site-search-box",align:"right",status:null});var d=a("#site-search-label"),f=a("#site-search-box .fbs-pane");c.bind("fb-select",function(e,g){window.location=b+"/view"+g.id;return false}).bind("fb-pane-show",function(){d.html("<span>Select an item from the list</span>").removeClass("loading")}).bind("fb-textchange",function(){a.trim(c.val())===
""?d.html("<span>Start typing to get some suggestions</span>").removeClass("loading"):d.html("<span>Searching...</span>").addClass("loading")}).bind("fb-error",function(){d.html("<span>Sorry, something went wrong. Please try again later</span>").removeClass("loading")}).focus(function(){d.is(":visible")||a("#site-search-label").slideDown("fast")}).blur(function(){!f.is(":visible")&&d.is(":visible")&&a("#site-search-label").slideUp("fast")});a(".SearchBox-form").submit(function(){return a.trim(a("#global-search-input").val()).length==
0?false:true});a("input, textarea").textPlaceholder()})})(jQuery,window.freebase);
