/* /js/unit/ek/performers/detail/demand.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.PanelCollegePicker=function()
{Eventful.Panel.call(this,'panel-college-picker')
this.options({width:550,closeClass:'modalCloseGreen'});this.oCachedResults={};this.eventCollegePicked=new Eventful.UIEvent();$(this.setupPanelCollegePicker.bind(this));}.mixin(Eventful.Panel);Eventful.PanelCollegePicker.prototype.setupPanelCollegePicker=function()
{this.find('.click-select').click(this.listenClickSelect.bind(this));this.find('form.search').submit(this.listenSubmit.bind(this));}
Eventful.PanelCollegePicker.prototype.searchField=function()
{if(!this.jqSearchField)this.jqSearchField=this.find('input:text');return this.jqSearchField;}
Eventful.PanelCollegePicker.prototype.subheader=function()
{if(!this.jqSubheader)this.jqSubheader=this.find('h2.subhead');return this.jqSubheader;}
Eventful.PanelCollegePicker.prototype.collegeList=function()
{if(!this.jqList)this.jqList=this.find('ul.colleges');return this.jqList;}
Eventful.PanelCollegePicker.prototype.show=function(oLocation)
{Eventful.Panel.prototype.show.call(this);this.searchField().val('');if(oLocation)
{if(oLocation.location_type=='venue_id')
{if(this.oLastDisplayed)
{this.showColleges(this.oLastDisplayed);}else
{this.subheader().html("Searching for colleges near \""+oLocation.pretty_name+"\".");this.collegeList().empty();this.panel().addClass('loading').removeClass('loaded');var oSeedCollege={svid:oLocation.location_id,name:oLocation.pretty_name};$.ajax({url:'/json/tools/venues/location',data:{bubble_up:1,id:oLocation.location_id},success:this.listenVenueLocationServerResponse.bind(this,oSeedCollege),dataType:'json'});}}else
{var sKey=oLocation.location_type+':'+oLocation.location_id;if(this.oCachedResults[sKey])
{this.showColleges(this.oCachedResults[sKey]);}else
{this.subheader().html("Searching for colleges in \""+oLocation.pretty_name+"\".");this.collegeList().empty();this.panel().addClass('loading').removeClass('loaded');this.searchByLocation(oLocation);}}}}
Eventful.PanelCollegePicker.prototype.showColleges=function(oArgs)
{this.oLastDisplayed=oArgs;var aColleges=oArgs.colleges;var sQuery=oArgs.query;this.collegeList().empty();if(aColleges.length)
{this.subheader().html("College results for \""+sQuery+"\".");$.each(aColleges,function(_,oCollege)
{this.addCollegeItem(oCollege);}.bind(this));this.panel().addClass('loaded')}else
{this.subheader().html("Sorry, we couldn't find any colleges for \""+sQuery+"\".");this.panel().removeClass('loaded')}}
Eventful.PanelCollegePicker.prototype.addCollegeItem=function(oCollege)
{if(oCollege)
{var bChecked=!this.collegeList().children().size();this.collegeList().append('\
      <li id="item-'+oCollege.svid+'">\
        <label>\
          <input type="radio" name="suggestion" />'+oCollege.name+'\
        </label>\
      </li>');if(bChecked)
{this.oCurrentCollege=oCollege;$('#item-'+oCollege.svid).addClass('checked');$('#item-'+oCollege.svid+' input:radio').attr({checked:'checked'});}
$('#item-'+oCollege.svid+' input:radio').click(this.listenClickCollege.bind(this,oCollege));}}
Eventful.PanelCollegePicker.prototype.searchByLocation=function(oLocation,oSeedCollege)
{var sKey=oLocation.location_type+':'+oLocation.location_id;var oData={location_type:oLocation.location_type,location_id:oLocation.location_id};this.search(oData,sKey,oLocation.pretty_name,oSeedCollege);}
Eventful.PanelCollegePicker.prototype.searchByQuery=function(sQuery)
{if(this.oCachedResults[sQuery])
{this.showColleges(this.oCachedResults[sQuery]);}else
{this.subheader().html("Searching for \""+sQuery+"\".");this.collegeList().empty();this.panel().addClass('loading').removeClass('loaded');var oData={q:sQuery};this.search(oData,sQuery,sQuery);}}
Eventful.PanelCollegePicker.prototype.search=function(oData,sKey,sQuery,oSeedCollege)
{oData.venue_type='University';oData.fields='name';$.ajax({url:'/json/tools/venues/search',data:oData,success:this.listenVenueSearchServerResponse.bind(this,sKey,sQuery,oSeedCollege),dataType:'json'});}
Eventful.PanelCollegePicker.prototype.listenClickCollege=function(oCollege)
{$('#item-'+this.oCurrentCollege.svid).removeClass('checked');$('#item-'+oCollege.svid).addClass('checked');this.oCurrentCollege=oCollege;}
Eventful.PanelCollegePicker.prototype.listenClickSelect=function(elItem,oCollege)
{this.close();this.eventCollegePicked.fire(this.oCurrentCollege);}
Eventful.PanelCollegePicker.prototype.listenSubmit=function(evt)
{evt.preventDefault();var sQuery=this.searchField().val();if(sQuery)
{this.searchByQuery(sQuery);}}
Eventful.PanelCollegePicker.prototype.listenVenueSearchServerResponse=function(sKey,sQuery,oSeedCollege,oResponse)
{if(oResponse.venues)
{if(oSeedCollege)
{oResponse.venues=$.grep(oResponse.venues,function(oCollege)
{return oCollege.svid!=oSeedCollege.svid;});oResponse.venues.unshift(oSeedCollege);}
this.oCachedResults[sKey]={colleges:oResponse.venues,query:sQuery};this.showColleges(this.oCachedResults[sKey]);}
this.panel().removeClass('loading');}
Eventful.PanelCollegePicker.prototype.listenVenueLocationServerResponse=function(oSeedCollege,oResponse)
{if(oResponse.location)
{this.searchByLocation(oResponse.location,oSeedCollege);}};/*
 * 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;}
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.DemandFlow=function(oArgs)
{this.oPerformer=oArgs.performer;this.oDemand=oArgs.demand;this.oLocation=oArgs.location;this.oUserLocation=oArgs.location.original||oArgs.location;this.oUser=oArgs.user;this.oCaptcha=oArgs.captcha;this.oTests=oArgs.tests||{};this.sConfirmedURL=oArgs.confirmed_url;this.bPerformerInterruptor=!!oArgs.performer_int;this.oIgnoreSpelling={};this.oLogged={};this.oHomeLocation=oArgs.home_location;this.sState=oArgs.state;this.sCompetitionName=oArgs.competition_name;this.bCompetition=!!this.sConfirmedURL;this.referral_user_id=oArgs.referral_user_id;this.oLogLabelValues={start:0,location:1,email:2,domestic:3,international:4,'change-location':5,college:6,signin:7,description:8,join:9};this.oClassLabelValues={onsite:0,offsite:90,performer:0,demand:30,college:60,unknown:0,remembered:10,registered:20};if(this.oUser.className)
{this.oUser.classValue=0;$.each(this.oUser.className.split('-'),function(_,sClass)
{this.oUser.classValue+=this.oClassLabelValues[sClass];}.bind(this));}
this.oStateHandlers={domestic:this.changeStateDomestic.bind(this),international:this.changeStateInternational.bind(this),location:this.changeStateLocation.bind(this),email:this.changeStateEmail.bind(this),signin:this.changeStateSignin.bind(this),description:this.changeStateDescription.bind(this),join:this.changeStateJoin.bind(this),'email-only':this.changeStateEmailOnly.bind(this)};this.oInternationalCityTypeAhead=new Eventful.LocationTypeAhead({id:'city',hide_description:1,default_on_blur:1,exclude:['place_id','region_id','country_id']});this.oInternationalCityTypeAhead.searchParams=function(sQuery)
{var oArgs=Eventful.LocationTypeAhead.prototype.searchParams.call(this.oInternationalCityTypeAhead,sQuery);var nCountryId=parseInt(this.elCountry.val(),10);if(nCountryId){oArgs.country_id=nCountryId;}
return oArgs;}.bind(this);$(this.setup.bind(this));}
Eventful.DemandFlow.prototype.val=function(sExpr)
{return $(sExpr).val();}
Eventful.DemandFlow.prototype.setup=function()
{this.elDemandFlow=$('#demand-flow');this.elCountry=$('#inp-country');this.elUSLocation=$('#inp-uslocation');this.elEmail=$(':input[name=email]');this.elDescription=$('#inp-description');$('#user-panel-facebook').attr('data-goto','no_reload');if(Eventful.oSignin&&Eventful.oSignin.eventEvUserLoggedIn){Eventful.oSignin.eventEvUserLoggedIn.subscribe(this.listenFacebookLogin.bind(this));}
var oValidationHandlers={domestic:this.listenSubmitDomestic.bind(this),international:this.listenSubmitInternational.bind(this),location:this.listenSubmitLocation.bind(this),email:this.listenSubmitEmail.bind(this),signin:this.listenSubmitSignin.bind(this),description:this.listenSubmitDescription.bind(this),join:this.listenSubmitJoin.bind(this),'email-only':this.listenSubmitEmailOnly.bind(this)};this.oValidators={};for(sState in oValidationHandlers)
{var oVal=this.oValidators[sState]=new Eventful.FormVal('#state-'+sState,'#summary-'+sState);oVal.eventJSONValidate.subscribe(this.listenJSONValidate.bind(this));oVal.eventFailValid.subscribe(this.listenValidationComplete.bind(this));oVal.eventPassValid.subscribe(this.listenValidationComplete.bind(this));oVal.eventPassValid.subscribe(oVal.initialize.bind(oVal));oVal.eventPassValid.subscribe(oValidationHandlers[sState]);}
this.oValidators.domestic.addRule('uslocation',{required:1,message:"We really need your zipcode!"});this.oValidators.domestic.addRule('uslocation',{pattern:Eventful.FormVal.GetPattern('number'),minlen:5,maxlen:5,message:"This zipcode doesn't look correct."});this.oValidators.domestic.addRule('uslocation',{jsonCb:function(el)
{return{get:'/json/tools/location/guess',data:{location:el.value,destination_key:'resolved',bubble_up:1},helperCb:this.listenLocationSearchServerResponse.bind(this,'domestic')};}.bind(this)});this.oValidators.international.addRule('country',{message:"What country are you in?",helperCb:function(el)
{if(this.oInternationalCityTypeAhead.item())
{return{};}else if(el.value==="0"||el.value==="")
{return{error:1}}else if(parseInt(el.value,10)==227)
{el.selectedIndex=0;this.changeState('domestic');}else
{return{error:1,message:"Are you sure you don't want to pick a city?\
            If so, <span class=\"fakelink click-use-country\">continue</span>."}}}.bind(this)});this.oValidators.international.eventErrorShown.subscribe(function(elInput,elError)
{$('.click-use-country',elError).mousedown(this.listenClickUseCountry.bind(this));}.bind(this));this.oValidators.email.addRule('email',{required:1,message:"\
      We need your email so we<br />\
      can let you know when your<br />\
      demand has succeeded."});this.oValidators.email.addRule('email',{required:1,pattern:Eventful.FormVal.GetPattern('email'),message:"That email address<br />doesn't look valid.",accept_unavailable:1,jsonCb:function(el)
{return{get:'/json/validate/available_email',data:{value:el.value},helperCb:function(oResponse)
{if(oResponse.errors)
{if(oResponse.errors.available_email.type==='available_email')
{this.changeState('signin');return false;}else if(oResponse.errors.available_email.type==='email')
{return{error:1,message:"That email address doesn't look valid"}}}else if(oResponse.valid.available_email&&oResponse.valid.available_email.typo&&!this.oIgnoreSpelling[oResponse.valid.available_email.value])
{return{error:1,message:'\
                Did you mean <strong>'+oResponse.valid.available_email.typo+'</strong>?\
                <div class="buttons">\
                  <button type="button" class="click-suggestion btn-yes" title="'+oResponse.valid.available_email.typo+'">\
                    <span class="hidden">Yes</span>\
                  </button>\
                  <button type="button" class="click-suggestion btn-no" title="'+oResponse.valid.available_email.value+'">\
                    <span class="hidden">No</span>\
                  </button>\
                </div>'};}}.bind(this)}}.bind(this)});this.oValidators.email.eventErrorShown.subscribe(function(elInput,elError)
{$('.click-suggestion',elError).mousedown(this.listenClickEmailSuggestion.bind(this));}.bind(this));this.oValidators.email.addRule('gender',{required:1,message:"Sorry, we need to know your gender."});this.oValidators.email.addRule('yob',{required:1,message:"Your age actually helps us find a good venue for the event."});this.oValidators.email.addRule('captcha',{required:1,message:"We need this so we know you're not a robot. You're not a robot, are you?"});this.oValidators.email.addRule('captcha',{required:1,minlen:6,maxlen:6,message:"Sorry, that didn't match exactly."});this.oValidators.email.addRule('captcha',{message:"Sorry, that didn't match exactly.",jsonCb:function(el)
{return{get:'/json/validate/captcha',data:{value:el.value,key:this.oCaptcha.key},helperCb:function(oResponse)
{if(!oResponse.valid||oResponse.errors)
{$.get('/json/tools/captcha',{ts:new Date().getTime(),version:2},this.listenGetCaptchaServerResponse.bind(this),'json');return{error:1,message:oResponse.errors.captcha.message?"Sorry, that didn't match exactly. Try another one.":"Oops, you took too long. Try another one."};}}.bind(this)}}.bind(this)});this.oValidators.signin.addRule('username',{required:1,message:"That username is not valid."});this.oValidators.signin.addRule('password',{required:1,message:"That password is not valid.",jsonCb:function()
{return{post:'/json/signin',data:$(':text, :password','#state-signin').serialize(),helperCb:function(oResponse)
{if(oResponse.errors)
{return{error:1,message:oResponse.errors.password.message}}}.bind(this)}}.bind(this)});this.oValidators.join.addRule('username',{required:1,message:"You have to pick a username."});this.oValidators.join.addRule('username',{required:1,minlen:3,message:"Your username is too short."});this.oValidators.join.addRule('username',{required:1,jsonCb:function()
{var sUsername=$('#inp-join-username').val();return{get:'/json/validate/available_username',data:{name:'username',value:sUsername},helperCb:function(oResponse)
{if(oResponse.status!='ok'&&oResponse.errors)
{var sErrorMessage="An unknown error occured.";if(oResponse.errors.username)
{if(oResponse.errors.username.suggested)
{var sList=$.map(oResponse.errors.username.suggested,function(sUsername)
{return'<li class="link-arrow"><span class="fakelink click-suggestion">'+sUsername+'</span></li>';}).join('')
sErrorMessage='That username is not available. Would you like to use one of these? <ul>'+sList+'</ul>';}else
{sErrorMessage=oResponse.errors.username.message;}}
return{error:1,message:sErrorMessage};}}.bind(this)};}.bind(this)});this.oValidators.join.eventErrorShown.subscribe(function(elInput,elError)
{$('.click-suggestion',elError).mousedown(this.listenClickUsernameSuggestion.bind(this));}.bind(this));this.oValidators.join.addRule('password1',{required:1,message:"You have to have a password."});this.oValidators.join.addRule('password1',{required:1,minlen:6,message:"That password is too short. It must be at least 6 characters."});this.oValidators.join.addRule('password2',{required:1,message:"The second password must be the same as the first.",helperCb:function()
{if($('#inp-join-password1').val()!==$('#inp-join-password2').val())
{return{error:1}}}});this.oValidators['email-only'].addRule('email',{required:1,pattern:Eventful.FormVal.GetPattern('email'),message:"That email address<br />doesn't look valid.",jsonCb:function(el)
{return{get:'/json/tools/demands/user/status',data:{email:el.value},helperCb:function(oResponse)
{if(oResponse.status==='unknown')
{this.elEmail.val(el.value);this.changeState(this.initialState());return false;}else if(oResponse.status==='user')
{this.changeState('signin');return false;}else if(oResponse.status==='error')
{return{error:1,message:oResponse.message};}}.bind(this)}}.bind(this)});this.elCountry.change(this.listenSelectCountry.bind(this));$('#cancel-signin').click(this.listenClickCancelSignin.bind(this));$('#skip-description').click(this.listenClickSkipDescription.bind(this));$('#cancel-join').click(this.listenClickCancelJoin.bind(this));$('#click-back').click(this.listenClickBack.bind(this));$('.click-international').click(this.listenClickInternational.bind(this));$('.click-domestic').click(this.listenClickDomestic.bind(this));this.oChangeLocation=new Eventful.PopoverChangeLocation({token:'demand_flow',exclude:['place_id','region_id'],position:{top:15,left:1,relative:$('#click-change-location')}});this.oChangeLocation.clickShow('#click-change-location',true);this.oChangeLocation.eventLocationChanged.subscribe(this.listenLocationChanged.bind(this));this.oPanelCollegePicker=new Eventful.PanelCollegePicker();this.oPanelCollegePicker.eventCollegePicked.subscribe(this.listenCollegePicked.bind(this));$('.click-college-picker').click(this.listenClickCollegePicker.bind(this));this.changeState(this.initialState(this.sState));this.logAction('start');}
Eventful.DemandFlow.prototype.listenFieldToggle=function(sVerb,evt,el)
{$(el).parents('.field-container').find('.tooltip')[sVerb]();}
Eventful.DemandFlow.prototype.logAction=function(sAction,fnContinuance)
{if(!this.oLogged[sAction])
{var nLabel=this.logLabel(sAction);$.get('/json/tools/click/simple',{l:nLabel},fnContinuance);}
this.oLogged[sAction]=1;}
Eventful.DemandFlow.prototype.logLabel=function(sAction)
{return 2089+this.oUser.classValue+this.oLogLabelValues[sAction];}
Eventful.DemandFlow.prototype.initialState=function(sState)
{if(sState in this.oStateHandlers)
{return sState;}else if(/-(registered|remembered)$/.test(this.oUser.className))
{return'location';}else
{if(/-college-/.test(this.oUser.className))
{return'email';}else if(this.oLocation.international)
{return'international';}else
{return'domestic';}}}
Eventful.DemandFlow.prototype.changeState=function(sState)
{if(this.oStateHandlers[sState])
{this.elDemandFlow.attr('class',sState);this.previousState(this.currentState());this.currentState(sState);Eventful.Forms.focusFirstField('#state-'+sState);this.oStateHandlers[sState]();}}
Eventful.DemandFlow.prototype.currentState=function(sState)
{return sState?this.sCurrentState=sState:this.sCurrentState;}
Eventful.DemandFlow.prototype.previousState=function(sState)
{return sState?this.sPreviousState=sState:this.sPreviousState;}
Eventful.DemandFlow.prototype.changeLocation=function(oLocation,bUpdateDemand)
{this.oLocation=oLocation;this.oUserLocation=oLocation.original||oLocation;$('.location-string',this.elDemandFlow).text(this.oLocation.pretty_name);if(bUpdateDemand===undefined||bUpdateDemand)
{delete this.oDemand;if(!this.oUser.registered&&!this.oUser.remembered&&this.currentState()!=='email-only')
{this.changeState('email');}}}
Eventful.DemandFlow.prototype.postLocation=function(oLocation)
{oLocation=oLocation.original||oLocation;$.post('/json/tools/location',{location_type:oLocation.location_type,location_id:oLocation.location_id,input_token:'demand_flow'});}
Eventful.DemandFlow.prototype.joinDemandAndConfirm=function(oArgs)
{if(this.elDemandFlow.hasClass('loading'))return;this.elDemandFlow.addClass('loading');var oDemandParams={consume_captcha:0};$.extend(oDemandParams,oArgs);this.joinDemand(this.listenJoinDemandAndConfirmServerResponse.bind(this,oArgs),oDemandParams);}
Eventful.DemandFlow.prototype.setDescription=function()
{this.elDemandFlow.addClass('loading');this.joinDemand(this.listenSetDescriptionServerResponse.bind(this));}
Eventful.DemandFlow.prototype.joinDemand=function(fnCallback,oVars)
{var oLocation=this.oLocation.original||this.oLocation;$.post('/json/tools/demands/queue/join',$.extend(oVars,{location:[oLocation.location_type,oLocation.location_id].join(':'),spid:this.oPerformer.spid,email:this.oUser.email,username:$('#inp-join-username').val(),password:$('#inp-join-password1').val(),password2:$('#inp-join-password2').val(),email:this.val(this.elEmail),gender:this.val('[name=gender]'),yob:this.val('[name=yob]'),opt_partners:$('#inp-opt_partners').is(':checked')?1:0,postal_code:this.elUSLocation.val()||this.oUserLocation.postal_code,country_id:this.elCountry.val(),user_location:[this.oUserLocation.location_type,this.oUserLocation.location_id].join(':'),captcha:this.oCaptcha?this.val('input.captcha'):'',captcha_key:this.oCaptcha?this.oCaptcha.key:'',mobile1:$('#inp-mobile1').val(),mobile2:$('#inp-mobile2').val(),mobile3:$('#inp-mobile3').val(),carrier:$('#inp-carrier').val(),referral_user_id:this.referral_user_id,skip_captcha:!this.bCompetition,state:this.currentState(),description:this.elDescription.val(),sdid:this.oDemand?this.oDemand.sdid:'',performer_int:this.bPerformerInterruptor?1:0,is_competition:this.bCompetition?1:0,competition_name:this.sCompetitionName}),fnCallback,'json');}
Eventful.DemandFlow.prototype.trackConfirmed=function(oResponse){var sArgs=(oResponse?"status="+oResponse.status+"&":"")+"user="+(/unknown$/.test(this.oUser.className)?'unknown':'known')+'&spid='+this.oPerformer.spid;var oLocation=this.oLocation.original||this.oLocation;if(oLocation){var sLocation=[oLocation.location_type,oLocation.location_id].join(':');sArgs+='&location='+sLocation;}
if(this.bPerformerInterruptor)
{sArgs+='&performer_int=1';}
this.elDemandFlow.addClass('loading');Eventful.TrackPageview({page:'/demand_success',query:'?'+sArgs});this.gotoConfirmed.bind(this,sArgs).later(200);}
Eventful.DemandFlow.prototype.gotoConfirmed=function(sArgs)
{sArgs+=this.oUser.registered?'&initial=registered':this.oUser.remembered?'&initial=remembered':'&initial=unknown';if(this.sConfirmedURL&&this.sCompetitionName!='ryanrockmytown2009')
{if(this.sConfirmedURL.match(/\/competitions\/hometownhero2011\/confirmed/)){var sPerformerSPID=this.oPerformer.spid;if(this.sConfirmedURL.match(/\?/)){this.sConfirmedURL=this.sConfirmedURL+"&spid="+sPerformerSPID;}else{this.sConfirmedURL=this.sConfirmedURL+"?spid="+sPerformerSPID;}}
window.location=this.sConfirmedURL;}else if(this.oDemand)
{if(!this.oDemand.permalink)
{this.oDemand.permalink="/demand/"+this.oDemand.sdid;}
if(this.sConfirmedURL){sArgs+='&goto='+this.sConfirmedURL;}
window.location=this.oDemand.permalink+"/offer?"+sArgs;}else
{if(!this.oPerformer.permalink)
{this.oPerformer.permalink="/performers/"+this.oPerformer.spid;}
window.location=this.oPerformer.permalink+"/demand/offer?"+sArgs;}}
Eventful.DemandFlow.prototype.getInternationalLocation=function()
{var oLocation=this.oInternationalCityTypeAhead.item();if(oLocation)return oLocation;var nCountryId=parseInt(this.elCountry.val(),10);if(nCountryId)
{return{pretty_name:$(':selected',this.elCountry).text(),location_type:'country_id',location_id:nCountryId};}}
Eventful.DemandFlow.prototype.changeStateDomestic=function()
{Eventful.TrackPageview({query:'?df_state=demand_start_unknown'});}
Eventful.DemandFlow.prototype.changeStateInternational=function()
{Eventful.TrackPageview({query:'?df_state=demand_start_unknown_int'});}
Eventful.DemandFlow.prototype.changeStateLocation=function()
{if(this.oLocation.pretty_name=='Worldwide')
{$('#change-location-field-container').show();this.oChangeLocation.show();}
Eventful.TrackPageview({query:'?df_state=demand_start_known'});}
Eventful.DemandFlow.prototype.changeStateEmail=function()
{if(this.oLocation.pretty_name=='Worlwide')
{this.changeState('location');}
if(parseInt($('#inp-country').val())==226){$('#mobile-field-container').removeClass('hidden');}
if(typeof window.pageTracker!=='undefined')
{pageTracker._setVar("unknown");}
$('#disclaimer').show();if(/(demand|college)-unknown$/.test(this.oUser.className))
{Eventful.TrackPageview({query:'?df_state=join_start_unknown'});}else
{Eventful.TrackPageview({query:'?df_state=demand_info'});}
var sSrc=$('#rev-gen-iframe-10114').attr('src');$('#rev-gen-iframe-10114').attr({src:sSrc});}
Eventful.DemandFlow.prototype.changeStateSignin=function()
{$('#txt-email').text(this.val(this.elEmail));}
Eventful.DemandFlow.prototype.changeStateDescription=function()
{if(this.oUser.registered)
{$('#state-description').removeClass('logged-out').addClass('logged-in');}else
{$('#state-description').removeClass('logged-in').addClass('logged-out');}}
Eventful.DemandFlow.prototype.changeStateJoin=function()
{}
Eventful.DemandFlow.prototype.changeStateEmailOnly=function()
{}
Eventful.DemandFlow.prototype.listenClickCancelSignin=function()
{this.changeState(this.previousState());}
Eventful.DemandFlow.prototype.listenClickSkipDescription=function()
{this.trackConfirmed();}
Eventful.DemandFlow.prototype.listenClickCancelJoin=function()
{this.changeState('description');}
Eventful.DemandFlow.prototype.listenClickInternational=function()
{this.changeState('international');}
Eventful.DemandFlow.prototype.listenClickDomestic=function()
{this.changeState('domestic');}
Eventful.DemandFlow.prototype.listenClickUseCountry=function()
{var oLocation=this.getInternationalLocation();if(oLocation)
{this.oValidators.international.hideHasError();this.oValidators.international.hideSummaryError();this.postLocation(oLocation);this.changeLocation(oLocation);}}
Eventful.DemandFlow.prototype.listenClickUsernameSuggestion=function(evt,el)
{var sUsername=$(el).text();$('#inp-join-username').val(sUsername);this.oValidators.join.hideHasError();this.oValidators.join.hideSummaryError();}
Eventful.DemandFlow.prototype.listenClickEmailSuggestion=function(evt,el)
{var sEmail=el.title;this.elEmail.val(sEmail);this.oValidators.email.hideHasError();this.oValidators.email.hideSummaryError();this.oIgnoreSpelling[sEmail]=sEmail;}
Eventful.DemandFlow.prototype.listenClickCollegePicker=function()
{this.oPanelCollegePicker.show(this.oLocation);}
Eventful.DemandFlow.prototype.listenClickBack=function()
{this.changeState('location');if(this.oLocation.location_type=='venue_id')
{this.oPanelCollegePicker.show(this.oLocation);}else
{$('#change-location-field-container').show();var changeLocation=this;$('#click-change-location').trigger('click');$('#inp-location-search').focus(function(evt){$('#inp-location-search').select();e=jQuery.Event("keypress");e.which=48;$("#inp-location-search").trigger(e);});$('#inp-location-search').trigger('keypress');}}
Eventful.DemandFlow.prototype.listenSelectCountry=function()
{if(parseInt(this.elCountry.val(),10)==227)
{this.elCountry.prop('selectedIndex',0);this.changeState('domestic');}}
Eventful.DemandFlow.prototype.listenLocationChanged=function(oArgs)
{this.logAction('change-location');Eventful.Autoclose.close_block();if(oArgs.response&&oArgs.locale)
{this.elDemandFlow.addClass('loading');var oLocation=oArgs.locale;$.get('/json/tools/location/lookup',{location_type:oLocation.location_type,location_id:oLocation.location_id,bubble_up:1},this.listenBubbleUpServerResponse.bind(this),'json');}}
Eventful.DemandFlow.prototype.listenCollegePicked=function(oCollege)
{var oLocation={pretty_name:oCollege.name,location_type:'venue_id',location_id:oCollege.svid};this.logAction('college');this.postLocation(oLocation);this.changeLocation(oLocation);}
Eventful.DemandFlow.prototype.listenBubbleUpServerResponse=function(oResponse)
{this.elDemandFlow.removeClass('loading');if(oResponse.location)
{this.changeLocation(oResponse.location);}}
Eventful.DemandFlow.prototype.listenLocationSearchServerResponse=function(sState,oResponse)
{this.elDemandFlow.removeClass('loading');var oResolved=oResponse.resolved;var sErrorMessage="We couldn't find that location. Try another one?";if(sState=='domestic')
{if(oResolved&&oResolved.location_type!='postal_code_id'&&(!oResolved.original||oResolved.original.location_type!='postal_code_id'))
{oResolved=null;sErrorMessage="We really need your zipcode!";}}
if(oResolved)
{this.postLocation(oResolved);this.changeLocation(oResolved);}else
{return{error:1,message:sErrorMessage};}}
Eventful.DemandFlow.prototype.listenGetCaptchaServerResponse=function(oResponse)
{if(oResponse.captcha)
{this.oCaptcha=oResponse.captcha;$('input.captcha').val('');$('.input-captcha')
.css({backgroundImage:'url('+this.oCaptcha.url+')'});}}
Eventful.DemandFlow.prototype.listenJoinDemandAndConfirmServerResponse=function(oArgs,oResponse)
{oArgs=oArgs||{};var fnContinuance=function()
{this.elDemandFlow.addClass('loading');if(oResponse.demand_created)
{this.changeState('description');}else
{this.trackConfirmed(oResponse);}}.bind(this);if(oResponse.demand)
{this.oDemand=oResponse.demand;}
if(!(/^(fraud|dupe)$/).test(oResponse.status)&&oArgs.logAction)
{this.logAction(oArgs.logAction,fnContinuance);}else
{fnContinuance();}}
Eventful.DemandFlow.prototype.listenSetDescriptionServerResponse=function()
{this.logAction('description');this.trackConfirmed();}
Eventful.DemandFlow.prototype.listenSubmitDomestic=function(evt)
{this.logAction('domestic');this.changeState('email');}
Eventful.DemandFlow.prototype.listenSubmitInternational=function(evt)
{this.logAction('international');var oLocation=this.getInternationalLocation();if(oLocation){this.postLocation(oLocation);this.changeLocation(oLocation);}}
Eventful.DemandFlow.prototype.listenSubmitLocation=function()
{if(this.oLocation.pretty_name=='Worldwide')
{$('#change-location-field-container').show();this.oChangeLocation.oValidator.showHasError($('[name=location-search]'));this.oChangeLocation.show();return;}
if(this.elDemandFlow.hasClass('loading'))return;this.logAction('location');if(this.oUser.registered||this.oUser.remembered)
{this.joinDemandAndConfirm();}else
{this.changeState('email');}}
Eventful.DemandFlow.prototype.listenSubmitEmail=function()
{this.joinDemandAndConfirm({logAction:'email'});}
Eventful.DemandFlow.prototype.listenSubmitSignin=function()
{this.oUser.registered=1;this.joinDemandAndConfirm({logAction:'signin'});}
Eventful.DemandFlow.prototype.listenSubmitDescription=function()
{if(this.oUser.registered)
{if(this.elDescription.val())
{this.logAction('description');this.setDescription();}else
{this.trackConfirmed();}}else
{this.changeState('join');}}
Eventful.DemandFlow.prototype.listenSubmitJoin=function()
{this.logAction('join');this.setDescription();}
Eventful.DemandFlow.prototype.listenSubmitEmailOnly=function()
{if(this.oLocation.pretty_name==='Worldwide')
{$('#change-location-field-container').show();this.oChangeLocation.oValidator.showHasError($('[name=location-search]'));this.oChangeLocation.show();this.changeState('location');return;}
this.joinDemandAndConfirm();}
Eventful.DemandFlow.prototype.listenJSONValidate=function()
{this.elDemandFlow.addClass('loading');}
Eventful.DemandFlow.prototype.listenValidationComplete=function()
{this.elDemandFlow.removeClass('loading');}
Eventful.DemandFlow.prototype.listenFacebookLogin=function(oResponse){var state=this.currentState();var bUserCreated=oResponse&&oResponse.message==="New User has been created and logged in";var oParams={user_created:bUserCreated?1:0};if(state=='international'||state=='email'){var oLocation=this.getInternationalLocation();if(oLocation){this.oLocation=oLocation;this.joinDemandAndConfirm(oParams);return;}}
if(state=='email'&&(this.elUSLocation.val()||this.oLocation.location_type=='venue_id')){this.joinDemandAndConfirm(oParams);return;}
$.getJSON('/json/tools/location',function(oResponse){this.oLocation=oResponse.home;this.joinDemandAndConfirm(oParams);}.bind(this));}
if(/(bg|fg|from_sticker)/.test(window.location.search))
{Eventful.TrackPageview.setParams({utm_source:'widgets',utm_medium:'widgets',utm_campaign:'demand_widget'});}
