var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);
/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/
return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return}f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S)}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null)}R(E)}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E()}}function E(){if(e){return}if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return}}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r<q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false)}else{if(typeof j.attachEvent!=b){I(j,"onload",r)}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r)}W(u,true)}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310"}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137"}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u)};I(j,"onload",v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t)};I(j,"onload",q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB]}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"'}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"'}}}}}var AD="";for(var AA in AE){if(AE[AA]!=Object.prototype[AA]){AD+='<param name="'+AA+'" value="'+AE[AA]+'" />'}}v.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object>";i[i.length]=AG.id;q=C(AG.id)}else{if(h.webkit&&h.webkit<312){var AC=a("embed");AC.setAttribute("type",P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()=="data"){AC.setAttribute("src",AG[z])}else{if(z.toLowerCase()=="styleclass"){AC.setAttribute("class",AG[z])}else{if(z.toLowerCase()!="classid"){AC.setAttribute(z,AG[z])}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!="movie"){AC.setAttribute(y,AE[y])}}}v.parentNode.replaceChild(AC,v);q=AC}else{var u=a(Q);u.setAttribute("type",P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()=="styleclass"){u.setAttribute("class",AG[x])}else{if(x.toLowerCase()!="classid"){u.setAttribute(x,AG[x])}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&&w.toLowerCase()!="movie"){F(u,w,AE[w])}}v.parentNode.replaceChild(u,v);q=u}}}return q}function F(t,q,r){var u=a("param");u.setAttribute("name",q);u.setAttribute("value",r);t.appendChild(u)}function X(r){var q=C(r);if(q&&(q.nodeName=="OBJECT"||q.nodeName=="EMBED")){if(h.ie&&h.win){if(q.readyState==4){B(r)}else{j.attachEvent("onload",function(){B(r)})}}else{q.parentNode.removeChild(q)}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]=="function"){r[q]=null}}r.parentNode.removeChild(r)}}function C(t){var q=null;try{q=K.getElementById(t)}catch(r){}return q}function a(q){return K.createElement(q)}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r]}function c(t){var r=h.pv,q=t.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]>q[0]||(r[0]==q[0]&&r[1]>q[1])||(r[0]==q[0]&&r[1]==q[1]&&r[2]>=q[2]))?true:false}function V(v,r){if(h.ie&&h.mac){return}var u=K.getElementsByTagName("head")[0],t=a("style");t.setAttribute("type","text/css");t.setAttribute("media","screen");if(!(h.ie&&h.win)&&typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+" {"+r+"}"))}u.appendChild(t);if(h.ie&&h.win&&typeof K.styleSheets!=b&&K.styleSheets.length>0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r)}}}function W(t,q){var r=q?"visible":"hidden";if(e&&C(t)){C(t).style.visibility=r}else{V("#"+t,"visibility:"+r)}}function g(s){var r=/[\\\"<>\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s}var D=function(){if(h.ie&&h.win){window.attachEvent("onunload",function(){var w=d.length;for(var v=0;v<w;v++){d[v][0].detachEvent(d[v][1],d[v][2])}var t=i.length;for(var u=0;u<t;u++){X(i[u])}for(var r in h){h[r]=null}h=null;for(var q in swfobject){swfobject[q]=null}swfobject=null})}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return}var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;N[N.length]=r;W(u,false)},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&&typeof t.SetVariable!=b)){q=t}else{if(typeof u.SetVariable!=b){q=u}}}}return q},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return}AB+="";AD+="";if(c(q)){W(AE,false);var AA={};if(AC&&typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v]}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&&typeof z===Q){for(var u in z){if(z[u]!=Object.prototype[u]){y[u]=z[u]}}}if(r&&typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+="&"+t+"="+r[t]}else{y.flashvars=t+"="+r[t]}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true)}})}else{if(w&&!A&&c("6.0.65")&&(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF)})}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]}},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q)}else{return undefined}},removeSWF:function(q){if(h.w3cdom){X(q)}},createCSS:function(r,q){if(h.w3cdom){V(r,q)}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u)}if(u){var t=u.substring(1).split("&");for(var r=0;r<t.length;r++){if(t[r].substring(0,t[r].indexOf("="))==v){return g(t[r].substring((t[r].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(A&&M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);if(l){W(l,true);if(h.ie&&h.win){M.style.display="block"}}M=null;l=null;A=false}}}}}();Date.months=["January","February","March","April","May","June","July","August","September","October","November","December"];Date.days=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];Date.prototype.isValidDate=function(){var a=true;if(a&&!this instanceof Date){a=false}if(a&&"invalid date"===this.toString().toLowerCase()){a=false}return a};Date.prototype.format=function(){var o=this.getDay();var c=this.getDate();var g=this.getMonth()+1;var l=this.getFullYear();var f=this.getHours();var d=this.getMinutes();if(d<10){d="0"+d}var t=this.getSeconds();if(t<10){t="0"+t}var j="";for(var e=0;e<arguments.length&&this.isValidDate();e++){switch(arguments[e]){default:j+=arguments[e];break;case"day":j+=""+c;break;case"month":j+=""+g;break;case"year":j+=""+l;break;case"shortday":j+=Date.days[o].substring(0,3);break;case"date":j+=c+"/"+g+"/"+l;break;case"udate":j+=g+"/"+c+"/"+l;break;case"shortdate":j+=c+"/"+g+"/"+String(l).substr(2);break;case"ushortdate":j+=g+"/"+c+"/"+String(l).substr(2);break;case"humandate":j+=c+" "+Date.months[g-1]+" "+l;break;case"uhumandate":j+=Date.months[g-1]+" "+c+", "+l;break;case"shorthumandate":j+=c+" "+Date.months[g-1].substring(0,3)+" "+l;break;case"ushorthumandate":j+=Date.months[g-1].substring(0,3)+" "+c+", "+l;break;case"shorterhumandate":j+=c+" "+Date.months[g-1].substring(0,3)+" '"+String(l).substr(2);break;case"ushorterhumandate":j+=Date.months[g-1].substring(0,3)+" "+c+", '"+String(l).substr(2);break;case"longhumandate":j+=Date.days[o]+" "+c+" "+Date.months[g-1]+", "+l;break;case"ulonghumandate":j+=Date.days[o]+" "+Date.months[g-1]+" "+c+", "+l;break;case"time":j+=f+":"+d;break;case"longtime":j+=f+":"+d+":"+t;break;case"relative":case"urelative":var b=new Date();var p=b-this;if(p<60000){p=0}var a=Math.floor(p/1000/60);var r=Math.floor(a/60);var q=(r>b.getHours())?Math.floor((r)/24):0;if(q==0){a=a-(r*60);r=r;if(r==0&&a==0){j+="less than a minute "}else{if(r>0){j+=(r==1)?"1 hour ":r+" hours "}if(a>0){j+=(a==1)?"1 minute ":a+" minutes "}}}else{if(q==1){j+="1 day ";r=r-24;if(r>0){j+=(r==1)?"1 hour ":r+" hours "}}else{if(q<=14){j+=q+" days "}}}if(q>14){j+="on ";j+=(arguments[e]=="relative")?c+" "+Date.months[g-1].substring(3,0)+" "+l:Date.months[g-1].substring(3,0)+" "+c+", "+l;j+=" at "+f+":"+d}else{j+="ago";if(q>1){j+=" at "+f+":"+d}}break;case"shortrelative":var b=new Date();var p=b-this;if(p<60000){p=0}var a=Math.floor(p/1000/60);var r=Math.floor(a/60);var q=(r>b.getHours())?Math.floor((r)/24):0;if(q==0){a=a-(r*60);r=r;if(r==0&&a==0){j+="now "}else{if(r>0){j+=r+"h"}if(a>0){j+=a+"mins"}j+=" ago"}}else{if(q==1){j+="1 day ";r=r-24;if(r>0){j+=r+"h "}j+="ago"}else{if(q<=14){j+=q+" days ago"}}}if(q>14){j+="on ";j+=c+"/"+g+"/"+String(l).substr(2)}break;case"tolower":j=j.toLowerCase();break;case"nonbreaking":j=j.replace(/ /g,"&nbsp;");break}}return j};var MD5=function(u){function P(b,a){return(b<<a)|(b>>>(32-a))}function O(x,b){var G,a,d,F,c;d=(x&2147483648);F=(b&2147483648);G=(x&1073741824);a=(b&1073741824);c=(x&1073741823)+(b&1073741823);if(G&a){return(c^2147483648^d^F)}if(G|a){if(c&1073741824){return(c^3221225472^d^F)}else{return(c^1073741824^d^F)}}else{return(c^d^F)}}function t(a,c,b){return(a&c)|((~a)&b)}function s(a,c,b){return(a&b)|(c&(~b))}function r(a,c,b){return(a^c^b)}function p(a,c,b){return(c^(a|(~b)))}function y(H,G,af,ae,F,I,ad){H=O(H,O(O(t(G,af,ae),F),ad));return O(P(H,I),G)}function f(H,G,af,ae,F,I,ad){H=O(H,O(O(s(G,af,ae),F),ad));return O(P(H,I),G)}function L(H,G,af,ae,F,I,ad){H=O(H,O(O(r(G,af,ae),F),ad));return O(P(H,I),G)}function v(H,G,af,ae,F,I,ad){H=O(H,O(O(p(G,af,ae),F),ad));return O(P(H,I),G)}function e(x){var H;var d=x.length;var c=d+8;var b=(c-(c%64))/64;var G=(b+1)*16;var I=Array(G-1);var a=0;var F=0;while(F<d){H=(F-(F%4))/4;a=(F%4)*8;I[H]=(I[H]|(x.charCodeAt(F)<<a));F++}H=(F-(F%4))/4;a=(F%4)*8;I[H]=I[H]|(128<<a);I[G-2]=d<<3;I[G-1]=d>>>29;return I}function J(c){var b="",d="",x,a;for(a=0;a<=3;a++){x=(c>>>(a*8))&255;d="0"+x.toString(16);b=b+d.substr(d.length-2,2)}return b}function N(b){b=b.replace(/\r\n/g,"\n");var a="";for(var x=0;x<b.length;x++){var d=b.charCodeAt(x);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}var K=Array();var T,h,M,A,g,ac,ab,aa,Z;var W=7,U=12,R=17,Q=22;var E=5,D=9,C=14,B=20;var q=4,o=11,m=16,l=23;var Y=6,X=10,V=15,S=21;u=N(u);K=e(u);ac=1732584193;ab=4023233417;aa=2562383102;Z=271733878;for(T=0;T<K.length;T+=16){h=ac;M=ab;A=aa;g=Z;ac=y(ac,ab,aa,Z,K[T+0],W,3614090360);Z=y(Z,ac,ab,aa,K[T+1],U,3905402710);aa=y(aa,Z,ac,ab,K[T+2],R,606105819);ab=y(ab,aa,Z,ac,K[T+3],Q,3250441966);ac=y(ac,ab,aa,Z,K[T+4],W,4118548399);Z=y(Z,ac,ab,aa,K[T+5],U,1200080426);aa=y(aa,Z,ac,ab,K[T+6],R,2821735955);ab=y(ab,aa,Z,ac,K[T+7],Q,4249261313);ac=y(ac,ab,aa,Z,K[T+8],W,1770035416);Z=y(Z,ac,ab,aa,K[T+9],U,2336552879);aa=y(aa,Z,ac,ab,K[T+10],R,4294925233);ab=y(ab,aa,Z,ac,K[T+11],Q,2304563134);ac=y(ac,ab,aa,Z,K[T+12],W,1804603682);Z=y(Z,ac,ab,aa,K[T+13],U,4254626195);aa=y(aa,Z,ac,ab,K[T+14],R,2792965006);ab=y(ab,aa,Z,ac,K[T+15],Q,1236535329);ac=f(ac,ab,aa,Z,K[T+1],E,4129170786);Z=f(Z,ac,ab,aa,K[T+6],D,3225465664);aa=f(aa,Z,ac,ab,K[T+11],C,643717713);ab=f(ab,aa,Z,ac,K[T+0],B,3921069994);ac=f(ac,ab,aa,Z,K[T+5],E,3593408605);Z=f(Z,ac,ab,aa,K[T+10],D,38016083);aa=f(aa,Z,ac,ab,K[T+15],C,3634488961);ab=f(ab,aa,Z,ac,K[T+4],B,3889429448);ac=f(ac,ab,aa,Z,K[T+9],E,568446438);Z=f(Z,ac,ab,aa,K[T+14],D,3275163606);aa=f(aa,Z,ac,ab,K[T+3],C,4107603335);ab=f(ab,aa,Z,ac,K[T+8],B,1163531501);ac=f(ac,ab,aa,Z,K[T+13],E,2850285829);Z=f(Z,ac,ab,aa,K[T+2],D,4243563512);aa=f(aa,Z,ac,ab,K[T+7],C,1735328473);ab=f(ab,aa,Z,ac,K[T+12],B,2368359562);ac=L(ac,ab,aa,Z,K[T+5],q,4294588738);Z=L(Z,ac,ab,aa,K[T+8],o,2272392833);aa=L(aa,Z,ac,ab,K[T+11],m,1839030562);ab=L(ab,aa,Z,ac,K[T+14],l,4259657740);ac=L(ac,ab,aa,Z,K[T+1],q,2763975236);Z=L(Z,ac,ab,aa,K[T+4],o,1272893353);aa=L(aa,Z,ac,ab,K[T+7],m,4139469664);ab=L(ab,aa,Z,ac,K[T+10],l,3200236656);ac=L(ac,ab,aa,Z,K[T+13],q,681279174);Z=L(Z,ac,ab,aa,K[T+0],o,3936430074);aa=L(aa,Z,ac,ab,K[T+3],m,3572445317);ab=L(ab,aa,Z,ac,K[T+6],l,76029189);ac=L(ac,ab,aa,Z,K[T+9],q,3654602809);Z=L(Z,ac,ab,aa,K[T+12],o,3873151461);aa=L(aa,Z,ac,ab,K[T+15],m,530742520);ab=L(ab,aa,Z,ac,K[T+2],l,3299628645);ac=v(ac,ab,aa,Z,K[T+0],Y,4096336452);Z=v(Z,ac,ab,aa,K[T+7],X,1126891415);aa=v(aa,Z,ac,ab,K[T+14],V,2878612391);ab=v(ab,aa,Z,ac,K[T+5],S,4237533241);ac=v(ac,ab,aa,Z,K[T+12],Y,1700485571);Z=v(Z,ac,ab,aa,K[T+3],X,2399980690);aa=v(aa,Z,ac,ab,K[T+10],V,4293915773);ab=v(ab,aa,Z,ac,K[T+1],S,2240044497);ac=v(ac,ab,aa,Z,K[T+8],Y,1873313359);Z=v(Z,ac,ab,aa,K[T+15],X,4264355552);aa=v(aa,Z,ac,ab,K[T+6],V,2734768916);ab=v(ab,aa,Z,ac,K[T+13],S,1309151649);ac=v(ac,ab,aa,Z,K[T+4],Y,4149444226);Z=v(Z,ac,ab,aa,K[T+11],X,3174756917);aa=v(aa,Z,ac,ab,K[T+2],V,718787259);ab=v(ab,aa,Z,ac,K[T+9],S,3951481745);ac=O(ac,h);ab=O(ab,M);aa=O(aa,A);Z=O(Z,g)}var j=J(ac)+J(ab)+J(aa)+J(Z);return j.toLowerCase()};function GReverseGeocoder(a){this.map=a;this.gdirections=new GDirections();this.geocoder=new GClientGeocoder();this.lastpoint=null;this.closestonroad=null;this.experimental=false;this.ad="";this.step=10;this.start=1;this.gdirectionsrefine=new GDirections();GEvent.bind(this.gdirections,"error",this,this.handleError);GEvent.bind(this.gdirections,"load",this,this.processDirection);GEvent.bind(this.gdirectionsrefine,"error",this,this.handleError);GEvent.bind(this.gdirectionsrefine,"load",this,this.processDirectionRefine)}GReverseGeocoder.prototype.reverseGeocode=function(a){this.lastpoint=a;this.closestonroad=null;this.gdirections.clear();this.gdirections.loadFromWaypoints([a.toUrlValue(6),a.toUrlValue(6)],{getSteps:true,locale:"GB",getPolyline:true})};GReverseGeocoder.prototype.getStatus=function(){return this.gdirections.getStatus()};GReverseGeocoder.prototype.handleError=function(){GEvent.trigger(this,"error")};GReverseGeocoder.prototype.processDirection=function(){var b=this;if(this.gdirections.getPolyline()!=null){this.closestonroad=this.gdirections.getPolyline().getVertex(0)}var j=this.gdirections.getNumRoutes();if(j!=0){var g=this.gdirections.getRoute(0);var f=g.getNumSteps();if(f!=0){var d=g.getStep(0);var c=d.getDescriptionHtml();c=this.getStreet(c);var h=new GLatLng(Number(this.lastpoint.lat())-0.01,Number(this.lastpoint.lng())-0.01);var e=new GLatLng(Number(this.lastpoint.lat())+0.01,Number(this.lastpoint.lng())+0.01);var a=new GLatLngBounds(h,e);this.geocoder.setViewport(a);this.geocoder.getLocations(c,function(l){var m=b.getBestMatchingPlacemark(l);if(m!=null){if(b.experimental){b.ad=m.address;b.step=10;b.start=1;b.houseNumberSearch()}else{GEvent.trigger(b,"load",m)}}else{b.handleError()}})}}};GReverseGeocoder.prototype.getBestMatchingPlacemark=function(d){if(!d||d.Status.code!=200){return null}var e=-1;var g=1000000;for(var f=0;f<d.Placemark.length;f++){var b=d.Placemark[f];var a=new GLatLng(b.Point.coordinates[1],b.Point.coordinates[0]);var c=this.lastpoint.distanceFrom(a);if(c<g){e=f;g=c}}if(e<0){return null}d.Placemark[e].RequestPoint={coordinates:[this.lastpoint.lng(),this.lastpoint.lat()]};d.Placemark[e].PointOnRoad={coordinates:[this.closestonroad.lng(),this.closestonroad.lat()]};d.Placemark[e].Distance=g;d.Placemark[e].DistanceOnRoad=this.closestonroad.distanceFrom(new GLatLng(d.Placemark[e].Point.coordinates[1],d.Placemark[e].Point.coordinates[0]));return d.Placemark[e]};GReverseGeocoder.prototype.processDirectionRefine=function(){var g=this.gdirectionsrefine.getNumGeocodes();var b=-1;var d=100;for(var c=1;c<g;c++){var a=this.gdirectionsrefine.getGeocode(c);var h=new GLatLng(a.Point.coordinates[1],a.Point.coordinates[0]);if(a.AddressDetails.Accuracy==8){var l=this.lastpoint.distanceFrom(h);if(l<d){b=c;d=l}}}if(b<0){if(this.start+(24*this.step)<2000){this.start=this.start+(25*this.step);this.houseNumberSearch()}else{this.handleError()}}else{if(this.step==1){var e=this.gdirectionsrefine.getGeocode(b);e.RequestPoint={coordinates:[this.lastpoint.lng(),this.lastpoint.lat()]};e.PointOnRoad={coordinates:[this.closestonroad.lng(),this.closestonroad.lat()]};e.Distance=d;e.DistanceOnRoad=this.closestonroad.distanceFrom(new GLatLng(e.Point.coordinates[1],e.Point.coordinates[0]));GEvent.trigger(this,"load",e)}else{var a=this.gdirectionsrefine.getGeocode(b);var f=a.address.split(",",1)[0].split(" ");f=f[f.length-1];this.start=f-10;this.step=1;this.houseNumberSearch()}}};GReverseGeocoder.prototype.houseNumberSearch=function(){this.gdirectionsrefine.clear();this.gdirectionsrefine.loadFromWaypoints([(""+(this.start+(0*this.step))+" ")+this.ad,(""+(this.start+(1*this.step))+" ")+this.ad,(""+(this.start+(2*this.step))+" ")+this.ad,(""+(this.start+(3*this.step))+" ")+this.ad,(""+(this.start+(4*this.step))+" ")+this.ad,(""+(this.start+(5*this.step))+" ")+this.ad,(""+(this.start+(6*this.step))+" ")+this.ad,(""+(this.start+(7*this.step))+" ")+this.ad,(""+(this.start+(8*this.step))+" ")+this.ad,(""+(this.start+(9*this.step))+" ")+this.ad,(""+(this.start+(10*this.step))+" ")+this.ad,(""+(this.start+(11*this.step))+" ")+this.ad,(""+(this.start+(12*this.step))+" ")+this.ad,(""+(this.start+(13*this.step))+" ")+this.ad,(""+(this.start+(14*this.step))+" ")+this.ad,(""+(this.start+(15*this.step))+" ")+this.ad,(""+(this.start+(16*this.step))+" ")+this.ad,(""+(this.start+(17*this.step))+" ")+this.ad,(""+(this.start+(18*this.step))+" ")+this.ad,(""+(this.start+(19*this.step))+" ")+this.ad,(""+(this.start+(20*this.step))+" ")+this.ad,(""+(this.start+(21*this.step))+" ")+this.ad,(""+(this.start+(22*this.step))+" ")+this.ad,(""+(this.start+(23*this.step))+" ")+this.ad,(""+(this.start+(24*this.step))+" ")+this.ad],{getSteps:true,locale:"GB"})};GReverseGeocoder.prototype.getStreet=function(b){var a=b.substring(b.lastIndexOf("<b>")+3,b.lastIndexOf("</b>"));if(a.indexOf("/<wbr/>")>0){strs=a.split("/<wbr/>");if(strs[0].charAt(1)>="0"&&strs[0].charAt(1)<="9"){a=strs[1]}else{a=strs[0]}}return a};GReverseGeocoder.prototype.setExperimentalHouseNumber=function(a){this.experimental=a};GReverseGeocoder.prototype.getPlacemarkProperty=function(a,b){for(var d in a){if((d==b)){return String(a[d])}else{if(typeof(a[d])=="object"){var c=this.getPlacemarkProperty(a[d],b);if(c!=null){return c}}}}return null};ii={};ii.log_to_console=window.ii_log_to_console;ii.log_to_div=window.ii_log_to_div;ii.logger_paused=false;ii.logger_queue=[];ii.init=function(){ii.browser={cssfilter:(typeof(document.body.style.filter)==="string")?true:false,safari:(navigator.userAgent.indexOf("Safari")!==-1)?true:false,opera:(navigator.userAgent.indexOf("Opera")!==-1)?true:false,windows:(navigator.userAgent.indexOf("Windows")!==-1)?true:false,msie:(navigator.userAgent.indexOf("MSIE")!==-1)?true:false,msie7:(navigator.userAgent.indexOf("MSIE 7")!==-1)?true:false};ii.browser.pngsupport=(ii.browser.cssfilter&&navigator.userAgent.indexOf("MSIE 7")===-1)?false:true};ii.pngImage=function(c,b,d,a){if(ii.browser.cssfilter){var e=document.createElement(a||"div");e.style.width=b+"px";e.style.height=d+"px";e.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src='media/"+c+"');"}else{var e=document.createElement("img");if(!a){e.style.display="block"}e.style.width=b+"px";e.style.height=d+"px";e.src="/media/"+c}return e};ii.assert=function(a){if(!a){ii.error("Assertion failed")}};ii.dir=function(a){if(window.console&&window.console.dir){console.dir(a)}};ii.log=function(b){if(ii.log_to_console!==true){return}if(ii.logger_paused===true){ii.logger_queue.push(b);return}if(window.console){if(console.log.apply){while(ii.logger_queue.length>0){console.log.apply(console,ii.logger_queue.shift())}console.log.apply(console,arguments)}else{while(ii.logger_queue.length>0){console.log(ii.logger_queue.shift()[0])}console.log(arguments[0])}}else{if(ii.log_to_div===true){var d=document.getElementById("div_console");if(d){while(ii.logger_queue.length>0){d.innerHTML+=ii.logger_queue.shift()+"<br>"}d.innerHTML+=b+"<br>"}else{d=document.createElement("div");d.setAttribute("id","div_console");d.style.position="fixed";d.style.background="white";d.style.zIndex="99999999";d.style.bottom="0px";d.style.right="0px";d.style.width="400px";d.style.height="150px";d.style.overflow="auto";d.style.border="1px solid red";d.innerHTML=b;document.body.appendChild(d);var e=ii.elm("div",{style:{position:"fixed",bottom:"0px",left:"0px",background:"blue",color:"white",display:"none"},onclick:function(){d.style.display="block";a.style.display="block";this.style.display="none"}},"open console");document.body.appendChild(e);var a=ii.elm("div",{style:{position:"fixed",bottom:"0px",left:"0px",background:"blue",color:"white"},onclick:function(){d.style.display="none";e.style.display="block";this.style.display="none"}},"close console");document.body.appendChild(a);var c=ii.elm("div",{style:{position:"fixed",bottom:"0px",left:"75px",background:"green",color:"white"},onclick:function(){if(this.innerHTML=="console paused"){ii.logger_paused=false;while(ii.logger_queue.length>0){d.innerHTML+=ii.logger_queue.shift()+"<br>"}this.style.background="green";this.innerHTML="pause console"}else{ii.logger_paused=true;this.style.background="red";this.innerHTML="console paused"}}},"pause console");document.body.appendChild(c)}}}};ii.error=function(a){ii.log("err: "+a);throw new Error(a)};ii.fatal=function(a){ii.log("fatal: "+a)};ii.get=function(url,callback,params){url="/srv/"+url+".php?";params=params||{};if(ii.login&&ii.login.key){params.key=ii.login.key}for(var k in params){url+=encodeURIComponent(k)+"="+encodeURIComponent(params[k])+"&"}var request=new XMLHttpRequest();request.open("GET",url);request.onreadystatechange=function(){if(request.readyState==4&&request.status==200){eval("var resp = "+request.responseText);callback(resp)}};request.send(null);return request};ii.getHtml=function(a,c,d){a="html/"+a+".php";var b=new XMLHttpRequest();b.open("GET",a);b.onreadystatechange=function(){if(b.readyState==4&&b.status==200){c.innerHTML=b.responseText;if(d){d(c)}}};b.send(null);return b};ii.loadDriver=function(a){if(!ii.drivers){ii.drivers={}}if(!ii.drivers[a]){ii.drivers[a]=ii.elm("div",{className:"driver",style:{marginTop:"15px"}});ii.getHtml("Drivers"+a,ii.drivers[a])}return ii.drivers[a]};ii.onmouseoverbtn=function(){this.src=this.src.replace(/([^X])\.png/,"$1X.png")};ii.onmouseoutbtn=function(){this.src=this.src.replace(/X\.png/,".png")};ii.add_s=function(a){if(a.substr(a.length-1,1)=="s"){return a+"'"}else{return a+"'s"}};ii.typeletter={user:"u",account:"u",trip:"t",comment:"c",spot:"s",group:"g",album:"a",poi:"p",feed:"f"};ii.typename={u:"user",p:"poi",t:"trip",c:"comment",g:"group",s:"spot",a:"album",f:"feed"};ii.typector={u:"User",p:"Poi",t:"Trip",c:"Comment",g:"Group",s:"Spot",a:"Album",f:"Feed"};ii.typeplural={u:"People",p:"Photos",t:"Trips",c:"Comments",s:"Spots",g:"Groups",a:"Albums",f:"Feed"};ii.typesingle={u:"Person",p:"Photo",t:"Trip",c:"Comment",s:"Spot",g:"Group",a:"Album",f:"Feed"};ii.views={};ii.items={};ii.elm=function(a){var c=function(j,h){for(var g in h){if(h[g] instanceof Object&&!(h[g] instanceof Function)){c(j[g],h[g])}else{if(ii.browser.msie){switch(g){case"cssFloat":j.setAttribute("styleFloat",h[g]);break;default:try{j[g]=h[g]}catch(f){ii.log("cant set "+g+" to "+h[g]);throw f}break}}else{j[g]=h[g]}}}};var d=document.createElement(a);var b=ii.elm.arguments;for(var e=1;e<b.length;e++){if(b[e]==undefined){ii.error("invalid parameter "+e+" to ii.elm")}else{if(b[e].nodeType){d.appendChild(b[e])}else{if(typeof(b[e])=="string"){d.appendChild(document.createTextNode(b[e]))}else{c(d,b[e])}}}}return d};ii.userLink=function(b,a){return ii.elm("a",{className:"user",href:"#rel&item=u."+b},a)};ii.poiLink=function(b,a){return ii.elm("a",{href:"#rel&item=p."+b},a)};ii.tripLink=function(b,a){return ii.elm("a",{href:"#rel&item=t."+b},a)};ii.groupLink=function(b,a){return ii.elm("a",{href:"#rel&item=g."+b},a)};ii.spotLink=function(b,a){return ii.elm("a",{href:"#rel&item=s."+b},a)};ii.albumLink=function(b,a){return ii.elm("a",{href:"#rel&item=a."+b},a)};ii.appendS=function(a){if(a.substr(a.length-1,1)=="s"){return a+"'"}else{return a+"'s"}};ii.setText=function(c,a){try{c.innerHTML="";c.appendChild(document.createTextNode(a))}catch(b){ii.log("elm is "+c+"\n cant set text "+a);throw b}};ii.stopPropagation=function(a){if(a){a.cancelBubble=true;if(a.stopPropagation){a.stopPropagation()}}};ii.formatDate=function(b,c){var a=new Date((parseInt(b))*1000);return a.format(c)};ii.formatDistance=function(a){if(a===undefined){return undefined}a=parseInt(a);return(a<2000?a+" m":Math.round(a/1000)+" km")};ii.formatSpeed=function(a){if(a==undefined){return""}else{return Math.round(a*3.6)+" km/h"}};ii.formatTimespan=function(a){if(a<120){return a+" secs"}else{if(a/60<240){return Math.round(a/60)+" min"}else{return Math.round(a/3600)+" hours"}}};ii.formatLocation=function(d,e,b,c,a){if(c){return ii.elm("span","@ ",spotLink(b,c),", ",ii.geoCode(d,e,a))}else{return ii.elm("span","@ ",ii.geoCode(d,e,a))}};ii.iframeDocument=function(a){if(a.contentDocument){return a.contentDocument.documentElement}else{if(a.contentWindow){return a.contentWindow.document.body}else{if(a.document){return a.document}}}};ii.refreshCenterPaneShadow=function(){var f=document.getElementById("ii_pane_itemlist_container");if(f.style.display=="none"){try{f=document.getElementById("ii_landing_page_container")}catch(l){}}var j=document.getElementById("ii_centerpane_container");var b=f.offsetHeight;var g=j.offsetHeight;var m=updated_bottomleft=false;for(var h in f.childNodes){var d=f.childNodes[h];if(d.nodeType!=1){continue}if(d.className.indexOf("chrome bottom")>-1){d.style.display="none"}}for(var h in j.childNodes){var d=j.childNodes[h];if(m===false&&1==d.nodeType&&(d.className.indexOf("chrome left")>-1)){if(g>b){d.style.top=b+"px"}else{d.style.top=g+"px"}m=true;if(m===true&&updated_bottomleft===true){break}}if(updated_bottomleft===false&&1==d.nodeType&&(d.className.indexOf("chrome bottomleft")>-1)){if(g>b){d.style.visibility="visible"}else{d.style.visibility="hidden"}updated_bottomleft=true;if(m===true&&updated_bottomleft===true){break}}}if(typeof(window.innerWidth)=="number"){var a=window.innerHeight}else{var a=document.documentElement.clientHeight}if(b+80+10>a){var c="none"}else{var c=""}for(var h in f.childNodes){var d=f.childNodes[h];if(d.nodeType!=1){continue}if(d.className.indexOf("chrome bottom")>-1){d.style.display=c}}};ii.setSelectValue=function(a,c){var b=a.getElementsByTagName("option");for(var d=0;d<b.length;d++){ii.log(b[d].value);if(b[d].value==c){b[d].selected=true;return}}};ii.setCookie=function(b,d,e){var e=(e===undefined)?14:e;var c=86400000;if(e==0){document.cookie=b+"="+d+"; path=/"}else{var a=new Date();a.setTime(a.getTime()+(e*c));document.cookie=b+"="+d+"; expires="+a.toGMTString()+"; path=/"}};ii.getCookieValue=function(a){var f="";var e=document.cookie.split(";");if(e.length){var d=e.length;for(var c=0;c<d;c++){var b=e[c];if(b.indexOf(a+"=")>-1){f=b.split(a+"=")[1];break}}}return f};ii.removeCookie=function(a){ii.setCookie(a,"",-1)};ii.removeLandingPage=function(){if(ii.landing_page_feed_browser){if(ii.landing_page_feed_browser.feed_query){ii.landing_page_feed_browser.feed_query.stop()}delete ii.landing_page_feed_browser}var b=document.getElementById("ii_header").getElementsByTagName("a");for(var a=0,e=b.length;a<e;a++){var c=b[a];switch(c.name){case"tab_Welcome":c.className="display_none";break;case"tab_Map":c.className="selected show";break;case"tab_Feed":c.className="show";break;default:break}}var f=document.getElementById("ii_landing_page_container");if(f){f.parentNode.removeChild(f)}var d=document.getElementById("ii_centerpane_Welcome");if(d){d.style.display="none"}};ii.selectItemBrowserTab=function(){var a=document.getElementById("ii_menu").getElementsByTagName("li");if(ii.app.state.state.item&&ii.app.state.state.item.indexOf("ME")>-1){a[0].getElementsByTagName("img")[0].src="media/homeX.gif";a[a.length-1].getElementsByTagName("img")[0].src="media/world.gif"}else{if(!ii.app.state.state.item){a[0].getElementsByTagName("img")[0].src="media/home.gif";a[a.length-1].getElementsByTagName("img")[0].src="media/worldX.gif"}else{a[0].getElementsByTagName("img")[0].src="media/home.gif";a[a.length-1].getElementsByTagName("img")[0].src="media/world.gif"}}};ii.decode_query_string=function(b){var g={};if(b.substring(0,1).indexOf("?")>-1){b=b.substring(1)}var h=b.split("&");for(var e=0,a=h.length;e<a;e++){var f=h[e].split("=");var d=decodeURIComponent(f[0]);var c=decodeURIComponent(f[1]);g[d]=c}return g};ii.encode_query_string=function(c){var a=[];for(var b in c){a.push(encodeURIComponent(b)+"="+encodeURIComponent(c[b]))}return a.join("&")};ii.setDefaultText=function(b,a){if(!b.hasFocus){b.value=a}b.defaultText=a;b.style.color="#707070";b.onfocus=function(){if(this.value==a){this.value=""}this.hasFocus=true};b.onblur=function(){if(this.value==""){this.value=a}this.hasFocus=false}};ii.getTextBoxValue=function(a){if(!a.defaultText||a.value!=a.defaultText){return a.value}else{return""}};ii.getElmByName=function(c,a){if(false&&!ii.browser.msie7){return c[a]}else{for(var b=0;b<c.elements.length;b++){var d=c.elements[b];if(d.getAttribute("name")==a){return d}}}};ii.startWaitButton=function(a){a.oldText=a.value;a.value="";a.className=(a.className||"")+" waiting";a.blur();a.disabled=true};ii.endWaitButton=function(a){a.value=a.oldText;a.className=a.className.replace("waiting","");a.disabled=false};ii.getMessageBox=function(a){var c=a.message===undefined?"":a.message;var b=a.style===undefined?{}:a.style;var d=ii.elm("div",{className:"messagebox",style:b},ii.elm("span",c),ii.elm("img",{src:"/media/balloon_curve_SML.gif"}));return d};ii.handle_messagebox_focus=function(c){c.style.backgroundImage="none";c.style.backgroundColor="white";var b=c.parentNode.getElementsByTagName("img")[0];b.src="./media/balloon_curve_SMLX.gif";if(c.setSelectionRange){c.setSelectionRange(0,c.value.length)}else{if(c.createTextRange){var a=c.createTextRange();a.collapse(true);a.moveStart("character",0);a.moveEnd("character",c.value.length);a.select()}}};ii.handle_messagebox_blur=function(b){b.style.backgroundImage="url(media/tab_poi_bground.png)";b.style.backgroundRepeat="repeat-x";var a=b.parentNode.getElementsByTagName("img")[0];a.src="./media/balloon_curve_SML.gif"};ii.addEvent=function(d,b,a){try{d.addEventListener(b,a,true)}catch(c){try{d.attachEvent("on"+b,a)}catch(c){d["on"+b]=a}}};ii.text2href=function(d,g){var b=/https?:\/\/([-\w\.]+)+(:\d+)?(\/([\w/_\.-]*(\?\S+)?(#\S+)?)?)?/;var a=new RegExp("(?:https?:\\/\\/"+window.location.host+"\\/)?#(\\w+)=([\\w\\.%]*)(?:&(\\w+)=([\\w\\.%]*))*","g");var h=g||document.createElement("p");for(;;){var f=b.exec(d);var c=a.exec(d);if(f!=null&&(c==null||f.index<c.index)){if(f.index>0){h.appendChild(document.createTextNode(d.substr(0,f.index)))}h.appendChild(ii.elm("a",{href:f[0],rel:"nofollow",target:"_blank"},f[0]));d=d.substr(f.index+f[0].length)}else{if(c!=null){if(c.index>0){h.appendChild(document.createTextNode(d.substr(0,c.index)))}(function(){var j=ii.elm("a",{href:c[0]},c[0]);var e=false;for(n=1;n<c.length-1;n+=2){if(c[n]=="item"){ii.log("using item: "+c[n+1]);var o=c[n+1].split(".");if(o.length!=2){break}var l=ii.typename[o[0]];var m=o[1];ii.get("q-items-"+l,function(p){if(p.items.length==1){ii.setText(j,p.items[0].name);j.className="micro "+l}},{id:m,fields:"basic"});e=true}}if(!e){for(n=1;n<c.length;n+=2){if(c[n]=="tab"){ii.setText(j,c[n+1])}}}h.appendChild(j)})();d=d.substr(c.index+c[0].length)}else{break}}}if(d){h.appendChild(document.createTextNode(d))}return h.innerHTML};ii.trim=function(a){if(typeof a=="string"){a.replace("/^s+|s+$/g","")}return a};ii.obj2json=function(a){var f=[];var b=(Object.prototype.toString.apply(a)==="[object Array]");for(var d in a){var e=a[d];if(typeof e=="object"){if(b){f.push(ii.obj2json(e))}else{f[d]=ii.obj2json(e)}}else{var g="";if(!b){g='"'+d+'":'}if(typeof e=="number"){g+=e}else{if(e===false){g+="false"}else{if(e===true){g+="true"}else{g+='"'+e+'"'}}}f.push(g)}}var c=f.join(",");if(b){return"["+c+"]"}return"{"+c+"}"};ii.obj2json=function(a){if(a===undefined){return"null"}switch(a.constructor){case String:return'"'+a+'"';case Number:return a.toString();case Array:var b=[];for(i in a){b.push(ii.obj2json(a[i]))}return"["+b.join(",")+"]";case Object:var b=[];for(k in a){b.push('"'+k+'":'+ii.obj2json(a[k]))}return"{ "+b.join(",")+"} ";case Boolean:return a?"true":"false";default:return"null"}};ii.set_itempane_animate_speed=80;ii.set_itempane_animate_collapse_fact=3;ii.set_itempane_animate_expand_fact=2;ii.set_wait_before_status=10000;ii.set_status_maxage=10000;ii.set_interval_status=6000;ii.fade_rotation_timer;ii.app={initialized:false,statusDisplay:{counters:{poi:[0,0],user:[0,0],trip:[0,0],spot:[0,0]},item:null,countItems:function(e,c,b,d,a){this.counters[a]=[c,b];this.update()},update:function(){var a="";if(this.counters.user[1]>0){a+=(""+this.counters.user[0])+" of "+this.counters.user[1]+" People, "}if(this.counters.poi[1]>0){a+=(""+this.counters.poi[0])+" of "+this.counters.poi[1]+" Photos, "}if(this.counters.trip[1]>0){a+=(""+this.counters.trip[0])+" of "+this.counters.trip[1]+" Trips, "}if(this.counters.spot[1]>0){a+=(""+this.counters.spot[0])+" of "+this.counters.spot[1]+" Spots, "}if(a!=""){a=a.substr(0,a.length-2);if(ii.app.state.state.ll){b="Showing in current Area: "+a}else{var b="Showing: ";if(this.item){b+=this.item+" "}b="Showing: "+(this.item?this.item+" ":"")+'<a href="javascript://viewAll" onclick="ii.app.map.viewAll();">'+a+" world-wide</a>"}}else{if(this.item){b="Showing: "+this.item.substr(0,this.item.length-2)}else{b=""}}document.getElementById("ii_status_displaying").innerHTML=b},reset:function(b,a){if(!b){this.item=null}else{if(b=="ME"){this.item="You, "}else{this.item=(ii.typesingle[ii.typeletter[b]]+" '"+a+"', ").toLowerCase()}}this.counters={poi:[0,0],user:[0,0],trip:[0,0],spot:[0,0]};this.update()}}};ii.app.init=function(){ii.app.initClock();if(document.location.hash.indexOf("#")>-1&&document.location.hash.indexOf("Welcome")==-1){ii.removeLandingPage()}if(ii.app.state===undefined){ii.app.state=new ii.State();ii.app.state.init()}var j=document.getElementById("ii_landing_page")||false;if(ii.login||j===false){ii.startWait=function(){document.getElementById("ii_wait_icon").className=document.getElementById("ii_wait_icon").className.replace("waitoff","waiton");document.getElementById("ii_active_item_label").className=document.getElementById("ii_active_item_label").className.replace("waitoff","waiton")};ii.stopWait=function(){document.getElementById("ii_wait_icon").className=document.getElementById("ii_wait_icon").className.replace("waiton","waitoff");document.getElementById("ii_active_item_label").className=document.getElementById("ii_active_item_label").className.replace("waiton","waitoff")};ii.app.initScreenComponents();ii.app.initSearchBox();ii.app.initMap();ii.app.initMiniFeed();ii.app.initMouseEvents();ii.app.initialized=true;ii.app.applyState({item:""},{item:""});if(window.ii_autologin){ii.login=new ii.Login(ii.getCookieValue("id"),ii.getCookieValue("username"),ii.getCookieValue("key"));if(document.location.hash.indexOf("#")<0){window.location="#item=ME.0"}}if(ii.app.postInit){ii.app.postInit()}}else{document.getElementById("ii_status_container").style.display="none";document.getElementById("ii_pane_itemlist_container").style.display="none";document.getElementById("ii_map_shadow").style.display="none";document.getElementById("ii_status_explore_container").style.display="none";ii.startWait=function(){};ii.stopWait=function(){};var h=document.getElementById("ii_header").getElementsByTagName("a");for(var f=0,c=h.length;f<c;f++){var d=h[f];switch(d.name){case"tab_Welcome":d.className="selected";break;case"tab_Map":d.className="selected display_none";break;case"tab_Feed":d.className="hide";break;default:break}}var a=document.getElementById("ii_landing_page");var b=ii.Login.landingLoginBox();var m=new ii.views.FeedBrowser({},{},{show_tabs:false,show_search:false,show_friends_checkbox:false,show_header:false,driver_name:"Landing",onAvatarClick:function(){a.style.display="none"},onDone:function(o){a.style.height=a.lastChild.offsetHeight+"px"},onUserNameClick:function(){a.style.display="none"},onItemClick:function(){a.style.display="none"},pager:function(o){var p=(o)?(o-1)*10:0;ii.landing_page_feed_browser.feed_query.setQueryOpts({start:p})}});ii.landing_page_feed_browser=m;function e(u){var q=document.getElementById("landing_page_banner");var r=q.getElementsByTagName("a");for(var t=0,o=r.length;t<o;t++){var p=r[t];if(p.id.indexOf("tab")==-1){continue}var s=document.getElementById(p.id.substr(0,p.id.length-4));if(u.id==p.id){p.className=s.className="selected"}else{p.className=s.className=""}}}var g=ii.elm("div",{style:{margin:"0px",padding:"0px",border:"0px"}},ii.elm("h1",{style:{marginBottom:"20px"}},"bliin ",ii.elm("span",{className:"live"},"YourLive!")," \u00BA Always There"),ii.elm("div",{id:"landing_page_banner"},ii.elm("div",{id:"landing_live",className:"selected"},ii.elm("div",{id:"landing_live_overlay"},ii.elm("h1",ii.elm("span",{className:"live"},"Live!")," locationstream sharing"),ii.elm("p","Find and follow your Friends in real-time via your phone and over the web. Share your ",ii.elm("span",{className:"live"},"Live!")," locationstream without the fuzz of setting your location manually … you’re simply ",ii.elm("strong","Always There.")))),ii.elm("div",{id:"landing_share"},ii.elm("div",{id:"landing_share_overlay"},ii.elm("h1","Instantly share experiences world wide"),ii.elm("p","Share your precious moments in geo-tagged media instantly, as you capture them. Create Trips of journeys and record them for playback later."))),ii.elm("div",{id:"landing_always"},ii.elm("div",{id:"landing_always_overlay"},ii.elm("h1","Any handset, any OS, any carrier, anywhere"),ii.elm("p","A global service, independent of operating system, handset manufacturer or network carrier ... we are browser based: any PC and any Handset will do; ",ii.elm("strong","Anytime, Anywhere, Anyone!")))),ii.elm("div",{id:"landing_secure"},ii.elm("div",{id:"landing_secure_overlay"},ii.elm("h1","You control... Peace of mind"),ii.elm("p","We work with experts and authorities to keep your data save and secure. The level of Privacy you want to enjoy on bliin is yours."))),ii.elm("div",{id:"landing_live_link_wrapper"},ii.elm("div",{className:"landing_live_link_container",id:"landing_live_link_signup_container"},ii.elm("img",{alt:"next",src:"./media/button_next.png"}),ii.elm("div",{className:"landing_live_link"},ii.elm("a",{href:"#rel&tab=Signup"},"Sign up"))),ii.elm("div",{className:"landing_live_link_container",id:"landing_live_link_entersite_container"},ii.elm("img",{alt:"next",src:"./media/button_next.png"}),ii.elm("div",{className:"landing_live_link"},ii.elm("a",{href:"#rel&tab=Map"},"Enter Site")))),ii.elm("a",{id:"landing_live_tab",className:"selected",onclick:function(){e(this)}}),ii.elm("a",{id:"landing_share_tab",onclick:function(){e(this)}}),ii.elm("a",{id:"landing_always_tab",onclick:function(){e(this)}}),ii.elm("a",{id:"landing_secure_tab",onclick:function(){e(this)}})),ii.elm("h1",{style:{margin:"20px 0px"}},ii.elm("span",{className:"live"},"Live!")," Feed activity on bliin"),m.feed_div);var l=ii.elm("div",{style:{background:"white",left:"326px",padding:"15px 16px 35px",position:"absolute",top:"0px",width:"635px",zIndex:"999"}},g);a.appendChild(b);document.getElementById("ii_centerpane_Welcome").appendChild(g);document.getElementById("ii_centerpane_container").style.visibility="";a.style.height=a.lastChild.offsetHeight+"px"}ii.app.setupWindowResize()};ii.app.initClock=function(){var a=ii.createClock();document.getElementById("ii_header").appendChild(a)};ii.app.initMouseEvents=function(){var c=document.getElementById("ii_search");var a=document.getElementById("ii_itemlist");var b=document.getElementById("ii_menu");ii.addEvent(c,"mousedown",ii.stopPropagation);ii.addEvent(b,"mousedown",ii.stopPropagation);ii.addEvent(a,"mousemove",ii.stopPropagation);ii.addEvent(c,"mousemove",ii.stopPropagation);ii.addEvent(b,"mousemove",ii.stopPropagation);ii.addEvent(a,"dblclick",ii.stopPropagation);ii.addEvent(c,"dblclick",ii.stopPropagation);ii.addEvent(b,"dblclick",ii.stopPropagation)};ii.app.initScreenComponents=function(){document.getElementById("ii_status_container").style.display="block";document.getElementById("ii_pane_itemlist_container").style.display="block";document.getElementById("ii_map_shadow").style.display="block";document.getElementById("ii_status_explore_container").style.display="block";ii.app.currentPane=new ii.Pane();ii.app.currentPane.div.style.paddingTop="0px";document.getElementById("ii_itemlist").appendChild(ii.app.currentPane.div);document.getElementById("ii_centerpane_container").style.visibility="hidden"};ii.app.initSearchBox=function(){ii.app.searchBox=document.getElementById("ii_searchbox");document.getElementById("ii_searchform").onsubmit=function(){if(this.query.value==""||this.query.value==this.query.defaultText){return false}ii.app.state.setState({query:this.query.value});return false}};ii.app.initMap=function(){ii.app.map=new ii.Map(document.getElementById("ii_map"))};ii.app.initMiniFeed=function(){ii.app.statusQuery=new ii.Query("feed",{interval:ii.set_interval_status},{count:1,maxage:ii.set_status_maxage/1000});ii.app.statusQuery.addListener({addItem:function(c){ii.log("adding feed item");var b=c.createView("SmallView");var a=document.getElementById("ii_status");a.appendChild(b.div)}});window.setTimeout(function(){ii.app.statusQuery.start()},ii.set_wait_before_status)};ii.app.applyState=function(b,o){ii.log("APPLY");ii.dir(o);isback=false;if(o.tab){ii.tracker._trackEvent("Navigate","TabChange",o.tab)}if(o.item){ii.tracker._trackEvent("Navigate","SelectItem",o.item)}if(o.query){ii.tracker._trackEvent("Navigate","Search",o.query)}if(ii.app.initialized===false&&((o.q===undefined&&o.tab===undefined)||o.tab==""||o.tab=="Map")){ii.app.init()}var a=ii.app.currentPane;if((!b.item||b.query)&&(o.pane!=undefined||o.page!=undefined)){o.item=""+b.item}if(o.item!=undefined||o.query!=undefined){var f=ii.app.currentPane=new ii.Pane(a,isback);if(!b.item||b.query){f.addBrowser(b)}else{if(b.item=="ME.0"){if(ii.Login.isLoggedIn()){f.addWelcome(b)}else{f.addLoginBox()}}else{var p=b.item.split(".");if(p[0]=="s"||p[0]=="g"||p[0]=="a"){ii.last_active_setid=parseInt(p[1])}else{if(p[0]=="u"){ii.last_active_setid=0}}f.addItem(ii.typename[p[0]],parseInt(p[1]),b)}}for(var g=0;g<ii.app.currentPane.queries.length;g++){if(b.ll&&b.ll!="items"&&b.ll!="map"){var j=b.ll.split("x");ii.app.currentPane.queries[g].setQueryOpts({lat1:j[1],lon1:j[0],lat2:j[3],lon2:j[2]})}}}else{if(o.pane!=undefined||o.page!=undefined){if(b.item=="ME.0"){ii.app.currentPane.switchMyItemPane(b)}else{ii.app.currentPane.switchItemPane(b)}for(var g=0;g<ii.app.currentPane.queries.length;g++){if(b.ll&&b.ll!="items"&&b.ll!="map"){var j=b.ll.split("x");ii.app.currentPane.queries[g].setQueryOpts({lat1:j[1],lon1:j[0],lat2:j[3],lon2:j[2]})}}}}if(o.ll!=undefined){var h=document.getElementById("ii_lock_map");if(b.ll=="map"){document.getElementById("ii_explore_area_btn").src="media/explore_areaX.png";ii.app.map.updateExtend()}else{if(!b.ll){ii.log("clearing explore mode");h.href="#rel&ll=map";h.className="lock";document.getElementById("ii_explore_area_btn").src="media/explore_area.png";for(var g=0;g<ii.app.currentPane.queries.length;g++){ii.app.currentPane.queries[g].setQueryOpts({lat1:"",lon1:"",lat2:"",lon2:""})}}else{h.href="#rel&ll=";h.className="lock selected";if(ii.app.currentPane){j=b.ll.split("x");for(var g=0;g<ii.app.currentPane.queries.length;g++){ii.app.currentPane.queries[g].setQueryOpts({lat1:j[1],lon1:j[0],lat2:j[3],lon2:j[2]})}}}}}if(ii.app.SearchBox&&ii.app.searchBox.value!=b.query){ii.app.searchBox.value=b.query;if(!b.query){if(!ii.app.searchBox.hasFocus){ii.app.searchBox.value=document.getElementById("ii_searchbox").defaultText}else{ii.app.searchBox.value=""}ii.app.searchBox.style.color="#666666"}}if(o.item!==undefined){if(ii.app.state.state.item&&(ii.app.state.state.item!="ME.0"||ii.Login.isLoggedIn())){var l="block"}else{var l="none"}document.getElementById("ii_btn_profile").style.display=l}var e=b.tab||"Map";if(o.tab!==undefined){var m=document.getElementById("ii_tabs").getElementsByTagName("a");for(var g=0;g<m.length;g++){var c=e.indexOf(m[g].name.substr(4))==0;if(!c&&m[g].className.indexOf("selected")>=0){m[g].className=m[g].className.replace("selected","")}else{if(c&&m[g].className.indexOf("selected")<0){m[g].className+=" selected"}}}}if((o.item!=undefined&&(b.tab!=undefined))||o.tab!=undefined||o.subtab!=undefined){document.getElementById("ii_centerpane_container").style.visibility=(e=="Map"?"hidden":"visible");if(e!="Map"){ii.tabs.initTab(e,ii.app.currentPane);if(ii.app.statusQuery){ii.app.statusQuery.pauseUpdate(true)}}else{ii.tabs.cleanup();if(ii.app.statusQuery){ii.app.statusQuery.start()}}}if(o.tpage!=undefined){if(ii.app.currentPane&&ii.app.currentPane.feed_browser){ii.app.currentPane.feed_browser.setPage(o.tpage)}else{if(ii.app.currentTab&&ii.app.currentTab.setPage){ii.app.currentTab.setPage(o.tpage)}}}ii.selectItemBrowserTab();ii.refreshCenterPaneShadow()};ii.app.setupWindowResize=function(){window.onresize=function(){if(typeof(window.innerWidth)=="number"){var b=window.innerHeight;var a=window.innerWidth}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){var b=document.documentElement.clientHeight;var a=document.documentElement.clientWidth}}document.getElementById("ii_map").style.height=(b-85-50)+"px";document.getElementById("ii_map_shadow").style.top=document.getElementById("ii_map").offsetHeight+"px";document.getElementById("ii_itemlist").style.maxHeight=(b-85-78+6)+"px";document.getElementById("ii_pane_itemlist_container").style.maxHeight=(b-85-78+6+77)+"px";document.getElementById("ii_centerpane_scroller").style.maxHeight=(b-85+4)+"px";document.getElementById("ii_centerpane").style.minHeight=(b-85+4-32)+"px";if(ii.map&&ii.map.map){var d=ii.map.map.controls;d[1].moveTo({x:Math.max(0,(a-cw)/2)+326+40,y:15})}ii.refreshCenterPaneShadow()};window.onresize()};ii.Login=function(d,c,a){this.id=d;this.username=c;this.key=a;document.getElementById("ii_user_status_state").innerHTML='Hi <a href="#rel&item=ME.0&pane=">'+this.username+"</a>! | ";document.getElementById("ii_btn_logout").style.display="inline";document.getElementById("ii_btn_signup").style.display="none";document.getElementById("ii_btn_add").style.display="block";document.getElementById("ii_btn_myinbox").style.display="block";this.query=new ii.Query("user",{interval:10000},{id:d,fields:"full"});this.query.start();var b=this;this.query.addListener({addItem:function(e){b.item=e;e.createView("MyStatusState",{});b.setUnread()}});if(ii.tracker){ii.tracker._trackEvent("Session","Login",c)}};ii.Login.prototype.logout=function(){window.location="#rel&item=&tab=";ii.get("s-logout",function(a){ii.removeCookie("id");ii.removeCookie("username");ii.removeCookie("key");delete ii.login;ii.app.state.refresh()});delete this.key;document.getElementById("ii_user_status_state").innerHTML="";document.getElementById("ii_btn_logout").style.display="none";document.getElementById("ii_btn_signup").style.display="inline";document.getElementById("ii_btn_add").style.display="none";document.getElementById("ii_btn_myinbox").style.display="none";this.query.stop();ii.tracker._trackEvent("Session","Logout",this.username)};ii.Login.prototype.updateAvatars=function(){ii.log("Finding aatars to reload");for(var e=0;e<this.item.itemviews.length;e++){var b=this.item.itemviews[e];var d=b.div;if(!d&&b.details){d=b.details.form}if(!d){continue}var c=d.getElementsByTagName("img");for(var a=0;a<c.length;a++){if(/d-media/.test(c[a].src)){ii.log("Reloading avatar "+c[a].src);c[a].src+="&t="+Math.random()}}if(d.style.backgroundImage&&/d-media/.test(d.style.backgroundImage)){ii.log("Reloading background-img");d.style.backgroundImage=d.style.backgroundImage.replace(")","&t="+Math.random()+")")}}};ii.Login.prototype.setUnread=function(){var b=parseInt(this.item.unreadmsg)+parseInt(this.item.unreadcmt);ii.log("setting unread: "+b);var c=ii.views.unreadIndicator(b);c.id="ii_unread";var e=document.getElementById("ii_unread");e.parentNode.replaceChild(c,e);function d(j,f){var h=document.getElementById(j);if(h&&h.parentNode){var g=ii.views.unreadIndicator(f);g.id=j;h.parentNode.replaceChild(g,h)}}d("ii_unread_msg",this.item.unreadmsg);d("ii_unread_cmt",this.item.unreadcmt);d("ii_unread_msg2",this.item.unreadmsg);d("ii_unread_cmt2",this.item.unreadcmt);if(b>0){var a="favicon_notify.ico"}else{var a="favicon.ico"}document.getElementById("ii_favicon").innerHTML='<link rel="shortcut icon" href="'+a+'">'};ii.Login.isLoggedIn=function(){return ii.login};ii.Login.landingLoginBox=function(){var a=ii.elm("div",{style:{background:"white",left:"0px",padding:"15px 16px 35px",position:"absolute",top:"0px",width:"294px",zIndex:"999"}},ii.Login.loginBox({displayHeader:true,displayBorder:true,initOnSuccess:true}));return a};ii.Login.loginBox=function(m){var m=(m!==undefined?m:{});var h=ii.elm("p",{style:{color:"#FF0000",margin:"5px",position:"relative",textAlign:"center"}},"");var b=ii.elm("input",{name:"username",style:{width:"100%"}});var j=ii.elm("input",{name:"password",type:"password",style:{width:"100%"}});var c=ii.elm("input",{name:"remember_me",type:"checkbox"});var e=ii.elm("input",{type:"submit",value:"Log in",style:{margin:"0px",position:"absolute",right:"0px"}});var d="";if(m.displayHeader&&m.displayHeader!==false){d=ii.elm("h1",{style:{borderBottom:"solid 1px #b7b7b7",marginBottom:"20px",padding:"5px 0px"}},"Log in for bliin")}var f=ii.elm("form",{style:{display:"none",padding:"10px 25px",margin:"0px 0px 5px"},className:"forgotpassword",onsubmit:function(){if(!this.username.value&&!this.email.value){alert("Please enter your bliin-username or your email");return false}ii.get("p-new-password",function(o){},{username:this.username.value,email:this.email.value});alert("A new password has been send to your email address");g.style.display="";f.style.display="none";return false}},ii.elm("p","A new password will be generated and sent to your ","email address. Type your email address or your bliin-username"),ii.elm("p",ii.elm("label",{style:{cssFloat:"left",styleFloat:"left",display:"block",width:"50px"}},"username:"),ii.elm("input",{style:{width:"160px",margin:"0px 1em"},name:"username"})),ii.elm("p","... or ..."),ii.elm("p",ii.elm("label",{style:{cssFloat:"left",styleFloat:"left",display:"block",width:"50px"}},"email:"),ii.elm("input",{style:{width:"160px",margin:"0px 1em"},name:"email"})),ii.elm("input",{type:"submit",value:"Send",style:{cssFloat:"right",styleFloat:"right",margin:"0px 0px 1em 1em"}}),ii.elm("input",{type:"button",value:"Cancel",style:{cssFloat:"right",styleFloat:"right",margin:"0px 0px 1em 1em"},onclick:function(){g.style.display="";f.style.display="none"}}),ii.elm("div",{style:{clear:"both"}}));if(m.displayBorder&&m.displayBorder!==false){f.style.border="solid 1px #b7b7b7"}var g;var a=ii.elm("a",{href:"#rel",onclick:function(){g.style.display="none";f.style.display=""}},"Forgot Password?");g=ii.elm("div",{style:{margin:"0px 0px 5px",padding:"10px 25px 10px",position:"relative"}},ii.elm("div",{style:{left:"0px",position:"absolute",top:"0px",width:"100%"}},h),ii.elm("p",ii.elm("label",{style:{display:"block",width:"100%"}},"Username"),b),ii.elm("p",ii.elm("label",{style:{display:"block",width:"100%"}},"Password"),j),ii.elm("p",c,ii.elm("span","Remember Me")),ii.elm("p",{style:{position:"relative"}},a,f,e),ii.elm("p",{style:{padding:"5px 0px 0px"}},ii.elm("b","Need a login?"),ii.elm("br"),ii.elm("a",{href:"#rel&tab=Signup"},"Signup for an account ... it's free")));if(m.displayBorder&&m.displayBorder!==false){g.style.border="solid 1px #b7b7b7"}var l=ii.elm("form",{name:"ii_login_form"},d,g,f);l.onmousedown=function(o){ii.stopPropagation(o)};l.onsubmit=function(){ii.Login.doLogin(b.value,j.value,function(o){try{var p=document.createTextNode("");h.replaceChild(p,h.firstChild)}catch(q){}ii.login=o;if(c.checked){ii.setCookie("id",ii.login.id,365);ii.setCookie("username",ii.login.username,365);ii.setCookie("key",ii.login.key,365)}else{ii.setCookie("id",ii.login.id,0);ii.setCookie("username",ii.login.username,0);ii.setCookie("key",ii.login.key,0)}ii.removeLandingPage();if(m.initOnSuccess&&m.initOnSuccess!==false){ii.app.init();ii.app.state.setState({item:"ME.0"})}else{ii.app.state.refresh()}},function(o){var p=document.createTextNode(o);try{h.replaceChild(p,h.firstChild)}catch(q){h.appendChild(p)}});return false};return l};ii.Login.doLogin=function(g,b,e,f,d){if(!d){ii.get("s-getkey",function(h){ii.Login.doLogin(g,b,e,f,h)},{loginname:g})}else{if(d.tempkey){var c=MD5(b+d.tempkey);ii.get("s-login",function(h){ii.Login.doLogin(g,b,e,f,h)},{loginname:g,password:c})}else{if(d.loginresult=="OK"){var a=new ii.Login(d.id,g,d.key);e(a)}else{f(d.loginresult)}}}};ii.createClock=function(){var f=false;var b=ii.elm("span",":");var e=document.createTextNode("d1");var d=document.createTextNode("d2");function a(){f=!f;b.style.visibility=(f?"":"hidden")}window.setInterval(a,1000);function c(){var j=new Date();var l=j.getHours();var g=j.getMinutes();if(g<10){g="0"+g}e.data=j.format("longhumandate")+" "+l;d.data=g}window.setInterval(c,60000);c();return ii.elm("a",{id:"ii_clock",href:"#",onclick:function(){var g=document.getElementById("ii_landing_page")||false;if(g!==false){window.location="/"}else{if(ii.login){window.location="/"}else{window.location="#"}}}},ii.elm("span",{className:"clock"},e,b,d))};ii.set_map_smooth_panning=false;ii.set_expand_layerswitcher=true;ii.Map=function(A,q,m,a){var D=this;this.div=A;OpenLayers.ProxyHost="/v2/proxy.php?url=";var l={projection:new OpenLayers.Projection("EPSG:900913"),displayProjection:new OpenLayers.Projection("EPSG:4326"),units:"m",numZoomLevels:17,minZoomLevel:2,maxResolution:30000,maxExtent:new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),panMethod:OpenLayers.Easing.Linear.easeOut,panDuration:10,eventListeners:{moveend:function(){if(ii.browser.msie){for(var c in D.markerLayers){if("tripLines"===c){var L=D.markerLayers[c];ii.log("redrawing the vector feature layer");L.redraw()}}}}},theme:"lib/OpenLayers-2.7/theme/bliin/style.css"};var s=[];this.layers=s;this.map=new OpenLayers.Map(A,l);this.useTransform=true;if(window.ii_layer_Google){var p=new OpenLayers.Layer.Google("Google Streets",{sphericalMercator:true,numZoomLevels:16});var y=new OpenLayers.Layer.Google("Google Satellite",{type:G_SATELLITE_MAP,numZoomLevels:22,sphericalMercator:true});var K=new OpenLayers.Layer.Google("Google Hybrid",{type:G_HYBRID_MAP,sphericalMercator:true});var g=new OpenLayers.Layer.Google("Google Physical",{type:G_PHYSICAL_MAP,sphericalMercator:true,numZoomLevels:15});s.push(p,g,y,K)}if(window.ii_layer_VirtualEarth){var f=new OpenLayers.Layer.VirtualEarth("Virtual Earth Roads",{type:VEMapStyle.Road,sphericalMercator:true,minZoomLevel:4});var u=new OpenLayers.Layer.VirtualEarth("Virtual Earth Aerial",{type:VEMapStyle.Aerial,sphericalMercator:true});var x=new OpenLayers.Layer.VirtualEarth("Virtual Earth Hybrid",{type:VEMapStyle.Hybrid,sphericalMercator:true});s.push(f,x,u)}if(window.ii_layer_Yahoo){var d=new OpenLayers.Layer.Yahoo("Yahoo Street",{sphericalMercator:true});var B=new OpenLayers.Layer.Yahoo("Yahoo Satellite",{type:YAHOO_MAP_SAT,sphericalMercator:true});var b=new OpenLayers.Layer.Yahoo("Yahoo Hybrid",{type:YAHOO_MAP_HYB,sphericalMercator:true});s.push(d,B,b)}if(window.ii_layer_Basic){var H=new OpenLayers.Layer.WMS("MetaCarta","http://labs.metacarta.com/wms/vmap0?",{layers:"basic"});var h=new OpenLayers.Layer.WMS("NASA Global Mosaic","http://t1.hypercube.telascience.org/cgi-bin/landsat7",{layers:"landsat7"});s.push(H,h)}if(window.ii_layer_OpenStreetMap){var o=new OpenLayers.Layer.TMS("OpenStreetMap (Mapnik)","http://a.tile.openstreetmap.org/",{displayOutsideMaxExtent:true,type:"png",maxResolution:156543.0339,getURL:osm_getTileURL});var j=new OpenLayers.Layer.TMS("OpenStreetMap (Tiles@H)","http://tah.openstreetmap.org/Tiles/tile/",{type:"png",displayOutsideMaxExtent:true,maxResolution:156543.0339,getURL:osm_getTileURL});var J=new OpenLayers.Layer.TMS("OpenStreetMap (linx)","http://linx.bliin.com/tilecache.py/1.0.0/osm/",{type:"png",displayOutsideMaxExtent:true,maxResolution:156543.0339,getURL:osm_getTileURL});var v=new OpenLayers.Layer.TMS("Midnight Commander (CM)","http://b.tile.cloudmade.com/8570b5222df659f2997f5348f024408d/999/256/",{type:"png",displayOutsideMaxExtent:true,maxResolution:156543.0339,getURL:osm_getTileURL});var e=new OpenLayers.Layer.WMS("OpenAerialMap","http://openaerialmap.org/wms/",{layers:"world",format:"image/png"});s.push(o,j,J,v)}this.map.addLayers(s);this.addLowlandsLayer();var I=new OpenLayers.Control.ZoomPanel();this.map.addControl(I);var E=new OpenLayers.Control.LayerSwitcher({id:"layerSwitcher",activeColor:"white"});this.map.addControl(E);this.map.setBaseLayer(v);if(ii.set_expand_layerswitcher){E.maximizeControl()}this.map.setCenter(this.getLatLon(q||30,m||0),a||2);I.moveTo({x:380,y:44});var G=this.map.controls;this.map.removeControl(G[1]);var r={displayInLayerSwitcher:false};this.markerLayers={};this.markerLayers.shadows=new OpenLayers.Layer.Markers("Shadows",r);this.markerLayers.tripLines=new OpenLayers.Layer.Vector("Trip lines",r);this.markerLayers.poiThumbs=new OpenLayers.Layer.Markers("POI thumbs",r);this.markerLayers.userIcons=new OpenLayers.Layer.Markers("User icons",r);this.markerLayers.userPopups=new OpenLayers.Layer.Markers("User popups",r);this.markerLayers.tripIcons=new OpenLayers.Layer.Markers("Trip icons",r);this.markerLayers.tripPopups=new OpenLayers.Layer.Markers("Trip popups",r);this.markerLayers.poiPopups=new OpenLayers.Layer.Markers("POI popups",r);this.markerLayers.spotIcons=new OpenLayers.Layer.Markers("Spot icons",r);this.markerLayers.spotPopups=new OpenLayers.Layer.Markers("Spot popups",r);for(var C in this.markerLayers){this.map.addLayer(this.markerLayers[C])}this.map.curZoom=this.map.getZoom();E.div.style.top="44px";ii.Map.setLayerSwitcherStyling(E);var t=this;this.map.events.register("moveend",this.map,function(L){if(!ii.app){return}var c=ii.app.state.state.ll;if(!c){return}if(c=="items"){}else{t.updateExtend()}});this.div.onmousedown=function(){if(!window.ii_centeredItem){return}if(window.ii_automoving){return}t.unlockView()};this.map.events.register("changebaselayer",this.map,function(c){ii.setCookie("maplayer",t.map.baseLayer.name,365)});var F=ii.getCookieValue("maplayer");if(F){for(var C=0;C<this.map.layers.length;C++){if(this.map.layers[C].name==F){this.map.setBaseLayer(this.map.layers[C])}}}};ii.Map.prototype.unlockView=function(){var a=window.ii_centeredItem;window.ii_centeredItem=0;if(a&&a.div&&a.prevparent){a.prevparent.appendChild(a.div);a.div.style.position="absolute";document.getElementById("ii_movie_container").style.display="none"}if(window.ii_curvid_centerbtn){ii_curvid_centerbtn.src="/media/qik/center_map_up.gif"}};ii.Map.prototype.addLowlandsLayer=function(){var a=new OpenLayers.Layer.TMS("Lowlands","http://linx.bliin.com/lowlands/",{displayOutsideMaxExtent:true,type:"png",getURL:ll_getTileURL,numZoomLevels:22,maxZoomLevel:22,isBaseLayer:false,displayInLayerSwitcher:false});this.map.addLayer(a)};ii.Map.setLayerSwitcherStyling=function(j){var b=j.layersDiv;b.style.color="#b7b7b7";b.style.opacity="1";b.style.filter="alpha(opacity=100)";var f=j.div.getElementsByTagName("span");for(var c=0,g=f.length;c<g;c++){var h=f[c];if(h.style.backgroundColor=="white"){h.style.opacity="1";h.style.filter="alpha(opacity=100)"}}var a=b.getElementsByTagName("div")[0];a.innerHTML="Select Map Source";a.style.borderBottom="1px solid #b7b7b7";a.style.color="#707070";a.style.display="block";a.style.fontSize="12px";a.style.fontWeight="normal";a.style.paddingBottom="3px";a.style.textIndent="28px";var d=b.getElementsByTagName("div")[1];d.style.paddingLeft="0px"};ii.Map.prototype.updateExtend=function(){var b=this.map.getExtent();if(this.useTransform){b=b.transform(new OpenLayers.Projection("EPSG:900913"),new OpenLayers.Projection("EPSG:4326"))}var a=b.toArray();b.left+=(b.right-b.left)*0.4;b.top-=(b.top-b.bottom)*0.18;window.location="#rel&ll="+b.toBBOX().replace(/,/g,"x")};ii.Map.prototype.viewAll=function(b){var d=new OpenLayers.Bounds();var e=0;if(b){for(var e in b){d.extend(this.getLatLon(b[e].lat,b[e].lon));e++}}else{for(var e in this.markerLayers){d.extend(this.markerLayers[e].getDataExtent());e++}}if(e<=1){return}var a=(d.right-d.left);var c=(d.top-d.bottom);d.top+=c*0.2;d.bottom-=c*0.1;d.left-=a*0.67;d.right+=c*0.1;this.map.zoomToExtent(d)};ii.Map.prototype.addZoomListener=function(b,a){this.map.events.register("moveend",b,a)};ii.Map.prototype.removeZoomListener=function(b,a){this.map.events.unregister("moveend",b,a)};ii.Map.prototype.getZoom=function(){return this.map.getZoom()/this.map.getNumZoomLevels()};function osm_getTileURL(d){var c=this.map.getResolution();var a=Math.round((d.left-this.maxExtent.left)/(c*this.tileSize.w));var f=Math.round((this.maxExtent.top-d.top)/(c*this.tileSize.h));var e=this.map.getZoom();var b=Math.pow(2,e);if(f<0||f>=b){return OpenLayers.Util.getImagesLocation()+"404.png"}else{a=((a%b)+b)%b;return this.url+e+"/"+a+"/"+f+"."+this.type}}function ll_getTileURL(d){var c=this.map.getResolution();var a=Math.round((d.left-this.maxExtent.left)/(c*this.tileSize.w));var f=Math.round((this.maxExtent.top-d.top)/(c*this.tileSize.h));var e=this.map.getZoom();if(this.map.baseLayer.name.indexOf("OpenStreet")==-1){e+=2}var b=Math.pow(2,e);if(e<10||f<0||f>=b){return"http://linx.bliin.com/lowlands/blank.png"}else{a=((a%b)+b)%b;return this.url+e+"/"+a+"/"+f+"."+this.type}}ii.Map.prototype.getLatLon=function(b,c){var a=new OpenLayers.LonLat(c,b);if(this.useTransform){a=a.transform(new OpenLayers.Projection("EPSG:4326"),new OpenLayers.Projection("EPSG:900913"))}return a};ii.Map.prototype.setCenter=function(e,f,b,a){this.offsetx=0+b;this.offsety=0+a;var d=this.getLatLon(e,f);if(b||a){var c=this.map.getLayerPxFromLonLat(d);c.x-=b;c.y-=a;d=this.map.getLonLatFromLayerPx(c)}if(ii.set_map_smooth_panning){this.map.panTo(d)}else{this.map.setCenter(d)}};ii.Map.prototype.zoomTo=function(g,b,c,a){var f=this.map.getZoom();var d=(this.map.getNumZoomLevels())/4*3;var e=Math.min(this.map.getNumZoomLevels()-1,this.map.getZoom()+d);this.map.zoomTo(parseInt(e));var h=this.getLatLon(g,b);if(c||a){var j=this.map.getLayerPxFromLonLat(h);j.x-=c;j.y-=a;h=this.map.getLonLatFromLayerPx(j)}this.map.setCenter(h)};ii.Map.prototype.zoomToExtent=function(a,c){var d=this.getLatLon(a.lat,a.lon);var b=this.getLatLon(c.lat,c.lon);this.map.zoomToExtent(new OpenLayers.Bounds(d.lon,d.lat,b.lon,b.lat));this.map.zoomOut()};ii.Map.prototype.addMarker=function(g,c,d,e,a,f){var b=new OpenLayers.Marker.Div(this.map,this.getLatLon(d,e),g,new OpenLayers.Pixel(a,f));this.markerLayers[c].addMarker(b);return b};ii.Map.prototype.removeMarker=function(a,b){this.markerLayers[b].removeMarker(a)};ii.Map.prototype.moveView=function(a,b,c){if(a==window.ii_centeredItem){window.ii_automoving=1;this.setCenter(b,c,50,220);window.ii_automoving=0}else{this.moveMarker(a.marker,b,c);if(a.shadowMarker){this.moveMarker(a.shadowMarker,b,c)}}};ii.Map.prototype.moveMarker=function(a,b,c){a.moveToLonLat(this.getLatLon(b,c))};ii.Map.prototype.lockView=function(a){window.ii_centeredItem=a;a.prevparent=a.div.parentNode;document.getElementById("ii_movie_container").appendChild(a.div);document.getElementById("ii_movie_container").style.display="";a.div.style.position="static";if(window.ii_curvid_centerbtn){ii_curvid_centerbtn.src="/media/qik/center_map_down.gif"}};ii.Map.prototype.addItem=function(d,c){var a;if(d.type=="u"){var b={map:this};d.createView("Icon",b);a=d.createView("IconPopup",{map:this,alwaysVisible:c})}else{if(d.type=="p"){if(c){a=d.createView("Popup",{map:this})}else{a=d.createView("Thumb",{map:this})}}else{if(d.type=="t"){a=d.createView("Icon",{map:this});a=d.createView("IconPopup",{map:this,alwaysVisible:c});if(c){a=d.createView("LineString",{map:this})}}else{if(d.type=="s"){a=d.createView("Icon",{map:this});a=d.createView("IconPopup",{map:this,alwaysVisible:c})}}}}if(c&&d.type=="p"){this.zoomTo(d.lat,d.lon,50,220);if(d.kind=="video"||d.kind=="stream"){this.lockView(a)}}else{if(c&&d.type!="g"){this.zoomTo(d.lat,d.lon,50,0)}}return a};ii.Map.prototype.addLineString=function(e,b){if(e.length<2){return 0}var d={strokeColor:"#FF9900",strokeWidth:3};var g=[];for(var h=0;h<e.length;h++){var f=this.getLatLon(parseFloat(e[h].lat),parseFloat(e[h].lon));f=new OpenLayers.Geometry.Point(f.lon,f.lat);g.push(f)}var a=new OpenLayers.Geometry.LineString(g);var c=new OpenLayers.Feature.Vector(a,null,d);this.markerLayers[b].addFeatures([c]);return c};ii.Map.prototype.removeLineString=function(b,a){this.markerLayers[a].destroyFeatures([b])};ii.Map.Minimap=function(g){var o=this;this.selectedLat=0;this.selectedLon=0;var p=g.target;var d=g.tabname;var q=g.onclick||function(){};p.innerHTML="";ii.get("t-geoip",function(r){if(r.lookupresult=="OK"){if(o.selectedLat==0&&o.selectedLon==0){o.map.setCenter(new OpenLayers.LonLat(r.lon,r.lat),5);if(!g.needclick){o.selectedLat=r.lat;o.selectedLon=r.lon}}}});var b=new OpenLayers.Control.ZoomPanel();this.map=new OpenLayers.Map(p,{controls:[new OpenLayers.Control.Navigation(),b,new OpenLayers.Control.ArgParser(),new OpenLayers.Control.Attribution()],theme:"lib/OpenLayers-2.7/theme/bliin/style.css"});var l=[];var c=new OpenLayers.Layer.Google("Google Streets");var f=new OpenLayers.Layer.Google("Google Satellite",{type:G_SATELLITE_MAP,numZoomLevels:22});var h=new OpenLayers.Layer.Google("Google Hybrid",{type:G_HYBRID_MAP});var a=new OpenLayers.Layer.Google("Google Physical",{type:G_PHYSICAL_MAP});l.push(c,a,f,h);this.markerLayer=new OpenLayers.Layer.Markers("",{displayInLayerSwitcher:false});var j=0;o.map.addLayers(l);o.map.addControl(b);o.map.addLayer(this.markerLayer);b.moveTo({x:10,y:10});var m=new OpenLayers.Control.LayerSwitcher({id:"layerSwitcher",activeColor:"white"});this.map.addControl(m);m.div.style.top="10px";ii.Map.setLayerSwitcherStyling(m);o.map.setCenter(new OpenLayers.LonLat(4,20),1);o.map.events.register("click",o.map,function(s){var r=o.map.getLonLatFromPixel(s.xy);o.moveMarker(r.lat,r.lon);q()});var e=window.setInterval(function(){if(ii.app.state.state.tab!=d){ii.log("tab: "+ii.app.state.state.tab+" != "+d);window.clearInterval(e);ii.log("ending map");o.map=0}else{o.map.updateSize()}},500)};ii.Map.Minimap.prototype.setCenter=function(a,b){this.map.setCenter(new OpenLayers.LonLat(b,a),13);this.moveMarker(a,b)};ii.Map.Minimap.prototype.moveMarker=function(c,e){if(this.marker){this.markerLayer.removeMarker(this.marker);this.marker.destroy()}var a=new OpenLayers.Size(79,58);var d=new OpenLayers.Pixel(-22,-55);var b=new OpenLayers.Icon("media/spot_add_marker.png",a,d);this.marker=new OpenLayers.Marker(new OpenLayers.LonLat(e,c),b);this.markerLayer.addMarker(this.marker);this.selectedLat=c;this.selectedLon=e;ii.log("moved to "+c+"x"+e)};OpenLayers.Marker.Div=OpenLayers.Class(OpenLayers.Marker,{div:null,initialize:function(b,a,d,c){this.map=b;this.lonlat=a;this.div=d;this.events=new OpenLayers.Events(this,this.div,null);this.offset=c||new OpenLayers.Pixel(0,0)},destroy:function(){OpenLayers.Marker.prototype.destroy.apply(this,arguments);this.div=null},moveToLonLat:function(a){this.lonlat=a;this.px=this.map.getLayerPxFromLonLat(a);if(this.div!=null){this.div.style.left=this.px.x+this.offset.x+"px";this.div.style.top=this.px.y+this.offset.y+"px"}},draw:function(a,b){this.div.style.left=a.x+this.offset.x+"px";this.div.style.top=a.y+this.offset.y+"px";return this.div},onScreen:function(){var b=false;if(this.map){var a=this.map.getExtent();b=a.containsBounds(this.bounds,true,true)}return b},display:function(a){this.div.style.display=(a)?"":"none"},CLASS_NAME:"OpenLayers.Marker.Div"});ii.set_interval_factor=1;ii.set_interval_default=6000;ii.set_full_refresh=150;ii.Query=function(b,c,a){this.type=b;this.items={};this.queryOpts={};this.fullrefresh=0;this.paused=((c.paused!=undefined)?c.paused:1);this.interval=c.interval||ii.set_interval_default;this.url=c.url||("q-items-"+b);this.listeners=[];this.setQueryOpts(a)};ii.Query.prototype.addListener=function(a){for(var b in this.items){if(a.addItem){a.addItem(this.items[b])}}if(this.count&&a.itemsDone){a.itemsDone(this.items)}this.listeners.push(a)};ii.Query.prototype.updateAll=function(){for(var a in this.items){this.items[a].update(this.items[a])}};ii.Query.prototype.stop=function(){for(id in this.items){this.items[id].remove();delete this.items[id]}this.queryOpts.lastmodified=0;this.pauseUpdate(1)};ii.Query.prototype.start=function(){for(id in this.items){this.items[id].remove();delete this.items[id]}this.queryOpts.lastmodified=0;this.pauseUpdate(0)};ii.Query.prototype.setQueryOpts=function(a){if(a){for(var b in a){if(!a[b]&&this.queryOpts[b]){delete this.queryOpts[b]}else{if(a[b]){this.queryOpts[b]=a[b]}}}delete this.count}this.queryOpts.lastmodified=0;if(this.pollTimer){window.clearTimeout(this.pollTimer);this.pollTimer=0}if(!this.paused){this.doDelayedUpdate()}};ii.Query.prototype.pauseUpdate=function(a){this.paused=a;if(this.pollTimer){window.clearTimeout(this.pollTimer);this.pollTimer=0}if(!this.paused){this.doDelayedUpdate()}};ii.Query.prototype.doDelayedUpdate=function(){if(this.queryOpts.count==0){var a=Math.random()*500+500}else{var a=Math.random()*300+0}var b=this;this.pollTimer=window.setTimeout(function(){b.doUpdate()},a)};ii.Query.prototype.doUpdate=function(d){if(this.paused){return}var g=this;if(this.pollTimer){window.clearTimeout(this.pollTimer);this.pollTimer=0}if(!d){if(this.request){this.request.abort()}if(this.queryOpts.lat1&&this.queryOpts.lastmodified){delete this.queryOpts.lastmodified}this.request=ii.get(this.url,function(l){g.doUpdate(l)},this.queryOpts);return}if(d.result=="NM"){if(this.interval){this.pollTimer=window.setTimeout(function(){g.doUpdate()},this.interval*ii.set_interval_factor)}return}if(d.result=="ERR"){ii.log("ERR - "+d.msg+" : "+d.dbmsg);ii.log("Last Query: "+d.lastsql.replace(/\t/," "));return}if(d.items===undefined){ii.log("No Items - "+d.result+" - "+d.msg);return}var j=(++this.fullrefresh%ii.set_full_refresh==0);this.queryOpts.lastmodified=0;var e={};for(var b=0;b<d.items.length;b++){var a=d.items[b].id;ii.assert(a);e[a]=1;if(d.items[b].modified>this.queryOpts.lastmodified){this.queryOpts.lastmodified=d.items[b].modified}if(this.items[a]){if(this.items[a].modified<d.items[b].modified||j){this.items[a].update(d.items[b]);ii.log("retieveData; updated:"+a)}}else{d.items[b].type=ii.typeletter[this.type];var h=ii.typector[d.items[b].type];if(!ii.items[h]){ii.log(h+"doesnt exist")}var f=new ii.items[h](d.items[b]);this.items[a]=f;for(var c=0;c<this.listeners.length;c++){if(this.listeners[c].addItem){this.listeners[c].addItem(f)}}}}for(a in this.items){if(!e[a]){this.items[a].remove();delete this.items[a]}}for(var c=0;c<this.listeners.length;c++){if(d.count!==this.count&&this.listeners[c].countItems){this.listeners[c].countItems(this.queryOpts.start||0,d.items.length,d.count,this.queryOpts.count||5,this.type)}if(!this.firstTimeDone&&this.listeners[c].itemsDone){this.listeners[c].itemsDone(this.items)}}this.count=d.count;this.firstTimeDone=true;if(this.interval){this.pollTimer=window.setTimeout(function(){g.doUpdate()},this.interval*ii.set_interval_factor)}};ii.set_interval_map_photos=10000;ii.set_interval_map_users=6000;ii.set_interval_largeitem=10000;ii.set_interval_world_groups=15000;ii.set_interval_world_people=15000;ii.set_interval_world_photos=15000;ii.set_interval_world_spots=15000;ii.set_interval_world_trips=15000;ii.Pane=function(a,b){ii.startWait();this.div=ii.elm("div",{className:"pane"});this.queries=[];this.queriesDone=0;this.prevPane=a;if(a&&!a.isFirst){this.direction=(b?"left":"right")}if(a){a.pause()}};ii.Pane.prototype.addItem=function(b,g,f){if(ii.login&&b=="user"&&ii.login.id==g){ii.app.state.setState({item:"ME.0"});return}if(ii.login&&ii.login.item){ii.login.item.showPopup(false)}var e=new ii.Query(b,{interval:ii.set_interval_largeitem},{id:g,fields:"full"});var c=this;this.itemQuery=e;var d={addItem:function(h){c.item=h;ii.last_active_itemname=h.name;ii.setDefaultText(ii.app.searchBox,"Search within '"+h.name+"'");ii.app.statusDisplay.reset(b,h.name);if(h.type!="g"||h.id!=1){c.itemView=h.createView("LargeListItem")}var j={onDone:function(){c.replacePane()},pane:f.pane,page:f.page,map:ii.app.map};if((!f.pane||f.pane=="")&&ii.views[b].ItemCounter){c.browserView=h.createView("ItemCounter",j)}else{c.browserView=h.createView("ItemBrowser",j)}ii.app.map.addItem(h,true);c.div.appendChild(c.itemView.div);c.div.appendChild(c.browserView.div);for(var l=0;l<c.browserView.subItemsets.length;l++){c.queries.push(c.browserView.subItemsets[l])}},itemsDone:function(){if(c.item){return}ii.log("items done:"+c.item);c.div.appendChild(ii.elm("p",{className:"results"},"This ",ii.typesingle[ii.typeletter[b]]," no longer exists or its privacy is restricted for you.",ii.elm("p",ii.elm("a",{href:"javascript:history.back();"},"Go back "))));c.replacePane()}};e.addListener(d);e.start();this.queries.push(e);var a=ii.typesingle[ii.typeletter[b]];ii.setText(document.getElementById("ii_active_item_label"),a)};ii.Pane.prototype.addLoginBox=function(){ii.app.statusDisplay.reset();var a=ii.Login.loginBox();this.div.appendChild(a);this.replacePane();a.username.focus();ii.setText(document.getElementById("ii_active_item_label"),"Me")};ii.Pane.prototype.switchItemPane=function(b){ii.startWait();var a=this;var c=this.browserView;function f(){a.replaceDiv(c.div,a.browserView.div,a.direction,function(){ii.stopWait();a.item.removeView(c)})}ii.app.statusDisplay.reset(ii.typename[this.item.type],this.item.name);var d={onDone:f,pane:b.pane,page:b.page,map:ii.app.map};if((!b.pane||b.pane=="")&&ii.views[ii.typename[this.item.type]].ItemCounter){this.browserView=this.item.createView("ItemCounter",d)}else{this.browserView=this.item.createView("ItemBrowser",d)}for(var e=0;e<this.browserView.subItemsets.length;e++){this.queries.push(this.browserView.subItemsets[e])}};ii.Pane.prototype.addBrowser=function(c){if(ii.login&&ii.login.item){ii.login.item.showPopup(false)}if(c.query){var r="Search Results"}else{if(!c.pane){var r="World"}else{var r=ii.typeplural[ii.typeletter[c.pane]]}}ii.setText(document.getElementById("ii_active_item_label"),r);var b=ii.elm("div",{style:{backgroundColor:"white"}});var h=[];var g=[];c.pane=c.pane||"";ii.app.statusDisplay.reset();if(!c.query){ii.setDefaultText(ii.app.searchBox,"Search within World")}var f={};if(c.query){f.query=c.query}if(c.item=="ME.0"){f.user=ii.login.id}else{if(c.item){var p=c.item.split(".")[0];var q=c.item.split(".")[1];f[ii.typename[p]]=q}}f.count=10;if(!c.pane){var m=this;var o=new ii.Query("group",{url:"q-items-count",interval:0},f);o.addListener({addItem:function(v){if(c.query){if(c.item=="ME.0"){var u=" within Me"}else{if(c.item){var u=" within '"+ii.last_active_itemname+"'"}else{var u=" within World"}}m.div.appendChild(ii.elm("p",{className:"results"},c.query,ii.elm("small",u)));if(v.total==0){m.div.appendChild(ii.elm("p",{className:"results"},"No results"))}else{m.div.appendChild(ii.elm("p",{className:"results"},""+v.total," results"))}if(v.total==0&&c.item){m.div.appendChild(ii.elm("p",{className:"results"},ii.elm("a",{href:"#item=&query="+c.query},"Search ",c.query," Worldwide")))}}var t=v.createView("WorldCounter");m.div.appendChild(t.div);m.replacePane()}});o.start();this.queries.push(o);f.fields="basic,count";var l=new ii.Query("user",{interval:ii.set_interval_map_users,paused:false},f);var j=new ii.Query("poi",{interval:ii.set_interval_map_photos,paused:false},f);l.addListener(ii.app.map);j.addListener(ii.app.map);this.queries.push(l);this.queries.push(j);ii.log("adding listeners");j.addListener(ii.app.statusDisplay);l.addListener(ii.app.statusDisplay);return}f.fields="count,basic";if(c.pane=="user"){g.push(new ii.views.ItemBrowser({id:"user",label:(c.pane==""?"People":""),query:new ii.Query("user",{interval:ii.set_interval_world_people},f),type:"user"},c))}else{if(c.pane=="poi"){g.push(new ii.views.ItemBrowser({id:"poi",label:(c.pane==""?"Photos":""),query:new ii.Query("poi",{interval:ii.set_interval_world_photos},f),type:"poi"},c))}else{if(c.pane=="trip"){g.push(new ii.views.ItemBrowser({id:"trip",label:(c.pane==""?"Trips":""),query:new ii.Query("trip",{interval:ii.set_interval_world_trips},f),type:"trip"},c))}else{if(c.pane=="spot"){g.push(new ii.views.ItemBrowser({id:"spot",label:(c.pane==""?"Spots":""),query:new ii.Query("spot",{interval:ii.set_interval_world_spots},f),type:"spot"},c))}else{if(c.pane=="group"){g.push(new ii.views.ItemBrowser({id:"group",label:(c.pane==""?"Groups":""),query:new ii.Query("group",{interval:ii.set_interval_world_groups},f),type:"group"},c))}}}}}for(var e=0;e<g.length;e++){this.div.appendChild(g[e].div);h.push(g[e].query);g[e].query.addListener(ii.app.map);this.queries.push(g[e].query);g[e].query.start();if(c.pane==g[e].query.type){g[e].query.addListener(ii.app.statusDisplay)}}var a=this.queries.length;var m=this;function d(u,t,s){if(!--a){m.replacePane()}}for(var e=0;e<this.queries.length;e++){this.queries[e].addListener({itemsDone:d})}return};ii.Pane.prototype.addWelcome=function(d){var c=ii.login.query;this.itemQuery=c;ii.setDefaultText(ii.app.searchBox,"Search within Me");var a=this;var b={addItem:function(e){ii.app.statusDisplay.reset("ME");a.item=e;a.itemView=e.createView("MyWelcomeBox");var f={onDone:function(){a.replacePane()},pane:d.pane,page:d.page,map:ii.app.map};if(!d.pane||d.pane==""){a.browserView=e.createView("MyItemCounter",f)}else{a.browserView=e.createView("MyItemBrowser",f)}var h=(!d.pane||d.pane=="");if(!ii.login.item){ii.login.item=e}if(!ii.login.icon){ii.login.icon=ii.app.map.addItem(e,true);document.getElementById("ii_btn_home").onmouseover=function(){if(ii.login){ii.login.item.onmouseover()}};document.getElementById("ii_btn_home").onmouseout=function(){if(ii.login){ii.login.item.onmouseout()}}}ii.login.item.showPopup(h);a.div.appendChild(a.itemView.div);a.div.appendChild(a.browserView.div);for(var g=0;g<a.browserView.subItemsets.length;g++){a.queries.push(a.browserView.subItemsets[g])}}};c.addListener(b);ii.setText(document.getElementById("ii_active_item_label"),"Me")};ii.Pane.prototype.switchMyItemPane=function(b){ii.startWait();var a=this;var c=this.browserView;function f(){a.replaceDiv(c.div,a.browserView.div,a.direction,function(){ii.stopWait();a.item.removeView(c)})}ii.app.statusDisplay.reset("ME");if(!b.pane||b.pane==""){this.browserView=this.item.createView("MyItemCounter",{onDone:f,map:ii.app.map,pane:b.pane,page:b.page});var e=true}else{this.browserView=this.item.createView("MyItemBrowser",{onDone:f,map:ii.app.map,pane:b.pane,page:b.page});var e=false}if(ii.login.item){ii.login.item.showPopup(e)}for(var d=0;d<this.browserView.subItemsets.length;d++){this.queries.push(this.browserView.subItemsets[d])}};ii.Pane.prototype.replacePane=function(){var a=this;function b(){ii.refreshCenterPaneShadow();ii.stopWait();a.prevPane.stop()}this.replaceDiv(this.prevPane.div,this.div,this.direction,b)};ii.Pane.prototype.replaceDiv=function(a,b,d,e){var c=a.parentNode;c.removeChild(a);c.appendChild(b);if(e){e()}return};ii.Pane.prototype.pause=function(){for(var a=0;a<this.queries.length;a++){this.queries[a].pauseUpdate(1)}if(this.scrollTimer){window.clearTimeout(this.scrollTimer)}if(!this.div.parentNode&&this.prevPane){this.prevPane.div.parentNode.appendChild(this.div)}if(this.prevPane){this.prevPane.stop();if(this.prevPane.div.parentNode){this.prevPane.div.parentNode.removeChild(this.prevPane.div)}}};ii.Pane.prototype.stop=function(){for(var a=0;a<this.queries.length;a++){this.queries[a].stop()}};ii.set_absolute_url_delay=400;ii.set_state_polling_interval=150;ii.State=function(){};ii.State.prototype.init=function(){this.seq=Math.random();this.state={};this.hash={};this.history=new History();this.history_nav=false;var a=this;if(ii.browser.msie){var b=document.createElement("iframe");b.id="ii-state-frame";b.style.display="none";document.body.appendChild(b);this.writeFrame("");if("onpropertychange" in document&&"attachEvent" in document){document.attachEvent("onpropertychange",function(){if(event.propertyName=="location"){a.check()}})}}window.setInterval(function(){a.check()},ii.set_state_polling_interval)};ii.State.prototype.check=function(){var a=document.location.hash;if(a!=this.hash){this.changeHash(a)}};ii.State.prototype.getHash=function(){return document.location.hash};ii.State.prototype.writeFrame=function(a){var b=document.getElementById("ii-state-frame");var c=b.contentDocument||b.contentWindow.document;c.open();c.write("<script>window._hash = '"+a+"'; window.onload = parent.ii.app.state.syncHash;<\/script>");c.close()};ii.State.prototype.syncHash=function(){var a=this._hash;if(a!=document.location.hash){document.location.hash=a}};ii.State.prototype.updateAbsoluteLocation=function(c,b){if(this.updateLocTimer){window.clearTimeout(this.updateLocTimer)}var a=this;this.updateLocTimer=window.setTimeout(function(){a.hash=c;if(b){window.location.replace(a.hash)}else{window.location=a.hash}},ii.set_absolute_url_delay)};ii.State.prototype.setAutoStates=function(a){if(a.ll=="map"&&this.state.item){a.item=""}if(a.item!=undefined&&a.pane==undefined){a.pane=""}if(a.query!=undefined||a.pane!=undefined){a.page="";a.tab="";a.tpage=""}if(a.query!=undefined&&a.query!=""){a.pane=""}if(a.item!=undefined){a.query=""}if(a.item!=undefined&&a.item!=""){a.ll=""}if(a.ll!=undefined&&a.ll!="map"){a.page=""}if(a.tab!=undefined){a.subtab=""}if(a.q==undefined&&a.tab!=undefined){a.q=""}if(a.subtab!=undefined){a.tpage=""}};ii.State.prototype.setState=function(b,d){var f={};this.setAutoStates(b);var c=this.createHash(b);this.updateAbsoluteLocation(c,d);for(var e in b){var a=(this.state[e]?this.state[e]:"");if(a!=b[e]){this.state[e]=b[e];f[e]=b[e]}}for(var e in f){ii.app.applyState(this.state,f);break}this.add_location_to_history(f,c)};ii.State.prototype.createHash=function(a){var d={};for(var b in this.state){d[b]=this.state[b]}for(var b in a){d[b]=a[b]}var c="#";for(n in d){if(d[n]){c+=encodeURIComponent(n)+"="+encodeURIComponent(d[n])+"&"}}if(c.length>1){return c.substr(0,c.length-1)}else{return"#"}};ii.State.prototype.changeHash=function(h){this.hash=h;var a={};var d=h.substr(1).split("&");for(var b=0;b<d.length;b++){var j=d[b].split("=");if(j.length==2){a[j[0]]=j[1]}else{if(j.length==1&&j[0]=="rel"){a[j[0]]=1}}}if(a.rel){delete a.rel;this.setState(a,true);return}var e={};for(var b in this.state){var f="";for(var c in a){if(b==c){f=a[c];break}}if(this.state[b]!=f){e[b]=f}}for(var b in a){var g=0;for(var c in this.state){if(b==c){g=1;break}}if(!g){e[b]=a[b]}}this.state=a;for(var b in e){ii.app.applyState(this.state,e);break}this.add_location_to_history(e,this.createHash(a))};ii.State.prototype.refresh=function(b){if(!b){var a=this.state}else{var a={};a[b]=this.state[b]}ii.app.applyState(this.state,a)};ii.State.prototype.add_location_to_history=function(b,a){if(this.history_nav===false&&(b.item!==undefined||b.query!==undefined||b.pane!==undefined||b.page!==undefined)){this.history.append(a)}this.history_nav=false};ii.State.prototype.next=function(){this.history_nav=true;var a=this.history.get_next_location();if("string"==typeof a&&""!==a&&a!==this.hash.toString()){window.location=a}};ii.State.prototype.next_onmouseover=function(a){if(this.history.get_current_index()<this.history.length()-1){a.src="media/arrow_rightX.png"}};ii.State.prototype.prev=function(){this.history_nav=true;var a=this.history.get_prev_location();if("string"==typeof a&&""!==a&&a!==this.hash.toString()){window.location=a}};ii.State.prototype.prev_onmouseover=function(a){if(this.history.get_current_index()>0){a.src="media/arrow_leftX.png"}};History=function(){this.queue=[];this.current_index=this.queue.length-1};History.prototype={append:function(a){if(this.queue.length==0&&a==""){return}while(this.current_index>-1&&this.current_index<this.queue.length-1){var b=this.queue.pop()}this.queue.push(a);this.current_index=this.queue.length-1;return this},get_current_index:function(){return this.current_index},get_location_at_index:function(b){var a=null;try{a=this.queue[b]}catch(c){}return a},get_next_location:function(){var a=this.queue[this.queue.length-1]||"";if(this.current_index<0&&this.queue.length>0){this.current_index=0;a=this.queue[this.current_index]}else{if(this.current_index<this.queue.length-1){this.current_index=this.current_index+1;a=this.queue[this.current_index]}}return a},get_prev_location:function(){var a=this.queue[0]||"";if(this.current_index>this.queue.length-1){this.current_index=this.queue.length-1;a=this.queue[this.current_index]}else{if(this.current_index>0){this.current_index=this.current_index-1;a=this.queue[this.current_index]}}return a},get_queue:function(){return this.queue},length:function(){return this.queue.length},replace:function(b,a){this.queue.splice(b,1,a)},toString:function(){var c=[];c.push("current_index="+this.current_index+"\n");for(var a=0,b=this.queue.length;a<b;a++){c.push("queue["+a+"]="+this.queue[a]+"\n")}return c.join("")}};ii.tabs={};ii.tabs.loadedFromServer={Add:true,AddPhoto:true,AddAlbum:true,AddSpot:true,AddGroup:true,DetailsUser:true,DetailsUserSettings:true,DetailsPoi:true,DetailsTrip:true,DetailsAlbum:true,DetailsGroup:true,DetailsSpot:true,Download:true,DownloadHandsetHelp:true,DownloadScreencasts:true,DownloadDesktopHelp:true,About:true,AboutHistory:true,AboutEnterprise:true,AboutContact:true,AboutManagement:true,AboutPeople:true,AboutPrivacy:true,AboutPress:true,AboutTos:true,Signup:true,Signup2:true,Signup3:true,Signup4:true,Signup5:true,Help:true,HelpFAQ:true,HelpChangelog:true,HelpScreencasts:true,HelpTools:true,HelpPromos:true};ii.tabs.dynamicData={DetailsUser:true,DetailsUserSettings:true,DetailsPoi:true,DetailsTrip:true,DetailsAlbum:true,DetailsGroup:true,DetailsSpot:true,Feed:true,MyInbox:true,MyInboxComments:true,AddPhoto:true,AddAlbum:true,AddSpot:true,AddGroup:true};ii.tabs.feed={subtab_entities:{All:"all",People:"user",Photos:"poi",Trips:"trip",Comments:"comment",Spots:"spot",Groups:"group",Albums:"album"},subtab_labels:{all:"All",user:"People",poi:"Photos",trip:"Trips",comment:"Comments",spot:"Spots",group:"Groups",album:"Albums"}};ii.tabs.cleanup=function(){if(ii.app.currentTabView){if(ii.app.currentTabView.item){ii.app.currentTabView.item.removeView(ii.app.currentTabView)}else{if(ii.app.currentTabView.remove){ii.app.currentTabView.remove()}}ii.app.currentTabView=0}};ii.tabs.initTab=function(h,f){ii.tabs.cleanup();var b;if(h=="Details"){h+=ii.typector[ii.typeletter[f.itemQuery.type]]}var e=document.getElementById("ii_centerpane");for(var g in e.childNodes){var d=e.childNodes[g];if(d.nodeType!=1){continue}var a=d.id.substr("ii_centerpane_".length);if(a==h){b=d}else{d.style.display="none"}}document.getElementById("ii_centerpane_throbber").style.display="block";if(!b){var b=ii.elm("div",{id:"ii_centerpane_"+h});b.style.display="none";e.appendChild(b);if(ii.tabs.loadedFromServer[h]){ii.getHtml(h,b,c)}else{c(b)}}else{c(b)}function c(p){if(h.indexOf(ii.app.state.state.tab)<0){var u=document.getElementById("ii_centerpane_"+h);u.parentNode.removeChild(u);return}if(ii.tabs["init_"+h]){ii.tabs["init_"+h]()}if(ii.tabs.dynamicData[h]){if("Feed"==h){var m=ii.app.state.state.pane||"";var r=ii.app.state.state.subtab||"";var s=ii.app.state.state.item||"";var l=(ii.app.state.state.tpage)?(ii.app.state.state.tpage-1)*10:0;var v=new ii.views.FeedBrowser({},{pane:m,subtab:r,item:s,start:l},{show_friends_checkbox:false,show_search:false,show_header:true,show_tabs:true});if(f.feed_browser){f.feed_browser.feed_query.stop()}f.feed_browser=v;f.queries.push(v.feed_query);try{b.replaceChild(v.feed_div,b.firstChild)}catch(q){b.appendChild(v.feed_div)}}else{var o="Tab"+h;ii.log(o);var j={addItem:function(t){ii.app.currentTabView=t.createView(o,{tabElm:b})}};if(h.indexOf("Add")>=0||h.indexOf("Inbox")>=0){ii.login.query.addListener(j)}else{f.itemQuery.addListener(j)}}}document.getElementById("ii_centerpane_throbber").style.display="none";b.style.display="block";ii.refreshCenterPaneShadow()}ii.app.currentTab=b;return b};ii.tabs.init_HelpFAQ=function(){if(ii.app.state.state.q){var c=document.getElementById("ii_help_FAQ").getElementsByTagName("a");for(var d=0;d<c.length;d++){if(c[d].name=="rel&q="+ii.app.state.state.q){var b=c[d];window.setTimeout(function(){ii.log("scrolling into view:");ii.log(b);b.scrollIntoView()},100)}}}};ii.tabs.init_Signup=function(){window.ii_signup_params={};var b=document.getElementById("ii_signup1_driver");b.innerHTML="";b.appendChild(ii.loadDriver("Signup1"));var a=document.getElementById("ii_centerpane_static_Signup");a.onsubmit=function(){ii.startWaitButton(this.save);var c={username:a.username.value,password:a.password.value,captcha:a.captcha.value,email:a.email.value,mobile:a.cellphone.value,sex:a.sex.value,tryonly:true};if(a.birthyear.value>0&&a.birthmonth.value>0&&a.birthday.value>0){c.birthday=a.birthyear.value.concat("-",a.birthmonth.value,"-",a.birthday.value)}window.ii_signup_params=c;var e=a.getElementsByTagName("div");for(var f=0;f<e.length;f++){ii.log("found div with class: "+e[f].className);if(e[f].className.match("error")){e[f].parentNode.removeChild(e[f])}}if(a.password.value!=a.retypepassword.value){var d=ii.elm("div",{className:"error"},"passwords don't match");a.retypepassword.parentNode.appendChild(d);return false}ii.get("s-signup",function(j){ii.endWaitButton(a.save);if(j.signupresult!="OK"){var h;if(j.target){h=a[j.target]}if(!h){h=a.captcha}var g=ii.elm("div",{className:"error"},j.signupresult);a[j.target].parentNode.appendChild(g);ii.log(j.signupresult)}else{window.location="#rel&tab=Signup2"}},c);return false}};ii.tabs.init_Signup2=function(){var d=document.getElementById("ii_signup_networks");d.innerHTML="";var b=ii.views.networkEdit([]);d.appendChild(b);var c=document.getElementById("ii_signup2_driver");c.innerHTML="";c.appendChild(ii.loadDriver("Signup2"));var a=document.getElementById("ii_centerpane_static_Signup2");a.skip.onclick=function(){window.location="#rel&tab=Signup3"};a.save.onclick=function(){ii.startWaitButton(this);var j=ii.iframeDocument(document.getElementById("ii_signup_upload_frame"));try{j.innerHTML=""}catch(h){}function f(){ii.endWaitButton(g.save);var m=ii.iframeDocument(document.getElementById("ii_signup_upload_frame"));if(!m.innerHTML.match('"result"')){if(ii.app.state.state.tab=="Signup2"){window.setTimeout(f,250)}}else{var l=/"mediaid":(\d+)/;var e=l.exec(m.innerHTML);if(e){window.ii_signup_params.mediaid=0+e[1]}window.location="#rel&tab=Signup3"}}var g=document.getElementById("ii_centerpane_static_Signup2");window.ii_signup_params.fullname=g.fullname.value;window.ii_signup_params.message=g.msgbox.value;window.ii_signup_params.website=g.website.value;window.ii_signup_params.homecountry=g.homecountry.value;window.ii_signup_params.homecity=g.homecity.value;window.ii_signup_params.networks=ii.views.networksGet(b);f()}};ii.tabs.init_Signup3=function(){var b=document.getElementById("ii_signup3_driver");b.innerHTML="";b.appendChild(ii.loadDriver("Signup3"));var a=document.getElementById("ii_centerpane_static_Signup3");a.onsubmit=function(){window.location="#rel&tab=Signup4";return false};a.save.onclick=function(){if(a.privacy[0].checked){window.ii_signup_params.visibility="public"}if(a.privacy[1].checked){window.ii_signup_params.visibility="friends"}if(a.privacy[2].checked){window.ii_signup_params.visibility="private"}}};ii.tabs.clear_Signup=function(){var a=document.getElementById("ii_centerpane_static_Signup");ii.getElmByName(a,"username").value="";ii.getElmByName(a,"password").value="";ii.getElmByName(a,"retypepassword").value="";ii.getElmByName(a,"captcha").value="";ii.getElmByName(a,"email").value="";ii.getElmByName(a,"cellphone").value="";ii.getElmByName(a,"sex").value=0;ii.getElmByName(a,"birthday").value=0;ii.getElmByName(a,"birthmonth").value=0;ii.getElmByName(a,"birthyear").value=0;var a=document.getElementById("ii_centerpane_static_Signup2");ii.getElmByName(a,"fullname").value="";ii.getElmByName(a,"msgbox").value="";ii.getElmByName(a,"website").value="";ii.getElmByName(a,"homecountry").value="";ii.getElmByName(a,"homecity").value=""};ii.tabs.init_Signup4=function(){var e=document.getElementById("ii_signup4_driver");e.innerHTML="";e.appendChild(ii.loadDriver("Signup4"));var a=0;var d=new ii.Map.Minimap({target:document.getElementById("ii_signup_clickmap_cont"),tabname:"Signup4",onclick:g});var c=document.getElementById("ii_signup_locateme");if(!navigator.geolocation){c.style.display="none"}else{c.onclick=function(){ii.startWaitButton(c);navigator.geolocation.getCurrentPosition(function(h){d.setCenter(h.coords.latitude,h.coords.longitude);document.getElementById("ii_signup_name_spot").style.display="block";document.getElementById("ii_signup_selected_spot").style.display="none";a=0;ii.endWaitButton(c)},function(){ii.endWaitButton(c);document.getElementById("ii_signup_locateme_err").style.display="inline"})}}function g(){document.getElementById("ii_signup_name_spot").style.display="block";document.getElementById("ii_signup_selected_spot").style.display="none";a=0}function b(h){ii.log("selected item:"+h.item.name);document.getElementById("ii_signup_name_spot").style.display="none";var j=document.getElementById("ii_signup_selected_spot");j.style.display="block";j.innerHTML="";j.appendChild(document.createTextNode("You positioned yourself on: "+h.item.name));d.moveMarker(h.item.lat,h.item.lon);h.highlighted=true;a=h.item.id}document.getElementById("ii_signup_searchspot_btn").onclick=function(){document.getElementById("ii_signup_spotresults").innerHTML="";if(ii.qrySearchSpots){ii.qrySearchSpots.stop()}var h=document.getElementById("ii_signup_searchspot_txt").value;ii.qrySearchSpots=new ii.Query("spot",{interval:60000},{query:h,fields:"basic.count"});ii.qrySearchSpots.addListener({addItem:function(m){var l=m.createView("ListItem",{onclick:b});var j=document.getElementById("ii_signup_spotresults");j.insertBefore(l.div,j.firstChild)},countItems:function(m,l,j){ii.log("found: "+j+" items");if(j==0){document.getElementById("ii_signup_spotresults").innerHTML="No spots found matching "+h}}});ii.qrySearchSpots.start()};var f=document.getElementById("ii_centerpane_static_Signup4");f.save.onclick=function(){window.ii_signup_params.spotid=a;window.ii_signup_params.spotname=f.spotname.value;f.onsubmit()};f.skip.onclick=function(){f.onsubmit()};f.onsubmit=function(){ii.startWaitButton(this.save);window.ii_signup_params.tryonly=false;if(d.selectedLat||d.selectedLon){window.ii_signup_params.spotlat=d.selectedLat;window.ii_signup_params.spotlon=d.selectedLon}ii.get("s-signup",function(j){ii.endWaitButton(f.save);if(j.signupresult!="OK"){var h=ii.elm("div",{className:"error"},"Signup error. Please try again");f.spotname.parentNode.appendChild(h);ii.log(j.signupresult)}else{ii.login=new ii.Login(j.id,window.ii_signup_params.username,j.key);ii.app.state.setState({item:"ME.0"});ii.app.state.setState({tab:"Signup5"});ii.app.state.refresh("item");ii.tabs.clear_Signup()}},window.ii_signup_params);return false}};ii.tabs.init_Signup5=function(){ii.setText(document.getElementById("ii_signup5_username"),ii.login.username);ii.login.query.addListener({addItem:function(a){document.getElementById("ii_signup5_mailto").innerHTML=a.uploademail;document.getElementById("ii_signup5_mailto").href="mailto:"+a.uploademail}});document.getElementById("ii_signup5_vcard").href="/srv/t-vcard-upload.php?key="+ii.login.key;ii.setText(document.getElementById("ii_signup5_vcard"),"[Download "+ii.login.username+" vCard]")};ii.set_status_duration=1500;ii.views.generateListitem=function(f){var h=function(){};if(f.item_handler===undefined||f.item_handler===true){h=function(){window.location=f.link}}var e=ii.elm("div",{onclick:h,className:"item small"});var d=ii.elm("img",{src:f.img});e.appendChild(d);var j=ii.elm("div",{className:"item_metadata"});var c=0;for(var m in f.labels){if(!f.labels[m]){continue}var g=f.labels[m];var a=ii.elm("p",ii.elm("span",{className:"item_metadata_label"},m+": "),g);j.appendChild(a);c++}e.appendChild(j);if(f.zoomto){var b=ii.elm("img",{src:"/media/poi_zoom_smll.png"});b.onmouseover=ii.onmouseoverbtn;b.onmouseout=ii.onmouseoutbtn;b.onclick=f.zoomto;var l=ii.elm("div",{className:"zoomto"},b);e.appendChild(l)}return e};ii.views.Pager=function(a){if(a instanceof Function){this.callback=a}else{this.urlparam=(a||"page")}this.counter=ii.elm("span",{className:"cnt"}," (...)");this.divs=[ii.elm("div",{className:"pager"}),ii.elm("div",{className:"pager"})]};ii.views.Pager.prototype.countItems=function(b,g,l,e){ii.setText(this.counter," ("+l+")");var j=1+(b/e);var d=Math.ceil(l/e);var o=Math.max(1,j-5);var m=Math.min(d,j+5);if(m>=10){var o=Math.max(1,j-4);var m=Math.min(d,j+4)}var f=this;function a(s,r){var q=ii.elm("a",r);if(!f.urlparam){q.href="#rel";q.onclick=function(){f.callback(s)}}else{q.href="#rel&"+f.urlparam+"="+s}return q}for(var p=0;p<2;p++){var h=this.divs[p];while(h.firstChild){h.removeChild(h.firstChild)}if(d==1){continue}if(b>0){h.appendChild(a(j-1,"<<"));h.appendChild(document.createTextNode(" | "))}for(var c=o;c<=m;c++){if(j==c){h.appendChild(ii.elm("span",{className:"sel"},c.toString()))}else{h.appendChild(a(c,c.toString()))}if(c<m){h.appendChild(document.createTextNode(" | "))}}if(b+g<l){h.appendChild(document.createTextNode(" | "));h.appendChild(a(1+j,">>"))}}};ii.views.ItemBrowser=function(g,b){var f=ii.elm("div");g.query.setQueryOpts({fields:"basic,distance,count,details,postedin"});g.query.addListener({addItem:function(j){var h=j.createView("ListItem");f.insertBefore(h.div,f.firstChild);if(b.onItemClick){h.div.onclick=function(){b.onItemClick(j)}}}});var c=(g.id==b.pane);if(c){var d="#rel&pane="}else{var d="#rel&pane="+g.id}if(g.inverseOpen){c=!c}g.query.setQueryOpts({count:(c?10:"none")});if(!c){g.query.interval*=5}if(b.page){g.query.setQueryOpts({start:(b.page-1)*10})}var a=new ii.views.Pager();var e=ii.elm("div",{className:"hdr"},ii.elm("a",{href:d},g.label,a.counter));if(!g.label){e.style.display="none"}if(c){this.div=ii.elm("div",{className:"item_browser "+g.type},e,a.divs[0],f,a.divs[1])}else{this.div=ii.elm("div",{className:"item_browser "+g.type},e,f)}if(c){g.query.addListener(ii.app.statusDisplay)}g.query.addListener(a);g.query.addListener({countItems:function(l,j,h){ii.log("done with total: "+h);if(h==0&&g.nocontent){f.appendChild(ii.elm("p",{className:"results"},g.nocontent))}}});this.query=g.query;this.query.start()};ii.views.addHeader=function(f,a,e,b,c){var d=ii.elm("div",{className:"item_browser "+b},ii.elm("a",{className:"hdr",href:"#rel&pane="+e},a+" ",ii.elm("span",{className:"cnt"},"(",""+c,")")));f.appendChild(d);return d};ii.views.FeedBrowser=function(d,b,g){var g=g||{show_friends_checkbox:true,show_search:true,show_tabs:true,show_header:true,driver_name:"feed"};if(!d.interval){d.interval=10000}if(!b.count){b.count=10}var f=new ii.Query("feed",d,b);var a=this.createPager(g.pager);var h=ii.elm("div",{style:{cssFloat:"left",width:"455px"}});f.addListener(a);f.addListener({addItem:function(o){var j;var m;for(var l in g){if(g[l] instanceof Function){m=m||{};m[l]=g[l]}}if(m!==undefined){j=o.createView("ListItem",m)}else{j=o.createView("ListItem")}h.insertBefore(j.div,h.firstChild)},itemsDone:function(j){if(g.onDone){g.onDone(j)}else{ii.refreshCenterPaneShadow()}}});this.feed_query=f;this.feed_div=ii.elm("div");if(g.show_header){this.feed_div.appendChild(this.createHeader(b))}if(g.show_tabs&&g.show_tabs===true){if(ii.app.state.state.subtab){var c=ii.app.state.state.subtab}else{if(ii.app.state.state.pane){var c=ii.app.state.state.pane}else{var c="all"}}var e=ii.tabs.feed.subtab_labels[c];ii.log("adding tabs");this.feed_div.appendChild(this.createTabHeader(e,"All","Comments","People","Photos","Trips","Spots","Groups"))}f.setQueryOpts({fields:"basic,count",subtab:c});f.start();if(g.show_search&&g.show_search===true){this.feed_div.appendChild(this.createSearchInput())}if(g.show_friends_checkbox&&g.show_friends_checkbox===true){this.feed_div.appendChild(ii.elm("div",{style:{borderBottom:"solid 1px #b7b7b7",position:"relative"}},a.divs[0],ii.elm("div",{style:{textAlign:"right"}},ii.elm("input",{type:"checkbox"}),ii.elm("span","Friends Only"))))}else{this.feed_div.appendChild(ii.elm("div",{style:{borderBottom:"solid 1px #b7b7b7",padding:"7px 0px",position:"relative"}},a.divs[0]))}this.feed_div.appendChild(ii.elm("div",{style:{width:"100%",overflow:"hidden"}},h,ii.loadDriver(g.driver_name||"Feed")));this.feed_div.appendChild(ii.elm("div",{style:{padding:"15px 0px",position:"relative"}},a.divs[1]))};ii.views.FeedBrowser.prototype.createHeader=function(b){var b=(b===undefined)?{}:b;var c=ii.elm("h1",{style:{border:"0px"}});if(b.item!==undefined&&b.item!==""){header_text="Live Feed ";if(ii.app.currentPane&&ii.app.currentPane.item){var a=ii.typesingle[ii.app.currentPane.item.type]+" Feed: "+ii.app.currentPane.item.name;c.appendChild(document.createTextNode(a))}}else{c.appendChild(document.createTextNode("Global "));c.appendChild(ii.elm("span",{className:"live"},"Live!"));c.appendChild(document.createTextNode(" Feed"))}return c};ii.views.FeedBrowser.prototype.createPager=function(b){var a;if(b instanceof Function){a=new ii.views.Pager(b)}else{a=new ii.views.Pager("tpage")}for(var c=0,d=a.divs.length;c<d;c++){a.divs[c].style.position="absolute";a.divs[c].style.left="0px";a.divs[c].style.bottom="0px"}return a};ii.views.FeedBrowser.prototype.createTabHeader=function(b){var a=ii.elm("div",{className:"subtabs"});for(var e=1;e<arguments.length&&!ii.app.state.state.item;e++){var d=arguments[e];if(d==b){var c=ii.elm("a",{className:"selected"},arguments[e])}else{var c=ii.elm("a",{href:"#rel&subtab="+ii.tabs.feed.subtab_entities[arguments[e]]},arguments[e])}a.appendChild(c)}return ii.elm("div",{style:{width:"100%",overflow:"hidden"}},a)};ii.views.FeedBrowser.prototype.createSearchInput=function(){var a="Type search";var b=ii.elm("form",ii.elm("input",{id:"feed_search",name:"search",onblur:function(){if(this.value==""){this.value=a;this.style.color="#666666"}this.hasFocus=false},onfocus:function(){if(this.value==a){this.value=""}this.style.color="black";this.hasFocus=true},onkeyup:function(){if(ii.app.applyFilterTimer){window.clearTimeout(ii.app.applyFilterTimer)}ii.app.applyFilterTimer=window.setTimeout(function(){window.location="#rel&query="+document.getElementById("feed_search").value},500)},style:{color:"#666666",margin:"20px 0px 10px",width:"60%"},value:a}));return b};ii.views.FeedBrowser.prototype.setPage=function(a){this.feed_query.setQueryOpts({start:(a-1)*this.feed_query.queryOpts.count})};ii.views.StatusElms=function(){this.statusMsg=ii.elm("div"," ",{style:{margin:"4px 16px"}});this.statusDiv=ii.elm("div",{style:{display:"none"},className:"live"},this.statusMsg,ii.elm("hr"))};ii.views.StatusElms.prototype.setStatus=function(a,c){ii.setText(this.statusMsg,a);this.statusDiv.style.display="block";var b=this;window.setTimeout(function(){ii.setText(b.statusMsg,"");b.statusDiv.style.display="none"},c||ii.set_status_duration)};ii.views.StatusElms.prototype.clearStatus=function(){ii.setText(this.statusMsg,"");this.statusDiv.style.display="none"};ii.views.networkDisplay=function(d){if(!d.length){return ii.elm("span",{className:"networks"},"None")}var c=ii.elm("span",{className:"networks"});for(var b=0;b<d.length;b++){var a=ii.views.user.networks[d[b].community].url;a=a.replace("$nick",d[b].nickname);c.appendChild(ii.elm("a",{href:a,target:"_blank"},d[b].community));if(b<d.length-1){c.appendChild(document.createTextNode(", "))}}return c};ii.views.networkEdit=function(g){var b=ii.elm("select");b.appendChild(ii.elm("option",{value:""},"Select a network"));for(var f in ii.views.user.networks){b.appendChild(ii.elm("option",{value:f},f))}var e=ii.elm("div",b,ii.elm("input"),ii.elm("img",{src:"/media/button_clear.png",className:"close",style:{display:"none"}}),ii.elm("form"));var d=ii.elm("div",{className:"edit_networks"});function a(s,o,l){var h=e.cloneNode(true);var q=h.firstChild;var p=q.nextSibling;var m=p.nextSibling;var r=m.nextSibling;if(s){q.value=s;if(ii.views.user.networks[s].fillSettingsDiv){ii.views.user.networks[s].fillSettingsDiv(r,l)}}if(o){p.value=o}m.onmouseover=ii.onmouseoverbtn;m.onmouseout=ii.onmouseoutbtn;m.onclick=function(){this.parentNode.parentNode.removeChild(this.parentNode)};var j=function(){ii.log("testing");if(this.value){if(ii.getTextBoxValue(this.nextSibling)==""){var t=ii.views.user.networks[this.value].helpText;if(!t){t="Enter your "+this.value+" username"}ii.setDefaultText(this.nextSibling,t)}r.innerHTML="";if(ii.views.user.networks[this.value].fillSettingsDiv){ii.views.user.networks[this.value].fillSettingsDiv(r,l)}}if(this.parentNode.nextSibling){return}if(!this.value){if(ii.getTextBoxValue(this.nextSibling.value)==""){ii.setDefaultText(this.nextSibling,"")}return}this.nextSibling.nextSibling.style.display="";a()};if(ii.browser.safari){q.onchange=j}else{q.onclick=j}d.appendChild(h);return h}for(var f=0;f<g.length;f++){var c=a(g[f].community,g[f].nickname,g[f].settings);c.firstChild.nextSibling.nextSibling.style.display=""}ii.log("testing appenndelm");a();return d};ii.views.networksGet=function(h){var c=[];var d=h.getElementsByTagName("select");for(var g=0;g<d.length;g++){var b=d[g].value;var a=ii.getTextBoxValue(d[g].nextSibling);var f=d[g].nextSibling.nextSibling.nextSibling;if(!b||!a){continue}var e={nickname:a,community:b};if(ii.views.user.networks[b].getSettings){e.settings=ii.views.user.networks[b].getSettings(f)}c.push(e)}return ii.obj2json(c)};ii.views.fillPostInDropDown=function(c,a){a=a||{};a.groupsOnly=a.groupsOnly||false;var b=ii.get("q-mysets",function(g){c.innerHTML="";c.appendChild(ii.elm("option",{className:"private",value:0},"Private"));for(var j=0;j<g.items.length;j++){var f=g.items[j].type;var h=g.items[j].id;var d=g.items[j].name;if(f=="group"&&h==1){f="world"}if(f=="group"&&d=="Friends"){f="friends"}var e=ii.elm("option",{className:f,value:h},d);if(a.groupsOnly&&(f=="album"||f=="spot")){continue}c.appendChild(e);if(f=="world"&&!a.value){e.selected=true}else{if(a.value==h){e.selected=true}}}},{})};ii.views.unreadIndicator=function(a){if(a==0){return ii.elm("span","")}else{if(a<10){return ii.elm("span",{className:"unread sd"},""+a)}else{ii.log("count="+a);return ii.elm("span",{className:"unread dd"},""+a)}}};ii.views.CommentElms=function(e,a,c){var b=ii.elm("textarea",{cols:30,rows:3});var d=ii.elm("form",{style:{display:"none"}},b,ii.elm("input",{type:"submit",value:"post"}),ii.elm("hr"));d.onmousedown=ii.stopPropagation;d.onmousemove=ii.stopPropagation;this.commentDiv=d;this.commentLink=ii.elm("a",{href:"javascript://comment()"},(e=="user"?"[Send Message]":"[Post Comment]"));this.commentLink.onclick=function(){c.clearStatus();if(!ii.login){if(e=="user"){alert("You must be logged in to send a Message")}else{alert("You must be logged in to post a Comment")}return}if(d.style.display=="block"){d.style.display="none"}else{ii.log("displaying commentdiv");d.style.display="block";b.focus()}ii.refreshCenterPaneShadow()};d.onsubmit=function(){ii.log("sending msg");ii.get("p-new-comment",function(f){if(e=="user"){c.setStatus("Message sent")}else{c.setStatus("Comment posted")}ii.log("msg sent: "+f.result)},{entitytype:e,entityid:a,content:b.value});c.setStatus("Sending...");b.value="";this.style.display="none";return false}};ii.views.SafElms=function(d,a,b){var c=ii.elm("textarea",{cols:60,rows:6});this.safLink=ii.elm("a",{href:"javascript://sendAFriend()"},"[send Friend]")};ii.views.VisitElms=function(b,a){this.visitLink=ii.elm("a",{href:"javascript://visit()"},"[Visit Spot]");this.visitLink.onclick=function(){if(!ii.login){alert("You must be logged in to visit a Spot");return}a.setStatus("Visiting ... ");ii.get("p-upd-profile",function(c){a.setStatus("You are now visiting "+b.name)},{spotid:b.id})}};ii.views.JoinElms=function(j,a,b,d){var c=ii.typesingle[ii.typeletter[a]];this.joinLink=ii.elm("a",{href:"javascript://join()"},"[Join "+c+"]");this.leaveLink=ii.elm("a",{href:"javascript://leave()"},"[Leave "+c+"]");var h=this.joinLink;var f=this.leaveLink;function e(){h.style.display=((!ii.login||(j.canjoin==0)||j.ismember=="owner"||j.ismember=="member")?"none":"");f.style.display=((!ii.login||j.ismember!="member")?"none":"")}e();function g(l,o,m){d.setStatus("Updating ... ");ii.get(l,function(p){j.ismember=o;e();d.setStatus(c+" "+m)},{entitytype:"user",entityid:ii.login.id,setid:j.id})}h.onclick=function(){g("p-new-link","member","joined")};f.onclick=function(){g("p-del-link","none","left")}};ii.views.PostInElms=function(j,a,d,e){if(!ii.login||(j.userid!=ii.login.id&&j.ispublic==0)){this.postInLink=ii.elm("span");this.postInDiv=ii.elm("span");return}else{ii.log("post in allowed")}this.postInLink=ii.elm("a",{href:"javascript://postIn()"},"[Post In]");var h=ii.elm("select",{className:"postedIn",multiple:"yes",size:"8",style:{width:"150px"}});var c=ii.elm("input",{type:"submit",value:"Save"});var f=this;function g(){ii.startWaitButton(c);var l=[0];var m=h.getElementsByTagName("option");for(var o=0;o<m.length;o++){if(m[o].selected){l.push(m[o].value)}}ii.get("p-upd-"+a,function(p){ii.endWaitButton(c);ii.log("updating sets: "+p.result);f.postInDiv.style.display="none";if(p.partialSuccess){e.setStatus("Some changes were not made because that would change the item's security settings",10)}ii.app.currentPane.itemQuery.doUpdate()},{id:j.id,sets:l.join(",")});return false}this.postInDiv=ii.elm("form",{className:"postIn",style:{display:"none"},onsubmit:g,onmousedown:ii.stopPropagation,onmousemove:ii.stopPropagation},ii.elm("p","Post this ",ii.typesingle[ii.typeletter[a]]," in your Collections"),ii.elm("p",{className:"note"},ii.typesingle[ii.typeletter[a]]," inherits the Collection's Privacy"),ii.elm("p",{className:"header"},"My Collections"),ii.elm("div",{style:{marginBottom:"10px",position:"relative",width:"100%"}},h,c),ii.elm("p",{className:"footer"},"Control Click (PC) or Apple Click (Mac) to select ","multiple Collections. Read our ",ii.elm("a",{href:"#rel&tab=HelpFAQ&q=postin_what"},"FAQ")," for help on the Post In feature."));var b=function(){h.innerHTML="";var p="";var r=(j.postedin.length==0);var o=ii.elm("option",{className:"private",value:0},"Private");if(r){o.selected="selected"}h.appendChild(o);for(var t=0;t<j.postedin.length;t++){var q=j.postedin[t].type;var s=j.postedin[t].id;var l=j.postedin[t].name;if(q=="trip"){continue}if(q=="group"&&s==1){q="world"}if(q=="group"&&l=="Friends"){q="friends"}var o=ii.elm("option",{className:q,value:s,selected:"selected"},l);h.appendChild(o);p+="_"+j.postedin[t].id+"_"}var m=ii.get("q-mysets",function(y){for(var B=0;B<y.items.length;B++){if(p.indexOf("_"+y.items[B].id+"_")>=0){continue}var x=y.items[B].type;var A=y.items[B].id;var u=y.items[B].name;if(x=="group"&&A==1){x="world"}if(x=="group"&&u=="Friends"){x="friends"}var v=ii.elm("option",{className:x,value:A},u);h.appendChild(v)}},{})};this.postInLink.onclick=function(){if(f.postInDiv.style.display=="block"){f.postInDiv.style.display="none";return}f.postInDiv.style.display="block";b();ii.refreshCenterPaneShadow()}};ii.views.SendAFriendElms=function(j,a,c,e){if(!ii.login||j.ispublic==0){this.sendAFriendLink=ii.elm("span");this.sendAFriendDiv=ii.elm("span");return}var g=this;var d="Select or type Friends names or type email addresses";var b=ii.elm("textarea",{onfocus:function(){if(ii.trim(this.value)==d){this.value=""}},onblur:function(){if(ii.trim(this.value)==""){this.value=d}}},d);var f=ii.elm("textarea");var h=ii.elm("select",{onchange:function(){var l=b.value;if(l.indexOf(this.options[this.selectedIndex].text)>-1){}else{if(d===l){b.value=this.options[this.selectedIndex].text}else{b.value=l+", "+this.options[this.selectedIndex].text}}this.options[0].selected=true},style:{border:"none",marginLeft:"10px"}},ii.elm("option",{value:"-1"},"My Friends"));ii.get("q-items-user",function(o){for(var p=0,l=o.items.length;p<l;p++){var m=ii.elm("option",o.items[p].name);h.appendChild(m)}},{count:100,friendof:ii.login.id,order:"name"});this.sendAFriendDiv=ii.elm("div",{style:{borderBottom:"1px solid #b7b7b7",display:"none",margin:"12px 16px 8px",padding:"0px 0px 12px"}},ii.elm("form",{className:"sendAFriend",onsubmit:function(){if(b.value!=d){ii.get("p-new-message",function(l){e.setStatus("Message sent")},{entitytype:"user",entityid:b.value,content:f.value});e.setStatus("Sending to Friend...");this.parentNode.style.display="none";b.value=d;f.value=f.defaultValue}return false},onmousedown:ii.stopPropagation,onmousemove:ii.stopPropagation},ii.elm("div",{className:"safTxtHeader"},"To:",h),b,ii.elm("div",{className:"safTxtHeader"},"Message:"),f,ii.elm("div",{style:{overflow:"hidden",width:"100%"}},ii.elm("input",{style:{display:"block",cssFloat:"right",margin:"0px"},type:"submit",value:"Send Message"}))));this.sendAFriendLink=ii.elm("a",{href:"javascript://sendAFriend()",onclick:function(){if(g.sendAFriendDiv.style.display=="block"){g.sendAFriendDiv.style.display="none"}else{g.sendAFriendDiv.style.display="block";var o=ii.login.username||"";var l=ii.login.item.fullname||"";if(l){l=" ("+l+")"}var m="Hi There!\nCheckout this "+ii.typesingle[j.type]+" on bliin: http://"+window.location.host+"/#item="+j.type+"."+j.id+"\n\nRegards,";f.value=m}ii.refreshCenterPaneShadow()}},"[Send to Friend]")};ii.views.postedInLinks=function(a){var c=ii.elm("span",{className:"postedIn"});for(var g=0;g<a.length;g++){var f=a[g];if(g>0){c.appendChild(document.createTextNode(", "))}if(f.type=="album"){var e="#rel&item="+ii.typeletter[f.parenttype]+"."+f.parentid+"&pane=album."+f.id;var b=f.parentname+" ("+f.name+")";var d="album"}else{if(f.type=="group"&&f.id==1){var e="#rel&item=";var b=f.name;var d="world"}else{if(f.type=="group"&&f.name=="Friends"){var e="#rel&item=u."+f.parentid+"&pane=friends";var b=ii.appendS(f.parentname)+" Friends";var d="friends"}else{var e="#rel&item="+ii.typeletter[f.type]+"."+f.id;var b=f.name;var d=f.type}}}c.appendChild(ii.elm("a",{className:d,href:e},b))}if(a.length==0){c.appendChild(ii.elm("a",{className:"private"},"Private"))}return c};ii.views.PopupCommentElms=function(f,a,e){var c=ii.elm("input",{type:"button",value:"Add Comment"});this.commentLink=c;var b=ii.elm("textarea",{cols:30,rows:6,style:{margin:"8px 0px",width:"100%"}});var d=ii.elm("form",{style:{display:"none"}},b,ii.elm("div",{style:{overflow:"hidden",width:"100%"}},ii.elm("div",{style:{cssFloat:"right"}},ii.elm("input",{type:"button",value:"cancel",style:{margin:"0px 4px",width:"80px"},onclick:function(){d.style.display="none";b.value="";c.style.display="inline"}}),ii.elm("input",{type:"submit",value:"post",style:{margin:"0px 4px",width:"80px"}}))),ii.elm("hr"));this.commentDiv=d;this.commentLink.onclick=function(){if(!ii.login){alert("You must be logged in to send a Message");return}this.style.display="none";d.style.display="block";b.focus()};d.onsubmit=function(){ii.get("p-new-comment",function(g){e.doUpdate()},{entitytype:f,entityid:a,content:b.value});this.style.display="none";b.value="";c.style.display="inline";return false}};ii.views.Details=function(d,b,a){this.item=d;this.tabElm=b;var c=ii.typename[d.type];this.type=c;this.queries=[];ii.log("Creating deatils "+this.type+" for "+d.id);this.form=this.setupForm(this.type,a);this.setupJoinBtn();this.setupComments();this.setupPhotos();this.setupUsers();this.setupDelete();for(var e=0;e<this.queries.length;e++){this.queries[e].start()}};ii.views.Details.prototype.setEditMode=function(a,b){if(b){a.className=a.className.replace("viewmode","editmode")}else{a.className=a.className.replace("editmode","viewmode")}};ii.views.Details.prototype.setupForm=function(b,a){var a=a||function(){};var e=this.item;var d=document.getElementById("ii_details_"+b+"_form");this.setEditMode(d,false);var f=(e.type=="u"?e.id:e.userid);var c=this;if(ii.login&&(ii.login.id==f||ii.login.isAdmin)){document.getElementById("ii_details_"+b+"_editbtn").parentNode.style.display="block";document.getElementById("ii_details_"+b+"_editbtn").onclick=function(){c.setEditMode(d,true)};document.getElementById("ii_details_"+b+"_cancelbtn").onclick=function(){c.setEditMode(d,false)};d.onsubmit=a}else{ii.log("hiding networks: %s %o",b,document.getElementById("ii_details_"+b+"_editbtn").parentNode);document.getElementById("ii_details_"+b+"_editbtn").parentNode.style.display="none"}return d};ii.views.Details.prototype.setupDelete=function(){var b=this.type;var d=this.item.id;var c=document.getElementById("ii_details_"+b+"_deletebtn");if(!c){return}var a=(!this.item.ismember||this.item.ismember=="owner");c.style.display=(a?"":"none");ii.log("type:"+this.type);c.onclick=function(){var e="Are you sure you want to delete this "+ii.typesingle[ii.typeletter[b]]+"?";if(!confirm(e)){return}ii.startWaitButton(c);b=b.replace("spot","set").replace("group","set");ii.get("p-del-"+b,function(f){ii.endWaitButton(c);ii.app.state.setState({item:"ME.0"})},{id:d})}};ii.views.Details.prototype.setupJoinBtn=function(){var c=this.type;var e=this.item;var d=this;var a=document.getElementById("ii_details_"+c+"_joinbtn");if(!a){return}if(!ii.login||e.ismember=="owner"){a.style.display="none";return}a.style.display="";if(e.ismember=="member"){ii.setText(a,"[Leave]");var b="p-del-link";var f="none"}else{ii.setText(a,"[Join]");var b="p-new-link";var f="member"}a.onclick=function(){ii.get(b,function(g){e.ismember=f;d.setupJoinBtn()},{entitytype:"user",entityid:ii.login.id,setid:e.id})}};ii.views.Details.prototype.update=function(a){var a=a||{};var d=this.item;var c=this.type;function b(o){for(var m=0;m<o.childNodes.length;m++){var j=o.childNodes[m];if(j.nodeType!=1){continue}b(j);if(j.nodeName.toLowerCase()=="form"||j.nodeName.toLowerCase()=="iframe"){continue}var g=j.getAttribute("name");if(!g||ii.trim(g)==""){continue}if(a[g]){a[g](j,d)}else{switch(j.getAttribute("name")){case"photo":var l="/srv/d-media.php?width=288&height=216&entitytype="+c+"&entityid="+d.id;var f=j.getElementsByTagName("img");if(!f||!f[0]||l!=f[0].src){j.innerHTML="";j.appendChild(ii.elm("img",{src:l}))}break;case"photo_name":j.innerHTML="";ii.setText(j,d.name);break;case"author":j.innerHTML="";j.appendChild(ii.elm("div",{style:{width:"288px"}},ii.elm("img",{src:"/srv/d-media.php?width=60&height=45&entitytype=user&entityid="+d.userid,style:{cssFloat:"right"}}),ii.userLink(d.userid,d.author)));break;case"created":if(d.created){ii.setText(j,ii.formatDate(d.created,"humandate"))}else{ii.setText(j,"Unknown")}break;case"location":if(!d.lat){ii.setText(j,"Unknown")}else{j.innerHTML="";j.appendChild(ii.geoCode(d.lat,d.lon))}break;case"distance":if(!d.distance){j.innerHTML="";j.appendChild(ii.elm("span","Unknown. ",ii.elm("a",{href:"#rel&item=ME.0"},"Log in")," to get your distance."))}else{ii.setText(j,ii.formatDistance(d.distance))}break;case"description":var h=d[j.getAttribute("name")];if(h===undefined){h="Unknown"}if(j.tagName.toLowerCase()=="textarea"){j.value=h}else{j.innerHTML="";ii.text2href(h,j)}break;case"photos":case"users":case"savebtn":case"addcomment":break;default:var h=d[j.getAttribute("name")];if(h===undefined){h="Unknown"}if(j.tagName=="input"||j.tagName=="INPUT"){switch(j.getAttribute("type")){case"file":case"submit":case"button":break;default:j.value=j.defaultText||h;break}}else{if(j.nodeName.toLowerCase()=="textarea"){j.value=j.defaultText||h}else{ii.setText(j,h)}}break}}}}b(this.tabElm);return};ii.views.Details.prototype.remove=function(){for(var a=0;a<this.queries.length;a++){this.queries[a].stop()}};ii.views.Details.prototype.setupComments=function(){var e=document.getElementById("ii_details_"+this.type+"_comments");if(!e){return}e.innerHTML="";var c={count:100};var b=this.type.replace("group","set").replace("album","set").replace("spot","set");c[b]=this.item.id;var d=new ii.Query("comment",{interval:15000},c);var a=new ii.views.Thread(this.type,this.item.id,"Comments",{onUpdate:function(){d.doUpdate()},collapsable:false,deleteMethod:"delete",showAlways:true});d.addListener({addItem:function(f){a.insertItem(f)}});e.appendChild(a.section);this.queries.push(d)};ii.views.Details.prototype.setupPhotos=function(){var h=document.getElementById("ii_details_"+this.type+"_photos");if(!h){return}h.innerHTML="";var e={count:24,fields:"basic,count"};var d=this.type.replace("group","set").replace("album","set").replace("spot","set");e[d]=this.item.id;var g=new ii.Query("poi",{interval:15000},e);g.addListener({addItem:function(l){var j=l.createView("Details",{});h.appendChild(j.div)}});var a=new ii.views.Pager(function b(j){g.setQueryOpts({start:(j-1)*e.count})});g.addListener(a);var c=document.getElementById("ii_details_"+this.type+"_photos_pager");c.innerHTML="";c.appendChild(a.divs[0]);var f=this;g.addListener({countItems:function(r,o,m,l){var p=(o<m);c.style.display=(p?"block":"none");if(m==0){var j=ii.typesingle[ii.typeletter[f.type]];var q=ii.elm("span","This "+j+" contains no Photos yet. ","Use the [Post In] link to Post a Photo in a "+j+". ","Read our ",ii.elm("a",{href:"#rel&tab=HelpFAQ&q=postin_what"},"FAQ")," for help on the Post In feature.");h.appendChild(q)}}});this.queries.push(g)};ii.views.Details.prototype.setupUsers=function(d){var d=document.getElementById("ii_details_"+this.type+"_users");if(!d){return}d.innerHTML="";var b={fields:"basic,count"};var a=this.type.replace("group","set").replace("album","set").replace("spot","set");b[a]=this.item.id;var c=new ii.Query("user",{interval:15000},b);c.addListener({addItem:function(f){var e=f.createView("ListItem",{});e.div.style.backgroundColor="transparent";e.div.className+=" wide";d.appendChild(e.div)}});this.queries.push(c)};ii.views.Thread=function(g,q,y,b){b=b||{};b.onUpdate=b.onUpdate||function(){};b.showListItem=b.showListItem||false;b.deleteMethod=b.deleteMethod||"remove";this.showAlways=b.showAlways||false;this.titleElm=ii.elm("span",y);this.iconElm=ii.elm("span");this.sc=ii.elm("div",{className:"cp_sc"});var e=this.sc;this.total=0;this.unread=0;this.title=y;if(!b.showAvatar){var t=""}else{var t=ii.elm("a",{href:"#rel&item="+ii.typeletter[g]+"."+q},ii.elm("img",{src:"/srv/d-media.php?entityid="+q+"&entitytype="+g+"&width=64&height=48",style:{display:"block",position:"absolute",left:"17px"}}))}var f=ii.elm("form",{action:"#rel",onsubmit:function(){if(ii.getTextBoxValue(ii.getElmByName(this,"cont"))==""){return false}ii.startWaitButton(ii.getElmByName(f,"submit"));ii.get("p-new-comment",function(B){ii.endWaitButton(ii.getElmByName(f,"submit"));ii.setDefaultText(ii.getElmByName(f,"cont"),ii.getElmByName(f,"cont").defaultText);b.onUpdate()},{entitytype:g,entityid:q,content:ii.getElmByName(this,"cont").value});return false},style:{position:"relative",minHeight:"46px",marginBottom:"10px",marginTop:"10px",marginRight:"6px"}},t,ii.elm("div",{style:{position:"absolute",right:"0px"}},ii.elm("textarea",{name:"cont",style:{margin:"0px",width:"246px"}}),ii.elm("input",{name:"submit",type:"submit",value:(g=="user"?"Post message":"Post comment"),style:{margin:"0px 0px 0px 6px",width:"75px",position:"relative",top:"-2px"}})));if(g=="user"){ii.setDefaultText(ii.getElmByName(f,"cont"),"Enter Message here")}else{ii.setDefaultText(ii.getElmByName(f,"cont"),"Enter "+ii.typesingle[ii.typeletter[g]]+" comment here")}function u(){var B=e.getElementsByTagName("input");for(var C=0;C<B.length;C++){if(B[C].type=="checkbox"){B[C].checked="checked";B[C].onclick()}}}function A(){var B=e.getElementsByTagName("input");for(var C=0;C<B.length;C++){if(B[C].type=="checkbox"){B[C].checked="";B[C].onclick()}}}function j(){var B;var C=e.getElementsByTagName("input");for(var D=0;D<C.length;D++){if(C[D].type=="checkbox"&&C[D].checked){B=(B?B+","+C[D].value:C[D].value)}}return B}function x(){var B=j();if(!B){alert("Please check the Messages you wish to mark as read");return}ii.get("p-upd-markasread",function(C){b.onUpdate();A()},{id:B})}function s(){var B=j();if(!B){alert("Please check the Messages you wish to delete");return}ii.get("p-del-comment",function(E){var D=B.split(",").length;var C=E.deleted.length;if(C<D){alert(""+(D-C)+" comment"+(D-C>1?"s":"")+" could not be deleted because of insufficient permissions")}b.onUpdate()},{id:B,method:b.deleteMethod})}if(ii.login){var l=[];for(var p=0;p<2;p++){var h=ii.elm("a","[Select all]",{className:"selectall",href:"#rel",onclick:u});var a=ii.elm("a","[Deselect all]",{className:"deselectall",href:"#rel",onclick:A,style:{display:"none"}});var d=ii.elm("a","[Mark as read]",{href:"#rel",onclick:x});var r=ii.elm("a","[Delete selected]",{href:"#rel",onclick:s});l.push(ii.elm("div",{className:"cp_sf actions"},h," ",a," ",d," ",r))}var c=l[1];c.style.borderBottom="1px solid #b7b7b7";c.style.borderTop="none";c.style.position="relative";c.style.left="-6px";c.style.top="-9px";this.sc.appendChild(c);this.sc.appendChild(f);var o=l[0]}else{var o=""}this.itemCont=ii.elm("div");this.sc.appendChild(this.itemCont);var v=ii.elm("h2",{className:"cp_sh"},this.titleElm,this.iconElm);this.section=ii.elm("div",v,this.sc,o);var m=this.section;if(b.collapsable){this.section.className="cp_s collapsable collapsed";v.onclick=function(){m.className=m.className.replace("expanded","swapcollapse").replace("collapsed","expanded").replace("swapcollapse","collapsed")}}else{this.section.className="cp_s"}};ii.views.Thread.prototype.insertItem=function(c){var a=c.createView("ListItem",{userid:(ii.login?ii.login.id:0)});this.total++;if(c.status==""){this.unread++}this.updateCounters();this.itemCont.insertBefore(a.div,this.itemCont.firstChild);var b=this;a.remove=function(){b.total--;if(this.item.status==""){b.unread--}b.updateCounters()};a.markAsRead=function(){b.unread--;b.updateCounters()}};ii.views.Thread.prototype.updateCounters=function(){var a=ii.views.unreadIndicator(this.unread);this.iconElm.parentNode.replaceChild(a,this.iconElm);this.iconElm=a;var b=ii.elm("span",this.title,ii.elm("span",{style:{fontSize:"10px"}}," ("+this.total+")"));this.titleElm.parentNode.replaceChild(b,this.titleElm);this.titleElm=b;if(!this.showAlways){this.section.style.display=(this.total>0?"":"none")}};ii.views.CenterPane=function(a){this.init(a)};ii.views.CenterPane.prototype={header_text:null,cp_sections:null,cp_navtabs:null,cp_w:null,cp_iw:null,cp_nav:null,init:function(a){var a=a||{};this.header_text=a.header_text||"";this.cp_sections=[];this.cp_navtabs=[]},addSection:function(a){this.cp_sections.push(a)},addNavTab:function(a){this.cp_navtabs.push(a)},getElm:function(){this.cp_w=ii.elm("div",{className:"cp_w"},ii.elm("h1",{className:"cp_wh"},this.header_text));this.cp_iw=ii.elm("div",{className:"cp_iw"});for(var a=0,b=this.cp_sections.length;a<b;a++){this.cp_iw.appendChild(this.cp_sections[a].getElm())}this.cp_w.appendChild(this.cp_iw);this.cp_nav=ii.elm("div",{className:"cp_nav"});for(var a=0,b=this.cp_navtabs.length;a<b;a++){this.cp_nav.appendChild(this.cp_navtabs[a].getElm())}this.cp_w.appendChild(this.cp_nav);return this.cp_w},appendCPS:function(a){this.cp_iw.appendChild(a)},insertCPS:function(a,b){this.cp_iw.insertBefore(a,b.nextSibling)}};ii.views.CenterPaneSection=function(a){this.init(a)};ii.views.CenterPaneSection.prototype={header_icon:null,header_text:null,custom_elms:null,init:function(a){var a=a||{};this.header_text=a.header_text||"";this.header_icon=(a.header_icon||ii.elm("span"));this.item_views=a.item_views||"";this.custom_elms=[]},appendCustomElm:function(a,b){if(!this.custom_elms[a]){this.custom_elms[a]=[]}this.custom_elms[a].push(b)},insertElm:function(c){if(!this.custom_elms.before||this.custom_elms.before.length==0){this.cp_sc.insertBefore(c,this.cp_sc.firstChild)}else{var a=this.custom_elms.before.length;var b=this.custom_elms.before[a-1];this.cp_sc.insertBefore(c,b.nextSibling)}},setIcon:function(a){if(this.header_icon.parentNode){this.header_icon.parentNode.replaceChild(a,this.header_icon)}this.header_icon=a},getElm:function(){cp_sc=ii.elm("div",{className:"cp_sc"});this.cp_sc=cp_sc;for(var c=0;this.custom_elms.before&&c<this.custom_elms.before.length;c++){cp_sc.appendChild(this.custom_elms.before[c])}for(var c=0,b=this.item_views.length;c<b;c++){cp_sc.appendChild(this.item_views[c])}for(var c=0;this.custom_elms.after&&c<this.custom_elms.after.length;c++){cp_sc.appendChild(this.custom_elms.after[c])}var a=ii.elm("div",{className:"cp_s"},ii.elm("h2",{className:"cp_sh",style:{position:"relative"}},this.header_text,this.header_icon),cp_sc,ii.elm("div",{className:"cp_sf"},"Having Trouble? Check ",ii.elm("a",{href:"#rel&tab=Help"},"Help")));this.cp_s=a;return a}};ii.views.CenterPaneCollapsibleSection=function(b,a){if(b){this.init(b,a)}};ii.views.CenterPaneCollapsibleSection.prototype=new ii.views.CenterPaneSection;ii.views.CenterPaneCollapsibleSection.prototype.init=function(a){ii.views.CenterPaneSection.prototype.init.apply(this,arguments);if(a&&a.expanded!==undefined){this.expanded=a.expanded}if(a&&a.onFirstExpand){this.onFirstExpand=a.onFirstExpand}};ii.views.CenterPaneCollapsibleSection.prototype.getElm=function(){var e=(this.expanded?"expanded":"collapsed");var b=ii.elm("div",{className:"cp_s collapsable "+e});var g=ii.elm("div",{className:"cp_sc"});this.cp_sc=g;for(var d=0;this.custom_elms.before&&d<this.custom_elms.before.length;d++){g.appendChild(this.custom_elms.before[d])}for(var d=0,a=this.item_views.length;d<a;d++){g.appendChild(this.item_views[d].div)}for(var d=0;this.custom_elms.after&&d<this.custom_elms.after.length;d++){g.appendChild(this.custom_elms.after[d])}var f=this;var c=ii.elm("h2",{className:"cp_sh",style:{position:"relative"},onclick:function(){if(f.onFirstExpand){f.onFirstExpand();f.onFirstExpand=0}b.className=b.className.replace("expanded","swapcollapse").replace("collapsed","expanded").replace("swapcollapse","collapsed")}},this.header_text,this.header_icon);b.appendChild(c);b.appendChild(g);return b};ii.views.CenterPaneNavTab=function(b,a){if(b){this.init(b,a)}};ii.views.CenterPaneNavTab.prototype={cp:null,text:null,href:null,selected:false,init:function(b,a){this.cp=b;var a=a||{};this.text=a.text||"";this.href=a.href||"#rel";this.selected=a.selected||false;this.cp.addNavTab(this)},getElm:function(){var b=ii.elm("a",this.text);if(this.selected){b.setAttribute("class","selected")}else{b.setAttribute("href",this.href)}return b}};ii.views.cp_send_msg_or_comment_form=function(d){var d=d||{};var c=d.form_action||"#rel";var f=d.form_onsubmit||function(){return false};var b=d.textarea_name||"content";var a=d.textarea_default_text||"Enter Message here";var e=ii.elm("form",{action:c,onsubmit:f,style:{position:"relative",minHeight:"46px"}},ii.elm("div",{style:{position:"absolute",right:"0px"}},ii.elm("textarea",{name:b,value:a,style:{margin:"0px",width:"265px"}}),ii.elm("input",{name:"submit",type:"submit",value:"Post message",style:{margin:"0px 0px 0px 6px"}})));ii.setDefaultText(e[b],a);return e};ii.views.View=function(a){};ii.views.View.prototype.initDiv=function(b){ii.assert(this.item);var a="ii_vw_"+ii.typename[this.item.type]+"_"+b;var d=document.getElementById(a);if(d){var g=d.getAttribute("data-loadFromServer");this.div=d.cloneNode(true);this.div.id=""}else{this.div=ii.elm("div",{className:"view"})}this.fields=[];var c=this.div.getElementsByTagName("*");for(var h=0;h<c.length;h++){var f=c[h].getAttribute("data-field");if(f){this.fields[f]=c[h]}}var e=this.item;this.div.onmouseover=function(){e.onmouseover()};this.div.onmouseout=function(){e.onmouseout()}};ii.views.View.prototype.update=function(){for(var g in this.fields){var e=this.fields[g];if(this["fillField_"+g]){this["fillField_"+g](e);continue}switch(g){case"author":e.innerHTML="";e.appendChild(ii.userLink(this.item.userid,this.item.author));break;case"link":e.href="#rel&item="+this.item.type+"."+this.item.id;break;case"thumb":e.src="/srv/d-media.php?entitytype="+ii.typename[this.item.type]+"&entityid="+this.item.id+"&width=64&height=48&style=center&marker=commentcount";break;case"authorthumb":e.src="/srv/d-media.php?entitytype=user&entityid="+this.item.userid+"&width=48&height=36";break;case"authorthumb_large":e.src="/srv/d-media.php?entitytype=user&entityid="+this.item.userid+"&width=64&height=48";break;case"created":e.innerHTML="";e.appendChild(document.createTextNode(ii.formatDate(this.item.created,"relative")));break;case"location":e.innerHTML="";e.appendChild(ii.geoCode(this.item.lat,this.item.lon));break;case"description":ii.text2href(this.item.description||"No description",e);break;case"content":if(this.item.content!==undefined){ii.text2href(this.item.content||"No content",e)}else{e.innerHTML="";var f=[];function h(l,o,p){if(!o){return}var m=""+o+" "+p+(o>1?"s":"");f.push(ii.elm("span",{className:"micro "+l},m))}if(this.item.friends){h("friend",this.item.friends,"Friend")}if(this.item.pois){h("poi",this.item.pois,"Photo")}if(this.item.trips){h("trip",this.item.trips,"Trip")}if(this.item.spots){h("spot",this.item.spots,"Spot")}if(this.item.groups){h("group",this.item.groups,"Group")}if(this.item.members){h("user",this.item.members,"Member")}for(var a=0;a<f.length;a++){if(a>0){e.appendChild(document.createTextNode(", "))}e.appendChild(f[a])}if(f.length==0){ii.setText(e,"None")}}break;case"messagebox":e.innerHTML="";e.className="msgbox";var d=ii.elm("div");if(this.item.message){ii.text2href(this.item.message,d)}else{d=ii.elm("div",ii.elm("em","No message yet"))}e.appendChild(d);e.appendChild(ii.elm("img",{src:"/media/balloontip_discs.gif",style:{position:"absolute",top:"-26px",left:"10px"}}));break;case"zoomto":var j=this.item;e.onclick=function(l){ii.stopPropagation(l);j.zoomto()};if(e.tagName.toLowerCase()=="img"){var c=e}else{var c=e.getElementsByTagName("img")[0]}c.onmouseover=ii.onmouseoverbtn;c.onmouseout=ii.onmouseoutbtn;break;case"distance":var b="Unknown";if(this.item.distance!==undefined){b=ii.formatDistance(this.item.distance)}e.innerHTML="";e.appendChild(document.createTextNode(b));break;default:if(this.item[g]!==undefined){e.innerHTML="";e.appendChild(document.createTextNode(""+this.item[g]))}break}}};ii.views.View.prototype.removeQueries=function(){ii.dir(this.queries);if(this.queries){for(var a in this.queries){this.queries[a].stop()}}};ii.views.View.prototype.remove=function(){this.removeQueries()};ii.views.ListItem=function(){};ii.views.ListItem.prototype=new ii.views.View;ii.views.ListItem.prototype.onmouseover=function(){this.div.style.backgroundColor="#f0f0f0"};ii.views.ListItem.prototype.onmouseout=function(){this.div.style.backgroundColor=""};ii.views.Mappable=function(){};ii.views.Mappable.prototype=new ii.views.View;ii.views.Mappable.prototype.addToMap=function(b,a,c){this.marker=this.map.addMarker(this.div,b,this.item.lat,this.item.lon,a,c)};ii.views.Mappable.prototype.addShadowToMap=function(c,d,b,a,e){this.shadowDiv=ii.pngImage(c,d,b);this.shadowDiv.className="marker shadow";this.shadowMarker=this.map.addMarker(this.shadowDiv,"shadows",this.item.lat,this.item.lon,a,e)};ii.views.Mappable.prototype.remove=function(){this.removeQueries();this.removeFromMap()};ii.views.Mappable.prototype.removeFromMap=function(){this.map.removeMarker(this.marker,"poiThumbs");if(this.shadowDiv){this.shadowDiv.parentNode.removeChild(this.shadowDiv)}if(this.shadowMarker){this.map.removeMarker(this.shadowMarker,"shadows")}};ii.views.Mappable.prototype.move=function(){this.map.moveMarker(this.marker,this.item.displayLat,this.item.displayLon)};ii.views.ActionLinks=function(){};ii.views.ActionLinks.prototype=new ii.views.View;ii.views.ActionLinks.prototype.statusDiv=function(){this.statusMsg=ii.elm("div"," ",{style:{margin:"4px 16px"}});this.statusDiv=ii.elm("div",{style:{display:"none"},className:"live"},this.statusMsg,ii.elm("hr"));return this.statusDiv};ii.views.ActionLinks.prototype.setStatus=function(a,c){ii.setText(this.statusMsg,a);this.statusDiv.style.display="block";var b=this;window.setTimeout(function(){ii.setText(b.statusMsg,"");b.statusDiv.style.display="none"},c||ii.set_status_duration)};ii.views.ActionLinks.prototype.clearStatus=function(){ii.setText(this.statusMsg,"");this.statusDiv.style.display="none"};ii.views.ActionLinks.prototype.postCommentLink=function(){var a=ii.elm("a",{href:"javascript://comment()"},(this.item.type=="u"?"[Send Message]":"[Post Comment]"));var b=this;a.onclick=function(){b.clearStatus();if(!ii.login){if(b.item.type=="u"){alert("You must be logged in to send a Message")}else{alert("You must be logged in to post a Comment")}return}if(b.commentDiv.style.display=="block"){b.commentDiv.style.display="none"}else{ii.log("displaying commentdiv");b.commentDiv.style.display="block";b.commentArea.focus()}ii.app.refreshCenterPaneShadow()};return a};ii.views.ActionLinks.prototype.postCommentDiv=function(){this.commentArea=ii.elm("textarea",{cols:30,rows:3});this.commentDiv=ii.elm("form",{style:{display:"none"}},this.commentArea,ii.elm("input",{type:"submit",value:"post"}),ii.elm("hr"));this.commentDiv.onmousedown=ii.stopPropagation;this.commentDiv.onmousemove=ii.stopPropagation;var a=this;this.commentDiv.onsubmit=function(){ii.log("sending msg");ii.get("p-new-comment",function(b){if(a.item.type=="u"){a.setStatus("Message sent")}else{a.setStatus("Comment posted")}ii.log("msg sent: "+b.result)},{entitytype:ii.typename[a.item.type],entityid:a.item.id,content:a.commentArea.value});a.setStatus("Sending...");a.commentArea.value="";this.style.display="none";return false};return this.commentDiv};ii.views.ActionLinks.prototype.postInLink=function(){var a=ii.elm("a",{href:"javascript://postIn()"},"[Post In]");if(!ii.login){a.onclick=function(){alert("You must be logged in to post this item in your collections")}}else{if(this.item.userid!=ii.login.id&&!this.item.ispublic){a.onclick=function(){alert("You are not allowed to post this item in your collections because it is not public.")}}else{var b=this;a.onclick=function(){if(b.postInDiv.style.display=="block"){b.postInDiv.style.display="none"}else{b.postInDiv.style.display="block";b.postInLoadMySets()}ii.app.refreshCenterPaneShadow()}}}return a};ii.views.ActionLinks.prototype.postInDiv=function(){this.postInSelect=ii.elm("select",{className:"postedIn",multiple:"yes",size:"8",style:{width:"150px"}});var a=this.postInSelect;var b=ii.elm("input",{type:"submit",value:"Save"});var c=this;function d(){ii.startWaitButton(b);var e=[0];var f=a.getElementsByTagName("option");for(var g=0;g<f.length;g++){if(f[g].selected){e.push(f[g].value)}}ii.get("p-upd-"+entitytype,function(h){ii.endWaitButton(b);ii.log("updating sets: "+h.result);c.postInDiv.style.display="none";if(h.partialSuccess){c.setStatus("Some changes were not made because that would change the item's security settings",10)}ii.app.currentPane.itemQuery.doUpdate()},{id:item.id,sets:e.join(",")});return false}this.postInDiv=ii.elm("form",{className:"postIn",style:{display:"none"},onsubmit:d,onmousedown:ii.stopPropagation,onmousemove:ii.stopPropagation},ii.elm("p","Post this ",ii.typesingle[this.item.type]," in your Collections"),ii.elm("p",{className:"note"},ii.typesingle[this.item.type]," inherits the Collection's Privacy"),ii.elm("p",{className:"header"},"My Collections"),ii.elm("div",{style:{marginBottom:"10px",position:"relative",width:"100%"}},a,b),ii.elm("p",{className:"footer"},"Control Click (PC) or Apple Click (Mac) to select ","multiple Collections. Read our ",ii.elm("a",{href:"#rel&tab=HelpFAQ&q=postin"},"FAQ")," for help on the Post In feature."));return this.postInDiv};ii.views.ActionLinks.prototype.postInLoadMySets=function(){this.postInSelect.innerHTML="";var c="";var j=(this.item.postedin.length==0);var d=ii.elm("option",{className:"private",value:0},"Private");if(j){d.selected="selected"}this.postInSelect.appendChild(d);for(var e=0;e<this.item.postedin.length;e++){var g=this.item.postedin[e].type;var b=this.item.postedin[e].id;var a=this.item.postedin[e].name;if(g=="trip"){continue}if(g=="group"&&b==1){g="world"}if(g=="group"&&a=="Friends"){g="friends"}var d=ii.elm("option",{className:g,value:b,selected:"selected"},a);this.postInSelect.appendChild(d);c+="_"+this.item.postedin[e].id+"_"}var f=this;var h=ii.get("q-mysets",function(p){for(var r=0;r<p.items.length;r++){if(c.indexOf("_"+p.items[r].id+"_")>=0){continue}var o=p.items[r].type;var q=p.items[r].id;var l=p.items[r].name;if(o=="group"&&q==1){o="world"}if(o=="group"&&l=="Friends"){o="friends"}var m=ii.elm("option",{className:o,value:q},l);this.postInSelect.appendChild(m)}},{})};ii.views.ItemList=function(){};ii.views.ItemList.prototype=new ii.views.View;ii.views.ItemList.prototype.addHeader=function(e){var d=ii.elm("span",""+this.item[e.dataField]);this.fields[e.dataField]=d;var h=(this.item[e.dataField]>0);var l=ii.elm("p",{className:"loading"},"Loading ...");var f=ii.elm("div",{className:"items"},l);var g=new ii.Query(e.type,{interval:10000},e.filter);g.setQueryOpts({fields:"basic,distance,count,content"});g.addListener({addItem:function(o){var m=o.createView("ListItem");f.insertBefore(m.div,f.firstChild)},itemsDone:function(){l.style.display="none"}});g.addListener(ii.app.map);if(e.expand&&h){g.start()}var j=ii.elm("div",{className:"hdr",href:"#rel"},ii.elm("div",{className:"arrow"}),e.label+" ",ii.elm("span",{className:"cnt"},"(",d,")"));var b=(e.expand&&h)?"expanded ":"collapsed ";var a=ii.elm("div",{className:"item_browser "+b+e.type+" "+(h?"":"noitems")},j,f,ii.elm("div",{className:"ftr"}));var c=this;j.onclick=function(){if(c.item[e.dataField]>0){if(a.className.indexOf("expanded")>=0){a.className=a.className.replace("expanded","collapsed");g.stop()}else{a.className=a.className.replace("collapsed","expanded");l.style.display="";g.start()}}};this.div.appendChild(a);ii.log("adding query: "+g.type);this.queries.push(g)};ii.views.TabDetails=function(){};ii.views.TabDetails.prototype=new ii.views.View;ii.views.TabDetails.prototype.initFields=function(){this.fields.author.appendChild(ii.elm("img",{src:"/srv/d-media.php?entitytype=user&entityid="+this.item.userid+"&width=60&height=45",style:{cssFloat:"right"}}));this.fields.author.appendChild(ii.userLink(this.item.userid,this.item.author))};ii.views.TabDetails.prototype.initForm=function(e,d){var h=(this.item.type=="u"?this.item.id:this.item.userid);var g=this.fields[e+"_form"];var c=this.fields[e+"_actionbar"];var b=this.fields[e+"_editbtn"];var a=this.fields[e+"_cancelbtn"];this.setEditMode(g,false);if(ii.login&&(ii.login.id==h||ii.login.isAdmin)){c.style.display="block";var f=this;b.onclick=function(){f.setEditMode(g,true)};a.onclick=function(){f.setEditMode(g,false)};g.onsubmit=d}else{ii.log("Setting up "+e+"_actionbar");c.style.display="none"}};ii.views.TabDetails.prototype.setEditMode=function(a,b){if(b){a.className=a.className.replace("viewmode","editmode")}else{a.className=a.className.replace("editmode","viewmode")}};ii.views.TabDetails.prototype.addComments=function(){var d=this.fields.commentlist;ii.log("comments : "+d);if(!d){return}d.innerHTML="";var b={count:100,type:"comment"};var a=ii.typename[this.item.type].replace("group","set").replace("album","set").replace("spot","set");b.entitytype=a;b.entityid=this.item.id;var c=new ii.Query("thread",{interval:15000},b);c.addListener({addItem:function(f){var e=f.createView("TabView",{title:"Comments"});d.appendChild(e.div)}});c.start();this.queries.push(c)};ii.items.Item=function(){};ii.items.Item.prototype.init=function(b){for(var a in b){this[a]=b[a]}this.itemviews=[]};ii.items.Item.prototype.update=function(c){ii.log("item.update "+this.id);for(var a in c){this[a]=c[a]}for(var b=0;b<this.itemviews.length;b++){if(this.itemviews[b].update){this.itemviews[b].update()}}};ii.items.Item.prototype.remove=function(){while(this.itemviews.length>0){this.removeView(this.itemviews[0])}};ii.items.Item.prototype.onmouseover=function(){for(var a=0;a<this.itemviews.length;a++){if(this.itemviews[a].onmouseover){this.itemviews[a].onmouseover()}}};ii.items.Item.prototype.onmouseout=function(){for(var a=0;a<this.itemviews.length;a++){if(this.itemviews[a].onmouseout){this.itemviews[a].onmouseout()}}};ii.items.Item.prototype.removeView=function(a){var b=-1;for(var d=0;d<this.itemviews.length;d++){if(this.itemviews[d]==a){b=d;break}}if(b==-1){ii.error("Removing non existent view");return}for(var d in this.subQueries){this.subQueries[d].stop();delete this.subQueries[d]}if(a.div){var c=a.div.parentNode;if(c){c.removeChild(a.div)}}if(a.remove){a.remove()}this.itemviews.splice(b,1)};ii.items.Item.prototype.createView=function(d,c){var b=ii.typename[this.type];if(!ii.views[b]){ii.error("itemtype "+b+" has no views")}if(!ii.views[b][d]){ii.error(" Item "+b+", view "+d+" doesn t exist")}if(c){var a=new ii.views[b][d](this,c)}else{var a=new ii.views[b][d](this)}this.itemviews.push(a);return a};ii.set_interval_user_feed=3000;ii.set_interval_user_albums=5000;ii.set_interval_user_friends=5000;ii.set_interval_user_groups=10000;ii.set_interval_user_photos=15000;ii.set_interval_user_spots=15000;ii.set_interval_user_trips=15000;ii.set_user_animate_step=200;ii.set_user_blink_on=1400;ii.set_user_blink_off=200;ii.assert(ii.items);ii.assert(ii.views);ii.views.user={};ii.views.user.networks={MySpace:{url:"http://www.myspace.com/$nick"},LinkedIn:{url:"http://www.linkedin.com/in/$nick"},Flickr:{url:"http://www.flickr.com/photos/$nick/"},Hyves:{url:"http://$nick.hyves.nl"},Twitter:{url:"http://www.twitter.com/$nick"},Delicious:{url:"http://del.icio.us/$nick"},"Last.fm":{url:"http://www.last.fm/user/$nick"},Qik:{url:"http://qik.com/$nick"}};ii.views.user.networks.Qik.fillSettingsDiv=function(div,settings){eval("settings = "+settings);settings=settings||{};div.appendChild(ii.elm("div",{style:{padding:"0px 0px 10px 0px",borderBottom:"1px solid #cccccc"}},ii.elm("div",ii.elm("input",{type:"checkbox",name:"getQiks",checked:settings.getQiks}),ii.elm("label","Post your Qiks on bliin "))))};ii.views.user.networks.Qik.getSettings=function(b){var d={};var a=b.getElementsByTagName("input");for(var c in a){if(a[c].type=="checkbox"){d[a[c].name]=a[c].checked?true:false}else{d[a[c].name]=a[c].value}}return d};ii.views.user.networks.Twitter.fillSettingsDiv=function(div,settings){eval("settings = "+settings);settings=settings||{};settings.password=settings.password||"";div.appendChild(ii.elm("div",{style:{padding:"10px 0px",borderBottom:"1px solid #cccccc"}},ii.elm("label","Your Twitter Password:"),ii.elm("input",{type:"password",name:"password",value:""+settings.password,style:{position:"relative",left:"2px"}})));div.appendChild(ii.elm("img",{style:{display:"block",padding:"10px 0px"},src:"/media/bliin2twitter.png"}));div.appendChild(ii.elm("div",{style:{padding:"0px 0px 10px 0px",borderBottom:"1px solid #cccccc"}},ii.elm("div",ii.elm("input",{type:"checkbox",name:"sendLive",checked:settings.sendLive}),ii.elm("label","Tweet your bliin ",ii.elm("span",{className:"live"},"Live!"))),ii.elm("div",ii.elm("input",{type:"checkbox",name:"sendStatus",checked:settings.sendStatus}),ii.elm("label","Tweet your bliin Status Message")),ii.elm("div",ii.elm("input",{type:"checkbox",name:"sendPhoto",checked:settings.sendPhoto}),ii.elm("label","Tweet your bliin Photo Posts")),ii.elm("div",ii.elm("input",{type:"checkbox",name:"sendTrip",checked:settings.sendTrip}),ii.elm("label","Tweet your bliin Trip Recordings"))));div.appendChild(ii.elm("img",{style:{display:"block",padding:"10px 0px"},src:"/media/twitter2bliin.png"}));div.appendChild(ii.elm("div",{style:{padding:"0px 0px 10px 0px",marginBottom:"10px",borderBottom:"1px solid #cccccc"}},ii.elm("div",ii.elm("input",{type:"checkbox",name:"getStatus",checked:settings.getStatus}),ii.elm("label","bliin your Tweets (Status Messages)"))))};ii.views.user.networks.Twitter.getSettings=function(b){var d={};var a=b.getElementsByTagName("input");for(var c in a){if(a[c].type=="checkbox"){d[a[c].name]=a[c].checked?true:false}else{d[a[c].name]=a[c].value}}return d};ii.items.User=function(b){this.init(b);this.lat=parseFloat(this.lat);this.lon=parseFloat(this.lon);this.displayLat=parseFloat(this.lastlat)||this.lat;this.displayLon=parseFloat(this.lastlon)||this.lon;this.blink=0;if(this.status=="live"){var a=this;this.animationTimer=window.setInterval(function(){a.updatePos()},ii.set_user_animate_step+(Math.random()*50)-25)}else{this.animationTimer=0}};ii.items.User.prototype=new ii.items.Item;ii.items.User.prototype.update=function(e){for(var c in e){this[c]=e[c]}this.lat=parseFloat(this.lat);this.lon=parseFloat(this.lon);var b=(this.lat==this.displayLat&&this.lon==this.displayLon);if((!b||this.status=="live")&&!this.animationTimer){var a=this;this.animationTimer=window.setInterval(function(){a.updatePos()},ii.set_user_animate_step)}else{if((b&&this.status!="live")&&this.animationTimer){window.clearInterval(this.animationTimer);this.animationTimer=0}}for(var d=0;d<this.itemviews.length;d++){if(this.itemviews[d].update){this.itemviews[d].update()}}if(ii.login&&ii.login.id==e.id){ii.login.setUnread()}};ii.items.User.prototype.showPopup=function(a){this.popupAlwaysVisible=a;for(var b=0;b<this.itemviews.length;b++){if(this.itemviews[b].onmouseout){this.itemviews[b].onmouseout()}}};ii.views.user.Icon=function(b,a){if(!a||!a.map){ii.error("Icon should have map")}this.item=b;this.color=a.color;this.map=a.map;var c=b.getIconUrl(this.map.getZoom(),a.color);this.div=ii.elm("div",{className:"marker"},ii.elm("img",{src:c.url}));if(this.item.status=="live"){this.div.style.zIndex=200}else{this.div.style.zIndex=100}this.div.onmouseover=function(){b.onmouseover()};this.div.onmouseout=function(){b.onmouseout()};this.div.onclick=function(){if(window.ii_popup_z){b.popup_z=window.ii_popup_z++}b.popupAlwaysVisible=true;b.onmouseover()};this.marker=a.map.addMarker(this.div,"userIcons",b.lat,b.lon,-(c.size/2),-(c.size/2));this.map.addZoomListener(this,function(){this.update()});if(ii.login&&b!=ii.login.item&&b.id==ii.login.id&&ii.login.id!=34750){this.div.style.display="none"}};ii.views.user.Icon.prototype.blink=function(a){this.div.style.visibility=(a?"":"hidden")};ii.views.user.Icon.prototype.move=function(){this.map.moveMarker(this.marker,this.item.displayLat,this.item.displayLon)};ii.views.user.Icon.prototype.remove=function(){this.map.removeMarker(this.marker,"userIcons");this.map.removeZoomListener(this,this.update)};ii.views.user.Icon.prototype.update=function(){var a=this.item.getIconUrl(this.map.getZoom(),this.color);if(this.div.firstChild.src!=a.url){if(this.item.status=="live"){this.div.style.zIndex=200}else{this.div.style.zIndex=100}this.div.firstChild.src=a.url;this.marker.offset.x=this.marker.offset.y=-a.size/2;this.move()}};ii.items.User.prototype.updatePos=function(){if(this.status=="live"){if(this.blink==(ii.set_user_blink_on/ii.set_user_animate_step)){for(var a=0;a<this.itemviews.length;a++){if(this.itemviews[a].blink){this.itemviews[a].blink(0)}}}else{if(this.blink>=((ii.set_user_blink_off+ii.set_user_blink_on)/ii.set_user_animate_step)){for(var a=0;a<this.itemviews.length;a++){if(this.itemviews[a].blink){this.itemviews[a].blink(1)}}this.blink=0}}this.blink++}if((Math.abs(this.displayLat-this.lat)<0.000001)&&Math.abs(this.displayLon-this.lon)<0.000001){if(this.status!="live"){window.clearInterval(this.animationTimer);this.animationTimer=0}return}if(this.status=="live"){this.displayLat+=0.01*(this.lat-this.displayLat);this.displayLon+=0.01*(this.lon-this.displayLon)}else{this.displayLat+=0.1*(this.lat-this.displayLat);this.displayLon+=0.1*(this.lon-this.displayLon)}for(var a=0;a<this.itemviews.length;a++){if(this.itemviews[a].move){this.itemviews[a].move(this.displayLat,this.displayLon)}}};ii.items.User.prototype.getIconUrl=function(h,e){var f="icon_user/";if(e=="green"){f+="live/"}else{if(e=="blue"){f+="trip/"}else{if(this.status!="live"){f+="idle/"}else{f+="live/"}}}var b=(h<=0.3?16:(h<=0.6?24:32));f+=b+"/";if(this.status!="live"){var g=0}else{var d=Math.abs(this.lon-this.displayLon);var a=-Math.abs(this.lat-this.displayLat);if(a==0){var j=(this.lon>this.displayLon)?90:270}else{var j=Math.atan(d/-a)*(360/(2*Math.PI))}if(this.lon>this.displayLon&&this.lat<this.displayLat){j=180-j}if(this.lon<this.displayLon&&this.lat<this.displayLat){j=180+j}if(this.lon<this.displayLon&&this.lat>this.displayLat){j=360-j}var g=Math.round(j/30)*30;if(g==360){g=0}}f+=g+".png";return{url:"/media/"+f,size:b}};ii.items.User.prototype.getLiveStatusElement=function(b){var b=(b===undefined)?{}:b;b.prefix=(b.prefix)?b.prefix:"";b.suffix=(b.suffix)?b.suffix:"";b.classname=(b.classname)?" "+b.classname:"";var a="";var d="lastseen";var e=[];switch(this.status){case"lastloc":a=document.createTextNode("Last seen "+ii.formatDate(this.locmodified,"shortrelative"));break;case"idle":var c=ii.spotLink(this.spotid,this.spotname);c.className="spot micro";a=ii.elm("span","Last seen at ",c," ",ii.formatDate(this.locmodified,"shortrelative"));break;case"live":d="";if(parseInt(this.speed)){a=ii.elm("span",ii.elm("span",{className:"live"},"Live!")," travelling "+Math.round(parseInt(this.speed)*3.6)+" km/h")}else{a=ii.elm("span",{className:"live"},"Live!")}break;default:a=document.createTextNode("Unknown");break}return ii.elm("span",{className:d+b.classname},b.prefix,a,b.suffix)};ii.views.user.TabDetailsUser=function(e,c){var d=this;this.item=e;onsubmit=function(){if(!this.tagName){return}ii.startWaitButton(this.savebtn);this.birthday.value=this.birthyear.value.concat("-",this.birthmonth.value,"-",this.birthdayofmonth.value);var h=ii.iframeDocument(document.getElementById("ii_details_user_frame"));h.innerHTML="";var g=this;function f(){var j=ii.iframeDocument(document.getElementById("ii_details_user_frame"));if(j.innerHTML.match('"result"')){d.details.setEditMode(g,false);ii.endWaitButton(g.savebtn);ii.login.query.doUpdate();ii.login.updateAvatars();return}window.setTimeout(f,250)}f()};this.details=new ii.views.Details(e,c.tabElm,onsubmit);if(ii.login){var b=document.getElementById("ii_details_user_form");b.action="/srv/p-upd-profile.php?key="+ii.login.key;function a(){var f=this;ii.startWaitButton(f.savebtn);var g={id:e.id,website:this.website.value,networks:ii.views.networksGet(document.getElementById("ii_details_user_networks_edit"))};ii.get("p-upd-profile",function(h){ii.endWaitButton(f.savebtn);d.details.setEditMode(f,false);ii.login.query.doUpdate()},g);return false}this.details.setupForm("user_networks",a)}else{this.details.setupForm("user_networks",function(){})}if(ii.login&&ii.login.id==e.id){document.getElementById("ii_details_user_subtabs").style.display=""}else{document.getElementById("ii_details_user_subtabs").style.display="none"}this.update()};ii.views.user.TabDetailsUser.prototype.update=function(){var b=document.getElementById("ii_details_user_form");if(b.className.indexOf("editmode")>=0){return}var b=document.getElementById("ii_details_user_networks_form");if(b.className.indexOf("editmode")>=0){return}var a={view_birthday:function(d,c){if(c.birthday!="0"){ii.setText(d,ii.formatDate(c.birthday,"humandate"))}else{ii.setText(d,"Unknown")}},birthdayofmonth:function(d,c){d.value=ii.formatDate(c.birthday,"day")},birthmonth:function(d,c){d.value=ii.formatDate(c.birthday,"month")},birthyear:function(d,c){d.value=ii.formatDate(c.birthday,"year")},totallivetime:function(d,c){if(c.livetime){ii.setText(d,ii.formatTimespan(c.livetime))}else{ii.setText(d,"None")}},totaltravelled:function(d,c){if(c.livemeters){ii.setText(d,ii.formatDistance(c.livemeters))}else{ii.setText(d,"None")}},view_sex:function(d,c){if(c.sex=="m"){ii.setText(d,"Male")}else{if(c.sex=="f"){ii.setText(d,"Female")}else{ii.setText(d,"Unknown")}}},sex:function(d,c){d.value=c.sex},homecountry:function(d,c){if(d.tagName=="select"||d.tagName=="SELECT"){d.value=c.homecountry}else{ii.setText(d,c.homecountry)}},avatar:function(d,c){},website_link:function(e,d){e.innerHTML="";var c=d.website;if(!/http/.test(c)){c="http://"+c}e.appendChild(ii.elm("a",{target:"_blank",href:c},d.website))},networks:function(d,c){d.innerHTML="";d.appendChild(ii.views.networkDisplay(c.networks))},networks_edit:function(d,c){d.innerHTML="";d.appendChild(ii.views.networkEdit(c.networks))}};this.details.update(a)};ii.views.user.TabDetailsUser.prototype.remove=function(){delete this.item};ii.views.user.TabDetailsUserSettings=function(a){this.setupAccount(a);this.setupPrivacy(a);this.setupPassword(a);this.setupDelete(a)};ii.views.user.TabDetailsUserSettings.prototype.setupAccount=function(b){ii.setText(document.getElementById("ii_settings_username"),b.name);document.getElementById("ii_settings_email").value=b.email||"";document.getElementById("ii_settings_phone").value=b.phone||"";ii.setText(document.getElementById("ii_settings_upload_email"),b.uploademail);document.getElementById("ii_settings_account_result").style.display="none";var a=document.getElementById("ii_settings_account_form");a.onsubmit=function(){var c=this;ii.startWaitButton(c.savebtn);var d={email:c.email.value,phone:c.phone.value};ii.get("p-upd-profile",function(e){ii.endWaitButton(c.savebtn);ii.login.query.doUpdate();document.getElementById("ii_settings_account_result").style.display="block";window.setTimeout(function(){document.getElementById("ii_settings_account_result").style.display="none"},3000)},d);return false}};ii.views.user.TabDetailsUserSettings.prototype.setupPrivacy=function(b){var c=document.getElementById("ii_details_user_settings_visible");ii.views.fillPostInDropDown(c,{groupsOnly:true,value:b.visibility});var a=document.getElementById("ii_settings_privacy_form");a.onsubmit=function(){var d=this;ii.startWaitButton(d.savebtn);var e={visibility:c.value};ii.get("p-upd-profile",function(f){ii.endWaitButton(d.savebtn);ii.login.query.doUpdate();document.getElementById("ii_settings_visibility_result").style.display="block";window.setTimeout(function(){document.getElementById("ii_settings_visibility_result").style.display="none"},3000)},e);return false}};ii.views.user.TabDetailsUserSettings.prototype.setupPassword=function(f){var e=document.getElementById("ii_settings_password_form");var b=document.getElementById("ii_settings_password_error");var a=document.getElementById("ii_settings_password_result");var g=e;var c=document.getElementById("ii_settings_password");var d=document.getElementById("ii_settings_password_cancel");d.onclick=function(){g.style.display="none"};ii.setText(b,"");c.onclick=function(){g.style.display="block"};e.onsubmit=function(){var h=this;if(h.password.value!=h.password2.value){ii.setText(b,"Passwords are not identical");return false}else{ii.setText(b,"")}ii.startWaitButton(h.savebtn);var j={password:h.password.value};ii.get("p-upd-profile",function(l){ii.endWaitButton(h.savebtn);if(l.result!="OK"){ii.setText(b,l.msg)}else{ii.login.query.doUpdate();a.style.display="block";window.setTimeout(function(){a.style.display="none";g.style.display="none"},3000)}},j);return false}};ii.views.user.TabDetailsUserSettings.prototype.setupDelete=function(c){var d=document.getElementById("ii_settings_delete_submit");var e=document.getElementById("ii_settings_delete_s");var a=document.getElementById("ii_settings_delete");var b=document.getElementById("ii_settings_delete_cancel");b.onclick=function(){e.style.display="none"};a.onclick=function(){e.style.display="block"};d.onclick=function(){ii.startWaitButton(a);ii.get("p-del-user",function(f){if(f.result=="ERR"){alert("error deleting your accounr")}else{ii.endWaitButton(a);alert("Your account has been deleted. The page will reload");window.location="http://bliin.com";window.location.reload(true)}})}};ii.views.user.TabDetailsUserSettings.prototype.setupMapType=function(b){var a=document.getElementById("ii_details_user_Settings_form");a.maptype.value=window.ii_layer_current;a.onsubmit=function(){ii.setCookie("maptype",this.maptype.value,14);window.location="#rel&item=ME.0&tab=";window.location.reload(true);return false}};ii.views.user.ListItem=function(b){this.item=b;this.statusElm=document.createElement("span");this.messageElm=document.createElement("span");var a=b.name;if(b.ismember){a=ii.elm("span",a,ii.elm("small"," ("+b.ismember+")"))}var c={name:a,status:this.statusElm,message:this.messageElm};if(!b.lastvisit){c.distance=ii.formatDistance(this.item.distance)}else{c["last visit"]=ii.formatDate(b.lastvisit,"relative")}this.div=ii.views.generateListitem({link:"#rel&item=u."+b.id,img:"/srv/d-media.php?entitytype=user&width=64&height=48&entityid="+b.id,labels:c,zoomto:function(d){ii.app.map.zoomTo(b.lat,b.lon,50,0);ii.stopPropagation(d)}});this.update();this.div.onmouseover=function(){b.onmouseover()};this.div.onmouseout=function(){b.onmouseout()}};ii.views.user.ListItem.prototype.onmouseover=function(){this.div.style.backgroundColor="#f0f0f0"};ii.views.user.ListItem.prototype.onmouseout=function(){this.div.style.backgroundColor=""};ii.views.user.ListItem.prototype.update=function(){var a=this.statusElm;this.statusElm=this.item.getLiveStatusElement();a.parentNode.replaceChild(this.statusElm,a);this.messageElm.innerHTML=ii.text2href(this.item.message)};ii.views.user.LargeListItem=function(f){this.item=f;this.statusElm=document.createElement("span");this.messageElm=document.createElement("span");this.locationElm=ii.geoCode(f.lat,f.lon);var b=document.createTextNode(f.name);var h={name:b,status:this.statusElm,message:this.messageElm};if(f.distance){h.distance=ii.formatDistance(f.distance)}if(f.heartrate){this.heartRateElm=ii.elm("span",""+f.heartrate+" bpm");h.heartrate=this.heartRateElm}h.location=this.locationElm;this.info=ii.views.generateListitem({link:"#rel&item=u."+f.id,img:"/srv/d-media.php?width=64&height=48&entitytype=user&entityid="+f.id,labels:h});this.info.className="item large";var d=new ii.views.StatusElms();var a=new ii.views.CommentElms("user",f.id,d);var g=new ii.views.SendAFriendElms(f,"user",f.id,d);var e=ii.elm("a",{href:"javascript://addfriend()"},"[Add to Friends]");e.onclick=function(){if(!ii.login){alert("You must be logged in to make Friends");return}d.setStatus("Adding user to Friends...");ii.get("p-new-friend",function(j){d.setStatus("Added user to Friends");e.style.display="none";c.style.display=""},{friendid:f.id})};var c=ii.elm("a",{href:"javascript://dropfriend()"},"[Drop Friend]");c.onclick=function(){if(!ii.login){alert("You must be logged in to make Friends");return}d.setStatus("Removing user from Friends...");ii.get("p-del-friend",function(j){d.setStatus("Removed user from Friends");e.style.display="";c.style.display="none"},{friendid:f.id})};if(f.isfriend>0||(ii.login&&f.id==ii.login.id)){e.style.display="none"}if(f.isfriend==0||(ii.login&&f.id==ii.login.id)){c.style.display="none"}this.div=ii.elm("div",this.info,ii.elm("div",{className:"listitem_links"},a.commentLink," ",g.sendAFriendLink," ",e," ",c),a.commentDiv,g.sendAFriendDiv,d.statusDiv);this.update();this.info.onmouseover=function(){f.onmouseover()};this.info.onmouseout=function(){f.onmouseout()}};ii.views.user.LargeListItem.prototype.update=function(){var a=this.item.getLiveStatusElement();this.statusElm.parentNode.replaceChild(a,this.statusElm);this.statusElm=a;ii.geoCode(this.item.lat,this.item.lon,0,this.locationElm);ii.setText(this.messageElm,this.item.message);if(this.item.heartrate){ii.setText(this.heartRateElm,""+this.item.heartrate+" bpm")}};ii.views.user.ItemCounter=function(b,a){this.item=b;this.subItemsets=[];this.div=ii.elm("div");this.update();window.setTimeout(function(){a.onDone()},0)};ii.views.user.ItemCounter.prototype.update=function(){this.div.innerHTML="";for(var a=0;a<this.item.albums.length;a++){ii.views.addHeader(this.div,this.item.albums[a].name,"album."+this.item.albums[a].id,"album",this.item.albums[a].count)}ii.views.addHeader(this.div,"Friends","friends","friends",this.item.friends);ii.views.addHeader(this.div,"Photos & Videos","allphotos","poi",this.item.pois);ii.views.addHeader(this.div,"Trips","alltrips","trip",this.item.trips);ii.views.addHeader(this.div,"Spots","spots","spot",this.item.spots);ii.views.addHeader(this.div,"Groups","groups","group",this.item.groups)};ii.views.user.ItemBrowser=function(d,c){this.item=d;this.map=c.map;this.div=ii.elm("div",{style:{backgroundColor:"white"}});this.subItemsets=[];var b=[];c.pane=c.pane||"";for(var f=0;f<d.albums.length;f++){if(c.pane==""||c.pane=="album."+d.albums[f].id){if(c.pane=="album."+d.albums[f].id){ii.last_active_setid=d.albums[f].id}b.push(new ii.views.ItemBrowser({id:"album."+d.albums[f].id,label:d.albums[f].name,query:new ii.Query("poi",{interval:ii.set_interval_user_albums},{set:d.albums[f].id}),type:"album"},c))}}if(c.pane==""||c.pane=="friends"){b.push(new ii.views.ItemBrowser({id:"friends",label:"Friends",query:new ii.Query("user",{interval:ii.set_interval_user_friends},{friendof:d.id}),type:"friends"},c))}if(c.pane==""||c.pane=="allphotos"){b.push(new ii.views.ItemBrowser({id:"allphotos",label:"Photos & Videos",query:new ii.Query("poi",{interval:ii.set_interval_user_photos},{user:d.id}),type:"poi"},c))}if(c.pane==""||c.pane=="alltrips"){b.push(new ii.views.ItemBrowser({id:"alltrips",label:"Trips",query:new ii.Query("trip",{interval:ii.set_interval_user_trips},{user:d.id}),type:"trip"},c))}if(c.pane==""||c.pane=="spots"){b.push(new ii.views.ItemBrowser({id:"spots",label:"Spots",query:new ii.Query("spot",{interval:ii.set_interval_user_spots},{user:d.id}),type:"spot"},c))}if(c.pane==""||c.pane=="groups"){b.push(new ii.views.ItemBrowser({id:"groups",label:"Groups",query:new ii.Query("group",{interval:ii.set_interval_user_groups},{user:d.id}),type:"group"},c))}if(c.pane==""){d.popupAlwaysVisible=true}else{d.popupAlwaysVisible=false}d.onmouseout();for(var f=0;f<b.length;f++){this.div.appendChild(b[f].div);this.subItemsets.push(b[f].query);b[f].query.addListener(this.map)}if(c.onDone){var a=this.subItemsets.length;function e(j,h,g){if(!--a){c.onDone()}}for(var f=0;f<this.subItemsets.length;f++){this.subItemsets[f].addListener({itemsDone:e})}}};ii.views.user.ItemBrowser.prototype.start=function(){for(var a=0;a<this.subItemsets.length;a++){this.subItemsets[a].start()}};ii.views.user.ItemBrowser.prototype.remove=function(){for(var a=0;a<this.subItemsets.length;a++){this.subItemsets[a].stop()}};ii.views.user.IconPopup=function(d,a){this.item=d;this.map=a.map;if(d.popupAlwaysVisible==undefined){d.popupAlwaysVisible=a.alwaysVisible}var b=ii.pngImage("user_info_bg.png",184,110);b.className="bg";this.statusElm=this.item.getLiveStatusElement();var c=this;this.div=ii.elm("div",{className:"iconpopup marker"},b,ii.elm("img",{className:"avatar",src:"/srv/d-media.php?width=64&height=48&entitytype=user&entityid="+d.id}),ii.elm("div",{className:"content"},ii.elm("div",ii.userLink(d.id,d.name)),ii.elm("div",this.statusElm)),ii.elm("img",{className:"button",style:{left:"160px",top:"52px"},src:"/media/poi_zoom_smll.png",onmouseover:ii.onmouseoverbtn,onmouseout:ii.onmouseoutbtn,onclick:function(){a.map.zoomTo(d.lat,d.lon,50,0)}}),ii.elm("img",{className:"button",style:{left:"160px",top:"5px"},src:"/media/button_userpop_close.png",onmouseover:ii.onmouseoverbtn,onmouseout:ii.onmouseoutbtn,onclick:function(){d.popupAlwaysVisible=false;c.div.style.visibility="hidden"}}));this.shadowDiv=ii.pngImage("user_info_shadow.png",208,60);this.shadowDiv.className="marker shadow";this.shadowMarker=a.map.addMarker(this.shadowDiv,"shadows",d.lat,d.lon,-28,-71);this.div.onmouseover=function(){d.onmouseover()};this.div.onmouseout=function(){d.onmouseout()};this.onmouseout();this.marker=a.map.addMarker(this.div,"userPopups",d.lat,d.lon,-58,-124)};ii.views.user.IconPopup.prototype.onmouseout=function(){this.div.style.visibility=this.shadowDiv.style.visibility=(this.item.popupAlwaysVisible?"":"hidden")};ii.views.user.IconPopup.prototype.onmouseover=function(){this.div.style.visibility=this.shadowDiv.style.visibility=""};ii.views.user.IconPopup.prototype.move=function(){this.map.moveMarker(this.marker,this.item.displayLat,this.item.displayLon);this.map.moveMarker(this.shadowMarker,this.item.displayLat,this.item.displayLon)};ii.views.user.IconPopup.prototype.remove=function(){this.map.removeMarker(this.marker,"userPopups");this.shadowDiv.parentNode.removeChild(this.shadowDiv);this.map.removeMarker(this.shadowMarker,"shadows")};ii.views.user.IconPopup.prototype.update=function(b){var a=this.statusElm;this.statusElm=this.item.getLiveStatusElement();a.parentNode.replaceChild(this.statusElm,a)};ii.views.user.Details=function(f,c){var g=ii.geoCode(f.lat,f.lon);var e=ii.elm("p",{className:"clear_wrapper"},ii.userLink(f.id,f.name)," ",f.getLiveStatusElement()," @ ",g);var b="";if(f.message&&f.message!=""){b=ii.elm("div",{className:"content_background clear_wrapper"},ii.elm("p",f.message))}var a=c.userid;var d="hidden";if((ii.login&&(ii.login.id==a)||ii.login.id==f.userid)){d="visible"}this.div=ii.elm("div",{className:"group_user_wrapper clear_wrapper"},ii.elm("input",{type:"checkbox",className:"checkbox",style:{visibility:d}}),ii.elm("img",{src:"/srv/d-media.php?width=64&height=48&entitytype=user&entityid="+f.id}),ii.elm("div",{className:"content_wrapper"},e,b))};ii.assert(ii.views.user);ii.views.user.TabMyInbox=function(t,b){var x=b.tabElm;x.innerHTML="";var g=ii.login.item.unreadmsg;var y=ii.login.item.unreadcmt;var h=ii.views.unreadIndicator(g);var u=ii.views.unreadIndicator(y);h.id="ii_unread_msg";u.id="ii_unread_cmt";var f=new ii.views.CenterPane({header_text:"My Inbox"});var v=ii.elm("div",{style:{cssFloat:"right",fontSize:"12px",width:"250px",paddingRight:"96px",fontWeight:"normal"}});var o=new ii.views.CenterPaneSection({header_text:ii.elm("span",v,"Conversations")});f.addSection(o);var r=new ii.views.CenterPaneNavTab(f,{text:ii.elm("span","Conversations",h),selected:true});var s=new ii.views.CenterPaneNavTab(f,{text:ii.elm("span","Comments",u),href:"#rel&tab=MyInboxComments"});var p=10;this.query=new ii.Query("comment",{interval:10000},{recipient:ii.login.id,count:p,countperuser:100});var d=this.query;function q(A){d.setQueryOpts({start:p*(A-1)})}var l=new ii.views.Pager(q);v.appendChild(l.divs[0]);this.query.addListener(l);var d=d;var m=ii.elm("p",{style:{display:"none"}},"No messages found");var e=ii.elm("form",{className:"inbox_search",style:{display:"none"}},ii.elm("label","Enter search terms:"),ii.elm("input",{name:"query"}),ii.elm("input",{type:"submit",value:"Search"}),m,{onsubmit:function(){d.setQueryOpts({query:ii.getElmByName(this,"query").value,start:0});return false}});var j=ii.elm("p",{style:{display:"none"}},"You have no messages in your inbox");o.appendCustomElm("after",e);o.appendCustomElm("after",j);var a=[];function c(A){if(A){d.start()}else{d.doUpdate()}ii.login.query.doUpdate()}this.query.addListener({addItem:function(C){if(ii.login.id==C.userid){var D=C.recipientid;var B=C.recipientname}else{var D=C.userid;var B=C.author}if(!a[D]){a[D]=new ii.views.Thread("user",D,"Conversation with "+B,{collapsable:true,onUpdate:c});f.insertCPS(a[D].section,o.cp_s)}var A=a[D];A.insertItem(C)},countItems:function(B,D,C){if(ii.getTextBoxValue(ii.getElmByName(e,"query"))==""){var A=(C>0);m.style.display="none"}else{var A=true;m.style.display=(C==0?"":"none")}j.style.display=(!A?"":"none");e.style.display=(A?"":"none")}});this.query.start();x.appendChild(f.getElm())};ii.views.user.TabMyInbox.prototype.remove=function(){this.query.stop()};ii.views.user.TabMyInboxComments=function(t,b){var x=b.tabElm;x.innerHTML="";var g=ii.login.item.unreadmsg;var y=ii.login.item.unreadcmt;var h=ii.views.unreadIndicator(g);var u=ii.views.unreadIndicator(y);h.id="ii_unread_msg2";u.id="ii_unread_cmt2";var f=new ii.views.CenterPane({header_text:"My Inbox"});var v=ii.elm("div",{style:{cssFloat:"right",fontSize:"12px",width:"250px",paddingRight:"96px",fontWeight:"normal"}});var o=new ii.views.CenterPaneSection({header_text:ii.elm("span",v,"Comments")});f.addSection(o);var r=new ii.views.CenterPaneNavTab(f,{text:ii.elm("span","Conversations",h),href:"#rel&tab=MyInbox"});var s=new ii.views.CenterPaneNavTab(f,{text:ii.elm("span","Comments",u),selected:true});var p=10;this.query=new ii.Query("comment",{interval:10000},{recipient:ii.login.id,type:"comment",count:p,countperentity:100});var d=this.query;function q(A){d.setQueryOpts({start:p*(A-1)})}var l=new ii.views.Pager(q);v.appendChild(l.divs[0]);this.query.addListener(l);var d=d;var m=ii.elm("p",{style:{display:"none"}},"No Comments found");var e=ii.elm("form",{className:"inbox_search",style:{display:"none"}},ii.elm("label","Enter search terms:"),ii.elm("input",{name:"query"}),ii.elm("input",{type:"submit",value:"Search"}),m,{onsubmit:function(){d.setQueryOpts({query:ii.getElmByName(this,"query").value,start:0});return false}});var j=ii.elm("p",{style:{display:"none"}},"You have no Comments in your Inbox");o.appendCustomElm("after",e);o.appendCustomElm("after",j);var a=[];function c(A){d.doUpdate();ii.login.query.doUpdate()}this.query.addListener({addItem:function(C){var B=C.entitytype+"."+C.entityid;var D=ii.elm("span",{className:"inbox_hdr "+C.entitytype}," "+C.entityname);if(!a[B]){a[B]=new ii.views.Thread(C.entitytype,C.entityid,D,{collapsable:true,onUpdate:c,showAvatar:true});f.insertCPS(a[B].section,o.cp_s)}var A=a[B];A.insertItem(C)},countItems:function(B,D,C){if(ii.getElmByName(e,"query").value==""){var A=(C>0);m.style.display="none"}else{var A=true;m.style.display=(C==0?"":"none")}j.style.display=(!A?"":"none");e.style.display=(A?"":"none")}});this.query.start();x.appendChild(f.getElm())};ii.views.user.TabMyInboxComments.prototype.remove=function(){this.query.stop()};ii.views.user.MyWelcomeBox=function(c){this.item=c;this.statusElm=document.createElement("span");this.locationElm=ii.geoCode(c.lat,c.lon);var b=ii.elm("form",{onmousedown:ii.stopPropagation},ii.elm("div",{className:"messagebox"},ii.elm("input",{name:"msgbox",maxLength:140,value:c.message,style:{paddingLeft:"50px",width:"175px"},onblur:function(){ii.handle_messagebox_blur(ii.getElmByName(b,"msgbox"))},onfocus:function(){ii.handle_messagebox_focus(ii.getElmByName(b,"msgbox"))}}),ii.elm("span",{className:"field",style:{background:"transparent",border:"0px",width:"50px"}},"message: "),ii.elm("img",{src:"/media/balloon_curve_SML.gif"}),ii.elm("input",{name:"submitbtn",type:"submit",value:"Set"})),{onsubmit:function(){var e=ii.getElmByName(this,"submitbtn");ii.startWaitButton(e);var f=ii.getElmByName(this,"msgbox");ii.get("p-upd-profile",function(g){ii.endWaitButton(e)},{message:f.value});return false}});var d={status:this.statusElm,location:this.locationElm};this.info=ii.views.generateListitem({img:"/srv/d-media.php?width=64&height=48&entitytype=user&entityid="+c.id,labels:d,item_handler:false});this.info.className="item large";var a=this.info.getElementsByTagName("div")[0];a.insertBefore(ii.elm("p",{style:{fontSize:"14px",fontWeight:"bold",margin:"0px",padding:"0px"}},"Hi "+c.name+"!"),a.childNodes[0]);this.info.appendChild(ii.elm("br",{style:{clear:"both"}}));this.info.appendChild(b);this.div=ii.elm("div",this.info);this.update();this.div.onmousedown=ii.stopPropagation};ii.views.user.MyWelcomeBox.prototype.update=function(){var a=this.item.getLiveStatusElement();this.statusElm.parentNode.replaceChild(a,this.statusElm);this.statusElm=a;ii.geoCode(this.item.lat,this.item.lon,0,this.locationElm)};ii.views.user.MyItemCounter=function(b,a){this.item=b;this.subItemsets=[];this.div=ii.elm("div");this.update();window.setTimeout(function(){a.onDone()},0)};ii.views.user.MyItemCounter.prototype.update=function(){this.div.innerHTML="";for(var a=0;a<this.item.albums.length;a++){ii.views.addHeader(this.div,this.item.albums[a].name,"album."+this.item.albums[a].id,"album",this.item.albums[a].count)}ii.views.addHeader(this.div,"My Friends","friends","friends",this.item.friends);ii.views.addHeader(this.div,"My Photos & Videos","allphotos","poi",this.item.pois);ii.views.addHeader(this.div,"My Trips","alltrips","trip",this.item.trips);ii.views.addHeader(this.div,"My Spots","spots","spot",this.item.spots);ii.views.addHeader(this.div,"My Groups","groups","group",this.item.groups)};ii.views.user.MyItemBrowser=function(d,c){this.item=d;this.map=c.map;this.div=ii.elm("div",{style:{backgroundColor:"white"}});this.subItemsets=[];var b=[];c.pane=c.pane||"";for(var f=0;f<d.albums.length;f++){if(c.pane==""||c.pane=="album."+d.albums[f].id){if(c.pane=="album."+d.albums[f].id){ii.last_active_setid=d.albums[f].id}b.push(new ii.views.ItemBrowser({id:"album."+d.albums[f].id,label:d.albums[f].name,query:new ii.Query("poi",{interval:ii.set_interval_user_albums},{set:d.albums[f].id}),type:"album"},c))}}if(c.pane==""||c.pane=="friends"){b.push(new ii.views.ItemBrowser({id:"friends",label:"My Friends",query:new ii.Query("user",{interval:ii.set_interval_user_albums},{friendof:d.id}),type:"friends",nocontent:ii.elm("span","You have no Friends yet. ","Use the [Add Friends] link to start adding Friends to your network ","Read our ",ii.elm("a",{href:"#rel&tab=HelpFAQ&q=home_friends"},"FAQ")," for help on Adding Friends.")},c))}if(c.pane==""||c.pane=="spots"){b.push(new ii.views.ItemBrowser({id:"spots",label:"My Spots",query:new ii.Query("spot",{interval:ii.set_interval_user_spots},{user:d.id}),type:"spot",nocontent:ii.elm("span","You have no Spots yet. ",ii.elm("a",{href:"#rel&tab=AddSpot"},"Add your first Spot here")," or","Read our ",ii.elm("a",{href:"#rel&tab=HelpFAQ&q=home_spotcreate"},"FAQ")," for help on Adding Spots.")},c))}if(c.pane==""||c.pane=="groups"){b.push(new ii.views.ItemBrowser({id:"groups",label:"My Groups",query:new ii.Query("group",{interval:ii.set_interval_user_groups},{user:d.id}),type:"group",nocontent:ii.elm("span","You have no Groups yet. ",ii.elm("a",{href:"#rel&tab=AddGroup"},"Add your first Group here")," or","Read our ",ii.elm("a",{href:"#rel&tab=HelpFAQ&q=home_group"},"FAQ")," for help on Adding Groups.")},c))}if(c.pane==""||c.pane=="allphotos"){b.push(new ii.views.ItemBrowser({id:"allphotos",label:"All my Photos",query:new ii.Query("poi",{interval:ii.set_interval_user_photos},{user:d.id}),type:"poi",nocontent:ii.elm("span","You have no Photos yet. ",ii.elm("a",{href:"#rel&tab=AddPhoto"},"Add your first Photo here")," or","Read our ",ii.elm("a",{href:"#rel&tab=HelpFAQ&q=home_upphotos"},"FAQ")," for help on Adding Photos.")},c))}if(c.pane==""||c.pane=="alltrips"){b.push(new ii.views.ItemBrowser({id:"alltrips",label:"All my Trips",query:new ii.Query("trip",{interval:ii.set_interval_user_trips},{user:d.id}),type:"trip",nocontent:ii.elm("span","You have no Trips yet. ","Read our ",ii.elm("a",{href:"#rel&tab=HelpFAQ&q=home_trip"},"FAQ")," for help on recording Trips.")},c))}for(var f=0;f<b.length;f++){this.div.appendChild(b[f].div);this.subItemsets.push(b[f].query);b[f].query.addListener(this.map)}if(c.onDone){var a=this.subItemsets.length;function e(j,h,g){if(!--a){c.onDone()}}for(var f=0;f<this.subItemsets.length;f++){this.subItemsets[f].addListener({itemsDone:e})}}};ii.views.user.MyItemBrowser.prototype.start=function(){for(var a=0;a<this.subItemsets.length;a++){this.subItemsets[a].start()}};ii.views.user.MyItemBrowser.prototype.remove=function(){for(var a=0;a<this.subItemsets.length;a++){this.subItemsets[a].stop()}};ii.views.user.MyItemBrowser.prototype.update=function(){};ii.views.user.MyInboxBrowser=function(g,d){this.item=g;var a=ii.elm("div");var e=ii.elm("div",{style:{display:"none"}});var f;var c=ii.elm("li","messages",{onclick:function(){e.style.display="none";a.style.display="";f.style.backgroundColor="white";this.style.backgroundColor="yellow"}});f=ii.elm("li","comments",{onclick:function(){e.style.display="";a.style.display="none";this.style.backgroundColor="yellow";c.style.backgroundColor="white"}});var b=ii.elm("span",{className:"cnt"});var h=ii.elm("div",{className:"hdr loading"},ii.elm("a",{href:"#rel&pane="},"inbox ",b));this.div=ii.elm("div",{style:{backgroundColor:"white"}},h,ii.elm("ul",c,f),a,e);this.subItemsets=[new ii.Query("comment",{interval:10000,paused:false},{user:g.id})];this.subItemsets[0].addListener({addItem:function(l){var j=l.createView("ListItem");a.appendChild(j.div)}});if(d.onDone){window.setTimeout(function(){d.onDone()},1000)}};ii.views.user.MyInboxBrowser.prototype.start=function(){};ii.views.user.MyInboxBrowser.prototype.remove=function(){for(var a=0;a<this.subItemsets.length;a++){this.subItemsets[a].stop()}};ii.views.user.MyInboxBrowser.prototype.update=function(a){};ii.views.user.TabAddPhoto=function(g,d){var f=document.getElementById("ii_addphoto_form");f.key.value=ii.login.key;f.tz_offset.value=(new Date()).getTimezoneOffset();ii.log("timezone:"+f.tz_offset.value);var c=document.getElementById("ii_addphoto_frame");ii.setText(document.getElementById("ii_addphoto_error"),"");f.name.value="";f.description.value="";var e=f.submitbtn;function b(){if(ii.iframeDocument(c)&&ii.iframeDocument(c).innerHTML.indexOf("result")>0){ii.endWaitButton(e);var m=ii.iframeDocument(c).innerHTML;var h=/"result":\s*"([^"]+)"/.exec(m);h=h[1];if(h=="OK"){var j=/"newid":\s*([0-9]+)/.exec(m);j=j[1];ii.log("upload successfull: newid="+j);window.location="#rel&item=p."+j}else{var l=/"msg":\s*"([^"]+)"/.exec(m);l=l[1];ii.log("error uploading: "+l);ii.setText(document.getElementById("ii_addphoto_error"),"Error: "+l)}}else{if(ii.app.state.state.tab=="AddPhoto"){window.setTimeout(b,1000)}else{ii.endWaitButton(e)}}}var a=document.getElementById("ii_addphoto_postin");ii.views.fillPostInDropDown(a);f.onsubmit=function(){ii.startWaitButton(e);b();return true}};ii.views.InviteUsers=function(c){c=c||{};c.buttonText=c.buttonText||"Finish";var f=ii.elm("select",{className:"postedIn",multiple:"yes",size:"9"});var b=ii.elm("textarea",{rows:"8"});function e(){var h=f.getElementsByTagName("option");for(var j=0;j<h.length;j++){if(h[j].selected){h[j].selected="";if(b.value.indexOf(h[j].textContent||h[j].innerText)>=0){continue}var g=""+b.value;if(g){g+=", "}g+=h[j].textContent||h[j].innerText;b.value=g}}}var d=ii.elm("div",ii.elm("div",{style:{cssFloat:"left"}},ii.elm("h3","My Friends"),f),ii.elm("div",{style:{cssFloat:"left"}},ii.elm("input",{type:"button",style:{width:"70px",marginTop:"50px"},value:"Post in >>",onclick:e})),ii.elm("div",{style:{cssFloat:"left"}},ii.elm("h3","Members"),b),ii.elm("div",{style:{clear:"both"}}));ii.get("q-items-user",function(h){for(var j=0;j<h.items.length;j++){var g=ii.elm("option",{className:"people"},h.items[j].name);f.appendChild(g)}},{order:"name",friendof:ii.login.id,count:100});this.submitbtn=ii.elm("input",{type:"submit",value:c.buttonText});this.members=b;var a=document.getElementById("ii_invite_section");if(a){a.parentNode.removeChild(a)}this.div=ii.elm("div",{id:"ii_invite_section",className:"cp_s invite",style:{display:"none"}},ii.elm("h2",{className:"cp_sh"},"Invite Members"),ii.elm("div",{className:"cp_sc"},ii.elm("p","Invite Members from your Friends Group or by typing usernames"),d,ii.elm("div",{className:"buttonbar"},this.submitbtn)))};ii.views.user.TabAddAlbum=function(f,d){var e=document.getElementById("ii_addalbum_form");ii.setDefaultText(e.albumname,"Enter a name");ii.setDefaultText(e.description,"Enter a description");e.visible.value="all";var c=document.getElementById("ii_addalbum_create_s");var b=new ii.views.InviteUsers();c.parentNode.appendChild(b.div);function a(){var g=(this.value=="members");b.div.style.display=(g?"":"none");e.submitbtn.style.display=(g?"none":"")}document.getElementById("ii_addalbum_visible").onclick=document.getElementById("ii_addalbum_visible").onkeyup=a;a();document.getElementById("ii_addalbum_error").innerHTML="";e.onsubmit=function(){var g=this.submitbtn;ii.startWaitButton(g);ii.startWaitButton(b.submitbtn);document.getElementById("ii_addalbum_error").innerHTML="";var h={type:"album",name:ii.getTextBoxValue(this.albumname),description:ii.getTextBoxValue(this.description),invite:"me",post:"me",visible:this.visible.value};if(this.visible.value=="members"){h.members=b.members.value}ii.get("p-new-set",function(j){ii.endWaitButton(g);ii.endWaitButton(b.submitbtn);if(j.result=="OK"){ii.log("Album created");f.albums.push({id:j.newid,name:h.name,count:0});f.update(f);window.location="#rel&item=ME.0"}else{ii.setText(document.getElementById("ii_addalbum_error"),j.msg)}},h);return false}};ii.views.user.TabAddGroup=function(j,f){var e=document.getElementById("ii_addgroup_join_s");var g=document.getElementById("ii_addgroup_detail_s");var l=new ii.views.InviteUsers();g.parentNode.appendChild(l.div);e.style.display="none";g.style.display="none";document.getElementById("ii_addgroup_error").innerHTML="";var b=document.getElementById("ii_addgroup_form");var h=document.getElementById("ii_addgroup_add");h.visible.value=h.invite.value=h.post.value="all";ii.setDefaultText(b.groupname,"Enter a name");ii.setDefaultText(h.description,"Enter a description");b.onsubmit=function(){if(ii.getTextBoxValue(this.groupname)==""){document.getElementById("ii_addgroup_error").innerHTML="Please enter a name";return false}document.getElementById("ii_addgroup_error").innerHTML="";var m=this.groupname.value;ii.get("q-items-group",function(p){if(!p.items.length){e.style.display="none";return}e.style.display="block";document.getElementById("ii_addgroup_groups").innerHTML="";document.getElementById("ii_addgroup_searchterm").textContent=m;for(var r=0;r<p.items.length;r++){p.items[r].type="g";var q=new ii.items.Group(p.items[r]);q.onmouseover=function(){};q.onmouseout=function(){};var o=q.createView("ListItem");o.div.style.backgroundColor="transparent";document.getElementById("ii_addgroup_groups").appendChild(o.div)}},{query:this.groupname.value,order:"name"});g.style.display="block";return false};h.onsubmit=function(){var m=this.submitbtn;ii.startWaitButton(m);ii.startWaitButton(l.submitbtn);var o={type:"group",name:b.groupname.value,description:this.description.value,invite:this.invite.value,post:this.post.value,visible:this.visible.value};if(l.div.style.display!="none"){o.members=l.members.value}ii.get("p-new-set",function(p){ii.endWaitButton(m);ii.endWaitButton(l.submitbtn);if(p.result=="OK"){ii.log("Group created");window.location="#rel&item=g."+p.newid}else{ii.setText(document.getElementById("ii_addgroup_error"),p.msg)}},o);return false};function c(){var o=false;var m=h.getElementsByTagName("select");for(var p=0;p<m.length;p++){if(m[p].value=="members"){o=true}}h.submitbtn.style.display=(o?"none":"");l.div.style.display=(o?"":"none")}c();var d=h.getElementsByTagName("select");for(var a=0;a<d.length;a++){d[a].onclick=d[a].onkeyup=c}};ii.views.user.TabAddSpot=function(m,h){var e=document.getElementById("ii_addspot_join_s");var j=document.getElementById("ii_addspot_detail_s");var o=new ii.views.InviteUsers();j.parentNode.appendChild(o.div);e.style.display="none";j.style.display="none";document.getElementById("ii_addspot_error").innerHTML="";var b=document.getElementById("ii_addspot_form");var l=document.getElementById("ii_addspot_add");ii.setDefaultText(b.spotname,"Enter a name");l.visible.value=l.invite.value=l.post.value="all";ii.setDefaultText(l.description,"Enter a description");var f=document.getElementById("ii_details_spot_map");var g=this;b.onsubmit=function(){if(ii.getTextBoxValue(this.spotname)==""){document.getElementById("ii_addspot_error").innerHTML="Please enter a name";return false}document.getElementById("ii_addspot_error").innerHTML="";document.getElementById("ii_addspot_error2").innerHTML="";var p=this.spotname.value;ii.get("q-items-spot",function(r){if(!r.items.length){e.style.display="none";return}e.style.display="block";document.getElementById("ii_addspot_spots").innerHTML="";document.getElementById("ii_addspot_searchterm").textContent=p;for(var t=0;t<r.items.length;t++){r.items[t].type="s";var s=new ii.items.Spot(r.items[t]);s.onmouseover=function(){};s.onmouseout=function(){};var q=s.createView("ListItem");q.div.style.backgroundColor="transparent";document.getElementById("ii_addspot_spots").appendChild(q.div)}},{query:this.spotname.value});j.style.display="block";g.map=new ii.Map.Minimap({target:f,tabname:"AddSpot",needclick:true});return false};l.onsubmit=function(){if(g.map.selectedLat==0&&g.map.selectedLon==0){document.getElementById("ii_addspot_error2").innerHTML="Please click a location on the map";return false}document.getElementById("ii_addspot_error2").innerHTML="";var p=this.submitbtn;ii.startWaitButton(p);ii.startWaitButton(o.submitbtn);var q={type:"spot",name:b.spotname.value,description:ii.getTextBoxValue(this.description),invite:this.invite.value,post:this.post.value,visible:this.visible.value,lat:g.map.selectedLat,lon:g.map.selectedLon};if(o.div.style.display!="none"){q.members=o.members.value}ii.get("p-new-set",function(r){ii.endWaitButton(p);ii.endWaitButton(o.submitbtn);if(r.result=="OK"){ii.log("Spot created");window.location="#rel&item=s."+r.newid}else{ii.setText(document.getElementById("ii_addspot_error2"),r.msg)}},q);return false};function c(){var q=false;var p=l.getElementsByTagName("select");for(var r=0;r<p.length;r++){if(p[r].value=="members"){q=true}}l.submitbtn.style.display=(q?"none":"");o.div.style.display=(q?"":"none")}c();var d=l.getElementsByTagName("select");for(var a=0;a<d.length;a++){d[a].onclick=d[a].onkeyup=c}};ii.views.user.MyStatusState=function(b,a){this.item=b;this.statusElm=ii.elm("span");var c=document.getElementById("ii_user_status_state");c.parentNode.replaceChild(ii.elm("span",{id:"ii_user_status_state"},"Hi ",ii.elm("a",{href:"#rel&item=ME.0&pane="},ii.login.username),"! ",this.statusElm," | "),c);this.update()};ii.views.user.MyStatusState.prototype.update=function(){var a=this.item.getLiveStatusElement();this.statusElm.parentNode.replaceChild(a,this.statusElm);this.statusElm=a};ii.set_interval_poi_popup_comments=10000;ii.set_interval_poi_commenters=10000;ii.assert(ii.items);ii.assert(ii.views);ii.views.poi={};ii.items.Poi=function(a){this.init(a);this.lat=parseFloat(this.lat);this.lon=parseFloat(this.lon)};ii.items.Poi.prototype=new ii.items.Item;ii.items.Poi.prototype.hideFromMap=function(a){for(var c=0;c<this.itemviews.length;c++){if(this.itemviews[c].map){var b=this.itemviews[c];b.marker.div.style.visibility=(a?"hidden":"visible");b.shadowMarker.div.style.visibility=(a?"hidden":"visible")}}};ii.views.poi.Thumb=function(o,j){this.map=j.map;var p=80;var l=o.aspectratio;var m=(l>1)?p:Math.floor(l*p);var e=(l>1)?Math.floor(p/l):p;var f=Math.min(Math.round(0.3*m),30);var b=Math.min(Math.round(0.25*m),20);this.div=document.getElementById("ii_vw_poi_Thumb").cloneNode(true);this.div.id="";var c=this.div.firstChild;while(c.nodeType!=1){c=c.nextSibling}var d=this.div.getElementsByTagName("img");c.style.width=m+"px";c.style.height=e+"px";d[0].src="/srv/d-media.php?border=0&entitytype=poi&entityid="+o.id+"&width="+m+"&height="+e;d[1].style.top=(e+4-16)+"px";d[1].onclick=function(){j.map.zoomTo(o.lat,o.lon,50,50)};d[1].onmouseover=ii.onmouseoverbtn;d[1].onmouseout=ii.onmouseoutbtn;d[2].style.marginLeft=(4+Math.round((m/2)-(f/2)))+"px";this.div.style.zIndex=Math.round((90-o.lat)*80000);this.marker=j.map.addMarker(this.div,"poiThumbs",o.lat,o.lon,-((m/2)+4),-(e+8+b));this.div.onmouseover=function(){o.onmouseover()};this.div.onmouseout=function(){o.onmouseout()};this.div.onclick=function(){ii.app.state.setState({item:"p."+o.id})};this.shadowDiv=ii.pngImage("media_shadow.png",140,100);this.shadowDiv.className="marker shadow";this.shadowMarker=j.map.addMarker(this.shadowDiv,"shadows",o.lat,o.lon,-48,-105);if(o.postedin){var g=this;this.div.onclick=function(){o.removeView(g);j.map.addItem(o,true)}}};ii.views.poi.Thumb.prototype.onmouseover=function(){this.orgz=this.div.style.zIndex;this.div.style.zIndex=16000000};ii.views.poi.Thumb.prototype.onmouseout=function(){if(this.orgz){this.div.style.zIndex=this.orgz}};ii.views.poi.Thumb.prototype.remove=function(){this.map.removeMarker(this.marker,"poiThumbs");this.shadowDiv.parentNode.removeChild(this.shadowDiv);this.map.removeMarker(this.shadowMarker,"shadows")};var player=null;function playlistLoaded(a){alert(player.getPlaylist()[0].duration)}function loadPoints(a,c){ii_active_vid_state="loading";if(!c){ii.log("Loading points");var b={user:ii_active_vid_user,start:ii_active_vid_start-8,end:parseInt(a)+parseInt(ii_active_vid_start)};ii.get("q-points",function(d){loadPoints(a,d)},b);return}ii_active_vid_points=c.points;ii_active_vid_state=0}function startTracker(a){loadPoints(a.duration)}function timeTracker(e){if(ii_active_vid_state=="start"){loadPoints(e.duration)}else{if(ii_active_vid_state=="loading"){return}else{if(ii_active_vid_state>0){ii_active_vid_state++;if(ii_active_vid_state>5){ii_active_vid_state=0}}else{var j;var a;ii_active_vid_state++;var m=parseFloat(e.position)+parseFloat(ii_active_vid_start)+12;for(var b=0;b<ii_active_vid_points.length;b++){if(parseFloat(ii_active_vid_points[b].loctime)>m){if(b==0){j=ii_active_vid_points[b].lat;a=ii_active_vid_points[b].lon}else{var d=ii_active_vid_points[b-1].lat;var h=ii_active_vid_points[b-1].lon;var c=ii_active_vid_points[b].lat;var f=ii_active_vid_points[b].lon;var l=m-parseFloat(ii_active_vid_points[b-1].loctime);var g=parseFloat(ii_active_vid_points[b].loctime)-ii_active_vid_points[b-1].loctime;l/=g;d=parseFloat(d);h=parseFloat(h);c=parseFloat(c);f=parseFloat(f);j=d+(c-d)*l;a=h+(f-h)*l}break}}if(!j&&!a){return}ii_active_vid_view.item.displayLat=j;ii_active_vid_view.item.displayLon=a;ii.set_map_smooth_panning=true;ii_active_vid_view.map.moveView(ii_active_vid_view,ii_active_vid_view.item.displayLat,ii_active_vid_view.item.displayLon);ii.set_map_smooth_panning=false;return;ii_active_vid_view.item.lat=parseFloat(j);ii_active_vid_view.item.lon=parseFloat(a);if((!ii_active_vid_view.animationTimer)&&(ii_active_vid_view.item.displayLat!==ii_active_vid_view.item.lat||ii_active_vid_view.item.displayLon!==ii_active_vid_view.item.lon)){ii_active_vid_view.animationTimer=window.setInterval(function(){ii_active_vid_view.updatePos()},ii.set_user_animate_step)}}}}}function playerReady(a){ii.log("Player ready: Adding listeners::"+a.id);player=document.getElementById("player2");player.addModelListener("TIME","timeTracker")}function playlistTracker(a){ii.log("playlist:%o",a)}function loadedTracker(a){ii.log("playlist:%o",a)}function seekTracker(a){return;ii_active_vid_view.item.displayLat=ii_active_vid_view.item.lat;ii_active_vid_view.item.displayLon=ii_active_vid_view.item.lon;ii_active_vid_view.updatePos()}function streamTimer(c){if(!c){ii.get("q-items-user",streamTimer,{id:ii_active_vid_user});return}var a=c.items[0].lat;var b=c.items[0].lon;ii_active_vid_view.item.lat=parseFloat(a);ii_active_vid_view.item.lon=parseFloat(b);if((!ii_active_vid_view.animationTimer)&&(ii_active_vid_view.item.displayLat!==ii_active_vid_view.item.lat||ii_active_vid_view.item.displayLon!==ii_active_vid_view.item.lon)){ii.log("Setting anim timer from stream!");ii_active_vid_view.animationTimer=window.setInterval(function(){ii_active_vid_view.updatePos()},ii.set_user_animate_step*2)}}ii.views.poi.Popup=function(y,d){var q=400;this.map=d.map;this.item=y;var D=y.aspectratio;var o=(D>1)?q:Math.floor(D*q);var x=(D>1)?Math.floor(q/D):q;if(y.kind=="video"||y.kind=="stream"){o=425;x=319}var F=Math.min(Math.round(0.3*o),30);var f=Math.min(Math.round(0.25*o),20);this.div=document.getElementById("ii_vw_poi_Popup").cloneNode(true);this.div.id="";this.div.onmousedown=ii.stopPropagation;this.div.onmouemove=ii.stopPropagation;this.div.onclick=ii.stopPropagation;this.div.ondrag=ii.stopPropagation;var E=this.commentQuery=new ii.Query("comment",{interval:ii.set_interval_poi_popup_comments},{poi:y.id,count:100});function b(c){if(c=="next"||c=="prev"){if(ii.last_active_setid){var a=ii.last_active_setid;var h="set"}else{var a=y.userid;var h="user"}ii.get("q-relative-id",b,{entitytype:"poi",entityid:y.id,relid:a,reltype:h,reldir:c})}else{ii.app.state.setState({item:"p."+c.id})}}var l=this;var e=this.div.getElementsByTagName("*");for(var s=0;s<e.length;s++){var C=e[s];switch(C.getAttribute("name")){case"imgcont":C.style.width=o+"px";C.style.height=x+"px";break;case"img":ii.log("kind="+y.kind);if(y.kind=="stream"){var B=ii.elm("div");C.parentNode.replaceChild(B,C);var g=y.description.substr(5);var p='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0" width="425" height="319" id="qikPlayer" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="true" /><param name="movie" value="http://qik.com/swfs/qikPlayer4.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#333333" /><param name="FlashVars" value="rssURL=http://qik.com/video/'+g+'.rss&autoPlay=true" /><embed src="http://qik.com/swfs/qikPlayer4.swf" quality="high" swliveconnect="true" id="iii" bgcolor="#333333" width="425" height="319" name="qikPlayer" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" FlashVars="rssURL=http://qik.com/video/'+g+'.rss&autoPlay=true"></embed></object>';B.innerHTML=p;ii_active_vid_view=this;ii_active_vid_user=y.userid;this.item.displayLat=parseFloat(y.lat);this.item.displayLon=parseFloat(y.lon);this.streamTimer=window.setInterval(function(){streamTimer()},15000)}else{if(y.kind=="video"){var B=ii.elm("div",{id:"ii_video_cont"});C.parentNode.replaceChild(B,C);var g=y.description.substr(5);var r={file:"http://qikimg.com/download/"+g+".flv",autostart:"true"};var A={allowfullscreen:"true",allowscriptaccess:"always",wmode:"transparent"};var m={id:"player2",name:"player2"};window.setTimeout(function(){swfobject.embedSWF("/lib/mediaplayer/player.swf","ii_video_cont","425","319","9.0.115",false,r,A,m)},0);ii_active_vid_user=y.userid;ii_active_vid_start=y.created;ii_active_vid_state="start";ii_active_vid_view=this;this.item.displayLat=parseFloat(y.lat);this.item.displayLon=parseFloat(y.lon)}else{C.src="/srv/d-media.php?entitytype=poi&entityid="+y.id+"&width="+o+"&height="+x}}break;case"tip":C.style.marginLeft=(12+Math.round((o/2)-(F/2)))+"px";break;case"zoom":if(y.kind=="video"||y.kind=="stream"){C.style.visibility="hidden"}C.title=C.alt="zoom map";C.style.top=(x+10-20)+"px";C.onmouseover=ii.onmouseoverbtn;C.onmouseout=ii.onmouseoutbtn;C.onclick=function(){if(y.displayLat){d.map.zoomTo(y.displayLat,y.displayLon,50,220);d.map.lockView(l)}else{d.map.zoomTo(y.lat,y.lon,50,220)}};break;case"close":C.title=C.alt="minimize";C.style.left=(o-21-8)+"px";C.onmouseover=ii.onmouseoverbtn;C.onmouseout=ii.onmouseoutbtn;C.onclick=function(){y.removeView(l);d.map.addItem(y)};break;case"overlay":this.overlay=C;break;case"infotab":var v=ii.elm("span");if(y.description){ii.text2href(y.description,v)}else{y.description="No description"}this.infotab=C;C.style.width=(o-34)+"px";C.style.maxHeight=(x-63)+"px";C.appendChild(ii.elm("img",{src:"/srv/d-media.php?entitytype=user&entityid="+y.userid+"&width=48&height=36"}));C.appendChild(ii.elm("div",{className:"item_metadata",style:{width:(o-34-73)+"px"}},ii.elm("p",ii.elm("span",{className:"item_metadata_label"},"title: "),y.name),ii.elm("p",ii.elm("span",{className:"item_metadata_label"},"author: "),ii.userLink(y.userid,y.author)),ii.elm("p",ii.elm("span",{className:"item_metadata_label"},"date: "),ii.formatDate(y.created,"relative")),ii.elm("p",ii.elm("span",{className:"item_metadata_label"},"location: "),ii.geoCode(y.lat,y.lon,y.locname)),ii.elm("br"),ii.elm("p",ii.elm("span",{className:"item_metadata_label"},"description: "),v)));break;case"commenttab":this.commenttab=C;C.style.width=(o-34)+"px";C.style.maxHeight=(x-63)+"px";C.ondrag=ii.stopPropagation;C.onmousemove=ii.stopPropagation;break;case"infobtn":this.infolink=C;C.onclick=function(){l.commentlink.className="tab";l.commenttab.style.display="none";this.className="tab sel";l.infotab.style.display=""};break;case"commentbtn":this.commentlink=C;C.textContent="Comments "+(y.comments?" ("+y.comments+")":""),C.onclick=function(){l.infolink.className="tab";l.infotab.style.display="none";this.className="tab sel";l.commenttab.style.display="";E.start()};break;case"prev":if(ii.last_active_setid===undefined||ii.last_active_setid==0){C.title=C.alt="Previous Photo by: "+y.author}else{for(var t=0,u=y.postedin.length;t<u;t++){var j=ii.typesingle[ii.typeletter[y.postedin[t].type]];C.title=C.alt="Previous Photo in "+j+": "+y.postedin[t].name}}C.onclick=function(){b("prev")};C.style.left=(o/3-21-10)+"px";C.onmouseover=ii.onmouseoverbtn;C.onmouseout=ii.onmouseoutbtn;break;case"next":if(ii.last_active_setid===undefined||ii.last_active_setid==0){C.title=C.alt="Next Photo by: "+y.author}else{for(var t=0,u=y.postedin.length;t<u;t++){var j=ii.typesingle[ii.typeletter[y.postedin[t].type]];C.title=C.alt="Next Photo in "+j+": "+y.postedin[t].name}}C.onclick=function(){b("next")};C.style.left=(o/3*2-21-15)+"px";C.onmouseover=ii.onmouseoverbtn;C.onmouseout=ii.onmouseoutbtn;break;case"bottombar":C.style.top=(x+10-20-18)+"px";break;case"commentbtnsin":if(ii.browser.safari){C.style.marginTop="5px"}break;case"commentform":this.addcommentform=C;C.onclick=ii.stopPropagation;C.onmousedown=ii.stopPropagation;C.ondrag=ii.stopPropagation;C.commenttext.style.width=(o-44)+"px";if(ii.browser.safari){C.commenttext.style.position="relative"}C.onsubmit=function(){ii.get("p-new-comment",function(a){l.addcommentform.style.display="none";l.addcommentform.commenttext.value="";l.commentlink.textContent="Comments "+(y.comments?" ("+(1+parseInt(y.comments))+")":""),E.start()},{entitytype:"poi",entityid:y.id,content:this.commenttext.value});return false};C.onreset=function(){l.addcommentform.style.display="none";l.addcommentform.commenttext.value=""};break;case"commentlist":this.commentlist=C;break;case"addcommentbtn":C.onclick=function(){if(!ii.login){alert("You must be logged in to post a comment")}else{l.addcommentform.style.display="block"}};break}}this.commentQuery.addListener({addItem:function(c){var a=c.createView("TabView");l.commentlist.insertBefore(a.div,l.commentlist.firstChild)}});this.marker=d.map.addMarker(this.div,"poiPopups",y.lat,y.lon,-((o/2)+10),-(x+20+f));this.div.onmouseover=function(){y.onmouseover()};this.div.onmouseout=function(){y.onmouseout()};if(this.item.kind!="video"&&this.item.kind!="stream"){this.shadowDiv=ii.pngImage("media_shadow.png",520,400);this.shadowDiv.className="marker shadow";this.shadowMarker=d.map.addMarker(this.shadowDiv,"shadows",y.lat,y.lon,-200,-392)}};ii.views.poi.Popup.prototype.remove=function(){this.map.removeMarker(this.marker,"poiPopups");if(this.shadowDiv){this.shadowDiv.parentNode.removeChild(this.shadowDiv);this.map.removeMarker(this.shadowMarker,"shadows")}if(this.commentQuery){this.commentQuery.stop()}if(this.streamTimer){window.clearInterval(this.streamTimer)}if(this.animationTimer){window.clearInterval(this.animationTimer)}ii_active_vid_view=0;window.ii_centeredItem=0;document.getElementById("ii_movie_container").style.display="none"};ii.views.poi.Popup.prototype.updatePos=function(){this.item.displayLat+=0.01*(this.item.lat-this.item.displayLat);this.item.displayLon+=0.01*(this.item.lon-this.item.displayLon);this.map.moveView(this,this.item.displayLat,this.item.displayLon)};ii.views.poi.Popup.prototype.onmouseover=function(){this.div.style.zIndex="900";if(this.item.kind!="video"&&this.item.kind!="stream"){this.overlay.style.display="block"}};ii.views.poi.Popup.prototype.onmouseout=function(){this.div.style.zIndex="";var a=this.div.getElementsByTagName("form")[0];if(!(a&&a.style.display=="block")){this.overlay.style.display="none"}};ii.views.poi.ListItem=function(b){this.item=b;this.div=document.getElementById("ii_vw_poi_ListItem").cloneNode(true);this.div.id="";this.div.onclick=function(){ii.app.state.setState({item:"p."+b.id})};this.div.getElementsByTagName("img")[0].src="/srv/d-media.php?marker=commentcount&width=64&height=48&style=center&entitytype=poi&entityid="+b.id;var c=ii.elm("img",{src:"/media/poi_zoom_smll.png"});c.onmouseover=ii.onmouseoverbtn;c.onmouseout=ii.onmouseoutbtn;c.onclick=function(d){ii.stopPropagation(d);if(ii.activePopup){for(var e=0;e<ii.activeItem.itemviews.length;e++){if(ii.activeItem.itemviews[e]==ii.activePopup){ii.activeItem.removeView(ii.activePopup);break}}}ii.activePopup=ii.app.map.addItem(b,true);ii.activeItem=b;window.setTimeout(function(){},3000)};var a=ii.elm("div",{className:"zoomto"},c);this.div.appendChild(a);this.update();this.div.onmouseover=function(){b.onmouseover()};this.div.onmouseout=function(){b.onmouseout()}};ii.views.poi.ListItem.prototype.update=function(){var b=this.div.getElementsByTagName("p");for(var c=0;c<b.length;c++){if(b[c].getAttribute("name")){switch(b[c].getAttribute("name")){case"author":b[c].appendChild(ii.userLink(this.item.userid,this.item.author));break;case"created":b[c].appendChild(document.createTextNode(ii.formatDate(this.item.created,"relative")));break;case"distance":var a="Unknown";if(this.item.distance!==undefined){a=ii.formatDistance(this.item.distance)}b[c].appendChild(document.createTextNode(a));break;default:b[c].appendChild(document.createTextNode(this.item.name));break}}}};ii.views.poi.ListItem.prototype.onmouseover=function(){this.div.style.backgroundColor="#f0f0f0"};ii.views.poi.ListItem.prototype.onmouseout=function(){this.div.style.backgroundColor=""};ii.views.poi.EditableListItem=function(b){this.item=b;var c=document.createTextNode(b.name);var a=document.createTextNode(ii.formatDate(b.modified,"relative"));this.div=ii.elm("div",ii.elm("input",{type:"checkbox",name:"poi."+b.id,style:{cssFloat:"left"}}),ii.views.generateListitem({link:"#rel",img:"/srv/d-media.php?marker=commentcount&width=64&height=48&entitytype=poi&entityid="+b.id,labels:{name:c,author:b.author,created:a}}));this.div.onclick=function(){var d=this.getElementsByTagName("input")[0];d.checked=d.checked?"":"checked"};this.update();this.div.onmouseover=function(){b.onmouseover()};this.div.onmouseout=function(){b.onmouseout()}};ii.views.poi.EditableListItem.prototype.update=function(){};ii.views.poi.EditableListItem.prototype.onmouseover=function(){this.div.style.backgroundColor="#bbddff"};ii.views.poi.EditableListItem.prototype.onmouseout=function(){this.div.style.backgroundColor=""};ii.views.poi.LargeListItem=function(c){this.item=c;this.postedInLinks=ii.elm("span");var h={name:document.createTextNode(c.name),author:ii.userLink(c.userid,c.author),date:ii.formatDate(c.created,"relative"),"posted in":this.postedInLinks,location:ii.geoCode(c.lat,c.lon,c.locname),distance:(c.distance?ii.formatDistance(c.distance):undefined)};this.info=ii.views.generateListitem({link:"#rel&item=p."+c.id,img:"/srv/d-media.php?marker=commentcount&style=center&width=64&height=48&entitytype=poi&entityid="+c.id,labels:h});this.info.className="item large";var b=new ii.views.StatusElms();var a=new ii.views.CommentElms("poi",c.id,b);var e=new ii.views.SafElms("poi",c.id,b);var g=new ii.views.PostInElms(c,"poi",c.id,b);var f=new ii.views.SendAFriendElms(c,"poi",c.id,b);if(c.kind=="stream"||c.kind=="video"){var d=ii.elm("div",ii.elm("a",ii.elm("img",{src:"/media/qik/center_map_down.gif",style:{cssFloat:"left",position:"relative",top:"-30px",left:"12px"}}),{href:"#rel"}));d.onclick=function(){if(!window.ii_centeredItem){ii.app.map.setCenter(c.displayLat,c.displayLon,50,220);ii.app.map.lockView(ii_active_vid_view)}else{ii.app.map.unlockView()}};ii_curvid_centerbtn=d.getElementsByTagName("img")[0]}else{var d=ii.elm("span")}this.div=ii.elm("div",this.info,d,ii.elm("div",{className:"listitem_links"},g.postInLink," ",a.commentLink," ",f.sendAFriendLink),a.commentDiv,g.postInDiv,f.sendAFriendDiv,b.statusDiv);this.update();this.div.onmouseover=function(){c.onmouseover()};this.div.onmouseout=function(){c.onmouseout()}};ii.views.poi.LargeListItem.prototype.update=function(){var a=ii.views.postedInLinks(this.item.postedin);this.postedInLinks.parentNode.replaceChild(a,this.postedInLinks);this.postedInLinks=a};ii.views.poi.ItemBrowser=function(d,c){this.item=d;this.map=c.map;this.div=ii.elm("div",{style:{backgroundColor:"white"}});this.subItemsets=[];var b=[];c.pane=c.pane||"";this.item=d;this.map=c.map;b.push(new ii.views.ItemBrowser({id:"nocommenters",inverseOpen:true,label:"Commenters",query:new ii.Query("user",{interval:ii.set_interval_poi_commenters},{commentedonid:d.id,commentedontype:"poi",fields:"basic,count"}),type:"user",nocontent:ii.elm("span","This Photo has no Commenters yet. ","Use the [Post Comment] link to be the first to Comment. ","Read our ",ii.elm("a",{href:"#rel&tab=HelpFAQ&q="},"FAQ")," for help on the Post Comment feature.")},c));for(var f=0;f<b.length;f++){this.div.appendChild(b[f].div);this.subItemsets.push(b[f].query);b[f].query.addListener(this.map)}if(c.onDone){var a=this.subItemsets.length;function e(j,h,g){if(!--a){c.onDone()}}for(var f=0;f<this.subItemsets.length;f++){this.subItemsets[f].addListener({itemsDone:e})}}};ii.views.poi.ItemBrowser.prototype.start=function(){for(var a=0;a<this.subItemsets.length;a++){this.subItemsets[a].start()}};ii.views.poi.ItemBrowser.prototype.remove=function(){for(var a=0;a<this.subItemsets.length;a++){this.subItemsets[a].stop()}};ii.views.poi.TabDetailsPoi=function(d,b){var c=this;function a(){var e=this;var f={id:d.id,name:this.name.value,description:this.description.value};ii.get("p-upd-poi",function(g){c.details.setEditMode(e,false);d.name=f.name;d.description=f.description;d.update()},f);return false}this.details=new ii.views.Details(d,b.tabElm,a);this.update()};ii.views.poi.TabDetailsPoi.prototype.update=function(){function b(d,e){if(d=="next"||d=="prev"){if(ii.last_active_setid){var c=ii.last_active_setid;var f="set"}else{var c=e.userid;var f="user"}ii.get("q-relative-id",b,{entitytype:"poi",entityid:e.id,relid:c,reltype:f,reldir:d})}else{ii.app.state.setState({item:"p."+d.id});ii.app.state.setState({tab:"Details"})}}var a={photo:function(d,c){d.innerHTML="";d.appendChild(ii.elm("img",{src:"/srv/d-media.php?style=center&width=428&height=321&entitytype=poi&entityid="+c.id}))},buttonNext:function(g,f){if(ii.last_active_setid===undefined||ii.last_active_setid==0){g.title=g.alt="Next Photo by: "+f.author}else{for(var e=0,d=f.postedin.length;e<d;e++){var c=ii.typesingle[ii.typeletter[f.postedin[e].type]];g.title=g.alt="Next Photo in "+c+": "+f.postedin[e].name}}g.onclick=function(){b("next",f)};g.onmouseover=ii.onmouseoverbtn;g.onmouseout=ii.onmouseoutbtn},buttonPrev:function(g,f){if(ii.last_active_setid===undefined||ii.last_active_setid==0){g.title=g.alt="Previous Photo by: "+f.author}else{for(var e=0,d=f.postedin.length;e<d;e++){var c=ii.typesingle[ii.typeletter[f.postedin[e].type]];g.title=g.alt="Previous Photo in "+c+": "+f.postedin[e].name}}g.onclick=function(){b("prev",f)};g.onmouseover=ii.onmouseoverbtn;g.onmouseout=ii.onmouseoutbtn}};this.details.update(a)};ii.views.poi.TabDetailsPoi.prototype.remove=function(a){this.details.remove()};ii.views.poi.Details=function(b,a){this.div=ii.elm("div",{className:"poi_cell"},ii.elm("a",{href:"#rel&item=p."+b.id},ii.elm("img",{src:"/srv/d-media.php?width=64&height=48&style=center&entitytype=poi&entityid="+b.id,alt:b.name,title:b.name}),ii.elm("p",b.name)),ii.elm("p",ii.formatDate(b.modified,"shortrelative")))};ii.set_interval_trip_feed=3000;ii.set_interval_trip_pois=15000;ii.assert(ii.items);ii.assert(ii.views);ii.views.trip={};ii.items.Trip=function(c){this.init(c);this.lat=parseFloat(this.lat);this.lon=parseFloat(this.lon);this.displayLat=parseFloat(this.lastlat)||this.lat;this.displayLon=parseFloat(this.lastlon)||this.lon;this.playing=false;this.trippoints=[];var b=60;var a=60;this.playback_interval=150;this.trip_playback_factor=this.timespan/b;if(this.trip_playback_factor>a){this.trip_playback_factor=a}this.vp=0;this.lvp=-1;this.progress_tnp=1};ii.items.Trip.prototype=new ii.items.Item;ii.items.Trip.prototype.update=function(d){this.prevlastseen=this.lastseen;for(var b in d){this[b]=d[b]}this.lat=parseFloat(this.lat);this.lon=parseFloat(this.lon);if(this.lastseen<0&&!this.animationTimer){var a=this;this.animationTimer=window.setInterval(function(){a.updatePos()},ii.set_user_animate_step)}else{if(this.lastseen>=0&&this.animationTimer){window.clearInterval(this.animationTimer);this.animationTimer=0}}for(var c=0;c<this.itemviews.length;c++){if(this.itemviews[c].update){this.itemviews[c].update()}}};ii.items.Trip.prototype.moveMarker=function(){for(var b=0,a=this.itemviews.length;b<a;b++){if(this.itemviews[b].moveMarker){this.itemviews[b].moveMarker()}}};ii.items.Trip.prototype.getIconUrl=function(f,b){var e=0,g=b||{};w=32,z=f,url="icon_user/trip/";if(g.lat_from===undefined&&g.lon_from===undefined&&g.lat_to===undefined&&g.lon_to===undefined){g.lat_from=this.lat;g.lon_from=this.lon;g.lat_to=this.displayLat;g.lon_to=this.displayLon}else{if(g.lat_from===undefined||g.lon_from===undefined||g.lat_to===undefined||g.lon_to===undefined){throw ("ll_obj must either have all properties defined or none of them")}}if(z<=0.3){w=16}else{if(z<=0.6){w=24}}if(this.playing){var d=Math.abs(g.lon_from-g.lon_to);var a=-Math.abs(g.lat_from-g.lat_to);if(a==0){var h=(g.lon_from>g.lon_to)?90:270}else{var h=Math.atan(d/-a)*(360/(2*Math.PI))}if(g.lon_from>g.lon_to&&g.lat_from<g.lat_to){h=180-h}if(g.lon_from<g.lon_to&&g.lat_from<g.lat_to){h=180+h}if(g.lon_from<g.lon_to&&g.lat_from>g.lat_to){h=360-h}var e=Math.round(h/30)*30;if(e==360){e=0}}return{url:"media/"+url+w+"/"+e+".png",size:w}};ii.views.trip.Icon=function(b,a){this.item=b;this.map=a.map;var c=b.getIconUrl(this.map.getZoom());this.icon_img=ii.elm("img",{src:c.url});this.div=ii.elm("div",{className:"marker"},this.icon_img);that=this;this.div.onmouseover=function(){that.div.style.cursor="pointer";b.onmouseover()};this.div.onmouseout=function(){that.div.style.cursor="default";b.onmouseout()};this.div.onclick=function(){b.popupAlwaysVisible=true;b.onmouseover()};this.marker=a.map.addMarker(this.div,"tripIcons",b.lat,b.lon,-(c.size/2),-(c.size/2));this.map.addZoomListener(this,function(){this.moveMarker()})};ii.views.trip.Icon.prototype.moveMarker=function(){if(this.item.vp){var a=this.item.getIconUrl(this.map.getZoom(),{lat_from:this.item.displayLat,lon_from:this.item.displayLon,lat_to:parseFloat(this.item.trippoints[this.item.vp].lat),lon_to:parseFloat(this.item.trippoints[this.item.vp].lon)})}else{var a=this.item.getIconUrl(this.map.getZoom(),{lat_from:this.item.displayLat,lon_from:this.item.displayLon,lat_to:this.item.displayLat,lon_to:this.item.displayLon})}if(this.div.firstChild.src!=a.url){this.div.firstChild.src=a.url;this.marker.offset.x=this.marker.offset.y=-a.size/2}this.icon_img.src=a.url;this.map.moveMarker(this.marker,this.item.displayLat,this.item.displayLon)};ii.views.trip.Icon.prototype.remove=function(){this.map.removeMarker(this.marker,"tripIcons")};ii.views.trip.IconPopup=function(d,a){this.item=d;this.map=a.map;if(d.popupAlwaysVisible==undefined){d.popupAlwaysVisible=a.alwaysVisible}var b=ii.pngImage("user_info_bg.png",184,110);b.className="bg";var c=this;this.speed=ii.elm("span",document.createTextNode("stopped"));this.div=ii.elm("div",{className:"iconpopup marker"},b,ii.elm("img",{className:"avatar",src:"/srv/d-media.php?width=64&height=48&entitytype=user&entityid="+d.userid}),ii.elm("div",{className:"content"},ii.elm("div",ii.userLink(d.userid,d.author)),ii.elm("div",d.name),this.speed),ii.elm("img",{className:"button",style:{left:"160px",top:"52px"},src:"media/poi_zoom_smll.png",onmouseover:ii.onmouseoverbtn,onmouseout:ii.onmouseoutbtn,onclick:function(){a.map.zoomTo(d.displayLat||d.lat,d.displayLon||d.lon,50,0)}}),ii.elm("img",{className:"button",style:{left:"160px",top:"5px"},src:"media/button_userpop_close.png",onmouseover:ii.onmouseoverbtn,onmouseout:ii.onmouseoutbtn,onclick:function(){d.popupAlwaysVisible=false;c.div.style.visibility="hidden"}}));this.shadowDiv=ii.pngImage("user_info_shadow.png",208,60);this.shadowDiv.className="marker shadow";this.shadowMarker=a.map.addMarker(this.shadowDiv,"shadows",d.lat,d.lon,-35,-67);this.div.onmouseover=function(){d.onmouseover()};this.div.onmouseout=function(){d.onmouseout()};this.onmouseout();this.marker=a.map.addMarker(this.div,"tripIcons",d.lat,d.lon,-58,-124)};ii.views.trip.IconPopup.prototype.moveMarker=function(){this.map.moveMarker(this.marker,this.item.displayLat,this.item.displayLon);this.map.moveMarker(this.shadowMarker,this.item.displayLat,this.item.displayLon);if(this.item.playing){this.speed.innerHTML=" traveling at "+ii.formatSpeed(this.item.current_trip_speed)}else{this.speed.innerHTML=" stopped"}};ii.views.trip.IconPopup.prototype.onmouseout=function(){this.div.style.visibility=this.shadowDiv.style.visibility=(this.item.popupAlwaysVisible?"":"hidden")};ii.views.trip.IconPopup.prototype.onmouseover=function(){this.div.style.visibility=this.shadowDiv.style.visibility=""};ii.views.trip.IconPopup.prototype.remove=function(){this.map.removeMarker(this.marker,"tripIcons");this.shadowDiv.parentNode.removeChild(this.shadowDiv);this.map.removeMarker(this.shadowMarker,"shadows")};ii.views.trip.TabDetailsTrip=function(d,b){var c=this;function a(){var e=this;ii.startWaitButton(e.savebtn);var f={id:d.id,name:this.name.value,description:this.description.value};ii.get("p-upd-trip",function(g){c.details.setEditMode(e,false);ii.endWaitButton(e.savebtn);d.name=f.name;d.description=f.description;d.update()},f);return false}this.details=new ii.views.Details(d,b.tabElm,a);this.update()};ii.views.trip.TabDetailsTrip.prototype.update=function(){this.details.update({start_address:function(b,a){b.innerHTML="";b.appendChild(ii.geoCode(a.lat,a.lon))},end_address:function(b,a){b.innerHTML="";b.appendChild(ii.geoCode(a.endlat,a.endlon))},start_date:function(c,b){var a=ii.formatDate(b.created,"relative");c.innerHTML="";ii.setText(c,a)},end_date:function(c,b){c.innerHTML="";var a=ii.formatDate(b.stopped,"relative");ii.setText(c,a)}})};ii.views.trip.TabDetailsTrip.prototype.remove=function(){this.details.remove()};ii.items.Trip.prototype.startTrip=function(){if(this.playing===true){if(this.trip_player){window.clearInterval(this.trip_player)}this.playing=false;this.src="media/trip_controls_play.png"}else{this.src="media/trip_controls_pauze.png";this.playing=true;var a=this;if(this.photoQuery){var d=this.photoQuery.items;for(var c in d){d[c].hideFromMap(true)}}else{var d=[]}if(this.lvp>-1){this.displayLat=this.lat;this.displayLon=this.lon;this.vp=0;this.lvp=-1;this.progress_tnp=1;this.moveMarker()}var b=this;this.trip_player=window.setInterval(function(){if(b.playing===true&&b.lvp+1<b.trippoints.length){while(1<=b.progress_tnp){if(b.lvp>-1){for(var f in d){if(d[f].created>b.trippoints[b.lvp].loctime&&d[f].created<b.trippoints[b.lvp+1].loctime){d[f].hideFromMap(false)}}}if(b.lvp+1<b.trippoints.length){b.lvp+=1}b.progress_tnp-=1;b.interval_dist=0;b.playback_dist=0;while(b.lvp+1<b.trippoints.length){if(b.trippoints[b.lvp].d_tnp==0||b.trippoints[b.lvp].s_tnp==0){b.lvp+=1;continue}b.interval_dist=b.trippoints[b.lvp].d_tnp;b.current_trip_speed=b.trippoints[b.lvp].s_tnp;b.playback_dist=b.current_trip_speed*(b.playback_interval/1000)*b.trip_playback_factor;break}}var g=0;var e=0;if(b.lvp+1<b.trippoints.length){b.progress_tnp+=b.playback_dist/b.interval_dist;g=b.trippoints[b.lvp+1].lat-b.trippoints[b.lvp].lat;e=b.trippoints[b.lvp+1].lon-b.trippoints[b.lvp].lon}b.displayLat=parseFloat(b.trippoints[b.lvp].lat)+b.progress_tnp*g;b.displayLon=parseFloat(b.trippoints[b.lvp].lon)+b.progress_tnp*e}else{window.clearInterval(b.trip_player);b.playing=false;a.src="media/trip_controls_play.png"}b.vp=b.lvp;b.moveMarker()},this.playback_interval)}};ii.views.trip.LargeListItem=function(c){this.item=c;this.postedInLinks=ii.elm("span");var f={name:document.createTextNode(c.name),author:ii.userLink(c.userid,c.author),date:ii.formatDate(c.created,"relative"),"posted in":this.postedInLinks,"starting point":ii.geoCode(c.lat,c.lon,c.locname),"trip distance":ii.formatDistance(c.distance),"avg. speed":ii.formatSpeed(this.item.distance/this.item.timespan),timespan:ii.formatTimespan(this.item.timespan)};this.info=ii.views.generateListitem({link:"#rel&item=t."+c.id,img:"/srv/d-media.php?width=64&height=48&entitytype=trip&entityid="+c.id,labels:f,item_handler:false});this.info.insertBefore(this.getTripControls(),this.info.lastChild);this.info.className="item large";var b=new ii.views.StatusElms();var a=new ii.views.CommentElms("trip",c.id,b);var e=new ii.views.PostInElms(c,"trip",c.id,b);var d=new ii.views.SendAFriendElms(c,"trip",c.id,b);this.div=ii.elm("div",this.info,ii.elm("div",{className:"listitem_links"},e.postInLink," ",a.commentLink," ",d.sendAFriendLink),a.commentDiv,e.postInDiv,d.sendAFriendDiv,b.statusDiv);this.update();this.div.onmouseover=function(){c.onmouseover()};this.div.onmouseout=function(){c.onmouseout()}};ii.views.trip.LargeListItem.prototype.update=function(){var a=ii.views.postedInLinks(this.item.postedin);this.postedInLinks.parentNode.replaceChild(a,this.postedInLinks);this.postedInLinks=a};ii.views.trip.LargeListItem.prototype.getTripControls=function(){var b=this;var a=this.item;return ii.elm("div",{style:{bottom:"0px",left:"0px",margin:"0px",padding:"0px 0px 12px 12px",position:"absolute"}},ii.elm("p",{className:"lli_text",style:{margin:"0px",padding:"0px 0px 3px 0px"}},"Trip Controls"),ii.elm("div",{style:{padding:"0px"}},ii.elm("img",{onclick:function(){if(a.playing===true){if(a.trip_player){window.clearInterval(a.trip_player)}a.playing=false;this.nextSibling.src="media/trip_controls_play.png"}a.displayLat=a.lat;a.displayLon=a.lon;a.vp=0;a.moveMarker()},onmouseover:function(){this.style.cursor="pointer";this.src="media/trip_controls_gotostartX.png"},onmouseout:function(){this.style.cursor="default";this.src="media/trip_controls_gotostart.png"},src:"media/trip_controls_gotostart.png",style:{border:"0px",margin:"0px"}}),ii.elm("img",{onclick:function(){b.item.startTrip()},onmouseover:function(){this.style.cursor="pointer";if(b.item.playing===true){this.src="media/trip_controls_pauzeX.png"}else{this.src="media/trip_controls_playX.png"}},onmouseout:function(){this.style.cursor="default";if(b.item.playing===true){this.src="media/trip_controls_pauze.png"}else{this.src="media/trip_controls_play.png"}},src:"media/trip_controls_play.png",style:{border:"0px",margin:"0px"}}),ii.elm("img",{onclick:function(){if(a.playing===true){if(a.trip_player){window.clearInterval(a.trip_player)}a.playing=false;this.previousSibling.src="media/trip_controls_play.png"}a.displayLat=a.trippoints[a.trippoints.length-1].lat;a.displayLon=a.trippoints[a.trippoints.length-1].lon;a.vp=a.trippoints.length-1;a.moveMarker()},onmouseover:function(){this.style.cursor="pointer";this.src="media/trip_controls_gotoendX.png"},onmouseout:function(){this.style.cursor="default";this.src="media/trip_controls_gotoend.png"},src:"media/trip_controls_gotoend.png",style:{border:"0px",margin:"0px"}})))};ii.views.trip.ListItem=function(b){this.item=b;this.lengthElm=ii.elm("span","");this.timespanElm=ii.elm("span","");this.speedElm=ii.elm("span","");var a=document.createTextNode(b.name);this.div=ii.views.generateListitem({link:"#rel&item=t."+b.id,img:"/srv/d-media.php?width=64&height=48&entitytype=trip&entityid="+b.id,labels:{name:b.name,author:b.author,created:ii.formatDate(b.created,"relative"),"trip distance":ii.formatDistance(b.distance)},zoomto:function(c){ii.app.map.zoomTo(b.lat,b.lon,50,0);ii.stopPropagation(c)}});this.update();this.div.onmouseover=function(){b.onmouseover()};this.div.onmouseout=function(){b.onmouseout()}};ii.views.trip.ListItem.prototype.update=function(){this.lengthElm.innerHTML=ii.formatDistance(this.item.distance);this.speedElm.innerHTML=ii.formatSpeed(this.item.distance/this.item.timespan);this.timespanElm.innerHTML=ii.formatTimespan(this.item.timespan)};ii.views.trip.ListItem.prototype.onmouseover=function(){this.div.style.backgroundColor="#f0f0f0"};ii.views.trip.ListItem.prototype.onmouseout=function(){this.div.style.backgroundColor=""};ii.views.trip.LineString=function(d,a){this.map=a.map;this.autoplay=a.autoplay;this.item=d;var c=this;var b=function(l){d.trippoints=l.trippoints;c.feature=c.map.addLineString(l.trippoints,"tripLines");var h={},j={};h.lon=j.lon=d.trippoints[0].lon,h.lat=j.lat=d.trippoints[0].lat;for(var f=1,e=d.trippoints.length;f<e;f++){var g={};g.lon=d.trippoints[f].lon,g.lat=d.trippoints[f].lat;if(g.lon<h.lon){h.lon=g.lon}if(g.lat<h.lat){h.lat=g.lat}if(g.lon>j.lon){j.lon=g.lon}if(g.lat>j.lat){j.lat=g.lat}}c.map.zoomToExtent(h,j);if(a.autoplay){d.startTrip()}};ii.get("q-trippoints",b,{tripid:d.id})};ii.views.trip.LineString.prototype.remove=function(){if(this.feature){this.map.removeLineString(this.feature,"tripLines")}if(this.autoplay){this.item.startTrip()}};ii.views.trip.ItemBrowser=function(d,c){this.item=d;this.map=c.map;this.div=ii.elm("div",{style:{backgroundColor:"white"}});this.subItemsets=[];var b=[];c.pane=c.pane||"";this.item=d;this.map=c.map;b.push(new ii.views.ItemBrowser({id:"nophotos",inverseOpen:true,label:"Trip photos",query:new ii.Query("poi",{interval:ii.set_interval_trip_pois},{trip:d.id}),type:"poi",nocontent:ii.elm("span","This Trip contains no Photos. ","Read our ",ii.elm("a",{href:"#rel&tab=HelpFAQ&q=home_trip"},"FAQ")," for help on recording Trips and Trip Photos.")},c));for(var f=0;f<b.length;f++){this.div.appendChild(b[f].div);this.subItemsets.push(b[f].query);this.item.photoQuery=b[f].query;b[f].query.addListener(this.map)}if(c.onDone){var a=this.subItemsets.length;function e(j,h,g){if(!--a){c.onDone()}}for(var f=0;f<this.subItemsets.length;f++){this.subItemsets[f].addListener({itemsDone:e})}}};ii.views.trip.ItemBrowser.prototype.start=function(){for(var a=0;a<this.subItemsets.length;a++){this.subItemsets[a].start()}};ii.views.trip.ItemBrowser.prototype.remove=function(){for(var a=0;a<this.subItemsets.length;a++){this.subItemsets[a].stop()}};ii.set_interval_group_albums=25000;ii.set_interval_group_trips=15000;ii.set_interval_group_photos=15000;ii.set_interval_group_users=25000;ii.set_interval_group_map_photos=5000;ii.set_interval_group_feed=3000;ii.assert(ii.items);ii.assert(ii.views);ii.views.group={};ii.items.Group=function(a){this.init(a)};ii.items.Group.prototype=new ii.items.Item;ii.views.group.ListItem=function(a){this.div=ii.views.generateListitem({link:"#rel&item=g."+a.id,img:"/srv/d-media.php?width=64&height=48&entitytype=group&entityid="+a.id,labels:{name:document.createTextNode(a.name),owner:ii.userLink(a.userid,a.author),date:ii.formatDate(a.modified,"relative"),members:a.members}});this.div.onmouseover=function(){a.onmouseover()};this.div.onmouseout=function(){a.onmouseout()}};ii.views.group.ListItem.prototype.update=function(){};ii.views.group.ListItem.prototype.onmouseover=function(){this.div.style.backgroundColor="#f0f0f0"};ii.views.group.ListItem.prototype.onmouseout=function(){this.div.style.backgroundColor=""};ii.views.group.LargeListItem=function(d){this.info=ii.views.generateListitem({link:"#rel&item=g."+d.id,img:"/srv/d-media.php?width=64&height=48&entitytype=group&entityid="+d.id,labels:{name:document.createTextNode(d.name),owner:ii.userLink(d.userid,d.author),date:ii.formatDate(d.modified,"relative")}});this.info.className="item large";var c=new ii.views.StatusElms();var b=new ii.views.CommentElms("group",d.id,c);var a=new ii.views.JoinElms(d,"group",d.id,c);var e=new ii.views.SendAFriendElms(d,"group",d.id,c);this.div=ii.elm("div",this.info,ii.elm("div",{className:"listitem_links"},a.joinLink,a.leaveLink," ",b.commentLink," ",e.sendAFriendLink),b.commentDiv,e.sendAFriendDiv,c.statusDiv);this.div.onmouseover=function(){d.onmouseover()};this.div.onmouseout=function(){d.onmouseout()}};ii.views.group.ItemCounter=function(b,a){this.item=b;this.subItemsets=[];this.div=ii.elm("div");this.update();window.setTimeout(function(){a.onDone()},0);var c=new ii.Query("poi",{interval:ii.set_interval_group_map_photos,paused:false},{set:b.id});c.addListener(ii.app.map);this.subItemsets.push(c)};ii.views.group.ItemCounter.prototype.update=function(){this.div.innerHTML="";ii.views.addHeader(this.div,"Photos & Videos","allphotos","poi",this.item.pois);ii.views.addHeader(this.div,"Trips","alltrips","trip",this.item.trips);ii.views.addHeader(this.div,"Members","members","user",this.item.members)};ii.views.group.ItemCounter.prototype.remove=function(){for(var a=0;a<this.subItemsets.length;a++){this.subItemsets[a].stop()}};ii.views.group.ItemBrowser=function(d,c){this.item=d;this.map=c.map;this.div=ii.elm("div",{style:{backgroundColor:"white"}});this.subItemsets=[];var b=[];c.pane=c.pane||"";if(c.pane==""||c.pane=="allphotos"){b.push(new ii.views.ItemBrowser({id:"allphotos",label:"All photos",query:new ii.Query("poi",{interval:ii.set_interval_group_photos},{set:d.id,fields:"full"}),type:"poi",nocontent:ii.elm("span","This Group contains no Photos yet. ","Use the [Post In] link to Post a Photo in a Group. ","Read our ",ii.elm("a",{href:"#rel&tab=HelpFAQ&q=postin_what"},"FAQ")," for help on the Post In feature.")},c))}if(c.pane==""||c.pane=="alltrips"){b.push(new ii.views.ItemBrowser({id:"alltrips",label:"All trips",query:new ii.Query("trip",{interval:ii.set_interval_group_trips},{set:d.id}),type:"trip",nocontent:ii.elm("span","This Group contains no Trips yet. ","Use the [Post In] link to Post a Trip in a Group. ","Read our ",ii.elm("a",{href:"#rel&tab=HelpFAQ&q=postin_what"},"FAQ")," for help on the Post In feature.")},c))}if(c.pane==""||c.pane=="members"){b.push(new ii.views.ItemBrowser({id:"members",label:"Members",query:new ii.Query("user",{interval:ii.set_interval_group_users},{set:d.id}),type:"user",nocontent:ii.elm("span","This Group has no Members yet, or Member Privacy is restricted to you. ","Use the [Join] link to Join this Group. ","Read our ",ii.elm("a",{href:"#rel&tab=HelpFAQ&q=groupjoin"},"FAQ")," for help on the Join feature.")},c))}if(c.pane==""){var g=new ii.Query("poi",{interval:ii.set_interval_group_map_photos,paused:false},{set:d.id});g.addListener(ii.app.map);this.subItemsets.push(g)}for(var f=0;f<b.length;f++){this.div.appendChild(b[f].div);this.subItemsets.push(b[f].query);b[f].query.addListener(this.map)}if(c.onDone){var a=this.subItemsets.length;function e(l,j,h){if(!--a){c.onDone()}}for(var f=0;f<this.subItemsets.length;f++){this.subItemsets[f].addListener({itemsDone:e})}}};ii.views.group.WorldCounter=function(a){this.item=a;this.div=ii.elm("div");this.update()};ii.views.group.WorldCounter.prototype.update=function(){this.div.innerHTML="";if(this.item.users>0){ii.views.addHeader(this.div,"People","user","user",this.item.users)}if(this.item.pois>0){var a=ii.views.addHeader(this.div,"Photos & Videos","poi","poi",this.item.pois)}if(this.item.trips>0){ii.views.addHeader(this.div,"Trips","trip","trip",this.item.trips)}if(this.item.spots>0){ii.views.addHeader(this.div,"Spots","spot","spot",this.item.spots)}if(this.item.groups>0){ii.views.addHeader(this.div,"Groups","group","group",this.item.groups)}if(this.item.users+this.item.pois+this.item.trips+this.item.spots+this.item.groups==0){this.div.appendChild(ii.elm("p",{className:"results"},"Nothing found in this area"))}};ii.views.group.ItemBrowser.prototype.remove=function(){for(var a=0;a<this.subItemsets.length;a++){this.subItemsets[a].stop()}};ii.views.group.TabDetailsGroup=function(d,b){var c=this;function a(){var e=this;ii.startWaitButton(e.savebtn);var f={id:d.id,name:this.name.value,description:this.description.value};ii.get("p-upd-set",function(g){ii.endWaitButton(e.savebtn);c.details.setEditMode(e,false);d.name=f.name;d.description=f.description;d.update()},f);return false}this.details=new ii.views.Details(d,b.tabElm,a);this.update()};ii.views.group.TabDetailsGroup.prototype.update=function(){var a={};this.details.update(a)};ii.views.group.TabDetailsGroup.prototype.remove=function(a){this.details.remove()};ii.set_interval_spot_albums=15000;ii.set_interval_spot_photos=15000;ii.set_interval_spot_trips=15000;ii.set_interval_spot_users=15000;ii.set_interval_spot_feed=3000;ii.assert(ii.items);ii.assert(ii.views);ii.views.spot={};ii.items.Spot=function(a){this.init(a)};ii.items.Spot.prototype=new ii.items.Item;ii.views.spot.ListItem=function(d,b){this.item=d;var e=document.createTextNode(d.name);var a=document.createTextNode(ii.formatDate(d.modified,"relative"));this.visitors=ii.elm("span",""+d.visitors);this.div=ii.views.generateListitem({link:"#rel&item=s."+d.id,img:"/srv/d-media.php?width=64&height=48&entitytype=spot&entityid="+d.id,labels:{name:e,owner:ii.userLink(d.userid,d.author),created:a,visitors:this.visitors},zoomto:function(f){ii.app.map.zoomTo(d.lat,d.lon,50,0);ii.stopPropagation(f)}});this.div.onmouseover=function(){d.onmouseover()};this.div.onmouseout=function(){d.onmouseout()};if(b&&b.onclick){var c=this;this.div.onclick=function(){b.onclick(c);this.onmouseover()}}};ii.views.spot.ListItem.prototype.onmouseover=function(){this.div.style.backgroundColor="#f0f0f0"};ii.views.spot.ListItem.prototype.onmouseout=function(){if(!this.highlighted){this.div.style.backgroundColor=""}};ii.views.spot.ListItem.prototype.update=function(){this.visitors.textContent=""+this.item.visitors};ii.views.spot.LargeListItem=function(j){this.item=j;var h=document.createTextNode(j.name);var b=document.createTextNode(ii.formatDate(j.created,"relative"));var d=ii.geoCode(j.lat,j.lon);this.visitors=ii.elm("span",""+j.visitors);this.info=ii.views.generateListitem({link:"#rel&item=s."+j.id,img:"/srv/d-media.php?width=64&height=48&entitytype=spot&entityid="+j.id,labels:{name:h,author:ii.userLink(j.userid,j.author),location:d,created:b,visitors:this.visitors}});this.info.className="item large";var f=new ii.views.StatusElms();var a=new ii.views.CommentElms("spot",j.id,f);var e=new ii.views.JoinElms(j,"spot",j.id,f);var c=new ii.views.VisitElms(j,f);var g=new ii.views.SendAFriendElms(j,"spot",j.id,f);this.div=ii.elm("div",this.info,ii.elm("div",{className:"listitem_links"},e.joinLink,e.leaveLink," ",c.visitLink," ",a.commentLink," ",g.sendAFriendLink),a.commentDiv,g.sendAFriendDiv,f.statusDiv);this.div.onmouseover=function(){j.onmouseover()};this.div.onmouseout=function(){j.onmouseout()}};ii.views.spot.LargeListItem.prototype.update=function(){this.visitors.textContent=""+this.item.visitors};ii.views.spot.ItemCounter=function(b,a){this.item=b;this.subItemsets=[];this.div=ii.elm("div",{className:""});this.update();window.setTimeout(function(){a.onDone()},0)};ii.views.spot.ItemCounter.prototype.update=function(){this.div.innerHTML="";ii.views.addHeader(this.div,"Photos & Videos","allphotos","poi",this.item.pois);ii.views.addHeader(this.div,"Trips","alltrips","trip",this.item.trips);ii.views.addHeader(this.div,"Members","members","user",this.item.members)};ii.views.spot.ItemBrowser=function(d,c){this.item=d;this.map=c.map;this.div=ii.elm("div",{style:{backgroundColor:"white"}});this.subItemsets=[];var b=[];c.pane=c.pane||"";if(c.pane==""||c.pane=="allphotos"){b.push(new ii.views.ItemBrowser({id:"allphotos",label:"Photos & Videos",query:new ii.Query("poi",{interval:ii.set_interval_spot_photos},{set:d.id}),type:"poi",nocontent:ii.elm("span","This Spot contains no Photos yet. ","Use the [Post In] link to Post a Photo in a Spot. ","Read our ",ii.elm("a",{href:"#rel&tab=HelpFAQ&q=postin_what"},"FAQ")," for help on the Post In feature.")},c))}if(c.pane==""||c.pane=="alltrips"){b.push(new ii.views.ItemBrowser({id:"alltrips",label:"Trips",query:new ii.Query("trip",{interval:ii.set_interval_spot_trips},{set:d.id}),type:"trip",nocontent:ii.elm("span","This Spot contains no Trips yet. ","Use the [Post In] link to Post a Trip in a Spot. ","Read our ",ii.elm("a",{href:"#rel&tab=HelpFAQ&q=postin_what"},"FAQ")," for help on the Post In feature.")},c))}if(c.pane==""||c.pane=="members"){b.push(new ii.views.ItemBrowser({id:"members",label:"Members",query:new ii.Query("user",{interval:ii.set_interval_spot_users},{set:d.id}),type:"user",nocontent:ii.elm("span","This Spot has no Members yet, or Member Privacy is restricted to you. ","Use the [Join] link to Join this Spot. ","Read our ",ii.elm("a",{href:"#rel&tab=HelpFAQ&q=joinspot"},"FAQ")," for help on the Join feature.")},c))}for(var f=0;f<b.length;f++){this.div.appendChild(b[f].div);this.subItemsets.push(b[f].query);b[f].query.addListener(this.map)}if(c.onDone){var a=this.subItemsets.length;function e(j,h,g){if(!--a){c.onDone()}}for(var f=0;f<this.subItemsets.length;f++){this.subItemsets[f].addListener({itemsDone:e})}}};ii.views.spot.ItemBrowser.prototype.start=function(){for(var a=0;a<this.subItemsets.length;a++){this.subItemsets[a].start()}};ii.views.spot.ItemBrowser.prototype.remove=function(){for(var a=0;a<this.subItemsets.length;a++){this.subItemsets[a].stop()}};ii.views.spot.Icon=function(b,a){if(!a||!a.map){ii.error("Icon should have map")}this.item=b;this.map=a.map;var c={url:"media/spot_map_large.png"};this.div=ii.elm("div",{className:"marker"},ii.elm("img",{src:c.url}));this.div.onmouseover=function(){b.onmouseover()};this.div.onmouseout=function(){b.onmouseout()};this.div.onclick=function(){b.popupAlwaysVisible=true;b.onmouseover()};this.marker=a.map.addMarker(this.div,"spotIcons",b.lat,b.lon,-23,-58);this.shadowDiv=ii.pngImage("spot_shadow_large.png",59,22);this.shadowDiv.className="marker shadow";this.shadowMarker=a.map.addMarker(this.shadowDiv,"shadows",b.lat,b.lon,-7,-22)};ii.views.spot.Icon.prototype.remove=function(){this.map.removeMarker(this.marker,"spotIcons");this.shadowDiv.parentNode.removeChild(this.shadowDiv);this.map.removeMarker(this.shadowMarker,"shadows")};ii.views.spot.IconPopup=function(d,a){this.item=d;this.map=a.map;if(d.popupAlwaysVisible==undefined){d.popupAlwaysVisible=a.alwaysVisible}this.visitors=ii.elm("span",""+d.visitors);var b=ii.pngImage("spot_balloon.png",208,111);b.className="bg";var c=this;this.div=ii.elm("div",{className:"spot iconpopup marker"},b,ii.elm("div",{className:"content"},ii.elm("div",ii.elm("label","name: "),ii.spotLink(d.id,d.name)),ii.elm("div",ii.elm("label","owner: "),ii.userLink(d.userid,d.author)),ii.elm("div",ii.elm("label","location: "),ii.geoCode(d.lat,d.lon,d.locname)),ii.elm("div",ii.elm("label","visitors: "),this.visitors)),ii.elm("img",{className:"button",style:{left:"185px",top:"77px"},src:"media/poi_zoom_smll.png",onmouseover:ii.onmouseoverbtn,onmouseout:ii.onmouseoutbtn,onclick:function(){a.map.zoomTo(d.lat,d.lon,50,0)}}),ii.elm("img",{className:"button",style:{left:"185px",top:"5px"},src:"media/button_userpop_close.png",onmouseover:ii.onmouseoverbtn,onmouseout:ii.onmouseoutbtn,onclick:function(){d.popupAlwaysVisible=false;c.div.style.visibility="hidden"}}));this.shadowDiv=ii.pngImage("spot_balloon_shadow.png",273,67);this.shadowDiv.className="marker shadow";this.shadowMarker=a.map.addMarker(this.shadowDiv,"shadows",d.lat,d.lon,6,-125);this.div.onmouseover=function(){d.onmouseover()};this.div.onmouseout=function(){d.onmouseout()};this.onmouseout();this.marker=a.map.addMarker(this.div,"spotPopups",d.lat,d.lon,3,-172)};ii.views.spot.IconPopup.prototype.update=function(){this.visitors.textContent=""+this.item.visitors};ii.views.spot.IconPopup.prototype.onmouseout=function(){this.div.style.visibility=this.shadowDiv.style.visibility=(this.item.popupAlwaysVisible?"":"hidden")};ii.views.spot.IconPopup.prototype.onmouseover=function(){this.div.style.visibility=this.shadowDiv.style.visibility=""};ii.views.spot.IconPopup.prototype.remove=function(){this.map.removeMarker(this.marker,"userPopups");this.shadowDiv.parentNode.removeChild(this.shadowDiv);this.map.removeMarker(this.shadowMarker,"shadows")};ii.views.spot.TabDetailsSpot=function(d,b){var c=this;function a(){var e=this;ii.startWaitButton(e.savebtn);var f={id:d.id,name:this.name.value,description:this.description.value};ii.get("p-upd-set",function(g){ii.endWaitButton(e.savebtn);c.details.setEditMode(e,false);d.name=f.name;d.description=f.description;d.update()},f);return false}this.details=new ii.views.Details(d,b.tabElm,a);this.update()};ii.views.spot.TabDetailsSpot.prototype.update=function(){var a={};this.details.update(a)};ii.views.spot.TabDetailsSpot.prototype.remove=function(a){this.details.remove()};ii.set_interval_album_photos=20000;ii.set_interval_album_trips=20000;ii.set_interval_album_feed=3000;ii.assert(ii.items);ii.assert(ii.views);ii.views.album={};ii.items.Album=function(a){this.init(a)};ii.items.Album.prototype=new ii.items.Item;ii.views.album.EditableListItem=function(a){this.div=ii.elm("div",ii.elm("input",{type:"checkbox"}),ii.views.generateListitem({link:"#rel&item=a."+a.id,img:"/srv/d-media.php?width=64&height=48&entitytype=group&entityid="+a.id,labels:{name:document.createTextNode(a.name),owner:ii.userLink(a.userid,a.author),date:ii.formatDate(a.modified,"date"),members:a.members}}));this.div.onmouseover=function(){a.onmouseover()};this.div.onmouseout=function(){a.onmouseout()}};ii.views.album.ListItem=function(a){this.div=ii.views.generateListitem({link:"#rel&item=a."+a.id,img:"/srv/d-media.php?width=64&height=48&entitytype=group&entityid="+a.id,labels:{name:document.createTextNode(a.name),owner:ii.userLink(a.userid,a.author),date:ii.formatDate(a.modified,"date"),members:a.members}});this.div.onmouseover=function(){a.onmouseover()};this.div.onmouseout=function(){a.onmouseout()}};ii.views.album.ListItem.prototype.update=function(){};ii.views.album.ListItem.prototype.onmouseover=function(){this.div.style.backgroundColor="#f0f0f0"};ii.views.album.ListItem.prototype.onmouseout=function(){this.div.style.backgroundColor=""};ii.views.album.LargeListItem=function(a){this.div=ii.views.generateListitem({link:"#rel&item=g."+a.id,img:"/srv/d-media.php?width=64&height=48&entitytype=group&entityid="+a.id,labels:{name:document.createTextNode(a.name),owner:ii.userLink(a.userid,a.author),date:ii.formatDate(a.modified,"date")}});this.div.onmouseover=function(){a.onmouseover()};this.div.onmouseout=function(){a.onmouseout()}};ii.views.album.LargeListItem.prototype.onmouseover=function(){this.div.style.backgroundColor="#bbddff"};ii.views.album.LargeListItem.prototype.onmouseout=function(){this.div.style.backgroundColor=""};ii.views.album.ItemBrowser=function(d,c){this.item=d;this.map=c.map;this.div=ii.elm("div",{style:{backgroundColor:"white"}});this.subItemsets=[];var b=[];c.pane=c.pane||"";if(c.pane==""||c.pane=="allphotos"){b.push(new ii.views.ItemBrowser({id:"photos",label:"Photos",query:new ii.Query("poi",{interval:ii.set_interval_album_photos},{set:d.id}),type:"poi"},c))}if(c.pane==""||c.pane=="alltrips"){b.push(new ii.views.ItemBrowser({id:"trips",label:"Trips",query:new ii.Query("trip",{interval:ii.set_interval_album_trips},{set:d.id}),type:"trip"},c))}for(var f=0;f<b.length;f++){this.div.appendChild(b[f].div);this.subItemsets.push(b[f].query);b[f].query.addListener(this.map)}if(c.onDone){var a=this.subItemsets.length;function e(j,h,g){if(!--a){c.onDone()}}for(var f=0;f<this.subItemsets.length;f++){this.subItemsets[f].addListener({itemsDone:e})}}};ii.views.album.ItemBrowser.prototype.start=function(){for(var a=0;a<this.subItemsets.length;a++){this.subItemsets[a].start()}};ii.views.album.ItemBrowser.prototype.remove=function(){for(var a=0;a<this.subItemsets.length;a++){this.subItemsets[a].stop()}};ii.views.album.TabDetailsAlbum=function(a){this.item=a;this.target=args.tabElm;ii.log("loginid="+ii.login.id+", userid="+a.userid);if(ii.login&&(ii.login.id==a.userid||ii.login.isAdmin)){var b=document.getElementById("ii_details_album_form");document.getElementById("ii_details_trip_editbtn").onclick=function(){b.className="editmode"};document.getElementById("ii_details_trip_cancelbtn").onclick=function(){b.className="viewmode"};b.onsubmit=function(){var c={id:a.id,name:this.name.value,description:this.description.value};ii.get("p-upd-trip",function(d){ii.dir(d);b.className="viewmode"},c);return false}}else{document.getElementById("ii_details_trip_editbtn").style.display="none"}this.update()};ii.views.album.TabDetailsAlbum=function(){this.details.update()};ii.views.album.TabDetailsAlbum.prototype.remove=function(){this.details.remove()};ii.assert(ii.items);ii.assert(ii.views);ii.views.comment={};ii.items.Comment=function(a){this.init(a)};ii.items.Comment.prototype=new ii.items.Item;ii.items.Comment.prototype.fillCommentContent=function(a){ii.text2href(this.content,a)};ii.views.comment.TabView=function(b){var a=ii.elm("p",{className:"content"});b.fillCommentContent(a);this.div=ii.elm("div",{className:"comment tabview"},a,ii.elm("img",{style:{cssFloat:"left"},alt:"photo",src:"/srv/d-media.php?width=32&height=24&entitytype=user&entityid="+b.userid}),ii.elm("p",{className:"details"},ii.elm("p",ii.elm("span",{className:"field"},"posted by: "),ii.userLink(b.userid,b.author)),ii.elm("p",{className:"field"},ii.formatDate(b.created,"relative"))),ii.elm("hr"));this.div.onmouseover=function(){b.onmouseover()};this.div.onmouseout=function(){b.onmouseout()}};ii.views.comment.ListItem=function(e,c){this.item=e;this.isunread=(e.status=="");var b=c.userid;var f=((ii.login&&ii.login.id==e.userid)?"fromme":"tome");var d=ii.elm("span",{className:"author"},ii.userLink(e.userid,e.author));var a=(ii.login&&(ii.login.id==b||ii.login.id==e.userid));var h="msgcontent "+(e.status==""?"unreadmsg":"readmsg");function g(){var l=this.parentNode.parentNode;var o=l.getElementsByTagName("input");var j=true;for(var p=0;p<o.length;p++){if(o[p].type=="checkbox"){if(!o[p].checked){j=false}}}var m=l.getElementsByTagName("a");for(var p=0;p<m.length;p++){if(m[p].className=="selectall"){m[p].style.display=(j?"none":"")}else{if(m[p].className=="deselectall"){m[p].style.display=(j?"":"none")}}}}this.content=ii.elm("p",{className:h});this.item.fillCommentContent(this.content);this.div=ii.elm("div",{className:"comment_wrapper"},ii.elm("input",{type:"checkbox",className:"checkbox",value:e.id,onclick:g,onchange:g,style:{visibility:(a?"":"hidden")}}),ii.elm("img",{alt:"avatar",src:"/srv/d-media.php?width=64&height=48&entitytype=user&entityid="+e.userid}),ii.elm("div",{className:"content_background_wrapper"},ii.elm("img",{alt:"pointer",src:"/media/details_comments_tip.gif",className:"tip"}),ii.elm("div",{className:"content_background"},ii.elm("p",{className:"metadata timestamp"},ii.formatDate(e.created,"relative")),this.content,ii.elm("p",d))));this.div.onmouseover=function(){e.onmouseover()};this.div.onmouseout=function(){e.onmouseout()}};ii.views.comment.ListItem.prototype.update=function(){if(this.item.status!=""&&this.isunread){this.isunread=false;this.content.className="readmsg";if(this.markAsRead){this.markAsRead()}}};ii.assert(ii.items);ii.assert(ii.views);ii.views.feed={};ii.items.Feed=function(a){this.init(a)};ii.items.Feed.prototype=new ii.items.Item;ii.views.feed.SmallView=function(d){var c;switch(d.feedtype+"."+d.entitytype1+"."+d.entitytype2){case"islive..":c=ii.elm("span"," is ",ii.elm("span",{className:"live"},"Live!"));break;case"atspot.spot.":c=ii.elm("span"," visits Spot: ",ii.spotLink(d.entityid1,d.content));break;case"updatepic..":c=ii.elm("span"," updates profile picture");break;case"add..":c=" signed up";break;case"add.comment.":c=" updates Status message: "+d.content;break;case"add.user.":c=ii.elm("span"," adds ",ii.userLink(d.entityid1,d.content)," as Friend");break;case"remove.user.":c=ii.elm("span"," drops ",ii.userLink(d.entityid1,d.content)," as Friend");break;case"add.poi.":c=ii.elm("span"," posts Photo: ",ii.poiLink(d.entityid1,d.content));break;case"add.trip.":c=ii.elm("span"," posts Trip: ",ii.tripLink(d.entityid1,d.content));break;case"add.spot.":c=ii.elm("span"," posts Spot: ",ii.spotLink(d.entityid1,d.content));break;case"add.album.":a="#rel&item=u."+d.userid+"&pane=album."+d.entityid1;c=ii.elm("span"," posts Album: ",ii.elm("a",{href:a},d.content));break;case"add.group.":c=ii.elm("span"," posts Group: ",ii.groupLink(d.entityid1,d.content));break;case"add.poi.comment":var b=ii.elm("span",{style:{fontStyle:"italic"}});ii.text2href(d.content,b);c=ii.elm("span"," posts ",ii.poiLink(d.entityid1,"Photo")," Comment: ",b);break;case"add.trip.comment":var b=ii.elm("span",{style:{fontStyle:"italic"}});ii.text2href(d.content,b);c=ii.elm("span"," posts ",ii.tripLink(d.entityid1,"Trip")," Comment: ",b);break;case"add.spot.comment":var b=ii.elm("span",{style:{fontStyle:"italic"}});ii.text2href(d.content,b);c=ii.elm("span"," posts ",ii.spotLink(d.entityid1,"Spot")," Comment: ",b);break;case"add.group.comment":var b=ii.elm("span",{style:{fontStyle:"italic"}});ii.text2href(d.content,b);c=ii.elm("span"," posts ",ii.groupLink(d.entityid1,"Group")," Comment: ",b);break;case"add.poi.group":c=ii.elm("span"," posts ",ii.groupLink(d.entityid2,"Group")," Photo: ",ii.poiLink(d.entityid1,d.content));break;case"add.poi.spot":c=ii.elm("span"," posts ",ii.spotLink(d.entityid2,"Spot")," Photo: ",ii.poiLink(d.entityid1,d.content));break;case"add.poi.trip":c=ii.elm("span"," posts ",ii.tripLink(d.entityid2,"Trip")," Photo: ",ii.poiLink(d.entityid1,d.content));break;case"add.poi.album":c=ii.elm("span"," posts ",ii.elm("a",{href:"#rel&item."+d.userid+"&pane=album."+d.entityid2},"Album")," Photo: ",ii.poiLink(d.entityid1,d.content));break;case"add.trip.group":c=ii.elm("span"," posts ",ii.groupLink(d.entityid2,"Group")," Trip: ",ii.tripLink(d.entityid1,d.content));break;case"add.trip.spot":c=ii.elm("span"," posts ",ii.spotLink(d.entityid2,"Spot")," Trip: ",ii.tripLink(d.entityid1,d.content));break;case"add.trip.album":c=ii.elm("span"," posts ",ii.elm("a",{href:"#rel&item."+d.userid+"&pane=album."+d.entityid2},"Album")," Trip: ",ii.tripLink(d.entityid1,d.content));break;case"add.user.group":var a="#rel&item="+ii.typeletter[d.entitytype2]+"."+d.entityid2;c=ii.elm("span"," joins Group: ",ii.elm("a",{href:a},d.content));break;case"remove.user.group":var a="#rel&item="+ii.typeletter[d.entitytype2]+"."+d.entityid2;c=ii.elm("span"," leaves Group: ",ii.elm("a",{href:a},d.content));break;case"add.user.spot":var a="#rel&item="+ii.typeletter[d.entitytype2]+"."+d.entityid2;c=ii.elm("span"," joins Spot: ",ii.elm("a",{href:a},d.content));break;case"remove.user.spot":var a="#rel&item="+ii.typeletter[d.entitytype2]+"."+d.entityid2;c=ii.elm("span"," leaves Spot: ",ii.elm("a",{href:a},d.content));break;default:c=ii.elm("div"," err. unknown item in feed: "+d.feedtype+"."+d.entitytype1+"."+d.entitytype2);break}this.div=ii.elm("div",ii.userLink(d.userid,d.username),c)};ii.views.feed.ListItem=function(t,f){var f=f||{};var v=item_location="";var p=false;var d={height:112,width:150,style:"center"};var c="/srv/d-media.php?";var u;switch(t.feedtype+"."+t.entitytype1+"."+t.entitytype2){case"islive..":v=ii.elm("span"," is ",ii.elm("span",{className:"live"},"Live!")," near: ",ii.geoCode(t.lat,t.lon));c="/srv/d-staticmap.php?";d.userlat=t.lat;d.userlon=t.lon;d.type="live-map";u="#rel&item=u."+t.userid;break;case"atspot.spot.":v=ii.elm("span"," visits Spot: ",ii.spotLink(t.entityid1,t.content));break;case"updatepic..":v=ii.elm("span"," updates profile picture");c="/srv/d-staticmap.php?";d.userlat=t.lat;d.userlon=t.lon;d.type="live-map";u="#rel&item=u."+t.userid;break;case"add..":v=ii.elm("span"," signed up near: ",ii.geoCode(t.lat,t.lon));p=true;c="/srv/d-staticmap.php?";d.userlat=t.lat;d.userlon=t.lon;d.type="live-map";u="#rel&item=u."+t.userid;break;case"add.comment.":v=" updates Status message:";p=true;c="/srv/d-staticmap.php?";d.userlat=t.lat;d.userlon=t.lon;d.type="live-map";u="#rel&item=u."+t.userid;break;case"add.user.":v=ii.elm("span"," adds ",ii.userLink(t.entityid1,t.content)," as Friend");break;case"remove.user.":v=ii.elm("span"," drops ",ii.userLink(t.entityid1,t.content)," as Friend");break;case"add.poi.":v=ii.elm("span"," posts Photo: ",ii.poiLink(t.entityid1,t.content)," near ",ii.geoCode(t.lat,t.lon));break;case"add.trip.":v=ii.elm("span"," posts Trip: ",ii.tripLink(t.entityid1,t.content)," near ",ii.geoCode(t.lat,t.lon));break;case"add.spot.":v=ii.elm("span"," posts Spot: ",ii.spotLink(t.entityid1,t.content)," near ",ii.geoCode(t.lat,t.lon));break;case"add.album.":u="#rel&item=u."+t.userid+"&pane=album."+t.entityid1;v=ii.elm("span"," posts Album: ",ii.elm("a",{href:u},t.content));break;case"add.group.":v=ii.elm("span"," posts Group: ",ii.groupLink(t.entityid1,t.content));break;case"add.poi.comment":var r=ii.elm("span",{style:{fontStyle:"italic"}});ii.text2href(t.content,r);v=ii.elm("span"," posts ",ii.poiLink(t.entityid1,"Photo")," Comment: ",r);d.marker="commentcount";break;case"add.trip.comment":var r=ii.elm("span",{style:{fontStyle:"italic"}});ii.text2href(t.content,r);v=ii.elm("span"," posts ",ii.tripLink(t.entityid1,"Trip")," Comment: ",r);break;case"add.spot.comment":var r=ii.elm("span",{style:{fontStyle:"italic"}});ii.text2href(t.content,r);v=ii.elm("span"," posts ",ii.spotLink(t.entityid1,"Spot")," Comment: ",r);break;case"add.group.comment":var r=ii.elm("span",{style:{fontStyle:"italic"}});ii.text2href(t.content,r);v=ii.elm("span"," posts ",ii.groupLink(t.entityid1,"Group")," Comment: ",r);break;case"add.poi.group":v=ii.elm("span"," posts ",ii.groupLink(t.entityid2,"Group")," Photo: ",ii.poiLink(t.entityid1,t.content));break;case"add.poi.spot":v=ii.elm("span"," posts ",ii.spotLink(t.entityid2,"Spot")," Photo: ",ii.poiLink(t.entityid1,t.content));break;case"add.poi.trip":v=ii.elm("span"," posts ",ii.tripLink(t.entityid2,"Trip")," Photo: ",ii.poiLink(t.entityid1,t.content));break;case"add.poi.album":v=ii.elm("span"," posts ",ii.elm("a",{href:"#rel&item."+t.userid+"&pane=album."+t.entityid2},"Album")," Photo: ",ii.poiLink(t.entityid1,t.content));break;case"add.trip.spot":v=ii.elm("span"," posts ",ii.spotLink(t.entityid2,"Spot")," Trip: ",ii.tripLink(t.entityid1,t.content));break;case"add.trip.group":v=ii.elm("span"," posts ",ii.groupLink(t.entityid2,"Group")," Trip: ",ii.tripLink(t.entityid1,t.content));break;case"add.trip.album":v=ii.elm("span"," posts ",ii.elm("a",{href:"#rel&item."+t.userid+"&pane=album."+t.entityid2},"Album")," Trip: ",ii.tripLink(t.entityid1,t.content));break;case"add.user.group":var u="#rel&item="+ii.typeletter[t.entitytype2]+"."+t.entityid2;v=ii.elm("span"," joins Group: ",ii.elm("a",{href:u},t.content));d.entitytype=t.entitytype2;d.entityid=t.entityid2;break;case"remove.user.group":var u="#rel&item="+ii.typeletter[t.entitytype2]+"."+t.entityid2;v=ii.elm("span"," leaves Group: ",ii.elm("a",{href:u},t.content));d.entitytype=t.entitytype2;d.entityid=t.entityid2;break;case"add.user.spot":var u="#rel&item="+ii.typeletter[t.entitytype2]+"."+t.entityid2;v=ii.elm("span"," joins Spot: ",ii.elm("a",{href:u},t.content));d.entitytype=t.entitytype2;d.entityid=t.entityid2;break;case"remove.user.spot":var u="#rel&item="+ii.typeletter[t.entitytype2]+"."+t.entityid2;v=ii.elm("span"," leaves Spot: ",ii.elm("a",{href:u},t.content));d.entitytype=t.entitytype2;d.entityid=t.entityid2;break;default:item_location=ii.geoCode(t.lat,t.lon);v=t.feedtype+"."+t.entitytype1+"."+t.entitytype2+":";d.entitytype="poi";d.entityid=t.entityid2;d.marker="commentcount";break}var m=ii.encode_query_string({entityid:t.userid,entitytype:"user",height:"45",width:"60"});var h=ii.elm("img",{alt:"avatar",src:"/srv/d-media.php?"+m,style:{height:"45px",width:"60px"}});var y=ii.elm("a",{href:"#rel&item=u."+t.userid},h);if(f.onAvatarClick){y.onclick=function(){f.onAvatarClick()}}var g=ii.elm("div",{style:{cssFloat:"left",margin:"0px 5px 5px 0px",width:"60px"}},y);if(!u){var u="#rel&item="+ii.typeletter[t.entitytype1]+"."+t.entityid1}if(!d.entitytype){d.entitytype=t.entitytype1;d.entityid=t.entityid1}var a=ii.encode_query_string(d);var A=ii.elm("img",{src:c+a,align:"right"});var l=ii.elm("a",{href:u},A);if(f.onItemClick){l.onclick=function(){f.onItemClick()}}var j=ii.elm("div",{style:{cssFloat:"right",padding:"0px 0px 5px 5px",width:d.width+"px"}},l);var s=ii.elm("p",{className:"feed_metadata_date",style:{margin:"0px",padding:"0px"}},ii.formatDate(t.created,"relative"));var e=ii.elm("a",{href:"#rel&item=u."+t.userid},t.username);if(f.onUserNameClick){e.onclick=function(){f.onUserNameClick()}}var o=(390-d.width-5)+"px";var b=ii.elm("div",{className:"feed_content",style:{margin:"0px",padding:"0px",width:o}},s,e,v||"");var x=ii.elm("div",{style:{clear:"right",width:"390px",left:"0px",marginLeft:"65px",position:"absolute",top:"15px"}},j,b);var q="";if(p&&t.content){q=ii.getMessageBox({message:t.content,disabled:true});q.style.position="absolute";q.style.bottom="17px";q.style.left="0px"}this.div=ii.elm("div",{style:{borderBottom:"solid 1px #b7b7b7",height:"112px",padding:"15px 0px",position:"relative",width:"100%"}},g,x,q);this.div.onmouseover=function(){t.onmouseover()};this.div.onmouseout=function(){t.onmouseout()}};ii.views.feed.ListItem.prototype.onmouseover=function(){this.div.style.backgroundColor="#f0f0f0"};ii.views.feed.ListItem.prototype.onmouseout=function(){this.div.style.backgroundColor=""};ii.views.feed.query=function(){};ii.set_geocode_shortnames=true;ii.set_geocode_server_cache=true;ii.geoCode_cache={};ii.geoCode=function(f,a,b,j){if(f==0&&a==0){b="Invalid location"}if(!b){var c=ii.geoCode_cache[""+f+"x"+a];if(c){ii.log("Geocoder: Using local cache");b=c}}else{ii.log("Geocoder: Using server cache")}if(b){var h=b}else{var h=""+(Math.round(f*100)/100)+" x "+(Math.round(a*100)/100)}if(j){var e=j;if(b){e.innerHTML=b}}else{var e=ii.elm("abbr",{className:"geo",title:""+f+";"+a},h)}if(b){return e}function g(m){if(m.Status.code==620){ii.log("Geocoder: Too many reuqests, postponing");window.setTimeout(function(){ii.reverseGeocoder.getLocations(new GLatLng(f,a),g)},2000+Math.random()*6000)}else{if(m.Status.code==200){var o=m.Placemark[0];var l=""+o.address;if(ii.set_geocode_shortnames){l=l.replace(/([^,]+), *USA/,"$1");l=l.replace(/([^,]+), *The Netherlands/,"$1")}ii.geoCode_cache[""+f+"x"+a]=l;e.innerHTML=""+l;ii.log("Geocoder: Using geocoder");if(ii.set_geocode_server_cache){ii.get("p-geoname-cache",function(){},{lat:f,lon:a,locname:o.address})}}else{ii.log("Geocoder: Geocoder failed")}}}if(!ii.reverseGeocoder&&window.GClientGeocoder){ii.log("Initinializing geocoder");try{ii.reverseGeocoder=new GClientGeocoder()}catch(d){ii.log("failed initializing geocoder: "+d)}}if(!b&&ii.reverseGeocoder&&f!=0&&a!=0){window.setTimeout(function(){ii.reverseGeocoder.getLocations(new GLatLng(f,a),g)},500+Math.random()*3000)}return e};