var Hoptoad={VERSION:"0.1.0",NOTICE_XML:'<?xml version="1.0" encoding="UTF-8"?><notice version="2.0"><api-key></api-key><notifier><name>hoptoad_notifier_js</name><version>0.1.0</version><url>http://hoptoadapp.com</url></notifier><error><class>EXCEPTION_CLASS</class><message>EXCEPTION_MESSAGE</message><backtrace>BACKTRACE_LINES</backtrace></error><request><url>REQUEST_URL</url><component>REQUEST_COMPONENT</component><action>REQUEST_ACTION</action></request><server-environment><project-root>PROJECT_ROOT</project-root><environment-name>production</environment-name></server-environment></notice>',ROOT:window.location.protocol+"//"+window.location.host,BACKTRACE_MATCHER:/^(.*)\@(.*)\:(\d+)$/,backtrace_filters:[/notifier\.js/],notify:function(h){if(!Hoptoad.enabled){return
}try{var e=escape(Hoptoad.generateXML(h));
var j=[/api\.twitter\.com/i,/api-read\.facebook\.com/i,/chrome\.tabs is not supported in content scripts/i,/\.cloudfront\.net/i,/connect\.facebook\.net/i,/error calling method on npobject/i,/jquery is not defined/i,/jquery\.tweet\.js/i,/list-manage1\.com/i,/non-native scope object/i,/notificationsrestartpolling/i,/nsloginmanager/i,/platform\.twitter\.com/i,/srchdetectlb\.predictad\.com/i,/static\.ak\.fbcdn\.net/i,/tinymce\/plugins\/media\/editor_plugin\.js/i,/toolbar\.xul/i,/wp-includes\/js\/jquery\/jquery\.js\?ver=1\.4\.2/i,/www\.google-analytics\.com\/ga\.js/i,/yontoo\.com/i];
var g=false;
for(var d=0;
d<j.length;
d++){g=g||(e.match(j[d])!==null)
}if(g){return
}var k=Hoptoad.host||"hoptoadapp.com";
var a="//"+k+"/notifier_api/v2/notices?data="+e;
var c=document.createElement("iframe");
c.style.width="1px";
c.style.height="1px";
c.style.display="none";
c.src=a;
document.getElementsByTagName("head")[0].appendChild(c)
}catch(f){var b=f.toString();
var j=[/object.*event.*has no method .replace./i,/replace is not a function/i];
var g=false;
for(var d=0;
d<j.length;
d++){g=g||(b.match(j[d])!==null)
}if(!g){throw f
}}},setEnabled:function(a){Hoptoad.enabled=a
},setEnvironment:function(a){var b=/<environment-name>.*<\/environment-name>/;
Hoptoad.NOTICE_XML=Hoptoad.NOTICE_XML.replace(b,"<environment-name>"+a+"</environment-name>")
},setHost:function(a){Hoptoad.host=a
},setKey:function(a){var b=/<api-key>.*<\/api-key>/;
Hoptoad.NOTICE_XML=Hoptoad.NOTICE_XML.replace(b,"<api-key>"+a+"</api-key>")
},setErrorDefaults:function(a){Hoptoad.errorDefaults=a
},generateXML:function(k){var m=Hoptoad.mergeDefault(Hoptoad.errorDefaults,k);
var g=Hoptoad.NOTICE_XML;
var j=m.url||"";
var f=location.hash||"";
var a=Hoptoad.escapeText(j||"");
var n=Hoptoad.escapeText(m.component||"");
var c=Hoptoad.escapeText(m.action||"");
var l=Hoptoad.escapeText(m.type||"Error");
var p=Hoptoad.escapeText(m.message||"Unknown error.");
var o=Hoptoad.generateBacktrace(m);
if(Hoptoad.trim(a)==""&&Hoptoad.trim(n)==""){g=g.replace(/<request>.*<\/request>/,"")
}else{var e="";
var h=m["cgi-data"]||{};
h.HTTP_USER_AGENT=navigator.userAgent;
e+="<cgi-data>";
e+=Hoptoad.generateVariables(h);
e+="</cgi-data>";
var b=["params","session"];
for(var d=0;
d<2;
d++){var l=b[d];
if(m[l]){e+="<"+l+">";
e+=Hoptoad.generateVariables(m[l]);
e+="</"+l+">"
}}g=g.replace("</request>",e+"</request>").replace("REQUEST_URL",a).replace("REQUEST_ACTION",c).replace("REQUEST_COMPONENT",n)
}return g.replace("PROJECT_ROOT",Hoptoad.ROOT).replace("EXCEPTION_CLASS",l).replace("EXCEPTION_MESSAGE",p).replace("BACKTRACE_LINES",o.join(""))
},generateBacktrace:function(g){g=g||{};
if(typeof g.stack!="string"){try{(0)()
}catch(f){g.stack=f.stack
}}var j=[];
var h=Hoptoad.getStackTrace(g);
for(var c=0,b=h.length;
c<b;
c++){var k=h[c];
var d=k.match(Hoptoad.BACKTRACE_MATCHER);
if(d&&Hoptoad.validBacktraceLine(k)){var a=d[2].replace(Hoptoad.ROOT,"[PROJECT_ROOT]");
if(c==0){if(d[2].match(document.location.href)){j.push('<line method="" file="internal: " number=""/>')
}}j.push('<line method="'+Hoptoad.escapeText(d[1])+'" file="'+Hoptoad.escapeText(a)+'" number="'+d[3]+'" />')
}}return j
},getStackTrace:function(b){var d=printStackTrace({e:b,guess:false});
for(var c=0,a=d.length;
c<a;
c++){if(d[c].match(/\:\d+$/)){continue
}if(d[c].indexOf("@")==-1){d[c]+="@unsupported.js"
}d[c]+=":0"
}return d
},validBacktraceLine:function(a){for(var b=0;
b<Hoptoad.backtrace_filters.length;
b++){if(a.match(Hoptoad.backtrace_filters[b])){return false
}}return true
},generateVariables:function(c){var b;
var a="";
for(b in c){a+='<var key="'+Hoptoad.escapeText(b)+'">'+Hoptoad.escapeText(c[b])+"</var>"
}return a
},escapeText:function(a){return a.replace(/&/g,"&#38;").replace(/</g,"&#60;").replace(/>/g,"&#62;").replace(/'/g,"&#39;").replace(/"/g,"&#34;")
},trim:function(a){return a.toString().replace(/^\s+/,"").replace(/\s+$/,"")
},mergeDefault:function(d,c){var a={};
var b;
for(b in c){a[b]=c[b]
}for(b in d){if(!a.hasOwnProperty(b)){a[b]=d[b]
}}return a
}};
function printStackTrace(e){var e=e||{guess:!0},d=e.e||null,e=!!e.guess,f=new printStackTrace.implementation,d=f.run(d);
return e?f.guessFunctions(d):d
}printStackTrace.implementation=function(){};
printStackTrace.implementation.prototype={run:function(d){var d=d||this.createException(),c=this.mode(d);
return c==="other"?this.other(arguments.callee):this[c](d)
},createException:function(){try{return this.undef(),null
}catch(b){return b
}},mode:function(b){if(b.arguments&&b.stack){return this._mode="chrome"
}else{if(typeof window!=="undefined"&&window.opera){return this._mode=b.stacktrace?"opera10":"opera"
}else{if(b.stack){return this._mode="firefox"
}}}return this._mode="other"
},instrumentFunction:function(e,d,f){e=e||window;
e["_old"+d]=e[d];
e[d]=function(){f.call(this,printStackTrace());
return e["_old"+d].apply(this,arguments)
};
e[d]._instrumented=!0
},deinstrumentFunction:function(d,c){d[c].constructor===Function&&d[c]._instrumented&&d["_old"+c].constructor===Function&&(d[c]=d["_old"+c])
},chrome:function(b){return b.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@").split("\n")
},firefox:function(b){return b.stack.replace(/(?:\n@:0)?\s+$/m,"").replace(/^\(/gm,"{anonymous}(").split("\n")
},opera10:function(i){var i=i.stacktrace.split("\n"),h=/.*line (\d+), column (\d+) in ((<anonymous function\:?\s*(\S+))|([^\(]+)\([^\)]*\))(?: in )?(.*)\s*$/i,n,m,l;
n=2;
m=0;
for(l=i.length;
n<l-2;
n++){if(h.test(i[n])){var j=RegExp.$6+":"+RegExp.$1+":"+RegExp.$2,k=RegExp.$3,k=k.replace(/<anonymous function\:?\s?(\S+)?>/g,"{anonymous}");
i[m++]=k+"@"+j
}}i.splice(m,i.length-m);
return i
},opera:function(g){var g=g.message.split("\n"),f=/Line\s+(\d+).*script\s+(http\S+)(?:.*in\s+function\s+(\S+))?/i,j,i,h;
j=4;
i=0;
for(h=g.length;
j<h;
j+=2){f.test(g[j])&&(g[i++]=(RegExp.$3?RegExp.$3+"()@"+RegExp.$2+RegExp.$1:"{anonymous}()@"+RegExp.$2+":"+RegExp.$1)+" -- "+g[j+1].replace(/^\s+/,""))
}g.splice(i,g.length-i);
return g
},other:function(g){for(var f=/function\s*([\w\-$]+)?\s*\(/i,j=[],i,h;
g&&j.length<10;
){i=f.test(g.toString())?RegExp.$1||"{anonymous}":"{anonymous}",h=Array.prototype.slice.call(g.arguments||[]),j[j.length]=i+"("+this.stringifyArguments(h)+")",g=g.caller
}return j
},stringifyArguments:function(e){for(var d=0;
d<e.length;
++d){var f=e[d];
f===void 0?e[d]="undefined":f===null?e[d]="null":f.constructor&&(f.constructor===Array?e[d]=f.length<3?"["+this.stringifyArguments(f)+"]":"["+this.stringifyArguments(Array.prototype.slice.call(f,0,1))+"..."+this.stringifyArguments(Array.prototype.slice.call(f,-1))+"]":f.constructor===Object?e[d]="#object":f.constructor===Function?e[d]="#function":f.constructor===String&&(e[d]='"'+f+'"'))
}return e.join(",")
},sourceCache:{},ajax:function(d){var c=this.createXMLHTTPObject();
if(c){return c.open("GET",d,!1),c.setRequestHeader("User-Agent","XMLHTTP/1.0"),c.send(""),c.responseText
}},createXMLHTTPObject:function(){for(var f,e=[function(){return new XMLHttpRequest
},function(){return new ActiveXObject("Msxml2.XMLHTTP")
},function(){return new ActiveXObject("Msxml3.XMLHTTP")
},function(){return new ActiveXObject("Microsoft.XMLHTTP")
}],h=0;
h<e.length;
h++){try{return f=e[h](),this.createXMLHTTPObject=e[h],f
}catch(g){}}},isSameDomain:function(b){return b.indexOf(location.hostname)!==-1
},getSource:function(b){b in this.sourceCache||(this.sourceCache[b]=this.ajax(b).split("\n"));
return this.sourceCache[b]
},guessFunctions:function(g){for(var f=0;
f<g.length;
++f){var j=g[f],i=/\{anonymous\}\(.*\)@(\w+:\/\/([\-\w\.]+)+(:\d+)?[^:]+):(\d+):?(\d+)?/.exec(j);
if(i){var h=i[1],i=i[4];
h&&this.isSameDomain(h)&&i&&(h=this.guessFunctionName(h,i),g[f]=j.replace("{anonymous}",h))
}}return g
},guessFunctionName:function(f,e){var h;
try{h=this.guessFunctionNameFromLines(e,this.getSource(f))
}catch(g){h="getSource failed with url: "+f+", exception: "+g.toString()
}return h
},guessFunctionNameFromLines:function(i,h){for(var n=/function ([^(]*)\(([^)]*)\)/,m=/['"]?([0-9A-Za-z_]+)['"]?\s*[:=]\s*(function|eval|new Function)/,l="",j=0;
j<10;
++j){if(l=h[i-j]+l,l!==void 0){var k=m.exec(l);
if(k&&k[1]){return k[1]
}else{if((k=n.exec(l))&&k[1]){return k[1]
}}}}return"(?)"
}};
window.onerror=function(c,b,a){setTimeout(function(){Hoptoad.notify({message:c,stack:"()@"+b+":"+a,url:window.location.href})
},100);
return true
};
Hoptoad.setKey('569b438d8d33395822536a1ae3c4b97d');
Hoptoad.setEnvironment('production');
Hoptoad.setEnabled(false);jQuery.addObject=function(b,a){jQuery.fn[b]=function(d){var c=this.data(b);
if(typeof d=="string"){var f=c[d];
if(typeof f=="function"){var e=f.apply(c,Array.prototype.slice.call(arguments,1));
return(e==c)?this:e
}if(arguments.length==1){return f
}c[d]=arguments[1];
return this
}if(c){return c
}this.data(b,new a(this,d));
return this
}
};jQuery.cookie=function(d,e,b){if(arguments.length>1&&(e===null||typeof e!=="object")){b=jQuery.extend({},b);
if(e===null){b.expires=-1
}if(typeof b.expires==="number"){var g=b.expires,c=b.expires=new Date();
c.setDate(c.getDate()+g)
}return(document.cookie=[encodeURIComponent(d),"=",b.raw?String(e):encodeURIComponent(String(e)),b.expires?"; expires="+b.expires.toUTCString():"",b.path?"; path="+b.path:"",b.domain?"; domain="+b.domain:"",b.secure?"; secure":""].join(""))
}b=e||{};
var a,f=b.raw?function(h){return h
}:decodeURIComponent;
return(a=new RegExp("(?:^|; )"+encodeURIComponent(d)+"=([^;]*)").exec(document.cookie))?f(a[1]):null
};(function(b){b.fn.ajaxSubmit=function(s){if(!this.length){a("ajaxSubmit: skipping submit process - no element selected");
return this
}if(typeof s=="function"){s={success:s}
}var d=b.trim(this.attr("action"));
if(d){d=(d.match(/^([^#]+)/)||[])[1]
}d=d||window.location.href||"";
s=b.extend(true,{url:d,type:this.attr("method")||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},s);
var t={};
this.trigger("form-pre-serialize",[this,s,t]);
if(t.veto){a("ajaxSubmit: submit vetoed via form-pre-serialize trigger");
return this
}if(s.beforeSerialize&&s.beforeSerialize(this,s)===false){a("ajaxSubmit: submit aborted via beforeSerialize callback");
return this
}var f,o,l=this.formToArray(s.semantic);
if(s.data){s.extraData=s.data;
for(f in s.data){if(s.data[f] instanceof Array){for(var h in s.data[f]){l.push({name:f,value:s.data[f][h]})
}}else{o=s.data[f];
o=b.isFunction(o)?o():o;
l.push({name:f,value:o})
}}}if(s.beforeSubmit&&s.beforeSubmit(l,this,s)===false){a("ajaxSubmit: submit aborted via beforeSubmit callback");
return this
}this.trigger("form-submit-validate",[l,this,s,t]);
if(t.veto){a("ajaxSubmit: submit vetoed via form-submit-validate trigger");
return this
}var c=b.param(l);
if(s.type.toUpperCase()=="GET"){s.url+=(s.url.indexOf("?")>=0?"&":"?")+c;
s.data=null
}else{s.data=c
}var r=this,j=[];
if(s.resetForm){j.push(function(){r.resetForm()
})
}if(s.clearForm){j.push(function(){r.clearForm()
})
}if(!s.dataType&&s.target){var p=s.success||function(){};
j.push(function(n){var k=s.replaceTarget?"replaceWith":"html";
b(s.target)[k](n).each(p,arguments)
})
}else{if(s.success){j.push(s.success)
}}s.success=function(v,n,w){var u=s.context||s;
for(var q=0,k=j.length;
q<k;
q++){j[q].apply(u,[v,n,w||r,r])
}};
var g=b("input:file",this).length>0;
var e="multipart/form-data";
var i=(r.attr("enctype")==e||r.attr("encoding")==e);
if(s.iframe!==false&&(g||s.iframe||i)){if(s.closeKeepAlive){b.get(s.closeKeepAlive,m)
}else{m()
}}else{b.ajax(s)
}this.trigger("form-submit-notify",[this,s]);
return this;
function m(){var k=r[0];
if(b(":input[name=submit],:input[id=submit]",k).length){alert('Error: Form elements must not have name or id of "submit".');
return
}var y=b.extend(true,{},b.ajaxSettings,s);
y.context=y.context||y;
var B="jqFormIO"+(new Date().getTime()),w="_"+B;
window[w]=function(){var n=q.data("form-plugin-onload");
if(n){n();
window[w]=undefined;
try{delete window[w]
}catch(K){}}};
var q=b('<iframe id="'+B+'" name="'+B+'" src="'+y.iframeSrc+'" onload="window[\'_\'+this.id]()" />');
var x=q[0];
q.css({position:"absolute",top:"-1000px",left:"-1000px"});
var u={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){this.aborted=1;
q.attr("src",y.iframeSrc)
}};
var G=y.global;
if(G&&!b.active++){b.event.trigger("ajaxStart")
}if(G){b.event.trigger("ajaxSend",[u,y])
}if(y.beforeSend&&y.beforeSend.call(y.context,u,y)===false){if(y.global){b.active--
}return
}if(u.aborted){return
}var C=false;
var F=0;
var v=k.clk;
if(v){var D=v.name;
if(D&&!v.disabled){y.extraData=y.extraData||{};
y.extraData[D]=v.value;
if(v.type=="image"){y.extraData[D+".x"]=k.clk_x;
y.extraData[D+".y"]=k.clk_y
}}}function E(){var M=r.attr("target"),K=r.attr("action");
k.setAttribute("target",B);
if(k.getAttribute("method")!="POST"){k.setAttribute("method","POST")
}if(k.getAttribute("action")!=y.url){k.setAttribute("action",y.url)
}if(!y.skipEncodingOverride){r.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"})
}if(y.timeout){setTimeout(function(){F=true;
A()
},y.timeout)
}var L=[];
try{if(y.extraData){for(var N in y.extraData){L.push(b('<input type="hidden" name="'+N+'" value="'+y.extraData[N]+'" />').appendTo(k)[0])
}}q.appendTo("body");
q.data("form-plugin-onload",A);
k.submit()
}finally{k.setAttribute("action",K);
if(M){k.setAttribute("target",M)
}else{r.removeAttr("target")
}b(L).remove()
}}if(y.forceSync){E()
}else{setTimeout(E,10)
}var I,J,H=50;
function A(){if(C){return
}q.removeData("form-plugin-onload");
var K=true;
try{if(F){throw"timeout"
}J=x.contentWindow?x.contentWindow.document:x.contentDocument?x.contentDocument:x.document;
var O=y.dataType=="xml"||J.XMLDocument||b.isXMLDoc(J);
a("isXml="+O);
if(!O&&window.opera&&(J.body==null||J.body.innerHTML=="")){if(--H){a("requeing onLoad callback, DOM not available");
setTimeout(A,250);
return
}}C=true;
u.responseText=J.documentElement?J.documentElement.innerHTML:null;
u.responseXML=J.XMLDocument?J.XMLDocument:J;
u.getResponseHeader=function(Q){var P={"content-type":y.dataType};
return P[Q]
};
var N=/(json|script)/.test(y.dataType);
if(N||y.textarea){var n=J.getElementsByTagName("textarea")[0];
if(n){u.responseText=n.value
}else{if(N){var M=J.getElementsByTagName("pre")[0];
if(M){u.responseText=M.innerHTML
}}}}else{if(y.dataType=="xml"&&!u.responseXML&&u.responseText!=null){u.responseXML=z(u.responseText)
}}I=b.httpData(u,y.dataType)
}catch(L){a("error caught:",L);
K=false;
u.error=L;
b.handleError(y,u,"error",L)
}if(K){y.success.call(y.context,I,"success",u);
if(G){b.event.trigger("ajaxSuccess",[u,y])
}}if(G){b.event.trigger("ajaxComplete",[u,y])
}if(G&&!--b.active){b.event.trigger("ajaxStop")
}if(y.complete){y.complete.call(y.context,u,K?"success":"error")
}setTimeout(function(){q.removeData("form-plugin-onload");
q.remove();
u.responseXML=null
},100)
}function z(n,K){if(window.ActiveXObject){K=new ActiveXObject("Microsoft.XMLDOM");
K.async="false";
K.loadXML(n)
}else{K=(new DOMParser()).parseFromString(n,"text/xml")
}return(K&&K.documentElement&&K.documentElement.tagName!="parsererror")?K:null
}}};
b.fn.ajaxForm=function(c){if(this.length===0){var d={s:this.selector,c:this.context};
if(!b.isReady&&d.s){a("DOM not ready, queuing ajaxForm");
b(function(){b(d.s,d.c).ajaxForm(c)
});
return this
}a("terminating; zero elements found by selector"+(b.isReady?"":" (DOM not ready)"));
return this
}return this.ajaxFormUnbind().bind("submit.form-plugin",function(f){if(!f.isDefaultPrevented()){f.preventDefault();
b(this).ajaxSubmit(c)
}}).bind("click.form-plugin",function(j){var i=j.target;
var g=b(i);
if(!(g.is(":submit,input:image"))){var f=g.closest(":submit");
if(f.length==0){return
}i=f[0]
}var h=this;
h.clk=i;
if(i.type=="image"){if(j.offsetX!=undefined){h.clk_x=j.offsetX;
h.clk_y=j.offsetY
}else{if(typeof b.fn.offset=="function"){var k=g.offset();
h.clk_x=j.pageX-k.left;
h.clk_y=j.pageY-k.top
}else{h.clk_x=j.pageX-i.offsetLeft;
h.clk_y=j.pageY-i.offsetTop
}}}setTimeout(function(){h.clk=h.clk_x=h.clk_y=null
},100)
})
};
b.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")
};
b.fn.formToArray=function(o){var m=[];
if(this.length===0){return m
}var c=this[0];
var f=o?c.getElementsByTagName("*"):c.elements;
if(!f){return m
}var h,g,e,p,d;
for(h=0,max=f.length;
h<max;
h++){d=f[h];
e=d.name;
if(!e){continue
}if(o&&c.clk&&d.type=="image"){if(!d.disabled&&c.clk==d){m.push({name:e,value:b(d).val()});
m.push({name:e+".x",value:c.clk_x},{name:e+".y",value:c.clk_y})
}continue
}p=b.fieldValue(d,true);
if(p&&p.constructor==Array){for(g=0,jmax=p.length;
g<jmax;
g++){m.push({name:e,value:p[g]})
}}else{if(p!==null&&typeof p!="undefined"){m.push({name:e,value:p})
}}}if(!o&&c.clk){var k=b(c.clk),l=k[0];
e=l.name;
if(e&&!l.disabled&&l.type=="image"){m.push({name:e,value:k.val()});
m.push({name:e+".x",value:c.clk_x},{name:e+".y",value:c.clk_y})
}}return m
};
b.fn.formSerialize=function(c){return b.param(this.formToArray(c))
};
b.fn.fieldSerialize=function(d){var c=[];
this.each(function(){var h=this.name;
if(!h){return
}var f=b.fieldValue(this,d);
if(f&&f.constructor==Array){for(var g=0,e=f.length;
g<e;
g++){c.push({name:h,value:f[g]})
}}else{if(f!==null&&typeof f!="undefined"){c.push({name:this.name,value:f})
}}});
return b.param(c)
};
b.fn.fieldValue=function(h){for(var g=[],e=0,c=this.length;
e<c;
e++){var f=this[e];
var d=b.fieldValue(f,h);
if(d===null||typeof d=="undefined"||(d.constructor==Array&&!d.length)){continue
}d.constructor==Array?b.merge(g,d):g.push(d)
}return g
};
b.fieldValue=function(c,j){var e=c.name,p=c.type,q=c.tagName.toLowerCase();
if(j===undefined){j=true
}if(j&&(!e||c.disabled||p=="reset"||p=="button"||(p=="checkbox"||p=="radio")&&!c.checked||(p=="submit"||p=="image")&&c.form&&c.form.clk!=c||q=="select"&&c.selectedIndex==-1)){return null
}if(q=="select"){var k=c.selectedIndex;
if(k<0){return null
}var m=[],d=c.options;
var g=(p=="select-one");
var l=(g?k+1:d.length);
for(var f=(g?k:0);
f<l;
f++){var h=d[f];
if(h.selected){var o=h.value;
if(!o){o=(h.attributes&&h.attributes.value&&!(h.attributes.value.specified))?h.text:h.value
}if(g){return o
}m.push(o)
}}return m
}return b(c).val()
};
b.fn.clearForm=function(){return this.each(function(){b("input,select,textarea",this).clearFields()
})
};
b.fn.clearFields=b.fn.clearInputs=function(){return this.each(function(){var d=this.type,c=this.tagName.toLowerCase();
if(d=="text"||d=="password"||c=="textarea"){this.value=""
}else{if(d=="checkbox"||d=="radio"){this.checked=false
}else{if(c=="select"){this.selectedIndex=-1
}}}})
};
b.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()
}})
};
b.fn.enable=function(c){if(c===undefined){c=true
}return this.each(function(){this.disabled=!c
})
};
b.fn.selected=function(c){if(c===undefined){c=true
}return this.each(function(){var d=this.type;
if(d=="checkbox"||d=="radio"){this.checked=c
}else{if(this.tagName.toLowerCase()=="option"){var e=b(this).parent("select");
if(c&&e[0]&&e[0].type=="select-one"){e.find("option").selected(false)
}this.selected=c
}}})
};
function a(){if(b.fn.ajaxSubmit.debug){var c="[jquery.form] "+Array.prototype.join.call(arguments,"");
if(window.console&&window.console.log){window.console.log(c)
}else{if(window.opera&&window.opera.postError){window.opera.postError(c)
}}}}})(jQuery);(function(j,o,r){var q="hashchange",l=document,n,m=j.event.special,k=l.documentMode,p="on"+q in o&&(k===r||k>7);
function s(a){a=a||location.href;
return"#"+a.replace(/^[^#]*#?(.*)$/,"$1")
}j.fn[q]=function(a){return a?this.bind(q,a):this.trigger(q)
};
j.fn[q].delay=50;
m[q]=j.extend(m[q],{setup:function(){if(p){return false
}j(n.start)
},teardown:function(){if(p){return false
}j(n.stop)
}});
n=(function(){var d={},e,a=s(),c=function(h){return h
},b=c,f=c;
d.start=function(){e||g()
};
d.stop=function(){e&&clearTimeout(e);
e=r
};
function g(){var h=s(),i=f(a);
if(h!==a){b(a=h,i);
j(o).trigger(q)
}else{if(i!==a){location.href=location.href.replace(/#.*/,"")+i
}}e=setTimeout(g,j.fn[q].delay)
}j.browser.msie&&!p&&(function(){var i,h;
d.start=function(){if(!i){h=j.fn[q].src;
h=h&&h+s();
i=j('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){h||b(s());
g()
}).attr("src",h||"javascript:0").insertAfter("body")[0].contentWindow;
l.onpropertychange=function(){try{if(event.propertyName==="title"){i.document.title=l.title
}}catch(t){}}
}};
d.stop=c;
f=function(){return s(i.location.href)
};
b=function(w,z){var x=i.document,y=j.fn[q].domain;
if(w!==z){x.title=l.title;
x.open();
y&&x.write('<script>document.domain="'+y+'"<\/script>');
x.close();
i.location.hash=w
}}
})();
return d
})()
})(jQuery,this);(function(c){var a=function(e){var h="0123456789ABCDEFGHJKMNPQRSTUVWXYZabcdefghkmnpqrstuvwxyz";
var g="";
for(var f=0;
f<e;
f++){var d=Math.floor(Math.random()*h.length);
g+=h.substring(d,d+1)
}return g
};
var b=function(d,e){this.setAjaxOptions(d);
this.name=(typeof(e.name)!="undefined")?e.name:a(4);
this.min_wait=(typeof(e.min_wait)!="undefined")?e.min_wait:1000;
this.max_wait=(typeof(e.max_wait)!="undefined")?e.max_wait:30000;
this.current_wait=this.min_wait;
this.wait_multiplier=(typeof(e.wait_multiplier)!="undefined")?e.wait_multiplier:2;
this.stop=false;
this.doLog=(typeof(e.doLog)!="undefined")?e.doLog:true;
this.current_poll=false;
if(typeof(e.adjustWait)!="undefined"){this.adjustWait=e.adjustWait
}};
b.prototype.log=function(d){if(this.doLog&&!!console){console.log("Poll "+this.name+": "+d)
}};
b.prototype.setAjaxOptions=function(f){if(typeof(f)=="string"){f={url:f}
}if(this.settings){oldsettings=this.settings
}else{oldsettings={}
}var d=c.extend(true,{},c.ajaxSettings,oldsettings);
if(f){c.extend(true,d,f)
}if(typeof(d.data)!="undefined"){if(c.isFunction(d.data)){this.dataCallback=d.data
}else{var e=d.data;
this.dataCallback=function(){return e
}
}delete d.data
}if(c.isFunction(d.complete)){this.userComplete=d.complete;
delete d.complete
}this.settings=d
};
b.prototype.fetch=function(){var d=this;
if(!this.stop){if(!this.current_poll){this.fetchNow()
}else{this.log("last XHR not complete, skipping fetch")
}var e=function(){d.fetch.apply(d,arguments)
};
this.log("next check in "+this.current_wait+"ms");
this.current_poll=setTimeout(e,this.current_wait)
}else{this.log("stopped.")
}};
b.prototype.fetchNow=function(){var d=this;
var e={ifModified:true,complete:function(){return d.completeCallback.apply(d,arguments)
},data:typeof(this.dataCallback)!="undefined"?this.dataCallback():null};
var f=c.extend(true,e,this.settings);
c.ajax(f)
};
b.prototype.completeCallback=function(d,e){this.log("complete: "+e);
this.current_poll=false;
if(c.isFunction(this.adjustWait)){this.current_wait=this.adjustWait(d,e,this.current_wait)
}else{if(e!="success"){next_wait=this.current_wait*this.wait_multiplier;
if(next_wait<=this.max_wait){this.current_wait=next_wait
}else{this.current_wait=this.max_wait
}if(c.isFunction(this.userError)){this.userError(d,e)
}}}if(c.isFunction(this.userComplete)){this.userComplete(d,e)
}};
b.prototype.setWait=function(d){if(d<this.current_wait&&this.current_poll){clearTimeout(this.current_poll);
this.current_poll=false
}if(d){this.current_wait=d
}this.fetch()
};
c.poll=function(d,e,g){var e=(!!e)?e:{};
var f=new b(d,e);
if(!!g){f.fetch()
}return f
}
})(jQuery);(function(d){var c=d.browser.msie&&parseInt(d.browser.version)===6&&typeof window.XMLHttpRequest!=="object",b=d.browser.msie&&parseInt(d.browser.version)===7,e=null,a=[];
d.modal=function(g,f){return d.modal.impl.init(g,f)
};
d.modal.close=function(){d.modal.impl.close()
};
d.modal.focus=function(f){d.modal.impl.focus(f)
};
d.modal.setContainerDimensions=function(){d.modal.impl.setContainerDimensions()
};
d.modal.setPosition=function(){d.modal.impl.setPosition()
};
d.modal.update=function(f,g){d.modal.impl.update(f,g)
};
d.fn.modal=function(f){return d.modal.impl.init(this,f)
};
d.modal.defaults={appendTo:"body",focus:true,opacity:50,overlayId:"simplemodal-overlay",overlayCss:{},containerId:"simplemodal-container",containerCss:{},dataId:"simplemodal-data",dataCss:{},minHeight:null,minWidth:null,maxHeight:null,maxWidth:null,autoResize:false,autoPosition:true,zIndex:1000,close:true,closeHTML:'<a class="modalCloseImg" title="Close"></a>',closeClass:"simplemodal-close",escClose:true,overlayClose:false,position:null,persist:false,modal:true,onOpen:null,onShow:null,onClose:null};
d.modal.impl={d:{},init:function(h,f){var g=this;
if(g.d.data){return false
}e=d.browser.msie&&!d.boxModel;
g.o=d.extend({},d.modal.defaults,f);
g.zIndex=g.o.zIndex;
g.occb=false;
if(typeof h==="object"){h=h instanceof jQuery?h:d(h);
g.d.placeholder=false;
if(h.parent().parent().size()>0){h.before(d("<span></span>").attr("id","simplemodal-placeholder").css({display:"none"}));
g.d.placeholder=true;
g.display=h.css("display");
if(!g.o.persist){g.d.orig=h.clone(true)
}}}else{if(typeof h==="string"||typeof h==="number"){h=d("<div></div>").html(h)
}else{alert("SimpleModal Error: Unsupported data type: "+typeof h);
return g
}}g.create(h);
h=null;
g.open();
if(d.isFunction(g.o.onShow)){g.o.onShow.apply(g,[g.d])
}return g
},create:function(g){var f=this;
a=f.getDimensions();
if(f.o.modal&&c){f.d.iframe=d('<iframe src="javascript:false;"></iframe>').css(d.extend(f.o.iframeCss,{display:"none",opacity:0,position:"fixed",height:a[0],width:a[1],zIndex:f.o.zIndex,top:0,left:0})).appendTo(f.o.appendTo)
}f.d.overlay=d("<div></div>").attr("id",f.o.overlayId).addClass("simplemodal-overlay").css(d.extend(f.o.overlayCss,{display:"none",opacity:f.o.opacity/100,height:f.o.modal?a[0]:0,width:f.o.modal?a[1]:0,position:"fixed",left:0,top:0,zIndex:f.o.zIndex+1})).appendTo(f.o.appendTo);
f.d.container=d("<div></div>").attr("id",f.o.containerId).addClass("simplemodal-container").css(d.extend(f.o.containerCss,{display:"none",position:"fixed",zIndex:f.o.zIndex+2})).append(f.o.close&&f.o.closeHTML?d(f.o.closeHTML).addClass(f.o.closeClass):"").appendTo(f.o.appendTo);
f.d.wrap=d("<div></div>").attr("tabIndex",-1).addClass("simplemodal-wrap").css({height:"100%",outline:0,width:"100%"}).appendTo(f.d.container);
f.d.data=g.attr("id",g.attr("id")||f.o.dataId).addClass("simplemodal-data").css(d.extend(f.o.dataCss,{display:"none"})).appendTo("body");
g=null;
f.setContainerDimensions();
f.d.data.appendTo(f.d.wrap);
if(c||e){f.fixIE()
}},bindEvents:function(){var f=this;
d("."+f.o.closeClass).bind("click.simplemodal",function(g){g.preventDefault();
f.close()
});
if(f.o.modal&&f.o.close&&f.o.overlayClose){f.d.overlay.bind("click.simplemodal",function(g){g.preventDefault();
f.close()
})
}d(document).bind("keydown.simplemodal",function(g){if(f.o.modal&&g.keyCode===9){f.watchTab(g)
}else{if((f.o.close&&f.o.escClose)&&g.keyCode===27){g.preventDefault();
f.close()
}}});
d(window).bind("resize.simplemodal",function(){a=f.getDimensions();
f.o.autoResize?f.setContainerDimensions():f.o.autoPosition&&f.setPosition();
if(c||e){f.fixIE()
}else{if(f.o.modal){f.d.iframe&&f.d.iframe.css({height:a[0],width:a[1]});
f.d.overlay.css({height:a[0],width:a[1]})
}}})
},unbindEvents:function(){d("."+this.o.closeClass).unbind("click.simplemodal");
d(document).unbind("keydown.simplemodal");
d(window).unbind("resize.simplemodal");
this.d.overlay.unbind("click.simplemodal")
},fixIE:function(){var f=this,g=f.o.position;
d.each([f.d.iframe||null,!f.o.modal?null:f.d.overlay,f.d.container],function(t,l){if(l){var q="document.body.clientHeight",v="document.body.clientWidth",x="document.body.scrollHeight",u="document.body.scrollLeft",o="document.body.scrollTop",k="document.body.scrollWidth",j="document.documentElement.clientHeight",r="document.documentElement.clientWidth",p="document.documentElement.scrollLeft",y="document.documentElement.scrollTop",z=l[0].style;
z.position="absolute";
if(t<2){z.removeExpression("height");
z.removeExpression("width");
z.setExpression("height",""+x+" > "+q+" ? "+x+" : "+q+' + "px"');
z.setExpression("width",""+k+" > "+v+" ? "+k+" : "+v+' + "px"')
}else{var n,h;
if(g&&g.constructor===Array){var w=g[0]?typeof g[0]==="number"?g[0].toString():g[0].replace(/px/,""):l.css("top").replace(/px/,"");
n=w.indexOf("%")===-1?w+" + (t = "+y+" ? "+y+" : "+o+') + "px"':parseInt(w.replace(/%/,""))+" * (("+j+" || "+q+") / 100) + (t = "+y+" ? "+y+" : "+o+') + "px"';
if(g[1]){var m=typeof g[1]==="number"?g[1].toString():g[1].replace(/px/,"");
h=m.indexOf("%")===-1?m+" + (t = "+p+" ? "+p+" : "+u+') + "px"':parseInt(m.replace(/%/,""))+" * (("+r+" || "+v+") / 100) + (t = "+p+" ? "+p+" : "+u+') + "px"'
}}else{n="("+j+" || "+q+") / 2 - (this.offsetHeight / 2) + (t = "+y+" ? "+y+" : "+o+') + "px"';
h="("+r+" || "+v+") / 2 - (this.offsetWidth / 2) + (t = "+p+" ? "+p+" : "+u+') + "px"'
}z.removeExpression("top");
z.removeExpression("left");
z.setExpression("top",n);
z.setExpression("left",h)
}}})
},focus:function(i){var g=this,h=i&&d.inArray(i,["first","last"])!==-1?i:"first";
var f=d(":input:enabled:visible:"+h,g.d.wrap);
setTimeout(function(){f.length>0?f.focus():g.d.wrap.focus()
},10)
},getDimensions:function(){var g=d(window);
var f=d.browser.opera&&d.browser.version>"9.5"&&d.fn.jquery<"1.3"||d.browser.opera&&d.browser.version<"9.5"&&d.fn.jquery>"1.2.6"?g[0].innerHeight:g.height();
return[f,g.width()]
},getVal:function(f,g){return f?(typeof f==="number"?f:f==="auto"?0:f.indexOf("%")>0?((parseInt(f.replace(/%/,""))/100)*(g==="h"?a[0]:a[1])):parseInt(f.replace(/px/,""))):null
},update:function(f,h){var g=this;
if(!g.d.data){return false
}g.d.origHeight=g.getVal(f,"h");
g.d.origWidth=g.getVal(h,"w");
g.d.data.hide();
f&&g.d.container.css("height",f);
h&&g.d.container.css("width",h);
g.setContainerDimensions();
g.d.data.show();
g.o.focus&&g.focus();
g.unbindEvents();
g.bindEvents()
},setContainerDimensions:function(){var q=this,i=c||b;
var f=q.d.origHeight?q.d.origHeight:d.browser.opera?q.d.container.height():q.getVal(i?q.d.container[0].currentStyle.height:q.d.container.css("height"),"h"),h=q.d.origWidth?q.d.origWidth:d.browser.opera?q.d.container.width():q.getVal(i?q.d.container[0].currentStyle.width:q.d.container.css("width"),"w"),m=q.d.data.outerHeight(true),g=q.d.data.outerWidth(true);
q.d.origHeight=q.d.origHeight||f;
q.d.origWidth=q.d.origWidth||h;
var j=q.o.maxHeight?q.getVal(q.o.maxHeight,"h"):null,n=q.o.maxWidth?q.getVal(q.o.maxWidth,"w"):null,l=j&&j<a[0]?j:a[0],p=n&&n<a[1]?n:a[1];
var k=q.o.minHeight?q.getVal(q.o.minHeight,"h"):"auto";
if(!f){if(!m){f=k
}else{if(m>l){f=l
}else{if(q.o.minHeight&&k!=="auto"&&m<k){f=k
}else{f=m
}}}}else{f=q.o.autoResize&&f>l?l:f<k?k:f
}var o=q.o.minWidth?q.getVal(q.o.minWidth,"w"):"auto";
if(!h){if(!g){h=o
}else{if(g>p){h=p
}else{if(q.o.minWidth&&o!=="auto"&&g<o){h=o
}else{h=g
}}}}else{h=q.o.autoResize&&h>p?p:h<o?o:h
}q.d.container.css({height:f,width:h});
q.d.wrap.css({overflow:(m>f||g>h)?"auto":"visible"});
q.o.autoPosition&&q.setPosition()
},setPosition:function(){var g=this,i,h,j=(a[0]/2)-(g.d.container.outerHeight(true)/2),f=(a[1]/2)-(g.d.container.outerWidth(true)/2);
if(g.o.position&&Object.prototype.toString.call(g.o.position)==="[object Array]"){i=g.o.position[0]||j;
h=g.o.position[1]||f
}else{i=j;
h=f
}g.d.container.css({left:h,top:i})
},watchTab:function(g){var f=this;
if(d(g.target).parents(".simplemodal-container").length>0){f.inputs=d(":input:enabled:visible:first, :input:enabled:visible:last",f.d.data[0]);
if((!g.shiftKey&&g.target===f.inputs[f.inputs.length-1])||(g.shiftKey&&g.target===f.inputs[0])||f.inputs.length===0){g.preventDefault();
var h=g.shiftKey?"last":"first";
f.focus(h)
}}else{g.preventDefault();
f.focus()
}},open:function(){var f=this;
f.d.iframe&&f.d.iframe.show();
if(d.isFunction(f.o.onOpen)){f.o.onOpen.apply(f,[f.d])
}else{f.d.overlay.show();
f.d.container.show();
f.d.data.show()
}f.o.focus&&f.focus();
f.bindEvents()
},close:function(){var f=this;
if(!f.d.data){return false
}f.unbindEvents();
if(d.isFunction(f.o.onClose)&&!f.occb){f.occb=true;
f.o.onClose.apply(f,[f.d])
}else{if(f.d.placeholder){var g=d("#simplemodal-placeholder");
if(f.o.persist){g.replaceWith(f.d.data.removeClass("simplemodal-data").css("display",f.display))
}else{f.d.data.hide().remove();
g.replaceWith(f.d.orig)
}}else{f.d.data.hide().remove()
}f.d.container.hide().remove();
f.d.overlay.hide();
f.d.iframe&&f.d.iframe.hide().remove();
setTimeout(function(){f.d.overlay.remove();
f.d={}
},10)
}}}
})(jQuery);(function(b){var c=b.browser.msie&&b.browser.version<8;
b.watermarker=function(){};
b.extend(b.watermarker,{defaults:{color:"#999",left:0,top:0,fallback:false,animDuration:300,minOpacity:0.6},setDefaults:function(a){b.extend(b.watermarker.defaults,a)
},checkVal:function(a,d){a.length==0?b(d).show():b(d).hide();
return a.length>0
},html5_support:function(){return"placeholder" in document.createElement("input")
}});
b.fn.watermark=function(d,f){var a;
f=b.extend(b.watermarker.defaults,f);
a=this.filter("textarea, input:not(:checkbox,:radio,:file,:submit,:reset)");
if(!(f.fallback&&b.watermarker.html5_support())){a.each(function(){var e,m,i,l,n,k=0;
e=b(this);
if(e.attr("data-jq-watermark")!="processed"){m=e.attr("placeholder")!=undefined&&e.attr("placeholder")!=""?"placeholder":"title";
i=d===undefined||d===""?b(this).attr(m):d;
l=b('<span class="watermark_container"></span>');
n=b('<span class="watermark">'+i+"</span>");
m=="placeholder"&&e.removeAttr("placeholder");
l.css({display:"inline-block",position:"relative"});
c&&l.css({zoom:1,display:"inline"});
e.wrap(l).attr("data-jq-watermark","processed");
if(this.nodeName.toLowerCase()=="textarea"){e_height=e.css("line-height");
e_height=e_height==="normal"?parseInt(e.css("font-size")):e_height;
k=e.css("padding-top")!="auto"?parseInt(e.css("padding-top")):0
}else{e_height=e.outerHeight();
if(e_height<=0){e_height=e.css("padding-top")!="auto"?parseInt(e.css("padding-top")):0;
e_height+=e.css("padding-bottom")!="auto"?parseInt(e.css("padding-bottom")):0;
e_height+=e.css("height")!="auto"?parseInt(e.css("height")):0
}}k+=e.css("margin-top")!="auto"?parseInt(e.css("margin-top")):0;
m=e.css("margin-left")!="auto"?parseInt(e.css("margin-left")):0;
m+=e.css("padding-left")!="auto"?parseInt(e.css("padding-left")):0;
n.css({position:"absolute",display:"block",fontFamily:e.css("font-family"),fontSize:e.css("font-size"),color:f.color,left:4+f.left+m,top:f.top+k,height:e_height,lineHeight:e_height+"px",textAlign:"left",pointerEvents:"none"}).data("jq_watermark_element",e);
b.watermarker.checkVal(e.val(),n);
n.click(function(){b(b(this).data("jq_watermark_element")).trigger("focus")
});
e.before(n).bind("focus.jq_watermark",function(){b.watermarker.checkVal(b(this).val(),n)||n.stop().fadeTo(f.animDuration,f.minOpacity)
}).bind("blur.jq_watermark change.jq_watermark",function(){b.watermarker.checkVal(b(this).val(),n)||n.stop().fadeTo(f.animDuration,1)
}).bind("keydown.jq_watermark",function(){b(n).hide()
}).bind("keyup.jq_watermark",function(){b.watermarker.checkVal(b(this).val(),n)
})
}});
return this
}};
b(document).ready(function(){b(".jq_watermark").watermark()
})
})(jQuery);function ns(b){var f=b.split("."),d=window,a="";
for(var c=0,e=f.length;
c<e;
c++){a=f[c];
d[a]=d[a]||{};
d=d[a]
}return d
};(function(){var s=this;
var q=s._;
var b={};
var i=Array.prototype,A=Object.prototype;
var r=i.slice,v=i.unshift,u=A.toString,n=A.hasOwnProperty;
var l=i.forEach,h=i.map,y=i.reduce,e=i.reduceRight,k=i.filter,a=i.every,x=i.some,t=i.indexOf,f=i.lastIndexOf,c=Array.isArray,z=Object.keys;
var B=function(C){return new g(C)
};
if(typeof module!=="undefined"&&module.exports){module.exports=B;
B._=B
}else{s._=B
}B.VERSION="1.1.4";
var d=B.each=B.forEach=function(I,G,F){var H;
if(I==null){return
}if(l&&I.forEach===l){I.forEach(G,F)
}else{if(B.isNumber(I.length)){for(var E=0,C=I.length;
E<C;
E++){if(G.call(F,I[E],E,I)===b){return
}}}else{for(var D in I){if(n.call(I,D)){if(G.call(F,I[D],D,I)===b){return
}}}}}};
B.map=function(F,E,D){var C=[];
if(F==null){return C
}if(h&&F.map===h){return F.map(E,D)
}d(F,function(I,G,H){C[C.length]=E.call(D,I,G,H)
});
return C
};
B.reduce=B.foldl=B.inject=function(G,F,C,E){var D=C!==void 0;
if(G==null){G=[]
}if(y&&G.reduce===y){if(E){F=B.bind(F,E)
}return D?G.reduce(F,C):G.reduce(F)
}d(G,function(J,H,I){if(!D&&H===0){C=J;
D=true
}else{C=F.call(E,C,J,H,I)
}});
if(!D){throw new TypeError("Reduce of empty array with no initial value")
}return C
};
B.reduceRight=B.foldr=function(F,E,C,D){if(F==null){F=[]
}if(e&&F.reduceRight===e){if(D){E=B.bind(E,D)
}return C!==void 0?F.reduceRight(E,C):F.reduceRight(E)
}var G=(B.isArray(F)?F.slice():B.toArray(F)).reverse();
return B.reduce(G,E,C,D)
};
B.find=B.detect=function(F,E,D){var C;
o(F,function(I,G,H){if(E.call(D,I,G,H)){C=I;
return true
}});
return C
};
B.filter=B.select=function(F,E,D){var C=[];
if(F==null){return C
}if(k&&F.filter===k){return F.filter(E,D)
}d(F,function(I,G,H){if(E.call(D,I,G,H)){C[C.length]=I
}});
return C
};
B.reject=function(F,E,D){var C=[];
if(F==null){return C
}d(F,function(I,G,H){if(!E.call(D,I,G,H)){C[C.length]=I
}});
return C
};
B.every=B.all=function(F,E,D){E=E||B.identity;
var C=true;
if(F==null){return C
}if(a&&F.every===a){return F.every(E,D)
}d(F,function(I,G,H){if(!(C=C&&E.call(D,I,G,H))){return b
}});
return C
};
var o=B.some=B.any=function(F,E,D){E=E||B.identity;
var C=false;
if(F==null){return C
}if(x&&F.some===x){return F.some(E,D)
}d(F,function(I,G,H){if(C=E.call(D,I,G,H)){return b
}});
return C
};
B.include=B.contains=function(E,D){var C=false;
if(E==null){return C
}if(t&&E.indexOf===t){return E.indexOf(D)!=-1
}o(E,function(F){if(C=F===D){return true
}});
return C
};
B.invoke=function(D,E){var C=r.call(arguments,2);
return B.map(D,function(F){return(E?F[E]:F).apply(F,C)
})
};
B.pluck=function(D,C){return B.map(D,function(E){return E[C]
})
};
B.max=function(F,E,D){if(!E&&B.isArray(F)){return Math.max.apply(Math,F)
}var C={computed:-Infinity};
d(F,function(J,G,I){var H=E?E.call(D,J,G,I):J;
H>=C.computed&&(C={value:J,computed:H})
});
return C.value
};
B.min=function(F,E,D){if(!E&&B.isArray(F)){return Math.min.apply(Math,F)
}var C={computed:Infinity};
d(F,function(J,G,I){var H=E?E.call(D,J,G,I):J;
H<C.computed&&(C={value:J,computed:H})
});
return C.value
};
B.sortBy=function(E,D,C){return B.pluck(B.map(E,function(H,F,G){return{value:H,criteria:D.call(C,H,F,G)}
}).sort(function(I,H){var G=I.criteria,F=H.criteria;
return G<F?-1:G>F?1:0
}),"value")
};
B.sortedIndex=function(H,G,E){E=E||B.identity;
var C=0,F=H.length;
while(C<F){var D=(C+F)>>1;
E(H[D])<E(G)?C=D+1:F=D
}return C
};
B.toArray=function(C){if(!C){return[]
}if(C.toArray){return C.toArray()
}if(B.isArray(C)){return C
}if(B.isArguments(C)){return r.call(C)
}return B.values(C)
};
B.size=function(C){return B.toArray(C).length
};
B.first=B.head=function(E,D,C){return D&&!C?r.call(E,0,D):E[0]
};
B.rest=B.tail=function(E,C,D){return r.call(E,B.isUndefined(C)||D?1:C)
};
B.last=function(C){return C[C.length-1]
};
B.compact=function(C){return B.filter(C,function(D){return !!D
})
};
B.flatten=function(C){return B.reduce(C,function(D,E){if(B.isArray(E)){return D.concat(B.flatten(E))
}D[D.length]=E;
return D
},[])
};
B.without=function(D){var C=r.call(arguments,1);
return B.filter(D,function(E){return !B.include(C,E)
})
};
B.uniq=B.unique=function(D,C){return B.reduce(D,function(E,G,F){if(0==F||(C===true?B.last(E)!=G:!B.include(E,G))){E[E.length]=G
}return E
},[])
};
B.intersect=function(D){var C=r.call(arguments,1);
return B.filter(B.uniq(D),function(E){return B.every(C,function(F){return B.indexOf(F,E)>=0
})
})
};
B.zip=function(){var C=r.call(arguments);
var F=B.max(B.pluck(C,"length"));
var E=new Array(F);
for(var D=0;
D<F;
D++){E[D]=B.pluck(C,""+D)
}return E
};
B.indexOf=function(G,E,F){if(G==null){return -1
}if(F){var D=B.sortedIndex(G,E);
return G[D]===E?D:-1
}if(t&&G.indexOf===t){return G.indexOf(E)
}for(var D=0,C=G.length;
D<C;
D++){if(G[D]===E){return D
}}return -1
};
B.lastIndexOf=function(E,D){if(E==null){return -1
}if(f&&E.lastIndexOf===f){return E.lastIndexOf(D)
}var C=E.length;
while(C--){if(E[C]===D){return C
}}return -1
};
B.range=function(J,G,H){var F=r.call(arguments),I=F.length<=1,J=I?0:F[0],G=I?F[0]:F[1],H=F[2]||1,D=Math.max(Math.ceil((G-J)/H),0),C=0,E=new Array(D);
while(C<D){E[C++]=J;
J+=H
}return E
};
B.bind=function(D,E){var C=r.call(arguments,2);
return function(){return D.apply(E||{},C.concat(r.call(arguments)))
}
};
B.bindAll=function(D){var C=r.call(arguments,1);
if(C.length==0){C=B.functions(D)
}d(C,function(E){D[E]=B.bind(D[E],D)
});
return D
};
B.memoize=function(E,D){var C={};
D=D||B.identity;
return function(){var F=D.apply(this,arguments);
return F in C?C[F]:(C[F]=E.apply(this,arguments))
}
};
B.delay=function(D,E){var C=r.call(arguments,2);
return setTimeout(function(){return D.apply(D,C)
},E)
};
B.defer=function(C){return B.delay.apply(B,[C,1].concat(r.call(arguments,1)))
};
var w=function(D,F,C){var E;
return function(){var H=this,G=arguments;
var I=function(){E=null;
D.apply(H,G)
};
if(C){clearTimeout(E)
}if(C||!E){E=setTimeout(I,F)
}}
};
B.throttle=function(C,D){return w(C,D,false)
};
B.debounce=function(C,D){return w(C,D,true)
};
B.wrap=function(C,D){return function(){var E=[C].concat(r.call(arguments));
return D.apply(this,E)
}
};
B.compose=function(){var C=r.call(arguments);
return function(){var D=r.call(arguments);
for(var E=C.length-1;
E>=0;
E--){D=[C[E].apply(this,D)]
}return D[0]
}
};
B.keys=z||function(E){if(B.isArray(E)){return B.range(0,E.length)
}var D=[];
for(var C in E){if(n.call(E,C)){D[D.length]=C
}}return D
};
B.values=function(C){return B.map(C,B.identity)
};
B.functions=B.methods=function(C){return B.filter(B.keys(C),function(D){return B.isFunction(C[D])
}).sort()
};
B.extend=function(C){d(r.call(arguments,1),function(D){for(var E in D){C[E]=D[E]
}});
return C
};
B.clone=function(C){return B.isArray(C)?C.slice():B.extend({},C)
};
B.tap=function(D,C){C(D);
return D
};
B.isEqual=function(D,C){if(D===C){return true
}var G=typeof(D),I=typeof(C);
if(G!=I){return false
}if(D==C){return true
}if((!D&&C)||(D&&!C)){return false
}if(D._chain){D=D._wrapped
}if(C._chain){C=C._wrapped
}if(D.isEqual){return D.isEqual(C)
}if(B.isDate(D)&&B.isDate(C)){return D.getTime()===C.getTime()
}if(B.isNaN(D)&&B.isNaN(C)){return false
}if(B.isRegExp(D)&&B.isRegExp(C)){return D.source===C.source&&D.global===C.global&&D.ignoreCase===C.ignoreCase&&D.multiline===C.multiline
}if(G!=="object"){return false
}if(D.length&&(D.length!==C.length)){return false
}var E=B.keys(D),H=B.keys(C);
if(E.length!=H.length){return false
}for(var F in D){if(!(F in C)||!B.isEqual(D[F],C[F])){return false
}}return true
};
B.isEmpty=function(D){if(B.isArray(D)||B.isString(D)){return D.length===0
}for(var C in D){if(n.call(D,C)){return false
}}return true
};
B.isElement=function(C){return !!(C&&C.nodeType==1)
};
B.isArray=c||function(C){return u.call(C)==="[object Array]"
};
B.isArguments=function(C){return !!(C&&n.call(C,"callee"))
};
B.isFunction=function(C){return !!(C&&C.constructor&&C.call&&C.apply)
};
B.isString=function(C){return !!(C===""||(C&&C.charCodeAt&&C.substr))
};
B.isNumber=function(C){return !!(C===0||(C&&C.toExponential&&C.toFixed))
};
B.isNaN=function(C){return C!==C
};
B.isBoolean=function(C){return C===true||C===false
};
B.isDate=function(C){return !!(C&&C.getTimezoneOffset&&C.setUTCFullYear)
};
B.isRegExp=function(C){return !!(C&&C.test&&C.exec&&(C.ignoreCase||C.ignoreCase===false))
};
B.isNull=function(C){return C===null
};
B.isUndefined=function(C){return C===void 0
};
B.noConflict=function(){s._=q;
return this
};
B.identity=function(C){return C
};
B.times=function(F,E,D){for(var C=0;
C<F;
C++){E.call(D,C)
}};
B.mixin=function(C){d(B.functions(C),function(D){p(D,B[D]=C[D])
})
};
var j=0;
B.uniqueId=function(C){var D=j++;
return C?C+D:D
};
B.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g};
B.template=function(F,E){var G=B.templateSettings;
var C="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+F.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(G.interpolate,function(H,I){return"',"+I.replace(/\\'/g,"'")+",'"
}).replace(G.evaluate||null,function(H,I){return"');"+I.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ")+"__p.push('"
}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');";
var D=new Function("obj",C);
return E?D(E):D
};
var g=function(C){this._wrapped=C
};
B.prototype=g.prototype;
var m=function(D,C){return C?B(D).chain():D
};
var p=function(C,D){g.prototype[C]=function(){var E=r.call(arguments);
v.call(E,this._wrapped);
return m(D.apply(B,E),this._chain)
}
};
B.mixin(B);
d(["pop","push","reverse","shift","sort","splice","unshift"],function(C){var D=i[C];
g.prototype[C]=function(){D.apply(this._wrapped,arguments);
return m(this._wrapped,this._chain)
}
});
d(["concat","join","slice"],function(C){var D=i[C];
g.prototype[C]=function(){return m(D.apply(this._wrapped,arguments),this._chain)
}
});
g.prototype.chain=function(){this._chain=true;
return this
};
g.prototype.value=function(){return this._wrapped
}
})();ns("MusicGlue");(function(c,b){var a=MusicGlue.Basket=function(){};
a.prototype={add_product:function(h,g,f){var d=this;
var e=h.children(".shop_product").attr("id").replace(/product_/i,"");
h.ajaxSubmit({dataType:"json",beforeSubmit:function(){d.notify_adding_products(e)
},success:function(j){if(j.RedirectToBasket){d.notify_redirect_to_basket()
}else{if(j.ReservationInProgress){d.notify_reservation_polling(e);
b.reservation.poll_for_progress({reservation_id:j.ReservationId,product_id:e,option_ids:h.find(".options_select").map(function(){return c(this).val()
}).toArray().sort().join(""),on_success:function(k){d.notify_basket_updated();
d.notify_reservation_polling_complete(e);
f(k)
}})
}else{d.notify_basket_updated();
var i=_.first(_(j.Lines).select(function(k){return k.ProductId==e
}));
if(!_.isUndefined(b.basket_cookie.reservation_id())){d.notify_reservation_extension_requested()
}d.notify_basket_line_updated(i.LineId,i.Quantity,i.Subtotal,i.ServiceCharge,i.Total);
g(i.SinglePurchaseOnly,i.Quantity)
}}},complete:function(){d.notify_adding_products_complete(e)
}})
},add_tickets:function(e,g,f){var d=this;
e.ajaxSubmit(c.extend({},{dataType:"json",beforeSubmit:function(){d.notify_adding_products()
},success:function(h){if(h.RedirectToBasket){d.notify_redirect_to_basket()
}else{if(h.ReservationInProgress){d.notify_reservation_polling();
b.reservation.poll_for_progress({reservation_id:h.ReservationId,on_success:function(i){f(i);
d.notify_basket_updated();
d.notify_reservation_polling_complete()
}})
}else{g(h.Lines);
d.notify_basket_updated()
}}},complete:function(){d.notify_adding_products_complete()
}}))
},remove_product:function(e,f){var d=this;
c(".basket_form").ajaxSubmit(c.extend({},{dataType:"json",beforeSubmit:function(g){d.notify_basket_updating();
g.push({name:"remove",value:e.remove_button.val()})
},success:function(g){if(g.Lines.length==0){d.notify_redirect_to_basket();
return
}var h=_(g.Lines).select(function(i){return(i.Error||"").toString().length>0
});
if(g.Checkoutable&&h.length==0){d.notify_basket_checkoutable()
}else{d.notify_basket_not_checkoutable()
}f(h);
d.notify_pricing_summary_updated(g.CheckoutJson)
},complete:function(){d.notify_basket_updating_complete()
}}))
},update_product_quantity:function(f,d,g){var e=this;
c(".basket_form").ajaxSubmit({dataType:"json",beforeSubmit:function(h){e.notify_basket_updating();
h.push({name:"update_id",value:f.line_id});
h.push({name:"update_quantity",value:f.quantity_select.val()})
},success:function(h){g();
var i=function(){var j=_(b.basket_cookie.lines()).detect(function(m){return m.LineId==f.line_id
});
e.notify_basket_line_pricing_updated(j.LineId,j.Subtotal,j.ServiceCharge);
if(h.Checkoutable){e.notify_basket_checkoutable()
}else{var l=b.basket_cookie.errors();
for(var k in l){e.notify_basket_line_error(k,l[k])
}e.notify_basket_not_checkoutable()
}e.notify_pricing_summary_updated(h.CheckoutJson);
e.notify_basket_line_updating_complete(j.LineId)
};
if(h.ReservationInProgress){e.notify_reservation_polling();
d();
b.reservation.poll_for_progress({reservation_id:h.ReservationId,on_success:function(){i();
e.notify_reservation_polling_complete()
}})
}else{i()
}},complete:function(){e.notify_basket_updating_complete()
}})
},notify_basket_updated:function(){c("body").trigger("basket_quantity_changed.musicglue",b.basket_cookie.total_items());
c("body").trigger("basket_total_changed.musicglue",b.basket_cookie.total());
c("body").trigger("reservation_expiry_changed.musicglue",b.basket_cookie.reservation_expires())
},notify_basket_line_updated:function(f,h,d,e,g){c("body").trigger("basket_line_updated.musicglue",[f,h,d,e,g])
},notify_basket_line_pricing_updated:function(f,d,e){c("body").trigger("basket_line_"+f+"_sub_total_changed.musicglue",d);
c("body").trigger("basket_line_"+f+"_service_charge_changed.musicglue",e)
},notify_basket_line_updating_complete:function(d){c("body").trigger("basket_line_"+d+"_updating_complete.musicglue")
},notify_basket_line_error:function(d,e){c("body").trigger("basket_line_"+d+"_error.musicglue",e)
},notify_pricing_summary_updated:function(){c("body").trigger("sub_total_changed.musicglue",b.basket_cookie.sub_total());
c("body").trigger("service_charge_changed.musicglue",b.basket_cookie.service_charge());
this.notify_basket_updated();
if(arguments.length>0){c("body").trigger("checkout_json_updated.musicglue",arguments[0])
}},notify_adding_products:function(d){c("body").trigger("adding_product_to_basket.musicglue",d)
},notify_adding_products_complete:function(d){c("body").trigger("adding_product_to_basket_complete.musicglue",d)
},notify_reservation_polling:function(d){c("body").trigger("beginning_reservation_polling.musicglue",d)
},notify_reservation_polling_complete:function(d){c("body").trigger("reservation_polling_complete.musicglue",d)
},notify_reservation_extension_requested:function(){c("body").trigger("reservation_extension_requested.musicglue")
},notify_basket_updating:function(){c("body").trigger("basket_updating.musicglue")
},notify_basket_updating_complete:function(){c("body").trigger("basket_updating_complete.musicglue")
},notify_basket_checkoutable:function(){c("body").trigger("basket_checkoutable.musicglue")
},notify_basket_not_checkoutable:function(){c("body").trigger("basket_not_checkoutable.musicglue")
},notify_redirect_to_basket:function(){c("body").trigger("redirect_to_basket.musicglue")
}}
})(jQuery,ns("MusicGlue.Globals"));(function(b){var a=MusicGlue.BasketCookie=function(){};
a.cookie_name="mg_basket";
var d=b;
var c=_.bind(function(){json=d.cookie(this.cookie_name);
return json?d.parseJSON(json):{}
},a);
a.prototype={checkoutable:function(){return c().Checkoutable
},errors:function(){return c().Errors
},line:function(e,f){return _(c().Lines).detect(function(g){return g.LineId==e+f
})
},lines:function(){return c().Lines
},reservation_expires:function(){return c().ReservationExpires
},reservation_id:function(){return c().ReservationId
},reservation_in_progress:function(){return c().ReservationInProgress
},service_charge:function(){return c().ServiceCharge
},set_expiry_for_checkout:function(){var e=new Date();
e.setTime(e.getTime()+(2*60*1000));
b.cookie(a.cookie_name,b.cookie(a.cookie_name),{expires:e,path:"/"})
},sub_total:function(){return c().Subtotal
},total:function(){return c().Total
},total_items:function(){return _(c().Lines).reduce(function(f,e){return f+e.Quantity
},0)
}}
})(jQuery);(function(g){var b=MusicGlue.Reservation=function(h){h=h||{};
this.near_expiry_lead_time=h.near_expiry_lead_time||10;
this.near_expiry_threshold=h.near_expiry_threshold||60;
this.poller=g.poll({cache:false,dataType:"json"},{doLog:false,min_wait:2000,wait_multiplier:1.5})
};
b.prototype={check_expiry:function(h){var k=a();
h=h*1000;
if(k>=h){g("body").trigger("reservation_expired.musicglue");
return
}var i=(h-k)/1000;
var j=i<(this.near_expiry_lead_time+this.near_expiry_threshold);
var m=i<this.near_expiry_threshold;
var l=m?"near_expiry":"not_near_expiry";
g("body").trigger("reservation_"+l,[Math.round(i)]);
if(j){g("body").trigger("reservation_crossed_near_expiration_threshold")
}},extend_expiry:function(j,h){var i=this;
g.ajax({dataType:"json",success:function(k){i.poller.setAjaxOptions({success:function(l){if(_.isUndefined(l)||_.isNull(l)){return
}if(l>h){g("body").trigger("reservation_expiry_changed.musicglue",l);
i.poller.stop=true
}else{if(a()>=(h*1000)){i.poller.stop=true
}}},url:"./reservation_expiry?id="+j});
i.poller.stop=false;
i.poller.fetch()
},type:"POST",url:"./extend_reservation?id="+j})
},poll_for_progress:function(h){h=c(h);
this.poller.setAjaxOptions({success:_.bind(d,this,h),error:_.bind(e,this),url:"./reservation_progress?id="+h.reservation_id});
this.poller.stop=false;
this.poller.fetch()
}};
var f=function(j,k){var h=k.components;
if(j.product_id&&_.isString(j.option_ids)){var i=_(k.components).detect(function(l){return l.product_id===j.product_id&&l.option_ids===j.option_ids
});
h=i.quantity
}j.on_success(h)
};
var e=function(h){if(h.status==404){this.poller.stop=true;
g("body").trigger("reservation_expired.musicglue")
}};
var d=function(h,i){if(_.isUndefined(i)||_.isNull(i)||_.isEmpty(i)){return
}this.poller.stop=true;
if(i.redirect_to_basket){g("body").trigger("redirect_to_basket.musicglue")
}else{f.call(this,h,i)
}};
var a=function(){return(new Date()).valueOf()
};
var c=function(i){var h="MusicGlue.Reservation.poll_for_progress requires ";
if(!_.isString(i.reservation_id)||i.reservation_id.length==0){throw h+"a reservation_id option."
}return g.extend({on_success:function(){}},i)
}
})(jQuery);(function(b){var a=function(c){this.elements=c;
b("body").bind("basket_updating.musicglue",_.bind(this.consume_basket_updating,this));
b("body").bind("basket_updating_complete.musicglue",_.bind(this.consume_basket_updating_complete,this));
b("body").bind("beginning_reservation_polling.musicglue",_.bind(this.consume_beginning_reservation_polling,this));
b("body").bind("reservation_polling_complete.musicglue",_.bind(this.consume_reservation_polling_complete,this))
};
a.prototype={consume_basket_updating:function(){this.elements.attr("disabled",true)
},consume_basket_updating_complete:function(){if(!this.reservation_polling_in_progress){this.elements.attr("disabled",false)
}},consume_beginning_reservation_polling:function(){this.reservation_polling_in_progress=true;
this.elements.attr("disabled",true)
},consume_reservation_polling_complete:function(){this.reservation_polling_in_progress=false;
this.elements.attr("disabled",false)
}};
b.addObject("musicglue_basket_disabler",a)
})(jQuery);(function(c,b){var a=function(d){this.navigation=d;
this.checkout_button=this.navigation.find(".checkout_button");
this.checkout_json=this.navigation.find(".basket_json");
c("body").bind("basket_checkoutable.musicglue",_.bind(this.consume_basket_checkoutable,this));
c("body").bind("basket_not_checkoutable.musicglue",_.bind(this.consume_basket_not_checkoutable,this));
c("body").bind("checkout_json_updated.musicglue",_.bind(this.consume_checkout_json_updated,this));
this.checkout_button.live("click",_.bind(this.set_cookie_expiry,this))
};
a.prototype={consume_basket_checkoutable:function(){this.navigation.show()
},consume_basket_not_checkoutable:function(){this.navigation.hide()
},consume_checkout_json_updated:function(f,d){this.checkout_json.val(d)
},set_cookie_expiry:function(){b.basket_cookie.set_expiry_for_checkout()
}};
c.addObject("musicglue_basket_navigation",a)
})(jQuery,ns("MusicGlue.Globals"));(function(b){var a=function(c){this.pricing_summary=c;
this.sub_total=this.pricing_summary.find(".sub_total_text");
this.service_charge=this.pricing_summary.find(".service_charge_text");
this.total=this.pricing_summary.find(".total_text");
b("body").bind("sub_total_changed.musicglue",_.bind(this.consume_sub_total_updated,this));
b("body").bind("service_charge_changed.musicglue",_.bind(this.consume_service_charge_updated,this));
b("body").bind("basket_total_changed.musicglue",_.bind(this.consume_total_updated,this));
b("body").bind("basket_checkoutable.musicglue",_.bind(this.consume_basket_checkoutable,this));
b("body").bind("basket_not_checkoutable.musicglue",_.bind(this.consume_basket_not_checkoutable,this))
};
a.prototype={consume_sub_total_updated:function(d,c){this.sub_total.text(c)
},consume_service_charge_updated:function(d,c){this.service_charge.text(c)
},consume_total_updated:function(d,c){this.total.text(c)
},consume_basket_checkoutable:function(){this.pricing_summary.show()
},consume_basket_not_checkoutable:function(){this.pricing_summary.hide()
}};
b.addObject("musicglue_basket_pricing_summary",a)
})(jQuery);(function(f,d){var b=function(g){this.product_line=g;
this.line_id=this.product_line.find(".line_id").val();
this.quantity_select=this.product_line.find(".quantity_select");
this.pricing=this.product_line.find(".pricing");
this.pricing_wrapper=this.pricing.find(".pricing_wrapper");
this.total=this.product_line.find(".product_total");
this.service_charge=this.product_line.find(".product_service_charge");
this.remove_button=this.product_line.find(".button_remove");
this.warning_row=this.product_line.prev(".line_warning_"+this.line_id);
this.error_row=this.product_line.prev(".line_error_"+this.line_id);
this.throbber=this.product_line.find(".update_product_throbber");
this.reserving_label=this.throbber.find(".reserving");
this.remove_button.live("click",_.bind(this.remove_product,this));
this.quantity_select.live("change",_.bind(this.update_product_quantity,this));
this.pricing_wrapper.bind("basket_checkoutable.musicglue",function(){f(this).show()
});
f("body").bind("basket.line_changed",_.bind(this.consume_line_changed,this));
f("body").bind("basket_line_removed.musicglue",_.bind(this.consume_line_removed,this));
f("body").bind("basket_line_"+this.line_id+"_sub_total_changed.musicglue",_.bind(this.consume_sub_total_change,this));
f("body").bind("basket_line_"+this.line_id+"_service_charge_changed.musicglue",_.bind(this.consume_service_charge_changed,this));
f("body").bind("basket_line_"+this.line_id+"_error.musicglue",_.bind(this.consume_error,this));
f("body").bind("basket_line_"+this.line_id+"_updating_complete.musicglue",_.bind(this.consume_basket_line_updating_complete,this))
};
b.prototype={consume_sub_total_change:function(h,g){this.total.html(g+" ")
},consume_service_charge_changed:function(h,g){this.service_charge.html(g)
},consume_error:function(h,g){this.error_row.find(".error-text").html(g);
this.error_row.show()
},consume_basket_line_updating_complete:function(){this.throbber.hide();
this.pricing_wrapper.show()
},consume_line_changed:function(h,g){if(this.line_id!=g){return
}a(this)
},consume_line_removed:function(h,g){if(this.line_id!=g){return
}c.call(this);
e.call(this)
},remove_product:function(h){var g=this;
var i=function(j){f(".product_error").hide();
_(j).each(function(k){f(".product_error_"+k.LineId+" .error_text").html(k.Error).show()
});
c.call(g)
};
d.basket.remove_product(this,i);
h.preventDefault()
},update_product_quantity:function(i){if(this.quantity_select.val()<1){return
}var g=this;
this.pricing_wrapper.hide();
this.throbber.show();
this.reserving_label[g.product_line.hasClass("reservable")?"show":"hide"]();
var h=function(){g.reserving_label.show();
g.throbber.show();
g.pricing_wrapper.hide()
};
var j=function(){f(".product_error").hide()
};
d.basket.update_product_quantity(this,h,j)
}};
var c=function(){this.product_line.remove();
this.error_row.remove();
this.warning_row.remove()
};
var a=function(h){var g=_(d.basket_cookie.lines()).detect(function(l){return l.LineId==h.line_id
});
h.total.html(g.Subtotal+" ");
h.service_charge.html(g.ServiceCharge);
if(d.basket_cookie.checkoutable()){f("body").trigger("basket_checkoutable.musicglue")
}else{var k=d.basket_cookie.errors();
for(var i in k){var j=f(".product_error_"+i);
j.find(".error-text").html(k[i]);
j.show()
}f("body").trigger("basket_not_checkoutable.musicglue")
}h.throbber.hide();
h.pricing_wrapper.show()
};
var e=function(){f("body").trigger("sub_total_changed.musicglue",d.basket_cookie.sub_total());
f("body").trigger("service_charge_changed.musicglue",d.basket_cookie.service_charge());
f("body").trigger("basket_total_changed.musicglue",d.basket_cookie.total());
f("body").trigger("basket_quantity_changed.musicglue",d.basket_cookie.total_items());
if(arguments.length>0){f("body").trigger("checkout_json_updated.musicglue",arguments[0])
}};
f.addObject("musicglue_basket_product_line",b)
})(jQuery,ns("MusicGlue.Globals"));(function(b){var a=function(c){this.product_count=c;
b("body").bind("basket_quantity_changed.musicglue",_.bind(this.consume_basket_quantity_changed,this))
};
a.prototype={consume_basket_quantity_changed:function(d,c){this.product_count.text(c+" ")
}};
b.addObject("musicglue_basket_summary_product_count",a)
})(jQuery);(function(e){var a=function(g){this.selector=g;
this.expires=this.selector.find(".expires span");
this.expired=this.selector.find(".expired");
var h=e(".musicglue_container");
this.minutes_unit=h.attr("data-minutes-unit");
this.seconds_unit=h.attr("data-seconds-unit");
e("body").bind({"reservation_expired.musicglue":_.bind(b,this),"reservation_near_expiry.musicglue":_.bind(d,this),"reservation_not_near_expiry.musicglue":_.bind(c,this)})
};
e.addObject("musicglue_basket_summary_reservation_feedback",a);
var b=function(){this.selector.removeClass("expiring")
};
var d=function(g,h){f.call(this,this.seconds_unit,h)
};
var c=function(g,h){f.call(this,this.minutes_unit,Math.round(h/60))
};
var f=function(g,h){this.selector.addClass("expiring");
this.expires.text(" "+h+" "+g)
}
})(jQuery);(function(e,c){var f=function(h,g){this.summary=h;
this.hover_element=e(g.rollover_trigger);
this.page_id=h.find(".page_id").val();
this.hover_element.live("mouseenter",_.bind(this.show_product_summary,this));
this.hover_element.live("mouseleave",_.bind(this.timer,this));
e("body").bind("basket_total_changed.musicglue",_.bind(this.update_summary,this));
e("body").bind("reservation_polling_complete.musicglue",_.bind(this.update_summary,this))
};
f.prototype={show_product_summary:function(){if(c.basket_cookie.total_items()==0){return
}this.cancel_timer();
if(a){this.summary.hide()
}a=this.summary.show()
},cancel_timer:function(){if(b){window.clearTimeout(b);
b=null
}},timer:function(){b=window.setTimeout(function(){if(a){a.hide()
}},d)
},update_summary:function(){var i=this.summary;
var j=i.find(".loading");
var g=i.find(".view_basket");
var h=i.find(".product_summary");
j.show();
g.hide();
e.get("./basketsummary",{page_id:this.page_id},function(k){h.html(k);
j.hide();
g.show()
})
}};
var d=500;
var b=0;
var a=0;
e.addObject("musicglue_basket_summary_rollover",f)
})(jQuery,ns("MusicGlue.Globals"));(function(b){var a=function(c){this.total=c;
b("body").bind("basket_total_changed.musicglue",_.bind(this.consume_basket_total_changed,this))
};
a.prototype={consume_basket_total_changed:function(d,c){this.total.text(c)
}};
b.addObject("musicglue_basket_summary_total",a)
})(jQuery);(function(a){var b=function(c){this.payment_method_select=c;
this.handling_fee=a(".basket_summary .card_handling_fee");
this.handling_fee_text=this.handling_fee.find(".right");
this.basket_total=this.handling_fee.attr("data-basket-total");
this.postage=this.handling_fee.attr("data-basket-postage");
this.currency=this.handling_fee.attr("data-basket-currency");
this.basket_total_text=a(".basket_summary .total .right");
this.payment_method_select.live("change",_.bind(this.update_payment_fee,this))
};
b.prototype={update_payment_fee:function(){var d=this.handling_fee;
var c=this.handling_fee_text;
var e=this.basket_total_text;
var f=true;
a.ajax({url:"./calculatecardhandlingfee",data:{method:this.payment_method_select.val(),ammount:this.basket_total,postage:this.postage,currency:this.currency},dataType:"json",success:function(g){if(g.hasOwnProperty("payment_fee")&&g.hasOwnProperty("basket_total")){if(a.trim(c.text())==g.payment_fee){f=false
}c.text(g.payment_fee);
e.text(g.basket_total)
}},error:function(){c.text("Error")
},complete:function(){if(f){d.effect("highlight",{},3000)
}}})
}};
a.addObject("musicglue_checkout_card_handling_fee",b)
})(jQuery);(function(b){var a=function(c){this.checkout=c;
var d=this.checkout.find(".payment_type");
d.find("option[value='paypal_express']").attr("disabled",false)
};
b.addObject("musicglue_checkout_enable_paypal",a)
})(jQuery);(function(c,b){var a=function(d){this.body=d;
this.body.find(".submit").hide();
this.body.find(".loading").show()
};
c.addObject("musicglue_checkout_iframe",a)
})(jQuery,ns("MusicGlue.Globals"));(function(b){var a=function(c){this.checkout_form=c;
this.billing_info=this.checkout_form.find(".billing_info");
this.payment_select=this.billing_info.find(".payment_type");
this.fields_not_required_by_paypal=this.billing_info.find("li:not(.pay_pal_required)");
this.payment_select.live("change",_.bind(this.update_billing_ui,this));
this.update_billing_ui()
};
a.prototype={update_billing_ui:function(){if(this.payment_select.val()=="paypal_express"){this.fields_not_required_by_paypal.hide()
}else{this.fields_not_required_by_paypal.show()
}}};
b.addObject("musicglue_checkout",a)
})(jQuery);(function(b,a){var c=function(e){this.checkout_container=e;
var d=this.checkout_container.find(".redirect-url").val();
this.redirect(d)
};
c.prototype={redirect:function(d){window.location=d
}};
b.addObject("musicglue_checkout_paypal_express_redirector",c)
})(jQuery,ns("MusicGlue.Globals"));(function(b){var a=function(c){this.input=c;
this.li=this.input.closest("li");
this.checkout_form=this.li.closest(".checkout_form");
this.input.bind("blur",_.bind(this.validate,this))
};
a.prototype={validate:function(f){var c=this.li;
var d=this.input[0].name;
if(d=="month"&&this.checkout_form.find("input[name=expiry_year]").val()==""){return
}this.checkout_form.ajaxSubmit(b.extend({},{dataType:"json",url:"./checkout/ajaxvalidate",data:{validation_field:d},beforeSubmit:function(e){c.removeClass("error");
c.removeClass("validated");
c.addClass("validating")
},success:function(e){c.removeClass("validating");
if(e.Valid){c.removeClass("error");
c.addClass("validated");
c.removeAttr("title")
}else{c.removeClass("validated");
c.addClass("error");
c.attr("title",e.Message)
}},complete:function(e){c.removeClass("validating")
}}))
}};
b.addObject("musicglue_checkout_validation",a)
})(jQuery);(function(d,c){var a=function(e){this.gig_product=e;
this.products_form=this.gig_product.find(".products_form");
this.products_form.live("submit",_.bind(this.submit_product_form,this))
};
a.prototype={submit_product_form:function(i){i.preventDefault();
if(this.all_product_quantities_are_zero()){return
}var h=this.products_form.find(".add_product_throbber");
var k=h.find(".reserving");
var f=this.products_form;
var l=false;
d.each(f.find(".product"),function(e,m){var n=d(m).find(".quantity select").val();
if(d(m).hasClass("reservable")&&n>0){l=true;
return
}});
h.toggle();
if(l){k.show()
}else{k.hide()
}var j=function(n){h.toggle();
for(var e=0;
e<n.length;
e+=1){var m=f.find("."+n[e].LineId);
m.find(".in_basket").html(n[e].Quantity);
m.find(".quantity").find("select").val("0")
}};
var g=function(e){h.hide();
d.each(e,function(m,o){var n=f.find("."+o.product_id);
n.find(".in_basket").text(o.quantity)
})
};
c.basket.add_tickets(this.products_form,j,g)
},all_product_quantities_are_zero:function(){var e=true;
d.each(this.products_form.serializeArray(),function(f,g){if(g.name.match(/^quantity_/)&&g.value!=0){return e=false
}});
return e
}};
var b=function(){d("body").trigger("basket_total_changed.musicglue",c.basket_cookie.total());
d("body").trigger("basket_quantity_changed.musicglue",c.basket_cookie.total_items())
};
d.addObject("musicglue_gig_product",a)
})(jQuery,ns("MusicGlue.Globals"));(function(b){var a=function(c){this.language_select=c;
this.change_link=this.language_select.find(".detected_language .change");
this.detected_language=this.language_select.find(".detected_language");
this.language_select=this.language_select.find(".select_language");
this.detected_language.show();
this.language_select.hide();
this.change_link.live("click",_.bind(this.show_language_select,this))
};
a.prototype={show_language_select:function(c){this.detected_language.hide();
this.language_select.show();
c.preventDefault()
}};
b.addObject("musicglue_language_select",a)
})(jQuery);(function(b){var a=function(c){this.listings_row=c;
this.gig_product=this.listings_row.closest("tr").next("tr");
this.toggle_link=this.listings_row.find(".tickets .musicglue_tickets");
this.toggle_link.live("click",_.bind(this.show_gig_product,this))
};
a.prototype={show_gig_product:function(c){this.gig_product.toggle();
c.preventDefault()
}};
b.addObject("musicglue_listings_gig_row",a)
})(jQuery);(function(b){var a=function(c){this.listings_search=c;
this.search_box=this.listings_search.find(".search_gigs");
this.search_form=this.listings_search.find(".search_gigs_form");
this.submit_button=this.listings_search.find(".submit");
this.throbber=this.listings_search.find(".search_throbber");
this.no_results_found=b(".no_results_found");
this.timer=null;
this.search_form.live("submit",function(d){d.preventDefault()
});
this.search_box.live("keyup",_.bind(this.consume_input_change,this));
b(window).hashchange(_.bind(this.consume_window_location_change,this));
b(window).hashchange();
this.submit_button.hide()
};
a.prototype={consume_input_change:function(){if(this.timer!=null){this.stopTimer()
}this.startTimer()
},consume_window_location_change:function(){var c=decodeURIComponent(window.location.hash).replace(/^#/,"");
if(c!=this.search_box.val()){this.search_box.val(c);
this.search_box.trigger("keyup");
this.search()
}},search:function(){var c=this;
this.search_form.ajaxSubmit(b.extend({},{dataType:"json",beforeSubmit:function(){c.throbber.toggle()
},success:function(d){if(d.length==0){c.no_results_found.show()
}else{c.no_results_found.hide()
}b(".gig_details").each(function(){if(b.inArray(b(this).attr("id"),d)>=0){b(this).show()
}else{b(this).hide();
b(this).next(".gig_product").hide()
}});
window.location.hash=encodeURIComponent(c.search_box.val())
},complete:function(){c.throbber.toggle()
}}))
},startTimer:function(){var c=this;
this.timer=window.setTimeout(function(){c.timer=null;
c.search()
},500)
},stopTimer:function(){window.clearTimeout(this.timer);
this.timer=null
}};
b.addObject("musicglue_listings_search",a)
})(jQuery);(function(b){var a=function(c){this.location_select=c;
this.change_link=this.location_select.find(".detected_location .change");
this.detected_location=this.location_select.find(".detected_location");
this.location_select=this.location_select.find(".select_location");
this.detected_location.show();
this.location_select.hide();
this.change_link.live("click",_.bind(this.show_location_select,this))
};
a.prototype={show_location_select:function(c){this.detected_location.hide();
this.location_select.show();
c.preventDefault()
}};
b.addObject("musicglue_location_select",a)
})(jQuery);(function(b,a){b.musicglue_page=function(e){var d=e.dom_ready||function(){};
var c=e.identifier||null;
var f=e.redirect_to_basket||function(){};
b(document).ready(function(){if(b(c).length==0){return
}a.basket_cookie=new MusicGlue.BasketCookie();
a.reservation=new MusicGlue.Reservation();
a.basket=new MusicGlue.Basket();
b("body").bind("redirect_to_basket.musicglue",f);
b("body").musicglue_reservation_expiry_monitor({reservation_expires_attr:function(){var g=["data-reservation-expires"];
g.push.apply(g,arguments);
var h=b(c);
return h.attr.apply(h,g)
}});
d.call(this);
b("body").trigger("page_loaded.musicglue")
})
}
})(jQuery,ns("MusicGlue.Globals"));(function(h,i){var k=function(n,o){this.selector=n;
this.reservation_expires_attr=o.reservation_expires_attr||function(){};
this.overlay_selector=".reservation_expired_overlay";
this.overlay_element=h(this.overlay_selector);
this.reserve_button=this.overlay_element.find(".reserve");
this.remove_button=this.overlay_element.find(".remove");
this.countdown=h(".floating_reservation_countdown");
this.countdown_buttons=this.countdown.find("button");
this.countdown_number=this.countdown.find("span");
this.seconds_unit=h(".musicglue_container").attr("data-seconds-unit");
this.reservation_expired_window_has_been_shown_at_least_once=false;
this.fast_update_interval=1000;
this.current_timer_interval=this.slow_update_interval=10000;
this.checking_enabled=false;
this.countdown_buttons.live("click",function(){h("body").trigger("reservation_extension_requested.musicglue")
});
h("body").bind({"page_loaded.musicglue":_.bind(a,this),"reservation_near_expiry.musicglue":_.bind(c,this),"reservation_not_near_expiry.musicglue":_.bind(j,this),"reservation_expired.musicglue":_.bind(e,this),"reservation_expiry_changed.musicglue":_.bind(l,this),"reservation_extension_requested.musicglue":_.bind(b,this),"reservation_crossed_near_expiration_threshold.musicglue":_.bind(m,this)})
};
h.addObject("musicglue_reservation_expiry_monitor",k);
var g=function(){var n=d.call(this);
if(n==0){this.checking_enabled=false;
return
}i.reservation.check_expiry(n);
if(this.checking_enabled){window.setTimeout(_.bind(g,this),this.current_timer_interval)
}};
var b=function(){this.countdown_buttons.attr("disabled",true).blur();
i.reservation.extend_expiry(i.basket_cookie.reservation_id(),d.call(this))
};
var d=function(){var n=this.reservation_expires_attr();
if(!_.isString(n)||n.length==0){return 0
}return parseInt(n)
};
var j=function(){this.countdown.hide();
this.countdown_buttons.attr("disabled",false)
};
var f=function(){this.countdown.appendTo(h("body"))
};
var a=function(){f.call(this);
l.call(this,null,i.basket_cookie.reservation_expires())
};
var e=function(){this.countdown.hide();
this.checking_enabled=false;
var o=this.overlay_selector;
var n=function(){h.modal.close();
h(o).hide().removeClass("reserving removing")
};
if(!this.reservation_expired_window_has_been_shown_at_least_once){this.reserve_button.bind("click",function(){h(o).addClass("reserving");
h.ajax({dataType:"json",success:function(p){if(p==null||p.RedirectToBasket){h("body").trigger("redirect_to_basket.musicglue")
}else{if(p.ReservationInProgress){i.reservation.poll_for_progress({reservation_id:p.ReservationId,on_success:function(){n();
h("body").trigger("reservation_expiry_changed.musicglue",i.basket_cookie.reservation_expires())
}})
}}},type:"POST",url:"./rereserveproducts"})
});
this.remove_button.bind("click",function(){h(o).addClass("removing");
var p=i.basket_cookie.lines();
var q=_(p).chain().select(function(r){return r.Reservable
}).map(function(r){return r.LineId
}).value();
h.ajax({dataType:"json",success:function(r){if(r==null||r.RedirectToBasket){h("body").trigger("redirect_to_basket.musicglue")
}else{n();
h("body").trigger("basket_quantity_changed.musicglue",i.basket_cookie.total_items());
h("body").trigger("basket_total_changed.musicglue",i.basket_cookie.total());
h("body").trigger("reservation_expiry_changed.musicglue",i.basket_cookie.reservation_expires());
_(q).each(function(s){h("body").trigger("basket_line_removed.musicglue",s)
});
h("body").trigger("all_reservable_items_removed.musicglue")
}},type:"POST",url:"./removereservableproducts"})
})
}this.reservation_expired_window_has_been_shown_at_least_once=true;
h(o).show().modal({close:false,overlayCss:{backgroundColor:"#000"}})
};
var l=function(o,n){this.reservation_expires_attr(n||"");
this.current_timer_interval=this.slow_update_interval;
this.checking_enabled=true;
g.call(this)
};
var m=function(){this.current_timer_interval=this.fast_update_interval
};
var c=function(n,o){this.countdown_number.text(o+" "+this.seconds_unit);
this.countdown.show()
}
})(jQuery,ns("MusicGlue.Globals"));(function(b){var a=function(c){this.elements=c;
b("body").bind("adding_product_to_basket.musicglue",_.bind(this.consume_adding_product_to_basket,this));
b("body").bind("beginning_reservation_polling.musicglue",_.bind(this.consume_beginning_reservation_polling,this));
b("body").bind("reservation_polling_complete.musicglue",_.bind(this.consume_reservation_polling_complete,this));
b("body").bind("adding_product_to_basket_complete.musicglue",_.bind(this.consume_adding_product_complete,this))
};
a.prototype={reservation_polling_in_progress:false,consume_adding_product_to_basket:function(){this.elements.attr("disabled",true)
},consume_beginning_reservation_polling:function(){this.reservation_polling_in_progress=true;
this.elements.attr("disabled",true)
},consume_reservation_polling_complete:function(){this.reservation_polling_in_progress=false;
this.elements.attr("disabled",false)
},consume_adding_product_complete:function(){if(!this.reservation_polling_in_progress){this.elements.attr("disabled",false)
}}};
b.addObject("musicglue_shop_disabler",a)
})(jQuery);(function(b){var a=function(c){this.free_download=c;
this.email_input=this.free_download.find(".email_input");
this.feedback=this.free_download.find(".download_feedback");
this.error=this.free_download.find(".download_error");
this.submit_button=this.free_download.find(".submit");
this.free_download.find(".show_download").live("click",_.bind(this.toggle_download_form,this));
this.free_download.submit(_.bind(this.submit_download_form,this))
};
a.prototype={toggle_download_form:function(c){this.free_download.find(".musicglue_download_form").modal({overlayCss:{backgroundColor:"#000"},overlayClose:true,minWidth:350,persist:true});
c.preventDefault()
},submit_download_form:function(d){d.preventDefault();
if(!this.email_input.val().match(this.email_regex)){this.display_error(this.error,".email_invalid");
return
}var c=this;
this.free_download.ajaxSubmit({dataType:"json",beforeSubmit:function(){c.error.hide();
c.error.children().hide();
c.submit_button.attr("disabled",true)
},success:function(e){c.feedback.children().hide();
c.submit_button.attr("disabled",false);
switch(e.responseCode){case 201:if(e.downloadLinks.length==1){if(b.browser.msie){c.display_single_download(c.feedback.find(".download_link_ie"),e.downloadLinks[0].SecureUrl,false)
}else{c.display_single_download(c.feedback.find(".download_link_other"),e.downloadLinks[0].SecureUrl,true)
}}else{c.display_multiple_downloads(c.feedback.find(".multiple_download_links"),e.downloadLinks)
}break;
case 204:c.feedback.find(".email_sent").show();
break;
default:return c.display_error(c.error,".cannot_be_processed")
}c.feedback.slideDown("fast")
},complete:function(){c.submit_button.attr("disabled",false)
}})
},display_error:function(d,c){d.find(c).show();
d.show()
},display_single_download:function(e,c,d){e.find(".download_src").attr("href",c);
e.show();
if(d){window.location=c
}},display_multiple_downloads:function(f,c){var d="";
for(var e=0;
e<c.length;
e++){d+='<li><a href="'+c[e].SecureUrl+'" target="_blank">'+c[e].Title+"</a></li>"
}f.find(".links_list").html(d);
f.show()
},email_regex:/^[a-zA-Z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+(?:[a-zA-Z]{2}|[aA][eE][rR][oO]|[aA][sS][iI][aA]|[bB][iI][zZ]|[cC][aA][tT]|[cC][oO][mM]|[cC][oO][oO][pP]|[eE][dD][uU]|[gG][oO][vV]|[iI][nN][fF][oO]|[iI][nN][tT]|[jJ][oO][bB][sS]|[mM][iI][lL]|[mM][oO][bB][iI]|[mM][uU][sS][eE][uU][mM]|[nN][aA][mM][eE]|[nN][eE][tT]|[oO][rR][gG]|[pP][rR][oO]|[tT][eE][lL]|[tT][rR][aA][vV][eE][lL])$/};
b.addObject("musicglue_shop_free_download",a)
})(jQuery);(function(b){var a=function(c){this.quantity_select=c;
this.product=this.quantity_select.closest(".shop_product");
this.option_select=this.product.find(".options_select");
this.product.bind("option_changed.musicglue",_.bind(this.consume_option_changed,this));
this.update_option_quantity(this.option_select.val())
};
a.prototype={consume_option_changed:function(d,c){this.update_option_quantity(c)
},update_option_quantity:function(e){if(!e){return
}var c="./option/"+e+"/quantity";
this.quantity_select.attr("disabled",true);
this.quantity_select.next(".add").find(".submit").attr("disabled",true);
var d=this.quantity_select;
b.get(c,{selectedquantity:this.quantity_select.val()},function(f){d.html(f);
d.attr("disabled",false);
d.next(".add").find(".submit").attr("disabled",false)
})
}};
b.addObject("musicglue_shop_option_quantity_monitor",a)
})(jQuery);(function(a){var b=function(c){this.option_select=c;
this.product=this.option_select.closest(".shop_product");
this.option_select.change(_.bind(this.trigger_option_changed,this))
};
b.prototype={trigger_option_changed:function(){this.product.trigger("option_changed.musicglue",this.option_select.val())
}};
a.addObject("musicglue_shop_option_select_monitor",b)
})(jQuery);(function(d,c){var a=function(f){this.product=f;
this.display_included_components_link=this.product.find(".included_components_title a");
this.component_title=this.product.find(".component a");
this.variable_price_input=this.product.find(".price_offered");
this.product.submit(_.bind(this.submit_product_form,this));
this.display_included_components_link.click(this.toggle_included_components);
this.component_title.click(this.show_component_details);
this.variable_price_input.keyup(this.validate_price_offered);
d("body").bind("all_reservable_items_removed.musicglue",_.bind(e,this))
};
a.prototype={toggle_included_components:function(f){d(this).closest("p").siblings("ul").slideToggle();
f.preventDefault()
},show_component_details:function(f){d(this).closest(".component").find(".component-information").slideToggle();
f.preventDefault()
},validate_price_offered:function(){var f=d(this).closest("form").find(".submit");
var g=d(this).val();
f.attr("disabled",!g.match(b))
},submit_product_form:function(k){var f=this.product.find(".feedback");
var j=f.find(".quantity_in_basket");
var i=f.find(".in_basket_text");
var h=this.product.find(".add_product_throbber");
h.toggle();
j.text("");
i.hide();
var l=function(m,n){h.toggle();
if(!m){j.text(n)
}i.show()
};
var g=function(m){h.hide();
j.text(m);
i.show()
};
c.basket.add_product(this.product,l,g);
k.preventDefault()
}};
var b=/^\d+(\.\d{1,2})?$/;
var e=function(){var f=this.product.find(".reservable");
f.find(".quantity_in_basket").text("");
f.find(".in_basket_text").hide()
};
d.addObject("musicglue_shop_product_line",a)
})(jQuery,ns("MusicGlue.Globals"));(function(b){var a=function(c){this.whats_this_link=c;
this.whats_this_link.live("click",_.bind(this.show_whats_this,this))
};
a.prototype={show_whats_this:function(f){var d=b(f.target).attr("data-whats-this");
var c=b("."+d+"_whats_this");
c.modal({overlayCss:{backgroundColor:"#000"},overlayClose:true});
f.preventDefault()
}};
b.addObject("musicglue_whats_this",a)
})(jQuery);(function(c,b){c.musicglue_page({identifier:".musicglue_basket_container",dom_ready:function(){c(".navigation").musicglue_basket_navigation();
c(".basket_form > .pricing").musicglue_basket_pricing_summary();
c(".button_remove").musicglue_basket_disabler();
c(".quantity_select").musicglue_basket_disabler();
c(".button_remove").musicglue_basket_disabler();
c(".checkout_button").musicglue_basket_disabler();
c(".basket .line").each(function(){c(this).musicglue_basket_product_line()
});
c(".pricing .whats_this_link").musicglue_whats_this();
var d=c(".basket_form");
d.find(".update_button, .refresh_guidance").hide();
c("body").bind("all_reservable_items_removed.musicglue",function(){if(b.basket_cookie.lines().length==0){a()
}});
if(!b.basket_cookie.reservation_in_progress()){return
}b.reservation.poll_for_progress({reservation_id:b.basket_cookie.reservation_id(),on_success:function(e){_(e).each(function(f){d.find(".basket_error").remove();
c("body").trigger("basket.line_changed",f.product_id+f.option_ids)
});
c("body").trigger("reservation_expiry_changed.musicglue",b.basket_cookie.reservation_expires());
c("body").trigger("basket_updating_complete.musicglue")
}})
},redirect_to_basket:function(){window.location.reload(true)
}});
var a=function(){window.location.reload(true)
}
})(jQuery,ns("MusicGlue.Globals"));(function(b,a){b.musicglue_page({identifier:".musicglue_checkout_container",dom_ready:function(){b(".checkout_form").musicglue_checkout();
b(".checkout_form").musicglue_checkout_enable_paypal();
b(".checkout_form .payment_type").musicglue_checkout_card_handling_fee();
b(".checkout_form input").each(function(){b(this).musicglue_checkout_validation()
});
b(".checkout_basket_summary .whats_this_link").musicglue_whats_this();
b("body").bind("all_reservable_items_removed.musicglue",function(){b("body").trigger("redirect_to_basket.musicglue")
})
},redirect_to_basket:function(){var c=window.location.href;
window.location=c.replace(/checkout.*$/,"basket")
}})
})(jQuery,ns("MusicGlue.Globals"));(function(a){a.musicglue_page({identifier:".musicglue_container",dom_ready:function(){a(".location_select").musicglue_location_select();
a(".language_select").musicglue_language_select();
a(".basket_summary_product_count").musicglue_basket_summary_product_count();
a(".basket_summary_total").musicglue_basket_summary_total();
a(".basket_summary_in_shop").musicglue_basket_summary_reservation_feedback()
}})
})(jQuery);(function(a){a.musicglue_page({identifier:".musicglue_gig_details_container",dom_ready:function(){a(".gig_product").each(function(){a(this).musicglue_gig_product()
});
a(".products_form .add .submit, .gig_product .quantity_select").each(function(){a(this).musicglue_shop_disabler()
})
},redirect_to_basket:function(){window.location="./basket/"
}})
})(jQuery);(function(a){a.musicglue_page({identifier:".musicglue_listings_container",dom_ready:function(){a(".listings_search").musicglue_listings_search();
a(".listings .gig_details").each(function(){a(this).musicglue_listings_gig_row()
});
a(".gig_product").each(function(){a(this).musicglue_gig_product()
});
a(".gig_product .quantity_select").each(function(){a(this).musicglue_shop_disabler()
});
a(".products_form .add .submit").each(function(){a(this).musicglue_shop_disabler()
})
},redirect_to_basket:function(){window.location="./basket/"
}})
})(jQuery);(function(b,a){b.musicglue_page({identifier:".musicglue_paypal_express_redirect",dom_ready:function(){b(".musicglue_paypal_express_redirect").musicglue_checkout_paypal_express_redirector();
b(".musicglue_paypal_express_redirect").musicglue_checkout_iframe()
},redirect_to_basket:function(){var c=window.location.href;
window.location=c.replace(/checkout.*$/,"basket")
}})
})(jQuery,ns("MusicGlue.Globals"));(function(b,a){b.musicglue_page({identifier:".musicglue_shop_container",dom_ready:function(){b(".product_form:not(.free_product_form)").each(function(){b(this).musicglue_shop_product_line()
});
b(".free_product_form").each(function(){b(this).musicglue_shop_free_download()
});
b(".options_select").each(function(){b(this).musicglue_shop_option_select_monitor()
});
b(".quantity_select").each(function(){b(this).musicglue_shop_option_quantity_monitor()
});
b(".quantity_select").musicglue_shop_disabler();
b(".options_select").musicglue_shop_disabler();
b(".product_form .add .submit").musicglue_shop_disabler()
},redirect_to_basket:function(){window.location="./basket/"
}})
})(jQuery,ns("MusicGlue.Globals"));(function(b,a){b.musicglue_page({identifier:".musicglue_three_d_secure_redirect",dom_ready:function(){b(".musicglue_three_d_secure_redirect").musicglue_checkout_iframe()
},redirect_to_basket:function(){var c=window.location.href;
window.location=c.replace(/checkout.*$/,"basket")
}})
})(jQuery,ns("MusicGlue.Globals"));

