(function(){function x(){h.isDocumentReady=true;h.ready(null,"document")}window.loadFirebugConsole&&window.loadFirebugConsole();var n=null,G={document:{ready:false,callbacks:[]},publisher:{ready:false,callbacks:[]},user:{ready:false,callbacks:[]},framework:{ready:false,callbacks:[]},setup:{ready:false,callbacks:[]},complete:{ready:false,callbacks:[]}},p=navigator.userAgent.toLowerCase(),H={version:(p.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],msie:/msie/.test(p)&&!/opera/.test(p)};p={}; if(window.location.search.match(/^\??(.*)$/)[1].length)for(var y=window.location.search.match(/^\??(.*)$/)[1].split("&"),E=0;E=7)){y=g.match(/^(.*)\.([a-z]+)$/);g=y[1]+".gz."+y[2]}}return i+"/api/v"+ h.version+"/"+g}},location:window.top.location,frameLocation:window.location.href,notifications:{gifting:null,purchase:null},environment:"production",hasComplete:false,params:p,init:function(a){a||(a={});if(this.params.v_host){if(!a.redirected){this.options=a;this.options.redirected=true;this.getScript(this.params.v_host+"/javascripts/api/viximo.js");return this}this.test=true;delete a.notifications}if(a.complete)this.hasComplete=true;if(a.window){a.window.viximo=h;this.targetFrame={window:a.window, document:a.window.document,location:a.window.location,options:{}}}this.domain=a.domain;var b={quibblo:true};if(!h.isDocumentReady&&(a.trackingOnly||a.complete)&&!b[a.publisher]){this.ready(function(){h.init(a)},"document");return this}a.complete&&this.ready(function(){h.isDocumentReady?a.complete():n(a.complete)},"complete");if(this.initialized)return this;if(a.locale){b=/^([a-z]{2})(?:-([a-z]{2}))?$/i.exec(a.locale);if(!b)throw Error(a.locale+" is not a valid locale");this.locale=b[1].toLowerCase()+ (b[2]?"-"+b[2].toUpperCase():"")}if(a.theme)this.theme=a.theme;if(a.version)this.version=a.version=="latest"?3:a.version;this.publisher={name:this.params.v_publisher||a.publisher,website:a.website,urls:this.version<3&&a.urls||{}};this.user={id:this.params.v_user||a.user,cash_currency_balance:a.cash_balance||a.balance,reward_currency_balance:a.reward_balance,display_name:a.name,friends:a.friends,gender:a.gender,location:a.location,country:a.country,locale:this.locale,avatar:a.avatar,birthday:a.birthday, profile_url:a.profile_url};if(this.params.v_session)this.user.session_key=this.params.v_session;else if(this.params.v_app_secret){b=Math.round((new Date).getTime()/1E3);this.user.session_key=N(this.user.id+b+this.params.v_app_secret)+"-"+b}else this.user.session_key=a.session;for(var g in this.user)this.user[g]==null&&delete this.user[g];if(a.notifications)this.notifications=a.notifications;if(a.settings)this.settings=a.settings;if(a.translations)this.translations=a.translations;this.initialized= true;if(a.trackingOnly){this.getScript("tracking");this.setup()}else{if(a.version<3){g=["default"];this.theme!="default"&&g.push(this.theme);for(b=0;b=3&&this.user.id&&!g.display_name&&(!this.user.display_name||this.user.id== this.user.display_name)){n.logger.error(Error("Required option(s) not specified: name"));for(a=0;a=3&&this.getStylesheet("publishers/"+this.publisher.name+".site")}this.tracker.context=n.extend({environment:this.environment,publisherId:this.publisher.name,userId:this.user.id,user_name:this.user.display_name,gender:this.user.gender,country:this.user.country, age:this.user.age,source:n.query.v_source},this.tracker.context);b=["user_name","gender","country","age"];for(a=0;a<\/script>')},getStylesheet:function(a){a.match(/^http/)||(a=h.url.stylesheet(a));var b=h.targetFrame.document; if(h.isDocumentReady||h.targetFrame.window!==window){var g=b.createElement("link");g.href=a;g.rel="stylesheet";g.media="screen";g.type="text/css";if(a=b.getElementsByTagName("head")[0])a.appendChild(g);else throw"Head element is missing. Please verify the markup validity of the page.";}else b.write('')}};if(document.addEventListener)document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded", arguments.callee,false);x()},false);else if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);x()}});document.documentElement.doScroll&&window===window.top&&function(){if(!h.isDocumentReady){try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}x()}}()}if(window.addEventListener)window.addEventListener("load",x,false);else window.attachEvent&& window.attachEvent("onload",x);h.register=function(a,b){b(n);a=="storefront"&&h.ready(null,"framework")};h.opensocialContext={};h.opensocialWrapErrors=function(a){return function(){try{a.apply(this,arguments)}catch(b){if(!b||typeof b!=="object"&&Object.prototype.toString.call(b)!=="[object Function]")b=Error(b);var g={build:h.build,container_id:h.opensocialContext.container_id,publisher_id:h.opensocialContext.publisher_id,app_id:h.opensocialContext.app_id,user_id:h.opensocialContext.user_id,fileName:b.fileName, lineNumber:b.lineNumber,message:b.message&&b.message.length>200?b.message.substr(0,197)+"...":b.message,stack:b.stack&&b.stack.length>3300?b.stack.substr(0,3297)+"...":b.stack},i=[],k;for(k in g){var j=g[k];if(j!=null)i[i.length]=encodeURIComponent(k)+"="+encodeURIComponent(j)}g=h.client_exceptions_url;g=g+(g.indexOf("?")>=0?"&":"?")+i.join("&").replace(/%20/g,"+");var c=new Image(1,1);c.onload=function(){c.onload=null};c.src=g;h.init({publisher:h.opensocialContext.publisher_id,version:3,complete:function(){h.ui.disabledapp("#"+ h.opensocialContext.container_id,{selected:h.opensocialContext.app_id})}})}}};h.opensocialUtil={encodeUserId:function(a){return a.toString().replace(/\./g,"::")},decodeUserId:function(a){return a.toString().replace(/::/g,".")}};h.opensocialInit=h.opensocialWrapErrors(function(a,b,g,i){if(arguments.length==5||b.match(/viximo\.com/)){b=arguments[2];g=arguments[3];i=arguments[4]}h.opensocialContext.container_id=a;h.opensocialContext.publisher_id=b;h.opensocialContext.app_id=g;var k=h.urls.api.protocol+ "://"+h.urls.api.host;if(h.urls.api.port)k+=":"+h.urls.api.port;var j=gadgets.views.getParams(),c;for(c in j)h.params[c]=j[c];if(window.location.href.match("VIXIMO_XD_PROXY"))getScript(k+"/javascripts/api/viximo.xd.js");else{j=[opensocial.Person.Field.GENDER,opensocial.Person.Field.DATE_OF_BIRTH,opensocial.Person.Field.THUMBNAIL_URL,opensocial.Person.Field.PROFILE_URL];if(i.demographics)j=j.concat(i.demographics);c=opensocial.newDataRequest();var e={};e[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS]= j;c.add(c.newFetchPersonRequest(opensocial.IdSpec.PersonId.VIEWER,e),"viewer");e=opensocial.newIdSpec({userId:opensocial.IdSpec.PersonId.VIEWER,groupId:opensocial.IdSpec.GroupId.FRIENDS});var f={};f[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS]=j;f[opensocial.DataRequest.PeopleRequestFields.MAX]=i.max_friends||2E3;c.add(c.newFetchPeopleRequest(e,f),"friends");c.send(function(d){var w=[];d.hasError&&w.push(d.getErrorMessage());var B=function(u,z,A){u=u.get(z);if(u.hadError()){A.push(u.getErrorCode()+ ":"+u.getErrorMessage());return null}return u.getData()},v=B(d,"viewer",w),I=B(d,"friends",w);d={};d[gadgets.io.RequestParameters.CONTENT_TYPE]=gadgets.io.ContentType.JSON;d[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;d[gadgets.io.RequestParameters.METHOD]=gadgets.io.MethodType.POST;B=k+"/api/v3/app/"+g+"/publishers/"+b+"/users/"+h.opensocialUtil.encodeUserId(v.getId())+"/sessions.json?_method=POST";h.opensocialContext.user_id=h.opensocialUtil.encodeUserId(v.getId()); var O=h.opensocialWrapErrors(function(u){if(u.errors&&u.errors.length>0)w=w.concat(u.errors);if(w.length>0)throw Error("OpensocialInit Error:"+w.join("_"));else{var z=function(l){var m;if(l&&l.getKey)m=l.getKey();else if(typeof l==="string")m=l;if(m)m=m.toLowerCase();return m=="male"||m=="female"?m:null},A=function(l){for(var m in l)l[m]||delete l[m];return l},J=function(l){return{id:h.opensocialUtil.encodeUserId(l.getId()),name:l.getDisplayName(),avatar:l.getField(opensocial.Person.Field.THUMBNAIL_URL), gender:z(l.getField(opensocial.Person.Field.GENDER)),birthday:l.getField(opensocial.Person.Field.DATE_OF_BIRTH),profile_url:l.getField(opensocial.Person.Field.PROFILE_URL)}},K=function(l,m){for(var C in m)l[C]=m[C]},L=[];I.each(function(l){var m=J(l);m.name&&m.id&&L.push(A(m));K(l,m)});K(v,J(v));u=A({user:h.opensocialUtil.encodeUserId(v.getId()),publisher:b,name:v.getDisplayName(),gender:z(v.getField(opensocial.Person.Field.GENDER)),birthday:v.getField(opensocial.Person.Field.DATE_OF_BIRTH),avatar:v.getField(opensocial.Person.Field.THUMBNAIL_URL), profile_url:v.getField(opensocial.Person.Field.PROFILE_URL),locale:function(){var l=new gadgets.Prefs,m=l.getLang();l=l.getCountry();return m&&l?m.toLowerCase()+"-"+l.toUpperCase():null}(),country:(new gadgets.Prefs).getCountry(),friends:L,session:u.data.session.session_key,version:3});for(var M in i)u[M]=i[M];u.complete=function(){var l=i.complete;l!=null&&l(v,I);h.ui.application("#"+a,{selected:g,menus:false,resized:function(m,C){gadgets.window.adjustHeight(C.height)}})};h.init(u)}});gadgets.io.makeRequest(B, O,d)})}});h.environment="production";h.build="0f9f28efc";p=document.location.protocol.slice(0,-1);h.urls={api:{protocol:p,host:"api.viximo.com",http:80,https:443},notifications:{protocol:p,host:"notifications.viximo.com",http:80,https:443},corporate:{protocol:"https",host:"viximo.com",http:80,https:443},photo_market:{protocol:"http",host:"snapmeup.viximo.com",http:"80"},asset:{protocol:p,host:p=="http"?"cdn.viximo.com":"s3.amazonaws.com/viximo-designer-portal-production",http:80,https:443}};h.client_exceptions_url= "http://viximo.com/client_exceptions/ping";if(h.environment!="production")var o=function(a,b){var g,i,k,j,c;k=a&2147483648;j=b&2147483648;g=a&1073741824;i=b&1073741824;c=(a&1073741823)+(b&1073741823);if(g&i)return c^2147483648^k^j;return g|i?c&1073741824?c^3221225472^k^j:c^1073741824^k^j:c^k^j},q=function(a,b,g,i,k,j,c){a=o(a,o(o(b&g|~b&i,k),c));return o(a<>>32-j,b)},r=function(a,b,g,i,k,j,c){a=o(a,o(o(b&i|g&~i,k),c));return o(a<>>32-j,b)},s=function(a,b,g,i,k,j,c){a=o(a,o(o(b^g^i,k),c)); return o(a<>>32-j,b)},t=function(a,b,g,i,k,j,c){a=o(a,o(o(g^(b|~i),k),c));return o(a<>>32-j,b)},D=function(a){var b="",g="",i;for(i=0;i<=3;i++){g=a>>>i*8&255;g="0"+g.toString(16);b+=g.substr(g.length-2,2)}return b},N=function(a){var b=[],g,i,k,j,c,e,f,d;b=a;b=b.replace(/\x0d\x0a/g,"\n");a="";for(g=0;g127&&i<2048)a+=String.fromCharCode(i>>6|192);else{a+=String.fromCharCode(i>>12|224);a+=String.fromCharCode(i>>6& 63|128)}a+=String.fromCharCode(i&63|128)}}b=a=a;a=b.length;g=a+8;i=((g-g%64)/64+1)*16;k=Array(i-1);for(c=j=0;c>>29;b=k;c=1732584193;e=4023233417;f=2562383102;d=271733878;for(a=0;a