(function(){var W=this,ac,F=W.jQuery,S=W.$,T=W.jQuery=W.$=function(b,a){return new T.fn.init(b,a)},M=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,ad=/^.[^:#\[\.,]*$/;T.fn=T.prototype={init:function(e,b){e=e||document;if(e.nodeType){this[0]=e;this.length=1;this.context=e;return this}if(typeof e==="string"){var c=M.exec(e);if(c&&(c[1]||!b)){if(c[1]){e=T.clean([c[1]],b)}else{var a=document.getElementById(c[3]);if(a&&a.id!=c[3]){return T().find(e)}var d=T(a||[]);d.context=document;d.selector=e;return d}}else{return T(b).find(e)}}else{if(T.isFunction(e)){return T(document).ready(e)}}if(e.selector&&e.context){this.selector=e.selector;this.context=e.context}return this.setArray(T.isArray(e)?e:T.makeArray(e))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(a){return a===ac?Array.prototype.slice.call(this):this[a]},pushStack:function(c,a,d){var b=T(c);b.prevObject=this;b.context=this.context;if(a==="find"){b.selector=this.selector+(this.selector?" ":"")+d}else{if(a){b.selector=this.selector+"."+a+"("+d+")"}}return b},setArray:function(a){this.length=0;Array.prototype.push.apply(this,a);return this},each:function(a,b){return T.each(this,a,b)},index:function(a){return T.inArray(a&&a.jquery?a[0]:a,this)},attr:function(c,a,b){var d=c;if(typeof c==="string"){if(a===ac){return this[0]&&T[b||"attr"](this[0],c)}else{d={};d[c]=a}}return this.each(function(e){for(c in d){T.attr(b?this.style:this,c,T.prop(this,d[c],b,e,c))}})},css:function(b,a){if((b=="width"||b=="height")&&parseFloat(a)<0){a=ac}return this.attr(b,a,"curCSS")},text:function(a){if(typeof a!=="object"&&a!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(a))}var b="";T.each(a||this,function(){T.each(this.childNodes,function(){if(this.nodeType!=8){b+=this.nodeType!=1?this.nodeValue:T.fn.text([this])}})});return b},wrapAll:function(b){if(this[0]){var a=T(b,this[0].ownerDocument).clone();if(this[0].parentNode){a.insertBefore(this[0])}a.map(function(){var c=this;while(c.firstChild){c=c.firstChild}return c}).append(this)}return this},wrapInner:function(a){return this.each(function(){T(this).contents().wrapAll(a)})},wrap:function(a){return this.each(function(){T(this).wrapAll(a)})},append:function(){return this.domManip(arguments,true,function(a){if(this.nodeType==1){this.appendChild(a)}})},prepend:function(){return this.domManip(arguments,true,function(a){if(this.nodeType==1){this.insertBefore(a,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(a){this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,false,function(a){this.parentNode.insertBefore(a,this.nextSibling)})},end:function(){return this.prevObject||T([])},push:[].push,sort:[].sort,splice:[].splice,find:function(b){if(this.length===1){var a=this.pushStack([],"find",b);a.length=0;T.find(b,this[0],a);return a}else{return this.pushStack(T.unique(T.map(this,function(c){return T.find(b,c)})),"find",b)}},clone:function(b){var d=this.map(function(){if(!T.support.noCloneEvent&&!T.isXMLDoc(this)){var f=this.outerHTML;if(!f){var e=this.ownerDocument.createElement("div");e.appendChild(this.cloneNode(true));f=e.innerHTML}return T.clean([f.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(b===true){var a=this.find("*").andSelf(),c=0;d.find("*").andSelf().each(function(){if(this.nodeName!==a[c].nodeName){return}var g=T.data(a[c],"events");for(var e in g){for(var f in g[e]){T.event.add(this,e,g[e][f],g[e][f].data)}}c++})}return d},filter:function(a){return this.pushStack(T.isFunction(a)&&T.grep(this,function(b,c){return a.call(b,c)})||T.multiFilter(a,T.grep(this,function(b){return b.nodeType===1})),"filter",a)},closest:function(c){var a=T.expr.match.POS.test(c)?T(c):null,b=0;return this.map(function(){var d=this;while(d&&d.ownerDocument){if(a?a.index(d)>-1:T(d).is(c)){T.data(d,"closest",b);return d}d=d.parentNode;b++}})},not:function(b){if(typeof b==="string"){if(ad.test(b)){return this.pushStack(T.multiFilter(b,this,true),"not",b)}else{b=T.multiFilter(b,this)}}var a=b.length&&b[b.length-1]!==ac&&!b.nodeType;return this.filter(function(){return a?T.inArray(this,b)<0:this!=b})},add:function(a){return this.pushStack(T.unique(T.merge(this.get(),typeof a==="string"?T(a):T.makeArray(a))))},is:function(a){return !!a&&T.multiFilter(a,this).length>0},hasClass:function(a){return !!a&&this.is("."+a)},val:function(c){if(c===ac){var i=this[0];if(i){if(T.nodeName(i,"option")){return(i.attributes.value||{}).specified?i.value:i.text}if(T.nodeName(i,"select")){var e=i.selectedIndex,b=[],a=i.options,f=i.type=="select-one";if(e<0){return null}for(var h=f?e:0,d=f?e+1:a.length;h<d;h++){var g=a[h];if(g.selected){c=T(g).val();if(f){return c}b.push(c)}}return b}return(i.value||"").replace(/\r/g,"")}return ac}if(typeof c==="number"){c+=""}return this.each(function(){if(this.nodeType!=1){return}if(T.isArray(c)&&/radio|checkbox/.test(this.type)){this.checked=(T.inArray(this.value,c)>=0||T.inArray(this.name,c)>=0)}else{if(T.nodeName(this,"select")){var j=T.makeArray(c);T("option",this).each(function(){this.selected=(T.inArray(this.value,j)>=0||T.inArray(this.text,j)>=0)});if(!j.length){this.selectedIndex=-1}}else{this.value=c}}})},html:function(a){return a===ac?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(a)},replaceWith:function(a){return this.after(a).remove()},eq:function(a){return this.slice(a,+a+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(a){return this.pushStack(T.map(this,function(b,c){return a.call(b,c,b)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(d,a,b){if(this[0]){var e=(this[0].ownerDocument||this[0]).createDocumentFragment(),h=T.clean(d,(this[0].ownerDocument||this[0]),e),f=e.firstChild;if(f){for(var g=0,i=this.length;g<i;g++){b.call(c(this[g],f),this.length>1||g>0?e.cloneNode(true):e)}}if(h){T.each(h,E)}}return this;function c(k,j){return a&&T.nodeName(k,"table")&&T.nodeName(j,"tr")?(k.getElementsByTagName("tbody")[0]||k.appendChild(k.ownerDocument.createElement("tbody"))):k}}};T.fn.init.prototype=T.fn;function E(b,a){if(a.src){T.ajax({url:a.src,async:false,dataType:"script"})}else{T.globalEval(a.text||a.textContent||a.innerHTML||"")}if(a.parentNode){a.parentNode.removeChild(a)}}function ae(){return +new Date}T.extend=T.fn.extend=function(){var c=arguments[0]||{},e=1,d=arguments.length,h=false,f;if(typeof c==="boolean"){h=c;c=arguments[1]||{};e=2}if(typeof c!=="object"&&!T.isFunction(c)){c={}}if(d==e){c=this;--e}for(;e<d;e++){if((f=arguments[e])!=null){for(var g in f){var b=c[g],a=f[g];if(c===a){continue}if(h&&a&&typeof a==="object"&&!a.nodeType){c[g]=T.extend(h,b||(a.length!=null?[]:{}),a)}else{if(a!==ac){c[g]=a}}}}}return c};var ah=/z-?index|font-?weight|opacity|zoom|line-?height/i,Q=document.defaultView||{},L=Object.prototype.toString;T.extend({noConflict:function(a){W.$=S;if(a){W.jQuery=F}return T},isFunction:function(a){return L.call(a)==="[object Function]"},isArray:function(a){return L.call(a)==="[object Array]"},isXMLDoc:function(a){return a.nodeType===9&&a.documentElement.nodeName!=="HTML"||!!a.ownerDocument&&T.isXMLDoc(a.ownerDocument)},globalEval:function(a){if(a&&/\S/.test(a)){var b=document.getElementsByTagName("head")[0]||document.documentElement,c=document.createElement("script");c.type="text/javascript";if(T.support.scriptEval){c.appendChild(document.createTextNode(a))}else{c.text=a}b.insertBefore(c,b.firstChild);b.removeChild(c)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()==b.toUpperCase()},each:function(e,a,f){var g,d=0,c=e.length;if(f){if(c===ac){for(g in e){if(a.apply(e[g],f)===false){break}}}else{for(;d<c;){if(a.apply(e[d++],f)===false){break}}}}else{if(c===ac){for(g in e){if(a.call(e[g],g,e[g])===false){break}}}else{for(var b=e[0];d<c&&a.call(b,d,b)!==false;b=e[++d]){}}}return e},prop:function(b,a,c,d,e){if(T.isFunction(a)){a=a.call(b,d)}return typeof a==="number"&&c=="curCSS"&&!ah.test(e)?a+"px":a},className:{add:function(b,a){T.each((a||"").split(/\s+/),function(d,c){if(b.nodeType==1&&!T.className.has(b.className,c)){b.className+=(b.className?" ":"")+c}})},remove:function(b,a){if(b.nodeType==1){b.className=a!==ac?T.grep(b.className.split(/\s+/),function(c){return !T.className.has(a,c)}).join(" "):""}},has:function(a,b){return a&&T.inArray(b,(a.className||a).toString().split(/\s+/))>-1}},swap:function(b,c,a){var e={};for(var d in c){e[d]=b.style[d];b.style[d]=c[d]}a.call(b);for(var d in c){b.style[d]=e[d]}},css:function(e,g,c,h){if(g=="width"||g=="height"){var a,f={position:"absolute",visibility:"hidden",display:"block"},b=g=="width"?["Left","Right"]:["Top","Bottom"];function d(){a=g=="width"?e.offsetWidth:e.offsetHeight;if(h==="border"){return}T.each(b,function(){if(!h){a-=parseFloat(T.curCSS(e,"padding"+this,true))||0}if(h==="margin"){a+=parseFloat(T.curCSS(e,"margin"+this,true))||0}else{a-=parseFloat(T.curCSS(e,"border"+this+"Width",true))||0}})}if(e.offsetWidth!==0){d()}else{T.swap(e,f,d)}return Math.max(0,Math.round(a))}return T.curCSS(e,g,c)},curCSS:function(e,h,g){var b,i=e.style;if(h=="opacity"&&!T.support.opacity){b=T.attr(i,"opacity");return b==""?"1":b}if(h.match(/float/i)){h=H}if(!g&&i&&i[h]){b=i[h]}else{if(Q.getComputedStyle){if(h.match(/float/i)){h="float"}h=h.replace(/([A-Z])/g,"-$1").toLowerCase();var a=Q.getComputedStyle(e,null);if(a){b=a.getPropertyValue(h)}if(h=="opacity"&&b==""){b="1"}}else{if(e.currentStyle){var d=h.replace(/\-(\w)/g,function(k,j){return j.toUpperCase()});b=e.currentStyle[h]||e.currentStyle[d];if(!/^\d+(px)?$/i.test(b)&&/^\d/.test(b)){var f=i.left,c=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left;i.left=b||0;b=i.pixelLeft+"px";i.left=f;e.runtimeStyle.left=c}}}}return b},clean:function(g,b,d){b=b||document;if(typeof b.createElement==="undefined"){b=b.ownerDocument||b[0]&&b[0].ownerDocument||document}if(!d&&g.length===1&&typeof g[0]==="string"){var e=/^<(\w+)\s*\/?>$/.exec(g[0]);if(e){return[b.createElement(e[1])]}}var f=[],h=[],a=b.createElement("div");T.each(g,function(l,i){if(typeof i==="number"){i+=""}if(!i){return}if(typeof i==="string"){i=i.replace(/(<(\w+)[^>]*?)\/>/g,function(q,p,r){return r.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?q:p+"></"+r+">"});var m=i.replace(/^\s+/,"").substring(0,10).toLowerCase();var k=!m.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!m.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||m.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!m.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!m.indexOf("<td")||!m.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!m.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!T.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];a.innerHTML=k[1]+i+k[2];while(k[0]--){a=a.lastChild}if(!T.support.tbody){var j=/<tbody/i.test(i),n=!m.indexOf("<table")&&!j?a.firstChild&&a.firstChild.childNodes:k[1]=="<table>"&&!j?a.childNodes:[];for(var o=n.length-1;o>=0;--o){if(T.nodeName(n[o],"tbody")&&!n[o].childNodes.length){n[o].parentNode.removeChild(n[o])}}}if(!T.support.leadingWhitespace&&/^\s/.test(i)){a.insertBefore(b.createTextNode(i.match(/^\s*/)[0]),a.firstChild)}i=T.makeArray(a.childNodes)}if(i.nodeType){f.push(i)}else{f=T.merge(f,i)}});if(d){for(var c=0;f[c];c++){if(T.nodeName(f[c],"script")&&(!f[c].type||f[c].type.toLowerCase()==="text/javascript")){h.push(f[c].parentNode?f[c].parentNode.removeChild(f[c]):f[c])}else{if(f[c].nodeType===1){f.splice.apply(f,[c+1,0].concat(T.makeArray(f[c].getElementsByTagName("script"))))}d.appendChild(f[c])}}return h}return f},attr:function(c,f,b){if(!c||c.nodeType==3||c.nodeType==8){return ac}var e=!T.isXMLDoc(c),a=b!==ac;f=e&&T.props[f]||f;if(c.tagName){var g=/href|src|style/.test(f);if(f=="selected"&&c.parentNode){c.parentNode.selectedIndex}if(f in c&&e&&!g){if(a){if(f=="type"&&T.nodeName(c,"input")&&c.parentNode){throw"type property can't be changed"}c[f]=b}if(T.nodeName(c,"form")&&c.getAttributeNode(f)){return c.getAttributeNode(f).nodeValue}if(f=="tabIndex"){var d=c.getAttributeNode("tabIndex");return d&&d.specified?d.value:c.nodeName.match(/(button|input|object|select|textarea)/i)?0:c.nodeName.match(/^(a|area)$/i)&&c.href?0:ac}return c[f]}if(!T.support.style&&e&&f=="style"){return T.attr(c.style,"cssText",b)}if(a){c.setAttribute(f,""+b)}var h=!T.support.hrefNormalized&&e&&g?c.getAttribute(f,2):c.getAttribute(f);return h===null?ac:h}if(!T.support.opacity&&f=="opacity"){if(a){c.zoom=1;c.filter=(c.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(b)+""=="NaN"?"":"alpha(opacity="+b*100+")")}return c.filter&&c.filter.indexOf("opacity=")>=0?(parseFloat(c.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}f=f.replace(/-([a-z])/ig,function(j,i){return i.toUpperCase()});if(a){c[f]=b}return c[f]},trim:function(a){return(a||"").replace(/^\s+|\s+$/g,"")},makeArray:function(a){var c=[];if(a!=null){var b=a.length;if(b==null||typeof a==="string"||T.isFunction(a)||a.setInterval){c[0]=a}else{while(b){c[--b]=a[b]}}}return c},inArray:function(b,a){for(var d=0,c=a.length;d<c;d++){if(a[d]===b){return d}}return -1},merge:function(b,e){var d=0,c,a=b.length;if(!T.support.getAll){while((c=e[d++])!=null){if(c.nodeType!=8){b[a++]=c}}}else{while((c=e[d++])!=null){b[a++]=c}}return b},unique:function(a){var f=[],g={};try{for(var e=0,d=a.length;e<d;e++){var b=T.data(a[e]);if(!g[b]){g[b]=true;f.push(a[e])}}}catch(c){f=a}return f},grep:function(e,a,f){var d=[];for(var c=0,b=e.length;c<b;c++){if(!f!=!a(e[c],c)){d.push(e[c])}}return d},map:function(f,a){var e=[];for(var d=0,c=f.length;d<c;d++){var b=a(f[d],d);if(b!=null){e[e.length]=b}}return e.concat.apply([],e)}});var O=navigator.userAgent.toLowerCase();T.browser={version:(O.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(O),opera:/opera/.test(O),msie:/msie/.test(O)&&!/opera/.test(O),mozilla:/mozilla/.test(O)&&!/(compatible|webkit)/.test(O)};T.each({parent:function(a){return a.parentNode},parents:function(a){return T.dir(a,"parentNode")},next:function(a){return T.nth(a,2,"nextSibling")},prev:function(a){return T.nth(a,2,"previousSibling")},nextAll:function(a){return T.dir(a,"nextSibling")},prevAll:function(a){return T.dir(a,"previousSibling")},siblings:function(a){return T.sibling(a.parentNode.firstChild,a)},children:function(a){return T.sibling(a.firstChild)},contents:function(a){return T.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:T.makeArray(a.childNodes)}},function(b,a){T.fn[b]=function(d){var c=T.map(this,a);if(d&&typeof d=="string"){c=T.multiFilter(d,c)}return this.pushStack(T.unique(c),b,d)}});T.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(b,a){T.fn[b]=function(h){var e=[],c=T(h);for(var d=0,g=c.length;d<g;d++){var f=(d>0?this.clone(true):this).get();T.fn[a].apply(T(c[d]),f);e=e.concat(f)}return this.pushStack(e,b,h)}});T.each({removeAttr:function(a){T.attr(this,a,"");if(this.nodeType==1){this.removeAttribute(a)}},addClass:function(a){T.className.add(this,a)},removeClass:function(a){T.className.remove(this,a)},toggleClass:function(a,b){if(typeof b!=="boolean"){b=!T.className.has(this,a)}T.className[b?"add":"remove"](this,a)},remove:function(a){if(!a||T.filter(a,[this]).length){T("*",this).add([this]).each(function(){T.event.remove(this);T.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){T(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(b,a){T.fn[b]=function(){return this.each(a,arguments)}});function Y(b,a){return b[0]&&parseInt(T.curCSS(b[0],a,true),10)||0}var aa="jQuery"+ae(),I=0,R={};T.extend({cache:{},data:function(c,d,b){c=c==W?R:c;var a=c[aa];if(!a){a=c[aa]=++I}if(d&&!T.cache[a]){T.cache[a]={}}if(b!==ac){T.cache[a][d]=b}return d?T.cache[a][d]:a},removeData:function(c,d){c=c==W?R:c;var a=c[aa];if(d){if(T.cache[a]){delete T.cache[a][d];d="";for(d in T.cache[a]){break}if(!d){T.removeData(c)}}}else{try{delete c[aa]}catch(b){if(c.removeAttribute){c.removeAttribute(aa)}}delete T.cache[a]}},queue:function(c,d,a){if(c){d=(d||"fx")+"queue";var b=T.data(c,d);if(!b||T.isArray(a)){b=T.data(c,d,T.makeArray(a))}else{if(a){b.push(a)}}}return b},dequeue:function(a,b){var d=T.queue(a,b),c=d.shift();if(!b||b==="fx"){c=d[0]}if(c!==ac){c.call(a)}}});T.fn.extend({data:function(d,b){var a=d.split(".");a[1]=a[1]?"."+a[1]:"";if(b===ac){var c=this.triggerHandler("getData"+a[1]+"!",[a[0]]);if(c===ac&&this.length){c=T.data(this[0],d)}return c===ac&&a[1]?this.data(a[0]):c}else{return this.trigger("setData"+a[1]+"!",[a[0],b]).each(function(){T.data(this,d,b)})}},removeData:function(a){return this.each(function(){T.removeData(this,a)})},queue:function(b,a){if(typeof b!=="string"){a=b;b="fx"}if(a===ac){return T.queue(this[0],b)}return this.each(function(){var c=T.queue(this,b,a);if(b=="fx"&&c.length==1){c[0].call(this)}})},dequeue:function(a){return this.each(function(){T.dequeue(this,a)})}});(function(){var b=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,h=0,l=Object.prototype.toString;var n=function(r,v,aj,D){aj=aj||[];v=v||document;if(v.nodeType!==1&&v.nodeType!==9){return[]}if(!r||typeof r!=="string"){return aj}var q=[],t,A,x,w,C,u,s=true;b.lastIndex=0;while((t=b.exec(r))!==null){q.push(t[1]);if(t[2]){u=RegExp.rightContext;break}}if(q.length>1&&g.exec(r)){if(q.length===2&&k.relative[q[0]]){A=j(q[0]+q[1],v)}else{A=k.relative[q[0]]?[v]:n(q.shift(),v);while(q.length){r=q.shift();if(k.relative[r]){r+=q.shift()}A=j(r,A)}}}else{var B=D?{expr:q.pop(),set:o(D)}:n.find(q.pop(),q.length===1&&v.parentNode?v.parentNode:v,c(v));A=n.filter(B.expr,B.set);if(q.length>0){x=o(A)}else{s=false}while(q.length){var y=q.pop(),z=y;if(!k.relative[y]){y=""}else{z=q.pop()}if(z==null){z=v}k.relative[y](x,z,c(v))}}if(!x){x=A}if(!x){throw"Syntax error, unrecognized expression: "+(y||r)}if(l.call(x)==="[object Array]"){if(!s){aj.push.apply(aj,x)}else{if(v.nodeType===1){for(var p=0;x[p]!=null;p++){if(x[p]&&(x[p]===true||x[p].nodeType===1&&i(v,x[p]))){aj.push(A[p])}}}else{for(var p=0;x[p]!=null;p++){if(x[p]&&x[p].nodeType===1){aj.push(A[p])}}}}}else{o(x,aj)}if(u){n(u,v,aj,D);if(m){hasDuplicate=false;aj.sort(m);if(hasDuplicate){for(var p=1;p<aj.length;p++){if(aj[p]===aj[p-1]){aj.splice(p--,1)}}}}}return aj};n.matches=function(q,p){return n(q,null,null,p)};n.find=function(p,w,x){var q,s;if(!p){return[]}for(var t=0,u=k.order.length;t<u;t++){var r=k.order[t],s;if((s=k.match[r].exec(p))){var v=RegExp.leftContext;if(v.substr(v.length-1)!=="\\"){s[1]=(s[1]||"").replace(/\\/g,"");q=k.find[r](s,w,x);if(q!=null){p=p.replace(k.match[r],"");break}}}}if(!q){q=w.getElementsByTagName("*")}return{set:q,expr:p}};n.filter=function(C,D,z,t){var u=C,x=[],p=D,r,w,q=D&&D[0]&&c(D[0]);while(C&&D.length){for(var aj in k.filter){if((r=k.match[aj].exec(C))!=null){var v=k.filter[aj],y,A;w=false;if(p==x){x=[]}if(k.preFilter[aj]){r=k.preFilter[aj](r,p,z,x,t,q);if(!r){w=y=true}else{if(r===true){continue}}}if(r){for(var s=0;(A=p[s])!=null;s++){if(A){y=v(A,r,s,p);var B=t^!!y;if(z&&y!=null){if(B){w=true}else{p[s]=false}}else{if(B){x.push(A);w=true}}}}}if(y!==ac){if(!z){p=x}C=C.replace(k.match[aj],"");if(!w){return[]}break}}}if(C==u){if(w==null){throw"Syntax error, unrecognized expression: "+C}else{break}}u=C}return p};var k=n.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(p){return p.getAttribute("href")}},relative:{"+":function(p,w,q){var s=typeof w==="string",x=s&&!/\W/.test(w),r=s&&!x;if(x&&!q){w=w.toUpperCase()}for(var t=0,u=p.length,v;t<u;t++){if((v=p[t])){while((v=v.previousSibling)&&v.nodeType!==1){}p[t]=r||v&&v.nodeName===w?v||false:v===w}}if(r){n.filter(w,p,true)}},">":function(u,r,t){var w=typeof r==="string";if(w&&!/\W/.test(r)){r=t?r:r.toUpperCase();for(var q=0,s=u.length;q<s;q++){var v=u[q];if(v){var p=v.parentNode;u[q]=p.nodeName===r?p:false}}}else{for(var q=0,s=u.length;q<s;q++){var v=u[q];if(v){u[q]=w?v.parentNode:v.parentNode===r}}if(w){n.filter(r,u,true)}}},"":function(p,r,t){var q=h++,s=a;if(!r.match(/\W/)){var u=r=t?r:r.toUpperCase();s=d}s("parentNode",r,q,p,u,t)},"~":function(p,r,t){var q=h++,s=a;if(typeof r==="string"&&!r.match(/\W/)){var u=r=t?r:r.toUpperCase();s=d}s("previousSibling",r,q,p,u,t)}},find:{ID:function(r,q,p){if(typeof q.getElementById!=="undefined"&&!p){var s=q.getElementById(r[1]);return s?[s]:[]}},NAME:function(q,u,t){if(typeof u.getElementsByName!=="undefined"){var r=[],v=u.getElementsByName(q[1]);for(var p=0,s=v.length;p<s;p++){if(v[p].getAttribute("name")===q[1]){r.push(v[p])}}return r.length===0?null:r}},TAG:function(q,p){return p.getElementsByTagName(q[1])}},preFilter:{CLASS:function(p,r,q,s,u,t){p=" "+p[1].replace(/\\/g,"")+" ";if(t){return p}for(var w=0,v;(v=r[w])!=null;w++){if(v){if(u^(v.className&&(" "+v.className+" ").indexOf(p)>=0)){if(!q){s.push(v)}}else{if(q){r[w]=false}}}}return false},ID:function(p){return p[1].replace(/\\/g,"")},TAG:function(q,r){for(var p=0;r[p]===false;p++){}return r[p]&&c(r[p])?q[1]:q[1].toUpperCase()},CHILD:function(q){if(q[1]=="nth"){var p=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(q[2]=="even"&&"2n"||q[2]=="odd"&&"2n+1"||!/\D/.test(q[2])&&"0n+"+q[2]||q[2]);q[2]=(p[1]+(p[2]||1))-0;q[3]=p[3]-0}q[0]=h++;return q},ATTR:function(v,r,q,s,u,t){var p=v[1].replace(/\\/g,"");if(!t&&k.attrMap[p]){v[1]=k.attrMap[p]}if(v[2]==="~="){v[4]=" "+v[4]+" "}return v},PSEUDO:function(u,r,q,s,t){if(u[1]==="not"){if(u[3].match(b).length>1||/^\w/.test(u[3])){u[3]=n(u[3],null,null,r)}else{var p=n.filter(u[3],r,q,true^t);if(!q){s.push.apply(s,p)}return false}}else{if(k.match.POS.test(u[0])||k.match.CHILD.test(u[0])){return true}}return u},POS:function(p){p.unshift(true);return p}},filters:{enabled:function(p){return p.disabled===false&&p.type!=="hidden"},disabled:function(p){return p.disabled===true},checked:function(p){return p.checked===true},selected:function(p){p.parentNode.selectedIndex;return p.selected===true},parent:function(p){return !!p.firstChild},empty:function(p){return !p.firstChild},has:function(p,q,r){return !!n(r[3],p).length},header:function(p){return/h\d/i.test(p.nodeName)},text:function(p){return"text"===p.type},radio:function(p){return"radio"===p.type},checkbox:function(p){return"checkbox"===p.type},file:function(p){return"file"===p.type},password:function(p){return"password"===p.type},submit:function(p){return"submit"===p.type},image:function(p){return"image"===p.type},reset:function(p){return"reset"===p.type},button:function(p){return"button"===p.type||p.nodeName.toUpperCase()==="BUTTON"},input:function(p){return/input|select|textarea|button/i.test(p.nodeName)}},setFilters:{first:function(p,q){return q===0},last:function(q,r,s,p){return r===p.length-1},even:function(p,q){return q%2===0},odd:function(p,q){return q%2===1},lt:function(p,q,r){return q<r[3]-0},gt:function(p,q,r){return q>r[3]-0},nth:function(p,q,r){return r[3]-0==q},eq:function(p,q,r){return r[3]-0==q}},filter:{PSEUDO:function(u,q,p,t){var r=q[1],w=k.filters[r];if(w){return w(u,p,q,t)}else{if(r==="contains"){return(u.textContent||u.innerText||"").indexOf(q[3])>=0}else{if(r==="not"){var v=q[3];for(var p=0,s=v.length;p<s;p++){if(v[p]===u){return false}}return true}}}},CHILD:function(w,t){var q=t[1],v=w;switch(q){case"only":case"first":while(v=v.previousSibling){if(v.nodeType===1){return false}}if(q=="first"){return true}v=w;case"last":while(v=v.nextSibling){if(v.nodeType===1){return false}}return true;case"nth":var u=t[2],x=t[3];if(u==1&&x==0){return true}var r=t[0],y=w.parentNode;if(y&&(y.sizcache!==r||!w.nodeIndex)){var s=0;for(v=y.firstChild;v;v=v.nextSibling){if(v.nodeType===1){v.nodeIndex=++s}}y.sizcache=r}var p=w.nodeIndex-x;if(u==0){return p==0}else{return(p%u==0&&p/u>=0)}}},ID:function(p,q){return p.nodeType===1&&p.getAttribute("id")===q},TAG:function(p,q){return(q==="*"&&p.nodeType===1)||p.nodeName===q},CLASS:function(p,q){return(" "+(p.className||p.getAttribute("class"))+" ").indexOf(q)>-1},ATTR:function(u,p){var q=p[1],s=k.attrHandle[q]?k.attrHandle[q](u):u[q]!=null?u[q]:u.getAttribute(q),t=s+"",v=p[2],r=p[4];return s==null?v==="!=":v==="="?t===r:v==="*="?t.indexOf(r)>=0:v==="~="?(" "+t+" ").indexOf(r)>=0:!r?t&&s!==false:v==="!="?t!=r:v==="^="?t.indexOf(r)===0:v==="$="?t.substr(t.length-r.length)===r:v==="|="?t===r||t.substr(0,r.length+1)===r+"-":false},POS:function(u,r,q,t){var s=r[2],p=k.setFilters[s];if(p){return p(u,q,r,t)}}}};var g=k.match.POS;for(var e in k.match){k.match[e]=RegExp(k.match[e].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var o=function(p,q){p=Array.prototype.slice.call(p);if(q){q.push.apply(q,p);return q}return p};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(f){o=function(t,p){var r=p||[];if(l.call(t)==="[object Array]"){Array.prototype.push.apply(r,t)}else{if(typeof t.length==="number"){for(var q=0,s=t.length;q<s;q++){r.push(t[q])}}else{for(var q=0;t[q];q++){r.push(t[q])}}}return r}}var m;if(document.documentElement.compareDocumentPosition){m=function(q,r){var p=q.compareDocumentPosition(r)&4?-1:q===r?0:1;if(p===0){hasDuplicate=true}return p}}else{if("sourceIndex" in document.documentElement){m=function(q,r){var p=q.sourceIndex-r.sourceIndex;if(p===0){hasDuplicate=true}return p}}else{if(document.createRange){m=function(p,r){var q=p.ownerDocument.createRange(),s=r.ownerDocument.createRange();q.selectNode(p);q.collapse(true);s.selectNode(r);s.collapse(true);var t=q.compareBoundaryPoints(Range.START_TO_END,s);if(t===0){hasDuplicate=true}return t}}}}(function(){var q=document.createElement("form"),p="script"+(new Date).getTime();q.innerHTML="<input name='"+p+"'/>";var r=document.documentElement;r.insertBefore(q,r.firstChild);if(!!document.getElementById(p)){k.find.ID=function(v,u,t){if(typeof u.getElementById!=="undefined"&&!t){var s=u.getElementById(v[1]);return s?s.id===v[1]||typeof s.getAttributeNode!=="undefined"&&s.getAttributeNode("id").nodeValue===v[1]?[s]:ac:[]}};k.filter.ID=function(t,s){var u=typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id");return t.nodeType===1&&u&&u.nodeValue===s}}r.removeChild(q)})();(function(){var p=document.createElement("div");p.appendChild(document.createComment(""));if(p.getElementsByTagName("*").length>0){k.find.TAG=function(s,t){var u=t.getElementsByTagName(s[1]);if(s[1]==="*"){var q=[];for(var r=0;u[r];r++){if(u[r].nodeType===1){q.push(u[r])}}u=q}return u}}p.innerHTML="<a href='#'></a>";if(p.firstChild&&typeof p.firstChild.getAttribute!=="undefined"&&p.firstChild.getAttribute("href")!=="#"){k.attrHandle.href=function(q){return q.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var q=n,p=document.createElement("div");p.innerHTML="<p class='TEST'></p>";if(p.querySelectorAll&&p.querySelectorAll(".TEST").length===0){return}n=function(u,v,s,r){v=v||document;if(!r&&v.nodeType===9&&!c(v)){try{return o(v.querySelectorAll(u),s)}catch(t){}}return q(u,v,s,r)};n.find=q.find;n.filter=q.filter;n.selectors=q.selectors;n.matches=q.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var p=document.createElement("div");p.innerHTML="<div class='test e'></div><div class='test'></div>";if(p.getElementsByClassName("e").length===0){return}p.lastChild.className="e";if(p.getElementsByClassName("e").length===1){return}k.order.splice(1,0,"CLASS");k.find.CLASS=function(s,r,q){if(typeof r.getElementsByClassName!=="undefined"&&!q){return r.getElementsByClassName(s[1])}}})()}function d(v,q,r,x,p,y){var z=v=="previousSibling"&&!y;for(var t=0,u=x.length;t<u;t++){var w=x[t];if(w){if(z&&w.nodeType===1){w.sizcache=r;w.sizset=t}w=w[v];var s=false;while(w){if(w.sizcache===r){s=x[w.sizset];break}if(w.nodeType===1&&!y){w.sizcache=r;w.sizset=t}if(w.nodeName===q){s=w;break}w=w[v]}x[t]=s}}}function a(v,q,r,x,p,y){var z=v=="previousSibling"&&!y;for(var t=0,u=x.length;t<u;t++){var w=x[t];if(w){if(z&&w.nodeType===1){w.sizcache=r;w.sizset=t}w=w[v];var s=false;while(w){if(w.sizcache===r){s=x[w.sizset];break}if(w.nodeType===1){if(!y){w.sizcache=r;w.sizset=t}if(typeof q!=="string"){if(w===q){s=true;break}}else{if(n.filter(q,[w]).length>0){s=w;break}}}w=w[v]}x[t]=s}}}var i=document.compareDocumentPosition?function(p,q){return p.compareDocumentPosition(q)&16}:function(p,q){return p!==q&&(p.contains?p.contains(q):true)};var c=function(p){return p.nodeType===9&&p.documentElement.nodeName!=="HTML"||!!p.ownerDocument&&c(p.ownerDocument)};var j=function(s,u){var p=[],w="",v,q=u.nodeType?[u]:u;while((v=k.match.PSEUDO.exec(s))){w+=v[0];s=s.replace(k.match.PSEUDO,"")}s=k.relative[s]?s+"*":s;for(var t=0,r=q.length;t<r;t++){n(s,q[t],p)}return n.filter(w,p)};T.find=n;T.filter=n.filter;T.expr=n.selectors;T.expr[":"]=T.expr.filters;n.selectors.filters.hidden=function(p){return p.offsetWidth===0||p.offsetHeight===0};n.selectors.filters.visible=function(p){return p.offsetWidth>0||p.offsetHeight>0};n.selectors.filters.animated=function(p){return T.grep(T.timers,function(q){return p===q.elem}).length};T.multiFilter=function(p,r,q){if(q){p=":not("+p+")"}return n.matches(p,r)};T.dir=function(q,r){var s=[],p=q[r];while(p&&p!=document){if(p.nodeType==1){s.push(p)}p=p[r]}return s};T.nth=function(t,s,q,p){s=s||1;var r=0;for(;t;t=t[q]){if(t.nodeType==1&&++r==s){break}}return t};T.sibling=function(p,q){var r=[];for(;p;p=p.nextSibling){if(p.nodeType==1&&p!=q){r.push(p)}}return r};return;W.Sizzle=n})();T.event={add:function(c,f,d,a){if(c.nodeType==3||c.nodeType==8){return}if(c.setInterval&&c!=W){c=W}if(!d.guid){d.guid=this.guid++}if(a!==ac){var e=d;d=this.proxy(e);d.data=a}var g=T.data(c,"events")||T.data(c,"events",{}),b=T.data(c,"handle")||T.data(c,"handle",function(){return typeof T!=="undefined"&&!T.event.triggered?T.event.handle.apply(arguments.callee.elem,arguments):ac});b.elem=c;T.each(f.split(/\s+/),function(k,j){var i=j.split(".");j=i.shift();d.type=i.slice().sort().join(".");var h=g[j];if(T.event.specialAll[j]){T.event.specialAll[j].setup.call(c,a,i)}if(!h){h=g[j]={};if(!T.event.special[j]||T.event.special[j].setup.call(c,a,i)===false){if(c.addEventListener){c.addEventListener(j,b,false)}else{if(c.attachEvent){c.attachEvent("on"+j,b)}}}}h[d.guid]=d;T.event.global[j]=true});c=null},guid:1,global:{},remove:function(b,e,c){if(b.nodeType==3||b.nodeType==8){return}var f=T.data(b,"events"),g,h;if(f){if(e===ac||(typeof e==="string"&&e.charAt(0)==".")){for(var d in f){this.remove(b,d+(e||""))}}else{if(e.type){c=e.handler;e=e.type}T.each(e.split(/\s+/),function(m,k){var i=k.split(".");k=i.shift();var l=RegExp("(^|\\.)"+i.slice().sort().join(".*\\.")+"(\\.|$)");if(f[k]){if(c){delete f[k][c.guid]}else{for(var j in f[k]){if(l.test(f[k][j].type)){delete f[k][j]}}}if(T.event.specialAll[k]){T.event.specialAll[k].teardown.call(b,i)}for(g in f[k]){break}if(!g){if(!T.event.special[k]||T.event.special[k].teardown.call(b,i)===false){if(b.removeEventListener){b.removeEventListener(k,T.data(b,"handle"),false)}else{if(b.detachEvent){b.detachEvent("on"+k,T.data(b,"handle"))}}}g=null;delete f[k]}}})}for(g in f){break}if(!g){var a=T.data(b,"handle");if(a){a.elem=null}T.removeData(b,"events");T.removeData(b,"handle")}}},trigger:function(d,b,e,h){var f=d.type||d;if(!h){d=typeof d==="object"?d[aa]?d:T.extend(T.Event(f),d):T.Event(f);if(f.indexOf("!")>=0){d.type=f=f.slice(0,-1);d.exclusive=true}if(!e){d.stopPropagation();if(this.global[f]){T.each(T.cache,function(){if(this.events&&this.events[f]){T.event.trigger(d,b,this.handle.elem)}})}}if(!e||e.nodeType==3||e.nodeType==8){return ac}d.result=ac;d.target=e;b=T.makeArray(b);b.unshift(d)}d.currentTarget=e;var c=T.data(e,"handle");if(c){c.apply(e,b)}if((!e[f]||(T.nodeName(e,"a")&&f=="click"))&&e["on"+f]&&e["on"+f].apply(e,b)===false){d.result=false}if(!h&&e[f]&&!d.isDefaultPrevented()&&!(T.nodeName(e,"a")&&f=="click")){this.triggered=true;try{e[f]()}catch(a){}}this.triggered=false;if(!d.isPropagationStopped()){var g=e.parentNode||e.ownerDocument;if(g){T.event.trigger(d,b,g,true)}}},handle:function(b){var c,h;b=arguments[0]=T.event.fix(b||W.event);b.currentTarget=this;var a=b.type.split(".");b.type=a.shift();c=!a.length&&!b.exclusive;var d=RegExp("(^|\\.)"+a.slice().sort().join(".*\\.")+"(\\.|$)");h=(T.data(this,"events")||{})[b.type];for(var f in h){var e=h[f];if(c||d.test(e.type)){b.handler=e;b.data=e.data;var g=e.apply(this,arguments);if(g!==ac){b.result=g;if(g===false){b.preventDefault();b.stopPropagation()}}if(b.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(c){if(c[aa]){return c}var e=c;c=T.Event(e);for(var d=this.props.length,a;d;){a=this.props[--d];c[a]=e[a]}if(!c.target){c.target=c.srcElement||document}if(c.target.nodeType==3){c.target=c.target.parentNode}if(!c.relatedTarget&&c.fromElement){c.relatedTarget=c.fromElement==c.target?c.toElement:c.fromElement}if(c.pageX==null&&c.clientX!=null){var b=document.documentElement,f=document.body;c.pageX=c.clientX+(b&&b.scrollLeft||f&&f.scrollLeft||0)-(b.clientLeft||0);c.pageY=c.clientY+(b&&b.scrollTop||f&&f.scrollTop||0)-(b.clientTop||0)}if(!c.which&&((c.charCode||c.charCode===0)?c.charCode:c.keyCode)){c.which=c.charCode||c.keyCode}if(!c.metaKey&&c.ctrlKey){c.metaKey=c.ctrlKey}if(!c.which&&c.button){c.which=(c.button&1?1:(c.button&2?3:(c.button&4?2:0)))}return c},proxy:function(a,b){b=b||function(){return a.apply(this,arguments)};b.guid=a.guid=a.guid||b.guid||this.guid++;return b},special:{ready:{setup:P,teardown:function(){}}},specialAll:{live:{setup:function(b,a){T.event.add(this,a[0],ag)},teardown:function(a){if(a.length){var c=0,b=RegExp("(^|\\.)"+a[0]+"(\\.|$)");T.each((T.data(this,"events").live||{}),function(){if(b.test(this.type)){c++}});if(c<1){T.event.remove(this,a[0],ag)}}}}}};T.Event=function(a){if(!this.preventDefault){return new T.Event(a)}if(a&&a.type){this.originalEvent=a;this.type=a.type}else{this.type=a}this.timeStamp=ae();this[aa]=true};function X(){return false}function J(){return true}T.Event.prototype={preventDefault:function(){this.isDefaultPrevented=J;var a=this.originalEvent;if(!a){return}if(a.preventDefault){a.preventDefault()}a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=J;var a=this.originalEvent;if(!a){return}if(a.stopPropagation){a.stopPropagation()}a.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=J;this.stopPropagation()},isDefaultPrevented:X,isPropagationStopped:X,isImmediatePropagationStopped:X};var ai=function(b){var c=b.relatedTarget;while(c&&c!=this){try{c=c.parentNode}catch(a){c=this}}if(c!=this){b.type=b.data;T.event.handle.apply(this,arguments)}};T.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(a,b){T.event.special[b]={setup:function(){T.event.add(this,a,ai,b)},teardown:function(){T.event.remove(this,a,ai)}}});T.fn.extend({bind:function(b,a,c){return b=="unload"?this.one(b,a,c):this.each(function(){T.event.add(this,b,c||a,c&&a)})},one:function(b,a,c){var d=T.event.proxy(c||a,function(e){T(this).unbind(e,d);return(c||a).apply(this,arguments)});return this.each(function(){T.event.add(this,b,d,c&&a)})},unbind:function(a,b){return this.each(function(){T.event.remove(this,a,b)})},trigger:function(b,a){return this.each(function(){T.event.trigger(b,a,this)})},triggerHandler:function(c,a){if(this[0]){var b=T.Event(c);b.preventDefault();b.stopPropagation();T.event.trigger(b,a,this[0]);return b.result}},toggle:function(a){var c=arguments,b=1;while(b<c.length){T.event.proxy(a,c[b++])}return this.click(T.event.proxy(a,function(d){this.lastToggle=(this.lastToggle||0)%b;d.preventDefault();return c[this.lastToggle++].apply(this,arguments)||false}))},hover:function(b,a){return this.mouseenter(b).mouseleave(a)},ready:function(a){P();if(T.isReady){a.call(document,T)}else{T.readyList.push(a)}return this},live:function(a,b){var c=T.event.proxy(b);c.guid+=this.selector+a;T(document).bind(Z(a,this.selector),this.selector,c);return this},die:function(a,b){T(document).unbind(Z(a,this.selector),b?{guid:b.guid+this.selector+a}:null);return this}});function ag(a){var d=RegExp("(^|\\.)"+a.type+"(\\.|$)"),b=true,c=[];T.each(T.data(this,"events").live||[],function(g,f){if(d.test(f.type)){var e=T(a.target).closest(f.data)[0];if(e){c.push({elem:e,fn:f})}}});c.sort(function(e,f){return T.data(e.elem,"closest")-T.data(f.elem,"closest")});T.each(c,function(){if(this.fn.call(this.elem,a,this.fn.data)===false){return(b=false)}});return b}function Z(a,b){return["live",a,b.replace(/\./g,"`").replace(/ /g,"|")].join(".")}T.extend({isReady:false,readyList:[],ready:function(){if(!T.isReady){T.isReady=true;if(T.readyList){T.each(T.readyList,function(){this.call(document,T)});T.readyList=null}T(document).triggerHandler("ready")}}});var G=false;function P(){if(G){return}G=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);T.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);T.ready()}});if(document.documentElement.doScroll&&W==W.top){(function(){if(T.isReady){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}T.ready()})()}}}T.event.add(W,"load",T.ready)}T.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(a,b){T.fn[b]=function(c){return c?this.bind(b,c):this.trigger(b)}});T(W).bind("unload",function(){for(var a in T.cache){if(a!=1&&T.cache[a].handle){T.event.remove(T.cache[a].handle.elem)}}});(function(){T.support={};var f=document.documentElement,e=document.createElement("script"),a=document.createElement("div"),b="script"+(new Date).getTime();a.style.display="none";a.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var d=a.getElementsByTagName("*"),g=a.getElementsByTagName("a")[0];if(!d||!d.length||!g){return}T.support={leadingWhitespace:a.firstChild.nodeType==3,tbody:!a.getElementsByTagName("tbody").length,objectAll:!!a.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/red/.test(g.getAttribute("style")),hrefNormalized:g.getAttribute("href")==="/a",opacity:g.style.opacity==="0.5",cssFloat:!!g.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};e.type="text/javascript";try{e.appendChild(document.createTextNode("window."+b+"=1;"))}catch(c){}f.insertBefore(e,f.firstChild);if(W[b]){T.support.scriptEval=true;delete W[b]}f.removeChild(e);if(a.attachEvent&&a.fireEvent){a.attachEvent("onclick",function(){T.support.noCloneEvent=false;a.detachEvent("onclick",arguments.callee)});a.cloneNode(true).fireEvent("onclick")}T(function(){var h=document.createElement("div");h.style.width=h.style.paddingLeft="1px";document.body.appendChild(h);T.boxModel=T.support.boxModel=h.offsetWidth===2;document.body.removeChild(h).style.display="none"})})();var H=T.support.cssFloat?"cssFloat":"styleFloat";T.props={"for":"htmlFor","class":"className","float":H,cssFloat:H,styleFloat:H,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};T.fn.extend({_load:T.fn.load,load:function(e,b,a){if(typeof e!=="string"){return this._load(e)}var c=e.indexOf(" ");if(c>=0){var g=e.slice(c,e.length);e=e.slice(0,c)}var d="GET";if(b){if(T.isFunction(b)){a=b;b=null}else{if(typeof b==="object"){b=T.param(b);d="POST"}}}var f=this;T.ajax({url:e,type:d,dataType:"html",data:b,complete:function(i,h){if(h=="success"||h=="notmodified"){f.html(g?T("<div/>").append(i.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(g):i.responseText)}if(a){f.each(a,[i.responseText,h,i])}}});return this},serialize:function(){return T.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?T.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(c,b){var a=T(this).val();return a==null?null:T.isArray(a)?T.map(a,function(d,e){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});T.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(b,a){T.fn[a]=function(c){return this.bind(a,c)}});var N=ae();T.extend({get:function(d,b,a,c){if(T.isFunction(b)){a=b;b=null}return T.ajax({type:"GET",url:d,data:b,success:a,dataType:c})},getScript:function(b,a){return T.get(b,null,a,"script")},getJSON:function(c,b,a){return T.get(c,b,a,"json")},post:function(d,b,a,c){if(T.isFunction(b)){a=b;b={}}return T.ajax({type:"POST",url:d,data:b,success:a,dataType:c})},ajaxSetup:function(a){T.extend(T.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return W.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(k){k=T.extend(true,k,T.extend(true,{},T.ajaxSettings,k));var a,r=/=\?(&|$)/g,f,b,q=k.type.toUpperCase();if(k.data&&k.processData&&typeof k.data!=="string"){k.data=T.param(k.data)}if(k.dataType=="jsonp"){if(q=="GET"){if(!k.url.match(r)){k.url+=(k.url.match(/\?/)?"&":"?")+(k.jsonp||"callback")+"=?"}}else{if(!k.data||!k.data.match(r)){k.data=(k.data?k.data+"&":"")+(k.jsonp||"callback")+"=?"}}k.dataType="json"}if(k.dataType=="json"&&(k.data&&k.data.match(r)||k.url.match(r))){a="jsonp"+N++;if(k.data){k.data=(k.data+"").replace(r,"="+a+"$1")}k.url=k.url.replace(r,"="+a+"$1");k.dataType="script";W[a]=function(u){b=u;o();l();W[a]=ac;try{delete W[a]}catch(t){}if(p){p.removeChild(d)}}}if(k.dataType=="script"&&k.cache==null){k.cache=false}if(k.cache===false&&q=="GET"){var s=ae();var c=k.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+s+"$2");k.url=c+((c==k.url)?(k.url.match(/\?/)?"&":"?")+"_="+s:"")}if(k.data&&q=="GET"){k.url+=(k.url.match(/\?/)?"&":"?")+k.data;k.data=null}if(k.global&&!T.active++){T.event.trigger("ajaxStart")}var g=/^(\w+:)?\/\/([^\/?#]+)/.exec(k.url);if(k.dataType=="script"&&q=="GET"&&g&&(g[1]&&g[1]!=location.protocol||g[2]!=location.host)){var p=document.getElementsByTagName("head")[0];var d=document.createElement("script");d.src=k.url;if(k.scriptCharset){d.charset=k.scriptCharset}if(!a){var i=false;d.onload=d.onreadystatechange=function(){if(!i&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){i=true;o();l();d.onload=d.onreadystatechange=null;p.removeChild(d)}}}p.appendChild(d);return ac}var m=false;var n=k.xhr();if(k.username){n.open(q,k.url,k.async,k.username,k.password)}else{n.open(q,k.url,k.async)}try{if(k.data){n.setRequestHeader("Content-Type",k.contentType)}if(k.ifModified){n.setRequestHeader("If-Modified-Since",T.lastModified[k.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}n.setRequestHeader("X-Requested-With","XMLHttpRequest");n.setRequestHeader("Accept",k.dataType&&k.accepts[k.dataType]?k.accepts[k.dataType]+", */*":k.accepts._default)}catch(e){}if(k.beforeSend&&k.beforeSend(n,k)===false){if(k.global&&!--T.active){T.event.trigger("ajaxStop")}n.abort();return false}if(k.global){T.event.trigger("ajaxSend",[n,k])}var j=function(v){if(n.readyState==0){if(h){clearInterval(h);h=null;if(k.global&&!--T.active){T.event.trigger("ajaxStop")}}}else{if(!m&&n&&(n.readyState==4||v=="timeout")){m=true;if(h){clearInterval(h);h=null}f=v=="timeout"?"timeout":!T.httpSuccess(n)?"error":k.ifModified&&T.httpNotModified(n,k.url)?"notmodified":"success";if(f=="success"){try{b=T.httpData(n,k.dataType,k)}catch(t){f="parsererror"}}if(f=="success"){var u;try{u=n.getResponseHeader("Last-Modified")}catch(t){}if(k.ifModified&&u){T.lastModified[k.url]=u}if(!a){o()}}else{T.handleError(k,n,f)}l();if(v){n.abort()}if(k.async){n=null}}}};if(k.async){var h=setInterval(j,13);if(k.timeout>0){setTimeout(function(){if(n&&!m){j("timeout")}},k.timeout)}}try{n.send(k.data)}catch(e){T.handleError(k,n,null,e)}if(!k.async){j()}function o(){if(k.success){k.success(b,f)}if(k.global){T.event.trigger("ajaxSuccess",[n,k])}}function l(){if(k.complete){k.complete(n,f)}if(k.global){T.event.trigger("ajaxComplete",[n,k])}if(k.global&&!--T.active){T.event.trigger("ajaxStop")}}return n},handleError:function(c,a,d,b){if(c.error){c.error(a,d,b)}if(c.global){T.event.trigger("ajaxError",[a,c,b])}},active:0,httpSuccess:function(a){try{return !a.status&&location.protocol=="file:"||(a.status>=200&&a.status<300)||a.status==304||a.status==1223}catch(b){}return false},httpNotModified:function(b,d){try{var a=b.getResponseHeader("Last-Modified");return b.status==304||a==T.lastModified[d]}catch(c){}return false},httpData:function(a,c,d){var e=a.getResponseHeader("content-type"),f=c=="xml"||!c&&e&&e.indexOf("xml")>=0,b=f?a.responseXML:a.responseText;if(f&&b.documentElement.tagName=="parsererror"){throw"parsererror"}if(d&&d.dataFilter){b=d.dataFilter(b,c)}if(typeof b==="string"){if(c=="script"){T.globalEval(b)}if(c=="json"){b=W["eval"]("("+b+")")}}return b},param:function(d){var b=[];function a(f,e){b[b.length]=encodeURIComponent(f)+"="+encodeURIComponent(e)}if(T.isArray(d)||d.jquery){T.each(d,function(){a(this.name,this.value)})}else{for(var c in d){if(T.isArray(d[c])){T.each(d[c],function(){a(c,this)})}else{a(c,T.isFunction(d[c])?d[c]():d[c])}}}return b.join("&").replace(/%20/g,"+")}});var V={},U,af=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function K(b,c){var a={};T.each(af.concat.apply([],af.slice(0,c)),function(){a[this]=b});return a}T.fn.extend({show:function(c,a){if(c){return this.animate(K("show",3),c,a)}else{for(var e=0,g=this.length;e<g;e++){var h=T.data(this[e],"olddisplay");this[e].style.display=h||"";if(T.css(this[e],"display")==="none"){var f=this[e].tagName,b;if(V[f]){b=V[f]}else{var d=T("<"+f+" />").appendTo("body");b=d.css("display");if(b==="none"){b="block"}d.remove();V[f]=b}T.data(this[e],"olddisplay",b)}}for(var e=0,g=this.length;e<g;e++){this[e].style.display=T.data(this[e],"olddisplay")||""}return this}},hide:function(b,a){if(b){return this.animate(K("hide",3),b,a)}else{for(var c=0,d=this.length;c<d;c++){var e=T.data(this[c],"olddisplay");if(!e&&e!=="none"){T.data(this[c],"olddisplay",T.css(this[c],"display"))}}for(var c=0,d=this.length;c<d;c++){this[c].style.display="none"}return this}},_toggle:T.fn.toggle,toggle:function(a,b){var c=typeof a==="boolean";return T.isFunction(a)&&T.isFunction(b)?this._toggle.apply(this,arguments):a==null||c?this.each(function(){var d=c?a:T(this).is(":hidden");T(this)[d?"show":"hide"]()}):this.animate(K("toggle",3),a,b)},fadeTo:function(c,a,b){return this.animate({opacity:a},c,b)},animate:function(a,d,b,c){var e=T.speed(d,b,c);return this[e.queue===false?"each":"queue"](function(){var g=T.extend({},e),i,f=this.nodeType==1&&T(this).is(":hidden"),h=this;for(i in a){if(a[i]=="hide"&&f||a[i]=="show"&&!f){return g.complete.call(this)}if((i=="height"||i=="width")&&this.style){g.display=T.css(this,"display");g.overflow=this.style.overflow}}if(g.overflow!=null){this.style.overflow="hidden"}g.curAnim=T.extend({},a);T.each(a,function(o,k){var l=new T.fx(h,g,o);if(/toggle|show|hide/.test(k)){l[k=="toggle"?f?"show":"hide":k](a)}else{var m=k.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),j=l.cur(true)||0;if(m){var p=parseFloat(m[2]),n=m[3]||"px";if(n!="px"){h.style[o]=(p||1)+n;j=((p||1)/l.cur(true))*j;h.style[o]=j+n}if(m[1]){p=((m[1]=="-="?-1:1)*p)+j}l.custom(j,p,n)}else{l.custom(j,k,"")}}});return true})},stop:function(b,c){var a=T.timers;if(b){this.queue([])}this.each(function(){for(var d=a.length-1;d>=0;d--){if(a[d].elem==this){if(c){a[d](true)}a.splice(d,1)}}});if(!c){this.dequeue()}return this}});T.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(b,a){T.fn[b]=function(d,c){return this.animate(a,d,c)}});T.extend({speed:function(b,a,c){var d=typeof b==="object"?b:{complete:c||!c&&a||T.isFunction(b)&&b,duration:b,easing:c&&a||a&&!T.isFunction(a)&&a};d.duration=T.fx.off?0:typeof d.duration==="number"?d.duration:T.fx.speeds[d.duration]||T.fx.speeds._default;d.old=d.complete;d.complete=function(){if(d.queue!==false){T(this).dequeue()}if(T.isFunction(d.old)){d.old.call(this)}};return d},easing:{linear:function(b,a,d,c){return d+c*b},swing:function(b,a,d,c){return((-Math.cos(b*Math.PI)/2)+0.5)*c+d}},timers:[],fx:function(b,c,a){this.options=c;this.elem=b;this.prop=a;if(!c.orig){c.orig={}}}});T.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(T.fx.step[this.prop]||T.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var b=parseFloat(T.css(this.elem,this.prop,a));return b&&b>-10000?b:parseFloat(T.curCSS(this.elem,this.prop))||0},custom:function(a,b,c){this.startTime=ae();this.start=a;this.end=b;this.unit=c||this.unit||"px";this.now=this.start;this.pos=this.state=0;var e=this;function d(f){return e.step(f)}d.elem=this.elem;if(d()&&T.timers.push(d)&&!U){U=setInterval(function(){var f=T.timers;for(var g=0;g<f.length;g++){if(!f[g]()){f.splice(g--,1)}}if(!f.length){clearInterval(U);U=ac}},13)}},show:function(){this.options.orig[this.prop]=T.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());T(this.elem).show()},hide:function(){this.options.orig[this.prop]=T.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(c){var d=ae();if(c||d>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var f=true;for(var e in this.options.curAnim){if(this.options.curAnim[e]!==true){f=false}}if(f){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(T.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){T(this.elem).hide()}if(this.options.hide||this.options.show){for(var b in this.options.curAnim){T.attr(this.elem.style,b,this.options.orig[b])}}this.options.complete.call(this.elem)}return false}else{var a=d-this.startTime;this.state=a/this.options.duration;this.pos=T.easing[this.options.easing||(T.easing.swing?"swing":"linear")](this.state,a,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};T.extend(T.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){T.attr(a.elem.style,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null){a.elem.style[a.prop]=a.now+a.unit}else{a.elem[a.prop]=a.now}}}});if(document.documentElement.getBoundingClientRect){T.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return T.offset.bodyOffset(this[0])}var f=this[0].getBoundingClientRect(),c=this[0].ownerDocument,g=c.body,h=c.documentElement,a=h.clientTop||g.clientTop||0,b=h.clientLeft||g.clientLeft||0,d=f.top+(self.pageYOffset||T.boxModel&&h.scrollTop||g.scrollTop)-a,e=f.left+(self.pageXOffset||T.boxModel&&h.scrollLeft||g.scrollLeft)-b;return{top:d,left:e}}}else{T.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return T.offset.bodyOffset(this[0])}T.offset.initialized||T.offset.initialize();var f=this[0],i=f.offsetParent,j=f,a=f.ownerDocument,c,h=a.documentElement,e=a.body,d=a.defaultView,k=d.getComputedStyle(f,null),b=f.offsetTop,g=f.offsetLeft;while((f=f.parentNode)&&f!==e&&f!==h){c=d.getComputedStyle(f,null);b-=f.scrollTop,g-=f.scrollLeft;if(f===i){b+=f.offsetTop,g+=f.offsetLeft;if(T.offset.doesNotAddBorder&&!(T.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(f.tagName))){b+=parseInt(c.borderTopWidth,10)||0,g+=parseInt(c.borderLeftWidth,10)||0}j=i,i=f.offsetParent}if(T.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"){b+=parseInt(c.borderTopWidth,10)||0,g+=parseInt(c.borderLeftWidth,10)||0}k=c}if(k.position==="relative"||k.position==="static"){b+=e.offsetTop,g+=e.offsetLeft}if(k.position==="fixed"){b+=Math.max(h.scrollTop,e.scrollTop),g+=Math.max(h.scrollLeft,e.scrollLeft)}return{top:b,left:g}}}T.offset={initialize:function(){if(this.initialized){return}var c=document.body,i=document.createElement("div"),g,h,a,f,b,j,e=c.style.marginTop,d='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';b={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(j in b){i.style[j]=b[j]}i.innerHTML=d;c.insertBefore(i,c.firstChild);g=i.firstChild,h=g.firstChild,f=g.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(h.offsetTop!==5);this.doesAddBorderForTableAndCells=(f.offsetTop===5);g.style.overflow="hidden",g.style.position="relative";this.subtractsBorderForOverflowNotVisible=(h.offsetTop===-5);c.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(c.offsetTop===0);c.style.marginTop=e;c.removeChild(i);this.initialized=true},bodyOffset:function(c){T.offset.initialized||T.offset.initialize();var a=c.offsetTop,b=c.offsetLeft;if(T.offset.doesNotIncludeMarginInBodyOffset){a+=parseInt(T.curCSS(c,"marginTop",true),10)||0,b+=parseInt(T.curCSS(c,"marginLeft",true),10)||0}return{top:a,left:b}}};T.fn.extend({position:function(){var b=0,c=0,e;if(this[0]){var d=this.offsetParent(),a=this.offset(),f=/^body|html$/i.test(d[0].tagName)?{top:0,left:0}:d.offset();a.top-=Y(this,"marginTop");a.left-=Y(this,"marginLeft");f.top+=Y(d,"borderTopWidth");f.left+=Y(d,"borderLeftWidth");e={top:a.top-f.top,left:a.left-f.left}}return e},offsetParent:function(){var a=this[0].offsetParent||document.body;while(a&&(!/^body|html$/i.test(a.tagName)&&T.css(a,"position")=="static")){a=a.offsetParent}return T(a)}});T.each(["Left","Top"],function(b,c){var a="scroll"+c;T.fn[a]=function(d){if(!this[0]){return null}return d!==ac?this.each(function(){this==W||this==document?W.scrollTo(!b?d:T(W).scrollLeft(),b?d:T(W).scrollTop()):this[a]=d}):this[0]==W||this[0]==document?self[b?"pageYOffset":"pageXOffset"]||T.boxModel&&document.documentElement[a]||document.body[a]:this[0][a]}});T.each(["Height","Width"],function(b,d){var f=b?"Left":"Top",c=b?"Right":"Bottom",e=d.toLowerCase();T.fn["inner"+d]=function(){return this[0]?T.css(this[0],e,false,"padding"):null};T.fn["outer"+d]=function(g){return this[0]?T.css(this[0],e,false,g?"margin":"border"):null};var a=d.toLowerCase();T.fn[a]=function(g){return this[0]==W?document.compatMode=="CSS1Compat"&&document.documentElement["client"+d]||document.body["client"+d]:this[0]==document?Math.max(document.documentElement["client"+d],document.body["scroll"+d],document.documentElement["scroll"+d],document.body["offset"+d],document.documentElement["offset"+d]):g===ac?(this.length?T.css(this[0],a):null):this.css(a,typeof g==="string"?g:g+"px")}})})();var tb_pathToImage="http://static.photowall.com/staging/img/fancyzoom/zoom-spin-1.png";
/*!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/
$(document).ready(function(){tb_init("a.thickbox, area.thickbox, input.thickbox");imgLoader=new Image();imgLoader.src=tb_pathToImage});function tb_init(a){$(a).click(function(){var c=this.title||this.name||null;var b=this.href||this.alt;var d=this.rel||false;tb_show(c,b,d);this.blur();return false})}function tb_show(j,b,h){try{if(typeof document.body.style.maxHeight==="undefined"){$("body","html").css({height:"100%",width:"100%"});$("html").css("overflow","hidden");if(document.getElementById("TB_HideSelect")===null){$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");$("#TB_overlay").click(tb_remove)}}else{if(document.getElementById("TB_overlay")===null){$("body").append("<div id='TB_overlay'></div>");$("#TB_overlay").click(tb_remove)}if(document.getElementById("TB_window")===null){$("body").append("<div id='TB_window'></div>")}}if(tb_detectMacXFF()){$("#TB_overlay").addClass("TB_overlayMacFFBGHack")}else{$("#TB_overlay").addClass("TB_overlayBG")}if(j===null){j=""}$("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");$("#TB_load").show();var c;if(b.indexOf("?")!==-1){c=b.substr(0,b.indexOf("?"))}else{c=b}var f=/\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;var k=c.toLowerCase().match(f);if(k==".jpg"||k==".jpeg"||k==".png"||k==".gif"||k==".bmp"){TB_PrevCaption="";TB_PrevURL="";TB_PrevHTML="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";TB_NextCaption="";TB_NextURL="";TB_NextHTML="";TB_imageCount="";TB_FoundURL=false;if(h){TB_TempArray=$("a[rel="+h+"]").get();for(TB_Counter=0;((TB_Counter<TB_TempArray.length)&&(TB_NextHTML===""));TB_Counter++){var g=TB_TempArray[TB_Counter].href.toLowerCase().match(f);if(!(TB_TempArray[TB_Counter].href==b)){if(TB_FoundURL){TB_NextCaption=TB_TempArray[TB_Counter].title;TB_NextURL=TB_TempArray[TB_Counter].href;TB_NextId=TB_TempArray[TB_Counter].id.split("-")[0];TB_NextHTML="<span id='TB_next'>&nbsp;&nbsp;<a href='#'>Older &gt;</a></span>"}else{TB_PrevCaption=TB_TempArray[TB_Counter].title;TB_PrevURL=TB_TempArray[TB_Counter].href;TB_PrevId=TB_TempArray[TB_Counter].id.split("-")[0];TB_PrevHTML="<span id='TB_prev'>&nbsp;&nbsp;<a href='#'>&lt; Newer</a></span>"}}else{TB_FoundURL=true;TB_imageCount="Photo "+(TB_Counter+1)+" of "+(TB_TempArray.length)}}}imgPreloader=new Image();imgPreloader.onload=function(){imgPreloader.onload=null;var n=tb_getPageSize();var l=n[0]-150;var q=n[1]-150;var m=imgPreloader.width;var e=imgPreloader.height;if(m>l){e=e*(l/m);m=l;if(e>q){m=m*(q/e);e=q}}else{if(e>q){m=m*(q/e);e=q;if(m>l){e=e*(l/m);m=l}}}TB_WIDTH=m+30;TB_HEIGHT=e+60;$("#TB_window").append("<div id='TB_caption'>"+j+"<div id='TB_secondLine'><div style='float:left;'>"+TB_imageCount+"</div><div style='float:right;'><a href='#' id='TB_closeWindowButton' title='Close'>X Close</a></div><div style='margin-right:50px; text-align:center;'>"+TB_PrevHTML+TB_NextHTML+"</div></div></div><div style='clear:both;'></div><div id='TB_ImageOff' ><img id='TB_Image' src='"+b+"' width='"+m+"' height='"+e+"' alt='"+j+"'/><div id='TB_Image_Overlay'></div></div>");$("#TB_closeWindowButton").click(tb_remove);if(!(TB_PrevHTML==="")){function p(){if($(document).unbind("click",p)){$(document).unbind("click",p)}$("#TB_window").remove();$("body").append("<div id='TB_window'></div>");Photowall.currentPhotoId=TB_PrevId;tb_show(TB_PrevCaption,TB_PrevURL,h);return false}$("#TB_prev").click(p)}if(!(TB_NextHTML==="")){function o(){$("#TB_window").remove();$("body").append("<div id='TB_window'></div>");Photowall.currentPhotoId=TB_NextId;tb_show(TB_NextCaption,TB_NextURL,h);return false}$("#TB_next").click(o)}document.onkeydown=function(r){if(r===null){keycode=event.keyCode}else{keycode=r.which}if(keycode==27){tb_remove();return false}else{if(keycode==190){if(!(TB_NextHTML==="")){document.onkeydown="";o()}}else{if(keycode==188){if(!(TB_PrevHTML==="")){document.onkeydown="";p()}}}}};tb_position();$("#TB_load").remove();$("#TB_ImageOff").click(function(){return false});$("#TB_Image").click(tb_remove);$("#TB_window").css({display:"block"});Photowall.overlayHook()};imgPreloader.src=b}else{console.log("html");var a=b.replace(/^[^\?]+\??/,"");var d=tb_parseQuery(a);TB_WIDTH=(d.width*1)+30||950;TB_HEIGHT=(d.height*1)+40||470;ajaxContentW=TB_WIDTH-30;ajaxContentH=TB_HEIGHT-45;if(b.indexOf("TB_iframe")!=-1){urlNoQuery=b.split("TB_");$("#TB_iframeContent").remove();if(d.modal!="true"){$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+j+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a> or Esc Key</div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW+29)+"px;height:"+(ajaxContentH+17)+"px;' > </iframe>")}else{$("#TB_overlay").unbind();$("#TB_window").append("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW+29)+"px;height:"+(ajaxContentH+17)+"px;'> </iframe>")}}else{if($("#TB_window").css("display")!="block"){if(d.modal!="true"){$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+j+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>close</a> or Esc Key</div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>")}else{$("#TB_overlay").unbind();$("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>")}}else{$("#TB_ajaxWindowTitle").html(j)}}$("#TB_closeWindowButton").click(tb_remove);if(b.indexOf("TB_inline")!=-1){$("#TB_ajaxContent").append($("#"+d.inlineId).children());$("#TB_window").unload(function(){$("#"+d.inlineId).append($("#TB_ajaxContent").children())});tb_position();$("#TB_load").remove();$("#TB_window").css({display:"block"})}else{if(b.indexOf("TB_iframe")!=-1){tb_position();if($.browser.safari){$("#TB_load").remove();$("#TB_window").css({display:"block"})}}else{$("#TB_ajaxContent").load(b+="&random="+(new Date().getTime()),function(){tb_position();$("#TB_load").remove();tb_init("#TB_ajaxContent a.thickbox");$("#TB_window").css({display:"block"})})}}}if(!d.modal){document.onkeyup=function(l){if(l===null){keycode=event.keyCode}else{keycode=l.which}if(keycode==27){tb_remove();return false}}}}catch(i){console.log(i)}}function tb_showIframe(){$("#TB_load").remove();$("#TB_window").css({display:"block"})}function tb_remove(){$("#TB_imageOff").unbind("click");$("#TB_closeWindowButton").unbind("click");$("#TB_window").fadeOut("fast",function(){$("#TB_window,#TB_HideSelect").trigger("unload").unbind().remove()});if(!$("#author-browser").is(":visible")){$("#TB_overlay").remove()}$("#TB_load").remove();if(typeof document.body.style.maxHeight=="undefined"){$("body","html").css({height:"auto",width:"auto"});$("html").css("overflow","")}document.onkeydown="";document.onkeyup="";Photowall.Photo.unloadPhotoView();return false}function tb_position(){$("#TB_window").css({marginLeft:"-"+parseInt((TB_WIDTH/2),10)+"px",width:TB_WIDTH+"px"})}function tb_parseQuery(d){var e={};if(!d){return e}var a=d.split(/[;&]/);for(var c=0;c<a.length;c++){var g=a[c].split("=");if(!g||g.length!=2){continue}var b=unescape(g[0]);var f=unescape(g[1]);f=f.replace(/\+/g," ");e[b]=f}return e}function tb_getPageSize(){var c=document.documentElement;var a=window.innerWidth||self.innerWidth||(c&&c.clientWidth)||document.body.clientWidth;var b=window.innerHeight||self.innerHeight||(c&&c.clientHeight)||document.body.clientHeight;arrayPageSize=[a,b];return arrayPageSize}function tb_detectMacXFF(){var a=navigator.userAgent.toLowerCase();if(a.indexOf("mac")!=-1&&a.indexOf("firefox")!=-1){return true}}(function(c){var a=c.scrollTo=function(f,e,d){c(window).scrollTo(f,e,d)};a.defaults={axis:"xy",duration:parseFloat(c.fn.jquery)>=1.3?0:1};a.window=function(d){return c(window).scrollable()};c.fn.scrollable=function(){return this.map(function(){var e=this,d=!e.nodeName||c.inArray(e.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!d){return e}var f=(e.contentWindow||e).document||e.ownerDocument||e;return c.browser.safari||f.compatMode=="BackCompat"?f.body:f.documentElement})};c.fn.scrollTo=function(f,e,d){if(typeof e=="object"){d=e;e=0}if(typeof d=="function"){d={onAfter:d}}if(f=="max"){f=9000000000}d=c.extend({},a.defaults,d);e=e||d.speed||d.duration;d.queue=d.queue&&d.axis.length>1;if(d.queue){e/=2}d.offset=b(d.offset);d.over=b(d.over);return this.scrollable().each(function(){var m=this,k=c(m),l=f,j,h={},n=k.is("html,body");switch(typeof l){case"number":case"string":if(/^([+-]=)?\d+(\.\d+)?(px)?$/.test(l)){l=b(l);break}l=c(l,this);case"object":if(l.is||l.style){j=(l=c(l)).offset()}}c.each(d.axis.split(""),function(r,s){var t=s=="x"?"Left":"Top",u=t.toLowerCase(),q="scroll"+t,o=m[q],p=s=="x"?"Width":"Height";if(j){h[q]=j[u]+(n?0:o-k.offset()[u]);if(d.margin){h[q]-=parseInt(l.css("margin"+t))||0;h[q]-=parseInt(l.css("border"+t+"Width"))||0}h[q]+=d.offset[u]||0;if(d.over[u]){h[q]+=l[p.toLowerCase()]()*d.over[u]}}else{h[q]=l[u]}if(/^\d+$/.test(h[q])){h[q]=h[q]<=0?0:Math.min(h[q],g(p))}if(!r&&d.queue){if(o!=h[q]){i(d.onAfterFirst)}delete h[q]}});i(d.onAfter);function i(o){k.animate(h,e,d.easing,o&&function(){o.call(this,f,d)})}function g(s){var p="scroll"+s;if(!n){return m[p]}var r="client"+s,q=m.ownerDocument.documentElement,o=m.ownerDocument.body;return Math.max(q[p],o[p])-Math.min(q[r],o[r])}}).end()};function b(d){return typeof d=="object"?d:{top:d,left:d}}})(jQuery);(function(d){d.timeago=function(g){if(g instanceof Date){return b(g)}else{if(typeof g=="string"){return b(d.timeago.parse(g))}else{return b(d.timeago.parse(d(g).attr("title")))}}};var f=d.timeago;d.extend(d.timeago,{settings:{refreshMillis:60000,allowFuture:false,strings:{prefixAgo:null,prefixFromNow:null,suffixAgo:"ago",suffixFromNow:"from now",ago:null,fromNow:null,seconds:"seconds",minute:"1 minute",minutes:"%d minutes",hour:"1 hour",hours:"%d hours",day:"a day",days:"%d days",month:"1 month",months:"%d months",year:"1 year",years:"%d years"}},inWords:function(k){var l=this.settings.strings;var h=l.prefixAgo;var p=l.suffixAgo||l.ago;if(this.settings.allowFuture){if(k<0){h=l.prefixFromNow;p=l.suffixFromNow||l.fromNow}k=Math.abs(k)}var n=k/1000;var g=n/60;var m=g/60;var o=m/24;var i=o/365;var j=n<45&&a(l.seconds,Math.round(n))||n<90&&a(l.minute,1)||g<45&&a(l.minutes,Math.round(g))||g<90&&a(l.hour,1)||m<24&&a(l.hours,Math.round(m))||m<48&&a(l.day,1)||o<30&&a(l.days,Math.floor(o))||o<60&&a(l.month,1)||o<365&&a(l.months,Math.floor(o/30))||i<2&&a(l.year,1)||a(l.years,Math.floor(i));return d.trim([h,j,p].join(" "))},parse:function(h){var g=d.trim(h);g=g.replace(/-/,"/").replace(/-/,"/");g=g.replace(/T/," ").replace(/Z/," UTC");g=g.replace(/([\+-]\d\d)\:?(\d\d)/," $1$2");return new Date(g)}});d.fn.timeago=function(){var h=this;h.each(c);var g=f.settings;if(g.refreshMillis>0){setInterval(function(){h.each(c)},g.refreshMillis)}return h};function c(){var g=f.parse(this.title);if(!isNaN(g)){d(this).text(b(g))}return this}function b(g){return f.inWords(e(g))}function e(g){var h=(new Date().getTime()-g.getTime()-Photowall.time_diff);return h}function a(g,i){var h=d.isFunction(g)?g(i):g;return h.replace(/%d/i,i)}if(d.browser.msie&&d.browser.version<7){document.createElement("abbr")}})(jQuery);jQuery.fn.rotate=function(h,c){var g=this.get(0);if(!c){g.angle=((g.angle==undefined?0:g.angle)+h)%360}else{g.angle=h}if(g.angle>=0){var e=Math.PI*g.angle/180}else{var e=Math.PI*(360+g.angle)/180}var a=Math.cos(e);var f=Math.sin(e);if(document.all&&!window.opera){var b=document.createElement("img");b.src=g.src;b.height=g.height;b.width=g.width;b.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+a+",M12="+(-f)+",M21="+f+",M22="+a+",SizingMethod='auto expand')"}else{var b=document.createElement("canvas");if(!g.oImage){b.oImage=new Image();b.oImage.src=g.src}else{b.oImage=g.oImage}b.style.width=b.width=Math.abs(a*b.oImage.width)+Math.abs(f*b.oImage.height);b.style.height=b.height=Math.abs(a*b.oImage.height)+Math.abs(f*b.oImage.width);var d=b.getContext("2d");d.save();if(e<=Math.PI/2){d.translate(f*b.oImage.height,0)}else{if(e<=Math.PI){d.translate(b.width,-a*b.oImage.height)}else{if(e<=1.5*Math.PI){d.translate(-a*b.oImage.width,b.height)}else{d.translate(0,-f*b.oImage.width)}}}d.rotate(e);d.drawImage(b.oImage,0,0,b.oImage.width,b.oImage.height);d.restore()}b.id=g.id;b.angle=g.angle;g.parentNode.replaceChild(b,g);return g.angle};jQuery.fn.rotateRight=function(a){this.rotate(a==undefined?90:a)};jQuery.fn.rotateLeft=function(a){this.rotate(a==undefined?-90:-a)};(function(e){var b={},k,m,o,j=e.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),a=false;e.tooltip={blocked:false,defaults:{delay:200,fade:false,showURL:true,extraClass:"",top:15,left:15,id:"tooltip"},block:function(){e.tooltip.blocked=!e.tooltip.blocked}};e.fn.extend({tooltip:function(p){p=e.extend({},e.tooltip.defaults,p);h(p);return this.each(function(){e.data(this,"tooltip",p);this.tOpacity=b.parent.css("opacity");this.tooltipText=this.title;e(this).removeAttr("title");this.alt=""}).mouseover(l).mouseout(f).click(f)},fixPNG:j?function(){return this.each(function(){var p=e(this).css("backgroundImage");if(p.match(/^url\(["']?(.*\.png)["']?\)$/i)){p=RegExp.$1;e(this).css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+p+"')"}).each(function(){var q=e(this).css("position");if(q!="absolute"&&q!="relative"){e(this).css("position","relative")}})}})}:function(){return this},unfixPNG:j?function(){return this.each(function(){e(this).css({filter:"",backgroundImage:""})})}:function(){return this},hideWhenEmpty:function(){return this.each(function(){e(this)[e(this).html()?"show":"hide"]()})},url:function(){return this.attr("href")||this.attr("src")}});function h(p){if(b.parent){return}b.parent=e('<div id="'+p.id+'"><h3></h3><div class="body"></div><div class="url"></div></div>').appendTo(document.body).hide();if(e.fn.bgiframe){b.parent.bgiframe()}b.title=e("h3",b.parent);b.body=e("div.body",b.parent);b.url=e("div.url",b.parent)}function c(p){return e.data(p,"tooltip")}function g(p){if(c(this).delay){o=setTimeout(n,c(this).delay)}else{n()}a=!!c(this).track;e(document.body).bind("mousemove",d);d(p)}function l(){if(e.tooltip.blocked||this==k||(!this.tooltipText&&!c(this).bodyHandler)){return}k=this;m=this.tooltipText;if(c(this).bodyHandler){b.title.hide();var s=c(this).bodyHandler.call(this);if(s.nodeType||s.jquery){b.body.empty().append(s)}else{b.body.html(s)}b.body.show()}else{if(c(this).showBody){var r=m.split(c(this).showBody);b.title.html(r.shift()).show();b.body.empty();for(var q=0,p;(p=r[q]);q++){if(q>0){b.body.append("<br/>")}b.body.append(p)}b.body.hideWhenEmpty()}else{b.title.html(m).show();b.body.hide()}}if(c(this).showURL&&e(this).url()){b.url.html(e(this).url().replace("http://","")).show()}else{b.url.hide()}b.parent.addClass(c(this).extraClass);if(c(this).fixPNG){b.parent.fixPNG()}g.apply(this,arguments)}function n(){o=null;if((!j||!e.fn.bgiframe)&&c(k).fade){if(b.parent.is(":animated")){b.parent.stop().show().fadeTo(c(k).fade,k.tOpacity)}else{b.parent.is(":visible")?b.parent.fadeTo(c(k).fade,k.tOpacity):b.parent.fadeIn(c(k).fade)}}else{b.parent.show()}d();Photowall.tooltipCallback(k)}function d(s){if(e.tooltip.blocked){return}if(s&&s.target.tagName=="OPTION"){return}if(!a&&b.parent.is(":visible")){e(document.body).unbind("mousemove",d)}if(k==null){e(document.body).unbind("mousemove",d);return}b.parent.removeClass("viewport-right").removeClass("viewport-bottom");var u=b.parent[0].offsetLeft;var t=b.parent[0].offsetTop;if(s){u=s.pageX+c(k).left;t=s.pageY+c(k).top;var q="auto";if(c(k).positionLeft){q=e(window).width()-u;u="auto"}b.parent.css({left:u,right:q,top:t})}var p=i(),r=b.parent[0];if(p.x+p.cx<r.offsetLeft+r.offsetWidth){u-=r.offsetWidth+20+c(k).left;b.parent.css({left:u+"px"}).addClass("viewport-right")}if(p.y+p.cy<r.offsetTop+r.offsetHeight){t-=r.offsetHeight+20+c(k).top;b.parent.css({top:t+"px"}).addClass("viewport-bottom")}}function i(){return{x:e(window).scrollLeft(),y:e(window).scrollTop(),cx:e(window).width(),cy:e(window).height()}}function f(r){if(e.tooltip.blocked){return}if(o){clearTimeout(o)}k=null;var q=c(this);function p(){b.parent.removeClass(q.extraClass).hide().css("opacity","")}if((!j||!e.fn.bgiframe)&&q.fade){if(b.parent.is(":animated")){b.parent.stop().fadeTo(q.fade,0,p)}else{b.parent.stop().fadeOut(q.fade,p)}}else{p()}if(c(this).fixPNG){b.parent.unfixPNG()}}})(jQuery);var ap_instances=new Array();function ap_stopAll(a){for(var b=0;b<ap_instances.length;b++){try{if(ap_instances[b]!=a){document.getElementById("audioplayer"+ap_instances[b].toString()).SetVariable("closePlayer",1)}else{document.getElementById("audioplayer"+ap_instances[b].toString()).SetVariable("closePlayer",0)}}catch(c){}}}function ap_registerPlayers(){var c;var b=document.getElementsByTagName("object");for(var a=0;a<b.length;a++){c=b[a].id;if(c.indexOf("audioplayer")==0){ap_instances[a]=c.substring(11,c.length)}}}var ap_clearID=setInterval(ap_registerPlayers,100);(function(){var b;b=jQuery.fn.flash=function(g,f,d,i){var h=d||b.replace;f=b.copy(b.pluginOptions,f);if(!b.hasFlash(f.version)){if(f.expressInstall&&b.hasFlash(6,0,65)){var e={flashvars:{MMredirectURL:location,MMplayerType:"PlugIn",MMdoctitle:jQuery("title").text()}}}else{if(f.update){h=i||b.update}else{return this}}}g=b.copy(b.htmlOptions,e,g);return this.each(function(){h.call(this,b.copy(g))})};b.copy=function(){var f={},e={};for(var g=0;g<arguments.length;g++){var d=arguments[g];if(d==undefined){continue}jQuery.extend(f,d);if(d.flashvars==undefined){continue}jQuery.extend(e,d.flashvars)}f.flashvars=e;return f};b.hasFlash=function(){if(/hasFlash\=true/.test(location)){return true}if(/hasFlash\=false/.test(location)){return false}var e=b.hasFlash.playerVersion().match(/\d+/g);var f=String([arguments[0],arguments[1],arguments[2]]).match(/\d+/g)||String(b.pluginOptions.version).match(/\d+/g);for(var d=0;d<3;d++){e[d]=parseInt(e[d]||0);f[d]=parseInt(f[d]||0);if(e[d]<f[d]){return false}if(e[d]>f[d]){return true}}return true};b.hasFlash.playerVersion=function(){try{try{var d=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");try{d.AllowScriptAccess="always"}catch(f){return"6,0,0"}}catch(f){}return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}catch(f){try{if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){return(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}}catch(f){}}return"0,0,0"};b.htmlOptions={height:240,flashvars:{},pluginspage:"http://www.adobe.com/go/getflashplayer",src:"#",type:"application/x-shockwave-flash",width:320};b.pluginOptions={expressInstall:false,update:true,version:"6.0.65"};b.replace=function(d){this.innerHTML='<div class="alt">'+this.innerHTML+"</div>";jQuery(this).addClass("flash-replaced").prepend(b.transform(d))};b.update=function(e){var d=String(location).split("?");d.splice(1,0,"?hasFlash=true&");d=d.join("");var f='<p>This content requires the Flash Player. <a href="http://www.adobe.com/go/getflashplayer">Download Flash Player</a>. Already have Flash Player? <a href="'+d+'">Click here.</a></p>';this.innerHTML='<span class="alt">'+this.innerHTML+"</span>";jQuery(this).addClass("flash-update").prepend(f)};function a(){var e="";for(var d in this){if(typeof this[d]!="function"){e+=d+'="'+this[d]+'" '}}return e}function c(){var e="";for(var d in this){if(typeof this[d]!="function"){e+=d+"="+encodeURIComponent(this[d])+"&"}}return e.replace(/&$/,"")}b.transform=function(d){d.toString=a;if(d.flashvars){d.flashvars.toString=c}return"<embed "+String(d)+"/>"};if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}})}})();jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m=$.extend({},m);m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}};
/* Copyright (c) 2009 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
 * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
 *
 * Version: 3.0.2
 * 
 * Requires: 1.2.2+
 */
(function(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(f){var d=[].slice.call(arguments,1),g=0,e=true;f=c.event.fix(f||window.event);f.type="mousewheel";if(f.wheelDelta){g=f.wheelDelta/120}if(f.detail){g=-f.detail/3}d.unshift(f,g);return c.event.handle.apply(this,d)}})(jQuery);(function(){var a=false,b=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Class=function(){};Class.extend=function(g){var f=this.prototype;a=true;var e=new this();a=false;for(var d in g){e[d]=typeof g[d]=="function"&&typeof f[d]=="function"&&b.test(g[d])?(function(h,i){return function(){var k=this._super;this._super=f[h];var j=i.apply(this,arguments);this._super=k;return j}})(d,g[d]):g[d]}function c(){if(!a&&this.init){this.init.apply(this,arguments)}}c.prototype=e;c.constructor=c;c.extend=arguments.callee;return c}})();(function(a){a.srender=function(b,c,d){a.srender.cache=a.srender.cache||{};if(a.srender.cache[b]){fn=a.srender.cache[b]}else{if(typeof c=="undefined"){return false}fn=a.srender.cache[b]=new Function("obj",'var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push("'+c.replace(/[\r\t\n]/g," ").replace(/\"/g,'\\"').split("<%").join("\t").replace(/((^|%>)[^\t]*)/g,"$1\r").replace(/\t=(.*?)%>/g,'",$1,"').split("\t").join('");').split("%>").join('p.push("').split("\r").join("")+"\");}return p.join('');")}if(typeof d!="undefined"){return fn(d)}else{return fn}}})(jQuery);(function(c){var a="([^/]+)";var b=/:([\w\d]+)/g;Sammy={};Sammy.VERSION="0.2.0";Sammy.Object=Class.extend({init:function(d){c.extend(this,d)},clone:function(d){if(typeof d=="undefined"){d=this}return c.extend({},d)},toHash:function(){var d={};this.each(function(f,e){if(!c.isFunction(e)){d[f]=e}});return d},toHTML:function(){var d="";this.each(function(f,e){if(!c.isFunction(e)){d+="<strong>"+f+"</strong> "+e+"<br />"}});return d},uuid:function(){if(typeof this._uuid=="undefined"||!this._uuid){this._uuid=(new Date()).getTime()+"-"+parseInt(Math.random()*1000)}return this._uuid},each:function(){var f,e,g,d;f=this;if(typeof arguments[0]!="function"){e=arguments[0];g=arguments[1]}else{e=this;g=arguments[0]}d=function(){return g.apply(f,arguments)};c.each(e,d)},log:function(){var d=[].slice.call(arguments);d.unshift("["+Date()+"]");if(typeof window.console!="undefined"){window.console.log.apply(window.console,d)}else{if(typeof console!="undefined"){console.log.apply(this,d)}else{}}}});Sammy.Application=Sammy.Object.extend({ROUTE_VERBS:["get","post","put","delete"],APP_EVENTS:["run","unload","lookup-route","run-route","route-found","event-context-before","event-context-after","changed","error-404","check-form-submission","redirect"],_last_route:null,_running:false,data_store_name:"sammy-app",element_selector:"body",debug:false,silence_404:true,run_interval_every:50,init:function(d){var e=this;this.routes={};this.listeners={};this.befores=[];this.namespace=this.uuid();this.context_prototype=Sammy.EventContext.extend({});this.each(this.ROUTE_VERBS,function(f,g){this._defineRouteShortcut(g)});d.apply(this);if(this.debug){this.addLogger(function(g,f){e.log(e.toString(),g.cleaned_type,f||{})})}},toString:function(){return"Sammy.Application:"+this.element_selector},$element:function(){return c(this.element_selector)},route:function(h,f,j){var g=this;var i=[];if(f.constructor==String){while((path_match=b.exec(f))!=null){i.push(path_match[1])}f=new RegExp(f.replace(b,a)+"$")}var d={verb:h,path:f,callback:j,param_names:i};if(typeof this.routes[h]=="undefined"||this.routes[h].length==0){this.routes[h]=[d]}else{var e=false;this.each(this.routes[h],function(l,k){if(f.toString().length>=k.path.toString().length){this.routes[h].splice(l,0,d);e=true;return false}});if(!e){this.routes[h].push(d)}}return d},eventNamespace:function(){return this.data_store_name+"-"+this.namespace+"-"},bind:function(d,f,g){if(typeof g=="undefined"){g=f}var e=function(){var j,h,i;j=arguments[0];h=arguments[1];i=arguments[2];j.cleaned_type=j.type.replace(h.eventNamespace(),"");g.apply(h,[j,i])};if(!this.listeners[d]){this.listeners[d]=[]}this.listeners[d].push(e);if(this.isRunning()){return this._listen(d,e)}},trigger:function(d,f,e){if(typeof e=="undefined"){e=new this.context_prototype(this,"bind",d,f)}return this.$element().triggerHandler(e.eventNamespace()+d,[e,f])},before:function(d){return this.befores.push(d)},after:function(d){return this.bind("event-context-after",d)},isRunning:function(){return this._running},helpers:function(d){this.context_prototype=this.context_prototype.extend(d)},run:function(d){if(this.isRunning()){return false}var e=this;this.each(this.listeners,function(f,g){this.each(g,function(j,h){this._listen(f,h)})});this.trigger("run",{start_url:d});this._running=true;this.$element().data(this.data_store_name,this);this.last_location=null;if(this.getLocation()==""&&typeof d!="undefined"){this.setLocation(d)}this._checkLocation();this._interval=setInterval(function(){e._checkLocation.apply(e)},this.run_interval_every);this.bind("changed",function(){e.$element().find("form:not(."+e.eventNamespace()+")").bind("submit",function(){return e._checkFormSubmission(this)}).addClass(e.eventNamespace())});c("body").bind("onunload",function(){e.unload()});this.trigger("changed")},unload:function(){if(!this.isRunning()){return false}var d=this;this.trigger("unload");clearInterval(this._interval);this.$element().find("form").unbind("submit").removeClass(d.eventNamespace());this.$element().removeData(this.data_store_name);this.each(this.listeners,function(e,f){this.each(f,function(h,g){this._unlisten(e,g)})});this._running=false},addLogger:function(d){this.each(this.APP_EVENTS,function(f,g){this.bind(g,d)})},lookupRoute:function(f,e){var d=false;this.trigger("lookup-route",{verb:f,path:e});if(typeof this.routes[f]!="undefined"){this.each(this.routes[f],function(h,g){if(e.match(g.path)){d=g;return false}})}return d},runRoute:function(k,h,j){this.trigger("run-route",{verb:k,path:h,params:j});if(typeof j=="undefined"){j={}}var e=this.lookupRoute(k,h);if(e){this.trigger("route-found",{route:e});if((path_params=e.path.exec(h))!=null){path_params.shift();this.each(path_params,function(l,m){if(e.param_names[l]){j[e.param_names[l]]=m}else{if(!j.splat){j.splat=[]}j.splat.push(m)}})}var f=new this.context_prototype(this,k,h,j);this.last_route=e;var d=true;var i=this.befores.slice(0);while(i.length>0){if(i.shift().apply(f)===false){return false}}f.trigger("event-context-before");var g=e.callback.apply(f);f.trigger("event-context-after");return g}else{this.notFound(k,h)}},getLocation:function(){return this.clone(window.location).hash.toString()},setLocation:function(d){window.location=d},swap:function(d){return this.$element().html(d)},notFound:function(e,d){this.trigger("error-404",{verb:e,path:d});throw ("404 Not Found "+e+" "+d)},_defineRouteShortcut:function(e){var d=this;this[e]=function(f,g){d.route.apply(d,[e,f,g])}},_checkLocation:function(){try{var d,f;d=this.getLocation();if(d!=this.last_location){f=this.runRoute("get",d)}this.last_location=d}catch(g){this.last_location=d;if(g.toString().match(/^404/)&&this.silence_404){return f}else{throw (g)}}return f},_checkFormSubmission:function(g){var d,i,k,j,f;this.trigger("check-form-submission",{form:g});d=c(g);i=d.attr("action");k=d.attr("method").toString().toLowerCase();j={};d.find(":input[type!=submit]").each(function(){j[c(this).attr("name")]=c(this).val()});try{f=this.runRoute(k,i,j)}catch(h){if(h.toString().match(/^404/)&&this.silence_404){return true}else{throw (h)}}return(typeof f=="undefined")?false:f},_listen:function(d,e){return this.$element().bind(this.eventNamespace()+d,e)},_unlisten:function(d,e){return this.$element().unbind(this.eventNamespace()+d,e)}});Sammy.EventContext=Sammy.Object.extend({init:function(g,f,d,e){this.app=g;this.verb=f;this.path=d;this.params=new Sammy.Object(e)},$element:function(){return this.app.$element()},template:function(e,f,d){if(typeof d=="undefined"){d=e}return c.srender(d,e,c.extend({},f,this))},partial:function(g,f,i){var e,h,d;d=this;if(typeof i=="undefined"){if(typeof f=="function"){i=f;f={}}else{i=function(j){d.app.swap(j)}}}e=c.srender(g);f=c.extend({},f,this);if(e){h=e(f);i.apply(d,[h]);d.trigger("changed")}else{c.get(g,function(j){h=c.srender(g,j,f);i.apply(d,[h]);d.trigger("changed")})}},redirect:function(d){this.trigger("redirect",{to:d});return this.app.setLocation(d)},trigger:function(d,e){return this.app.trigger(d,e,this)},eventNamespace:function(){return this.app.eventNamespace()},notFound:function(){return this.app.notFound(this.verb,this.path)}});c.sammy=function(d){return new Sammy.Application(d)}})(jQuery);var Photowall=window.Photowall={};var somevar="hello";$(document).ready(function(){$(document).keypress(function(b){var a=b.keyCode||b.charCode;if(a==27){return false}});Photowall.time_diff=new Date().getTime()-Number($("#seedtime").html());Photowall.fixIE();Photowall.wall.init();Photowall.search.setEvents();Photowall.menu.setEvents();$(".ondeck").live("mouseover",function(){$(this).addClass("ondeck-hover")});$(".ondeck").live("mouseout",function(){$(this).removeClass("ondeck-hover")});$(".ondecka").live("click",function(){var a=$(this).attr("id").split("-")[0];$("#"+a+"-a").click();return false});$(".updatea").click(function(){if(Photowall.wall.state=="updating"){clearInterval(Photowall.wall.updateInterval)}else{Photowall.wall.update();Photowall.wall.updateInterval=setInterval(function(){Photowall.wall.update()},5000)}return false});fadeOutFooter();$("abbr[class*=timeago]").timeago();Photowall.Navigator.init();setInterval(function(){console.log("Resetting the ping status. From:",Photowall.wall.pingReturned);Photowall.wall.pingReturned=true},30000);if($("#destinations-notice").length>0){setTimeout(function(){$("#destinations-notice").animate({top:0});setTimeout(function(){$("#destinations-notice").fadeOut()},10000)},5000)}});Photowall.startIdleCheck=function(){Photowall.idleTimeout=setTimeout(function(){tb_show(null,"/pages/timeout");Photowall.wall.shouldPing=false},60000);$(document).bind("mousemove",Photowall.clearIdleCheck)};Photowall.clearIdleCheck=function(){$(document).unbind("mousemove",Photowall.clearIdleCheck);clearTimeout(Photowall.idleCheckTimeout);clearTimeout(Photowall.stopTimeout);Photowall.idleCheckTimeout=setTimeout(Photowall.startIdleCheck,1800000);tb_remove();Photowall.wall.shouldPing=true};Photowall.tooltipCallback=function(b){var a=$(b).attr("id").split("-").shift();if($("#"+a+"-time").length>0){$("#tooltip .body").prepend($("#"+a+"-time").html()+"<br />").show()}};function applyTooltip(a){$(a).tooltip({showURL:false,delay:0,showBody:" - "})}function fadeOutFooter(){Photowall.footerTimeout=setTimeout(function(){$(".poweredby, .voicetech, #flashMessage").hide()},10000);$(".poweredby").hover(function(){clearTimeout(Photowall.footerTimeout);$(".poweredby").show()},function(){fadeOutFooter()});$.cookie("Photowall.poweredby",1)}Photowall.overlayHook=function(){clearTimeout(Photowall.ImageHoverTimeout);if($("#author-browser").is(":visible")){return false}$("#TB_Image_Overlay").load("/photos/overlay/"+Photowall.currentPhotoId+"?&_="+Math.random(),function(){tb_init(".zoomoverlay .thickbox");$(".zoomoverlay .thickbox").click(function(){$(".fancyOverlay").click();return false});$(".zoomoverlay abbr[class*=timeago]").timeago();$("#TB_Image_Overlay").css({width:$("#TB_Image").width(),left:$("#TB_Image").position().left+16});var a=$("#TB_Image_Overlay").height();$("#TB_Image_Overlay").data("realheight",a);if(!$.cookie("Photowall.overlayShown")){$("#TB_Image_Overlay").css({top:$("#TB_Image").position().top+$("#TB_Image").height()-$("#TB_Image_Overlay").height()});$.cookie("Photowall.overlayShown",1,{expires:null});Photowall.ImageHoverTimeout=setTimeout(function(){$("#TB_Image_Overlay").animate({top:"+="+a,height:0}).data("state","hidden")},3000)}else{$("#TB_Image_Overlay").css({top:$("#TB_Image").position().top+$("#TB_Image").height(),height:0}).data("state","hidden")}$("#TB_Image_Overlay").mouseenter(function(){clearTimeout(Photowall.ImageHoverTimeout)}).mouseleave(function(){if($("#TB_Image_Overlay").data("state")=="visible"){Photowall.ImageHoverTimeout=setTimeout(function(){$("#TB_Image_Overlay").animate({top:"+="+$("#TB_Image_Overlay").data("realheight"),height:0}).data("state","hidden")},1000)}});$("#TB_window").append($("#chrome-content").remove().html());$("#TB_window").append($("#chrome-menu").remove().html());tb_init(".overlay-menu .thickbox");$(".overlay-details").click(function(){$("#TB_Image_Overlay").trigger("mouseenter");if($("#TB_Image_Overlay").data("state")=="hidden"){$("#TB_Image_Overlay").animate({top:"-="+$("#TB_Image_Overlay").data("realheight"),height:$("#TB_Image_Overlay").data("realheight")});$("#TB_Image_Overlay").data("state","visible")}$(this).blur()})});return};Photowall.warnInappropriate=function(){alert("Our automated system has detected potentially offensive content in your input.  Please remove any offensive content and re-submit.")};Photowall.share=function(a){$.cookie("Photowall.browser.tab","share",{expires:365,path:"/"});pw(a)};Photowall.sendToService=function(c,a){var b;switch(a){case"comment":b="comments";break;default:b="share";break}$.cookie("Photowall.browser.tab",b,{expires:365,path:"/"});pw(c)};Photowall.sendToNetwork=function(b){$("#share_submit").attr("disabled","true");var a="/friends/share.json";console.log(a,"share");$.post(a,{"data[Share][image_id]":b,"data[Share][message]":$("#network_prompt").val()},function(c){$("#share_flash").html("You have successfully shared this photo with your network!");setTimeout(function(){tb_remove()},2000)})};Photowall.deleteComment=function(a){if(confirm("Are you sure you want to delete this comment?")){$.post("/comments/delete.json",{"data[Comment][id]":a},function(b){if(b.result){$(".comment-"+a).fadeOut()}},"json")}};Photowall.reportPhoto=function(a){if(confirm("Are you sure you want to report this photo?")){$.post("/abusereports/create.json",{"data[AbuseReport][image_id]":a},function(b){if(b.result){alert("This photo has been reported to our Quality Control team.");$("#"+a+"-w, #browser-thumb-"+a).fadeOut("fast",function(){if($(".browser-list:visible").length>0){$(".browser-thumb:first").click()}});$("#"+a+"-h").parent().fadeOut(function(){$(this).remove()});tb_remove()}},"json")}};Photowall.unsubscribe=function(){if(confirm("Are you sure you want to be permanently removed from MSNPhotoWALL?")){$.post("/users/unsubscribe.json",{"data[confirm]":1},function(a){if(a){alert("You have been removed from MSNPhotoWALL.  You will now be directed to MSN.com.");window.location="http://www.msn.com"}},"json")}};Photowall.clearHistory=function(){$.post("/histories/clear.json",{"data[confirm]":1},function(a){if(a.result){window.location="#/activity"}},"json")};Photowall.fixIE=function(){if(!Array.indexOf){Array.prototype.indexOf=function(a){var b=-1;for(var c=0;c<this.length;c++){var d=this[c];if(d==a){b=c;break}}return b}}if(!window.console){window.console={};window.console.log=window.console.debug=function(c){return;var b=document.getElementsByTagName("body")[0];var a=document.createElement("div");a.innerHTML=c;b.insertBefore(a,b.lastChild)}}};(function(b){var a=navigator.userAgent.toLowerCase();b.browser={version:(a.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(a),opera:/opera/.test(a),msie:/msie/.test(a)&&!/opera/.test(a),mozilla:/mozilla/.test(a)&&!/(compatible|webkit)/.test(a)}})(jQuery);function serialize(c){var h=function(o){var n=typeof o,k;var m;if(n=="object"&&!o){return"null"}if(n=="object"){if(!o.constructor){return"object"}var j=o.constructor.toString();k=j.match(/(\w+)\(/);if(k){j=k[1].toLowerCase()}var l=["boolean","number","string","array"];for(m in l){if(j==l[m]){n=l[m];break}}}return n};var e=h(c);var a,b="";switch(e){case"function":a="";break;case"undefined":a="N";break;case"boolean":a="b:"+(c?"1":"0");break;case"number":a=(Math.round(c)==c?"i":"d")+":"+c;break;case"string":a="s:"+c.length+':"'+c+'"';break;case"array":case"object":a="a";var d=0;var f="";var i;var g;for(g in c){b=h(c[g]);if(b=="function"){continue}i=(g.match(/^[0-9]+$/)?parseInt(g,10):g);f+=serialize(i)+serialize(c[g]);d++}a+=":"+d+":{"+f+"}";break;default:break}if(e!="object"&&e!="array"){a+=";"}return a}$(function(){if($.browser.msie&&$.browser.version<7){$("#browser-warn").show()}if($.browser.mozilla&&$.browser.version<3){$("#browser-warn").show()}Photowall.hasFlash=$("body").flash.hasFlash()});var Utf8={encode:function(b){b=b.replace(/\r\n/g,"\n");var a="";for(var e=0;e<b.length;e++){var d=b.charCodeAt(e);if(d<128){a+=String.fromCharCode(d)}else{if((d>127)&&(d<2048)){a+=String.fromCharCode((d>>6)|192);a+=String.fromCharCode((d&63)|128)}else{a+=String.fromCharCode((d>>12)|224);a+=String.fromCharCode(((d>>6)&63)|128);a+=String.fromCharCode((d&63)|128)}}}return a},decode:function(a){var b="";var d=0;var e=c1=c2=0;while(d<a.length){e=a.charCodeAt(d);if(e<128){b+=String.fromCharCode(e);d++}else{if((e>191)&&(e<224)){c2=a.charCodeAt(d+1);b+=String.fromCharCode(((e&31)<<6)|(c2&63));d+=2}else{c2=a.charCodeAt(d+1);c3=a.charCodeAt(d+2);b+=String.fromCharCode(((e&15)<<12)|((c2&63)<<6)|(c3&63));d+=3}}}return b}};Photowall.Photo={};Photowall.Photo.addFavorite=function(b,a){$.post("/favorites.json?_="+Math.random(),{"data[Favorite][image_id]":b},function(c){if(c.result=="success"){$(".verb",a).html("Liked!")}},"json")};Photowall.Photo.removeFavorite=function(a){if(confirm("Are you sure you want to remove this photo from your favorites?")){$.post("/favorites/delete.json?_="+Math.random(),{"data[Favorite][image_id]":a},function(b){$("#favorite-"+a).fadeOut()})}};Photowall.Photo.report=function(a){if(confirm("Are you sure you want to report this photo?")){$.post("/abusereports/create.json",{"data[AbuseReport][image_id]":a},function(b){if(b.result){alert("This photo has been reported to our Quality Control team.");$("#"+a+"-w, #browser-thumb-"+a).fadeOut("fast",function(){if($(".browser-list:visible").length>0){$(".browser-thumb:first").click()}});$("#"+a+"-h").parent().fadeOut(function(){$(this).remove()});tb_remove()}},"json")}};Photowall.Photo.activateThumb=function(b){clearTimeout(Photowall.ImageHoverTimeout);$("#TB_Image_Overlay").html("");var c=$(b).attr("id").split("-")[0];var a=$(b).attr("href");Photowall.currentPhotoId=c;console.log("activating thumb");pw(c,a);return false};function pw(b,a){$(".photoview-navarrow").hide();$("#pw-banner").hide();if($("#TB_load").length<1){$("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");$("#TB_load").show()}if(a){Photowall.Photo.preload=new Image();$(Photowall.Photo.preload).load(function(){tb_show(null,"/photos/view/"+b)}).attr("src",a).attr("id","photoviewphoto")}else{$.getJSON("/photos/url/"+b+".json",function(c){if(c.url){pw(b,c.url)}else{tb_remove()}})}Photowall.Navigator.track("#/photos/"+b)}Photowall.Photo.toggleMenu=function(){var b=$(".overlay-menu");var e=$(".overlay-menu-show");var d=$(".overlay-menu-show").position();var c=d.top-(b.height()-e.height());var a=d.left-(b.width()-e.width());$(".overlay-menu").toggle().css({top:c,left:a})};Photowall.Photo.initPhotoView=function(a){console.log("initializing photo view for:",a);Photowall.wall.hideNavArrows(1);Photowall.Photo.photoViewAdjust();Photowall.Photo.contentAdjust();Photowall.Photo.activateNavigation(a);$("#TB_load").remove();$("#photoviewphoto").css({opacity:1});$("#photoview-breadcrumbs").show();Photowall.Photo.activateAd()};Photowall.Photo.unloadPhotoView=function(){$(".photoview-navarrow").hide().unbind("click");$("#photoviewphoto").unbind("load")};Photowall.Photo.photoViewAdjust=function(){var k=$("#photoviewphoto").height();var c=$("#photoviewphoto").width();if(k<100||c<100){return}var j=100;var f=$(window).height()-j;var i=(640>k)?k:640;var b=590;var g=(f>i)?i:f;$("#TB_ajaxContent").height(g);var e=c/k;if(e>1){$("#photoviewphoto").css({width:b,height:g-10})}else{$("#photoviewphoto").css({height:g-10,width:(g-10)*e})}var a=$("#photoviewphoto").width();var d=(b-a)/2;$("#photoviewphoto").css({marginLeft:d})};Photowall.Photo.contentAdjust=function(){var c=$("#TB_ajaxContent").height();var a=[".photoview-title",".photoview-meta",".photoview-share-wrap",".photoview-controls",".photoview-comment-add"];var d=0;$.each(a,function(f,g){d+=$(g).height()});console.log("Content height:",c,"Elements height:",d);var b=c-d-55;$(".photoview-input-wrap").height(b)};Photowall.Photo.activateNavigation=function(b){var g=($("#"+b).length>0);if(!g){console.log("Photo doesnt exist on page!",$("#"+b));return}var f=$(".thumb").length;var c,i=false,e=1,d;$(".thumb").each(function(k,j){if(i){d=$(j).attr("id");return false}if($(j).attr("id")==b){i=true}if(!i){c=$(j).attr("id");e++}});var a=-82;if(c){$(".photoview-navarrow-left").css({left:a}).fadeIn().unbind("click").click(function(){$("#"+c+"-a").click();return false})}var h=950;if(d){$(".photoview-navarrow-right").css({left:h}).fadeIn().unbind("click").click(function(){$("#"+d+"-a").click();return false})}console.log(e+" of "+f);if(i){$("#TB_ajaxWindowTitle").html("Photo "+e+" of "+f)}};Photowall.Photo.openEditor=function(a){$(".photoview-content-wrap").load("/photos/editor/"+a,function(){$("#country-select").change(function(){var b="locations/provinces/"+$("#country-select").val()+".json?_="+Math.random();$.getJSON(b,function(c){$("#province-select").html("<option>-- Select a State / Province --</option>");$.each(c.provinces,function(e,f){var d=document.createElement("option");$(d).html(f.Location.province);$("#province-select").append(d)})});$(this).data("changed",true)});$("#province-select").change(function(){var b="locations/cities/"+$("#country-select").val()+"/"+$("#province-select").val()+".json?_="+Math.random();$.getJSON(b,function(c){$("#city-select").html("<option>-- Select a City --</option>");$.each(c,function(e,f){var d=document.createElement("option");$(d).html(f.Location.city);$("#city-select").append(d)})});$(this).data("changed",true)});$("#city-select").change(function(){var b="locations/geo/"+$("#country-select").val()+"/"+$("#province-select").val()+"/"+$("#city-select").val()+".json?_="+Math.random();$.getJSON(b,function(c){$("#lat").val(c.Location.latitude);$("#lon").val(c.Location.longitude)});$(this).data("changed",true)})});return false};Photowall.Photo.save=function(b){var c={};$("*[name*=data]").each(function(e,d){c[$(d).attr("name")]=$(d).val()});var a="/photos/"+b+".json?_="+Math.random();$.post(a,c,function(d){if(d.result=="success"){pw(b)}else{}},"json")};Photowall.Photo.setPrivacy=function(b,a){$("#photoview-manage-privacy").val(b);$("#photoview-manage-privacy-text").html(a)};Photowall.Photo.rotate=function(a){var b=$("#photoviewphoto").rotate(a);$("#ab-manage-rotation").val(b)};Photowall.Photo.deletePhoto=function(a){if(confirm("Are you sure you want to permanently delete this photo?  This cannot be undone!")){$.post("/photos/delete.json?_="+Math.random(),{"data[ImageDetail][image_id]":a},function(b){if(b.result=="success"){$("#"+a+"-a").remove();tb_remove()}},"json")}};Photowall.Photo.activateComments=function(a){$(".photoview-comment-input-wrap").toggle();$("#photoview-comment-input").focus();console.log("Do comments exist?",$(".photoview-comment-list").length);if($(".photoview-comment-list").length<1){Photowall.Photo.deactivateMap();$("#photoview-input-wrap").html('<ul class="photoview-comment-list"></ul>');$(".photoview-comment-list").load("/comments/photoview_list/"+a,function(){$("abbr",".photoview-comment-list").timeago()})}return false};Photowall.Photo.deactivateComments=function(){$(".photoview-comment-input-wrap").hide();return false};Photowall.Photo.addComment=function(a){var b=$("#photoview-comment-input").val();if($.trim(b)===""){return}$.post("/comments",{"data[Comment][image_id]":a,"data[Comment][content]":b},function(c){if(c=="blacklist"){Photowall.warnInappropriate();return}$(".photoview-comment-list").html(c);$("#photoview-comment-input").val("");$(".photoview-comment-input-wrap").hide();$("abbr",".photoview-content-wrap").timeago()})};Photowall.Photo.activateMap=function(a,b){if(typeof VEMap!="function"){$.getScript("http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2&mkt=en-us",function(){Photowall.Photo.activateMap(a,b)});return false}setTimeout(function(){$("#photoview-input-wrap").html('<div id="photoview-map"></div>');$("#photoview-map").width($("#photoview-input-wrap").width());$("#photoview-map").height($("#photoview-input-wrap").height());Photowall.Photo.map=new VEMap("photoview-map");var d=new VELatLong(a,b);var e=false;Photowall.Photo.map.LoadMap(d,11,VEMapStyle.Road,e,VEMapMode.Mode2D,false,1);var c=new VEShape(VEShapeType.Pushpin,d);Photowall.Photo.map.AddShape(c);Photowall.Photo.map.HideDashboard()},200);return false};Photowall.Photo.deactivateMap=function(){try{Photowall.Photo.map.Dispose()}catch(a){}};Photowall.Photo.flashMsg=function(b){Photowall.Photo.content=$("#photoview-input-wrap").html();var a='<div class="photoview-flash">'+b+'<br /><br /><input type="button" onclick="Photowall.Photo.revertFlash();" value="OK" /></div>';$("#photoview-input-wrap").html(a)};Photowall.Photo.revertFlash=function(){$("#photoview-input-wrap").html(Photowall.Photo.content)};Photowall.Photo.activateFacebook=function(a){$.getJSON("/destinations/facebook/"+a+".json?_="+Math.random(),function(b){if(b.result=="success"){Photowall.Photo.flashMsg("This photo has been sent to Facebook! Please allow a few moments to process.")}else{if(b.result=="setup"){window.location=b.url}}});return false};Photowall.Photo.activateFlickr=function(a){$.getJSON("/destinations/flickr/"+a+".json?_="+Math.random(),function(b){if(b.result=="success"){Photowall.Photo.flashMsg("This photo has been sent to Flickr! Please allow a few moments to process.")}else{if(b.result=="setup"){window.location=b.url}}});return false};Photowall.Photo.activateTwitter=function(a){$.getJSON("/destinations/twitter/"+a+".json?_="+Math.random(),function(b){Photowall.Photo.content_twitter=$("#photoview-input-wrap").html();if(b.result=="success"){Photowall.Photo.flashMsg("This photo has been sent to Twitter!")}else{if(b.result=="setup"){window.location="/destinations/twitter_setup/"+b.image_id}else{if(b.result=="prompt"){$("#photoview-input-wrap").load("/destinations/twitter_prompt/"+b.image_id)}}}});return false};Photowall.Photo.activateNetwork=function(a){Photowall.Photo.content_share=$("#photoview-input-wrap").html();$(".photoview-input-wrap").load("/friends/share/"+a);return false};Photowall.Photo.sendToNetwork=function(b){$("#share_submit").attr("disabled","true");var a="/friends/share.json";$.post(a,{"data[Share][image_id]":b,"data[Share][message]":$("#network_prompt").val()},function(c){Photowall.Photo.flashMsg("You have successfully shared this photo with your network!");Photowall.Photo.content=Photowall.Photo.content_share})};Photowall.Photo.activateAd=function(){clearTimeout(Photowall.Photo.adStartTimeout);clearTimeout(Photowall.Photo.adEndTimeout);Photowall.Photo.adStartTimeout=setTimeout(function(){if($("#photoviewphoto").length<1){return}$("#bing-travel").width($("#photoviewphoto").width()).css({left:$("#photoviewphoto").position().left,marginLeft:$("#photoviewphoto").css("marginLeft")});$("#bing-travel").fadeIn("slow");Photowall.Photo.adEndTimeout=setTimeout(function(){$("#bing-travel").fadeOut("slow")},5000)},3000)};Photowall.Photo.potd=function(a){$.post("/photos/potd.json",{"data[image_id]":a},function(b){})};Photowall.wall={id:null,state:null,updateInterval:null,pingInterval:null,defaultSize:100,liveIdFilter:null,startWall:null,pingReturned:true,shouldPing:false,urls:{"#globalwall":"/photos","#mywall":"/users/wall","#searchwall":"/photos/search"},details:{"#globalwall":null,"#mywall":null,"#search":null}};Photowall.wall.init=function(){console.log("Initializing wall events!");Photowall.wall.currentFeaturedId=$(".ondeck-featured-id:first").val()};Photowall.wall.startPinging=function(){if(Photowall.wall.pingInterval==null){Photowall.wall.pingInterval=setInterval(Photowall.wall.ping,5000);Photowall.Comet.subscribe()}setTimeout(function(){console.log("Starting ping!");Photowall.wall.shouldPing=true},4500)};Photowall.wall.stopPinging=function(){console.log("Stopping ping!");Photowall.wall.shouldPing=false};Photowall.wall.ping=function(){if(!Photowall.wall.shouldPing){console.log("shouldPing set to",Photowall.wall.shouldPing);return}if(!Photowall.wall.pingReturned){console.log("Our previous ping has not returned yet!");return}if($(".wall").length<1){console.log("There is no wall to update!");return}Photowall.wall.startWall=Photowall.wall.id;var b=(Photowall.wall.id=="#mywall"?"users":"photos");var f="latest";var a="";var e="html";var c=$(".thumb:first").attr("id");if(c===null||c===""){c=0}switch(Photowall.wall.id){case"#mywall":b="users";f="latest";a="after="+c;break;case"#globalwall":if(Photowall.Comet.useComet){Photowall.Comet.subscribe();return}if(typeof Photowall.wall.currentFeaturedId=="undefined"){Photowall.wall.currentFeaturedId=$(".ondeck-featured-id:first").val()}if(typeof Photowall.wall.currentFeaturedId=="udnefined"){return}b="photos";a="featured_id="+Photowall.wall.currentFeaturedId;break;case"#searchwall":if(Photowall.search.lastSearch===null){return}b="search";a="type="+Photowall.search.type+"&context="+Photowall.search.fromWallId+"&limit=1&q="+escape(Photowall.search.lastSearch)+"&after="+c;f=Photowall.search.type;break;case"#theirwall":default:b="users";f="landing/"+Photowall.wall.id;a="&limit=1&after="+c;break}Photowall.wall.pingReturned=false;var d="/"+b+"/"+f+"?"+a+"&_="+Math.random();$.get(d,function(h){Photowall.wall.pingReturned=true;if(Photowall.wall.startWall!=Photowall.wall.id){return}if(h!==""){var g,i;switch(b){case"users":g=$(".thumbawrap","<div>"+h+"</div>");Photowall.wall.updateWall(g);break;default:g=$(".thumbawrap",h);i=$(".ondeck",h);var k=$(".thumb",g).attr("id");if(typeof(k)=="undefined"){return}var j=$(g).attr("id").split("-").shift();if($("#"+j+"-w").length>0){console.log("this image already exists on the wall!");return}else{Photowall.wall.updateWall(g);Photowall.wall.updateOndeck(i.html())}break}}},e)};Photowall.wall.updateWall=function(d){if(!Photowall.wall.shouldPing){console.log("Cancelling wall update: shouldPing is set to false!");return false}var b=$(".thumb",d).attr("id");if($("#"+b).length>0){console.log("> Cancelling wall update: image already exists!");return false}Photowall.wall.state="updating";if($(".thumba",".wall").length>=100){$(".thumba:last",".wall").remove()}if($(".col:first").children().length>=4){var a=document.createElement("div");$(a).addClass("col").css({display:"none"});$(".wall").prepend(a);$(a).show("slow")}$(d).hide();$(".col:first").prepend(d);var c=$(".col:first .thumbawrap:first");$(c).css({position:"relative",top:-64,marginBottom:-64});$(c).show().animate({top:(64)*(3-($(".col:first").children().length-1))},"slow",function(){$("abbr[class*=timeago]",".thumbawrap:first").timeago();applyTooltip(".thumbawrap:first a.thumba")})};Photowall.wall.updateOndeck=function(a){if(!Photowall.wall.shouldPing){console.log("Cancelling ondeck update: shouldPing is set to false!");return false}var b=document.createElement("div");$(b).addClass("ondeck").css({display:"none"});$(b).insertBefore(".ondeck:first");$(b).html(a);$(b).show("slow");tb_init(".ondeck:first .thickbox");$(".ondeck:last").remove();$("abbr[class*=timeago]").timeago();Photowall.wall.currentFeaturedId=$(".ondeck-featured-id:first").val()};Photowall.wall.slideNewer=function(){$(".navarrowleft").blur();$(".colorstrip").animate({scrollLeft:"-=250"},function(){Photowall.Loader.refresh()});return false};Photowall.wall.slideOlder=function(){$(".navarrowright").blur();$end=$(".col:last").position().left;if($end<$(".container:first").width()){}var a=($(".wall").position().left==10);$(".navarrowleft").show();$(".colorstrip").animate({scrollLeft:"+=250"},function(){Photowall.Loader.refresh()});return false};Photowall.wall.slideOut=function(a){console.log("Sliding the wall out!");$(".colorstrip").addClass("loading").scrollLeft(0);Photowall.wall.stopPinging();$("#primarycontent").css({position:"relative"}).animate({left:$(".container").width()},function(){$("#primarycontent").html("");if(typeof a=="function"){a.apply()}});$("#detail").animate({left:$(".container").width()},function(){$("#detail").html("")})};Photowall.wall.slideIn=function(a){console.log("Sliding the wall in!");$(".colorstrip").scrollLeft(0);$("#primarycontent").animate({left:0},function(){Photowall.wall.startPinging();if(typeof a=="function"){a.apply()}$(".colorstrip").removeClass("loading");Photowall.Loader.refresh()});$("#detail").animate({left:0},function(){})};Photowall.wall.extractDetail=function(){console.log("Extracting wall detail!");var a=$("#detail-content").remove();$("#detail").html($(a).html())};Photowall.wall.activateVoice=function(a){if(Photowall.hasFlash){clearTimeout(Photowall.wall.clearInlinePlayerTimeout);$(".poweredby").hide();$("#inline-voice").show().load("/photos/voice/"+a);Photowall.wall.clearInlinePlayerTimeout=setTimeout(function(){$("#inline-voice").fadeOut()},8000)}else{$("#flash-warn").show("fast",function(){setTimeout(function(){$("#flash-warn").hide()},10000)})}};Photowall.wall.nextThumb=function(){var a=$(Photowall.currentPhotoId+"-w");$(".thumbawrap").filter(function(b){if($(this).attr("id")==(Photowall.currentPhotoId+"-w")){Photowall.currentPhotoIndex=b}});tb_remove();$(".thumbawrap").eq(Photowall.currentPhotoIndex+1).children(".thumba").click()};Photowall.wall.activateThumb=function(a){return Photowall.Photo.activateThumb(a)};Photowall.wall.showWall=function(a,c){if($("#primarycontent").length<1){$("#maincontent").html('<div class="colorstrip loading"><div id="primarycontent"></div></div><div id="detail"></div>');Photowall.wall.init()}console.log("Showing wall:",a);$(".selected","#hdtabs").removeClass("selected");if(typeof c!="undefined"){$(c).addClass("selected");$(c).blur()}if(Photowall.wall.id==a){return false}var b;if(typeof Photowall.wall.urls[a]!="undefined"){b=Photowall.wall.loadWall}else{b=Photowall.wall.loadAuthorWall}if($(".wall").length>0){Photowall.wall.slideOut(function(){console.log("Firing slideout callback!");b(a,function(){Photowall.wall.slideIn();Photowall.wall.currentFeaturedId=$(".ondeck-featured-id:first").val();return});return})}else{$("#primarycontent").css({left:$(".container:first").width()});b(a,function(){$(".colorstrip").removeClass("loading");Photowall.wall.slideIn()})}return false};Photowall.wall.thumbsToLoad=function(){console.log("> Calculating the number of thumbs to load.");var a=$(".colorstrip").width();var c=$(".col:first").width()||76;console.log("> page width is",a,"px");console.log("> col width is",c,"px");var b=Math.ceil(a/c);console.log("> cols to load",b);return b*4};Photowall.wall.loadWall=function(d,c){if(Photowall.wall.lockWall){console.log("Wall is locked! Not loading wall");return false}Photowall.Loader.unlock();var b=Photowall.wall.thumbsToLoad();var a=Photowall.wall.urls[d]+"?&limit="+b+"&_="+Math.random();console.log("Loading wall: ",d,"with URL: ",a);Photowall.wall.stopPinging();Photowall.wall.lockWall=true;$("#primarycontent").load(a,null,function(e){Photowall.wall.afterWallLoad(c);Photowall.wall.setId(d)})};Photowall.wall.setId=function(a){console.log("Setting wall ID to:",a);Photowall.wall.id=a};Photowall.wall.loadAuthorWall=function(b,c){if(Photowall.wall.lockWall){console.log("Wall is locked! Not loading wall");return false}Photowall.Loader.unlock();tb_remove();$(".selected","#hdtabs").removeClass("selected");var a="/users/landing/"+encodeURI(b);console.log("Loading Author Wall: ",b,"with URL:",a);Photowall.wall.stopPinging();Photowall.wall.lockWall=true;$("#primarycontent").load(a,null,function(d){Photowall.wall.afterWallLoad(c);Photowall.wall.setId(b)})};Photowall.wall.afterWallLoad=function(a){Photowall.wall.lockWall=false;Photowall.wall.extractDetail();$("abbr[class*=timeago]").timeago();applyTooltip("a.thumba");Photowall.wall.startPinging();$(".colorstrip").mousewheel(function(b,c){this.scrollLeft+=(-10*c);Photowall.Loader.refresh();if(this.scrollLeft>0){$(".navarrowleft").show()}return false});if(typeof a=="function"){a.apply()}};Photowall.wall.blurNavArrow=function(){$(this).removeClass("navarrowactive");if($(".colorstrip").scrollLeft()==0){$(".navarrowleft").hide()}};Photowall.wall.focusNavArrow=function(){clearTimeout(Photowall.wall.hideNavArrowsTimeout);$(this).addClass("navarrowactive")};Photowall.wall.showNavArrows=function(){clearTimeout(Photowall.wall.hideNavArrowsTimeout);$(".navarrows").show();if($(".colorstrip").scrollLeft()==0){$(".navarrowleft").hide()}};Photowall.wall.hideNavArrows=function(a){Photowall.wall.hideNavArrowsTimeout=setTimeout(function(){$(".navarrows").hide()},(a||1000))};Photowall.user={};Photowall.Setup={};Photowall.Setup.init=function(){$("#name_first").focus();if($("#wall_name").val().length>0){Photowall.Setup.filterWallName()}else{if($("#name_last").val().length>0){$("#name_last").trigger("change")}}try{if($("#city").val().length>0){$("#city").trigger("change")}}catch(a){}};Photowall.Setup.REQ=["name_first","name_last","wall_name"];Photowall.Setup.validate=function(d){var a=true,c,b=[];if(!$("#agree").is(":checked")){$("#error-agree").show();a=false}$.each(Photowall.Setup.REQ,function(e,f){c=$("#"+f).val();if(c===null||c.length<1){b.push(f);a=false}else{$("#error-"+f).hide()}});if(!$("#wall_name").data("valid")){a=false;b.push("wall_name")}if(a){if(d=="mobile"){$("#mobile").val("true")}$("#setupform").submit()}else{$.each(b,function(e,g){$("#error-"+g).show()})}};Photowall.Setup.phonenumber=function(){$("#setupform").submit()};Photowall.Setup.countryChange=function(){var d,c,b;d=$("#country").val();c=$("#country option:selected").html().split("(");if(c.length<2){return}$("#country_code").val(c[1].replace(")",""));var a="/locations/provinces/"+$("#country").val()+".json?_="+Math.random();$.getJSON(a,function(e){$("#state").html('<option value="">-- Select a State / Province --</option>');$.each(e.provinces,function(g,h){var f=document.createElement("option");$(f).html(h.Location.province);$("#state").append(f)});$("#state-row").show()})};Photowall.Setup.stateChange=function(){var b;b=$("#state").val();var a="/locations/cities/"+$("#country").val()+"/"+$("#state").val()+".json?_="+Math.random();$.getJSON(a,function(c){$("#city-row").show();$("#city").html('<option value="">-- Select a City --</option>');$.each(c,function(e,f){var d=document.createElement("option");$(d).html(f.Location.city);$("#city").append(d)})})};Photowall.Setup.cityChange=function(){var b;b=$("#city").val();var a="/locations/geo/"+$("#country").val()+"/"+$("#state").val()+"/"+$("#city").val()+".json?_="+Math.random();$.getJSON(a,function(c){$("#lat").val(c.Location.latitude);$("#long").val(c.Location.longitude)});$(this).data("changed",true)};Photowall.Setup.filterWallName=function(){clearTimeout(Photowall.Setup.checkTimeout);var b=$("#wall_name").val();var a=b.replace(/[^a-zA-Z0-9_]+/,"");$("#wall_name").val(a);$("#wall_name").focus();Photowall.Setup.checkTimeout=setTimeout(function(){Photowall.Setup.checkWallName()},500)};Photowall.Setup.checkWallName=function(){var a="/users/check_name/"+$("#wall_name").val()+".json?_="+Math.random();$.getJSON(a,function(b){if(b.ok!==true){$("#error-taken").show();$("#wall_name").data("valid",false)}else{$("#wall_name").data("valid",true);$("#error-taken").hide()}})};Photowall.Setup.suggestWallName=function(){if($("#wall_name").val()!==""){return}var c,a,b;c=$("#name_first").val();a=$("#name_last").val();b=c+"_"+a+"_"+Math.floor(Math.random()*1000);$("#wall_name").val(b.replace(/[^a-zA-Z0-9]+/,"_"));$("#wall_name").select();Photowall.Setup.filterWallName()};Photowall.User={};Photowall.User.filterWall=function(c){var b=$(".wall").attr("id");var a;if(b=="mywall"){a="/users/wall/"}else{a="/users/landing/"}$("#loc-filter").html("/ "+c+" / ");if(c.length>0){$("#loc-filter-clear").show()}else{$("#loc-filter-clear").hide();$("#loc-filter").html("")}$("#primarycontent").css({left:$(".container:first").width()}).load(a+b+"?loc="+escape(c),function(d){$("#detail-content").remove();applyTooltip("#primarycontent a.thumba");Photowall.wall.slideIn(function(){$(".colorstrip").removeClass("loading")})})};Photowall.User.addToNetwork=function(b,a){$.post("/friends.json?_="+Math.random(),{"data[UserNetwork][friend_live_id]":b},function(c){if(c.result=="success"){$(a).html("Added to network!")}},"json")};Photowall.search={mode:"simple",type:"tags",lastSearch:null,flickr_api_key:"17719a3df1aef2c71d838c17b61637fb",fromWallId:"#globalwall",setEvents:function(){$("#searchq").keypress(function(b){if(b.which==13){var a=$(this).val();Photowall.search.go(a)}});$("#searchq").focus(function(){$("#searchguide").fadeIn()})},query:function(a){if(a.length<1){return}Photowall.search.url="/photos/search/"+escape(a)+"/"+$("#authors").is(":checked")+"/"+$("#locations").is(":checked")+"/"+$("#titles").is(":checked")+"/"+$("#voicetag").is(":checked");$("#primarycontent").load(Photowall.search.url,function(){Photowall.wall.extractDetail();tb_init("#detail .thickbox")})}};Photowall.search.activateInterface=function(){return Photowall.search.activateHeader()};Photowall.search.activateHeader=function(){if(Photowall.wall.id!="#searchwall"){Photowall.search.fromWallId=Photowall.wall.id.replace("#","");console.log("Setting Search context to:",Photowall.search.fromWallId);Photowall.wall.setId("#searchwall")}Photowall.wall.id="#searchwall";if(!navigator.userAgent.match(/iPhone/i)&&!navigator.userAgent.match(/iPod/i)){}$(".searcha").html("Search Guide");$(".selected","#hdtabs").removeClass("selected");$(".searcha").addClass("selected").blur();$(".hdsearchbox").fadeIn();$("#searchq").focus();$(".searchblock").bind("mouseenter",function(){if(!$(".hdsearcbox").is(":visible")){$(".hdsearchbox").fadeIn()}});Photowall.search.activateTrending()};Photowall.search.activateTrending=function(){$("#searchguide").show();var a=5;$.getJSON("/search/trending.json?limit="+a,function(c){var d=c.trending;if(d.length>0){var e=[];$.each(d,function(f,g){e.push('<li><a href="#/search/'+Utf8.decode(g)+'" onclick="Photowall.search.go(\''+Utf8.decode(g)+"'); $(this).blur(); return false;\">"+Utf8.decode(g)+"</a></li>")});$("#trending-tags").html(e.join(""))}var b=c.potd;$("#potd").html('<a href="#" class="ondecka" onclick="pw('+b.ImageDetail.image_id+'); return false;"><img src="'+b.ImageDetail.image_url_wrap+'" class="potd" style="border:solid 1px #ccc;" /></a>');if(b.ImageDetail.title){$("#potd-details").html('<h4 style="color:#F4793A;">'+b.ImageDetail.title+"</h4>")}else{$("#potd-details").html("")}$("#potd-details").append('by <a href="/@'+b.UserDetail.wall_name+'">'+b.ImageDetail.author_name+"</a>")},"jsonp")};Photowall.search.deactivateTrending=function(){};Photowall.search.easeHeader=function(){$(".hdsearchbox").fadeOut("slow");$(".searcha").html('Results for "'+$("#searchq").val()+'"')};Photowall.search.deactivateInterface=function(){$(".searchbar").hide();$(".hdsearchbox").hide();$(".searchblock").unbind("mouseenter");$(".searcha").html("Search Guide");Photowall.search.deactivateTrending()};Photowall.search.activateType=function(b){clearTimeout(Photowall.search.hideTimeout);this.type=(b=="map"?"locations":b);$(".searchtype.selected").removeClass("selected");$(".searchtype-"+b).addClass("selected").blur();$("#searchq").focus();var a;switch(b){case"locations":Photowall.search.activateTrending();a='e.g. "Colorado" or "Bangalore, India"';break;default:Photowall.search.deactivateTrending();break}if($("#searchq").val().length<1){$("#searchq").val(a);$("#searchq").select()}if(b=="map"){this.activateMap($("#userlat").html(),$("#userlon").html())}else{this.deactivateMap()}};Photowall.search.activateMap=function(a,b){$("#searchbar-left").removeClass("span-24").addClass("span-12");$(".searchbox").addClass("withmap");$("#searchbar-right").show();$.scrollTo(".searchbar",500);this.mode="map";var c=this;c.init_lat=Number(a);c.init_lon=Number(b);if(typeof VEMap!="function"){$.getScript("http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2&mkt=en-us",function(){c.activateMap(c.init_lat,c.init_lon)});return}setTimeout(function(){$("#searchmap").removeClass("loading");c.map=new VEMap("searchmap");var d=new VELatLong(c.init_lat,c.init_lon);var e=false;c.map.LoadMap(d,11,VEMapStyle.Road,e,VEMapMode.Mode2D,false,1);c.map.AttachEvent("onmousedown",c.mapMouseDown);c.map.AttachEvent("onmouseup",c.mapMouseUp);c.map.AttachEvent("onmousemove",c.mapMouseMove)},200)};Photowall.search.mapMouseDown=function(a){Photowall.search.mouseHasMoved=false};Photowall.search.mapMouseUp=function(d){if(!Photowall.search.mouseHasMoved){var b=new VEPixel(d.mapX,d.mapY);var c=Photowall.search.map.PixelToLatLong(b);console.log(d.mapX,d.mapY,c);var a="http://api.flickr.com/services/rest/?method=flickr.places.findByLatLon&format=json&jsoncallback=?&api_key="+Photowall.search.flickr_api_key+"&lat="+c.Latitude+"&lon="+c.Longitude;$.getJSON(a,function(f){console.log(f);var e=f.places.place[0].place_url;var i=e.split("/");var h="";console.log(i);if(i.length<3){i=f.places.place[0].name.split(", ");h=i[i.length-2]+" "+i[i.length-1]}else{var k=i[1];var g=i[2];var j=i[3];h=j+" "+g+", "+k}Photowall.search.go(h.replace("+"," "))})}};Photowall.search.mapMouseMove=function(a){Photowall.search.mouseHasMoved=true};Photowall.search.deactivateMap=function(){$("#searchbar-left").removeClass("span-12").addClass("span-24");$("#searchbar-right").hide();$("#searchmap").addClass("loading");$(".searchbox").removeClass("withmap");this.mode="simple";if(typeof this.map!="undefined"){this.map.Dispose()}};Photowall.search.go=function(b){b=$.trim(unescape(b));clearTimeout(Photowall.search.hideTimeout);$("#searchq").val(unescape(b)).blur();console.log("> from wall id: "+Photowall.search.fromWallId);if(Photowall.search.fromWallId!="globalwall"&&Photowall.search.fromWallId!="searchwall"){window.location="/"+encodeURI(b);return}Photowall.Loader.unlock();var a="/search/"+this.type+"?q="+encodeURI(b).replace("+","%2B")+"&context="+Photowall.search.fromWallId+"&_="+Math.random();console.log("Loading search wall: ",b,"with URL:",a);Photowall.search.lastSearch=unescape(b);if(Photowall.search.fromWallId=="mynetwork"){$("#activity").load(a,function(c){Photowall.network.searchResults(c)})}else{$(".colorstrip").addClass("loading");Photowall.wall.stopPinging();Photowall.wall.lockWall=true;$(".colorstrip").scrollLeft(0);$("#primarycontent").css({position:"relative",left:$(".colorstrip").width()}).load(a,function(c){Photowall.wall.afterWallLoad(function(){Photowall.wall.slideIn(function(){});if($(".hdsearchbox").is(":visible")){Photowall.search.hideTimeout=setTimeout(function(){Photowall.search.easeHeader()},20000)}})});console.log(">> attempting to hide search guide",$("#searchguide").hide())}};Photowall.search.landing=function(a){Photowall.wall.setId("#globalwall");Photowall.search.activateHeader();Photowall.search.go(a)};Photowall.search.moreFromLocation=function(a){if($(".wall").length>0){window.location="#/search";Photowall.search.go(a);tb_remove()}else{window.location="/"+a}};Photowall.network={activeURL:"/#network",init:function(){Photowall.network.activeURL="/network";applyTooltip("#activity .thumba");$("abbr[class*=timeago]").timeago()},refresh:function(){$(".event_count").fadeOut();Photowall.wall.setId("#mynetwork");Photowall.search.deactivateInterface();$("#hdtabs a").removeClass("selected");$("a.mynetworka").addClass("selected").blur()},searchResults:function(a){Photowall.wall.setId("#mynetwork");$("abbr[class*=timeago]").timeago()},filterFriendList:function(a){if(a===""){$(".friendlist-item").show();return}var b=(a+"").toLowerCase();$(".friendlist-item").hide();$('.friendlist-item[rel*="'+b+'"]').show()},setSearchEvents:function(){return;$("#friendq").change(function(){$(".network-search-button").click()})},addToNetwork:function(a,b){$.post("/friends.json?_="+Math.random(),{"data[UserNetwork][friend_live_id]":a},function(c){b(c)},"json")},removeFromNetwork:function(a){if(confirm("Are you sure you want to remove this user from your network?")){$.post("/friends/remove.json?_="+Math.random(),{"data[wall_name]":a},function(b){$("#friend-"+a).parent().fadeOut();window.location="#/activity"},"json")}},addSuggestion:function(b,a){this.addToNetwork(b,function(c){console.log(c);if(c.result=="success"){$(a).parent().html("Added!");$(".friends-list").load("/friends/friendlist?_="+Math.random())}})},replyTo:function(d,b){var c=$("#event-reply-content-"+d).val();var a=$("#event-reply-imageid-"+d).val();if($.trim(c)===""){return}$.post("/comments",{"data[Comment][image_id]":a,"data[Comment][content]":c,"data[Comment][comment_id]":b},function(e){if(e=="blacklist"){Photowall.warnInappropriate();return}$("#event-reply-"+d).hide();$("#event-reply-msg-"+d).show().append('<p style="margin-bottom:2px;">Your Reply: <span style="color:#fff; font-weight:bold;">"'+c+'"</span></p>')})}};Photowall.network.eventDiscuss=function(d,c){var b=$("#event-reply-content-"+c).val();var a=$("#event-reply-imageid-"+c).val();if($.trim(b)===""){return}$.post("/event_discussions.json",{"data[EventDiscussion][event_id]":d,"data[EventDiscussion][content]":b},function(e){$("#event-reply-"+c).hide();$("#event-reply-msg-"+c).show().append('<p style="margin-bottom:2px;">Your Reply: <span style="color:#fff; font-weight:bold;">"'+b+'"</span></p>')},"json")};Photowall.network.activity=function(){Photowall.network.activeURL="/network";$("#activity").load(Photowall.network.activeURL+"?_="+Math.random(),function(){$("abbr[class*=timeago]").timeago();applyTooltip("#activity a.thumba");window.location="#/activity"});Photowall.network.activateTab(".activitya");$("li .friend-activitya").show();return false};Photowall.network.mutual=function(){Photowall.network.activeURL="/network";$("#activity").load(Photowall.network.activeURL+"?mutual=true&_="+Math.random(),function(){$("abbr[class*=timeago]").timeago();applyTooltip("#activity a.thumba")});Photowall.network.activateTab(".mutuala");$("li .friend-activitya").hide();$("li .mutualfriend").show();return false};Photowall.network.favorites=function(){$("#activity").load("/favorites?_="+Math.random(),function(){$("abbr[class*=timeago]").timeago();applyTooltip("#activity a.thumba");window.location="#/favorites"});Photowall.network.activateTab(".favoritesa");return false};Photowall.network.history=function(){$("#activity").load("/histories?_="+Math.random(),function(){tb_init("#activity .thickbox");$("abbr[class*=timeago]").timeago();applyTooltip("#activity a.thumba");window.location="#/history"});Photowall.network.activateTab(".historya");return false};Photowall.network.followers=function(){Photowall.network.activeURL="/friends/followers";$("#activity").load(Photowall.network.activeURL+"?_="+Math.random(),function(){});Photowall.network.activateTab(".followersa");return false};Photowall.network.friend=function(a){Photowall.network.activeURL="/friends/events/"+a;$("#activity").load(Photowall.network.activeURL+"?_="+Math.random(),function(){tb_init("#activity a.thickbox");$("abbr[class*=timeago]").timeago();applyTooltip("#activity a.thumba")});Photowall.network.activateTab("#friend-"+a);return false};Photowall.network.findfriends=function(){$("#activity").load("/network/search?_="+Math.random(),function(){Photowall.network.setSearchEvents();applyTooltip(".thumba")});$("a.selected",".networknav").removeClass("selected");$(".activitya").addClass("selected");Photowall.network.activateTab(".networksearcha");return false};Photowall.network.activateTab=function(a){$("a.selected",".networknav").removeClass("selected");$(".friend-activitya",".friends-list").removeClass("selected");$(a).addClass("selected");$(a).blur();Photowall.search.deactivateInterface()};Photowall.network.page=function(a){$("#activity").load(Photowall.network.activeURL+"?page="+a+"&_="+Math.random(),function(){$("abbr[class*=timeago]").timeago();applyTooltip("#activity a.thumba")});return false};Photowall.network.searchNetwork=function(){console.log("network search");$.get("/network/search?_="+Math.random(),{q:$("#friendq").val()},function(a){$("#friendq-results").html(a);applyTooltip(".thumba")})};Photowall.menu={setEvents:function(){$(".menu a").click(function(){$(".menu").hide()})}};Photowall.menu.shouldClose=false;Photowall.menu.activate=function(){var b=$(".usercontrols").position().top;var a=$(".usercontrols").position().left-($(".menu").width()-$(".usercontrols").width())-10;$(".menu").css({top:b,left:a});$(".menu").show();$(".usercontrols").blur();$(document).bind("click",Photowall.menu.autoClose);Photowall.Navigator.track("#/menu");return false};$(function(){$(".menu").hover(function(){Photowall.menu.setShouldClose(false)},function(){Photowall.menu.setShouldClose(true)})});Photowall.menu.setShouldClose=function(a){Photowall.menu.shouldClose=a};Photowall.menu.autoClose=function(){if(Photowall.menu.shouldClose){Photowall.menu.close()}};Photowall.menu.close=function(){$(document).unbind("click",Photowall.menu.autoClose);$(".menu").hide();setTimeout(function(){Photowall.menu.setShouldClose(false)},500)};Photowall.menu.setup=function(){tb_show("","/users/view")};Photowall.AuthorBrowser=function(b,a){this.init_type=(a?a:"photo");this.init_id=b};function ab(a){Photowall.AB=new Photowall.AuthorBrowser(a,"author");Photowall.AB.init()}var AB=Photowall.AuthorBrowser;AB.TB_overlay=function(a){$("#TB_overlay").remove();$("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");$("#TB_overlay").click(a.close);if(tb_detectMacXFF()){$("#TB_overlay").addClass("TB_overlayMacFFBGHack")}else{$("#TB_overlay").addClass("TB_overlayBG")}};AB.prototype={init_type:"author",init_id:null,current_tab:"comments",photo_id:0};AB.prototype.init=function(){tb_remove();AB.TB_overlay(this);$(".ab-content").addClass("ab-content-loading").html("");this.loadBrowser();$("#author-browser").css({left:($("body").width()/2)-($("#author-browser").width()/2),top:$(window).scrollTop()+110}).show();$(window).scroll(function(){$("#author-browser").css({top:$(window).scrollTop()+110})})};AB.prototype.deepLinkInit=function(){AB.TB_overlay(this);$("#author-browser").css({left:($("body").width()/2)-($("#author-browser").width()/2)}).show();tb_init(".ab-imga")};AB.prototype.close=function(){try{this.map.Dispose()}catch(a){}$("#author-browser").hide();tb_remove()};AB.prototype.loadBrowser=function(){var b=this;var a="/users/browser/"+this.init_id+"/"+this.init_type+"?_="+Math.random();$("#author-browser").load(a,function(c){tb_init("#author-browser .ab-imga");tb_init("#author-browser .thickbox")})};AB.prototype.activateTab=function(b,d){$(".ab-nav-tabs a").removeClass("selected");$(".ab-nav-"+b).addClass("selected").blur();$.cookie("Photowall.browser.tab",b,{expires:365,path:"/"});this.current_tab=b;var a="/photos/browser_content/"+b+"/"+this.photo_id+"?_="+Math.random();var c=this;$(".ab-col2").addClass("ab-content-loading").html("");$(".ab-content").load(a,function(e){tb_init(".ab-imga");tb_init(".thickbox");$(".ab-col2").removeClass("ab-content-loading");if(typeof d=="function"){d()}})};AB.prototype.activateVoice=function(a){if(Photowall.AB.photo_id!=a){Photowall.AB.loadContentFor(a,function(){Photowall.AB.activateVoice(a)});return}if(Photowall.AB.current_tab!="comments"){Photowall.AB.activateTab("comments",function(){Photowall.AB.activateVoice(a)})}else{$("#ab-voice").load("/photos/browser_voice/"+Photowall.AB.photo_id+"?_="+Math.random())}};AB.prototype.page=function(b){var a="/users/browser_page/"+this.photo_id+"/"+b+"?_="+Math.random();$(".browser-pager-wrap").load(a)};AB.prototype.loadContentFor=function(a,b){this.photo_id=a;this.activateTab(this.current_tab,b);$(".browser-thumb-selected").removeClass("browser-thumb-selected");$("#browser-thumb-"+a).addClass("browser-thumb-selected");return false};AB.prototype.addComment=function(){var a=$("#ab-comment-input").val();if($.trim(a)===""){return}$.post("/comments",{"data[Comment][image_id]":this.photo_id,"data[Comment][content]":a},function(b){if(b=="blacklist"){Photowall.warnInappropriate();return}$(".ab-comment-list").html(b);$("#ab-comment-input").val("");$(".ab-add-comment").hide();$("abbr",".ab-comment-list").timeago()})};AB.prototype.deletePhoto=function(){var a=this;if(confirm("Are you sure you want to permanently delete this photo?  This cannot be undone!")){$.post("/photos/delete.json?_="+Math.random(),{"data[ImageDetail][image_id]":a.photo_id},function(b){if(b.result=="success"){var c=null;if(b.neighbors.next!==null){c=b.neighbors.next.ImageDetail.image_id}else{if(b.neighbors.prev!==null){c=b.neighbors.prev.ImageDetail.image_id}}$("#browser-thumb-"+a.photo_id).remove();$("#"+a.photo_id+"-a").remove();if(c!==null){$("#browser-thumb-"+c).click()}else{a.close()}}},"json")}};AB.prototype.loadMap=function(a,b){var c=this;c.init_lat=Number(a);c.init_lon=Number(b);if(typeof VEMap!="function"){$.getScript("http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2&mkt=en-us",function(){c.loadMap(c.init_lat,c.init_lon)});return}setTimeout(function(){$("#ab-map").css({background:"none"}).html("");c.map=new VEMap("ab-map");var e=new VELatLong(c.init_lat,c.init_lon);var f=false;c.map.LoadMap(e,11,VEMapStyle.Road,f,VEMapMode.Mode2D,false,1);var d=new VEShape(VEShapeType.Pushpin,e);c.map.AddShape(d)},200)};AB.prototype.addFavorite=function(){var a=this;$.post("/favorites.json?_="+Math.random(),{"data[Favorite][image_id]":this.photo_id},function(b){console.log(b);if(b.result=="success"){a.flashMsg("This photo has been added to your favorites!")}},"json")};AB.prototype.sendToFlickr=function(){var a=this;$.getJSON("/destinations/flickr/"+a.photo_id+".json?_="+Math.random(),function(b){if(b.result=="success"){a.flashMsg("This photo has been sent to Flickr! Please allow a few moments to process.")}else{if(b.result=="setup"){window.location=b.url}}})};AB.prototype.sendToFacebook=function(){var a=this;$.getJSON("/destinations/facebook/"+a.photo_id+".json?_="+Math.random(),function(b){if(b.result=="success"){a.flashMsg("This photo has been sent to Facebook! Please allow a few moments to process.")}else{if(b.result=="setup"){window.location=b.url}}})};AB.prototype.sendToTwitter=function(){var a=this;$.getJSON("/destinations/twitter/"+a.photo_id+".json?_="+Math.random(),function(b){if(b.result=="success"){a.flashMsg("This photo has been sent to Twitter!")}else{if(b.result=="setup"){$(".ab-content").append('<a href="/destinations/twitter_setup/'+b.image_id+'" id="twitter_setup"></a>');tb_init("#twitter_setup");$("#twitter_setup").click()}else{if(b.result=="prompt"){$(".ab-content").append('<a href="/destinations/twitter_prompt/'+b.image_id+'" id="twitter_prompt"></a>');tb_init("#twitter_prompt");$("#twitter_prompt").click()}}}})};AB.prototype.flashMsg=function(b){var a=this;$(".flashmsg").html(b);$(".flashmsg").show("slow",function(){setTimeout(function(){$(".flashmsg").fadeOut("slow")},3000)})};AB.prototype.addToNetwork=function(a){var b=this;$.post("/friends.json?_="+Math.random(),{"data[UserNetwork][friend_live_id]":a},function(c){console.log(c);if(c.result=="success"){$(".ab-addfriend").html("Added to network!")}},"json")};AB.prototype.save=function(){var b={};$("*[name*=data]").each(function(d,c){b[$(c).attr("name")]=$(c).val()});var a="/photos/"+Photowall.AB.photo_id+".json?_="+Math.random();$.post(a,b,function(c){if(c.result=="success"){$("#ab-save-result").show().html("Photo successfully saved!").fadeOut(5000);if(c.message_id){$("#ab-save-result").show().html("Please allow a few moments to process your rotated photo.").fadeOut(5000)}$("#ab-manage-location").html($("#city-select").val()+" "+$("#province-select").val()+", "+$("#country-select").val());$(".ab-manage-location").hide()}else{switch(c.reason){case"blacklist":$("#ab-save-result").show().html('<span style="color:red;">The information could not be saved because the image title contains an innappropriate word.</span>').fadeOut(5000);break;default:break}}},"json")};AB.prototype.setPrivacy=function(b,a){$("#ab-manage-privacy").val(b);$("#ab-manage-privacy-text").html(a)};AB.prototype.rotate=function(a){var b=$("#"+Photowall.AB.photo_id+"-ab").rotate(a);$("#ab-manage-rotation").val(b)};AB.prototype.setManageEvents=function(){$("#country-select").change(function(){var a="locations/provinces/"+$("#country-select").val()+".json?_="+Math.random();$.getJSON(a,function(b){$("#province-select").html("<option>-- Select a State / Province --</option>");$.each(b.provinces,function(d,e){var c=document.createElement("option");$(c).html(e.Location.province);$("#province-select").append(c)})});$(this).data("changed",true)});$("#province-select").change(function(){var a="locations/cities/"+$("#country-select").val()+"/"+$("#province-select").val()+".json?_="+Math.random();$.getJSON(a,function(b){$("#city-select").html("<option>-- Select a City --</option>");$.each(b,function(d,e){var c=document.createElement("option");$(c).html(e.Location.city);$("#city-select").append(c)})});$(this).data("changed",true)});$("#city-select").change(function(){var a="locations/geo/"+$("#country-select").val()+"/"+$("#province-select").val()+"/"+$("#city-select").val()+".json?_="+Math.random();$.getJSON(a,function(b){$("#lat").val(b.Location.latitude);$("#lon").val(b.Location.longitude)});$(this).data("changed",true)})};Photowall.destinations=Photowall.Destinations={};Photowall.Destinations.toggleAutoSend=function(b){var a=$("#autosend-"+b).is(":checked")?1:0;console.log("autosend-"+b,a);if(a==1){if(confirm("Enabling this checkbox will automatically send any public photos you upload to this destination.  We send Public photos to Facebook, Flickr and Twitter; Network photos to Facebook and Flickr (to your friends); Private photos are never forwarded. Are you sure you want to continue?")){Photowall.Destinations.postAutoSend(b,a)}else{$("#autosend-"+b).attr("checked",false)}}else{Photowall.Destinations.postAutoSend(b,a)}$(".auto-"+b).toggle()};Photowall.Destinations.postAutoSend=function(b,a){$.post("/destinations/autosend.json",{"data[Destination][dest_type]":b,"data[Destination][auto_send]":a},function(c){},"json")};Photowall.destinations.reset=function(a){$.post("/destinations/reset.json",{"data[type]":a},function(b){if(b.result){tb_show(null,"/destinations")}if(a=="FB"){FB.Connect.logoutAndRedirect("/");return false}},"json");$(".auto-"+a).hide()};Photowall.destinations.setup=function(a){if(a!="TW"){$.getJSON("/destinations/setup/"+a+".json?_="+Math.random(),function(b){if(b.result=="setup"){window.location=b.url}})}else{tb_show(null,"/destinations/twitter_setup")}};Photowall.facebook={};Photowall.facebook.onConnect=function(){FB.Connect.ifUserConnected(function(a){$.post("/users/create.json",{"data[UserDetail][source]":"FB"},function(b){if(b.result){window.location="/"}},"json")},function(){})};Photowall.Comments={};Photowall.Comments.thread=function(b,c){var a=$(".event-all-comments","#event-"+b);if(a.html()===""){a.load("/comments/thread/"+c+"/"+b+"?_="+Math.random(),function(){$(".timeago").timeago()})}else{a.html("")}};Photowall.Comments.open=function(a){$.cookie("Photowall.browser.tab","comments",365,"/");pw(a)};Photowall.Comments.replyTo=function(d,b){var c=$("#event-reply-content-"+d).val();var a=$("#event-reply-imageid-"+d).val();if($.trim(c)===""){return}$.post("/comments/replyto.json",{"data[Comment][image_id]":a,"data[Comment][content]":c,"data[Comment][comment_id]":b},function(e){if(e=="blacklist"){Photowall.warnInappropriate();return}$("#event-reply-"+d).hide();$("#event-reply-msg-"+d).show().append('<p style="margin-bottom:2px;">Your Reply: <span style="color:#fff; font-weight:bold;">"'+e.comment+'"</span></p>')},"json")};Photowall.Discussions={};Photowall.Discussions.thread=function(c,b){var a=$(".event-all-comments","#event-"+b);if(a.html()===""){a.load("/event_discussions/thread/"+c+"?_="+Math.random(),function(){$(".timeago").timeago()})}else{a.html("")}};Photowall.Navigator={};Photowall.Navigator.app={};Photowall.Navigator.init=function(){this.app=$.sammy(function(){with(this){get("#/events/:term",function(){tb_remove();Photowall.search.landing(this.params.term);Photowall.Navigator.track("#/search/"+this.params.term)});get("#/globalwall",function(){console.log("Firing Route:","#globalwall");Photowall.wall.showWall("#globalwall",$("a.globalwalla"));Photowall.search.deactivateInterface();Photowall.Navigator.track("#/globalwall")});get("#/mywall",function(){console.log("Firing Route:","#mywall");if($(".wall").attr("id")!="mywall"){Photowall.wall.showWall("#mywall");$(".walltab, .searcha").removeClass("selected");$(".mywalla").addClass("selected")}Photowall.search.deactivateInterface();Photowall.Navigator.track("#/mywall")});get("#/authorwall/:name",function(){console.log("Firing Route:","#/authorwall/",this.params.name);if(window.location.pathname!="/"){console.log("We are not on the homepage!");window.location="/#/authorwall/"+this.params.name;return}Photowall.wall.showWall(this.params.name);Photowall.search.deactivateInterface();Photowall.Navigator.track("#/authorwall/"+this.params.name)});get("#/search",function(){console.log("Firing Route:","#/search");if($("#activity").length<1&&$(".wall").length<1){window.location="#/globalwall";return}Photowall.search.activateInterface();Photowall.Navigator.track("#/search");$("#pw-banner").fadeOut()});get("#/cancelsearch",function(){console.log("Cancelling search box");if($(".wall").length<1){window.location="#/globalwall"}});get("#/search/:term",function(){tb_remove();Photowall.search.landing(this.params.term);Photowall.Navigator.track("#/search/"+this.params.term)});get("#/network",function(){Photowall.wall.hideNavArrows();Photowall.network.refresh();if($("#activity").length<1){Photowall.wall.slideOut(function(){});$("#maincontent").load("/network/index/true",function(){Photowall.network.init()})}Photowall.Navigator.track("#/network")});get("#/photos/:id",function(){pw(this.params.id);if($(".wall").length<1&&$("#activity").length<1){setTimeout(function(){Photowall.Navigator.app.runRoute("get","#/globalwall")},1000)}Photowall.Navigator.track("#/photos/"+this.params.id)});get("#/activity",function(){if($("#activity").length<1){window.location="#/network";return}Photowall.network.activity();Photowall.Navigator.track("#/network")});get("#/mutualfriends",function(){if($("#activity").length<1){window.location="#/network";return}Photowall.network.mutual();Photowall.Navigator.track("#/mutualfriends")});get("#/favorites",function(){if($("#activity").length<1){window.location="#/network";return}Photowall.network.favorites();Photowall.Navigator.track("#/favorites")});get("#/history",function(){if($("#activity").length<1){window.location="#/network";return}Photowall.network.history();Photowall.Navigator.track("#/history")});get("#/followers",function(){if($("#activity").length<1){window.location="#/network";return}Photowall.network.followers();Photowall.Navigator.track("#/followers")});get("#/findfriends",function(){if($("#activity").length<1){window.location="#/network";return}Photowall.network.findfriends();Photowall.Navigator.track("#/findfriends")});get("#/friendactivity/:name",function(){if($("#activity").length<1){window.location="#/network";return}Photowall.network.friend(this.params.name);Photowall.Navigator.track("#/friendactivity/"+this.params.name)});get("",function(){if(window.location.pathname=="/"){console.log("Firing Route:","");window.location="#/globalwall"}})}});this.app.run();Photowall.Navigator.keepAliveInterval=setInterval(function(){console.log("Keep alive:"+Photowall.Navigator.last_location);Photowall.Navigator.track(Photowall.Navigator.last_location)},30000)};Photowall.Navigator.track=function(a){if(typeof pageTracker!="undefined"){pageTracker._trackPageview(a)}};Photowall.Loader={};Photowall.Loader.locked=false;Photowall.Loader.newCols=[];Photowall.Loader.refresh=function(){if($(".wall").length<1){return}if(Photowall.Loader.locked){return}var a=Photowall.Loader.coverage();if(a<0){Photowall.Loader.fillGap(a)}};Photowall.Loader.coverage=function(){var b=$(".colorstrip").width();var d=76*$(".col").length;var a=302*$(".wallad").length;var e=$(".colorstrip").scrollLeft();var c=d+a-e-b;return c};Photowall.Loader.fillGap=function(f){var b=Photowall.Loader.context();if(typeof b=="undefined"){return}console.log("> wall context:",b);var c=Math.ceil(-f/76)*4;c+=16;var e=$(".col:last").find(".thumbawrap").length;c+=4-e;var d=$(".wall").find(".thumb:last").attr("id");console.log("> loading",c,"new photos after",d);var a;switch(b.type){case"global":a="/photos/backfill?limit="+c+"&before="+d+"&_="+Math.random();break;case"mywall":a="/users/my_backfill?limit="+c+"&before="+d+"&_="+Math.random();break;case"search":a="/search/tag_backfill?q="+b.q+"&limit="+c+"&before="+d+"&_="+Math.random();break;case"author":a=["/users/author_backfill/",b.wallName,"?q=",b.q,"&limit=",c,"&before=",d,"&_=",Math.random()].join("");break;default:break}if(typeof a=="undefined"){return}Photowall.Loader.fetchOlder(a,d,function(h){var g=$(h).find(".col");if(g.length>0){$.each(g,function(k,j){Photowall.Loader.newCols.push(j)});Photowall.Loader.processNewCols()}})};Photowall.Loader.fetchOlder=function(c,b,a){Photowall.Loader.lock();$.get(c,a)};Photowall.Loader.processNewCols=function(){if(Photowall.Loader.newCols.length<1){Photowall.Loader.finishProcessingNewCols();return}var a=Photowall.Loader.newCols.shift();$(a).css({display:"none"});$(".wall").append(a);$(a).fadeIn("fast",function(){$(a).find("abbr[class*=timeago]").timeago();applyTooltip($(a).find("a.thumba"));Photowall.Loader.processNewCols()})};Photowall.Loader.finishProcessingNewCols=function(){Photowall.Loader.unlock();Photowall.Loader.refresh()};Photowall.Loader.context=function(){var b=$(".wall").attr("id");var a;switch(b){case"globalwall":a={type:"global"};break;case"mywall":a={type:"mywall"};break;case"searchwall":a={type:"search",q:Photowall.search.lastSearch};break;default:a={type:"author",wallName:$(".wall").attr("id")};break}return a};Photowall.Loader.lock=function(){console.log("> locking the loader");return Photowall.Loader.locked=true};Photowall.Loader.unlock=function(){console.log("> unlocking the loader");return Photowall.Loader.locked=false};Photowall.Comet={};Photowall.Comet.active=false;Photowall.Comet.useComet=true;Photowall.Comet.subDelay=500;Photowall.Comet.errCount=0;Photowall.Comet.subscribe=function(){var a=Photowall.Loader.context();if(a.type!="global"){console.log(">> context is not global! aborting subscription");return}if(Photowall.Comet.active){return}Photowall.Comet.active=true;Photowall.Comet.xhr=$.ajax({url:"/subscribe?_="+Math.random(),success:function(b){console.log(">> success!",b);Photowall.Comet.updateWall(b.photos[0].image_id);setTimeout(Photowall.Comet.subscribe,Photowall.Comet.subDelay);Photowall.Comet.active=false;Photowall.Comet.errCount=0},error:function(d,c,b){console.log(">> fail!",c);if(c=="parsererror"){Photowall.Comet.errCount+=1;if(Photowall.Comet.errCount>=5){console.log(">> comet failed:",Photowall.Comet.errCount,"times");Photowall.Comet.useComet=false;return}}setTimeout(Photowall.Comet.subscribe,Photowall.Comet.subDelay);Photowall.Comet.active=false},dataType:"json"});Photowall.Navigator.track("/subscribe")};Photowall.Comet.updateWall=function(b){var a=Photowall.Loader.context();if(a.type!="global"){console.log(">> context is not global! aborting comet update.");return}$.get("/photos/global_featured/"+b,function(c){thumb=$(".thumbawrap",c);ondeck=$(".ondeck",c);var e=$(".thumb",thumb).attr("id");if(typeof(e)=="undefined"){return}var d=$(thumb).attr("id").split("-").shift();if($("#"+d+"-w").length>0){console.log("this image already exists on the wall!");return}else{Photowall.wall.updateWall(thumb);Photowall.wall.updateOndeck(ondeck.html())}})};