/* /js/unit/ek/events/detail.js */
Function.prototype.bind=function(){var __method=this,args=Array.prototype.slice.call(arguments),object=args.shift();return function(){var local_args=args.concat(Array.prototype.slice.call(arguments));if(this!==window)local_args.push(this);return __method.apply(object,local_args);}}
Function.prototype.mixin=function(fn)
{this.prototype=$.extend(this.prototype,fn.prototype);return this;}
Function.prototype.later=function(msec)
{var fn=this,args=Array.prototype.slice.call(arguments,1);return window.setTimeout(function(){fn.apply(this,args)},msec);}
Function.prototype.slow=function(msec,next){var fn=this,tm;if(next){return function(){if(tm)return;tm=1;fn.apply(this,Array.prototype.slice.call(arguments));(function(){tm=0;}).later(msec);}}else{return function(){if(tm)clearTimeout(tm);tm=(function(args){tm=0;fn.apply(this,args);})
.bind(this,Array.prototype.slice.call(arguments))
.later(msec);}}}
Function.prototype.invert=function()
{return function()
{return!this.call();}.bind(this);}
/* Copyright Eventful, Inc. All rights reserved except where otherwise noted. */
if(typeof window.Eventful==="undefined"){window.Eventful={};}
if(jQuery&&jQuery.fn.jquery>="1.4"){jQuery.ajaxSettings.traditional=true;}
if(window.console==="undefined"){window.console=(function(){var console={},noOp=function(){},aProps=['assert','count','debug','dir','dirxml','error','group','groupCollapsed','groupEnd','info','log','markTimeline','profile','profileEnd','time','timeEnd','trace','warn'],i,l;for(i=0,l=aProps.length;i<l;i++){console[aProps[i]]=noOp;}
return console;})();}
Eventful.isIE=false/*@cc_on @*//*@if (@_win32) || true/*@end @*/;Eventful.isSafari=navigator&&navigator.userAgent.indexOf('Safari')>0;Eventful.JSCheck=function(){document.body.className+=" has-js";};Eventful.fixKeyCode=function(keyCode){var keyEnter=13;if(Eventful.isSafari&&keyCode===3){return keyEnter;}
if(Eventful.isIE&&keyCode===0){return keyEnter;}
return keyCode;};Eventful.UIEvent=function()
{this.subscribers=[];}
Eventful.UIEvent.prototype.subscribe=function(fnCallback)
{this.subscribers.push(fnCallback);}
Eventful.UIEvent.prototype.fire=function()
{var aArgs=arguments;for(var i=0;i<this.subscribers.length;i++)
{this.subscribers[i].apply(undefined,aArgs);}}
Eventful.TrackPageview=function(oArgs){window._gaq=window._gaq||[];oArgs=oArgs||{};if(typeof oArgs=='string'){return Eventful.TrackPageview({page:oArgs});}
oArgs.page=oArgs.page||window.location.pathname;oArgs.query=oArgs.query||'';var sQuery=Eventful.TrackPageview.query();if(oArgs.query&&oArgs.page.indexOf('?')>=0){oArgs.query='&'+oArgs.query.substring(1);}
if(sQuery&&(oArgs.page.indexOf('?')>=0||oArgs.query)){sQuery='&'+sQuery.substring(1);}
Eventful.TrackPageview.track(oArgs.page+oArgs.query+sQuery);};Eventful.TrackPageview.track=function(sPage){_gaq.push(['_trackPageview',sPage]);};Eventful.TrackPageview.trackVirturalEvent=function(){Eventful.TrackPageview.track('/virtual/event/'+Array.prototype.slice.call(arguments).join('/'));};Eventful.TrackPageview.trackEvent=function(category,action,optional_label,optional_value){if(typeof window["console"]==="object"&&Eventful.Session&&Eventful.Session.userRole==="admin"){window["console"].log("Google Analytics _trackEvent:",arguments);}
_gaq.push(['_trackEvent',category,action,optional_label,optional_value]);};Eventful.TrackPageview.trackSocial=function(network,action,optional_target,optional_pagepath){_gaq.push(['_trackSocial',network,action,optional_target,optional_pagepath]);}
Eventful.TrackPageview.query=function(sQuery){return Eventful.TrackPageview._sQuery=sQuery||Eventful.TrackPageview._sQuery||window.location.search.toLowerCase();};Eventful.TrackPageview.setParams=function(oParams){var aParams=[];for(var sKey in oParams){aParams.push(sKey+'='+oParams[sKey]);}
var sQuery=Eventful.TrackPageview.query();Eventful.TrackPageview.query((sQuery?sQuery+'&':'?')+aParams.join('&'));};Eventful.Forms={};Eventful.Forms.focusFirstField=function(elForm)
{$(":input",elForm)
.not(':hidden')
.eq(0)
.not('[value],.inactive,:file')
.focus();};/*
 * SimpleModal 1.1.1 - jQuery Plugin
 * http://www.ericmmartin.com/projects/simplemodal/
 * http://plugins.jquery.com/project/SimpleModal
 * http://code.google.com/p/simplemodal/
 *
 * Copyright (c) 2007 Eric Martin - http://ericmmartin.com
 *
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * Revision: $Id: jquery.simplemodal.js 93 2008-01-15 16:14:20Z emartin24 $
 *
 */
(function($){$.modal=function(data,options){return $.modal.impl.init(data,options);};$.modal.close=function(){$.modal.impl.close(true);};$.fn.modal=function(options){return $.modal.impl.init(this,options);};$.modal.defaults={overlay:50,overlayId:'modalOverlay',overlayCss:{},containerId:'modalContainer',containerCss:{},close:true,closeTitle:'Close',closeClass:'modalClose',closeText:'&#215;',persist:false,onOpen:null,onShow:null,onClose:null};$.modal.impl={opts:null,dialog:{},init:function(data,options){if(this.dialog.data){return false;}
this.opts=$.extend({},$.modal.defaults,options);if(typeof data=='object'){data=data instanceof jQuery?data:$(data);if(data.parent().parent().size()>0){this.dialog.parentNode=data.parent();if(!this.opts.persist){this.dialog.original=data.clone(true);}}}
else if(typeof data=='string'||typeof data=='number'){data=$('<div>').html(data);}
else{if(console){console.log('SimpleModal Error: Unsupported data type: '+typeof data);}
return false;}
this.dialog.data=data.addClass('modalData');data=null;this.create();this.open();if($.isFunction(this.opts.onShow)){this.opts.onShow.apply(this,[this.dialog]);}
return this;},create:function(){this.dialog.overlay=$('<div>')
.attr('id',this.opts.overlayId)
.addClass('modalOverlay')
.css($.extend(this.opts.overlayCss,{opacity:this.opts.overlay/100,height:'100%',width:'100%',position:'fixed',left:0,top:0,zIndex:3000}))
.hide()
.appendTo('body');this.dialog.container=$('<div>')
.attr('id',this.opts.containerId)
.addClass('modalContainer')
.css($.extend(this.opts.containerCss,{zIndex:3100}))
.append(this.opts.close?'<a class="modalCloseImg '
+this.opts.closeClass
+'" title="'
+this.opts.closeTitle+'">'+this.opts.closeText+'</a>':'')
.hide()
.appendTo('body');if($.browser.msie&&($.browser.version<7)){this.fixIE();}
this.dialog.container.append(this.dialog.data.hide());},bindEvents:function(){var modal=this;$('.'+this.opts.closeClass).click(function(e){e.preventDefault();modal.close();});},unbindEvents:function(){$('.'+this.opts.closeClass).unbind('click');},fixIE:function(){if($(document.body).height()<$(document).height())
{$(document.body).css({height:'100%'});}
var wHeight=$(document.body).height()+'px';var wWidth=$(document.body).width()+'px';this.dialog.overlay.css({position:'absolute',height:wHeight,width:wWidth});this.dialog.container.css({position:'absolute'});this.dialog.iframe=$('<iframe src="javascript:false;">')
.css($.extend(this.opts.iframeCss,{opacity:0,position:'absolute',height:wHeight,width:wWidth,zIndex:1000,width:'100%',top:0,left:0}))
.hide()
.appendTo('body');},open:function(){if(this.dialog.iframe){this.dialog.iframe.show();}
if($.isFunction(this.opts.onOpen)){this.opts.onOpen.apply(this,[this.dialog]);}
else{this.dialog.overlay.show();this.dialog.container.show();this.dialog.data.show();}},close:function(external){if(!this.dialog.data){return false;}
if($.isFunction(this.opts.onClose)&&!external){this.opts.onClose.apply(this,[this.dialog]);}
if(this.dialog.parentNode){if(this.opts.persist){this.dialog.data.hide().appendTo(this.dialog.parentNode);}
else{this.dialog.data.remove();this.dialog.original.appendTo(this.dialog.parentNode);}}
else{this.dialog.data.remove();}
this.dialog.container.remove();this.dialog.overlay.remove();if(this.dialog.iframe){this.dialog.iframe.remove();}
this.dialog={};this.unbindEvents();}};})(jQuery);Eventful.Panel=function(id)
{this.id=id;this.trackingString=null;this.eventShow=new Eventful.UIEvent();this.eventClose=new Eventful.UIEvent();this.eventReady=new Eventful.UIEvent();var fnToggleAds=function(){var ads=$('.rev-gen').filter(function(){return $(this).parents('.panel').length==0?this:null;});ads.toggle();};this.eventShow.subscribe(fnToggleAds);this.eventClose.subscribe(fnToggleAds);}
Eventful.Panel.prototype.panel=function()
{if(!this.jqPanel)this.jqPanel=$('#'+this.id);return this.jqPanel;}
Eventful.Panel.prototype.find=function(sExpr)
{return this.panel().find(sExpr)}
Eventful.Panel.prototype.options=function(oOptions)
{if(oOptions.tracking_string)
{this.trackingString=oOptions.tracking_string;}
if(oOptions.width)
{oOptions.width=+oOptions.width.toString().replace('px','');oOptions.containerCss=$.extend(oOptions.containerCss,{width:oOptions.width,marginLeft:-oOptions.width/2});}
oOptions=$.extend({persist:true,overlay:75,onShow:this.listenShow.bind(this),closeClass:'modalClose',closeOnKeyEsc:false},oOptions);oOptions.containerCss=$.extend({position:'absolute'},oOptions.containerCss);this.oOptions=oOptions;return this;}
Eventful.Panel.prototype.autoShow=function(sHash)
{if(window.location.hash=="#"+sHash)
{$(this.show.bind(this));}}
Eventful.Panel.prototype.clickShow=function(sQuery)
{return this.clickClose(sQuery,true);}
Eventful.Panel.prototype.clickClose=function(sQuery,bShow)
{$(function()
{if(sQuery instanceof Array)sQuery=$.map(sQuery,function(id){return'#'+id}).join();$(sQuery).click(function(evt)
{evt.preventDefault();if(bShow)this.show(evt);else this.close(evt);}.bind(this));}.bind(this));return this;}
Eventful.Panel.prototype.show=function(evt)
{if(!this.panel().length)return this;if(this.oOptions.containerCss.position=='absolute')
{this.oOptions.containerCss.top=(Eventful.scrollTop()+30)+'px';}
if(this.oOptions.topMod){this.oOptions.containerCss.top=(Eventful.scrollTop()+30+this.oOptions.topMod)+'px';}
if(this.parent(Eventful.Panel.current()))
{this.parent().close();}
var jqModal=this.panel().modal(this.oOptions);if(jqModal){this.jqModal=jqModal;}
Eventful.Panel.current(this);if(this.oOptions.containerCss.position=='fixed'&&!($.browser.msie&&($.browser.version<7)))
{var jqMC=$('#modalContainer');jqMC
.css('top','50%')
.css('marginTop','-'+Math.round(jqMC.height()*0.67)+'px');}
if(this.oOptions.closeOnKeyEsc)
{$('#modalContainer').one('keyup',function(evt){if(evt.keyCode==27)this.close();}.bind(this));}
$('#modalContainer .'+this.oOptions.closeClass).one('click',this.close.bind(this));if(this.trackingString){Eventful.TrackPageview.track(this.trackingString);}
this.eventShow.fire(evt);return this;}
Eventful.Panel.prototype.close=function(evt)
{if(this.jqModal)this.jqModal.close();this.eventClose.fire(evt);if(Eventful.Panel.current()==this)
{Eventful.Panel.current(null);}
if(this.parent())
{this.parent().show();this.parent(null);}
return this;}
Eventful.Panel.prototype.parent=function(obj)
{return obj!==undefined?this.oParent=obj:this.oParent||null;}
Eventful.Panel.prototype.listenShow=function()
{Eventful.Forms.focusFirstField(this.panel());}
Eventful.Panel.current=function(obj)
{return obj!==undefined?Eventful.Panel.oCurrent=obj:Eventful.Panel.oCurrent||null;}
Eventful.Panel.prototype.resize=function(){var width=0;this.panel().each(function(){tmpWidth=$(this).width();if(tmpWidth>=width){width=tmpWidth;}});var left=$(window).width()/2;$('#modalContainer').css({'width':width+'px','left':(left-(width/2))+'px','margin-left':'0px'});}
Eventful.scrollTop=function()
{return document.body.scrollTop||document.documentElement.scrollTop||0;}
Eventful.Autoclose=function()
{$('body').click(Eventful.Autoclose.body_click);}
Eventful.Autoclose.element_id=null;Eventful.Autoclose.afterClosed=new Eventful.UIEvent();Eventful.Autoclose.body_click=function(evt)
{if(evt)
{var elTarget=$(evt.target);if(elTarget.size())
{if(elTarget.hasClass("autoclose")||elTarget.hasClass("autoclose-click")||elTarget.parents('.autoclose').size())
{return true;}}}
Eventful.Autoclose.close_block();}
Eventful.Autoclose.close_block=function()
{var id=Eventful.Autoclose.element_id;if(id&&id.length)
{var elAutoclose=$('#'+id);if(elAutoclose.size())
{elAutoclose.hide();Eventful.Autoclose.element_id=null;Eventful.Autoclose.afterClosed.fire(elAutoclose.get(0));}}}
Eventful.Autoclose.set_id=function(idEl)
{if(Eventful.Autoclose.element_id!=idEl)
{Eventful.Autoclose.close_block();Eventful.Autoclose.element_id=idEl;}}
$(Eventful.Autoclose);Eventful.Popover=function(jqEx,oOptions)
{this.eventShow=new Eventful.UIEvent();this.eventClose=new Eventful.UIEvent();this._setup({width:"300px",css:{'backgroundColor':'#fff','border':'1px solid #666','zIndex':"10"},position:{"top":10,"left":10,"right":'auto',"bottom":'auto',"relative":'mouse'},no_focus:false,tracking:''},jqEx,oOptions||{});}
Eventful.Popover.prototype._setup=function(default_args,jqEx,oOptions){var popoverCss={},containerCss={};$.each($.extend(default_args.css,{'width':default_args.width},oOptions.css,{'width':oOptions.width}),function(attr,val){if(!val)return;if(/^(width|height|zIndex)$/.test(attr)){containerCss[attr]=val;}else{popoverCss[attr]=val;}});this.popover(jqEx).css(popoverCss);this.args={'containerCss':containerCss,'position':$.extend(default_args.position,oOptions.position),'tracking':oOptions.tracking||default_args.tracking,'no_focus':oOptions.no_focus||default_args.no_focus,'listenKeyESC':!!this.find(':input').not(':hidden').length};}
Eventful.Popover.prototype.container=function(){var jContainer,oEvt,oInst,fnKeyESCHdl=function(evt){if(evt.keyCode==27&&oInst){oInst.close(evt);}},fnReposition=function(evt){if(oInst)oInst._position(evt);},fnMouseLeaveHdl=function(){if(oInst)oInst._slowUIAct(!oInst.args.slowActOverPopover,true);},fnMouseEnterHdl=function(){if(oInst)oInst._slowUIAct(!oInst.args.slowActOverPopover,false);},fnShow=function(intc,evt){if(oInst)fnClose();oInst=intc;oEvt=evt?{'target':evt.target,'pageX':evt.pageX,'pageY':evt.pageY}:null;jContainer
.prepend(oInst.popover(true))
.css($.extend({height:'auto',width:'auto',zIndex:'auto'},oInst.args.containerCss,{"top":"-1000px","left":"-1000px"}))
.show();oInst._position(oEvt);if(oInst.args.listenOverPopover){jContainer
.bind('mouseenter',fnMouseEnterHdl)
.bind('mouseleave',fnMouseLeaveHdl);}
if(oInst.args.listenKeyESC){jContainer.bind('keyup',fnKeyESCHdl);}
if(oInst.args.position.relative==='mouse'&&oEvt){$(oEvt.target).bind('mousemove',fnReposition);}},fnClose=function(){if(oInst.args.listenOverPopover){jContainer
.unbind('mouseenter',fnMouseEnterHdl)
.unbind('mouseleave',fnMouseLeaveHdl);}
if(oInst.args.listenKeyESC){jContainer.unbind('keyup',fnKeyESCHdl);}
if(oInst.args.position.relative==='mouse'&&oEvt){$(oEvt.target).unbind('mousemove',fnReposition);}
jContainer
.hide()
.children().not('iframe')
.each(function(){if(this.parentNode)this.parentNode.removeChild(this);});oInst=oEvt=null;};return function(doElse){if(!jContainer){jContainer=$('<div id="eventful-tooltip" class="popover autoclose" \
                          style="position:absolute;margin:0;border:0;padding:0;background-color:transparent;"> \
                      </div>')
.appendTo(document.body)
.hide()
.bind('resize',function(){jContainer
.children('iframe')
.css({'width':jContainer.width(),'height':jContainer.height()});fnReposition(oEvt);});if($.browser.msie&&($.browser.version<7)){jContainer.append('<iframe frameborder="0" src="javascript:\'\'" \
                             style="position:absolute;top:0;left:0;z-index:-1;filter:mask();"> \
                           </iframe>');}
$(window).bind('resize',function(){fnReposition(oEvt);});}
if(doElse){if(doElse.get&&doElse.get==='event'){return oEvt;}else if(doElse.get&&doElse.get==='instance'){return oInst;}else if(doElse.set&&doElse.set[0]){fnShow(doElse.set[0],doElse.set[1]);}else if(doElse.set&&oInst){fnClose();}}
return jContainer;}}();Eventful.Popover.prototype.popover=function(jqEx){if(!this._jPopover&&jqEx){this._jPopover=$(jqEx).hide();if(this._jPopover.parents('body').length){this._jPopover._delayDetach=true;}else if(typeof jqEx==='string'){this._jPopover=$('<div class="popbd">'+jqEx+'</div>');}}else if(this._jPopover._delayDetach&&jqEx===true){this._jPopover.each(function(){if(this.parentNode)this.parentNode.removeChild(this);}).removeClass('hidden').show();delete this._jPopover['_delayDetach'];}
return this._jPopover;}
Eventful.Popover.prototype.find=function(sExpr)
{return this.popover().find(sExpr)}
Eventful.Popover.prototype.clickShow=function(jSel,bStayOpen){$(jSel)
.addClass('popover-sender autoclose')
.click(function(evt){(!bStayOpen&&this.isOpen())?this.close(evt):this.show(evt);evt.preventDefault();}.bind(this));return this;}
Eventful.Popover.prototype.clickClose=function(jSel){$(jSel).click(function(evt){this.close(evt);evt.preventDefault();}.bind(this));return this;}
Eventful.Popover.prototype.hoverShow=function(jSel,options){var fnShow,fnClose;if(options&&(options.show_over||options.show_slow)){fnShow=this._slowUIAct.bind(this,!options.show_slow,false);fnClose=this._slowUIAct.bind(this,!options.show_slow,true);}else{fnShow=this.show.bind(this);fnClose=this.close.bind(this);}
this.args.listenOverPopover=!!(options&&options.show_over);this.args.slowActOverPopover=this.args.listenOverPopover&&options.show_slow;$(jSel)
.addClass('popover-sender')
.bind('mouseenter',fnShow)
.bind('mouseleave',fnClose);return this;}
Eventful.Popover.prototype._slowUIAct=(function(){var fn=function(evt,bClosing){bClosing===true?this.close(evt):this.show(evt);},fnHalfSec=fn.slow(500),fnMillSec=fn.slow(10);return function(bQuick,bClosing,evt){(bQuick?fnMillSec:fnHalfSec)
.call(this,evt?{'target':evt.target,'pageX':evt.pageX,'pageY':evt.pageY}:null,bClosing);}})();Eventful.Popover.prototype.isOpen=function(bPopover){var inst=this.container({'get':'instance'});return bPopover?!!inst:this===inst;}
Eventful.Popover.prototype.show=function(evt){if(this.isOpen()){var lastShowEvt=this.container({'get':'event'});if(!evt)return this._position(lastShowEvt);if(lastShowEvt&&lastShowEvt.target===evt.target)return this._position(evt);}
if(this.isOpen(true)){this.container({'get':'instance'}).close(evt);}
this.container({'set':[this,evt]});if(!this.args.no_focus){this.container().find(":input").not('.inactive,:hidden').eq(0).trigger('focus');}
if(this.args.tracking){Eventful.TrackPageview.track(this.args.tracking);}
Eventful.Autoclose.set_id(this.container().attr('id'));this.eventShow.fire(evt);return this;}
Eventful.Popover.prototype.close=function(evt){this.container({'set':[null,null]});Eventful.Autoclose.element_id=null;this.eventClose.fire(evt);return this;}
Eventful.Autoclose.afterClosed.subscribe(function(elClose){if(elClose===Eventful.Popover.prototype.container()[0]){var intsToClose=Eventful.Popover.prototype.container({'get':'instance'});if(intsToClose)intsToClose.close();}});Eventful.Popover.prototype._position=function(evt){var docScrollTop=document.body.scrollTop||document.documentElement.scrollTop||0,docScrollLeft=document.body.scrollLeft||document.documentElement.scrollLeft||0,h=this.container().height(),w=this.container().width(),top=0,left=0;if(typeof this.args.position.relative=='object'||(this.args.position.relative=='sender'&&evt)){var jRelative=typeof this.args.position.relative==='object'?$(this.args.position.relative):$(evt.target).parents('.popover-sender').andSelf(),positionOffset=jRelative.offset();if(typeof this.args.position.top=='number'){top=positionOffset.top+this.args.position.top;}else if(typeof this.args.position.bottom=='number'){top=positionOffset.top+jRelative.height()-h-this.args.position.bottom;}else{top=positionOffset.top+10;}
if(typeof this.args.position.left=='number'){left=positionOffset.left+this.args.position.left;}else if(typeof this.args.position.right=='number'){left=positionOffset.left+jRelative.width()-w-this.args.position.right;}else{left=positionOffset.left+10;}}else if(this.args.position.relative=='viewport'){if(typeof this.args.position.top=='number'){top=docScrollTop+this.args.position.top;}else if(typeof this.args.position.bottom=='number'){top=docScrollTop+$(window).height()-h-this.args.position.bottom;}else{top=docScrollTop+10;}
if(typeof this.args.position.left=='number'){left=docScrollLeft+this.args.position.left;}else if(typeof this.args.position.right=='number'){left=docScrollLeft+$(window).width()-w-this.args.position.right;}else{left=docScrollLeft+10;}}else if(/^(mouse|click)$/.test(this.args.position.relative)&&evt){if(typeof this.args.position.top!=='number')this.args.position.top=10;if(typeof this.args.position.left!=='number')this.args.position.left=10;if(evt.pageY<=docScrollTop+$(window).height()*0.5){top=evt.pageY+this.args.position.top;}else{top=evt.pageY-this.args.position.top-h;}
if(evt.pageX<=docScrollLeft+$(window).width()*0.5){left=evt.pageX+this.args.position.left;}else{left=evt.pageX-this.args.position.left-w;}}
this.container().css({"top":top+"px","left":left+"px"});return this;}
Eventful.Popover.blockUI=function(){if(!Eventful.Popover.blockUI.blocker)Eventful.Popover.blockUI.blocker=new Eventful.Popover('<div id="eventful-uiblocker" style="height:'+$(document).height()+
'px;background:#FFFFFF url(http://s1.evcdn.com/store/skin/throbbers/throbber_32x32.gif) no-repeat fixed center center;"></div>',{css:{width:'100%',border:false,opacity:0.66},position:{top:0,left:0,relative:'viewport'}});Eventful.Popover.blockUI.blocker.show();}
Eventful.Popover.unblockUI=function(){if(Eventful.Popover.blockUI.blocker)Eventful.Popover.blockUI.blocker.close();}
/*
 * jQuery Templating Plugin
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 */;(function(jQuery,undefined){var oldManip=jQuery.fn.domManip,tmplItmAtt="_tmplitem",htmlExpr=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,newTmplItems={},wrappedItems={},appendToTmplItems,topTmplItem={key:0,data:{}},itemKey=0,cloneIndex=0,stack=[];function newTmplItem(options,parentItem,fn,data){var newItem={data:data||(parentItem?parentItem.data:{}),_wrap:parentItem?parentItem._wrap:null,tmpl:null,parent:parentItem||null,nodes:[],calls:tiCalls,nest:tiNest,wrap:tiWrap,html:tiHtml,update:tiUpdate};if(options){jQuery.extend(newItem,options,{nodes:[],parent:parentItem});}
if(fn){newItem.tmpl=fn;newItem._ctnt=newItem._ctnt||newItem.tmpl(jQuery,newItem);newItem.key=++itemKey;(stack.length?wrappedItems:newTmplItems)[itemKey]=newItem;}
return newItem;}
jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){var ret=[],insert=jQuery(selector),elems,i,l,tmplItems,parent=this.length===1&&this[0].parentNode;appendToTmplItems=newTmplItems||{};if(parent&&parent.nodeType===11&&parent.childNodes.length===1&&insert.length===1){insert[original](this[0]);ret=this;}else{for(i=0,l=insert.length;i<l;i++){cloneIndex=i;elems=(i>0?this.clone(true):this).get();jQuery.fn[original].apply(jQuery(insert[i]),elems);ret=ret.concat(elems);}
cloneIndex=0;ret=this.pushStack(ret,name,insert.selector);}
tmplItems=appendToTmplItems;appendToTmplItems=null;jQuery.tmpl.complete(tmplItems);return ret;};});jQuery.fn.extend({tmpl:function(data,options,parentItem){return jQuery.tmpl(this[0],data,options,parentItem);},tmplItem:function(){return jQuery.tmplItem(this[0]);},template:function(name){return jQuery.template(name,this[0]);},domManip:function(args,table,callback,options){if(args[0]&&args[0].nodeType){var dmArgs=jQuery.makeArray(arguments),argsLength=args.length,i=0,tmplItem;while(i<argsLength&&!(tmplItem=jQuery.data(args[i++],"tmplItem"))){}
if(argsLength>1){dmArgs[0]=[jQuery.makeArray(args)];}
if(tmplItem&&cloneIndex){dmArgs[2]=function(fragClone){jQuery.tmpl.afterManip(this,fragClone,callback);};}
oldManip.apply(this,dmArgs);}else{oldManip.apply(this,arguments);}
cloneIndex=0;if(!appendToTmplItems){jQuery.tmpl.complete(newTmplItems);}
return this;}});jQuery.extend({tmpl:function(tmpl,data,options,parentItem){var ret,topLevel=!parentItem;if(topLevel){parentItem=topTmplItem;tmpl=jQuery.template[tmpl]||jQuery.template(null,tmpl);wrappedItems={};}else if(!tmpl){tmpl=parentItem.tmpl;newTmplItems[parentItem.key]=parentItem;parentItem.nodes=[];if(parentItem.wrapped){updateWrapped(parentItem,parentItem.wrapped);}
return jQuery(build(parentItem,null,parentItem.tmpl(jQuery,parentItem)));}
if(!tmpl){return[];}
if(typeof data==="function"){data=data.call(parentItem||{});}
if(options&&options.wrapped){updateWrapped(options,options.wrapped);}
ret=jQuery.isArray(data)?jQuery.map(data,function(dataItem){return dataItem?newTmplItem(options,parentItem,tmpl,dataItem):null;}):[newTmplItem(options,parentItem,tmpl,data)];return topLevel?jQuery(build(parentItem,null,ret)):ret;},tmplItem:function(elem){var tmplItem;if(elem instanceof jQuery){elem=elem[0];}
while(elem&&elem.nodeType===1&&!(tmplItem=jQuery.data(elem,"tmplItem"))&&(elem=elem.parentNode)){}
return tmplItem||topTmplItem;},template:function(name,tmpl){if(tmpl){if(typeof tmpl==="string"){tmpl=buildTmplFn(tmpl)}else if(tmpl instanceof jQuery){tmpl=tmpl[0]||{};}
if(tmpl.nodeType){tmpl=jQuery.data(tmpl,"tmpl")||jQuery.data(tmpl,"tmpl",buildTmplFn(tmpl.innerHTML));}
return typeof name==="string"?(jQuery.template[name]=tmpl):tmpl;}
return name?(typeof name!=="string"?jQuery.template(null,name):(jQuery.template[name]||jQuery.template(null,htmlExpr.test(name)?name:jQuery(name)))):null;},encode:function(text){return(""+text).split("<").join("&lt;").split(">").join("&gt;").split('"').join("&#34;").split("'").join("&#39;");}});jQuery.extend(jQuery.tmpl,{tag:{"tmpl":{_default:{$2:"null"},open:"if($notnull_1){_=_.concat($item.nest($1,$2));}"},"wrap":{_default:{$2:"null"},open:"$item.calls(_,$1,$2);_=[];",close:"call=$item.calls();_=call._.concat($item.wrap(call,_));"},"each":{_default:{$2:"$index, $value"},open:"if($notnull_1){$.each($1a,function($2){with(this){",close:"}});}"},"if":{open:"if(($notnull_1) && $1a){",close:"}"},"else":{_default:{$1:"true"},open:"}else if(($notnull_1) && $1a){"},"html":{open:"if($notnull_1){_.push($1a);}"},"=":{_default:{$1:"$data"},open:"if($notnull_1){_.push($.encode($1a));}"},"!":{open:""}},complete:function(items){newTmplItems={};},afterManip:function afterManip(elem,fragClone,callback){var content=fragClone.nodeType===11?jQuery.makeArray(fragClone.childNodes):fragClone.nodeType===1?[fragClone]:[];callback.call(elem,fragClone);storeTmplItems(content);cloneIndex++;}});function build(tmplItem,nested,content){var frag,ret=content?jQuery.map(content,function(item){return(typeof item==="string")?(tmplItem.key?item.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g,"$1 "+tmplItmAtt+"=\""+tmplItem.key+"\" $2"):item):build(item,tmplItem,item._ctnt);}):tmplItem;if(nested){return ret;}
ret=ret.join("");ret.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,function(all,before,middle,after){frag=jQuery(middle).get();storeTmplItems(frag);if(before){frag=unencode(before).concat(frag);}
if(after){frag=frag.concat(unencode(after));}});return frag?frag:unencode(ret);}
function unencode(text){var el=document.createElement("div");el.innerHTML=text;return jQuery.makeArray(el.childNodes);}
function buildTmplFn(markup){return new Function("jQuery","$item","var $=jQuery,call,_=[],$data=$item.data;"+
"with($data){_.push('"+
jQuery.trim(markup)
.replace(/([\\'])/g,"\\$1")
.replace(/[\r\t\n]/g," ")
.replace(/\$\{([^\}]*)\}/g,"{{= $1}}")
.replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,function(all,slash,type,fnargs,target,parens,args){var tag=jQuery.tmpl.tag[type],def,expr,exprAutoFnDetect;if(!tag){throw"Template command not found: "+type;}
def=tag._default||[];if(parens&&!/\w$/.test(target)){target+=parens;parens="";}
if(target){target=unescape(target);args=args?(","+unescape(args)+")"):(parens?")":"");expr=parens?(target.indexOf(".")>-1?target+parens:("("+target+").call($item"+args)):target;exprAutoFnDetect=parens?expr:"(typeof("+target+")==='function'?("+target+").call($item):("+target+"))";}else{exprAutoFnDetect=expr=def.$1||"null";}
fnargs=unescape(fnargs);return"');"+
tag[slash?"close":"open"]
.split("$notnull_1").join(target?"typeof("+target+")!=='undefined' && ("+target+")!=null":"true")
.split("$1a").join(exprAutoFnDetect)
.split("$1").join(expr)
.split("$2").join(fnargs?fnargs.replace(/\s*([^\(]+)\s*(\((.*?)\))?/g,function(all,name,parens,params){params=params?(","+params+")"):(parens?")":"");return params?("("+name+").call($item"+params):all;}):(def.$2||""))+
"_.push('";})+
"');}return _;");}
function updateWrapped(options,wrapped){options._wrap=build(options,true,jQuery.isArray(wrapped)?wrapped:[htmlExpr.test(wrapped)?wrapped:jQuery(wrapped).html()]).join("");}
function unescape(args){return args?args.replace(/\\'/g,"'").replace(/\\\\/g,"\\"):null;}
function outerHtml(elem){var div=document.createElement("div");div.appendChild(elem.cloneNode(true));return div.innerHTML;}
function storeTmplItems(content){var keySuffix="_"+cloneIndex,elem,elems,newClonedItems={},i,l,m;for(i=0,l=content.length;i<l;i++){if((elem=content[i]).nodeType!==1){continue;}
elems=elem.getElementsByTagName("*");for(m=elems.length-1;m>=0;m--){processItemKey(elems[m]);}
processItemKey(elem);}
function processItemKey(el){var pntKey,pntNode=el,pntItem,tmplItem,key;if((key=el.getAttribute(tmplItmAtt))){while(pntNode.parentNode&&(pntNode=pntNode.parentNode).nodeType===1&&!(pntKey=pntNode.getAttribute(tmplItmAtt))){}
if(pntKey!==key){pntNode=pntNode.parentNode?(pntNode.nodeType===11?0:(pntNode.getAttribute(tmplItmAtt)||0)):0;if(!(tmplItem=newTmplItems[key])){tmplItem=wrappedItems[key];tmplItem=newTmplItem(tmplItem,newTmplItems[pntNode]||wrappedItems[pntNode],null,true);tmplItem.key=++itemKey;newTmplItems[itemKey]=tmplItem;}
if(cloneIndex){cloneTmplItem(key);}}
el.removeAttribute(tmplItmAtt);}else if(cloneIndex&&(tmplItem=jQuery.data(el,"tmplItem"))){cloneTmplItem(tmplItem.key);newTmplItems[tmplItem.key]=tmplItem;pntNode=jQuery.data(el.parentNode,"tmplItem");pntNode=pntNode?pntNode.key:0;}
if(tmplItem){pntItem=tmplItem;while(pntItem&&pntItem.key!=pntNode){pntItem.nodes.push(el);pntItem=pntItem.parent;}
delete tmplItem._ctnt;delete tmplItem._wrap;jQuery.data(el,"tmplItem",tmplItem);}
function cloneTmplItem(key){key=key+keySuffix;tmplItem=newClonedItems[key]=(newClonedItems[key]||newTmplItem(tmplItem,newTmplItems[tmplItem.parent.key+keySuffix]||tmplItem.parent,null,true));}}}
function tiCalls(content,tmpl,data,options){if(!content){return stack.pop();}
stack.push({_:content,tmpl:tmpl,item:this,data:data,options:options});}
function tiNest(tmpl,data,options){return jQuery.tmpl(jQuery.template(tmpl),data,options,this);}
function tiWrap(call,wrapped){var options=call.options||{};options.wrapped=wrapped;return jQuery.tmpl(jQuery.template(call.tmpl),call.data,options,call.item);}
function tiHtml(filter,textOnly){var wrapped=this._wrap;return jQuery.map(jQuery(jQuery.isArray(wrapped)?wrapped.join(""):wrapped).filter(filter||"*"),function(e){return textOnly?e.innerText||e.textContent:e.outerHTML||outerHtml(e);});}
function tiUpdate(){var coll=this.nodes;jQuery.tmpl(null,null,null,this).insertBefore(coll[0]);jQuery(coll).remove();}})(jQuery);/**
 * A simple querystring parser.
 * Example usage: var q = $.parseQuery(); q.fooreturns  "bar" if query contains "?foo=bar"; multiple values are added to an array. 
 * Values are unescaped by default and plus signs replaced with spaces, or an alternate processing function can be passed in the params object .
 * http://actingthemaggot.com/jquery
 *
 * Copyright (c) 2008 Michael Manning (http://actingthemaggot.com)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 **/jQuery.parseQuery=function(qs,options){var q=(typeof qs==='string'?qs:window.location.search),o={'f':function(v){return unescape(v).replace(/\+/g,' ');}},options=(typeof qs==='object'&&typeof options==='undefined')?qs:options,o=jQuery.extend({},o,options),params={};jQuery.each(q.match(/^\??(.*)$/)[1].split('&'),function(i,p){p=p.split('=');p[1]=o.f(p[1]);params[p[0]]=params[p[0]]?((params[p[0]]instanceof Array)?(params[p[0]].push(p[1]),params[p[0]]):[params[p[0]],p[1]]):p[1];});return params;}
Eventful.ThirdParty=function(adData){this.oParams=$.parseQuery();this.adData=(adData)?adData:[];this.global_delay=(this.oParams.global_delay)?this.oParams.global_delay:500;this.fb_delay=(this.oParams.fb_delay)?this.oParams.fb_delay:this.global_delay;this.rondavu_delay=(this.oParams.rondavu_delay)?this.oParams.rondavu_delay:this.global_delay;this.g1_delay=(this.oParams.g1_delay)?this.oParams.g1_delay:this.global_delay;this.ad_delay=(this.oParams.ad_delay)?this.oParams.ad_delay:this.global_delay;this.global_disable=(this.oParams.global_disable)?1:0;this.fb_disable=(this.oParams.disable_facebook_js_lib==='1')?1:this.global_disable;this.rondavu_disable=(this.oParams.rondavu_disable)?1:this.global_disable;this.g1_disable=(this.oParams.g1_disable)?1:this.global_disable;this.ad_disable=(this.oParams.ad_disable)?1:this.global_disable;$(this.setup.bind(this));};Eventful.ThirdParty.adData=[];Eventful.ThirdParty.eventDOMReady=new Eventful.UIEvent();Eventful.ThirdParty.prototype.renderAd=function(oItem){this.tmplAd=$('#template-ad').template();$(oItem.jqSelector).replaceWith($.tmpl(this.tmplAd,oItem));};Eventful.ThirdParty.prototype.renderFBAll=function(){if(this.jqBody.hasClass('disable-fb'))return;if(Eventful.FBConnect){window.fbAsyncInit=function(){Eventful.FBConnect.fbReady.fire();};}
(function(d,t){var e=d.createElement(t),f;e.type='text/javascript';e.async=true;e.src=d.location.protocol+'//connect.facebook.net/en_US/all.js';d.getElementById('fb-root').appendChild(e);f=function(){if(FB&&!Eventful.oFBConnect){Eventful.FBConnect.fbReady.fire();}};setTimeout(f,3000);setTimeout(f,7000);})(document,'script');};Eventful.ThirdParty.prototype.renderG1=function(){if(this.jqBody.hasClass('disable-g1'))return;(function(d,t){var e=d.createElement(t),s=d.getElementsByTagName(t)[0];e.type='text/javascript';e.async=true;e.src="https://apis.google.com/js/plusone.js";s.parentNode.insertBefore(e,s);})(document,'script');};Eventful.ThirdParty.prototype.renderRondavu=function(){if(this.jqBody.hasClass('disable-rondavu'))return;var scriptPath=arguments[0];(function(){var s=document.createElement('script');s.async=true;s.src=scriptPath;document.getElementsByTagName('head')[0].appendChild(s);})();};Eventful.ThirdParty.prototype.delayCall=function(fn,args,delay){var delay=(delay)?delay:0;setTimeout(function(){fn.apply(this,[args]);}.bind(this),delay);};Eventful.ThirdParty.prototype.loadAds=function(){if(this.jqBody.hasClass('disable-ads'))return;for(var i=0;i<this.nAds;i++){var item=this.adData[i];this.renderAd(item);}};Eventful.ThirdParty.prototype.setup=function(){this.jqBody=$('body');if(this.global_disable)return;this.nAds=this.adData.length;if(this.nAds&&!this.ad_disable){this.delayCall.apply(this,[this.loadAds,null,this.ad_delay]);}
if(!this.fb_disable){this.delayCall.apply(this,[this.renderFBAll,null,this.fb_delay]);}
if(!this.g1_disable){this.delayCall.apply(this,[this.renderG1,null,this.g1_delay]);}
if(window.RondavuScriptPath&&window.RondavuData&&!this.rondavu_disable){this.delayCall.apply(this,[this.renderRondavu,window.RondavuScriptPath,this.rondavu_delay]);}};Eventful.ThirdParty.eventDOMReady.subscribe(function(){new Eventful.ThirdParty(Eventful.ThirdParty.adData);});$(function(){Eventful.ThirdParty.eventDOMReady.fire();});Eventful.Cookies={};Eventful.Cookies.addCookie=function(sKey,sValue,nExpires)
{var sCurrentValue=Eventful.Cookies.getCookie(sKey);sValue=(sCurrentValue?sCurrentValue+'^':'')+sValue;Eventful.Cookies.setCookie(sKey,sValue,nExpires);}
Eventful.Cookies.setCookie=function(sKey,sValue,nExpires,sPath)
{if(!sPath)sPath='/';var sCookie=sKey+'='+sValue+';path='+sPath+';';if(nExpires)
{var oDate=new Date(new Date().getTime()+nExpires*60000);sCookie+='expires='+oDate.toUTCString()+';';}
document.cookie=sCookie;}
Eventful.Cookies.getCookie=function(sKey)
{var rx=new RegExp(sKey+'=([^;]*)');return(document.cookie.match(rx)||[])[1];}
Eventful.Cookies.removeCookie=function(sKey,sPath)
{Eventful.Cookies.setCookie(sKey,'',-1,sPath);}
Eventful.FBConnect=function(){this.sRequiredPermissions='publish_stream,email,user_birthday,user_about_me,user_interests,offline_access,user_location,user_likes';this.oFBLoggedIn=new Eventful.UIEvent();this.oFBLoggedOut=new Eventful.UIEvent();this.oFBAuthResponseChange=new Eventful.UIEvent();this.oFBStatusChange=new Eventful.UIEvent();this.oFBItemLiked=new Eventful.UIEvent();this.oFBItemUnliked=new Eventful.UIEvent();this.oFBCommentAdded=new Eventful.UIEvent();this.oFBLogged=new Eventful.UIEvent();$(this.setup.bind(this));};Eventful.FBConnect.getInstance=function(){return Eventful.oFBConnect=Eventful.oFBConnect||new Eventful.FBConnect();};Eventful.FBConnect.fbReady=new Eventful.UIEvent();Eventful.FBConnect.fbReady.subscribe(Eventful.FBConnect.getInstance);Eventful.FBConnect.prototype.setup=function(){if(window.Eventful.FacebookAppId===undefined)return;if(window.FB===undefined)return;FB.init({appId:Eventful.FacebookAppId,oauth:true,status:true,cookie:false,xfbml:true,channelUrl:window.location.protocol+'//'+window.location.host+'/fb_xd_channel.html'});FB.getLoginStatus(function(res){if(!res||res.status!=="connected"){FB.Event.subscribe('auth.login',this.listenLoginState.bind(this,null));}}.bind(this));FB.Event.subscribe('auth.logout',function(){this.oFBLoggedOut.fire()}.bind(this));FB.Event.subscribe('auth.authResponseChange',function(){this.oFBAuthResponseChange.fire()}.bind(this));FB.Event.subscribe('auth.statusChange',function(){this.oFBStatusChange.fire()}.bind(this));FB.Event.subscribe('edge.create',function(){Eventful.TrackPageview.trackSocial("Facebook","fbLike");this.oFBItemLiked.fire()}.bind(this));FB.Event.subscribe('edge.remove',function(){Eventful.TrackPageview.trackSocial("Facebook","fbUnlike");this.oFBItemUnliked.fire()}.bind(this));FB.Event.subscribe('message.send',function(){Eventful.TrackPageview.trackSocial("Facebook","fbSend");this.oFBItemUnliked.fire()}.bind(this));FB.Event.subscribe('comments.add',function(){Eventful.TrackPageview.trackSocial("Facebook","fbComment");this.oFBCommentAdded.fire()}.bind(this));FB.Event.subscribe('fb.log',function(){this.oFBLogged.fire()}.bind(this));};Eventful.FBConnect.prototype.authorize=function(url){var sParams=Eventful.Cookies.getCookie("override_fb_params");url=url||null;if(sParams){var oAuthResponse=jQuery.parseQuery(decodeURIComponent(sParams));return this.listenLoginState(null,{authResponse:oAuthResponse});}
FB.login(this.listenLoginState.bind(this,url),{scope:this.sRequiredPermissions});};Eventful.FBConnect.prototype.listenLoginState=function(url,response){if(response.authResponse){this.oAuthResponse=response.authResponse;this.oFBLoggedIn.fire(this.oAuthResponse);if(url){window.location.href=url;}}else{this.oFBLoggedOut.fire();}};Eventful.Signin=function(){this.eventEvUserLoggedIn=new Eventful.UIEvent();$(this.setup.bind(this));};Eventful.Signin.prototype.setup=function(){this.jqFBLogin=$('.fb-login-click');this.jqPopover=new Eventful.Popover("#user-panel-popover",{css:{width:'',border:'',zIndex:1010,backgroundColor:''},position:{relative:$('#user-panel-signin'),top:20,left:'auto',right:-81},tracking:'lbox_signin'})
.clickShow('#user-panel-signin, #user-panel-signin-block',true);this.jqFBLogin.click(this.listenConnectButtonClicked.bind(this));Eventful.FBConnect.fbReady.subscribe(function(){this.FBConnect().oFBLoggedIn.subscribe(this.listenLoggedIn.bind(this));}.bind(this));};Eventful.Signin.prototype.FBConnect=function(e){return Eventful.FBConnect.getInstance();}
Eventful.Signin.prototype.listenConnectButtonClicked=function(e){this.jqClickedFacebookButton=$(e.target);this.FBConnect().authorize();e.preventDefault();};Eventful.Signin.prototype.listenLoggedIn=function(oSession){if(!oSession){return;}
this.oFBSession=oSession;this.logInEvUser();};Eventful.Signin.prototype.logInEvUser=function(oExtraParams){if(!this.oFBSession){return;}
if(this.bLoggingIn)return;this.bLoggingIn=true;var params={};$.extend(params,this.oFBSession,oExtraParams);$.post("/json/apps/facebook/login",params,function(oResponse){delete this.bLoggingIn;if(oResponse.status==="ok"){this.listenEvUserLoggedIn(oResponse);}else{this.listenEvUserLoggedOut(oResponse);}}.bind(this),"json");};Eventful.Signin.prototype.listenEvUserLoggedIn=function(oResponse){if(!this.jqClickedFacebookButton)return;this.loading('hide');var sAction=this.jqClickedFacebookButton.attr('data-goto');if(sAction=='no_reload'){this.eventEvUserLoggedIn.fire(oResponse);return;}else if(sAction){window.location.href=sAction;}else{window.location.reload();}};Eventful.Signin.prototype.listenEvUserLoggedOut=function(oResponse){if(!oResponse)return;this.loading('hide');if(!this.jqClickedFacebookButton)return;if(oResponse.status==="error"){if(oResponse.message=="emails do not match"){this.panel().show();}else if(oResponse.message=="password invalid"){this.listenBadPassword();}else{if(!this.oFacebookLoginFailed){$('\
        <div id="facebook-login-failed" class="hidden">\
          <div class="hd">Facebook Login Failed</div>\
          <div class="bd">Sorry, Facebook encountered an error while trying to log you in.</div>\
        </div>\
        ').appendTo('body');this.oFacebookLoginFailed=new Eventful.Panel('facebook-login-failed').options({width:300});}
this.oFacebookLoginFailed.show();}}};Eventful.Signin.prototype.panel=function(){if(this._jqPanel){return this._jqPanel;}else{var _sHtml='<div id="facebook-signin-panel" class="hidden">';_sHtml+='<div class="hd">';_sHtml+='<h1>Connect your account with facebook</h1>';_sHtml+='</div>';_sHtml+='<div class="bd">';_sHtml+='<div class="reason">';_sHtml+='<p>You already have an Eventful account with a different email address than connected to your Facebook account.</p><p>Would you like to create a new user tied to your Facebook information or merge the existing Eventful account with your Facebook information?</p>';_sHtml+='<div class="buttons">';_sHtml+='<span class="update option">Merge Accounts</span>';_sHtml+='<span class="or">or</span>';_sHtml+='<span class="create option">Create New Account</span>';_sHtml+='</div>';_sHtml+='</div>';_sHtml+='<div class="authenticate hidden">';_sHtml+='<p>To protect the privacy and security of your Eventful account, please enter the password associated with your Eventful account and click "Continue".</p><p>Or click the "Create New Account" button to create a new account based on your Facebook information.</p>';_sHtml+='<div class="password"><span class="label">Enter Password</span><input type="password" name="password" id="inp-facebook-signin-panel" class="text-input"><a href="/forgot">Forgot your password</a></div>';_sHtml+='<div class="buttons">';_sHtml+='<span class="continue option">Continue</span>';_sHtml+='<span class="or">or</span>';_sHtml+='<span class="create option">Create New Account</span>';_sHtml+='</div>';_sHtml+='<p class="bad-pass hidden">';_sHtml+='That password is incorrect';_sHtml+='</p>';_sHtml+='</div>';_sHtml+='</div>';_sHtml+='</div>';$(_sHtml).appendTo('body');this._jqPanel=new Eventful.Panel('facebook-signin-panel').
options({width:536,onShow:null});$('#facebook-signin-panel span.update').click(this.listenUpdateUserClicked.bind(this));$('#facebook-signin-panel span.create').click(this.listenCreateUserClicked.bind(this));$('#facebook-signin-panel span.continue').click(this.listenContinueClicked.bind(this));this._jqPanel.eventShow.subscribe(this.listenPanelDisplay.bind(this,'on'));this._jqPanel.eventClose.subscribe(this.listenPanelDisplay.bind(this,'off'));return this._jqPanel;}}
Eventful.Signin.prototype.listenUpdateUserClicked=function(){Eventful.Forms.focusFirstField(this.panel().find('.reason').addClass('hidden').end().find('.authenticate').removeClass('hidden').end());};Eventful.Signin.prototype.listenCreateUserClicked=function(){if(this.loadingStatus==1)return;this.logInEvUser({skip_email_check:1});this.loading('show');};Eventful.Signin.prototype.listenContinueClicked=function(){if(this.loadingStatus==1)return;this.panel().find('.bad-pass').slideUp();this.logInEvUser({password:$('#inp-facebook-signin-panel').val()});this.loading('show');};Eventful.Signin.prototype.listenPanelDisplay=function(sAction){if(sAction=='on'){$('#modalContainer a.modalCloseImg').addClass('fbMoved');}else{$('#modalContainer a.modalCloseImg').removeClass('fbMoved');}};Eventful.Signin.prototype.listenBadPassword=function(){this.loading('hide');this.panel().find('.bad-pass').slideDown();};Eventful.Signin.prototype.loading=function(sState){if(sState=='show'){if(this._jqPanel)this.panel().addClass='loading';this.loadingStatus=1;}else{if(this._jqPanel)this.panel().removeClass='loading';this.loadingStatus=0;}}
Eventful.oSignin=new Eventful.Signin();Eventful.LB=function(){$(this.setup.bind(this));};Eventful.LB.prototype.setup=function(){this.oQueryString=$.parseQuery();this.lightbox;if(!this.oQueryString.lbURL){return;}
this.constructContents(this.oQueryString.lbURL);}
Eventful.LB.prototype.listenLoad=function(){var height=$('#lightboxer').innerHeight();var width=$('#lightboxer').innerWidth();this.lightbox.resize();}
Eventful.LB.prototype.constructContents=function(url){var sHTML='<img id="lightboxer" src="'+url+'" />';$(sHTML).appendTo('body');this.lightbox=new Eventful.Panel('lightboxer').options({width:300});this.lightbox.show();$('#lightboxer').load(this.listenLoad.bind(this));}
Eventful.lbViewer=new Eventful.LB();String.prototype.truncate=function(n,suffix)
{if(!this.length||!n)return this;suffix=suffix||'...';if(this.length>n)
{return this.substring(0,n)+suffix;}
else{return this.substring(0);}}
String.prototype.append=function(sAdd,sSep)
{return this+((this.length)?sSep:'')+sAdd;}
String.prototype.trim=function()
{return this.replace(/(^\s+|\s+$)/g,'');}
String.prototype.lpad=function(n,sPad)
{if(n&&this.length<n)
{return(sPad+this).lpad(n,sPad);}else
{return this;}}
String.prototype.commify=function()
{return this.replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,");}
String.prototype.uppercaseFirst=function()
{return this.replace(/\b(\w)/g,function(_,m)
{return m.toUpperCase();});}
String.prototype.surplant=function(O)
{return this.replace(/\{(\w+)\}/g,function(a,b){var r=O[b];return typeof r==="string"?r:a;});}
Eventful.CircularQ=function()
{this.iter=null;if(arguments.length==1)
{this.queue=arguments[0];}
else
{this.queue=[];}}
Eventful.CircularQ.prototype={next:function()
{if(this.queue.length>0)
{var next;if(this.iter===null)next=0;else next=this.iter+1;if(next>=this.queue.length)
{next=0;}
this.iter=next;return this.queue[next];}
else
{return null;}},prev:function()
{if(this.queue.length>0)
{var prev;if(this.iter===null)prev=this.queue.length-1;else prev=this.iter-1;if(prev<0)
{prev=this.queue.length-1;}
this.iter=prev;return this.queue[prev];}
else
{return null;}},goto:function(goTo)
{if((this.queue.length>0)&&(goTo<=this.queue.length))
{var idToGoTo=goTo-1;this.iter=idToGoTo;return this.queue[idToGoTo];}
else
{return null;}},current:function()
{if(this.queue.length>0)
{var current=this.iter;return this.queue[current];}
else
{return null;}},add:function(item)
{this.queue.push(item);},extend:function(items)
{this.queue=this.queue.concat(items);},rem:function(idx)
{this.queue.splice(idx,1);}}
Eventful.InactiveText=function(el)
{el=$(el);el.blur();el.blur(Eventful.InactiveText.listenBlur);el.focus(Eventful.InactiveText.listenFocus);if(!el.prop('defaultValue'))
{el.val(el.attr('alt'));el.addClass('inactive');}else
{el.val(el.prop('defaultValue'));}
el.removeClass('inactive-text');}
Eventful.InactiveText.attachHandlers=function(root)
{$('.inactive-text',root).each(function(_,el){Eventful.InactiveText(el);});}
Eventful.InactiveText.listenBlur=function(evt)
{var el=$(evt.target);if(!el.val()&&!el.parents('.field-container.has-error').size())
{el.addClass('inactive');el.val(el.attr('alt'));}}
Eventful.InactiveText.listenFocus=function(evt)
{var el=$(evt.target);if(el.hasClass('inactive'))
{el.removeClass('inactive');el.val('');}}
Eventful.InactiveText.doForcedUpdate=function(el)
{el=$(el);el.addClass('inactive');el.val(el.attr('alt'));}
Eventful.DropDown=function(oArgs)
{this.elInput=oArgs.input;this.elPopover=oArgs.popover;this.nMinInputLength=oArgs.minInputLength||0;this.listItemClass=oArgs.listItemClass||0;this.bSuggestionMode=oArgs.suggestionMode||0;this.bExact=oArgs.exact;this.eventItemSelected=new Eventful.UIEvent();this.eventInputChanged=new Eventful.UIEvent();this.eventPopoverShown=new Eventful.UIEvent();this.eventItemHighlighted=new Eventful.UIEvent();this.eventEscRequested=new Eventful.UIEvent();this.eventBlur=new Eventful.UIEvent();this.eventBadFocus=new Eventful.UIEvent();this.eventEnterAfterSelected=new Eventful.UIEvent();$(this.setup.bind(this));}
Eventful.DropDown.prototype.popover=function()
{return this.jqPopover?this.jqPopover:this.jqPopover=$(this.elPopover);}
Eventful.DropDown.prototype.find=function(sExpr)
{return this.popover().find(sExpr);}
Eventful.DropDown.prototype.input=function()
{return this.jqInput?this.jqInput:this.jqInput=$(this.elInput);}
Eventful.DropDown.prototype.list=function()
{return this.jqList?this.jqList:this.jqList=this.find('ul:first');}
Eventful.DropDown.prototype.setup=function()
{if(this.input().hasClass('inactive-text'))
{Eventful.InactiveText(this.input());}
this.input().
focus(this.listenFocus.bind(this)).
click(this.listenClick.bind(this)).
blur(this.listenBlur.bind(this)).
keyup(this.listenKeyUp.bind(this));if(jQuery.browser.safari||jQuery.browser.msie)
{this.input().keydown(this.listenKeyDown.bind(this));}else
{this.input().keypress(this.listenKeyDown.bind(this));}
this.popover().
mousedown(this.listenMouseDown.bind(this)).
mouseup(this.listenMouseUp.bind(this));this.sListItem=this.listItemClass?'li.'+this.listItemClass:'li';if(this.list().html())
{this.list().find(this.sListItem).
mouseover(this.listenMouseOver.bind(this)).
click(this.listenClickItem.bind(this))}else
{this.list().
mouseover(this.listenMouseOver.bind(this)).
click(this.listenClickItem.bind(this));}}
Eventful.DropDown.prototype.reset=function()
{if(!this.bSuggestionMode){this.input().val('');}
this.popover().hide();this.list().empty();this.queue(null);if(!this.bHasFocus)
{Eventful.InactiveText.doForcedUpdate(this.input())}}
Eventful.DropDown.prototype.currentElement=function()
{if(this.oQueue&&this.oQueue.iter>=0)
{return this.list().find(this.sListItem).eq(this.oQueue.iter);}}
Eventful.DropDown.prototype.indexFromElement=function(el)
{el=$(el);el=el.is('li')?el:el.parents('li');if(el[0]){return this.list().find(this.sListItem).index(el[0]);}}
Eventful.DropDown.prototype.queue=function(oQueue)
{if(oQueue!==undefined)
{if(oQueue&&!this.bSuggestionMode)oQueue.next();this.oQueue=oQueue;}
return this.oQueue;}
Eventful.DropDown.prototype.usingQueue=function(bUsingQueue)
{if(bUsingQueue!==undefined)this.bUsingQueue=bUsingQueue;return this.bUsingQueue;}
Eventful.DropDown.prototype.showPopover=function()
{var sVal=this.input().hasClass('inactive')?'':this.input().val();if((this.list().html()||this.popover().hasClass('empty'))&&sVal.length>=this.nMinInputLength)
{this.popover().show();this.find('iframe.popover-layer').css({width:this.popover().width(),height:this.popover().height()+500});this.eventPopoverShown.fire();setTimeout(function(){this.input().select()}.bind(this),0);}}
Eventful.DropDown.prototype.highlight=function(arg)
{if(this.oQueue[arg]||arg!=this.oQueue.iter)
{if(this.oQueue[arg])
{this.oQueue[arg]();}else
{this.oQueue.goto(arg%this.oQueue.queue.length+1);}}
this.list().find('li.highlight').removeClass('highlight');var jqCurrentElement=this.currentElement();if(jqCurrentElement){jqCurrentElement.addClass('highlight');}}
Eventful.DropDown.prototype.clearInput=function()
{if(!this.input().hasClass('inactive'))
{this.input().val('');if(this.input().attr('alt'))
{Eventful.InactiveText.listenBlur({target:this.input()});}}}
Eventful.DropDown.prototype.listenClick=function()
{if(this.popover().css('display')!='block')
{this.showPopover();}}
Eventful.DropDown.prototype.listenFocus=function()
{if(!this.input().is(':visible'))
{this.eventBadFocus.fire();return;}
if(this.bHasFocus)return;this.bHasFocus=true;this.showPopover();}
Eventful.DropDown.prototype.listenBlur=function()
{if(this.bIgnoreBlur)
{this.bIgnoreBlur=false;return;}
this.eventBlur.fire();this.popover().hide();this.bHasFocus=false;}
Eventful.DropDown.prototype.listenKeyDown=function(evt)
{switch(evt.keyCode)
{case 27:evt.preventDefault();this.eventEscRequested.fire(this.oQueue.current());break;case 38:if(this.oQueue)
{evt.preventDefault();this.usingQueue(true);this.highlight('prev');this.eventItemHighlighted.fire(this.oQueue.current());}
break;case 40:if(this.oQueue)
{evt.preventDefault();this.usingQueue(true);this.highlight('next');this.eventItemHighlighted.fire(this.oQueue.current());}
break;case 13:if(this.oQueue)
{evt.preventDefault();if(this.popover().is(':visible'))
{if(this.usingQueue()||this.bExact)
{this.eventItemSelected.fire(this.oQueue.current());}else
{this.eventItemSelected.fire(this.input().val())}
this.popover().hide();}
else
{this.eventEnterAfterSelected.fire();}}
break;}
this.sOldInput=this.input().val();}
Eventful.DropDown.prototype.listenKeyUp=function(evt)
{var sInput=this.input().val();if(this.sOldInput!=sInput)
{this.usingQueue(false);this.eventInputChanged.fire(sInput);}}
Eventful.DropDown.prototype.listenMouseOver=function(evt)
{this.highlight(this.indexFromElement(evt.target));}
Eventful.DropDown.prototype.listenClickItem=function(evt)
{var i=this.indexFromElement(evt.target);this.oQueue.goto(i+1);this.eventItemSelected.fire(this.oQueue.current());this.popover().hide();}
Eventful.DropDown.prototype.listenMouseDown=function()
{this.bIgnoreBlur=true;}
Eventful.DropDown.prototype.listenMouseUp=function()
{this.input().focus();}
Eventful.TypeAhead=function(oArgs)
{if(typeof oArgs==="undefined")return;this.id=oArgs.id;this.bSingular=!oArgs.multiple;this.sExcludeQuery=null;this.oItemsToExclude={};this.bOptions=oArgs.options;this.bRequired=oArgs.required;this.sListItemClass=oArgs.itemClass||'click-result';this.bSuggestionMode=oArgs.suggestionMode||0;this.bHideDescription=oArgs.hide_description;this.nMinInputLength=(typeof oArgs.minInputLength==="number")?oArgs.minInputLength:2;this.bDefaultOnBlur=this.bRequired||oArgs.default_on_blur;this.bForceBoldSearchTerms=oArgs.forceBoldSearchTerms;this.eventItemSelected=new Eventful.UIEvent();this.eventNoItemSelected=new Eventful.UIEvent();this.eventOptionSelected=new Eventful.UIEvent();this.eventItemRemoved=new Eventful.UIEvent();this.eventEnterConfirm=new Eventful.UIEvent();this.eventInputChanged=new Eventful.UIEvent();this.oDropDown=new Eventful.DropDown({exact:1,input:'#inp-'+this.id,popover:'#popover-'+this.id,listItemClass:this.sListItemClass,suggestionMode:this.bSuggestionMode,minInputLength:this.nMinInputLength});this.oDropDown.eventItemSelected.subscribe(this.listenItemSelected.bind(this));this.oDropDown.eventItemHighlighted.subscribe(this.listenItemHighlighted.bind(this));this.oDropDown.eventInputChanged.subscribe(this.listenInputChanged.bind(this));this.oDropDown.eventEnterAfterSelected.subscribe(this.listenEnterAfterSelected.bind(this));this.oDropDown.eventEscRequested.subscribe(this.listenEscRequested.bind(this));if(this.bDefaultOnBlur)
{this.oDropDown.eventBlur.subscribe(this.listenBlur.bind(this));}
$(this.setup.bind(this));}
Eventful.TypeAhead.prototype.typeahead=function()
{return this.jqTypeahead?this.jqTypeahead:this.jqTypeahead=$('#type-ahead-'+this.id);}
Eventful.TypeAhead.prototype.selected=function()
{return this.jqSelected?this.jqSelected:this.jqSelected=$('ul',this.typeahead());}
Eventful.TypeAhead.prototype.description=function()
{return this.jqDescription?this.jqDescription:this.jqDescription=$('#description-'+this.id);}
Eventful.TypeAhead.prototype.setup=function()
{Eventful.InactiveText(this.oDropDown.input());if(this.bSingular)
{this.oDropDown.input().css({width:'98%'});this.selected().hide();}
if(this.bOptions)
{this.renderResults();}
if(this.bSuggestionMode)
{this.oDropDown.input().focus(function(){this.oDropDown.popover().show();this.oDropDown.eventPopoverShown.fire();}.bind(this));}
this.updateInputLength();}
Eventful.TypeAhead.prototype.updateInputLength=function()
{if(this.bSingular)return;var nWidth=this.typeahead().width()-this.selected().width()-10;this.oDropDown.input().css({width:nWidth+'px'});this.oDropDown.popover().css({left:this.selected().width()+'px'});}
Eventful.TypeAhead.prototype.removeExcluded=function(aResults){return aResults;}
Eventful.TypeAhead.prototype.setValue=function(sValue)
{if(sValue)
{this.oDropDown.input().val(sValue).removeClass('inactive');}else
{this.reset();}}
Eventful.TypeAhead.prototype.reset=function()
{this.item(null);}
Eventful.TypeAhead.prototype.promoteType=function(aResults,listingType){return aResults.sort(function(a,b){if(a.type===listingType&&b.type!==listingType)return-1;if(a.type!==listingType&&b.type===listingType)return 1;return 0;});}
Eventful.TypeAhead.prototype.addSponsoredViewMore=function(oItem){if(oItem.show_uri){oItem.permalink=oItem.base_url+'/show/'+oItem.show_uri;var jqDetailLink=$('<a />').text('View Full Schedule').attr('href',oItem.permalink);$('<li />').addClass('typeahead-full-schedule').
attr({id:oItem.seeMoreID}).
html(jqDetailLink).
insertAfter('#'+oItem.domID);$('<span />').text('sponsored').appendTo('#'+oItem.domID);$('#'+oItem.seeMoreID).click(function(){window.location.href=oItem.permalink;return false;});}}
Eventful.TypeAhead.prototype.renderResults=function(sQuery,aResults,oAdditionalArgs)
{this.typeahead().removeClass('loading');if(this.bOptions)
{var aOptions=this.options();if(aOptions&&aOptions.length)
{aResults=(aResults||[]).concat(aOptions);}}
if(!aResults)return;this.promoteType.apply(this,[aResults,"sponsored"]);aResults=this.removeExcluded(aResults);if((sQuery&&!this.bSuggestionMode)||(sQuery&&this.bForceBoldSearchTerms))
{var aSplit=$.grep(sQuery.split(/[\s,']+/),function(s){return s;});var rxBold=new RegExp('('+aSplit.join('|')+')','ig');}
if(aResults.length)
{this.oDropDown.popover().removeClass('empty');this.oDropDown.queue(new Eventful.CircularQ(aResults));this.oDropDown.list().empty();if(this.bShowSuggestionHeaders){var elIntroText=$('<li>').
addClass('suggestion-header').
html('<em>Or, are you looking for&#0133;</em>').
appendTo(this.oDropDown.list());}
$.each(aResults,function(i,oItem)
{if(this.bShowCategoryHeaders&&oItem.type&&(!this.sSection||this.sSection!=oItem.type)){var elCatHeader=$('<li>').
addClass('result-cat').
addClass('header-type-'+oItem.type).
html(this.itemCategoryHeader(oItem)).
appendTo(this.oDropDown.list());}
var sTitle=this.itemTitle(oItem);if(rxBold&&!oItem.option)
{sTitle=sTitle.replace(rxBold,'<b>$1</b>');}
var sDescription=this.itemDescription(oItem);var sItemID=this.itemId(oItem)||Math.floor(Math.random()*10000000);oItem.domID='type-ahead-'+this.id+'-'+sItemID;oItem.seeMoreID=oItem.domID+'-full-schedule';var elItem=$('<li>').
addClass(this.sListItemClass).
attr('id',oItem.domID).
html(sTitle+(sDescription?'<p class="diminished">'+sDescription+'</p>':'')).
appendTo(this.oDropDown.list());elItem.addClass('result-type-'+oItem.type);if(!this.bSuggestionMode&&!i)elItem.addClass(i?'':'highlight');if(oItem.type==="sponsored"){this.addSponsoredViewMore.call(this,oItem);}
if(oItem.option)elItem.addClass('option');if(oItem.customClass)elItem.addClass(oItem.customClass);if(i==0)elItem.addClass('first');}.bind(this));}else
{this.oDropDown.popover().addClass('empty');this.oDropDown.queue(null);this.oDropDown.list().empty();}
this.sSection=null;if(this.oDropDown.bHasFocus)
{this.oDropDown.popover().show();}}
Eventful.TypeAhead.prototype.item=function(oItem)
{if(oItem===null)
{this.description().hide();this.oDropDown.reset();this.renderResults();}else if(oItem)
{var sTitle=this.itemTitle(oItem);var sDescription=this.itemDescription(oItem);if(this.bSingular)
{if(!this.bSuggestionMode){this.setValue(sTitle);}
if(sDescription&&!this.bHideDescription)
{this.description().html(sDescription).show().removeClass('hidden');}else
{this.description().hide();}}else
{this.oDropDown.input().css({width:0}).val('');this.oDropDown.list().empty();var elItem=$('<li>'+sTitle+' <span class="faded delete_box click-remove">X</span></li>').
appendTo(this.selected());elItem.find('.click-remove').click(this.listenClickRemove.bind(this,elItem,oItem));this.updateInputLength();}}
if(typeof oItem!=='undefined')this.oItem=oItem;return this.oItem;}
Eventful.TypeAhead.prototype.listenBlur=function()
{if(!this.oDropDown.input().is(':visible'))return;var oItem=this.item();var oQueue=this.oDropDown.oQueue;if(oQueue&&oQueue.queue[0]&&!oQueue.queue[0].option&&(oQueue.iter==0||!oItem))
{this.item(oQueue.queue[0]);this.eventItemSelected.fire(oQueue.queue[0]);}else if(oItem)
{this.item(oItem);}}
Eventful.TypeAhead.prototype.listenItemSelected=function(oItem)
{if(!oItem)
{this.eventNoItemSelected.fire();return;}
if(oItem.option)
{this.eventOptionSelected.fire(oItem);}else{this.item(oItem);this.eventItemSelected.fire(oItem);Eventful.InactiveText.listenFocus({target:this.oDropDown.input()});this.oDropDown.input().select();}}
Eventful.TypeAhead.prototype.listenEnterAfterSelected=function()
{if(this.item())
{this.eventEnterConfirm.fire(this.item());}}
Eventful.TypeAhead.prototype.listenItemHighlighted=function(oItem)
{if(!oItem.option)
{this.item(oItem);}}
Eventful.TypeAhead.prototype.listenInputChanged=function(sInput)
{this.description().hide();if(!this.oDropDown.input().hasClass('inactive')&&sInput.length>=this.nMinInputLength)
{this.typeahead().addClass('loading');this.search(sInput);}else{if(sInput.length===0&&!this.bRequired)
{this.reset();}
if(!this.bSuggestionMode)
{this.oDropDown.popover().hide();}}
this.eventInputChanged.fire();}
Eventful.TypeAhead.prototype.listenClickRemove=function(elItem,oItem,evt)
{$(elItem).remove();this.updateInputLength();this.eventItemRemoved.fire(oItem);}
Eventful.TypeAhead.prototype.listenServerResponse=function(sQuery,oResponse)
{var aResults=(oResponse||{}).results||[];this.renderResults(sQuery,aResults);}
Eventful.TypeAhead.prototype.listenEscRequested=function()
{if(this.bSuggestionMode){this.reset();}}
Eventful.LocationTypeAhead=function(oArgs)
{this.nTruncate=oArgs.truncate||oArgs.length||64;this.sExclude=oArgs.exclude||'';this.bBubbleUp=oArgs.bubble_up||'';this.sRegionId=oArgs.region_id||'';this.sLocationType=oArgs.location_type||'';Eventful.TypeAhead.call(this,oArgs);this.eventLocationPosted=new Eventful.UIEvent();if(oArgs.post)
{this.eventItemSelected.subscribe(this.listenLocationSelected.bind(this));}}.mixin(Eventful.TypeAhead);Eventful.LocationTypeAhead.prototype.itemTitle=function(oLocation)
{var aSplit=this.splitLines(oLocation);if(aSplit)
{return aSplit[1].trim().truncate(this.nTruncate);}
return oLocation.pretty_name.truncate(this.nTruncate);}
Eventful.LocationTypeAhead.prototype.itemDescription=function(oLocation)
{var aSplit=this.splitLines(oLocation);if(aSplit)
{return aSplit[2].trim().truncate(this.nTruncate);}}
Eventful.LocationTypeAhead.prototype.splitLines=function(oLocation)
{return oLocation.pretty_name.match(/^(.*)\((.*)\)$/);}
Eventful.LocationTypeAhead.prototype.itemId=function(oLocation)
{return oLocation.location_type+'-'+oLocation.location_id;}
Eventful.LocationTypeAhead.prototype.search=function(sQuery)
{$.get('/json/tools/location/typedown',this.searchParams(sQuery),this.listenServerResponse.bind(this,sQuery),'json');}.slow(500);Eventful.LocationTypeAhead.prototype.searchParams=function(sQuery)
{return{location:sQuery,destination_key:'results',recent:1,bubble_up:this.bBubbleUp,region_id:this.sRegionId,location_type:this.sLocationType,exclude:this.sExclude};}
Eventful.LocationTypeAhead.prototype.listenLocationSelected=function(oLocation)
{$.post('/json/tools/location',{location_type:oLocation.location_type,location_id:oLocation.location_id,input_token:'save'},this.listenLocationPosted.bind(this,oLocation),'json');}
Eventful.LocationTypeAhead.prototype.listenLocationPosted=function(oLocation,oResponse)
{this.eventLocationPosted.fire(oLocation,oResponse);}
Eventful.LocationTypeAhead.prototype.options=function()
{return Eventful.LocationTypeAhead.options;}
Eventful.LocationTypeAhead.options=[{pretty_name:'Worldwide',option:1,worldwide:1,svid:'V0-001-000000001-8'}];Eventful.GoogleAnalytics={};Eventful.GoogleAnalytics.setup=function(){if(typeof window["console"]==="object"&&Eventful.Session&&Eventful.Session.userRole==="admin"){this.bLog=true;}
if(typeof window["console"]==="object"&&Eventful.Session&&Eventful.Session.userRole==="admin"){this.bLog=true;}
$("[data-ga-label]").live("click change",this.listenUserAction.bind(this));};Eventful.GoogleAnalytics.listenUserAction=function(evt){if(evt.type=='click'&&evt.target.type=='checkbox'){return};var jqLabel=$(evt.currentTarget),jqAction,jqCategory,sLabel,sAction,sCategory;if(Eventful.GADebug){evt.preventDefault();}
sLabel=jqLabel.data("ga-label");jqAction=jqLabel.closest("[data-ga-action]");if(jqAction.length){sAction=jqAction.data("ga-action");}
jqCategory=jqLabel.closest("[data-ga-category]");if(jqCategory.length){sCategory=jqCategory.data("ga-category");}
if(!sCategory){sCategory=null;}
if(!sAction){sAction=null;}
if(!sLabel){sLabel=null;}
this.trackEvent(sCategory,sAction,sLabel);};Eventful.GoogleAnalytics.trackEvent=function(sCategory,sAction,sLabel){var aParams=["_trackEvent",sCategory,sAction,sLabel];if(!window._gaq){return;}
if(this.bLog){window["console"].log(aParams);}
window._gaq.push(aParams);};$(Eventful.GoogleAnalytics.setup.bind(Eventful.GoogleAnalytics));Eventful.Location=function(oArgs){this.oArgs=(oArgs)?oArgs:{};this.nMinInputLength=this.oArgs.minInputLength;this.oTypeAhead=new Eventful.LocationTypeAhead({id:"header-location-change",itemClass:"header-location-change-result",suggestionMode:1,forceBoldSearchTerms:1,minInputLength:this.nMinInputLength});this.oTypeAhead.eventItemSelected.subscribe(this.listenItemSelected.bind(this));this.oTypeAhead.oDropDown.eventPopoverShown.subscribe(this.listenPopoverShown.bind(this));$(this.setup.bind(this));};Eventful.Location.prototype.setup=function(){var height=$('#header-location-change').height();this.oTypeAhead.oDropDown.popover().css('top',height);this.jqRecentLocations=$('#recent-locations');this.jqRecentLocationsList=$('#recent-locations-list');this.jqRecentLocationsList.find('li .fakelink').live('click',this.listenClickRecentLocation.bind(this));this.jqO2Banner=$('#o2-banner');this.jqO2ClickTicketLinks=$('.o2-click-ticket-link').not('#event-tickets');this.jqO2ClickTicketLinksLrg=$('#event-tickets.o2-click-ticket-link');this.jqO2Banner.add(this.jqO2ClickTicketLinks).add(this.jqO2ClickTicketLinksLrg).bind('click',function(e){var targ=e.currentTarget;this.listenClickO2.call(this,targ);}.bind(this));};Eventful.Location.prototype.listenClickO2=function(){var currentSelector=$(arguments[0]),isO2Banner=currentSelector.attr('id')==='o2-banner',isClickTicketLinkLrg=currentSelector.attr('id')==='event-tickets';if(isO2Banner){Eventful.TrackPageview.trackEvent('o2','o2 Banner')}else if(isClickTicketLinkLrg){Eventful.TrackPageview.trackEvent('o2','o2 Button LRG');}else{Eventful.TrackPageview.trackEvent('o2','o2 Button');}};Eventful.Location.prototype.changeLocation=function(location_type,location_id){$.post('/json/tools/location',{location_type:location_type,location_id:location_id,input_token:"change_location",path:window.location.pathname+window.location.search},this.listenChangeLocationServerResponse.bind(this),"json");};Eventful.Location.prototype.listenItemSelected=function(oItem){this.changeLocation(oItem.location_type,oItem.location_id);};Eventful.Location.prototype.listenChangeLocationServerResponse=function(oResponse){if(oResponse.base_path){window.location=window.location.protocol+'//'+window.location.host+oResponse.base_path;}else{window.location.reload();}};Eventful.Location.prototype.listenPopoverShown=function(){if(!this.bRecentLocationsLoaded){this.bRecentLocationsLoaded=true;$.get('/json/tools/location','?'+new Date().getTime(),this.listenRecentLocationsServerResponse.bind(this),'json');}};Eventful.Location.prototype.listenRecentLocationsServerResponse=function(oResponse){var aLocations=oResponse.saved_locations||oResponse.recent_locations;var jqRecentLocationsList=$('#recent-locations-list'),jqNewItem;$.each(aLocations,function(index,oLocation){jqNewItem=$("<li/>");if(Eventful.Session&&Eventful.Session.CWL&&Eventful.Session.CWL.location_id===oLocation.location_id&&Eventful.Session.CWL.location_type===oLocation.location_type){jqNewItem.html('<span class="current">'+oLocation.pretty_name+'</span>');}else{jqNewItem.html('<span class="fakelink">'+oLocation.pretty_name+'</span>');}
jqNewItem.data('location',oLocation.location_type+'-'+oLocation.location_id).appendTo(jqRecentLocationsList);});if(Eventful.Session&&Eventful.Session.CWL&&Eventful.Session.CWL.pretty_name==="Worldwide"){$('<li><span class="current" id="location-worldwide">Worldwide</span></li>')
.appendTo(jqRecentLocationsList);}else{$('<li><span class="fakelink" id="location-worldwide">Worldwide</span></li>')
.data('location','worldwide-worldwide')
.appendTo(jqRecentLocationsList);}
this.jqRecentLocations.removeClass('loading');};Eventful.Location.prototype.listenClickRecentLocation=function(evt){var location_type_id=$(evt.target).parent('li').data('location').split('-');this.changeLocation(location_type_id[0],location_type_id[1]);};Eventful.Location.prototype.changeLocationString=function(sLocation){this.oTypeAhead.oDropDown.input().attr('alt',sLocation);Eventful.InactiveText.doForcedUpdate(this.oTypeAhead.oDropDown.input());if(this.bRecentLocationsLoaded){this.bRecentLocationsLoaded=false;this.jqRecentLocations.addClass('loading');this.jqRecentLocationsList.empty();}};Eventful.Search=function(oArgs){this.oArgs=(oArgs)?oArgs:{};this.nMinInputLength=(this.oArgs.minInputLength)?this.oArgs.minInputLength:0;var oArgs={id:'uni-search',itemClass:'uni-search-result',suggestionMode:1,options:1,minInputLength:this.nMinInputLength};this.bShowCategoryHeaders=1;this.sCurrentQuery='';this.sGoTo='';Eventful.TypeAhead.call(this,oArgs);this.eventItemSelected.subscribe(this.handleItemSelected.bind(this));this.eventNoItemSelected.subscribe(this.handleItemSelected.bind(this));this.eventOptionSelected.subscribe(this.handleItemSelected.bind(this));this.oDropDown.eventInputChanged.subscribe(this.listenInputChanged.bind(this));$(this.setupPopover.bind(this));}.mixin(Eventful.TypeAhead);Eventful.Search.prototype.setupPopover=function(){var height=$('#search').height();this.oDropDown.popover().css('top',height);};Eventful.Search.prototype.listenInputChanged=function(sInput){if(!this.oDropDown.input().hasClass('inactive')&&sInput.length>=this.nMinInputLength){this.jqContainer=this.jqContainer||$('#uni-search');this.jqContainer.addClass("loading");}
Eventful.TypeAhead.prototype.listenInputChanged.call(this,sInput);};Eventful.Search.prototype.itemTitle=function(oItem){var name=oItem.name.replace('&amp;','&').truncate(50);if(oItem.type==='movie'&&oItem.rating){name+=" ("+oItem.rating+")";}
return name;};Eventful.Search.prototype.itemDescription=function(oItem){switch(oItem.type){case'category':break;case'movie':if(oItem.coming_soon&&oItem.release_date_string){return"In theaters: "+oItem.release_date_string;}else if(oItem.coming_soon){return"Coming soon";}else{return"Now playing";}
case'performer':return oItem.short_bio.truncate(50);case'venue':return[oItem.city,oItem.region_abbr||oItem.country].join(', ').truncate(50);case'location':return("Change your location to "+oItem.name).truncate(50);case'sponsored':return oItem.venue.truncate(50);}};Eventful.Search.prototype.itemId=function(oItem){return oItem.svid||oItem.spid||oItem.location_type+"-"+oItem.location_id;};Eventful.Search.prototype.itemCategoryHeader=function(oItem){switch(oItem.type){case'category':this.sSection='category';return'Categories';case'venue':this.sSection='venue';return'Venues';case'performer':this.sSection='performer';return'Performers';case'location':this.sSection='location';return'Locations';case'movie':this.sSection='movie';return'Movies';case'sponsored':this.sSection='sponsored';return'Sponsored';}};Eventful.Search.prototype.search=function(sQuery){this.sCurrentQuery=sQuery;$.get('/json/tools/uni-search',{q:sQuery,destination_key:'results'},this.listenServerResponse.bind(this,sQuery),'json');}.slow(250);Eventful.Search.prototype.listenServerResponse=function(sQuery,oResponse){this.jqContainer.removeClass("loading");Eventful.TypeAhead.prototype.listenServerResponse.call(this,sQuery,oResponse);};Eventful.Search.prototype.renderResults=function(sQuery,aResults){Eventful.TypeAhead.prototype.renderResults.call(this,sQuery,aResults,{addCategories:1,name:'thing'});};Eventful.Search.prototype.handleItemSelected=function(oItem){if(!oItem){$('#site-search').submit();return;}
if(oItem.option&&oItem.advanced){this.doTrack('advanced');this.sGoTo=Eventful.Hosts.web+"/search?q="+this.sCurrentQuery;}else if(oItem.type==='event'||oItem.type==='performer'||oItem.type==='venue'||oItem.type==='category'||oItem.type==='movie'||oItem.type==='sponsored'){switch(oItem.type){case'venue':this.sGoTo=Eventful.Hosts.web+"/venues/"+oItem.svid;break;case'performer':this.sGoTo=Eventful.Hosts.web+"/performers/"+oItem.spid;break;case'category':this.sGoTo=Eventful.Hosts.web+"/events/categories/"+oItem.name_squish;break;case'movie':if(oItem.coming_soon){this.sGoTo=oItem.permalink+"/info";}else{this.sGoTo=oItem.permalink+"/showtimes";}
break;case'location':this.sGoTo=Eventful.Hosts.web+"/events";break;case'sponsored':this.sGoTo=oItem.permalink;break;default:return false;}
this.doTrack(oItem);var SID=oItem.seid||oItem.svid||oItem.spid||oItem.smid;if(SID){$.post('/json/tools/globalactions/add/'+SID,{type:"search-result"});}}else if(oItem.type==='location'){Eventful.Location.prototype.changeLocation(oItem.location_type,oItem.location_id);}
if(this.sGoTo){this.goToUrl.bind(this).later(100);}};Eventful.Search.prototype.goToUrl=function(){window.location.href=this.sGoTo;};Eventful.Search.prototype.doTrack=function(oItem){if(!oItem){return;}
Eventful.TrackPageview.track("/unifed_search?type="+oItem.type+"&query="+encodeURIComponent(this.sCurrentQuery));if(oItem.type==="sponsored"&&Eventful.GoogleAnalytics){Eventful.GoogleAnalytics.trackEvent("MGM","Type Ahead",oItem.placement_label);}};Eventful.Search.prototype.options=function(){return Eventful.Search.options;};Eventful.Search.options=[{name:'Advanced search',option:1,advanced:1,customClass:'advanced'}];Eventful.HeaderNav=function(){this.sSiteSection=$('body').attr('id');if(this.sSiteSection){this.sSiteSection='nav-'+this.sSiteSection;}
this.aNavClasses='nav-home nav-events nav-concerts nav-movies nav-demands nav-community nav-users nav-groups nav-my nav-show';this.jqSiteTabs=$('.site-tab');this.jqBody=$('body');this.jqSiteTabs.hover(function(evt,item){this.jqBody.removeClass(this.aNavClasses).addClass($(item).attr('id'));}.bind(this),function(evt,item){this.jqBody.removeClass(this.aNavClasses).addClass(this.sSiteSection);}.bind(this));};$(Eventful.HeaderNav);Eventful.oLocation=new Eventful.Location({minInputLength:2});Eventful.oSearch=new Eventful.Search({minInputLength:1});Eventful.FormVal=function(formJExpr,summaryJExpr,oArgs){this.jForm=$(formJExpr);if(summaryJExpr)this.jqFormSummary=$(summaryJExpr);if(!oArgs)oArgs={};this.args={summaryError:oArgs.summaryError||"Oh no! Errors! Please check the fields above.",summaryEmpty:oArgs.summaryEmpty||"You forgot to fill out the fields! Good thing I reminded you.",keepValidate:oArgs.keepValidate===undefined?false:oArgs.keepValidate,isMobile:oArgs.isMobile||false};this.rules=[];this.eventBeginValidation=new Eventful.UIEvent();this.eventPassValid=new Eventful.UIEvent();this.eventJSONValidate=new Eventful.UIEvent();this.eventFailValid=new Eventful.UIEvent();this.eventErrorShown=new Eventful.UIEvent();this.eventFailFormEmpty=new Eventful.UIEvent();this.initialize();}
Eventful.FormVal.prototype.bindEvent=function(nm,fn){var nmEvts={'beginValidatation':this.eventBeginValidation,'passValid':this.eventPassValid,'failValid':this.eventFailValid,'errorShown':this.eventErrorShown,'JSONValidate':this.eventJSONValidate};if(nmEvts[nm])nmEvts[nm].subscribe(fn);return this;}
Eventful.FormVal.GetPattern=function(type){var allPatterns={"float":/^-?(\d+\.?\d*|\d*\.\d+)$/,"number":/^[-+]?\d+$/,"email":/^[\w.%+-]+@([\w-]+\.)+[A-Za-z]{2,4}$/,"url":/^https?:\/\/([\w-]+\.)+[A-Za-z]{2,4}/i};return allPatterns[type];}
Eventful.FormVal.prototype.getPattern=Eventful.FormVal.GetPattern;Eventful.FormVal.setInactive=function(exprActiveToggle){$(exprActiveToggle||'input[type=text][alt!=""],textarea[alt!=""]',!exprActiveToggle&&this.jForm?this.jForm:undefined)
.bind('focus',function(){if($(this).hasClass('inactive')){$(this).removeClass('inactive').val('');}})
.bind('blur',function(){var alt=$(this).attr('alt');if(this.value==''){$(this).addClass('inactive').val(alt);}})
.each(function(i,el){var alt=$(this).attr('alt');if(el.value==""||el.value==alt){$(el).addClass('inactive').val(alt);}});return this;}
Eventful.FormVal.prototype.setInactive=Eventful.FormVal.setInactive;Eventful.FormVal.emptyInactive=function(exprActiveToggle){$(exprActiveToggle||'input.inactive[type=text][alt!=""],textarea.inactive[alt!=""]',!exprActiveToggle&&this.jForm?this.jForm:undefined).val('');return this;}
Eventful.FormVal.prototype.emptyInactive=Eventful.FormVal.emptyInactive;Eventful.FormVal.prototype.initialize=function(){this._serializedValues=this.jForm.serialize();this.jForm.bind('submit.formval',function(){this.validateForm.bind(this).later(1);return false;}.bind(this));return this;}
Eventful.FormVal.prototype.deinitialize=function(){this.jForm.unbind('submit.formval');return this;}
Eventful.FormVal.prototype.focusFirstField=function(){if(this.args.isMobile){return this;}
var jqInputs=this.jForm.find('.has-error :input').not(':hidden');if(!jqInputs.size())
{jqInputs=this.jForm.find(':input').not(':hidden');}
jqInputs.eq(0).trigger('focus');return this;}
Eventful.FormVal.prototype.isDirty=function(){return this._serializedValues!==this.jForm.serialize();}
Eventful.FormVal.prototype.trackEvent=function(sAction,sLabel,sValue)
{Eventful.TrackPageview.trackEvent("Form Validation",sAction,sLabel,sValue);}
Eventful.FormVal.prototype.validateForm=function(){this.eventBeginValidation.fire(this.jForm[0]);if($.grep(this.jForm.find(":input").not(':hidden,:button,:reset,:image,:submit,.inactive').serializeArray(),function(pair){return!!$.trim(pair.value)}).length===0&&$.grep(this.rules,function(rule){return rule.rule.required;}).length>0&&this.jqFormSummary)
{this.showSummaryError(this.args.summaryEmpty);this.eventFailFormEmpty.fire(this.jForm[0]);return;}
if(this.args.isMobile){this.jForm.find('.field-container').removeClass('has-error show-errors');}
this.hideSummaryError().hideHasError();$.each(this.rules,function(_,oNameRulePair){oNameRulePair.rule.quality={error:0,message:'',defaultMessage:''};});function _markBadQuality(errInput,jInput,rule,errBit,defMsg,msg){errInput.push(jInput);rule.quality.error|=1<<errBit;rule.quality.defaultMessage=defMsg||"The input has error";rule.quality.message=msg||rule.message;}
var errInput=[],jsonQueue=[];$.each(this.rules,function(_,oNameRulePair){var jInput=this.jForm.find(':input[name='+oNameRulePair.name+']'),rule=oNameRulePair.rule;if(jInput.length==0||$.grep(errInput,function(j){return jInput.attr('name')===j.attr('name')}).length||!rule)return;var nameValues=$.grep(jInput.not('.inactive').serializeArray(),function(pair){return!!$.trim(pair.value)});if(rule.ignoreCb&&rule.ignoreCb(jInput.length===1?jInput[0]:jInput,nameValues)){return;}
if(rule.required&&!nameValues.length){_markBadQuality(errInput,jInput,rule,0,"Data is required");}else if(nameValues.length&&rule.pattern&&$.grep(nameValues,function(oPair){return rule.pattern.test(oPair.value)===false;}).length){_markBadQuality(errInput,jInput,rule,1,"The input has incorrect format");}else if(nameValues.length&&rule.hasOwnProperty("minlen")){if(jInput.is(':text, :password, textarea')&&jInput.val().length<rule.minlen){_markBadQuality(errInput,jInput,rule,2,"string length must >= "+rule.minlen);}else if(jInput.is(':checkbox, select')&&nameValues.length<rule.minlen){_markBadQuality(errInput,jInput,rule,3,"at least "+rule.minlen+" selected");}}else if(nameValues.length&&rule.hasOwnProperty("maxlen")){if(jInput.is(':text, :password, textarea')&&jInput.val().length>rule.maxlen){_markBadQuality(errInput,jInput,rule,4,"string length must <= "+rule.maxlen);}else if(jInput.is(':checkbox, select')&&nameValues.length>rule.maxlen){_markBadQuality(errInput,jInput,rule,5,"at most "+rule.maxlen+" selected");}}else if(nameValues.length&&rule.hasOwnProperty("min")&&jInput.is(':text')){var aNum=/^[+-]?\d+$/.test(jInput.val())?parseInt(jInput.val()):parseFloat(jInput.val());if(isNaN(aNum)||aNum<rule.min){_markBadQuality(errInput,jInput,rule,6,"must >= "+rule.min);}}else if(nameValues.length&&rule.hasOwnProperty("max")&&jInput.is(':text')){var aNum=/^[+-]?\d+$/.test(jInput.val())?parseInt(jInput.val()):parseFloat(jInput.val());if(isNaN(aNum)||aNum>rule.max){_markBadQuality(errInput,jInput,rule,7,"must <= "+rule.max);}}else if(rule.helperCb){var msg=rule.helperCb(jInput.length===1?jInput[0]:jInput,nameValues);if(msg&&msg.error)_markBadQuality(errInput,jInput,rule,8,'Failed to helper check',msg.message);}else if(rule.jsonCb){var oJSONsetup=rule.jsonCb(jInput.length==1?jInput[0]:jInput,nameValues);if(oJSONsetup&&(oJSONsetup.post||oJSONsetup.get))
{jsonQueue.push($.extend(oJSONsetup,{'rule':rule,'jInput':jInput}));}}}.bind(this));if(errInput.length){this._afterFailure(errInput);}else if(jsonQueue.length){var _onJsonResponse=function(helperCb,jInput,rule,sJsonUrl,oResponse)
{if(rule.accept_unavailable&&oResponse.status===503)
{this.trackEvent("Service Unavailable",sJsonUrl,jInput.val());}else
{var msg=helperCb(oResponse,jInput.length==1?jInput[0]:jInput,this.jForm[0]);}
if(msg&&msg.error){_markBadQuality(errInput,jInput,rule,9,'Failed to ajax check',msg.message);this._afterFailure(errInput);}else if(msg===false){return;}else if(jsonQueue.length){_shiftJsonQueue.call(this);}else{this._afterSuccess();}};var _shiftJsonQueue=function()
{var oJson=jsonQueue.shift();if(oJson)
{var sJsonUrl=oJson.post||oJson.get;$.ajax({url:sJsonUrl,type:oJson.post?"post":"get",data:oJson.data,success:_onJsonResponse.bind(this,oJson.helperCb,oJson.jInput,oJson.rule,sJsonUrl),error:_onJsonResponse.bind(this,oJson.helperErrorCb||function(){return{"error":1,"message":"Sorry! There is trouble to validate your input."}},oJson.jInput,oJson.rule),dataType:oJson.dataType||'json'});}};_shiftJsonQueue.call(this);this.eventJSONValidate.fire();}else{this._afterSuccess();}
return this;}
Eventful.FormVal.prototype._afterSuccess=function(){if(!this.args.keepValidate)this.deinitialize();if(this.eventPassValid.subscribers.length){this.eventPassValid.fire(this.jForm[0]);}else{this.emptyInactive();this.jForm.trigger('submit');}
return this;}
Eventful.FormVal.prototype._afterFailure=function(errInput){this.showSummaryError();this.showHasError(errInput);this.eventFailValid.fire(this.jForm[0],errInput);return this;}
Eventful.FormVal.prototype.addRule=function(inputname,oRule,position){if(typeof position=='number'){this.rules.splice(position,0,{name:inputname,rule:oRule});}else{this.rules.push({name:inputname,rule:oRule});}
return this;}
Eventful.FormVal.prototype.removeRule=function(inputname){this.rules=$.map(this.rules,function(oRule){return oRule.name===inputname?null:oRule;});return this;}
Eventful.FormVal.prototype.showShowError=function(elInput){var jqElContainer=$(elInput).parents(".field-container").addClass("show-errors");var sInputName=$(elInput).attr('name');var sMessage="There are errors in your input.";var jqFormError=jqElContainer.find(".form-error");if(!jqFormError.size()){jqFormError=$('<div class="form-error"></div>')
.attr('id',sInputName+'-error')
.appendTo(jqElContainer);}
var oNameRulePair=$.grep(this.rules,function(oNameRulePair){return oNameRulePair.name==sInputName&&oNameRulePair.rule.quality&&oNameRulePair.rule.quality.error;})[0];if(oNameRulePair)
{var oRule=oNameRulePair.rule;if(oRule.markupMessage==undefined)
{oRule.markupMessage=jqFormError.html();}
sMessage=oRule.quality.message||oRule.markupMessage||oRule.quality.defaultMessage||sMessage;}
jqFormError.html(sMessage);this.eventErrorShown.fire(elInput,jqFormError.get(0));return this;}
Eventful.FormVal.prototype.hideShowError=function(elInput){$(elInput).parents(".field-container").removeClass("show-errors");return this;}
Eventful.FormVal.prototype.showHasError=function(errInput){this._fnClearHasError=this._fnClearHasError?this._fnClearHasError.splice(0):[];$.each(errInput,function(i,el){var jqEl=$(el),jqContainer=jqEl.parents(".field-container").addClass("has-error");if(jqContainer.length==0)return;if(this.args.isMobile){this.showShowError.call(this,el);return this;}else{jqEl.bind("focus.haserror",this.showShowError.bind(this,el))
.bind("blur.haserror",this.hideShowError.bind(this,el));}
var afterTryAgain=function(){jqContainer.removeClass("has-error").removeClass("show-errors");jqEl.unbind("focus.haserror").unbind("blur.haserror");}
if(jqEl.is(':text, :password, textarea')){jqEl.bind("keyup.causechange",function(sOldVal){if($(this).val()!=sOldVal){afterTryAgain();$(this).unbind('keyup.causechange')}}.bind(jqEl[0],jqEl.val()));this._fnClearHasError.push(function(){jqEl.unbind("keyup.causechange");afterTryAgain();});}else if(jqEl.is('select')){jqEl.one("change",afterTryAgain);this._fnClearHasError.push(function(){jqEl.unbind("change",afterTryAgain);afterTryAgain();});}else if(jqEl.is(':checkbox, :radio')){jqEl.one("click",afterTryAgain);this._fnClearHasError.push(function(){jqEl.unbind("click",afterTryAgain);afterTryAgain();});}}.bind(this));return this.focusFirstField();}
Eventful.FormVal.prototype.hideHasError=function(){if(this._fnClearHasError){var fn;while(fn=this._fnClearHasError.pop())fn();}
return this;}
Eventful.FormVal.prototype.showSummaryError=function(sErrorMsg){if(this.jqFormSummary){sErrorMsg=sErrorMsg||this.args.summaryError;this.jqFormSummary.html(sErrorMsg).addClass("show-errors");var fnHideSummary=function(sOldFormValue){if(sOldFormValue!==this.jForm.serialize()){this.hideSummaryError();this.jForm
.find(':text, :password, textarea')
.unbind("keyup",fnHideSummary)
.end()
.find('select')
.unbind("change",fnHideSummary)
.end()
.find(':checkbox, :radio')
.unbind("click",fnHideSummary);}}.bind(this,this.jForm.serialize());this.jForm
.find(':text, :password, textarea')
.bind("keyup",fnHideSummary)
.end()
.find('select')
.bind("change",fnHideSummary)
.end()
.find(':checkbox, :radio')
.bind("click",fnHideSummary);}
return this.focusFirstField();}
Eventful.FormVal.prototype.hideSummaryError=function(evt){if(this.jqFormSummary){this.jqFormSummary.empty().removeClass("show-errors");}
return this;}
Eventful.PopoverChangeLocation=function(oArgs)
{Eventful.Popover.call(this,'#popover-change-location',$.extend({width:250},oArgs));this.bPost=typeof oArgs.post=='undefined'?true:oArgs.post;this.sInputToken=oArgs.token;this.eventLocationChanged=new Eventful.UIEvent();this.oValidator=new Eventful.FormVal(this.find('#location-form'));this.oValidator.addRule('location-search',{required:1,message:'Please enter a location.'});this.oValidator.eventPassValid.subscribe(this.listenLocationValidated.bind(this));this.oValidator.eventFailValid.subscribe(this.listenLocationInvalid.bind(this));if(this.popover().hasClass('guessed'))
{this.swapTopAndBottom();}
this.eventShow.subscribe(this.listenShow.bind(this));this.oLocationTypeAhead=new Eventful.LocationTypeAhead({id:'location-search',required:1,exclude:oArgs.exclude||['place_id'],length:28});this.oLocationTypeAhead.eventItemSelected.subscribe(this.changeLocation.bind(this));if(window.navigator&&navigator.geolocation)
{this.find('.geolocate')
.show()
.click(this.listenClickGeoLocate.bind(this));}}.mixin(Eventful.Popover);Eventful.PopoverChangeLocation.prototype.updateLocations=function(aLocales,oCurrentLocale)
{this.find('#location-form').removeClass('loading');this.find('#location-search').val('');this.find('#location-form').removeClass('has-error');this.find('#location-form').removeClass('show-errors');if(aLocales&&oCurrentLocale)
{this.aLocales=aLocales;var bFoundCurrent=false;if(this.sInputToken!='demand_flow'&&oCurrentLocale.pretty_name!='Worldwide')
{aLocales.push({pretty_name:'Worldwide',location_type:'worldwide',location_id:'worldwide'});}
this.find('#locations-list').empty();$.each(aLocales,function(_,oLocale)
{if(oLocale.location_type==oCurrentLocale.location_type&&oLocale.location_id==oCurrentLocale.location_id)
{oLocale.current=true;bFoundCurrent=true;}else
{oLocale.current=false;}
this.addLocationItem(oLocale);}.bind(this));if(!bFoundCurrent)
{oCurrentLocale.current=true;this.addLocationItem(oCurrentLocale);if(oCurrentLocale.pretty_name!='Worldwide')
{this.aLocales.push(oCurrentLocale);}}}
if(this.popover().hasClass('guessed')&&!oCurrentLocale.geo_ip_guess)
{this.popover().removeClass('guessed');this.swapTopAndBottom();}}
Eventful.PopoverChangeLocation.prototype.swapTopAndBottom=function()
{var elBody=this.find('.popbd:first')
elBody.children(':first').remove().appendTo(elBody);}
Eventful.PopoverChangeLocation.prototype.addLocationItem=function(oLocale)
{var elItem=$('\
    <li>\
      <span class="link-arrow">\
        <span class="title">\
          '+oLocale.pretty_name+'\
          <span class="progress"></span>\
        </span>\
      </span>\
    </li>\
  ').appendTo(this.find('#locations-list'));if(oLocale.current)
{elItem.addClass('current');}else
{elItem.find('.title')
.addClass('fakelink')
.click(this.listenLocationClick.bind(this,elItem,oLocale));}
if(oLocale.pretty_name=='Worldwide')
{elItem.find('.title').attr({id:'location-worldwide'});}}
Eventful.PopoverChangeLocation.prototype.changeLocation=function(oLocale,bFire)
{if(this.bPost)
{this.bLoading=true;$.post('/json/tools/location',{location_type:oLocale.location_type,location_id:oLocale.location_id,input_token:this.sInputToken,path:window.location.pathname+window.location.search},this.listenChangeLocationServerResponse.bind(this,oLocale,bFire),'json');}else
{this.updateLocations(this.aLocales,oLocale);this.eventLocationChanged.fire({locale:oLocale});}}
Eventful.PopoverChangeLocation.prototype.listenShow=function()
{this.show();this.oLocationTypeAhead.oDropDown.input().focus();if(!this.bLoaded&&!this.bLoading)
{$.get('/json/tools/location','?'+new Date().getTime(),this.listenGetLocationsServerResponse.bind(this),'json');}}
Eventful.PopoverChangeLocation.prototype.listenClickGeoLocate=function()
{navigator.geolocation.getCurrentPosition(this.listenGeoLocate.bind(this));}
Eventful.PopoverChangeLocation.prototype.listenGeoLocate=function(oPosition)
{if(oPosition&&oPosition.coords){$.getJSON('/json/tools/location/latlong',{latitude:oPosition.coords.latitude,longitude:oPosition.coords.longitude},function(oResponse)
{if(oResponse.location)
{this.changeLocation(oResponse.location);}}.bind(this))}}
Eventful.PopoverChangeLocation.prototype.listenChangeLocationServerResponse=function(oLocale,bFire,oResponse)
{this.bLoaded=true;this.bLoading=false;var aLocales=oResponse.saved_locations||oResponse.recent_locations;this.updateLocations(aLocales,oLocale);this.close();if(bFire||typeof bFire=='undefined')
{this.eventLocationChanged.fire({locale:oLocale,response:oResponse});}}
Eventful.PopoverChangeLocation.prototype.listenGetLocationsServerResponse=function(oResponse)
{this.bLoaded=true;var aLocales=oResponse.saved_locations||oResponse.recent_locations;var oCurrentLocale=oResponse.current;this.updateLocations(aLocales,oCurrentLocale);this.show();}
Eventful.PopoverChangeLocation.prototype.listenLocationClick=function(elItem,oLocale)
{if(!this.bLoading)
{elItem.addClass('loading');this.changeLocation(oLocale);}}
Eventful.PopoverChangeLocation.prototype.listenLocationValidated=function()
{this.oValidator.initialize();var oLocale=this.oLocationTypeAhead.item();if(oLocale)
{this.changeLocation(oLocale);}}
Eventful.PopoverChangeLocation.prototype.listenLocationInvalid=function()
{this.find('#location-form').removeClass('loading');}
Eventful.PanelWithdraw=function()
{Eventful.Panel.call(this,'panel-withdraw');this.options({width:350});this.clickClose("#panel-withdraw .bn-grey");}.mixin(Eventful.Panel);Eventful.CommentsInPlace=function(){$(document).ready(this.setup.bind(this));this.bLoading=false;}
Eventful.CommentsInPlace.prototype.setup=function(){$('#comments-list').click(this.onClickCommentList.bind(this));this.elAdder=$('#comment-adder-text');Eventful.InactiveText(this.elAdder);this.elAdder.focus(this.listenFocus.bind(this));this.elAdder.blur(this.listenBlur.bind(this));this.elAdder.keyup(this.listenFocus.bind(this));this.elAdder.keyup(this.listenKeyup.bind(this));$('#btn-comment-adder-submit').click(this.AddComment.bind(this));this.listenBlur();}
Eventful.CommentsInPlace.prototype.onClickCommentList=function(evt){var elTarget=evt.target;if(/^click-ce-/.test(elTarget.id))
{this.showEdit(elTarget);evt.preventDefault();}
else if(/^btn-comment-modify-cancel-/.test(elTarget.id))
{this.hideEdit(elTarget);evt.preventDefault();}
else if(/^btn-comment-modify-submit-/.test(elTarget.id))
{if(!this.bLoading)this.editComment(elTarget);evt.preventDefault();}
else if($(elTarget).hasClass("delete-comment-link")){if(!this.bLoading)this.deleteComment(elTarget);evt.preventDefault();}}
Eventful.CommentsInPlace.prototype.showEdit=function(elTarget){$(elTarget)
.parents('li.comment-item')
.addClass('hidden')
.next()
.removeClass('hidden');}
Eventful.CommentsInPlace.prototype.hideEdit=function(elTarget){$(elTarget)
.parents('li.comment-item').addClass('hidden')
.prev().removeClass('hidden');}
Eventful.CommentsInPlace.prototype.deleteComment=function(elTarget){$(elTarget).parent().addClass('loading');var data=Eventful.CommentsInPlace.bIsDetail?{is_detail:1}:{};$.get($(elTarget).prev('.delete-link').text(),data,this.responseDeleteComment.bind(this,elTarget),"html");this.bLoading=true;}
Eventful.CommentsInPlace.prototype.responseDeleteComment=function(elTarget,htmlResponse){this.bLoading=false;if(!/^\s*<li (.|\s)+<\/li>\s*$/i.test(htmlResponse)){window.location.reload(true);return;}
$(elTarget)
.parents('li.comment-item')
.fadeOut("slow",function(){var jqUL=$(this).parent().html(htmlResponse);if(Eventful.CommentsInPlace.bIsDetail){var jqP_see_all=jqUL.parents('div#comments').nextAll('p#see-all-comments-link');var htmlPager=$.trim(jqUL.children(':last-child').html());if(htmlPager){jqP_see_all.html(htmlPager);}else{jqP_see_all.remove();}}else{jqUL
.parents('div.section')
.nextAll('div.section.last')
.html(jqUL.children(':last-child').html());}
jqUL.children(':last-child').remove();});}
Eventful.CommentsInPlace.prototype.editComment=function(elTarget){$(elTarget.form).addClass('loading');$.post(elTarget.form.action,$(':input',elTarget.form).serializeArray(),this.responseEditComment.bind(this,elTarget),"json");this.bLoading=true;}
Eventful.CommentsInPlace.prototype.responseEditComment=function(elTarget,oJSON){this.bLoading=false;if(!oJSON||oJSON.error||!oJSON.new_comment){window.location.reload(true);return;}
$(elTarget)
.parents('form')
.removeClass('loading')
.find('textarea[name=comment]')
.val(oJSON.new_comment)
.parents('li.comment-item')
.fadeOut("slow",function(){$(this)
.attr('style','')
.addClass('hidden')
.prev()
.find('.comment-text')
.html(oJSON.new_comment)
.end()
.fadeIn(2000,function(){$(this)
.attr('style','')
.removeClass('hidden');});});}
Eventful.CommentsInPlace.prototype.listenBlur=function()
{if($('#comment-adder-text').hasClass('inactive'))
{$('#btn-comment-adder-submit')
.removeClass("bn-green")
.addClass("bn-grey")}}
Eventful.CommentsInPlace.prototype.listenKeyup=function(){if($('#comment-adder-text').val().split('').length===0){this.elAdder.blur();this.elAdder.focus();}};Eventful.CommentsInPlace.prototype.listenFocus=function()
{if($('#comment-adder-text').val().split('').length===0)return;$('#btn-comment-adder-submit')
.addClass("bn-green")
.removeClass("bn-grey")}
Eventful.CommentsInPlace.prototype.AddComment=function(evt)
{evt.preventDefault();if(this.bLoading)return;var elSubmitBtn=evt.target;var data=$(':input',elSubmitBtn.form).serializeArray();if(Eventful.CommentsInPlace.bIsDetail){data=data.concat({name:"is_detail",value:1});}
if($(elSubmitBtn).hasClass('bn-grey'))return;$.post(elSubmitBtn.form.action,data,this.ResponseAddComment.bind(this,elSubmitBtn),'html');$(elSubmitBtn.form).addClass("loading");this.bLoading=true;}
Eventful.CommentsInPlace.prototype.ResponseAddComment=function(elSubmitBtn,htmlResponse){$(elSubmitBtn.form)
.removeClass("loading")
.find('textarea')
.val('')
.trigger('blur');this.bLoading=false;if(!/^\s*<li (.|\s)+<\/li>\s*$/i.test(htmlResponse)){window.location.reload(true);return;}
var jqNoCommentsText=$("#no-comments-text");var jqUL=$('ul#comments-list');if(jqNoCommentsText){jqNoCommentsText.slideUp()};if(Eventful.CommentsInPlace.bIsDetail){jqUL
.children(':first-child')
.removeClass('first')
.end()
.prepend('<li class="first comment-item" style="height:75px;">&nbsp;</li>');jqUL.children(':first-child').fadeOut('fast',function(){var sAddedComment=htmlResponse.substr(0,htmlResponse.search(/<\/li>/)).replace(/<li[^>]+>|<\/li>/g,'');$(this)
.css('height','auto')
.html(sAddedComment)
.fadeIn(2000,function(){jqUL.html(htmlResponse);var jqP_see_all=jqUL.parents('div#comments').nextAll('p#see-all-comments-link');var htmlPager=$.trim(jqUL.children(':last-child').html());if(htmlPager){if(jqP_see_all.size()==0){jqUL.parents('div#comments').after('<p id="see-all-comments-link"></p>');jqP_see_all=jqUL.parents('div#comments').nextAll('p#see-all-comments-link');}
jqP_see_all.html(htmlPager);}
jqUL.children(':last-child').remove();});});}else{jqUL
.fadeOut('slow',function(){jqUL
.html(htmlResponse)
.fadeIn(2000,function(){jqUL
.parents('div.section')
.nextAll('div.section.last')
.html(jqUL.children(':last-child').html());jqUL.children(':last-child').remove();});});}
this.listenBlur();}
new Eventful.CommentsInPlace();if(!this.JSON){JSON=function(){function f(n){return n<10?'0'+n:n;}
Date.prototype.toJSON=function(){return this.getUTCFullYear()+'-'+
f(this.getUTCMonth()+1)+'-'+
f(this.getUTCDate())+'T'+
f(this.getUTCHours())+':'+
f(this.getUTCMinutes())+':'+
f(this.getUTCSeconds())+'Z';};var m={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};function stringify(value,whitelist){var a,i,k,l,v;switch(typeof value){case'string':return/["\\\x00-\x1f]/.test(value) ?
                    '"' + value.replace(/[\x00-\x1f\\"]/g, function (a) {
                        var c = m[a];
                        if (c) {
                            return c;
                        }
                        c = a.charCodeAt();
                        return '\\u00' + Math.floor(c / 16).toString(16) +
                                                   (c % 16).toString(16);
                    }) + '"' :
                    '"' + value + '"';

            case 'number':

// JSON numbers must be finite. Encode non-finite numbers as null.

                return isFinite(value) ? String(value) : 'null';

            case 'boolean':
                return String(value);

            case 'null':
                return 'null';

            case 'object':

// Due to a specification blunder in ECMAScript,
// typeof null is 'object', so watch out for that case.

                if (!value) {
                    return 'null';
                }

// If the object has a toJSON method, call it, and stringify the result.

                if (typeof value.toJSON === 'function') {
                    return stringify(value.toJSON());
                }
                a = [];
                if (typeof value.length === 'number' &&
                        !(value.propertyIsEnumerable('length'))) {

// The object is an array. Stringify every element. Use null as a placeholder
// for non-JSON values.

                    l = value.length;
                    for (i = 0; i < l; i += 1) {
                        a.push(stringify(value[i], whitelist) || 'null');
                    }

// Join all of the elements together and wrap them in brackets.

                    return '[' + a.join(',') + ']';
                }
                if (whitelist) {

// If a whitelist (array of keys) is provided, use it to select the components
// of the object.

                    l = whitelist.length;
                    for (i = 0; i < l; i += 1) {
                        k = whitelist[i];
                        if (typeof k === 'string') {
                            v = stringify(value[k], whitelist);
                            if (v) {
                                a.push(stringify(k) + ':' + v);
                            }
                        }
                    }
                } else {

// Otherwise, iterate through all of the keys in the object.

                    for (k in value) {
                        if (typeof k === 'string') {
                            v = stringify(value[k], whitelist);
                            if (v) {
                                a.push(stringify(k) + ':' + v);
                            }
                        }
                    }
                }

// Join all of the member texts together and wrap them in braces.

                return '{' + a.join(',') + '}';
            }
        }

        return {
            stringify: stringify,
            parse: function (text, filter) {
                var j;

                function walk(k, v) {
                    var i, n;
                    if (v && typeof v === 'object') {
                        for (i in v) {
                            if (Object.prototype.hasOwnProperty.apply(v, [i])) {
                                n = walk(i, v[i]);
                                if (n !== undefined) {
                                    v[i] = n;
                                }
                            }
                        }
                    }
                    return filter(k, v);
                }


// Parsing happens in three stages. In the first stage, we run the text against
// regular expressions that look for non-JSON pattern. We are especially
// concerned with '()' and 'new' because they can cause invocation, and '='
// because it can cause mutation. But just to be safe, we want to reject all
// unexpected forms.

// We split the first stage into 4 regexp operations in order to work around
// crippling inefficiencies in IE's and Safari's regexp engines. First we
// replace all backslash pairs with '@' (a non-JSON character). Second, we
// replace all simple value tokens with ']' characters. Third, we delete all
// open brackets that follow a colon or comma or that begin the text. Finally,
// we look to see that the remaining characters are only whitespace or ']' or
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.

                if (/^[\],:{}\s]*$/.test(text.replace(/\\./g, '@').
replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(:?[eE][+\-]?\d+)?/g, ']').
replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {

// In the second stage we use the eval function to compile the text into a
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
// in JavaScript: it can begin a block or an object literal. We wrap the text
// in parens to eliminate the ambiguity.

                    j = eval('(' + text + ')');

// In the optional third stage, we recursively walk the new structure, passing
// each name/value pair to a filter function for possible transformation.
return typeof filter==='function'?walk('',j):j;}
throw new SyntaxError('parseJSON');}};}();}
Eventful.AsynchUpload=function(jqForm,msecTimeout)
{this.elForm=$(jqForm)[0];if(!jqForm||!this.elForm)return null;$(this.elForm).submit(this.listenFormSubmit.bind(this));this.eventSubmit=new Eventful.UIEvent();this.eventComplete=new Eventful.UIEvent();this.eventError=new Eventful.UIEvent();this.eventTimeout=new Eventful.UIEvent();this.msecTimeout=msecTimeout;this.iTimerID=null;}
Eventful.AsynchUpload.prototype.listenFormSubmit=function(evt){var valuedEles=$.grep(this.elForm.elements,function(ele){if(/^text|textarea|password|file|select-one$/i.test(ele.type)){return!!$.trim(ele.value);}});if(valuedEles.length>0){this.eventSubmit.fire(this.elForm);this.sFrameID='f'+Math.floor(Math.random()*99999);$(document.body)
.append('<iframe style="display:none" src="about:blank" id="'+this.sFrameID+'" name="'+this.sFrameID+'"></iframe>');this.elForm.target=this.sFrameID;$('iframe#'+this.sFrameID)
.one("load",this.listenFrameLoad.bind(this));if(this.msecTimeout){this.iTimerID=(this.cancel.bind(this,true)).later(this.msecTimeout);}}else{this.eventError.fire("Please fill out the form first.");evt.preventDefault();return false;}}
Eventful.AsynchUpload.prototype.cancel=function(bTimeout){$('iframe#'+this.sFrameID).unbind("load").remove();if(bTimeout)
this.eventTimeout.fire("submission has been cancel");}
Eventful.AsynchUpload.prototype.listenFrameLoad=function(evt,elFrame)
{var elContent=elFrame.contentDocument||(elFrame.contentWindow?elFrame.contentWindow.document:null)||window.frames[elFrame.id].document;if(elContent.location.href=='about:blank')return;if(this.iTimerID){window.clearTimeout(this.iTimerID);this.iTimerID=null;}
try{var oResponse=JSON.parse(elContent.body.innerHTML);this.eventComplete.fire(oResponse,this.elForm);}catch(e){this.eventError.fire("There are errors in uploading.");}
(function(){$('iframe#'+this.sFrameID).unbind("load").remove();}).bind(this).later(500);}
Eventful.PanelImageAdd=function()
{Eventful.Panel.call(this,'panel-img-add');this.options({width:"380px",closeOnKeyEsc:true,containerCss:{position:'fixed'}})
this.clickClose('#btn-add-image-cancel');var elForm=$('#panel-img-add form')[0];if(!elForm){return{error:"Panel HTML not present"};}
var FV=(new Eventful.FormVal(elForm,$(elForm).find('.form-summary'))).deinitialize();this._oUploader=new Eventful.AsynchUpload(elForm);this.eventSubmit=this._oUploader.eventSubmit;this.eventComplete=new Eventful.UIEvent();this._justClickOn=null;this.eventShow.subscribe(function(evt){FV.hideSummaryError();this._justClickOn=evt?evt.target:null;}.bind(this));this.eventSubmit.subscribe(function(){$(elForm).addClass('loading');$('#btn-add-image-upload').hide();});this._oUploader.eventComplete.subscribe(function(oResponse){$(elForm).removeClass('loading');$('#btn-add-image-upload').show();elForm.reset();if(oResponse.status=="ok"&&oResponse.image){this.eventComplete.fire(oResponse);this.close();}else{FV.showSummaryError(oResponse.message||"There are errors in uploading.");}}.bind(this));this._oUploader.eventError.subscribe(function(msg){FV.showSummaryError(msg);});}.mixin(Eventful.Panel);Eventful.PanelImageAdd.prototype.justClickOn=function(){return this._justClickOn;}
Eventful.PanelImageAddWizard=function(formExpr,defaultImageURL){this.jqForm=$(formExpr);this.defaultImageURL=defaultImageURL||'http://s1.evcdn.com/store/legacy/events/add-no_image.png';this.oImageAdd=new Eventful.PanelImageAdd();this.oImageAdd.eventComplete.subscribe(this.listenImageUploadServerResponse.bind(this));this.oImageAdd.clickShow("#image-viewer-add-click");this.oImageAdd.clickShow('#image-thumb-blank');$('#image-viewer-delete-click').one('click',this.onDeleteImageClicked.bind(this));}
Eventful.PanelImageAddWizard.prototype.onDeleteImageClicked=function(evt){if(this.jqForm.find('input[name=image_id]').size()){this.jqForm.find('input[name=image_id]').remove();}else if(this.jqForm.find('input[name=delete_image]').size()==0){this.jqForm.append('<input type="hidden" name="delete_image" value="1" />');}
$(evt.target)
.prev("#list-image-thumb")
.find('#image-thumb-blank')
.attr('src',this.defaultImageURL)
.end()
.end()
.attr('id',"image-viewer-add-click")
.html('Choose an image')
.bind('click',function(){this.oImageAdd.show();}.bind(this));}
Eventful.PanelImageAddWizard.prototype.listenImageUploadServerResponse=function(oResponse)
{if(oResponse.error||!oResponse.image)return;var img_size;try{img_size=parseInt(this.jqForm.find('#image-thumb-blank').attr('width'));}catch(e){img_size=48;}
this.jqForm
.find('#image-thumb-blank')
.attr('src',img_size<=48?oResponse.image.thumb_url:img_size<=128?oResponse.image.block_url:oResponse.image.block250_url)
.end()
.find('#image-viewer-add-click')
.attr('id',"image-viewer-delete-click")
.html('Delete this image')
.unbind('click')
.one('click',this.onDeleteImageClicked.bind(this))
.end()
.append('<input type="hidden" name="image_id" value="'+oResponse.image.id+'" />')}
Eventful.ImageMultiAddWizard=function(formExpr,oOption){this.jqForm=$(formExpr);if(this.jqForm.size()!=1||this.jqForm[0].tagName.toUpperCase()!='FORM'){throw" There are errors to find the form";}
this.oOption=oOption||{};this.oOption.default_img=this.oOption.default_img||'http://s1.evcdn.com/store/legacy/events/add-no_image.png';this.oOption.max_img=this.oOption.max_img||-1;this.oOption.allow_del=this.oOption.allow_del||0;this.sHolderHtm='<li class="multi_add">'+
this.jqForm.find('#list-image-thumb .multi_add:first-child').html()+
'</li>';this.oImageAdd=new Eventful.PanelImageAdd();this.oImageAdd.clickShow("#list-image-thumb #image-multi-add-btn");this.oImageAdd.eventComplete.subscribe(this.listenImageUploadServerResponse.bind(this));this.jqLastLiBtn=this.jqForm.find('#list-image-thumb .multi_add:last-child');this.jqForm.find('#list-image-thumb').click(this.listenClickList.bind(this));}
Eventful.ImageMultiAddWizard.prototype.listenClickList=function(evt){if($(evt.target).hasClass("delete_box")&&this.oOption.allow_del){$(evt.target).parent().remove();if(this.jqLastLiBtn.css('display')==='none'&&this.jqForm.find('.multi_add img').length<this.oOption.max_img){this.jqLastLiBtn.css('display','inline');}}else if(evt.target.tagName.toUpperCase()=='IMG'&&evt.target.src.search(this.oOption.default_img)!=-1){this.oImageAdd.show();}}
Eventful.ImageMultiAddWizard.prototype.listenImageUploadServerResponse=function(oResponse){if(oResponse.error||!oResponse.image)return;var img_size;try{img_size=parseInt(this.jqForm.find('.multi_add img').attr('width'));}catch(e){img_size=48;}
var sImageFile=this.oOption.default_img.split('/').pop();var jqEmptyImg=this.jqForm.find('.multi_add img[src$="'+sImageFile+'"]');jqEmptyImg
.attr('src',img_size<=48?oResponse.image.thumb_url:img_size<=128?oResponse.image.block_url:oResponse.image.block250_url)
.after('<input type="hidden" name="image_id" value="'+oResponse.image.id+'" />');if(this.oOption.allow_del){jqEmptyImg
.after('<span class="delete_box">X</span>');}
if(this.oOption.max_img>0&&this.jqForm.find('.multi_add input[name=image_id]').length>=this.oOption.max_img){this.jqLastLiBtn.css('display','none');}
this.jqLastLiBtn.before(this.sHolderHtm);}
Eventful.ImageViewer=function()
{this.panelManager=new Eventful.ImageViewer.PanelManager();this.panelLarge=new Eventful.ImageViewer.PanelLarge();$(this.setup.bind(this));}
Eventful.ImageViewer.prototype.setup=function()
{$("#image-viewer-image").load(Eventful.ImageViewer.Rotator.hideThrobber);$("#image-viewer-previous-btn").click(Eventful.ImageViewer.Rotator.prev);$("#image-viewer-next-btn").click(Eventful.ImageViewer.Rotator.next);$("#image-viewer-ringtones .close-box").click(this.closeRingtoneOverlay.bind(this));$("#image-viewer-ringtones-click").click(this.gotoRingtonePage.bind(this));this.openRingtoneOverlay.bind(this).later(3000);if(Eventful.Session.userName)
{var oImageAddPanel=new Eventful.PanelImageAdd();if(!oImageAddPanel.error){oImageAddPanel.clickShow("#image-viewer-add-click, #image-viewer-image-add, #event-info-improve-add-photo");oImageAddPanel.eventComplete.subscribe(function(){window.location.reload(true);});}}else{$("#image-viewer-add-click, #image-viewer-image-add, #event-info-improve-add-photo").click(function(){window.location=Eventful.Hosts.web+'/signin?goto='+escape(window.location.href);});}}
Eventful.ImageViewer.Rotator={queue:new Eventful.CircularQ()};Eventful.ImageViewer.Rotator.next=function()
{var oData=Eventful.ImageViewer.Rotator.queue.next();if(!oData.map&&(Eventful.ImageViewer.Rotator.oLastData&&!Eventful.ImageViewer.Rotator.oLastData.map))
{Eventful.ImageViewer.Rotator.showThrobber();}
Eventful.ImageViewer.Rotator.populate(oData);}
Eventful.ImageViewer.Rotator.prev=function()
{var oData=Eventful.ImageViewer.Rotator.queue.prev();if(!oData.map&&(Eventful.ImageViewer.Rotator.oLastData&&!Eventful.ImageViewer.Rotator.oLastData.map))
{Eventful.ImageViewer.Rotator.showThrobber();}
Eventful.ImageViewer.Rotator.populate(oData);}
Eventful.ImageViewer.Rotator.populate=function(oData)
{Eventful.ImageViewer.Rotator.oLastData=oData;var el;for(var key in oData)
{el=$("#image-viewer-"+key);if(el.length)
{if(Eventful.ImageViewer.bHasMap)
{$("#image-viewer-map").hide();}
switch(key)
{case'count':$("#image-viewer-count").text(oData[key]);$("#panel-image-viewer-count").text(oData[key]);break;case'image':el.attr({src:oData[key]});break;case'map':$("#image-viewer-map").show();Eventful.ImageViewer.Rotator.hideThrobber();break;case'manage':if(oData[key]!="1")
{$("#image-viewer-manage").hide();}
else{$("#image-viewer-manage").css({display:'inline'});}
break;}}}
$("#panel-img-view-mng-image").attr({src:oData.image_block});$("#panel-img-view-mng-remove-image-id").val(oData.image_id);}
Eventful.ImageViewer.Rotator.hideThrobber=function()
{$("#image-viewer").removeClass("throbber");}
Eventful.ImageViewer.Rotator.showThrobber=function()
{$("#image-viewer").addClass("throbber");}
Eventful.ImageViewer.PanelManager=function()
{Eventful.Panel.call(this,"panel-img-view-mng");this.options({width:430});this.clickShow("#image-viewer-manage-click");this.clickClose("#btn-img-view-mng-remove-no, #btn-panel-img-view-mng-close");this.eventShow.subscribe(this.reset.bind(this));$(this.setupPanelManager.bind(this));}.mixin(Eventful.Panel);Eventful.ImageViewer.PanelManager.prototype.setupPanelManager=function()
{$("#panel-img-view-mng-option-delete").click(this.displayDeleteImageConfirmMode.bind(this));$("#btn-img-view-mng-remove-yes").click(this.deleteImage.bind(this));$("#panel-img-view-mng-option-make-default").click(this.makeDefaultImage.bind(this));}
Eventful.ImageViewer.PanelManager.prototype.deleteImage=function(evt)
{var sParentKind=Eventful.ImageViewer.Rotator.parentKind;evt.preventDefault();$.post("/json/tools/"+sParentKind+"s/images/remove",$('#panel-img-view-mng-confirm form').serialize(),function(){window.location.reload(true);});$("#img-view-mng-delete-buttons").addClass("throbber");$("#btn-img-view-mng-remove-yes,\
     #btn-img-view-mng-remove-no").hide();$("#img-view-mng-delete-removing").show();}
Eventful.ImageViewer.PanelManager.prototype.makeDefaultImage=function()
{var oCurrent=Eventful.ImageViewer.Rotator.queue.current();var sParentKind=Eventful.ImageViewer.Rotator.parentKind;var sParentId=Eventful.ImageViewer.Rotator.parentId;$.post("/json/tools/"+sParentKind+"s/images/default/set",{id:sParentId,siid:oCurrent.image_id});this.configureDefaultImage();this.close();}
Eventful.ImageViewer.PanelManager.prototype.configureDefaultImage=function()
{var oQueue=Eventful.ImageViewer.Rotator.queue.queue;$.each(oQueue,function(_,oImage)
{var oCurrent=Eventful.ImageViewer.Rotator.queue.current();oImage.is_default=(oImage.image_id==oCurrent.image_id);});}
Eventful.ImageViewer.PanelManager.prototype.displayDefaultImageMode=function()
{$("#panel-img-view-mng-header-all-options,\
     #panel-img-view-mng-option-make-default").hide();$("#panel-img-view-mng-header-default-options").show();}
Eventful.ImageViewer.PanelManager.prototype.displayDeleteImageConfirmMode=function()
{$("#panel-img-view-mng-options,\
     #panel-img-view-mng-close").hide();$("#panel-img-view-mng-confirm").show();}
Eventful.ImageViewer.PanelManager.prototype.reset=function()
{$("#panel-img-view-mng-confirm,\
     #img-view-mng-delete-removing").hide();$("#panel-img-view-mng-options,\
     #panel-img-view-mng-close,\
     #btn-img-view-mng-remove-yes,\
     #btn-img-view-mng-remove-no").show();$("#img-view-mng-delete-buttons").removeClass("throbber");var oCurrent=Eventful.ImageViewer.Rotator.queue.current();if(oCurrent.is_default)
{this.displayDefaultImageMode();}
else
{$("#panel-img-view-mng-header-default-options").hide();$("#panel-img-view-mng-option-make-default,\
       #panel-img-view-mng-header-all-options").show();}}
Eventful.ImageViewer.PanelLarge=function()
{Eventful.Panel.call(this,"panel-img-view-large");this.options({width:790});this.clickShow("#image-viewer-image, #image-viewer-magnify , #icon-magnify");this.clickClose('#panel-img-view-large button.close');this.eventShow.subscribe(this.load.bind(this));this.eventClose.subscribe(this.reset.bind(this));$(this.secondarySetup.bind(this));}.mixin(Eventful.Panel);Eventful.ImageViewer.PanelLarge.prototype.secondarySetup=function()
{$("#image-viewer-previous-btn-large").click(this.listenArrowClicked.bind(this,'prev'));$("#image-viewer-next-btn-large").click(this.listenArrowClicked.bind(this,'next'));}
Eventful.ImageViewer.PanelLarge.prototype.listenArrowClicked=function(action)
{if(action=="prev")
{var oData=Eventful.ImageViewer.Rotator.queue.prev();if(!oData.map&&(Eventful.ImageViewer.Rotator.oLastData&&!Eventful.ImageViewer.Rotator.oLastData.map))
{Eventful.ImageViewer.Rotator.showThrobber();}
Eventful.ImageViewer.Rotator.populate(oData);}
else if(action=="next")
{var oData=Eventful.ImageViewer.Rotator.queue.next();if(!oData.map&&(Eventful.ImageViewer.Rotator.oLastData&&!Eventful.ImageViewer.Rotator.oLastData.map))
{Eventful.ImageViewer.Rotator.showThrobber();}
Eventful.ImageViewer.Rotator.populate(oData);}
var oCurrent=Eventful.ImageViewer.Rotator.queue.current();$("#panel-image-viewer-count").text(oData['count']);$("#panel-img-view-large .image").html($('<img id="panel-img-view-large-image">').
attr({src:oCurrent.image_large}));}
Eventful.ImageViewer.PanelLarge.prototype.load=function()
{var oCurrent=Eventful.ImageViewer.Rotator.queue.current();$("#panel-img-view-large .image").html($('<img id="panel-img-view-large-image">').attr({src:oCurrent.image_large}));}
Eventful.ImageViewer.PanelLarge.prototype.reset=function()
{$("#panel-img-view-large .image").empty();}
Eventful.ImageViewer.prototype.openRingtoneOverlay=function()
{$('#image-viewer-ringtones').slideDown();}
Eventful.ImageViewer.prototype.closeRingtoneOverlay=function()
{$('#image-viewer-ringtones').slideUp();}
Eventful.ImageViewer.prototype.gotoRingtonePage=function(evt)
{var sUrl=$(evt.target).attr('alt');if(sUrl){window.location.href=sUrl;};}
Eventful.oImageViewer=new Eventful.ImageViewer();Eventful.PerformerTypeAhead=function(oArgs)
{this.nTruncate=oArgs.truncate||64;Eventful.TypeAhead.call(this,oArgs);if(this.bOptions)
{this.oPerformerPanel=new Eventful.PanelAddPerformer();this.eventOptionSelected.subscribe(this.listenPerformerOption.bind(this));}
$(this.setupPerformerTypeAhead.bind(this));}.mixin(Eventful.TypeAhead);Eventful.PerformerTypeAhead.prototype.setupPerformerTypeAhead=function()
{if(this.bOptions)
{if(Eventful.PanelSigninRequired)
{this.oSigninPanel=new Eventful.PanelSigninRequired();}
var aCreatePerf=window.location.search.match(/createperf=([^&]*)/);if(Eventful.Session.userName&&aCreatePerf)
{this.oPerformerPanel.show(unescape(aCreatePerf[1]));}}}
Eventful.PerformerTypeAhead.prototype.itemTitle=function(oPerformer)
{return oPerformer.name.substring(0,this.nTruncate)+(oPerformer.name.length>this.nTruncate?'...':'');}
Eventful.PerformerTypeAhead.prototype.itemDescription=function(oPerformer)
{return oPerformer.short_bio?oPerformer.short_bio.substring(0,this.nTruncate)+(oPerformer.short_bio.length>this.nTruncate?'...':''):'';}
Eventful.PerformerTypeAhead.prototype.itemId=function(oPerformer)
{return oPerformer.spid;}
Eventful.PerformerTypeAhead.prototype.removeExcluded=function(aResults){aResults=$.grep(aResults,function(i){return!this.oItemsToExclude[i.spid];}.bind(this));return aResults;}
Eventful.PerformerTypeAhead.prototype.search=function(sQuery)
{$.get('/json/tools/performers/typedown',{q:sQuery,destination_key:'results'},this.listenServerResponse.bind(this,sQuery),'json');}.slow(500);Eventful.PerformerTypeAhead.prototype.listenPerformerOption=function(oOption)
{var sName=this.oDropDown.input().val();this.reset();if(oOption.add_performer)
{if(Eventful.Session.userName)
{this.oPerformerPanel.show(sName);}else if(this.oSigninPanel)
{this.oSigninPanel.show();var sNewGoto=window.location.pathname+'?createperf='+sName;this.oSigninPanel.find(':input[name=goto]').val(sNewGoto);var jqJoinA=this.oSigninPanel.find('a#btn-signin-required-join');var sHref=jqJoinA.attr('href');if(sHref)
{var sGotoVar=sHref.match(/(goto=[^&]*)/);if(sGotoVar)
{sHref=sHref.replace(sGotoVar[1],'goto='+escape(sNewGoto));}
jqJoinA.attr('href',sHref);}}}}
Eventful.PerformerTypeAhead.prototype.options=function()
{return Eventful.PerformerTypeAhead.options;}
Eventful.PerformerTypeAhead.options=[{name:"I can't find my performer - Add them!",option:1,add_performer:1}];Eventful.AddPerformerToEvent=function(oArgs){this.sEventId=oArgs.eventId;this.sEventType=oArgs.eventType||"add_event";this.sUserName=Eventful.Session.userName;this.sList=oArgs.appendList;this.bNoLink=oArgs.noLink;this.oKnownList={};this.el=null;this.elResults=null;$(document).ready(this.setup.bind(this));}
Eventful.AddPerformerToEvent.prototype.hasRights=function()
{return Eventful.Session.userRole=='admin'||Eventful.Session.userRole=='trustee';}
Eventful.AddPerformerToEvent.prototype.setup=function(){this.jsContainer=$("#add-performer-to-event-widget");this.jqList=$("#"+this.sList);this.jqTypeAheadInput=$("#inp-performer");this.jqAdderClick=$("#add-performer-to-event-click .fakelink");this.jqNoneSpecifiedCopy=$("#event-performers-none-specified");this.jqDupeErrorCopy=$("#add-performer-to-event-dupe-error");this.currentPerformers=$(".who-performer-id");this.jqAdderClick.click(this.doShowAdder.bind(this));this.performerTypeAhead=new Eventful.PerformerTypeAhead({id:'performer',singular:true});this.performerTypeAhead.eventItemSelected.subscribe(function(oPerformer){this.listenSelected(oPerformer);}.bind(this));this.currentPerformers.each(function(_,oItem){var sId=$(oItem).attr('alt');if(sId){this.oKnownList[sId]=1;}}.bind(this));this.doUpdateExcludes();this.jqTypeAheadInput.keyup(this.doRemoveErrors.bind(this));}
Eventful.AddPerformerToEvent.prototype.doShowAdder=function(){this.jsContainer.slideUp('fast',function(oItem){var jqActor=this.jsContainer;jqActor.removeClass("closed");jqActor.addClass("open");jqActor.slideDown('fast',function(oItem){this.jqTypeAheadInput.focus();}.bind(this));}.bind(this));}
Eventful.AddPerformerToEvent.prototype.doHideAdder=function(){this.jsContainer.slideUp('fast',function(_,oItem){var jqActor=$(this);jqActor.addClass("closed");jqActor.removeClass("open");jqActor.slideDown('fast');});}
Eventful.AddPerformerToEvent.prototype.doUpdateExcludes=function(){var sQuery="";var oExclude={};for(var k in this.oKnownList){sQuery+=" -spid:"+k;oExclude[k]=1;}
this.performerTypeAhead.sExcludeQuery=sQuery;this.performerTypeAhead.oItemsToExclude=oExclude;}
Eventful.AddPerformerToEvent.prototype.doAddPerformerToEvent=function(oPerformer,oResponse){this.doRemoveErrors();var bUserIsOwner=false;if(oResponse&&oResponse.performer&&oResponse.performer.user==this.sUserName){bUserIsOwner=true;}
if(!this.jqList||!oPerformer||!oPerformer.name||!oPerformer.spid)return;this.oKnownList[oPerformer.spid]=1;this.doUpdateExcludes();var sHtml='<li><h2>'+(this.bNoLink?oPerformer.name:'<a href="/performers/'+oPerformer.spid+'">'+oPerformer.name+'</a>');if(this.hasRights()||bUserIsOwner){sHtml+=' <span id="remove-'+oPerformer.spid+'" class="delete_box faded';sHtml+=' click-remove-performer">X</span>';}
else{sHtml+=' <span id="ap-'+oPerformer.spid+'" class="approval-note">';sHtml+='(submitted for approval)</span>';}
sHtml+='</h2>';if(this.sEventType=='add_event'){sHtml+='<input type="hidden" value="'+oPerformer.spid+'" name="performer"/>';}
sHtml+='</li>';this.jqList.append(sHtml);this.performerTypeAhead.reset();if(this.sEventType=='detail'){this.doHideAdder();}
if(this.sEventType=='detail'&&this.sEventId){var nRti=(this.hasRights()||oPerformer.owner==this.sUserName)?0:1;if(!nRti){this.jqNoneSpecifiedCopy.slideUp("fast");}
$.post("/json/tools/events/performers/add",{id:this.sEventId,no_rti:nRti,performer_id:oPerformer.spid},this.listenServerResponseSuccess.bind(this),"json");}}
Eventful.AddPerformerToEvent.prototype.doShowDupePerformer=function(oPerformer){this.jqDupeErrorCopy.text('"'+oPerformer.name+'" has already been added to this event.')
this.jsContainer.addClass("error-dupe");}
Eventful.AddPerformerToEvent.prototype.doRemoveErrors=function(){this.jsContainer.removeClass("error-dupe");}
Eventful.AddPerformerToEvent.prototype.listenSelected=function(oPerformer){if(!oPerformer)return;this.performerTypeAhead.reset();if(this.oKnownList[oPerformer.spid]){this.doShowDupePerformer(oPerformer);return;}
else if(this.hasRights()){this.doAddPerformerToEvent(oPerformer);}
else{$.get("/json/tools/performers",{performer_id:oPerformer.spid,fields:"user"},this.doAddPerformerToEvent.bind(this,oPerformer),"json");}}
Eventful.AddPerformerToEvent.prototype.listenServerResponseSuccess=function(oPerformer){return;}
Eventful.RemoveItem=function(oArgs)
{this.id=oArgs.id;this.url=oArgs.url;this.classToFind=oArgs.with_class;this.queryArgs=oArgs.query_args||{};this.eventItemRemoved=new Eventful.UIEvent();$(this.setup.bind(this));}
Eventful.RemoveItem.prototype.setup=function()
{$('#'+this.id).click(this.listenClick.bind(this));}
Eventful.RemoveItem.prototype.serializeQueryObject=function(oVals,el)
{var aTemp=[];for(var i in oVals)
{var sVal=oVals[i].replace(/=(\S+)/,function(w,m){var v;if(m)
{if(m=="id")
{v=el[m]||'';return v.replace(/^remove-/,'');}
return el[m]||'';}});aTemp.push(encodeURIComponent(i)+"="+encodeURIComponent(sVal));}
return aTemp.join('&');}
Eventful.RemoveItem.prototype.removeItem=function(el)
{var sVals=this.serializeQueryObject(this.queryArgs,el);$.post(this.url,sVals);var elListItem=$(el).parents('li:first').remove().get(0);this.eventItemRemoved.fire({el:elListItem});}
Eventful.RemoveItem.prototype.listenClick=function(evt)
{if($(evt.target).hasClass(this.classToFind))
{this.removeItem(evt.target);}}
Eventful.PopoverAddLink=function(oArgs)
{this.eventLinkAdded=new Eventful.UIEvent();this.elForm=$('form#popover-add-link');oArgs=$.extend({width:275,position:{top:14,left:0,relative:'sender'}},oArgs);if(oArgs.isNewEventForm){oArgs.position.left=0;oArgs.position.right='auto';}
if(oArgs.isIframeForm){oArgs.css={zIndex:'100'};}else if(oArgs.isPanelNewEventForm){oArgs.css={zIndex:'3200'};}
Eventful.Popover.call(this,this.elForm,oArgs);this.clickClose($('.click-cancel',this.elForm));this.eventShow.subscribe(this.listenShow.bind(this));this.oValidator=new Eventful.FormVal(this.elForm);this.oValidator.eventPassValid.subscribe(this.listenValid.bind(this));this.oValidator.eventJSONValidate.subscribe(this.listenStartJSON.bind(this));this.oValidator.eventPassValid.subscribe(this.listenEndJSON.bind(this));this.oValidator.eventFailValid.subscribe(this.listenEndJSON.bind(this));this.oValidator.addRule('link',{required:1,message:"Link URL is required."});this.oValidator.addRule('link',{required:1,pattern:Eventful.FormVal.GetPattern('url'),message:"This link doesn't look right, it should be something like http://eventful.com."});}.mixin(Eventful.Popover);Eventful.PopoverAddLink.prototype.listenShow=function()
{this.elForm
.find('input:text')
.val('')
.end()
.find('select')
.val('1');}
Eventful.PopoverAddLink.prototype.listenStartJSON=function()
{this.elForm.addClass('loading');}
Eventful.PopoverAddLink.prototype.listenEndJSON=function()
{this.elForm.removeClass('loading');}
Eventful.PopoverAddLink.prototype.listenValid=function()
{this.oValidator.initialize();this.close();var oLink={link:$('[name=link]',this.elForm).val(),description:$('[name=description]',this.elForm).val(),link_type:$('[name=link_type_id] :selected',this.elForm).text(),link_type_id:$('[name=link_type_id]',this.elForm).val()};oLink.description=oLink.description||oLink.link;this.eventLinkAdded.fire(oLink);}
Eventful.AddObjectLink=function(oArgs)
{this.oArgs=oArgs||{};if(!Eventful.Session.userName){$('#click-add-link .fakelink').click(function(){window.location=Eventful.Hosts.web+'/signin?goto='+escape(window.location.href);});return;}
this.elLinks=$(this.oArgs.links);var oPopover=new Eventful.PopoverAddLink(this.oArgs.popover);oPopover.clickShow('#click-add-link .fakelink');if(this.oArgs.noSave){oPopover.oValidator.eventPassValid.subscribe(this.appendLink.bind(this,oPopover));}else{oPopover.oValidator.addRule('link',{required:1,jsonCb:function()
{return{post:this.oArgs.url,data:oPopover.elForm.serialize(),helperCb:function(oResponse)
{if(oResponse.status=='error')
{return{error:1,message:oResponse.message};}else if(oResponse.status!='ok')
{return{error:1,message:"Sorry, an unknown error occured."};}else if(oResponse.links)
{this.rebuildLinks(oResponse.links)}}.bind(this)};}.bind(this)});}
if(this.oArgs.noSave){$('#event-links-list').click(this.removeLink.bind(this));}}
Eventful.AddObjectLink.prototype.rebuildLinks=function(aLinks)
{var sNewLinks=$.map(aLinks,function(oLink){return this.buildLink.call(this,oLink);}.bind(this)).join('');this.elLinks.find('li:not(.no-replace)').remove();this.elLinks.prepend(sNewLinks);Eventful.ClickOffsite(this.elLinks);}
Eventful.AddObjectLink.prototype.appendLink=function(oPopover)
{this.elLinks.append(this.buildLink({url:$('[name=link]',oPopover.elForm).val(),link_type_id:$('[name=link_type_id] :selected',oPopover.elForm).val(),url_type_id:$('[name=link_type_id] :selected',oPopover.elForm).val(),url_type_name:$('[name=link_type_id] :selected',oPopover.elForm).text(),description:$('[name=description]',oPopover.elForm).val(),always_removable:1}));}
Eventful.AddObjectLink.prototype.buildLink=function(oLink)
{var sHTML='\
    <span class="faded">['+oLink.url_type_name+']</span>\
    <a class="click-offsite" href="'+oLink.url+'">'+(oLink.description||oLink.url)+'</a>&nbsp;\
  ';if(oLink.always_removable){sHTML+='<span class="delete_box faded click-remove-link">X</span>\
    ';}else if(oLink.can_be_removed){sHTML+='<span id="remove-'+oLink.url_id+'" class="delete_box faded click-remove-link">X</span>\
    ';}
if(this.oArgs.noSave){sHTML+='<input type="hidden" name="link" value="'+JSON.stringify(oLink).replace(/"/g,'&quot;')+'" />\
    ';}
return'<li>'+sHTML+'</li>';}
Eventful.AddObjectLink.prototype.removeLink=function(e)
{var $target=$(e.target);if($target.hasClass('click-remove-link')){$target.closest('li').remove();}}
Eventful.RecurrenceList=function(oArgs)
{this.seid=oArgs.seid;this.nPageNumber=1;this.nPageSize=5;$(this.setup.bind(this));}
Eventful.RecurrenceList.prototype.setup=function()
{this.elList=$('#recurrence-list');$('\
    <li class="controls">\
      <button type="button" class="prev"></button>\
      <button type="button" class="next"></button>\
    </li>\
  ').appendTo(this.elList)
.find('.prev').hide().click(this.goToPrev.bind(this)).end()
.find('.next').click(this.goToNext.bind(this));$('#event-recurrence').click(this.listenClick.bind(this));}
Eventful.RecurrenceList.prototype.listenClick=function(evt)
{if(this.elList.is(":hidden"))
{if(!this.bHaveData)
{this.requestList({seek_instance:1});}
this.elList.show();}else
{this.elList.hide();}}
Eventful.RecurrenceList.prototype.listenServerSuccess=function(oResponse)
{if(oResponse.instances&&oResponse.instances.events.length)
{this.bHaveData=true;this.nPageNumber=parseInt(oResponse.instances.page_number,10);var i=oResponse.instances.events.length;this.bHasMore=i==this.nPageSize;$('li.instance',this.elList).remove();var oInst=null,elLI=null,sHTML='';while(oInst=oResponse.instances.events[--i])
{var sDate=oInst.mf_start_time+' '+
(oInst.all_day==0?oInst.tf_start_time?oInst.tf_start_time:"All Day":'')+
' ('+oInst.df_start_time+')';var sHTML=sDate;if(oInst.seid!=Eventful.oEvent.seid)
{sHTML='<a href="/events/'+oInst.seid+'">'+sDate+'</a>'}
$('<li class="instance">'+sHTML+'</li>').prependTo(this.elList);}}else{this.bHasMore=false;if(this.nPageNumber>1)this.nPageNumber--;}
this.elList.removeClass("loading");if(this.bHasMore)
{this.elList.find('.next').show();}else
{this.elList.find('.next').hide();}
if(this.nPageNumber==1)
{this.elList.find('.prev').hide();}else
{this.elList.find('.prev').show();}}
Eventful.RecurrenceList.prototype.goToNext=function()
{if(this.bHasMore)
{this.nPageNumber+=1;this.requestList();}}
Eventful.RecurrenceList.prototype.goToPrev=function()
{if(this.nPageNumber>1)
{this.nPageNumber--;this.requestList();}}
Eventful.RecurrenceList.prototype.requestList=function(oArgs)
{this.elList.addClass("loading");var oDefaultArgs={t:new Date().getTime(),id:this.seid,page_size:this.nPageSize,page_number:this.nPageNumber};$.get("/json/tools/events/recurrence/list",$.extend(oDefaultArgs,oArgs),this.listenServerSuccess.bind(this),'json');}
Eventful.ClickOffsite=function(el)
{$('a.click-offsite',el).click(Eventful.ClickOffsite.listenClick);}
Eventful.ClickOffsite.listenClick=function(evt)
{if(evt.ctrlKey||evt.shiftKey||evt.metaKey||evt.altKey)return;evt.preventDefault();window.open(Eventful.ClickOffsite.redirect(this.href),this.target||'_blank');}
Eventful.ClickOffsite.redirect=function(sLocation)
{return'/r/'+sLocation;}
$(function(){Eventful.ClickOffsite()});Eventful.MojoPicker=function()
{$('#inp-mojo-picker').change(Eventful.MojoPicker.listenChange);}
Eventful.MojoPicker.listenChange=function()
{$('#mojo-picker').addClass('loading');$.post($('#mojo-picker-form').attr('action'),$('#mojo-picker-form').serialize(),function(){$('#mojo-picker').removeClass('loading');});}
$(Eventful.MojoPicker);;/*
 * jQuery Color Animations
 * Copyright 2007 John Resig
 * Released under the MIT and GPL licenses.
 */(function(jQuery){jQuery.each(['backgroundColor','borderBottomColor','borderLeftColor','borderRightColor','borderTopColor','color','outlineColor'],function(i,attr){jQuery.fx.step[attr]=function(fx){if(fx.state==0){fx.start=getColor(fx.elem,attr);fx.end=getRGB(fx.end);}fx.elem.style[attr]="rgb("+[Math.max(Math.min(parseInt((fx.pos*(fx.end[0]-fx.start[0]))+fx.start[0]),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[1]-fx.start[1]))+fx.start[1]),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[2]-fx.start[2]))+fx.start[2]),255),0)].join(",")+")";}});function getRGB(color){var result;if(color&&color.constructor==Array&&color.length==3)return color;if(result=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))return[parseInt(result[1]),parseInt(result[2]),parseInt(result[3])];if(result=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))return[parseFloat(result[1])*2.55,parseFloat(result[2])*2.55,parseFloat(result[3])*2.55];if(result=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))return[parseInt(result[1],16),parseInt(result[2],16),parseInt(result[3],16)];if(result=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))return[parseInt(result[1]+result[1],16),parseInt(result[2]+result[2],16),parseInt(result[3]+result[3],16)];if(result=/rgba\(0, 0, 0, 0\)/.exec(color))return colors['transparent'];return colors[jQuery.trim(color).toLowerCase()];}function getColor(elem,attr){var color;do{color=jQuery.curCSS(elem,attr);if(color!=''&&color!='transparent'||jQuery.nodeName(elem,"body"))break;attr="backgroundColor";}while(elem=elem.parentNode);return getRGB(color);};var colors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};})(jQuery);Eventful.Notification=function(){var fnAnimation=function(){var oStyle=Eventful.Notification.style();$('.notification#notification')
.animate({backgroundColor:"#ffffff",color:"#666666",borderBottomColor:oStyle.borderColor,borderLeftColor:oStyle.borderColor,borderRightColor:oStyle.borderColor,borderTopColor:oStyle.borderColor},2000)
.find('.sign').animate({backgroundColor:"#eeeeee"},2000);}
$(function(){fnAnimation.later(1000);});}
Eventful.Notification.oStyle={borderColor:'#eeeeee'}
Eventful.Notification.style=function(oArgs)
{if(oArgs)
{$.extend(Eventful.Notification.oStyle,oArgs);}
return Eventful.Notification.oStyle;}
Eventful.Tooltip=function(elTooltip,oPosition,elTrigger)
{var el=$(elTooltip),elTrigger=elTrigger?$(elTrigger):el.parent();var oArgs={position:{relative:'sender',top:10},css:{zIndex:1000,borderColor:'#777',width:200}};if(el.find('.tab').is('.right'))
{$.extend(oArgs.position,{right:10,left:'auto'});}else
{$.extend(oArgs.position,{right:'auto',left:10});}
$.extend(oArgs.position,oPosition);Eventful.Popover.call(this,el,oArgs)
this.hoverShow(elTrigger,{show_over:true});el.find('.bd').mouseover(this.close.bind(this));}.mixin(Eventful.Popover)
Eventful.PostLink=function()
{$('a.post-link').click(function(evt)
{evt.preventDefault();Eventful.PostLink.ListenClick(this);});}
Eventful.PostLink.ListenClick=function(el)
{$('<form method="post"></form>').
appendTo('body').
attr({action:el.href,target:el.target}).
submit();}
$(Eventful.PostLink);Eventful.ManageFavorites=function(oArgs){if(!oArgs||!oArgs.type)return false;this.oArgs=oArgs;this.bTrack=oArgs.noTracking?false:true;this.sType=oArgs.type||null;$(document).ready(this.setup.bind(this));}
Eventful.ManageFavorites.prototype.setup=function(){this.jqDebug=$("#debug-text");}
Eventful.ManageFavorites.prototype.setType=function(sType){if(!sType)return;this.sType=sType;}
Eventful.ManageFavorites.prototype.doTrack=function(sType){if(!sType)return;Eventful.TrackPageview.track("/fav_"+sType);}
Eventful.ManageFavorites.prototype.doManageFavorite=function(sId,sAction,fnCallback){if(!sId||!sAction||!this.sType)return false;var url="/json/tools/users/favorites/"+this.sType+"/"+sAction;if(this.bTrack){this.doTrack(this.sType);}
if(Eventful.Session.userType!='session'){$.post(url,{id:sId},fnCallback,"json");}}
Eventful.ActionItems=function(oArgs){$(document).ready(this.setup.bind(this));}
Eventful.ActionItems.prototype.setup=function(){this.jqActionItems=$(".action-item");this.jqActionElements=$(".action-items li, .action-items tbody tr, .action-items dt, .action-items dd, .actionable");this.jqJoinButton=$("#btn-signin-required-join");this.jqJoinFrom=$("#form-signin-required-from");this.bFromSet=false;this.jqFrame=$("#outer-container");this.jqActionElements.hover(this.listenHandleHoverIn.bind(this),this.listenHandleHoverOut.bind(this));this.jqHoverElement=$('<div></div>')
.hide()
.appendTo(this.jqFrame)
.attr({id:'action-item-popover'})
.addClass("action-item-hover")
.text('this is text')
.click(this.listenActOnItemClick.bind(this));this.jqHoverElementHeight=this.jqHoverElement.outerHeight()
this.oPopover=new Eventful.Popover(this.jqHoverElement,{css:{zIndex:1000,width:125,backgroundColor:'#EAEAEA',border:'none'},bToggleClick:1,position:{relative:this.jqFrame,top:'auto',bottom:'auto',right:'auto',left:'auto'}});this.jqActionElements.each(function(_,oItem){this.oPopover.hoverShow(oItem,{show_over:true})}.bind(this));this.oManageFavs=new Eventful.ManageFavorites({type:null,noTracking:true});}
Eventful.ActionItems.prototype.listenHandleHoverIn=function(evt,oItem){var jqActor=$(".action-item",oItem);var sHoverText,sClassToAdd;if(jqActor.hasClass('is-item-fan')){this.updatePopoverCopy('is_fan');this.jqHoverElement.addClass('is-item-fan');}else{this.updatePopoverCopy('not_fan');this.jqHoverElement.removeClass('is-item-fan');}
this.jqHoverElement.attr('alt',jqActor.attr('alt'));var nDiffTop=(this.jqHoverElementHeight-jqActor.outerHeight())/2;var nTop=jqActor.offset().top-nDiffTop;var nLeft=jqActor.offset().left-this.jqFrame.offset().left-2;this.oPopover.args.position.top=nTop;this.oPopover.args.position.left=nLeft;this.oPopover.show();}
Eventful.ActionItems.prototype.listenHandleHoverOut=function(evt,oItem){}
Eventful.ActionItems.prototype.doTrack=function(sType){if(!sType)return;var sTrackId="/click_pfav_"+sType+"&type="+Eventful.Session.userType;Eventful.TrackPageview.track(sTrackId);}
Eventful.ActionItems.prototype.listenActOnItemClick=function(evt){var jqActor=$(evt.target);var sId=jqActor.attr('alt');var bDoSwitch=Eventful.Session.userType=='session'?false:true;if(/.*eventful.com\/my/.test(jqActor.attr('href'))){return;}
else{evt.preventDefault();}
if(Eventful.Session.userType=='session'){window.location=Eventful.Hosts.web+'/signin?goto='+escape(window.location.href);return;}
if(jqActor.hasClass('is-item-fan')){if(bDoSwitch)jqActor.removeClass('is-item-fan');this.doAddItem(sId,'remove');this.updateItemView(sId,'remove');this.updatePopoverCopy('not_fan');}else{jqActor.addClass('is-item-fan');this.doAddItem(sId,'add');this.updateItemView(sId,'add');this.updatePopoverCopy('is_fan');}}
Eventful.ActionItems.prototype.listenItemUpdated=function(){return;}
Eventful.ActionItems.prototype.updateItemView=function(sId,sAction){this.jqActionItems.each(function(_,oItem){jqActor=$(oItem);if(jqActor.attr('alt')==sId){if(sAction=='add'){jqActor.addClass('is-item-fan');}else if(sAction=='remove'){jqActor.removeClass('is-item-fan');}}});}
Eventful.ActionItems.prototype.updatePopoverCopy=function(sType){if(!sType)return;switch(sType){case'is_fan':this.jqHoverElement.html('Added - <a href="'+Eventful.Hosts.web+'/my">View Favorites</a>');this.jqHoverElement.attr('data-ga-label','View Favorites Link');break;case'not_fan':this.jqHoverElement.text('Add to favorites');this.jqHoverElement.attr('data-ga-label','Favorites Link');break;}}
Eventful.ActionItems.prototype.doAddItem=function(sId,sAction){if(!sId||!sAction)return;var aIdSplit=sId.split('-');var sType;switch(aIdSplit[0]){case'E0':sType='events';this.doTrack('event');break;case'V0':sType='venues';this.doTrack('venue');break;case'P0':sType='performers';this.doTrack('performer');break;case'M0':sType='movies';this.doTrack('movie');break;case'T0':sType='theaters';this.doTrack('theater');break;default:sType='users';this.doTrack('user');}
if(Eventful.Session.userType!='session'){this.oManageFavs.setType(sType);this.oManageFavs.doManageFavorite(sId,sAction,this.listenItemUpdated.bind(this));}}
new Eventful.ActionItems();Eventful.TrackTicketLinks=function(){$("a.ticket-link").click(function(evt){Eventful.TrackPageview.track("/click_ticket");});$('#movie-showtimes td.tickets a').click(function(){Eventful.fandango_link_source=Eventful.fandango_link_source||'unknown';Eventful.TrackPageview.trackEvent('Fandango Links','Click',Eventful.fandango_link_source,null);});}
$(Eventful.TrackTicketLinks);Eventful.PopoverShareEmail=function(sPopoverSelector,sTriggerSelector,oArgs){this.oPosition={top:22,left:'auto',right:5};if(oArgs&&oArgs.position){this.oPosition=oArgs.position;}
$(this.setup.bind(this,sPopoverSelector,sTriggerSelector));}
Eventful.PopoverShareEmail.prototype.setup=function(sPopoverSelector,sTriggerSelector){this.jqPopovers=$(sPopoverSelector);this.jqPopovers.each(function(i,item){var jqActor=$(item);var jqClick=jqActor.siblings(sTriggerSelector).eq(0);Eventful.InactiveText.attachHandlers(jqActor);$(".send-link input").click(function(evt){var jqActor=$(evt.target);window.setTimeout(function(){jqActor.select()},50);});this.oPosition.relative=jqClick;var oPopover=new Eventful.Popover(jqActor,{css:{zIndex:1000,width:316},no_focus:true,bToggleClick:1,position:this.oPosition}).clickShow(jqClick);var jqForm=jqActor.find('form');jqForm.submit(this.listenSubmit.bind(this));var oInviteValidator=new Eventful.FormVal(jqForm);oInviteValidator.addRule('emails',{required:true,message:"We need your friend's email address to send the invitation."});}.bind(this));};Eventful.PopoverShareEmail.prototype.listenSubmitInvite=function(jqForm)
{var elForm=jqForm;}
Eventful.PopoverShareEmail.prototype.listenSubmit=function(evt){evt.preventDefault();};Eventful.ItemSharer=function(){$(this.setup.bind(this));};Eventful.ItemSharer.prototype.setup=function(){this.jqPrint=$(".item-sharer .share-print");this.jqEmail=$(".item-sharer .share-email");this.jqPopovers=new Eventful.PopoverShareEmail(".item-sharer .share-email-popover",".share-email");this.jqPrint.click(this.sharePrint.bind(this));};Eventful.ItemSharer.prototype.sharePrint=function(evt){evt.preventDefault();window.print();};Eventful.oItemSharer=new Eventful.ItemSharer();$(function(){if(Eventful.stubhub_ticket_test){Eventful.TrackPageview.trackEvent('Ticket Links','Impression',Eventful.stubhub_ticket_test);}
$(document.body).delegate(".click-ticket-link","click",function(evt){var jqLink,sHREF,sLID,sTarget;evt.preventDefault();jqLink=$(evt.currentTarget);sHREF=jqLink.attr('href')||jqLink.data("href");sLID=jqLink.data('lid')||'other';sTarget=jqLink.attr('target')||'_blank';if(!sHREF){return;}
if((/^edptest/).test(sLID)){Eventful.TrackPageview.trackEvent('Ticket Links','Click',Eventful.stubhub_ticket_test);}
window.open(sHREF+'/tickets?lid='+sLID,sTarget);});});Eventful.StubHub=function(){$(this.setup.bind(this));};Eventful.StubHub.prototype.setup=function(){var uri=window.location.pathname,qstring=window.location.search,rxMatchJustEvents=/events(|\?.*)$/,rxMatchAllEvents=/events/,rxMatchSearch=/\?q\=/,rxMatchEDP=/events\/.*\/E[0-9]/,rxMatchPDP=/performers\/.*\/P[0-9]/,rxMatchVDP=/venues\/.*\/V[0-9]/,rxMatchDDP=/demand\/.*\/D[0-9]/,jqTopConcerts=$('#top-concert-stubhub');if(rxMatchJustEvents.test(uri)&&!rxMatchSearch.test(qstring)){this.sPageName="Events";}else if(rxMatchSearch.test(qstring)){this.sPageName="Search Results";}else if(rxMatchAllEvents.test(uri)&&!rxMatchJustEvents.test(uri)&&!rxMatchEDP.test(uri)){this.sPageName="Browse Results";}else if(rxMatchEDP.test(uri)){this.sPageName="EDP";}else if(rxMatchPDP.test(uri)){this.sPageName="PDP";}else if(rxMatchVDP.test(uri)){this.sPageName="VDP";}else if(rxMatchDDP.test(uri)){this.sPageName="DDP";}else{this.sPageName="Unknown Page";}
if(jqTopConcerts.length){jqTopConcerts.delegate(".fakelink, .bn","click",this.listenClick.bind(this));}};Eventful.StubHub.prototype.listenClick=function(evt){var jqLink=$(evt.currentTarget),sType;evt.preventDefault();if(jqLink.hasClass("ticket")){sType=" Button";}else if(jqLink.hasClass("see-more")){sType=" See More";}else{sType=" Link";}
Eventful.TrackPageview.trackEvent('Ticket Widget','Top Concerts',this.sPageName+sType);if(sType!==" See More"){Eventful.TrackPageview.trackEvent('Ticket Links','Click',"4_stubhub.com");}
window.open(jqLink.attr('data-href'),"_blank");};Eventful.oStubHub=new Eventful.StubHub();Number.prototype.toStringPadLeft=function(nPlaces)
{var s=this.toString().replace(/\.\d+/,'');while(s.length<nPlaces)
{s='0'+s;}
return s;}
Number.prototype.commify=function()
{return this.toString().commify();}
$(function(){$('a.scroll-anchor').click(function(evt){var $target=$(this.hash+', a[name='+this.hash.slice(1)+']');if($target.length>0){evt.preventDefault();$('html,body').animate({scrollTop:$target.offset().top},1000);}});});Eventful.EDP=function(){$(this.setup.bind(this));}
Eventful.EDP.prototype.setup=function(){this.oEmailPopover=new Eventful.PopoverShareEmail('#event-info-email .share-email-popover','#click-email',{position:{top:24,left:0}});new Eventful.AddObjectLink({links:'#event-links-list',url:"/json/tools/events/links/add"});if(Eventful.Session.userName)
{$("span","#save-calendars, #save-groups").click(Eventful.EDP.listenGCClick);this.oAddPerformer=new Eventful.AddPerformerToEvent({eventType:"detail",eventId:Eventful.oEvent.seid,appendList:"event-info-performers"});new Eventful.PanelWithdraw().
clickShow("#event-owner-tools-withdraw");}}
Eventful.EDP.listenGCClick=function(evt){var elTarget=$(this);if(!(/^(at|rf)(c|g)-/.test(elTarget.attr('id'))))return;var elLi=elTarget.parents('li:first');var idItem=elTarget.attr('id').substr(4);var sAction=elTarget.attr('id').substr(0,3);var bAdd=(sAction.charAt(0)=='a');var urlCall="/json/tools/events";var elHeader=null;var oVars={"event_id":Eventful.oEvent.seid};if(bAdd&&elLi.hasClass("added")){return false;}
if(bAdd){elTarget.removeClass('fakelink').addClass('added');}
else{elTarget.addClass('fakelink').removeClass('added');}
switch(idItem.charAt(0)){case'C':urlCall+="/calendars";oVars.calendar_id=idItem;elHeader=$("#hdr-save-calendars");break;case'G':urlCall+="/groups";oVars.group_id=idItem;elHeader=$("#hdr-save-groups");break;default:return false;}
urlCall+=(bAdd?"/add":"/remove");elHeader.addClass("loading");$.post(urlCall,oVars,function(){elHeader.removeClass("loading");if(bAdd){elLi.addClass('added');}else{elLi.removeClass('added');}});}
Eventful.oEDP=new Eventful.EDP();Eventful.PanelSaveToCalendar=function(){new Eventful.Panel('panel-save-to-calendar').
options({width:430,tracking_string:'/lbox_savetocalendar_main'}).
clickShow('#click-save-to-calendar').
autoShow('calendar');$(this.setup.bind());}
Eventful.PanelSaveToCalendar.prototype.setup=function()
{$('#save-calendars .fakelink').click(function(){Eventful.TrackPageview.track('/lbox_savetocalendar_calendars');});$('#save-groups .fakelink').click(function(){Eventful.TrackPageview.track('/lbox_savetocalendar_groups');});$('#save-add-to-your-calendar li:nth-child(1) a').click(function(){Eventful.TrackPageview.track('/lbox_savetocalendar_yahoo');});$('#save-add-to-your-calendar li:nth-child(2) a').click(function(){Eventful.TrackPageview.track('/lbox_savetocalendar_google');});$('#save-add-to-your-calendar li:nth-child(3) a').click(function(){Eventful.TrackPageview.track('/lbox_savetocalendar_outlook');});$('#save-add-to-your-calendar li:nth-child(4) a').click(function(){Eventful.TrackPageview.track('/lbox_savetocalendar_ical');});}
new Eventful.PanelSaveToCalendar();Eventful.TicketAlertInterstitial=function(){$(this.setup.bind(this));}
Eventful.TicketAlertInterstitial.prototype.setup=function(){if(!$('#panel-site-interrupter.ticket_alert').length){return;}
if(Eventful.Cookies.getCookie('perf_int')==="f")return;this.oInterrupterConfig={ga_category:$('body').data('ga-category')||"Unknown Page",ga_action:$('#panel-site-interrupter').data('ga-action')||"Unknown Interstitial",width:652,delay:25};$.later(this.oInterrupterConfig.delay*1000,function(){if($('.modalOverlay:visible, .rondavu_targetedinvite_scrim:visible').length)return;this.oInterrupter=new Eventful.Panel('panel-site-interrupter')
.options({width:this.oInterrupterConfig.width,containerCss:{position:'fixed'}})
.clickClose(".close_link");this.NoInvitation=this.oInterrupter.find('input[name=if-show]')
.click(this.onNoInviteClicked.bind(this))
.is(':checked');this.setupTracking();this.showInterrupter();}.bind(this));}
Eventful.TicketAlertInterstitial.prototype.setupTracking=function(){this.oInterrupter.eventShow.subscribe(this.onOpen.bind(this));this.oInterrupter.eventClose.subscribe(this.onClose.bind(this));}
Eventful.TicketAlertInterstitial.prototype.showInterrupter=function(){this.oInterrupter.show();$('#modalContainer a.modalCloseImg').toggle();}
Eventful.TicketAlertInterstitial.prototype.onOpen=function(){Eventful.TrackPageview.trackEvent(this.oInterrupterConfig.ga_category,this.oInterrupterConfig.ga_action,'Open',null);}
Eventful.TicketAlertInterstitial.prototype.onClose=function(){Eventful.TrackPageview.trackEvent(this.oInterrupterConfig.ga_category,this.oInterrupterConfig.ga_action,'Close',null);if(this.NoInvitation){Eventful.Cookies.setCookie('perf_int','f',43200);}}
Eventful.TicketAlertInterstitial.prototype.onNoInviteClicked=function(evt,eInput){this.NoInvitation=$(eInput).is(':checked');}
new Eventful.TicketAlertInterstitial();Eventful.TicketBuyEDPInterstitial=function(){$(this.setup.bind(this));}
Eventful.TicketBuyEDPInterstitial.prototype.setup=function(){this.oInterrupterConfig={ga_category:$('body').data('ga-category')||"Unknown Page",ga_action:$('#panel-site-interrupter').data('ga-action')||"Unknown Interstitial",width:490};if(!$('#panel-site-interrupter.ticket_buy_edp').length)return;if(Eventful.Cookies.getCookie(this.oInterrupterConfig.tracking_name)=='no_show')return;this.oInterrupter=new Eventful.Panel('panel-site-interrupter')
.options({width:this.oInterrupterConfig.width,containerCss:{position:'fixed'}})
.clickClose(".close_link");this.setupTracking();this.showInterrupter();}
Eventful.TicketBuyEDPInterstitial.prototype.setupTracking=function(){this.oInterrupter.eventShow.subscribe(this.onOpen.bind(this));this.oInterrupter.eventClose.subscribe(this.onClose.bind(this));}
Eventful.TicketBuyEDPInterstitial.prototype.showInterrupter=function(){this.oInterrupter.show();}
Eventful.TicketBuyEDPInterstitial.prototype.onOpen=function(){Eventful.TrackPageview.trackEvent(this.oInterrupterConfig.ga_category,this.oInterrupterConfig.ga_action,'Open',null);}
Eventful.TicketBuyEDPInterstitial.prototype.onClose=function(){Eventful.TrackPageview.trackEvent(this.oInterrupterConfig.ga_category,this.oInterrupterConfig.ga_action,'Close',null);if($('#id-if-show:checked').length){Eventful.TrackPageview.trackEvent(this.oInterrupterConfig.tracking_name,'Dont Show Again',null,null);Eventful.Cookies.setCookie(this.oInterrupterConfig.tracking_name,'no_show',43200);}}
new Eventful.TicketBuyEDPInterstitial();Eventful.TicketFindLongPastEDP=function(){$(this.setup.bind(this));}
Eventful.TicketFindLongPastEDP.prototype.setup=function(){if(!$('#panel-site-interrupter.ticket_find_long_past_edp').length){return;}
this.oInterrupterConfig={ga_category:$('body').data('ga-category')||"Unknown Page",ga_action:$('#panel-site-interrupter').data('ga-action')||"Unknown Interstitial",width:612};this.oInterrupter=new Eventful.Panel('panel-site-interrupter')
.options({width:this.oInterrupterConfig.width,topMod:75,position:'absolute'})
.clickClose(".close_link");$('.copy').click(function(evt){evt.preventDefault();window.open($(evt.currentTarget).find('.find-tickets-button').attr('href'),'_blank');});this.setupTracking();this.showInterrupter();}
Eventful.TicketFindLongPastEDP.prototype.setupTracking=function(){this.oInterrupter.eventShow.subscribe(this.onOpen.bind(this));this.oInterrupter.eventClose.subscribe(this.onClose.bind(this));}
Eventful.TicketFindLongPastEDP.prototype.showInterrupter=function(){this.oInterrupter.show();$('#modalContainer a.modalCloseImg').toggle();}
Eventful.TicketFindLongPastEDP.prototype.onOpen=function(){Eventful.TrackPageview.trackEvent(this.oInterrupterConfig.ga_category,this.oInterrupterConfig.ga_action,'Open',null);}
Eventful.TicketFindLongPastEDP.prototype.onClose=function(){Eventful.TrackPageview.trackEvent(this.oInterrupterConfig.ga_category,this.oInterrupterConfig.ga_action,'Close',null);}
new Eventful.TicketFindLongPastEDP();
