var MooTools={version:"1.2.0",build:""};var Native=function(J){J=J||{};var F=J.afterImplement||function(){};var G=J.generics;G=(G!==false);var H=J.legacy;var E=J.initialize;var B=J.protect;var A=J.name;var C=E||H;C.constructor=Native;C.$family={name:"native"};if(H&&E){C.prototype=H.prototype}C.prototype.constructor=C;if(A){var D=A.toLowerCase();C.prototype.$family={name:D};Native.typize(C,D)}var I=function(M,K,N,L){if(!B||L||!M.prototype[K]){M.prototype[K]=N}if(G){Native.genericize(M,K,B)}F.call(M,K,N);return M};C.implement=function(L,K,N){if(typeof L=="string"){return I(this,L,K,N)}for(var M in L){I(this,M,L[M],K)}return this};C.alias=function(M,K,N){if(typeof M=="string"){M=this.prototype[M];if(M){I(this,K,M,N)}}else{for(var L in M){this.alias(L,M[L],K)}}return this};return C};Native.implement=function(D,C){for(var B=0,A=D.length;B<A;B++){D[B].implement(C)}};Native.genericize=function(B,C,A){if((!A||!B[C])&&typeof B.prototype[C]=="function"){B[C]=function(){var D=Array.prototype.slice.call(arguments);return B.prototype[C].apply(D.shift(),D)}}};Native.typize=function(A,B){if(!A.type){A.type=function(C){return($type(C)===B)}}};Native.alias=function(E,B,A,F){for(var D=0,C=E.length;D<C;D++){E[D].alias(B,A,F)}};(function(B){for(var A in B){Native.typize(B[A],A)}})({"boolean":Boolean,"native":Native,object:Object});(function(B){for(var A in B){new Native({name:A,initialize:B[A],protect:true})}})({String:String,Function:Function,Number:Number,Array:Array,RegExp:RegExp,Date:Date});(function(B,A){for(var C=A.length;C--;C){Native.genericize(B,A[C],true)}return arguments.callee})(Array,["pop","push","reverse","shift","sort","splice","unshift","concat","join","slice","toString","valueOf","indexOf","lastIndexOf"])(String,["charAt","charCodeAt","concat","indexOf","lastIndexOf","match","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase","valueOf"]);function $chk(A){return !!(A||A===0)}function $clear(A){clearTimeout(A);clearInterval(A);return null}function $defined(A){return(A!=undefined)}function $empty(){}function $arguments(A){return function(){return arguments[A]}}function $lambda(A){return(typeof A=="function")?A:function(){return A}}function $extend(C,A){for(var B in (A||{})){C[B]=A[B]}return C}function $unlink(C){var B;switch($type(C)){case"object":B={};for(var E in C){B[E]=$unlink(C[E])}break;case"hash":B=$unlink(C.getClean());break;case"array":B=[];for(var D=0,A=C.length;D<A;D++){B[D]=$unlink(C[D])}break;default:return C}return B}function $merge(){var E={};for(var D=0,A=arguments.length;D<A;D++){var B=arguments[D];if($type(B)!="object"){continue}for(var C in B){var G=B[C],F=E[C];E[C]=(F&&$type(G)=="object"&&$type(F)=="object")?$merge(F,G):$unlink(G)}}return E}function $pick(){for(var B=0,A=arguments.length;B<A;B++){if(arguments[B]!=undefined){return arguments[B]}}return null}function $random(B,A){return Math.floor(Math.random()*(A-B+1)+B)}function $splat(B){var A=$type(B);return(A)?((A!="array"&&A!="arguments")?[B]:B):[]}var $time=Date.now||function(){return new Date().getTime()};function $try(){for(var B=0,A=arguments.length;B<A;B++){try{return arguments[B]()}catch(C){}}return null}function $type(A){if(A==undefined){return false}if(A.$family){return(A.$family.name=="number"&&!isFinite(A))?false:A.$family.name}if(A.nodeName){switch(A.nodeType){case 1:return"element";case 3:return(/\S/).test(A.nodeValue)?"textnode":"whitespace"}}else{if(typeof A.length=="number"){if(A.callee){return"arguments"}else{if(A.item){return"collection"}}}}return typeof A}var Hash=new Native({name:"Hash",initialize:function(A){if($type(A)=="hash"){A=$unlink(A.getClean())}for(var B in A){this[B]=A[B]}return this}});Hash.implement({getLength:function(){var B=0;for(var A in this){if(this.hasOwnProperty(A)){B++}}return B},forEach:function(B,C){for(var A in this){if(this.hasOwnProperty(A)){B.call(C,this[A],A,this)}}},getClean:function(){var B={};for(var A in this){if(this.hasOwnProperty(A)){B[A]=this[A]}}return B}});Hash.alias("forEach","each");function $H(A){return new Hash(A)}Array.implement({forEach:function(C,D){for(var B=0,A=this.length;B<A;B++){C.call(D,this[B],B,this)}}});Array.alias("forEach","each");function $A(C){if(C.item){var D=[];for(var B=0,A=C.length;B<A;B++){D[B]=C[B]}return D}return Array.prototype.slice.call(C)}function $each(C,B,D){var A=$type(C);((A=="arguments"||A=="collection"||A=="array")?Array:Hash).each(C,B,D)}var Browser=new Hash({Engine:{name:"unknown",version:""},Platform:{name:(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase()},Features:{xpath:!!(document.evaluate),air:!!(window.runtime)},Plugins:{}});if(window.opera){Browser.Engine={name:"presto",version:(document.getElementsByClassName)?950:925}}else{if(window.ActiveXObject){Browser.Engine={name:"trident",version:(window.XMLHttpRequest)?5:4}}else{if(!navigator.taintEnabled){Browser.Engine={name:"webkit",version:(Browser.Features.xpath)?420:419}}else{if(document.getBoxObjectFor!=null){Browser.Engine={name:"gecko",version:(document.getElementsByClassName)?19:18}}}}}Browser.Engine[Browser.Engine.name]=Browser.Engine[Browser.Engine.name+Browser.Engine.version]=true;if(window.orientation!=undefined){Browser.Platform.name="ipod"}Browser.Platform[Browser.Platform.name]=true;Browser.Request=function(){return $try(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("MSXML2.XMLHTTP")})};Browser.Features.xhr=!!(Browser.Request());Browser.Plugins.Flash=(function(){var A=($try(function(){return navigator.plugins["Shockwave Flash"].description},function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")})||"0 r0").match(/\d+/g);return{version:parseInt(A[0]||0+"."+A[1]||0),build:parseInt(A[2]||0)}})();function $exec(B){if(!B){return B}if(window.execScript){window.execScript(B)}else{var A=document.createElement("script");A.setAttribute("type","text/javascript");A.text=B;document.head.appendChild(A);document.head.removeChild(A)}return B}Native.UID=1;var $uid=(Browser.Engine.trident)?function(A){return(A.uid||(A.uid=[Native.UID++]))[0]}:function(A){return A.uid||(A.uid=Native.UID++)};var Window=new Native({name:"Window",legacy:(Browser.Engine.trident)?null:window.Window,initialize:function(A){$uid(A);if(!A.Element){A.Element=$empty;if(Browser.Engine.webkit){A.document.createElement("iframe")}A.Element.prototype=(Browser.Engine.webkit)?window["[[DOMElement.prototype]]"]:{}}return $extend(A,Window.Prototype)},afterImplement:function(B,A){window[B]=Window.Prototype[B]=A}});Window.Prototype={$family:{name:"window"}};new Window(window);var Document=new Native({name:"Document",legacy:(Browser.Engine.trident)?null:window.Document,initialize:function(A){$uid(A);A.head=A.getElementsByTagName("head")[0];A.html=A.getElementsByTagName("html")[0];A.window=A.defaultView||A.parentWindow;if(Browser.Engine.trident4){$try(function(){A.execCommand("BackgroundImageCache",false,true)})}return $extend(A,Document.Prototype)},afterImplement:function(B,A){document[B]=Document.Prototype[B]=A}});Document.Prototype={$family:{name:"document"}};new Document(document);Array.implement({every:function(C,D){for(var B=0,A=this.length;B<A;B++){if(!C.call(D,this[B],B,this)){return false}}return true},filter:function(D,E){var C=[];for(var B=0,A=this.length;B<A;B++){if(D.call(E,this[B],B,this)){C.push(this[B])}}return C},clean:function(){return this.filter($defined)},indexOf:function(C,D){var A=this.length;for(var B=(D<0)?Math.max(0,A+D):D||0;B<A;B++){if(this[B]===C){return B}}return -1},map:function(D,E){var C=[];for(var B=0,A=this.length;B<A;B++){C[B]=D.call(E,this[B],B,this)}return C},some:function(C,D){for(var B=0,A=this.length;B<A;B++){if(C.call(D,this[B],B,this)){return true}}return false},associate:function(C){var D={},B=Math.min(this.length,C.length);for(var A=0;A<B;A++){D[C[A]]=this[A]}return D},link:function(C){var A={};for(var E=0,B=this.length;E<B;E++){for(var D in C){if(C[D](this[E])){A[D]=this[E];delete C[D];break}}}return A},contains:function(A,B){return this.indexOf(A,B)!=-1},extend:function(C){for(var B=0,A=C.length;B<A;B++){this.push(C[B])}return this},getLast:function(){return(this.length)?this[this.length-1]:null},getRandom:function(){return(this.length)?this[$random(0,this.length-1)]:null},include:function(A){if(!this.contains(A)){this.push(A)}return this},combine:function(C){for(var B=0,A=C.length;B<A;B++){this.include(C[B])}return this},erase:function(B){for(var A=this.length;A--;A){if(this[A]===B){this.splice(A,1)}}return this},empty:function(){this.length=0;return this},flatten:function(){var D=[];for(var B=0,A=this.length;B<A;B++){var C=$type(this[B]);if(!C){continue}D=D.concat((C=="array"||C=="collection"||C=="arguments")?Array.flatten(this[B]):this[B])}return D},hexToRgb:function(B){if(this.length!=3){return null}var A=this.map(function(C){if(C.length==1){C+=C}return C.toInt(16)});return(B)?A:"rgb("+A+")"},rgbToHex:function(D){if(this.length<3){return null}if(this.length==4&&this[3]==0&&!D){return"transparent"}var B=[];for(var A=0;A<3;A++){var C=(this[A]-0).toString(16);B.push((C.length==1)?"0"+C:C)}return(D)?B:"#"+B.join("")}});Function.implement({extend:function(A){for(var B in A){this[B]=A[B]}return this},create:function(B){var A=this;B=B||{};return function(D){var C=B.arguments;C=(C!=undefined)?$splat(C):Array.slice(arguments,(B.event)?1:0);if(B.event){C=[D||window.event].extend(C)}var E=function(){return A.apply(B.bind||null,C)};if(B.delay){return setTimeout(E,B.delay)}if(B.periodical){return setInterval(E,B.periodical)}if(B.attempt){return $try(E)}return E()}},pass:function(A,B){return this.create({arguments:A,bind:B})},attempt:function(A,B){return this.create({arguments:A,bind:B,attempt:true})()},bind:function(B,A){return this.create({bind:B,arguments:A})},bindWithEvent:function(B,A){return this.create({bind:B,event:true,arguments:A})},delay:function(B,C,A){return this.create({delay:B,bind:C,arguments:A})()},periodical:function(A,C,B){return this.create({periodical:A,bind:C,arguments:B})()},run:function(A,B){return this.apply(B,$splat(A))}});Number.implement({limit:function(B,A){return Math.min(A,Math.max(B,this))},round:function(A){A=Math.pow(10,A||0);return Math.round(this*A)/A},times:function(B,C){for(var A=0;A<this;A++){B.call(C,A,this)}},toFloat:function(){return parseFloat(this)},toInt:function(A){return parseInt(this,A||10)}});Number.alias("times","each");(function(B){var A={};B.each(function(C){if(!Number[C]){A[C]=function(){return Math[C].apply(null,[this].concat($A(arguments)))}}});Number.implement(A)})(["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","max","min","pow","sin","sqrt","tan"]);String.implement({test:function(A,B){return((typeof A=="string")?new RegExp(A,B):A).test(this)},contains:function(A,B){return(B)?(B+this+B).indexOf(B+A+B)>-1:this.indexOf(A)>-1},trim:function(){return this.replace(/^\s+|\s+$/g,"")},clean:function(){return this.replace(/\s+/g," ").trim()},camelCase:function(){return this.replace(/-\D/g,function(A){return A.charAt(1).toUpperCase()})},hyphenate:function(){return this.replace(/[A-Z]/g,function(A){return("-"+A.charAt(0).toLowerCase())})},capitalize:function(){return this.replace(/\b[a-z]/g,function(A){return A.toUpperCase()})},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")},toInt:function(A){return parseInt(this,A||10)},toFloat:function(){return parseFloat(this)},hexToRgb:function(B){var A=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(A)?A.slice(1).hexToRgb(B):null},rgbToHex:function(B){var A=this.match(/\d{1,3}/g);return(A)?A.rgbToHex(B):null},stripScripts:function(B){var A="";var C=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,function(){A+=arguments[1]+"\n";return""});if(B===true){$exec(A)}else{if($type(B)=="function"){B(A,C)}}return C},substitute:function(A,B){return this.replace(B||(/\\?\{([^}]+)\}/g),function(D,C){if(D.charAt(0)=="\\"){return D.slice(1)}return(A[C]!=undefined)?A[C]:""})}});Hash.implement({has:Object.prototype.hasOwnProperty,keyOf:function(B){for(var A in this){if(this.hasOwnProperty(A)&&this[A]===B){return A}}return null},hasValue:function(A){return(Hash.keyOf(this,A)!==null)},extend:function(A){Hash.each(A,function(C,B){Hash.set(this,B,C)},this);return this},combine:function(A){Hash.each(A,function(C,B){Hash.include(this,B,C)},this);return this},erase:function(A){if(this.hasOwnProperty(A)){delete this[A]}return this},get:function(A){return(this.hasOwnProperty(A))?this[A]:null},set:function(A,B){if(!this[A]||this.hasOwnProperty(A)){this[A]=B}return this},empty:function(){Hash.each(this,function(B,A){delete this[A]},this);return this},include:function(B,C){var A=this[B];if(A==undefined){this[B]=C}return this},map:function(B,C){var A=new Hash;Hash.each(this,function(E,D){A.set(D,B.call(C,E,D,this))},this);return A},filter:function(B,C){var A=new Hash;Hash.each(this,function(E,D){if(B.call(C,E,D,this)){A.set(D,E)}},this);return A},every:function(B,C){for(var A in this){if(this.hasOwnProperty(A)&&!B.call(C,this[A],A)){return false}}return true},some:function(B,C){for(var A in this){if(this.hasOwnProperty(A)&&B.call(C,this[A],A)){return true}}return false},getKeys:function(){var A=[];Hash.each(this,function(C,B){A.push(B)});return A},getValues:function(){var A=[];Hash.each(this,function(B){A.push(B)});return A},toQueryString:function(A){var B=[];Hash.each(this,function(F,E){if(A){E=A+"["+E+"]"}var D;switch($type(F)){case"object":D=Hash.toQueryString(F,E);break;case"array":var C={};F.each(function(H,G){C[G]=H});D=Hash.toQueryString(C,E);break;default:D=E+"="+encodeURIComponent(F)}if(F!=undefined){B.push(D)}});return B.join("&")}});Hash.alias({keyOf:"indexOf",hasValue:"contains"});var Event=new Native({name:"Event",initialize:function(A,F){F=F||window;var K=F.document;A=A||F.event;if(A.$extended){return A}this.$extended=true;var J=A.type;var G=A.target||A.srcElement;while(G&&G.nodeType==3){G=G.parentNode}if(J.test(/key/)){var B=A.which||A.keyCode;var M=Event.Keys.keyOf(B);if(J=="keydown"){var D=B-111;if(D>0&&D<13){M="f"+D}}M=M||String.fromCharCode(B).toLowerCase()}else{if(J.match(/(click|mouse|menu)/i)){K=(!K.compatMode||K.compatMode=="CSS1Compat")?K.html:K.body;var I={x:A.pageX||A.clientX+K.scrollLeft,y:A.pageY||A.clientY+K.scrollTop};var C={x:(A.pageX)?A.pageX-F.pageXOffset:A.clientX,y:(A.pageY)?A.pageY-F.pageYOffset:A.clientY};if(J.match(/DOMMouseScroll|mousewheel/)){var H=(A.wheelDelta)?A.wheelDelta/120:-(A.detail||0)/3}var E=(A.which==3)||(A.button==2);var L=null;if(J.match(/over|out/)){switch(J){case"mouseover":L=A.relatedTarget||A.fromElement;break;case"mouseout":L=A.relatedTarget||A.toElement}if(!(function(){while(L&&L.nodeType==3){L=L.parentNode}return true}).create({attempt:Browser.Engine.gecko})()){L=false}}}}return $extend(this,{event:A,type:J,page:I,client:C,rightClick:E,wheel:H,relatedTarget:L,target:G,code:B,key:M,shift:A.shiftKey,control:A.ctrlKey,alt:A.altKey,meta:A.metaKey})}});Event.Keys=new Hash({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});Event.implement({stop:function(){return this.stopPropagation().preventDefault()},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation()}else{this.event.cancelBubble=true}return this},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault()}else{this.event.returnValue=false}return this}});var Class=new Native({name:"Class",initialize:function(B){B=B||{};var A=function(E){for(var D in this){this[D]=$unlink(this[D])}for(var F in Class.Mutators){if(!this[F]){continue}Class.Mutators[F](this,this[F]);delete this[F]}this.constructor=A;if(E===$empty){return this}var C=(this.initialize)?this.initialize.apply(this,arguments):this;if(this.options&&this.options.initialize){this.options.initialize.call(this)}return C};$extend(A,this);A.constructor=Class;A.prototype=B;return A}});Class.implement({implement:function(){Class.Mutators.Implements(this.prototype,Array.slice(arguments));return this}});Class.Mutators={Implements:function(A,B){$splat(B).each(function(C){$extend(A,($type(C)=="class")?new C($empty):C)})},Extends:function(self,klass){var instance=new klass($empty);delete instance.parent;delete instance.parentOf;for(var key in instance){var current=self[key],previous=instance[key];if(current==undefined){self[key]=previous;continue}var ctype=$type(current),ptype=$type(previous);if(ctype!=ptype){continue}switch(ctype){case"function":if(!arguments.callee.caller){self[key]=eval("("+String(current).replace(/\bthis\.parent\(\s*(\))?/g,function(full,close){return"arguments.callee._parent_.call(this"+(close||", ")})+")")}self[key]._parent_=previous;break;case"object":self[key]=$merge(previous,current)}}self.parent=function(){return arguments.callee.caller._parent_.apply(this,arguments)};self.parentOf=function(descendant){return descendant._parent_.apply(this,Array.slice(arguments,1))}}};var Chain=new Class({chain:function(){this.$chain=(this.$chain||[]).extend(arguments);return this},callChain:function(){return(this.$chain&&this.$chain.length)?this.$chain.shift().apply(this,arguments):false},clearChain:function(){if(this.$chain){this.$chain.empty()}return this}});var Events=new Class({addEvent:function(C,B,A){C=Events.removeOn(C);if(B!=$empty){this.$events=this.$events||{};this.$events[C]=this.$events[C]||[];this.$events[C].include(B);if(A){B.internal=true}}return this},addEvents:function(A){for(var B in A){this.addEvent(B,A[B])}return this},fireEvent:function(C,B,A){C=Events.removeOn(C);if(!this.$events||!this.$events[C]){return this}this.$events[C].each(function(D){D.create({bind:this,delay:A,"arguments":B})()},this);return this},removeEvent:function(B,A){B=Events.removeOn(B);if(!this.$events||!this.$events[B]){return this}if(!A.internal){this.$events[B].erase(A)}return this},removeEvents:function(C){for(var D in this.$events){if(C&&C!=D){continue}var B=this.$events[D];for(var A=B.length;A--;A){this.removeEvent(D,B[A])}}return this}});Events.removeOn=function(A){return A.replace(/^on([A-Z])/,function(B,C){return C.toLowerCase()})};var Options=new Class({setOptions:function(){this.options=$merge.run([this.options].extend(arguments));if(!this.addEvent){return this}for(var A in this.options){if($type(this.options[A])!="function"||!(/^on[A-Z]/).test(A)){continue}this.addEvent(A,this.options[A]);delete this.options[A]}return this}});Document.implement({newElement:function(A,B){if(Browser.Engine.trident&&B){["name","type","checked"].each(function(C){if(!B[C]){return }A+=" "+C+'="'+B[C]+'"';if(C!="checked"){delete B[C]}});A="<"+A+">"}return $.element(this.createElement(A)).set(B)},newTextNode:function(A){return this.createTextNode(A)},getDocument:function(){return this},getWindow:function(){return this.defaultView||this.parentWindow},purge:function(){var C=this.getElementsByTagName("*");for(var B=0,A=C.length;B<A;B++){Browser.freeMem(C[B])}}});var Element=new Native({name:"Element",legacy:window.Element,initialize:function(A,B){var C=Element.Constructors.get(A);if(C){return C(B)}if(typeof A=="string"){return document.newElement(A,B)}return $(A).set(B)},afterImplement:function(A,B){if(!Array[A]){Elements.implement(A,Elements.multi(A))}Element.Prototype[A]=B}});Element.Prototype={$family:{name:"element"}};Element.Constructors=new Hash;var IFrame=new Native({name:"IFrame",generics:false,initialize:function(){var E=Array.link(arguments,{properties:Object.type,iframe:$defined});var C=E.properties||{};var B=$(E.iframe)||false;var D=C.onload||$empty;delete C.onload;C.id=C.name=$pick(C.id,C.name,B.id,B.name,"IFrame_"+$time());B=new Element(B||"iframe",C);var A=function(){var F=$try(function(){return B.contentWindow.location.host});if(F&&F==window.location.host){var H=new Window(B.contentWindow);var G=new Document(B.contentWindow.document);$extend(H.Element.prototype,Element.Prototype)}D.call(B.contentWindow,B.contentWindow.document)};(!window.frames[C.id])?B.addListener("load",A):A();return B}});var Elements=new Native({initialize:function(F,B){B=$extend({ddup:true,cash:true},B);F=F||[];if(B.ddup||B.cash){var G={},E=[];for(var C=0,A=F.length;C<A;C++){var D=$.element(F[C],!B.cash);if(B.ddup){if(G[D.uid]){continue}G[D.uid]=true}E.push(D)}F=E}return(B.cash)?$extend(F,this):F}});Elements.implement({filter:function(A,B){if(!A){return this}return new Elements(Array.filter(this,(typeof A=="string")?function(C){return C.match(A)}:A,B))}});Elements.multi=function(A){return function(){var B=[];var F=true;for(var D=0,C=this.length;D<C;D++){var E=this[D][A].apply(this[D],arguments);B.push(E);if(F){F=($type(E)=="element")}}return(F)?new Elements(B):B}};Window.implement({$:function(B,C){if(B&&B.$family&&B.uid){return B}var A=$type(B);return($[A])?$[A](B,C,this.document):null},$$:function(A){if(arguments.length==1&&typeof A=="string"){return this.document.getElements(A)}var F=[];var C=Array.flatten(arguments);for(var D=0,B=C.length;D<B;D++){var E=C[D];switch($type(E)){case"element":E=[E];break;case"string":E=this.document.getElements(E,true);break;default:E=false}if(E){F.extend(E)}}return new Elements(F)},getDocument:function(){return this.document},getWindow:function(){return this}});$.string=function(C,B,A){C=A.getElementById(C);return(C)?$.element(C,B):null};$.element=function(A,D){$uid(A);if(!D&&!A.$family&&!(/^object|embed$/i).test(A.tagName)){var B=Element.Prototype;for(var C in B){A[C]=B[C]}}return A};$.object=function(B,C,A){if(B.toElement){return $.element(B.toElement(A),C)}return null};$.textnode=$.whitespace=$.window=$.document=$arguments(0);Native.implement([Element,Document],{getElement:function(A,B){return $(this.getElements(A,true)[0]||null,B)},getElements:function(A,D){A=A.split(",");var C=[];var B=(A.length>1);A.each(function(E){var F=this.getElementsByTagName(E.trim());(B)?C.extend(F):C=F},this);return new Elements(C,{ddup:B,cash:!D})}});Element.Storage={get:function(A){return(this[A]||(this[A]={}))}};Element.Inserters=new Hash({before:function(B,A){if(A.parentNode){A.parentNode.insertBefore(B,A)}},after:function(B,A){if(!A.parentNode){return }var C=A.nextSibling;(C)?A.parentNode.insertBefore(B,C):A.parentNode.appendChild(B)},bottom:function(B,A){A.appendChild(B)},top:function(B,A){var C=A.firstChild;(C)?A.insertBefore(B,C):A.appendChild(B)}});Element.Inserters.inside=Element.Inserters.bottom;Element.Inserters.each(function(C,B){var A=B.capitalize();Element.implement("inject"+A,function(D){C(this,$(D,true));return this});Element.implement("grab"+A,function(D){C($(D,true),this);return this})});Element.implement({getDocument:function(){return this.ownerDocument},getWindow:function(){return this.ownerDocument.getWindow()},getElementById:function(D,C){var B=this.ownerDocument.getElementById(D);if(!B){return null}for(var A=B.parentNode;A!=this;A=A.parentNode){if(!A){return null}}return $.element(B,C)},set:function(D,B){switch($type(D)){case"object":for(var C in D){this.set(C,D[C])}break;case"string":var A=Element.Properties.get(D);(A&&A.set)?A.set.apply(this,Array.slice(arguments,1)):this.setProperty(D,B)}return this},get:function(B){var A=Element.Properties.get(B);return(A&&A.get)?A.get.apply(this,Array.slice(arguments,1)):this.getProperty(B)},erase:function(B){var A=Element.Properties.get(B);(A&&A.erase)?A.erase.apply(this,Array.slice(arguments,1)):this.removeProperty(B);return this},match:function(A){return(!A||Element.get(this,"tag")==A)},inject:function(B,A){Element.Inserters.get(A||"bottom")(this,$(B,true));return this},wraps:function(B,A){B=$(B,true);return this.replaces(B).grab(B,A)},grab:function(B,A){Element.Inserters.get(A||"bottom")($(B,true),this);return this},appendText:function(B,A){return this.grab(this.getDocument().newTextNode(B),A)},adopt:function(){Array.flatten(arguments).each(function(A){A=$(A,true);if(A){this.appendChild(A)}},this);return this},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this},clone:function(E,A){E=E!==false;var D={input:"checked",option:"selected",textarea:(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerHTML":"value"};var H=this.cloneNode(E);var C=function(L,K){if(!A){L.removeAttribute("id")}if(Browser.Engine.trident){L.clearAttributes();L.mergeAttributes(K);L.removeAttribute("uid");if(L.options){var M=L.options,I=K.options;for(var J=M.length;J--;){M[J].selected=I[J].selected}}}var N=D[K.tagName.toLowerCase()];if(N&&K[N]){L[N]=K[N]}};if(E){var F=H.getElementsByTagName("*"),G=this.getElementsByTagName("*");for(var B=F.length;B--;){C(F[B],G[B])}}C(H,this);return $(H)},replaces:function(A){A=$(A,true);A.parentNode.replaceChild(this,A);return this},hasClass:function(A){return this.className.contains(A," ")},addClass:function(A){if(!this.hasClass(A)){this.className=(this.className+" "+A).clean()}return this},removeClass:function(A){this.className=this.className.replace(new RegExp("(^|\\s)"+A+"(?:\\s|$)"),"$1").clean();return this},toggleClass:function(A){return this.hasClass(A)?this.removeClass(A):this.addClass(A)},getComputedStyle:function(B){if(this.currentStyle){return this.currentStyle[B.camelCase()]}var A=this.getWindow().getComputedStyle(this,null);return(A)?A.getPropertyValue([B.hyphenate()]):null},empty:function(){$A(this.childNodes).each(function(A){Browser.freeMem(A);Element.empty(A);Element.dispose(A)},this);return this},destroy:function(){Browser.freeMem(this.empty().dispose());return null},getSelected:function(){return new Elements($A(this.options).filter(function(A){return A.selected}))},toQueryString:function(){var A=[];this.getElements("input, select, textarea").each(function(B){if(!B.name||B.disabled){return }var C=(B.tagName.toLowerCase()=="select")?Element.getSelected(B).map(function(D){return D.value}):((B.type=="radio"||B.type=="checkbox")&&!B.checked)?null:B.value;$splat(C).each(function(D){if(D){A.push(B.name+"="+encodeURIComponent(D))}})});return A.join("&")},getProperty:function(C){var B=Element.Attributes,A=B.Props[C];var D=(A)?this[A]:this.getAttribute(C,2);return(B.Bools[C])?!!D:(A)?D:D||null},getProperties:function(){var A=$A(arguments);return A.map(function(B){return this.getProperty(B)},this).associate(A)},setProperty:function(D,E){var C=Element.Attributes,B=C.Props[D],A=$defined(E);if(B&&C.Bools[D]){E=(E||!A)?true:false}else{if(!A){return this.removeProperty(D)}}(B)?this[B]=E:this.setAttribute(D,E);return this},setProperties:function(A){for(var B in A){this.setProperty(B,A[B])}return this},removeProperty:function(D){var C=Element.Attributes,B=C.Props[D],A=(B&&C.Bools[D]);(B)?this[B]=(A)?false:"":this.removeAttribute(D);return this},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this}});(function(){var A=function(D,B,I,C,F,H){var E=D[I||B];var G=[];while(E){if(E.nodeType==1&&(!C||Element.match(E,C))){G.push(E);if(!F){break}}E=E[B]}return(F)?new Elements(G,{ddup:false,cash:!H}):$(G[0],H)};Element.implement({getPrevious:function(B,C){return A(this,"previousSibling",null,B,false,C)},getAllPrevious:function(B,C){return A(this,"previousSibling",null,B,true,C)},getNext:function(B,C){return A(this,"nextSibling",null,B,false,C)},getAllNext:function(B,C){return A(this,"nextSibling",null,B,true,C)},getFirst:function(B,C){return A(this,"nextSibling","firstChild",B,false,C)},getLast:function(B,C){return A(this,"previousSibling","lastChild",B,false,C)},getParent:function(B,C){return A(this,"parentNode",null,B,false,C)},getParents:function(B,C){return A(this,"parentNode",null,B,true,C)},getChildren:function(B,C){return A(this,"nextSibling","firstChild",B,true,C)},hasChild:function(B){B=$(B,true);return(!!B&&$A(this.getElementsByTagName(B.tagName)).contains(B))}})})();Element.Properties=new Hash;Element.Properties.style={set:function(A){this.style.cssText=A},get:function(){return this.style.cssText},erase:function(){this.style.cssText=""}};Element.Properties.tag={get:function(){return this.tagName.toLowerCase()}};Element.Properties.href={get:function(){return(!this.href)?null:this.href.replace(new RegExp("^"+document.location.protocol+"//"+document.location.host),"")}};Element.Properties.html={set:function(){return this.innerHTML=Array.flatten(arguments).join("")}};Native.implement([Element,Window,Document],{addListener:function(B,A){if(this.addEventListener){this.addEventListener(B,A,false)}else{this.attachEvent("on"+B,A)}return this},removeListener:function(B,A){if(this.removeEventListener){this.removeEventListener(B,A,false)}else{this.detachEvent("on"+B,A)}return this},retrieve:function(B,A){var D=Element.Storage.get(this.uid);var C=D[B];if($defined(A)&&!$defined(C)){C=D[B]=A}return $pick(C)},store:function(B,A){var C=Element.Storage.get(this.uid);C[B]=A;return this},eliminate:function(A){var B=Element.Storage.get(this.uid);delete B[A];return this}});Element.Attributes=new Hash({Props:{html:"innerHTML","class":"className","for":"htmlFor",text:(Browser.Engine.trident)?"innerText":"textContent"},Bools:["compact","nowrap","ismap","declare","noshade","checked","disabled","readonly","multiple","selected","noresize","defer"],Camels:["value","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"]});Browser.freeMem=function(A){if(!A){return }if(Browser.Engine.trident&&(/object/i).test(A.tagName)){for(var B in A){if(typeof A[B]=="function"){A[B]=$empty}}Element.dispose(A)}if(A.uid&&A.removeEvents){A.removeEvents()}};(function(B){var C=B.Bools,A=B.Camels;B.Bools=C=C.associate(C);Hash.extend(Hash.combine(B.Props,C),A.associate(A.map(function(D){return D.toLowerCase()})));B.erase("Camels")})(Element.Attributes);window.addListener("unload",function(){window.removeListener("unload",arguments.callee);document.purge();if(Browser.Engine.trident){CollectGarbage()}});Element.Properties.events={set:function(A){this.addEvents(A)}};Native.implement([Element,Window,Document],{addEvent:function(E,G){var H=this.retrieve("events",{});H[E]=H[E]||{keys:[],values:[]};if(H[E].keys.contains(G)){return this}H[E].keys.push(G);var F=E,A=Element.Events.get(E),C=G,I=this;if(A){if(A.onAdd){A.onAdd.call(this,G)}if(A.condition){C=function(J){if(A.condition.call(this,J)){return G.call(this,J)}return false}}F=A.base||F}var D=function(){return G.call(I)};var B=Element.NativeEvents[F]||0;if(B){if(B==2){D=function(J){J=new Event(J,I.getWindow());if(C.call(I,J)===false){J.stop()}}}this.addListener(F,D)}H[E].values.push(D);return this},removeEvent:function(D,C){var B=this.retrieve("events");if(!B||!B[D]){return this}var G=B[D].keys.indexOf(C);if(G==-1){return this}var A=B[D].keys.splice(G,1)[0];var F=B[D].values.splice(G,1)[0];var E=Element.Events.get(D);if(E){if(E.onRemove){E.onRemove.call(this,C)}D=E.base||D}return(Element.NativeEvents[D])?this.removeListener(D,F):this},addEvents:function(A){for(var B in A){this.addEvent(B,A[B])}return this},removeEvents:function(B){var A=this.retrieve("events");if(!A){return this}if(!B){for(var C in A){this.removeEvents(C)}A=null}else{if(A[B]){while(A[B].keys[0]){this.removeEvent(B,A[B].keys[0])}A[B]=null}}return this},fireEvent:function(D,B,A){var C=this.retrieve("events");if(!C||!C[D]){return this}C[D].keys.each(function(E){E.create({bind:this,delay:A,"arguments":B})()},this);return this},cloneEvents:function(D,A){D=$(D);var C=D.retrieve("events");if(!C){return this}if(!A){for(var B in C){this.cloneEvents(D,B)}}else{if(C[A]){C[A].keys.each(function(E){this.addEvent(A,E)},this)}}return this}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:1,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1};(function(){var A=function(B){var C=B.relatedTarget;if(C==undefined){return true}if(C===false){return false}return($type(this)!="document"&&C!=this&&C.prefix!="xul"&&!this.hasChild(C))};Element.Events=new Hash({mouseenter:{base:"mouseover",condition:A},mouseleave:{base:"mouseout",condition:A},mousewheel:{base:(Browser.Engine.gecko)?"DOMMouseScroll":"mousewheel"}})})();Element.Properties.styles={set:function(A){this.setStyles(A)}};Element.Properties.opacity={set:function(A,B){if(!B){if(A==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden"}}else{if(this.style.visibility!="visible"){this.style.visibility="visible"}}}if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1}if(Browser.Engine.trident){this.style.filter=(A==1)?"":"alpha(opacity="+A*100+")"}this.style.opacity=A;this.store("opacity",A)},get:function(){return this.retrieve("opacity",1)}};Element.implement({setOpacity:function(A){return this.set("opacity",A,true)},getOpacity:function(){return this.get("opacity")},setStyle:function(B,A){switch(B){case"opacity":return this.set("opacity",parseFloat(A));case"float":B=(Browser.Engine.trident)?"styleFloat":"cssFloat"}B=B.camelCase();if($type(A)!="string"){var C=(Element.Styles.get(B)||"@").split(" ");A=$splat(A).map(function(E,D){if(!C[D]){return""}return($type(E)=="number")?C[D].replace("@",Math.round(E)):E}).join(" ")}else{if(A==String(Number(A))){A=Math.round(A)}}this.style[B]=A;return this},getStyle:function(G){switch(G){case"opacity":return this.get("opacity");case"float":G=(Browser.Engine.trident)?"styleFloat":"cssFloat"}G=G.camelCase();var A=this.style[G];if(!$chk(A)){A=[];for(var F in Element.ShortStyles){if(G!=F){continue}for(var E in Element.ShortStyles[F]){A.push(this.getStyle(E))}return A.join(" ")}A=this.getComputedStyle(G)}if(A){A=String(A);var C=A.match(/rgba?\([\d\s,]+\)/);if(C){A=A.replace(C[0],C[0].rgbToHex())}}if(Browser.Engine.presto||(Browser.Engine.trident&&!$chk(parseInt(A)))){if(G.test(/^(height|width)$/)){var B=(G=="width")?["left","right"]:["top","bottom"],D=0;B.each(function(H){D+=this.getStyle("border-"+H+"-width").toInt()+this.getStyle("padding-"+H).toInt()},this);return this["offset"+G.capitalize()]-D+"px"}if(Browser.Engine.presto&&String(A).test("px")){return A}if(G.test(/(border(.+)Width|margin|padding)/)){return"0px"}}return A},setStyles:function(B){for(var A in B){this.setStyle(A,B[A])}return this},getStyles:function(){var A={};Array.each(arguments,function(B){A[B]=this.getStyle(B)},this);return A}});Element.Styles=new Hash({left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"});Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(G){var F=Element.ShortStyles;var B=Element.Styles;["margin","padding"].each(function(H){var I=H+G;F[H][I]=B[I]="@px"});var E="border"+G;F.border[E]=B[E]="@px @ rgb(@, @, @)";var D=E+"Width",A=E+"Style",C=E+"Color";F[E]={};F.borderWidth[D]=F[E][D]=B[D]="@px";F.borderStyle[A]=F[E][A]=B[A]="@";F.borderColor[C]=F[E][C]=B[C]="rgb(@, @, @)"});(function(){Element.implement({scrollTo:function(H,I){if(B(this)){this.getWindow().scrollTo(H,I)}else{this.scrollLeft=H;this.scrollTop=I}return this},getSize:function(){if(B(this)){return this.getWindow().getSize()}return{x:this.offsetWidth,y:this.offsetHeight}},getScrollSize:function(){if(B(this)){return this.getWindow().getScrollSize()}return{x:this.scrollWidth,y:this.scrollHeight}},getScroll:function(){if(B(this)){return this.getWindow().getScroll()}return{x:this.scrollLeft,y:this.scrollTop}},getScrolls:function(){var I=this,H={x:0,y:0};while(I&&!B(I)){H.x+=I.scrollLeft;H.y+=I.scrollTop;I=I.parentNode}return H},getOffsetParent:function(){var H=this;if(B(H)){return null}if(!Browser.Engine.trident){return H.offsetParent}while((H=H.parentNode)&&!B(H)){if(D(H,"position")!="static"){return H}}return null},getOffsets:function(){if(Browser.Engine.trident){var L=this.getBoundingClientRect(),J=this.getDocument().documentElement;return{x:L.left+J.scrollLeft-J.clientLeft,y:L.top+J.scrollTop-J.clientTop}}var I=this,H={x:0,y:0};if(B(this)){return H}while(I&&!B(I)){H.x+=I.offsetLeft;H.y+=I.offsetTop;if(Browser.Engine.gecko){if(!F(I)){H.x+=C(I);H.y+=G(I)}var K=I.parentNode;if(K&&D(K,"overflow")!="visible"){H.x+=C(K);H.y+=G(K)}}else{if(I!=this&&Browser.Engine.webkit){H.x+=C(I);H.y+=G(I)}}I=I.offsetParent}if(Browser.Engine.gecko&&!F(this)){H.x-=C(this);H.y-=G(this)}return H},getPosition:function(K){if(B(this)){return{x:0,y:0}}var L=this.getOffsets(),I=this.getScrolls();var H={x:L.x-I.x,y:L.y-I.y};var J=(K&&(K=$(K)))?K.getPosition():{x:0,y:0};return{x:H.x-J.x,y:H.y-J.y}},getCoordinates:function(J){if(B(this)){return this.getWindow().getCoordinates()}var H=this.getPosition(J),I=this.getSize();var K={left:H.x,top:H.y,width:I.x,height:I.y};K.right=K.left+K.width;K.bottom=K.top+K.height;return K},computePosition:function(H){return{left:H.x-E(this,"margin-left"),top:H.y-E(this,"margin-top")}},position:function(H){return this.setStyles(this.computePosition(H))}});Native.implement([Document,Window],{getSize:function(){var I=this.getWindow();if(Browser.Engine.presto||Browser.Engine.webkit){return{x:I.innerWidth,y:I.innerHeight}}var H=A(this);return{x:H.clientWidth,y:H.clientHeight}},getScroll:function(){var I=this.getWindow();var H=A(this);return{x:I.pageXOffset||H.scrollLeft,y:I.pageYOffset||H.scrollTop}},getScrollSize:function(){var I=A(this);var H=this.getSize();return{x:Math.max(I.scrollWidth,H.x),y:Math.max(I.scrollHeight,H.y)}},getPosition:function(){return{x:0,y:0}},getCoordinates:function(){var H=this.getSize();return{top:0,left:0,bottom:H.y,right:H.x,height:H.y,width:H.x}}});var D=Element.getComputedStyle;function E(H,I){return D(H,I).toInt()||0}function F(H){return D(H,"-moz-box-sizing")=="border-box"}function G(H){return E(H,"border-top-width")}function C(H){return E(H,"border-left-width")}function B(H){return(/^(?:body|html)$/i).test(H.tagName)}function A(H){var I=H.getDocument();return(!I.compatMode||I.compatMode=="CSS1Compat")?I.html:I.body}})();Native.implement([Window,Document,Element],{getHeight:function(){return this.getSize().y},getWidth:function(){return this.getSize().x},getScrollTop:function(){return this.getScroll().y},getScrollLeft:function(){return this.getScroll().x},getScrollHeight:function(){return this.getScrollSize().y},getScrollWidth:function(){return this.getScrollSize().x},getTop:function(){return this.getPosition().y},getLeft:function(){return this.getPosition().x}});Native.implement([Document,Element],{getElements:function(H,G){H=H.split(",");var C,E={};for(var D=0,B=H.length;D<B;D++){var A=H[D],F=Selectors.Utils.search(this,A,E);if(D!=0&&F.item){F=$A(F)}C=(D==0)?F:(C.item)?$A(C).concat(F):C.concat(F)}return new Elements(C,{ddup:(H.length>1),cash:!G})}});Element.implement({match:function(B){if(!B){return true}var D=Selectors.Utils.parseTagAndID(B);var A=D[0],E=D[1];if(!Selectors.Filters.byID(this,E)||!Selectors.Filters.byTag(this,A)){return false}var C=Selectors.Utils.parseSelector(B);return(C)?Selectors.Utils.filter(this,C,{}):true}});var Selectors={Cache:{nth:{},parsed:{}}};Selectors.RegExps={id:(/#([\w-]+)/),tag:(/^(\w+|\*)/),quick:(/^(\w+|\*)$/),splitter:(/\s*([+>~\s])\s*([a-zA-Z#.*:\[])/g),combined:(/\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)["']?(.*?)["']?)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g)};Selectors.Utils={chk:function(B,C){if(!C){return true}var A=$uid(B);if(!C[A]){return C[A]=true}return false},parseNthArgument:function(F){if(Selectors.Cache.nth[F]){return Selectors.Cache.nth[F]}var C=F.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/);if(!C){return false}var E=parseInt(C[1]);var B=(E||E===0)?E:1;var D=C[2]||false;var A=parseInt(C[3])||0;if(B!=0){A--;while(A<1){A+=B}while(A>=B){A-=B}}else{B=A;D="index"}switch(D){case"n":C={a:B,b:A,special:"n"};break;case"odd":C={a:2,b:0,special:"n"};break;case"even":C={a:2,b:1,special:"n"};break;case"first":C={a:0,special:"index"};break;case"last":C={special:"last-child"};break;case"only":C={special:"only-child"};break;default:C={a:(B-1),special:"index"}}return Selectors.Cache.nth[F]=C},parseSelector:function(E){if(Selectors.Cache.parsed[E]){return Selectors.Cache.parsed[E]}var D,H={classes:[],pseudos:[],attributes:[]};while((D=Selectors.RegExps.combined.exec(E))){var I=D[1],G=D[2],F=D[3],B=D[4],C=D[5],J=D[6];if(I){H.classes.push(I)}else{if(C){var A=Selectors.Pseudo.get(C);if(A){H.pseudos.push({parser:A,argument:J})}else{H.attributes.push({name:C,operator:"=",value:J})}}else{if(G){H.attributes.push({name:G,operator:F,value:B})}}}}if(!H.classes.length){delete H.classes}if(!H.attributes.length){delete H.attributes}if(!H.pseudos.length){delete H.pseudos}if(!H.classes&&!H.attributes&&!H.pseudos){H=null}return Selectors.Cache.parsed[E]=H},parseTagAndID:function(B){var A=B.match(Selectors.RegExps.tag);var C=B.match(Selectors.RegExps.id);return[(A)?A[1]:"*",(C)?C[1]:false]},filter:function(F,C,E){var D;if(C.classes){for(D=C.classes.length;D--;D){var G=C.classes[D];if(!Selectors.Filters.byClass(F,G)){return false}}}if(C.attributes){for(D=C.attributes.length;D--;D){var B=C.attributes[D];if(!Selectors.Filters.byAttribute(F,B.name,B.operator,B.value)){return false}}}if(C.pseudos){for(D=C.pseudos.length;D--;D){var A=C.pseudos[D];if(!Selectors.Filters.byPseudo(F,A.parser,A.argument,E)){return false}}}return true},getByTagAndID:function(B,A,D){if(D){var C=(B.getElementById)?B.getElementById(D,true):Element.getElementById(B,D,true);return(C&&Selectors.Filters.byTag(C,A))?[C]:[]}else{return B.getElementsByTagName(A)}},search:function(J,I,O){var B=[];var C=I.trim().replace(Selectors.RegExps.splitter,function(Z,Y,X){B.push(Y);return":)"+X}).split(":)");var K,F,E,V;for(var U=0,Q=C.length;U<Q;U++){var T=C[U];if(U==0&&Selectors.RegExps.quick.test(T)){K=J.getElementsByTagName(T);continue}var A=B[U-1];var L=Selectors.Utils.parseTagAndID(T);var W=L[0],M=L[1];if(U==0){K=Selectors.Utils.getByTagAndID(J,W,M)}else{var D={},H=[];for(var S=0,R=K.length;S<R;S++){H=Selectors.Getters[A](H,K[S],W,M,D)}K=H}var G=Selectors.Utils.parseSelector(T);if(G){E=[];for(var P=0,N=K.length;P<N;P++){V=K[P];if(Selectors.Utils.filter(V,G,O)){E.push(V)}}K=E}}return K}};Selectors.Getters={" ":function(H,G,I,A,E){var D=Selectors.Utils.getByTagAndID(G,I,A);for(var C=0,B=D.length;C<B;C++){var F=D[C];if(Selectors.Utils.chk(F,E)){H.push(F)}}return H},">":function(H,G,I,A,F){var C=Selectors.Utils.getByTagAndID(G,I,A);for(var E=0,D=C.length;E<D;E++){var B=C[E];if(B.parentNode==G&&Selectors.Utils.chk(B,F)){H.push(B)}}return H},"+":function(C,B,A,E,D){while((B=B.nextSibling)){if(B.nodeType==1){if(Selectors.Utils.chk(B,D)&&Selectors.Filters.byTag(B,A)&&Selectors.Filters.byID(B,E)){C.push(B)}break}}return C},"~":function(C,B,A,E,D){while((B=B.nextSibling)){if(B.nodeType==1){if(!Selectors.Utils.chk(B,D)){break}if(Selectors.Filters.byTag(B,A)&&Selectors.Filters.byID(B,E)){C.push(B)}}}return C}};Selectors.Filters={byTag:function(B,A){return(A=="*"||(B.tagName&&B.tagName.toLowerCase()==A))},byID:function(A,B){return(!B||(A.id&&A.id==B))},byClass:function(B,A){return(B.className&&B.className.contains(A," "))},byPseudo:function(A,D,C,B){return D.call(A,C,B)},byAttribute:function(C,D,B,E){var A=Element.prototype.getProperty.call(C,D);if(!A){return false}if(!B||E==undefined){return true}switch(B){case"=":return(A==E);case"*=":return(A.contains(E));case"^=":return(A.substr(0,E.length)==E);case"$=":return(A.substr(A.length-E.length)==E);case"!=":return(A!=E);case"~=":return A.contains(E," ");case"|=":return A.contains(E,"-")}return false}};Selectors.Pseudo=new Hash({empty:function(){return !(this.innerText||this.textContent||"").length},not:function(A){return !Element.match(this,A)},contains:function(A){return(this.innerText||this.textContent||"").contains(A)},"first-child":function(){return Selectors.Pseudo.index.call(this,0)},"last-child":function(){var A=this;while((A=A.nextSibling)){if(A.nodeType==1){return false}}return true},"only-child":function(){var B=this;while((B=B.previousSibling)){if(B.nodeType==1){return false}}var A=this;while((A=A.nextSibling)){if(A.nodeType==1){return false}}return true},"nth-child":function(G,E){G=(G==undefined)?"n":G;var C=Selectors.Utils.parseNthArgument(G);if(C.special!="n"){return Selectors.Pseudo[C.special].call(this,C.a,E)}var F=0;E.positions=E.positions||{};var D=$uid(this);if(!E.positions[D]){var B=this;while((B=B.previousSibling)){if(B.nodeType!=1){continue}F++;var A=E.positions[$uid(B)];if(A!=undefined){F=A+F;break}}E.positions[D]=F}return(E.positions[D]%C.a==C.b)},index:function(A){var B=this,C=0;while((B=B.previousSibling)){if(B.nodeType==1&&++C>A){return false}}return(C==A)},even:function(B,A){return Selectors.Pseudo["nth-child"].call(this,"2n+1",A)},odd:function(B,A){return Selectors.Pseudo["nth-child"].call(this,"2n",A)}});Element.Events.domready={onAdd:function(A){if(Browser.loaded){A.call(this)}}};(function(){var B=function(){if(Browser.loaded){return }Browser.loaded=true;window.fireEvent("domready");document.fireEvent("domready")};switch(Browser.Engine.name){case"webkit":(function(){(["loaded","complete"].contains(document.readyState))?B():arguments.callee.delay(50)})();break;case"trident":var A=document.createElement("div");(function(){($try(function(){A.doScroll("left");return $(A).inject(document.body).set("html","temp").dispose()}))?B():arguments.callee.delay(50)})();break;default:window.addEvent("load",B);document.addEvent("DOMContentLoaded",B)}})();var JSON=new Hash({encode:function(B){switch($type(B)){case"string":return'"'+B.replace(/[\x00-\x1f\\"]/g,JSON.$replaceChars)+'"';case"array":return"["+String(B.map(JSON.encode).filter($defined))+"]";case"object":case"hash":var A=[];Hash.each(B,function(E,D){var C=JSON.encode(E);if(C){A.push(JSON.encode(D)+":"+C)}});return"{"+A+"}";case"number":case"boolean":return String(B);case false:return"null"}return null},$specialChars:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},$replaceChars:function(A){return JSON.$specialChars[A]||"\\u00"+Math.floor(A.charCodeAt()/16).toString(16)+(A.charCodeAt()%16).toString(16)},decode:function(string,secure){if($type(string)!="string"||!string.length){return null}if(secure&&!(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){return null}return eval("("+string+")")}});Native.implement([Hash,Array,String,Number],{toJSON:function(){return JSON.encode(this)}});var Cookie=new Class({Implements:Options,options:{path:false,domain:false,duration:false,secure:false,document:document},initialize:function(B,A){this.key=B;this.setOptions(A)},write:function(B){B=encodeURIComponent(B);if(this.options.domain){B+="; domain="+this.options.domain}if(this.options.path){B+="; path="+this.options.path}if(this.options.duration){var A=new Date();A.setTime(A.getTime()+this.options.duration*24*60*60*1000);B+="; expires="+A.toGMTString()}if(this.options.secure){B+="; secure"}this.options.document.cookie=this.key+"="+B;return this},read:function(){var A=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)");return(A)?decodeURIComponent(A[1]):null},dispose:function(){new Cookie(this.key,$merge(this.options,{duration:-1})).write("");return this}});Cookie.write=function(B,C,A){return new Cookie(B,A).write(C)};Cookie.read=function(A){return new Cookie(A).read()};Cookie.dispose=function(B,A){return new Cookie(B,A).dispose()};var Swiff=new Class({Implements:[Options],options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowScriptAccess:"always",wMode:"transparent",swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object},initialize:function(L,M){this.instance="Swiff_"+$time();this.setOptions(M);M=this.options;var B=this.id=M.id||this.instance;var A=$(M.container);Swiff.CallBacks[this.instance]={};var E=M.params,G=M.vars,F=M.callBacks;var H=$extend({height:M.height,width:M.width},M.properties);var K=this;for(var D in F){Swiff.CallBacks[this.instance][D]=(function(N){return function(){return N.apply(K.object,arguments)}})(F[D]);G[D]="Swiff.CallBacks."+this.instance+"."+D}E.flashVars=Hash.toQueryString(G);if(Browser.Engine.trident){H.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";E.movie=L}else{H.type="application/x-shockwave-flash";H.data=L}var J='<object id="'+B+'"';for(var I in H){J+=" "+I+'="'+H[I]+'"'}J+=">";for(var C in E){if(E[C]){J+='<param name="'+C+'" value="'+E[C]+'" />'}}J+="</object>";this.object=((A)?A.empty():new Element("div")).set("html",J).firstChild},replaces:function(A){A=$(A,true);A.parentNode.replaceChild(this.toElement(),A);return this},inject:function(A){$(A,true).appendChild(this.toElement());return this},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].extend(arguments))}});Swiff.CallBacks={};Swiff.remote=function(obj,fn){var rs=obj.CallFunction('<invoke name="'+fn+'" returntype="javascript">'+__flash__argumentsToXML(arguments,2)+"</invoke>");return eval(rs)};var Fx=new Class({Implements:[Chain,Events,Options],options:{fps:50,unit:false,duration:500,link:"ignore",transition:function(A){return -(Math.cos(Math.PI*A)-1)/2}},initialize:function(A){this.subject=this.subject||this;this.setOptions(A);this.options.duration=Fx.Durations[this.options.duration]||this.options.duration.toInt();var B=this.options.wait;if(B===false){this.options.link="cancel"}},step:function(){var A=$time();if(A<this.time+this.options.duration){var B=this.options.transition((A-this.time)/this.options.duration);this.set(this.compute(this.from,this.to,B))}else{this.set(this.compute(this.from,this.to,1));this.complete()}},set:function(A){return A},compute:function(C,B,A){return Fx.compute(C,B,A)},check:function(A){if(!this.timer){return true}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(A.bind(this,Array.slice(arguments,1)));return false}return false},start:function(B,A){if(!this.check(arguments.callee,B,A)){return this}this.from=B;this.to=A;this.time=0;this.startTimer();this.onStart();return this},complete:function(){if(this.stopTimer()){this.onComplete()}return this},cancel:function(){if(this.stopTimer()){this.onCancel()}return this},onStart:function(){this.fireEvent("start",this.subject)},onComplete:function(){this.fireEvent("complete",this.subject);if(!this.callChain()){this.fireEvent("chainComplete",this.subject)}},onCancel:function(){this.fireEvent("cancel",this.subject).clearChain()},pause:function(){this.stopTimer();return this},resume:function(){this.startTimer();return this},stopTimer:function(){if(!this.timer){return false}this.time=$time()-this.time;this.timer=$clear(this.timer);return true},startTimer:function(){if(this.timer){return false}this.time=$time()-this.time;this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);return true}});Fx.compute=function(C,B,A){return(B-C)*A+C};Fx.Durations={"short":250,normal:500,"long":1000};Fx.CSS=new Class({Extends:Fx,prepare:function(D,E,B){B=$splat(B);var C=B[1];if(!$chk(C)){B[1]=B[0];B[0]=D.getStyle(E)}var A=B.map(this.parse);return{from:A[0],to:A[1]}},parse:function(A){A=$lambda(A)();A=(typeof A=="string")?A.split(" "):$splat(A);return A.map(function(C){C=String(C);var B=false;Fx.CSS.Parsers.each(function(F,E){if(B){return }var D=F.parse(C);if($chk(D)){B={value:D,parser:F}}});B=B||{value:C,parser:Fx.CSS.Parsers.String};return B})},compute:function(D,C,B){var A=[];(Math.min(D.length,C.length)).times(function(E){A.push({value:D[E].parser.compute(D[E].value,C[E].value,B),parser:D[E].parser})});A.$family={name:"fx:css:value"};return A},serve:function(C,B){if($type(C)!="fx:css:value"){C=this.parse(C)}var A=[];C.each(function(D){A=A.concat(D.parser.serve(D.value,B))});return A},render:function(A,D,C,B){A.setStyle(D,this.serve(C,B))},search:function(A){if(Fx.CSS.Cache[A]){return Fx.CSS.Cache[A]}var B={};Array.each(document.styleSheets,function(E,D){var C=E.href;if(C&&C.contains("://")&&!C.contains(document.domain)){return }var F=E.rules||E.cssRules;Array.each(F,function(I,G){if(!I.style){return }var H=(I.selectorText)?I.selectorText.replace(/^\w+/,function(J){return J.toLowerCase()}):null;if(!H||!H.test("^"+A+"$")){return }Element.Styles.each(function(K,J){if(!I.style[J]||Element.ShortStyles[J]){return }K=String(I.style[J]);B[J]=(K.test(/^rgb/))?K.rgbToHex():K})})});return Fx.CSS.Cache[A]=B}});Fx.CSS.Cache={};Fx.CSS.Parsers=new Hash({Color:{parse:function(A){if(A.match(/^#[0-9a-f]{3,6}$/i)){return A.hexToRgb(true)}return((A=A.match(/(\d+),\s*(\d+),\s*(\d+)/)))?[A[1],A[2],A[3]]:false},compute:function(C,B,A){return C.map(function(E,D){return Math.round(Fx.compute(C[D],B[D],A))})},serve:function(A){return A.map(Number)}},Number:{parse:parseFloat,compute:Fx.compute,serve:function(B,A){return(A)?B+A:B}},String:{parse:$lambda(false),compute:$arguments(1),serve:$arguments(0)}});Fx.Tween=new Class({Extends:Fx.CSS,initialize:function(B,A){this.element=this.subject=$(B);this.parent(A)},set:function(B,A){if(arguments.length==1){A=B;B=this.property||this.options.property}this.render(this.element,B,A,this.options.unit);return this},start:function(C,E,D){if(!this.check(arguments.callee,C,E,D)){return this}var B=Array.flatten(arguments);this.property=this.options.property||B.shift();var A=this.prepare(this.element,this.property,B);return this.parent(A.from,A.to)}});Element.Properties.tween={set:function(A){var B=this.retrieve("tween");if(B){B.cancel()}return this.eliminate("tween").store("tween:options",$extend({link:"cancel"},A))},get:function(A){if(A||!this.retrieve("tween")){if(A||!this.retrieve("tween:options")){this.set("tween",A)}this.store("tween",new Fx.Tween(this,this.retrieve("tween:options")))}return this.retrieve("tween")}};Element.implement({tween:function(A,C,B){this.get("tween").start(arguments);return this},fade:function(C){var E=this.get("tween"),D="opacity",A;C=$pick(C,"toggle");switch(C){case"in":E.start(D,1);break;case"out":E.start(D,0);break;case"show":E.set(D,1);break;case"hide":E.set(D,0);break;case"toggle":var B=this.retrieve("fade:flag",this.get("opacity")==1);E.start(D,(B)?0:1);this.store("fade:flag",!B);A=true;break;default:E.start(D,arguments)}if(!A){this.eliminate("fade:flag")}return this},highlight:function(C,A){if(!A){A=this.retrieve("highlight:original",this.getStyle("background-color"));A=(A=="transparent")?"#fff":A}var B=this.get("tween");B.start("background-color",C||"#ffff88",A).chain(function(){this.setStyle("background-color",this.retrieve("highlight:original"));B.callChain()}.bind(this));return this}});Fx.Morph=new Class({Extends:Fx.CSS,initialize:function(B,A){this.element=this.subject=$(B);this.parent(A)},set:function(A){if(typeof A=="string"){A=this.search(A)}for(var B in A){this.render(this.element,B,A[B],this.options.unit)}return this},compute:function(E,D,C){var A={};for(var B in E){A[B]=this.parent(E[B],D[B],C)}return A},start:function(B){if(!this.check(arguments.callee,B)){return this}if(typeof B=="string"){B=this.search(B)}var E={},D={};for(var C in B){var A=this.prepare(this.element,C,B[C]);E[C]=A.from;D[C]=A.to}return this.parent(E,D)}});Element.Properties.morph={set:function(A){var B=this.retrieve("morph");if(B){B.cancel()}return this.eliminate("morph").store("morph:options",$extend({link:"cancel"},A))},get:function(A){if(A||!this.retrieve("morph")){if(A||!this.retrieve("morph:options")){this.set("morph",A)}this.store("morph",new Fx.Morph(this,this.retrieve("morph:options")))}return this.retrieve("morph")}};Element.implement({morph:function(A){this.get("morph").start(A);return this}});(function(){var A=Fx.prototype.initialize;Fx.prototype.initialize=function(B){A.call(this,B);var C=this.options.transition;if(typeof C=="string"&&(C=C.split(":"))){var D=Fx.Transitions;D=D[C[0]]||D[C[0].capitalize()];if(C[1]){D=D["ease"+C[1].capitalize()+(C[2]?C[2].capitalize():"")]}this.options.transition=D}}})();Fx.Transition=function(B,A){A=$splat(A);return $extend(B,{easeIn:function(C){return B(C,A)},easeOut:function(C){return 1-B(1-C,A)},easeInOut:function(C){return(C<=0.5)?B(2*C,A)/2:(2-B(2*(1-C),A))/2}})};Fx.Transitions=new Hash({linear:$arguments(0)});Fx.Transitions.extend=function(A){for(var B in A){Fx.Transitions[B]=new Fx.Transition(A[B])}};Fx.Transitions.extend({Pow:function(B,A){return Math.pow(B,A[0]||6)},Expo:function(A){return Math.pow(2,8*(A-1))},Circ:function(A){return 1-Math.sin(Math.acos(A))},Sine:function(A){return 1-Math.sin((1-A)*Math.PI/2)},Back:function(B,A){A=A[0]||1.618;return Math.pow(B,2)*((A+1)*B-A)},Bounce:function(D){var C;for(var B=0,A=1;1;B+=A,A/=2){if(D>=(7-4*B)/11){C=-Math.pow((11-6*B-11*D)/4,2)+A*A;break}}return C},Elastic:function(B,A){return Math.pow(2,10*--B)*Math.cos(20*B*Math.PI*(A[0]||1)/3)}});["Quad","Cubic","Quart","Quint"].each(function(B,A){Fx.Transitions[B]=new Fx.Transition(function(C){return Math.pow(C,[A+2])})});var Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false},initialize:function(A){this.xhr=new Browser.Request();this.setOptions(A);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers=new Hash(this.options.headers)},onStateChange:function(){if(this.xhr.readyState!=4||!this.running){return }this.running=false;this.status=0;$try(function(){this.status=this.xhr.status}.bind(this));if(this.options.isSuccess.call(this,this.status)){this.response={text:this.xhr.responseText,xml:this.xhr.responseXML};this.success(this.response.text,this.response.xml)}else{this.response={text:null,xml:null};this.failure()}this.xhr.onreadystatechange=$empty},isSuccess:function(){return((this.status>=200)&&(this.status<300))},processScripts:function(A){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return $exec(A)}return A.stripScripts(this.options.evalScripts)},success:function(B,A){this.onSuccess(this.processScripts(B),A)},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain()},failure:function(){this.onFailure()},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr)},setHeader:function(A,B){this.headers.set(A,B);return this},getHeader:function(A){return $try(function(){return this.xhr.getResponseHeader(A)}.bind(this))},check:function(A){if(!this.running){return true}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(A.bind(this,Array.slice(arguments,1)));return false}return false},send:function(I){if(!this.check(arguments.callee,I)){return this}this.running=true;var G=$type(I);if(G=="string"||G=="element"){I={data:I}}var D=this.options;I=$extend({data:D.data,url:D.url,method:D.method},I);var E=I.data,B=I.url,A=I.method;switch($type(E)){case"element":E=$(E).toQueryString();break;case"object":case"hash":E=Hash.toQueryString(E)}if(this.options.format){var H="format="+this.options.format;E=(E)?H+"&"+E:H}if(this.options.emulation&&["put","delete"].contains(A)){var F="_method="+A;E=(E)?F+"&"+E:F;A="post"}if(this.options.urlEncoded&&A=="post"){var C=(this.options.encoding)?"; charset="+this.options.encoding:"";this.headers.set("Content-type","application/x-www-form-urlencoded"+C)}if(E&&A=="get"){B=B+(B.contains("?")?"&":"?")+E;E=null}this.xhr.open(A.toUpperCase(),B,this.options.async);this.xhr.onreadystatechange=this.onStateChange.bind(this);this.headers.each(function(K,J){if(!$try(function(){this.xhr.setRequestHeader(J,K);return true}.bind(this))){this.fireEvent("exception",[J,K])}},this);this.fireEvent("request");this.xhr.send(E);if(!this.options.async){this.onStateChange()}return this},cancel:function(){if(!this.running){return this}this.running=false;this.xhr.abort();this.xhr.onreadystatechange=$empty;this.xhr=new Browser.Request();this.fireEvent("cancel");return this}});(function(){var A={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(B){A[B]=function(){var C=Array.link(arguments,{url:String.type,data:$defined});return this.send($extend(C,{method:B.toLowerCase()}))}});Request.implement(A)})();Element.Properties.send={set:function(A){var B=this.retrieve("send");if(B){B.cancel()}return this.eliminate("send").store("send:options",$extend({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")},A))},get:function(A){if(A||!this.retrieve("send")){if(A||!this.retrieve("send:options")){this.set("send",A)}this.store("send",new Request(this.retrieve("send:options")))}return this.retrieve("send")}};Element.implement({send:function(A){var B=this.get("send");B.send({data:this,url:A||B.options.url});return this}});Request.HTML=new Class({Extends:Request,options:{update:false,evalScripts:true,filter:false},processHTML:function(C){var B=C.match(/<body[^>]*>([\s\S]*?)<\/body>/i);C=(B)?B[1]:C;var A=new Element("div");return $try(function(){var D="<root>"+C+"</root>",G;if(Browser.Engine.trident){G=new ActiveXObject("Microsoft.XMLDOM");G.async=false;G.loadXML(D)}else{G=new DOMParser().parseFromString(D,"text/xml")}D=G.getElementsByTagName("root")[0];for(var F=0,E=D.childNodes.length;F<E;F++){var H=Element.clone(D.childNodes[F],true,true);if(H){A.grab(H)}}return A})||A.set("html",C)},success:function(D){var C=this.options,B=this.response;B.html=D.stripScripts(function(E){B.javascript=E});var A=this.processHTML(B.html);B.tree=A.childNodes;B.elements=A.getElements("*");if(C.filter){B.tree=B.elements.filter(C.filter)}if(C.update){$(C.update).empty().adopt(B.tree)}if(C.evalScripts){$exec(B.javascript)}this.onSuccess(B.tree,B.elements,B.html,B.javascript)}});Element.Properties.load={set:function(A){var B=this.retrieve("load");if(B){send.cancel()}return this.eliminate("load").store("load:options",$extend({data:this,link:"cancel",update:this,method:"get"},A))},get:function(A){if(A||!this.retrieve("load")){if(A||!this.retrieve("load:options")){this.set("load",A)}this.store("load",new Request.HTML(this.retrieve("load:options")))}return this.retrieve("load")}};Element.implement({load:function(){this.get("load").send(Array.link(arguments,{data:Object.type,url:String.type}));return this}});Request.JSON=new Class({Extends:Request,options:{secure:true},initialize:function(A){this.parent(A);this.headers.extend({Accept:"application/json","X-Request":"JSON"})},success:function(A){this.response.json=JSON.decode(A,this.options.secure);this.onSuccess(this.response.json,A)}});;
Fx.Slide=new Class({Extends:Fx,options:{mode:"vertical"},initialize:function(B,A){this.addEvent("complete",function(){this.open=(this.wrapper["offset"+this.layout.capitalize()]!=0);if(this.open&&Browser.Engine.webkit419){this.element.dispose().inject(this.wrapper)}},true);this.element=this.subject=$(B);this.parent(A);var C=this.element.retrieve("wrapper");this.wrapper=C||new Element("div",{styles:$extend(this.element.getStyles("margin","position"),{overflow:"hidden"})}).wraps(this.element);this.element.store("wrapper",this.wrapper).setStyle("margin",0);this.now=[];this.open=true},vertical:function(){this.margin="margin-top";this.layout="height";this.offset=this.element.offsetHeight},horizontal:function(){this.margin="margin-left";this.layout="width";this.offset=this.element.offsetWidth},set:function(A){this.element.setStyle(this.margin,A[0]);this.wrapper.setStyle(this.layout,A[1]);return this},compute:function(E,D,C){var B=[];var A=2;A.times(function(F){B[F]=Fx.compute(E[F],D[F],C)});return B},start:function(B,E){if(!this.check(arguments.callee,B,E)){return this}this[E||this.options.mode]();var D=this.element.getStyle(this.margin).toInt();var C=this.wrapper.getStyle(this.layout).toInt();var A=[[D,C],[0,this.offset]];var G=[[D,C],[-this.offset,0]];var F;switch(B){case"in":F=A;break;case"out":F=G;break;case"toggle":F=(this.wrapper["offset"+this.layout.capitalize()]==0)?A:G}return this.parent(F[0],F[1])},slideIn:function(A){return this.start("in",A)},slideOut:function(A){return this.start("out",A)},hide:function(A){this[A||this.options.mode]();this.open=false;return this.set([-this.offset,0])},show:function(A){this[A||this.options.mode]();this.open=true;return this.set([0,this.offset])},toggle:function(A){return this.start("toggle",A)}});Element.Properties.slide={set:function(B){var A=this.retrieve("slide");if(A){A.cancel()}return this.eliminate("slide").store("slide:options",$extend({link:"cancel"},B))},get:function(A){if(A||!this.retrieve("slide")){if(A||!this.retrieve("slide:options")){this.set("slide",A)}this.store("slide",new Fx.Slide(this,this.retrieve("slide:options")))}return this.retrieve("slide")}};Element.implement({slide:function(D,E){D=D||"toggle";var B=this.get("slide"),A;switch(D){case"hide":B.hide(E);break;case"show":B.show(E);break;case"toggle":var C=this.retrieve("slide:flag",B.open);B[(C)?"slideOut":"slideIn"](E);this.store("slide:flag",!C);A=true;break;default:B.start(D,E)}if(!A){this.eliminate("slide:flag")}return this}});Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:true},initialize:function(B,A){this.element=this.subject=$(B);this.parent(A);var D=this.cancel.bind(this,false);if($type(this.element)!="element"){this.element=$(this.element.getDocument().body)}var C=this.element;if(this.options.wheelStops){this.addEvent("start",function(){C.addEvent("mousewheel",D)},true);this.addEvent("complete",function(){C.removeEvent("mousewheel",D)},true)}},set:function(){var A=Array.flatten(arguments);this.element.scrollTo(A[0],A[1])},compute:function(E,D,C){var B=[];var A=2;A.times(function(F){B.push(Fx.compute(E[F],D[F],C))});return B},start:function(C,H){if(!this.check(arguments.callee,C,H)){return this}var E=this.element.getSize(),F=this.element.getScrollSize();var B=this.element.getScroll(),D={x:C,y:H};for(var G in D){var A=F[G]-E[G];if($chk(D[G])){D[G]=($type(D[G])=="number")?D[G].limit(0,A):A}else{D[G]=B[G]}D[G]+=this.options.offset[G]}return this.parent([B.x,B.y],[D.x,D.y])},toTop:function(){return this.start(false,0)},toLeft:function(){return this.start(0,false)},toRight:function(){return this.start("right",false)},toBottom:function(){return this.start(false,"bottom")},toElement:function(B){var A=$(B).getPosition(this.element);return this.start(A.x,A.y)}});Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(B,A){this.elements=this.subject=$$(B);this.parent(A)},compute:function(G,H,I){var C={};for(var D in G){var A=G[D],E=H[D],F=C[D]={};for(var B in A){F[B]=this.parent(A[B],E[B],I)}}return C},set:function(B){for(var C in B){var A=B[C];for(var D in A){this.render(this.elements[C],D,A[D],this.options.unit)}}return this},start:function(C){if(!this.check(arguments.callee,C)){return this}var H={},I={};for(var D in C){var F=C[D],A=H[D]={},G=I[D]={};for(var B in F){var E=this.prepare(this.elements[D],B,F[B]);A[B]=E.from;G[B]=E.to}}return this.parent(H,I)}});var Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:"px",grid:false,style:true,limit:false,handle:false,invert:false,preventDefault:false,modifiers:{x:"left",y:"top"}},initialize:function(){var B=Array.link(arguments,{options:Object.type,element:$defined});this.element=$(B.element);this.document=this.element.getDocument();this.setOptions(B.options||{});var A=$type(this.options.handle);this.handles=(A=="array"||A=="collection")?$$(this.options.handle):$(this.options.handle)||this.element;this.mouse={now:{},pos:{}};this.value={start:{},now:{}};this.selection=(Browser.Engine.trident)?"selectstart":"mousedown";this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:$lambda(false)};this.attach()},attach:function(){this.handles.addEvent("mousedown",this.bound.start);return this},detach:function(){this.handles.removeEvent("mousedown",this.bound.start);return this},start:function(C){if(this.options.preventDefault){C.preventDefault()}this.fireEvent("beforeStart",this.element);this.mouse.start=C.page;var A=this.options.limit;this.limit={x:[],y:[]};for(var D in this.options.modifiers){if(!this.options.modifiers[D]){continue}if(this.options.style){this.value.now[D]=this.element.getStyle(this.options.modifiers[D]).toInt()}else{this.value.now[D]=this.element[this.options.modifiers[D]]}if(this.options.invert){this.value.now[D]*=-1}this.mouse.pos[D]=C.page[D]-this.value.now[D];if(A&&A[D]){for(var B=2;B--;B){if($chk(A[D][B])){this.limit[D][B]=$lambda(A[D][B])()}}}}if($type(this.options.grid)=="number"){this.options.grid={x:this.options.grid,y:this.options.grid}}this.document.addEvents({mousemove:this.bound.check,mouseup:this.bound.cancel});this.document.addEvent(this.selection,this.bound.eventStop)},check:function(A){if(this.options.preventDefault){A.preventDefault()}var B=Math.round(Math.sqrt(Math.pow(A.page.x-this.mouse.start.x,2)+Math.pow(A.page.y-this.mouse.start.y,2)));if(B>this.options.snap){this.cancel();this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop});this.fireEvent("start",this.element).fireEvent("snap",this.element)}},drag:function(A){if(this.options.preventDefault){A.preventDefault()}this.mouse.now=A.page;for(var B in this.options.modifiers){if(!this.options.modifiers[B]){continue}this.value.now[B]=this.mouse.now[B]-this.mouse.pos[B];if(this.options.invert){this.value.now[B]*=-1}if(this.options.limit&&this.limit[B]){if($chk(this.limit[B][1])&&(this.value.now[B]>this.limit[B][1])){this.value.now[B]=this.limit[B][1]}else{if($chk(this.limit[B][0])&&(this.value.now[B]<this.limit[B][0])){this.value.now[B]=this.limit[B][0]}}}if(this.options.grid[B]){this.value.now[B]-=(this.value.now[B]%this.options.grid[B])}if(this.options.style){this.element.setStyle(this.options.modifiers[B],this.value.now[B]+this.options.unit)}else{this.element[this.options.modifiers[B]]=this.value.now[B]}}this.fireEvent("drag",this.element)},cancel:function(A){this.document.removeEvent("mousemove",this.bound.check);this.document.removeEvent("mouseup",this.bound.cancel);if(A){this.document.removeEvent(this.selection,this.bound.eventStop);this.fireEvent("cancel",this.element)}},stop:function(A){this.document.removeEvent(this.selection,this.bound.eventStop);this.document.removeEvent("mousemove",this.bound.drag);this.document.removeEvent("mouseup",this.bound.stop);if(A){this.fireEvent("complete",this.element)}}});Element.implement({makeResizable:function(A){return new Drag(this,$merge({modifiers:{x:"width",y:"height"}},A))}});Drag.Move=new Class({Extends:Drag,options:{droppables:[],container:false},initialize:function(C,B){this.parent(C,B);this.droppables=$$(this.options.droppables);this.container=$(this.options.container);if(this.container&&$type(this.container)!="element"){this.container=$(this.container.getDocument().body)}C=this.element;var D=C.getStyle("position");var A=(D!="static")?D:"absolute";if(C.getStyle("left")=="auto"||C.getStyle("top")=="auto"){C.position(C.getPosition(C.offsetParent))}C.setStyle("position",A);this.addEvent("start",function(){this.checkDroppables()},true)},start:function(B){if(this.container){var D=this.element,J=this.container,E=J.getCoordinates(D.offsetParent),F={},A={};["top","right","bottom","left"].each(function(K){F[K]=J.getStyle("padding-"+K).toInt();A[K]=D.getStyle("margin-"+K).toInt()},this);var C=D.offsetWidth+A.left+A.right,I=D.offsetHeight+A.top+A.bottom;var H=[E.left+F.left,E.right-F.right-C];var G=[E.top+F.top,E.bottom-F.bottom-I];this.options.limit={x:H,y:G}}this.parent(B)},checkAgainst:function(B){B=B.getCoordinates();var A=this.mouse.now;return(A.x>B.left&&A.x<B.right&&A.y<B.bottom&&A.y>B.top)},checkDroppables:function(){var A=this.droppables.filter(this.checkAgainst,this).getLast();if(this.overed!=A){if(this.overed){this.fireEvent("leave",[this.element,this.overed])}if(A){this.overed=A;this.fireEvent("enter",[this.element,A])}else{this.overed=null}}},drag:function(A){this.parent(A);if(this.droppables.length){this.checkDroppables()}},stop:function(A){this.checkDroppables();this.fireEvent("drop",[this.element,this.overed]);this.overed=null;return this.parent(A)}});Element.implement({makeDraggable:function(A){return new Drag.Move(this,A)}});var Color=new Native({initialize:function(B,C){if(arguments.length>=3){C="rgb";B=Array.slice(arguments,0,3)}else{if(typeof B=="string"){if(B.match(/rgb/)){B=B.rgbToHex().hexToRgb(true)}else{if(B.match(/hsb/)){B=B.hsbToRgb()}else{B=B.hexToRgb(true)}}}}C=C||"rgb";switch(C){case"hsb":var A=B;B=B.hsbToRgb();B.hsb=A;break;case"hex":B=B.hexToRgb(true);break}B.rgb=B.slice(0,3);B.hsb=B.hsb||B.rgbToHsb();B.hex=B.rgbToHex();return $extend(B,this)}});Color.implement({mix:function(){var A=Array.slice(arguments);var C=($type(A.getLast())=="number")?A.pop():50;var B=this.slice();A.each(function(D){D=new Color(D);for(var E=0;E<3;E++){B[E]=Math.round((B[E]/100*(100-C))+(D[E]/100*C))}});return new Color(B,"rgb")},invert:function(){return new Color(this.map(function(A){return 255-A}))},setHue:function(A){return new Color([A,this.hsb[1],this.hsb[2]],"hsb")},setSaturation:function(A){return new Color([this.hsb[0],A,this.hsb[2]],"hsb")},setBrightness:function(A){return new Color([this.hsb[0],this.hsb[1],A],"hsb")}});function $RGB(C,B,A){return new Color([C,B,A],"rgb")}function $HSB(C,B,A){return new Color([C,B,A],"hsb")}function $HEX(A){return new Color(A,"hex")}Array.implement({rgbToHsb:function(){var B=this[0],C=this[1],J=this[2];var G,F,H;var I=Math.max(B,C,J),E=Math.min(B,C,J);var K=I-E;H=I/255;F=(I!=0)?K/I:0;if(F==0){G=0}else{var D=(I-B)/K;var A=(I-C)/K;var L=(I-J)/K;if(B==I){G=L-A}else{if(C==I){G=2+D-L}else{G=4+A-D}}G/=6;if(G<0){G++}}return[Math.round(G*360),Math.round(F*100),Math.round(H*100)]},hsbToRgb:function(){var C=Math.round(this[2]/100*255);if(this[1]==0){return[C,C,C]}else{var A=this[0]%360;var E=A%60;var F=Math.round((this[2]*(100-this[1]))/10000*255);var D=Math.round((this[2]*(6000-this[1]*E))/600000*255);var B=Math.round((this[2]*(6000-this[1]*(60-E)))/600000*255);switch(Math.floor(A/60)){case 0:return[C,B,F];case 1:return[D,C,F];case 2:return[F,C,B];case 3:return[F,D,C];case 4:return[B,F,C];case 5:return[C,F,D]}}return false}});String.implement({rgbToHsb:function(){var A=this.match(/\d{1,3}/g);return(A)?hsb.rgbToHsb():null},hsbToRgb:function(){var A=this.match(/\d{1,3}/g);return(A)?A.hsbToRgb():null}});var Group=new Class({initialize:function(){this.instances=Array.flatten(arguments);this.events={};this.checker={}},addEvent:function(B,A){this.checker[B]=this.checker[B]||{};this.events[B]=this.events[B]||[];if(this.events[B].contains(A)){return false}else{this.events[B].push(A)}this.instances.each(function(C,D){C.addEvent(B,this.check.bind(this,[B,C,D]))},this);return this},check:function(C,A,B){this.checker[C][B]=true;var D=this.instances.every(function(F,E){return this.checker[C][E]||false},this);if(!D){return }this.checker[C]={};this.events[C].each(function(E){E.call(this,this.instances,A)},this)}});var Asset=new Hash({javascript:function(F,D){D=$extend({onload:$empty,document:document,check:$lambda(true)},D);var B=new Element("script",{src:F,type:"text/javascript"});var E=D.onload.bind(B),A=D.check,G=D.document;delete D.onload;delete D.check;delete D.document;B.addEvents({load:E,readystatechange:function(){if(["loaded","complete"].contains(this.readyState)){E()}}}).setProperties(D);if(Browser.Engine.webkit419){var C=(function(){if(!$try(A)){return }$clear(C);E()}).periodical(50)}return B.inject(G.head)},css:function(B,A){return new Element("link",$merge({rel:"stylesheet",media:"screen",type:"text/css",href:B},A)).inject(document.head)},image:function(C,B){B=$merge({onload:$empty,onabort:$empty,onerror:$empty},B);var D=new Image();var A=$(D)||new Element("img");["load","abort","error"].each(function(E){var F="on"+E;var G=B[F];delete B[F];D[F]=function(){if(!D){return }if(!A.parentNode){A.width=D.width;A.height=D.height}D=D.onload=D.onabort=D.onerror=null;G.delay(1,A,A);A.fireEvent(E,A,1)}});D.src=A.src=C;if(D&&D.complete){D.onload.delay(1)}return A.setProperties(B)},images:function(D,C){C=$merge({onComplete:$empty,onProgress:$empty},C);if(!D.push){D=[D]}var A=[];var B=0;D.each(function(F){var E=new Asset.image(F,{onload:function(){C.onProgress.call(this,B,D.indexOf(F));B++;if(B==D.length){C.onComplete()}}});A.push(E)});return new Elements(A)}});var Sortables=new Class({Implements:[Events,Options],options:{snap:4,opacity:1,clone:false,revert:false,handle:false,constrain:false},initialize:function(A,B){this.setOptions(B);this.elements=[];this.lists=[];this.idle=true;this.addLists($$($(A)||A));if(!this.options.clone){this.options.revert=false}if(this.options.revert){this.effect=new Fx.Morph(null,$merge({duration:250,link:"cancel"},this.options.revert))}},attach:function(){this.addLists(this.lists);return this},detach:function(){this.lists=this.removeLists(this.lists);return this},addItems:function(){Array.flatten(arguments).each(function(A){this.elements.push(A);var B=A.retrieve("sortables:start",this.start.bindWithEvent(this,A));(this.options.handle?A.getElement(this.options.handle)||A:A).addEvent("mousedown",B)},this);return this},addLists:function(){Array.flatten(arguments).each(function(A){this.lists.push(A);this.addItems(A.getChildren())},this);return this},removeItems:function(){var A=[];Array.flatten(arguments).each(function(B){A.push(B);this.elements.erase(B);var C=B.retrieve("sortables:start");(this.options.handle?B.getElement(this.options.handle)||B:B).removeEvent("mousedown",C)},this);return $$(A)},removeLists:function(){var A=[];Array.flatten(arguments).each(function(B){A.push(B);this.lists.erase(B);this.removeItems(B.getChildren())},this);return $$(A)},getClone:function(B,A){if(!this.options.clone){return new Element("div").inject(document.body)}if($type(this.options.clone)=="function"){return this.options.clone.call(this,B,A,this.list)}return A.clone(true).setStyles({margin:"0px",position:"absolute",visibility:"hidden",width:A.getStyle("width")}).inject(this.list).position(A.getPosition(A.getOffsetParent()))},getDroppables:function(){var A=this.list.getChildren();if(!this.options.constrain){A=this.lists.concat(A).erase(this.list)}return A.erase(this.clone).erase(this.element)},insert:function(C,B){var A="inside";if(this.lists.contains(B)){this.list=B;this.drag.droppables=this.getDroppables()}else{A=this.element.getAllPrevious().contains(B)?"before":"after"}this.element.inject(B,A);this.fireEvent("sort",[this.element,this.clone])},start:function(B,A){if(!this.idle){return }this.idle=false;this.element=A;this.opacity=A.get("opacity");this.list=A.getParent();this.clone=this.getClone(B,A);this.drag=new Drag.Move(this.clone,{snap:this.options.snap,container:this.options.constrain&&this.element.getParent(),droppables:this.getDroppables(),onSnap:function(){B.stop();this.clone.setStyle("visibility","visible");this.element.set("opacity",this.options.opacity||0);this.fireEvent("start",[this.element,this.clone])}.bind(this),onEnter:this.insert.bind(this),onCancel:this.reset.bind(this),onComplete:this.end.bind(this)});this.clone.inject(this.element,"before");this.drag.start(B)},end:function(){this.drag.detach();this.element.set("opacity",this.opacity);if(this.effect){var A=this.element.getStyles("width","height");var B=this.clone.computePosition(this.element.getPosition(this.clone.offsetParent));this.effect.element=this.clone;this.effect.start({top:B.top,left:B.left,width:A.width,height:A.height,opacity:0.25}).chain(this.reset.bind(this))}else{this.reset()}},reset:function(){this.idle=true;this.clone.destroy();this.fireEvent("complete",this.element)},serialize:function(){var C=Array.link(arguments,{modifier:Function.type,index:$defined});var B=this.lists.map(function(D){return D.getChildren().map(C.modifier||function(E){return E.get("id")},this)},this);var A=C.index;if(this.lists.length==1){A=0}return $chk(A)&&A>=0&&A<this.lists.length?B[A]:B}});var Tips=new Class({Implements:[Events,Options],options:{onShow:function(A){A.setStyle("visibility","visible")},onHide:function(A){A.setStyle("visibility","hidden")},showDelay:100,hideDelay:100,className:null,offsets:{x:16,y:16},fixed:false},initialize:function(){var C=Array.link(arguments,{options:Object.type,elements:$defined});this.setOptions(C.options||null);this.tip=new Element("div").inject(document.body);if(this.options.className){this.tip.addClass(this.options.className)}var B=new Element("div",{"class":"tip-top"}).inject(this.tip);this.container=new Element("div",{"class":"tip"}).inject(this.tip);var A=new Element("div",{"class":"tip-bottom"}).inject(this.tip);this.tip.setStyles({position:"absolute",top:0,left:0,visibility:"hidden"});if(C.elements){this.attach(C.elements)}},attach:function(A){$$(A).each(function(D){var G=D.retrieve("tip:title",D.get("title"));var F=D.retrieve("tip:text",D.get("rel")||D.get("href"));var E=D.retrieve("tip:enter",this.elementEnter.bindWithEvent(this,D));var C=D.retrieve("tip:leave",this.elementLeave.bindWithEvent(this,D));D.addEvents({mouseenter:E,mouseleave:C});if(!this.options.fixed){var B=D.retrieve("tip:move",this.elementMove.bindWithEvent(this,D));D.addEvent("mousemove",B)}D.store("tip:native",D.get("title"));D.erase("title")},this);return this},detach:function(A){$$(A).each(function(C){C.removeEvent("mouseenter",C.retrieve("tip:enter")||$empty);C.removeEvent("mouseleave",C.retrieve("tip:leave")||$empty);C.removeEvent("mousemove",C.retrieve("tip:move")||$empty);C.eliminate("tip:enter").eliminate("tip:leave").eliminate("tip:move");var B=C.retrieve("tip:native");if(B){C.set("title",B)}});return this},elementEnter:function(B,A){$A(this.container.childNodes).each(Element.dispose);var D=A.retrieve("tip:title");if(D){this.titleElement=new Element("div",{"class":"tip-title"}).inject(this.container);this.fill(this.titleElement,D)}var C=A.retrieve("tip:text");if(C){this.textElement=new Element("div",{"class":"tip-text"}).inject(this.container);this.fill(this.textElement,C)}this.timer=$clear(this.timer);this.timer=this.show.delay(this.options.showDelay,this);this.position((!this.options.fixed)?B:{page:A.getPosition()})},elementLeave:function(A){$clear(this.timer);this.timer=this.hide.delay(this.options.hideDelay,this)},elementMove:function(A){this.position(A)},position:function(D){var B=window.getSize(),A=window.getScroll();var E={x:this.tip.offsetWidth,y:this.tip.offsetHeight};var C={x:"left",y:"top"};for(var F in C){var G=D.page[F]+this.options.offsets[F];if((G+E[F]-A[F])>B[F]){G=D.page[F]-this.options.offsets[F]-E[F]}this.tip.setStyle(C[F],G)}},fill:function(A,B){(typeof B=="string")?A.set("html",B):A.adopt(B)},show:function(){this.fireEvent("show",this.tip)},hide:function(){this.fireEvent("hide",this.tip)}});var SmoothScroll=new Class({Extends:Fx.Scroll,initialize:function(B,C){C=C||document;var E=C.getDocument(),D=C.getWindow();this.parent(E,B);this.links=(this.options.links)?$$(this.options.links):$$(E.links);var A=D.location.href.match(/^[^#]*/)[0]+"#";this.links.each(function(G){if(G.href.indexOf(A)!=0){return }var F=G.href.substr(A.length);if(F&&$(F)){this.useLink(G,F)}},this);if(!Browser.Engine.webkit419){this.addEvent("complete",function(){D.location.hash=this.anchor},true)}},useLink:function(B,A){B.addEvent("click",function(C){this.anchor=A;this.toElement(A);C.stop()}.bind(this))}});var Slider=new Class({Implements:[Events,Options],options:{onTick:function(A){if(this.options.snap){A=this.toPosition(this.step)}this.knob.setStyle(this.property,A)},snap:false,offset:0,range:false,wheel:false,steps:100,mode:"horizontal"},initialize:function(E,A,D){this.setOptions(D);this.element=$(E);this.knob=$(A);this.previousChange=this.previousEnd=this.step=-1;this.element.addEvent("mousedown",this.clickedElement.bind(this));if(this.options.wheel){this.element.addEvent("mousewheel",this.scrolledElement.bindWithEvent(this))}var F,B={},C={x:false,y:false};switch(this.options.mode){case"vertical":this.axis="y";this.property="top";F="offsetHeight";break;case"horizontal":this.axis="x";this.property="left";F="offsetWidth"}this.half=this.knob[F]/2;this.full=this.element[F]-this.knob[F]+(this.options.offset*2);this.min=$chk(this.options.range[0])?this.options.range[0]:0;this.max=$chk(this.options.range[1])?this.options.range[1]:this.options.steps;this.range=this.max-this.min;this.steps=this.options.steps||this.full;this.stepSize=Math.abs(this.range)/this.steps;this.stepWidth=this.stepSize*this.full/Math.abs(this.range);this.knob.setStyle("position","relative").setStyle(this.property,-this.options.offset);C[this.axis]=this.property;B[this.axis]=[-this.options.offset,this.full-this.options.offset];this.drag=new Drag(this.knob,{snap:0,limit:B,modifiers:C,onDrag:this.draggedKnob.bind(this),onStart:this.draggedKnob.bind(this),onComplete:function(){this.draggedKnob();this.end()}.bind(this)});if(this.options.snap){this.drag.options.grid=Math.ceil(this.stepWidth);this.drag.options.limit[this.axis][1]=this.full}},set:function(A){if(!((this.range>0)^(A<this.min))){A=this.min}if(!((this.range>0)^(A>this.max))){A=this.max}this.step=Math.round(A);this.checkStep();this.end();this.fireEvent("tick",this.toPosition(this.step));return this},clickedElement:function(C){var B=this.range<0?-1:1;var A=C.page[this.axis]-this.element.getPosition()[this.axis]-this.half;A=A.limit(-this.options.offset,this.full-this.options.offset);this.step=Math.round(this.min+B*this.toStep(A));this.checkStep();this.end();this.fireEvent("tick",A)},scrolledElement:function(A){var B=(this.options.mode=="horizontal")?(A.wheel<0):(A.wheel>0);this.set(B?this.step-this.stepSize:this.step+this.stepSize);A.stop()},draggedKnob:function(){var B=this.range<0?-1:1;var A=this.drag.value.now[this.axis];A=A.limit(-this.options.offset,this.full-this.options.offset);this.step=Math.round(this.min+B*this.toStep(A));this.checkStep()},checkStep:function(){if(this.previousChange!=this.step){this.previousChange=this.step;this.fireEvent("change",this.step)}},end:function(){if(this.previousEnd!==this.step){this.previousEnd=this.step;this.fireEvent("complete",this.step+"")}},toStep:function(A){var B=(A+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?Math.round(B-=B%this.stepSize):B},toPosition:function(A){return(this.full*Math.abs(this.min-A))/(this.steps*this.stepSize)-this.options.offset}});var Scroller=new Class({Implements:[Events,Options],options:{area:20,velocity:1,onChange:function(A,B){this.element.scrollTo(A,B)}},initialize:function(B,A){this.setOptions(A);this.element=$(B);this.listener=($type(this.element)!="element")?$(this.element.getDocument().body):this.element;this.timer=null;this.coord=this.getCoords.bind(this)},start:function(){this.listener.addEvent("mousemove",this.coord)},stop:function(){this.listener.removeEvent("mousemove",this.coord);this.timer=$clear(this.timer)},getCoords:function(A){this.page=(this.listener.get("tag")=="body")?A.client:A.page;if(!this.timer){this.timer=this.scroll.periodical(50,this)}},scroll:function(){var B=this.element.getSize(),A=this.element.getScroll(),E=this.element.getPosition(),D={x:0,y:0};for(var C in this.page){if(this.page[C]<(this.options.area+E[C])&&A[C]!=0){D[C]=(this.page[C]-this.options.area-E[C])*this.options.velocity}else{if(this.page[C]+this.options.area>(B[C]+E[C])&&B[C]+B[C]!=A[C]){D[C]=(this.page[C]-B[C]+this.options.area-E[C])*this.options.velocity}}}if(D.y||D.x){this.fireEvent("change",[A.x+D.x,A.y+D.y])}}});;
Object.extend=$extend;Object.clone=$merge;Object.toQueryString=Hash.toQueryString;Cookie.set=Cookie.write;Cookie.get=Cookie.read;Cookie.remove=Cookie.dispose;Array.alias({erase:"remove"});Element.alias({dispose:"remove"});(function(B){var A=function(D){var E=Cookie.set("dummy",1,D);var C=!!(E.read("dummy"));E.dispose();return C};B.cookieSession=A();B.cookie=A({duration:1})})(Browser.Features);Class.create=function(){return function(){this.initialize.apply(this,arguments)}};function $_(A){if(typeof A=="string"){A=document.getElementById(A)}return A}function $F(A){return $(A).getValue()}String.implement({escapeHTML:function(){var B=document.createElement("div");var A=document.createTextNode(this);B.appendChild(A);return B.innerHTML},unescapeHTML:function(){var A=document.createElement("div");A.innerHTML=this.stripTags();return A.childNodes[0]?A.childNodes[0].nodeValue:""},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"")},extractScripts:function(){var A="(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)";var C=new RegExp(A,"img");var B=new RegExp(A,"im");return(this.match(C)||[]).map(function(D){return(D.match(B)||["",""])[1]})},parseJSON:function(){try{return eval("("+this+")")}catch(e){}throw new SyntaxError("parseJSON")},parseUrl:function(){var A=this.match(/^(?:([^:\/?#.]+):)?(?:\/\/)?(([^:\/?#]*)(?::(\d*))?)((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[\?#]|$)))*\/?)?([^?#\/]*))?(?:\?([^#]*))?(?:#(.*))?/)||[];return A.associate(["uri","scheme","authority","host","port","path","directory","file","query","fragment"])},setURL:function(){var A=/(http|https|ftp)([^ ]+)/ig;return this.replace(A,'<a href="$1$2" target="_blank">$1$2</a>')},nl2br:function(){return this.replace(/\n/,"<br>")}});Function.implement({bindAsEventListener:function(B,A){return this.create({bind:B,event:true,"arguments":A})}});Array.implement({inject:function(A,B){this.each(function(D,C){A=B(A,D,C)});return A},detect:function(B){var A;this.each(function(D,C){if(B(D,C)){A=D;return A}});return A}});Native.implement([Element,Document],{getElementsByClassName:function(A){return this.getElements("."+A)}});Element.implement({interpolate:function(){var A=arguments[0].split(/[{}]/);for(var B=0;B<A.length;B++){if(A[B].trim()!=""&&arguments[1][A[B]]){A[B]=arguments[1][A[B]]}}for(var B=0;B<A.length;B++){if(typeof A[B]=="string"){if(A[B].length!=0){this.appendChild(document.createTextNode(A[B]))}}else{A[B].inject(this)}}return this},hide:function(){this.style.display="none";return this},show:function(){this.style.display="";return this},getValue:function(){return this.get("value")},effect:function(B,A){return new Fx.Style(this,B,A)},yellowFade:function(B,C){if(!$defined(B)){B="#FFFF9C"}if(!$defined(C)){C="#FFFFFF"}var A=this.get("tween",{property:"background-color",duration:500,link:"chain"});A.start(B).chain(function(){A.start(C)});return this},wait:function(C,A){var A=$merge(A);if(!A||!A.notEmpty){this.empty()}delete A.notEmpty;var B={};if(typeof A=="object"){$extend(B,A)}var D=new Element("div",{"class":"spinner",html:'<div>Loading</div><img src="'+App.getStaticUrl("/img/panel/loading-02.gif")+'" alt="" />',styles:B}).inject(this);if(C){C.addEvent("onComplete",function(){if(D.parentNode){D.destroy()}})}return this},endWait:function(){var A=this.getElement(".spinner");if(A){A.destroy()}},getText:function(){return this.get("text")},setText:function(A){return this.set("text",A)},setHTML:function(){return this.set("html",arguments)},getHTML:function(){return this.get("html")},getTag:function(){return this.get("tag")},getCoordinates_cache:function(B,D){if(!B[this.uid]){var A=this.getPosition(D);var C=this.getSize();B[this.uid]={type:this.tagName.toLowerCase(),left:A.x,top:A.y,width:C.x,height:C.y};B[this.uid].right=B[this.uid].left+B[this.uid].width;B[this.uid].bottom=B[this.uid].top+B[this.uid].height}return B[this.uid]}});$extend(Element,{getDimensions:function(C){C=$_(C);var G=C.style.display;if(G!="none"&&G!=null){return{width:C.offsetWidth,height:C.offsetHeight}}var B=C.style;var F=B.visibility;var D=B.position;var A=B.display;B.visibility="hidden";B.position="absolute";B.display="block";var H=C.clientWidth;var E=C.clientHeight;B.display=A;B.position=D;B.visibility=F;return{width:H,height:E}},visible:function(A){return $_(A).style.display!="none"},hide:function(A){A=$_(A);A.style.display="none";return A},show:function(A){A=$_(A);A.style.display="";return A},setStyle:function(A,B){return $(A).setStyles(B)},hasClassName:function(A,B){A=$_(A);return A.className.contains(B," ")},addClassName:function(A,B){A=$_(A);if(!Element.hasClassName(A,B)){A.className=(A.className+" "+B).clean()}return A},removeClassName:function(A,B){A=$_(A);A.className=A.className.replace(new RegExp("(^|\\s)"+B+"(?:\\s|$)"),"$1").clean();return A},remove:function(A){return $(A).remove()},update:function(B,A){$_(B).innerHTML=A}});Date.implement({getMonthName:function(){var A=[_("January"),_("February"),_("March"),_("April"),_("May"),_("June"),_("July"),_("August"),_("September"),_("October"),_("November"),_("December")];return A[this.getMonth()]},getShortMonthName:function(){var A=[_("Jan"),_("Feb"),_("Mar"),_("Apr"),_("May"),_("Jun"),_("Jul"),_("Aug"),_("Sep"),_("Oct"),_("Nov"),_("Dec")];return A[this.getMonth()]},getDayName:function(){var A=[_("Sunday"),_("Monday"),_("Tuesday"),_("Wednesday"),_("Thursday"),_("Friday"),_("Saturday")];return A[this.getDay()]},getShortDayName:function(){var A=[_("Sun"),_("Mon"),_("Tue"),_("Wed"),_("Thu"),_("Fri"),_("Sat")];return A[this.getDay()]},toTranslatedString:function(B){if(typeof B=="undefined"){B="mediumdate"}var D=this.getHours();if(D<10){D="0"+D}var A=this.getMinutes();if(A<10){A="0"+A}switch(B){case"shortday":if(this.getFullYear()!=new Date().getFullYear()){return _("{0} {1}, {2}").format(this.getShortMonthName(),this.getDate(),this.getFullYear())}else{return _("{0} {1}").format(this.getShortMonthName(),this.getDate())}case"shorttime":return _("{0}:{1}").format(D,A);case"mediumdate":return _("{0} {1} {2}, {3} {4}:{5}").format(this.getShortDayName(),this.getShortMonthName(),this.getDate(),this.getFullYear(),D,A);case"longdate":var C=this.getSeconds();if(C<10){C="0"+C}switch(this.getDate()){case 1:case 21:case 31:var E="st";break;case 2:case 22:var E="nd";break;case 3:case 23:var E="rd";break;default:var E="th"}return _("{0}, {1} {2}{3}, {4} {5}:{6}:{7}").format(this.getDayName(),this.getMonthName(),this.getDate(),E,this.getFullYear(),D,A,C)}}});$extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,pointerX:function(A){if(!A.$extended){A=new Event(A)}return A.page.x||(A.client.y+(document.documentElement.scrollLeft||document.body.scrollLeft))},pointerY:function(A){if(!A.$extended){A=new Event(A)}return A.page.y||(A.client.y+(document.documentElement.scrollTop||document.body.scrollTop))},element:function(A){return A.target||new Event(A).target},stop:function(A){if(!A||!A.$extended){A=new Event(A)}A.stop()},findElement:function(C,B){var A=C.target||new Event(C).target;while(A.parentNode&&(!A.tagName||(A.tagName.toUpperCase()!=B.toUpperCase()))){A=A.parentNode}return A},observe:function(D,C,B,A){D=$_(D);if(C=="keypress"&&$defined(window.webkit)){C="keydown"}$(D).addEvent(C,B)},stopObserving:function(D,C,B,A){$(D).removeEvent(C,B)}});Request.implement({check:function(A){if($type(this.options.url)!="string"||this.options.url.substr(0,1)=="["){return false}if(!this.running){return true}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(A.bind(this,Array.slice(arguments,1)));return false}return false}});var Ajax={};Ajax.Request=new Class({initialize:function(B,A){A.url=B;if(A.method){A.method=A.method.toLowerCase()}A.data=A.parameters||A.postBody||"";if(A.onComplete){this.onCompleteFunction=A.onComplete;A.onComplete=this.onComplete.bind(this)}if(A.onSuccess){this.onSuccessFunction=A.onSuccess;A.onSuccess=this.onSuccess.bind(this)}if(A.onFailure){this.onFailureFunction=A.onFailure;A.onFailure=this.onFailure.bind(this)}this.ajax=new Request(A).send()},onSuccess:function(){if(this.onSuccessFunction&&this.ajax.isSuccess()){this.onSuccessFunction(this.ajax.xhr)}},onComplete:function(){if(this.onCompleteFunction){this.onCompleteFunction(this.ajax.xhr)}},onFailure:function(){if(this.onFailureFunction&&!this.ajax.isSuccess()){this.onFailureFunction(this.ajax.xhr)}},request:function(A){this.ajax.send(A)}});PeriodicalExecuter=new Class({initialize:function(B,A){this.callback=B;this.frequency=A;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},stop:function(){if(!this.timer){return }clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.callback(this)}finally{this.currentlyExecuting=false}}}});var Form={getElements:function(A){return $(A).getElements("input, textarea, select")}};var Position={cumulativeOffset:function(B){var A=0,C=0;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;B=B.offsetParent}while(B);return[C,A]},page:function(D){var A=0,C=0;var B=D;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;if(B.offsetParent==document.body){if(B.getStyle("position")=="absolute"){break}}}while(B=B.offsetParent);B=D;do{if(!window.opera||B.tagName=="BODY"){A-=B.scrollTop||0;C-=B.scrollLeft||0}}while(B=B.parentNode);return[C,A]},clone:function(C,E){var A=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});C=$(C);var D=Position.page(C);E=$(E);var F=[0,0];var B=null;if(E.getStyle("position")=="absolute"){B=Position.offsetParent(E);F=Position.page(B)}if(B==document.body){F[0]-=document.body.offsetLeft;F[1]-=document.body.offsetTop}if(A.setLeft){E.style.left=(D[0]-F[0]+A.offsetLeft)+"px"}if(A.setTop){E.style.top=(D[1]-F[1]+A.offsetTop)+"px"}if(A.setWidth){E.style.width=C.offsetWidth+"px"}if(A.setHeight){E.style.height=C.offsetHeight+"px"}},offsetParent:function(A){if(A.offsetParent){return A.offsetParent}if(A==document.body){return A}while((A=A.parentNode)&&A!=document.body){if(A.getStyle("position")!="static"){return A}}return document.body},within:function(B,A,C){this.xcomp=A;this.ycomp=C;this.offset=this.cumulativeOffset(B);return(C>=this.offset[1]&&C<this.offset[1]+B.offsetHeight&&A>=this.offset[0]&&A<this.offset[0]+B.offsetWidth)}};;
var md5=function(R){function j(G,F){return(G<<F)|(G>>>(32-F))}function i(a,G){var c,F,I,b,H;I=(a&2147483648);b=(G&2147483648);c=(a&1073741824);F=(G&1073741824);H=(a&1073741823)+(G&1073741823);if(c&F){return(H^2147483648^I^b)}if(c|F){if(H&1073741824){return(H^3221225472^I^b)}else{return(H^1073741824^I^b)}}else{return(H^I^b)}}function Q(F,H,G){return(F&H)|((~F)&G)}function P(F,H,G){return(F&G)|(H&(~G))}function O(F,H,G){return(F^H^G)}function M(F,H,G){return(H^(F|(~G)))}function T(H,G,AA,z,F,I,k){H=i(H,i(i(Q(G,AA,z),F),k));return i(j(H,I),G)}function B(H,G,AA,z,F,I,k){H=i(H,i(i(P(G,AA,z),F),k));return i(j(H,I),G)}function f(H,G,AA,z,F,I,k){H=i(H,i(i(O(G,AA,z),F),k));return i(j(H,I),G)}function S(H,G,AA,z,F,I,k){H=i(H,i(i(M(G,AA,z),F),k));return i(j(H,I),G)}function A(a){var d;var I=a.length;var H=I+8;var G=(H-(H%64))/64;var c=(G+1)*16;var k=Array(c-1);var F=0;var b=0;while(b<I){d=(b-(b%4))/4;F=(b%4)*8;k[d]=(k[d]|(a.charCodeAt(b)<<F));b++}d=(b-(b%4))/4;F=(b%4)*8;k[d]=k[d]|(128<<F);k[c-2]=I<<3;k[c-1]=I>>>29;return k}function Z(H){var G="",I="",a,F;for(F=0;F<=3;F++){a=(H>>>(F*8))&255;I="0"+a.toString(16);G=G+I.substr(I.length-2,2)}return G}function h(G){G=G.replace(/\r\n/g,"\n");var F="";for(var I=0;I<G.length;I++){var H=G.charCodeAt(I);if(H<128){F+=String.fromCharCode(H)}else{if((H>127)&&(H<2048)){F+=String.fromCharCode((H>>6)|192);F+=String.fromCharCode((H&63)|128)}else{F+=String.fromCharCode((H>>12)|224);F+=String.fromCharCode(((H>>6)&63)|128);F+=String.fromCharCode((H&63)|128)}}}return F}var e=Array();var o,D,g,U,C,y,w,v,u;var r=7,p=12,m=17,l=22;var Y=5,X=9,W=14,V=20;var N=4,L=11,K=16,J=23;var t=6,s=10,q=15,n=21;R=h(R);e=A(R);y=1732584193;w=4023233417;v=2562383102;u=271733878;for(o=0;o<e.length;o+=16){D=y;g=w;U=v;C=u;y=T(y,w,v,u,e[o+0],r,3614090360);u=T(u,y,w,v,e[o+1],p,3905402710);v=T(v,u,y,w,e[o+2],m,606105819);w=T(w,v,u,y,e[o+3],l,3250441966);y=T(y,w,v,u,e[o+4],r,4118548399);u=T(u,y,w,v,e[o+5],p,1200080426);v=T(v,u,y,w,e[o+6],m,2821735955);w=T(w,v,u,y,e[o+7],l,4249261313);y=T(y,w,v,u,e[o+8],r,1770035416);u=T(u,y,w,v,e[o+9],p,2336552879);v=T(v,u,y,w,e[o+10],m,4294925233);w=T(w,v,u,y,e[o+11],l,2304563134);y=T(y,w,v,u,e[o+12],r,1804603682);u=T(u,y,w,v,e[o+13],p,4254626195);v=T(v,u,y,w,e[o+14],m,2792965006);w=T(w,v,u,y,e[o+15],l,1236535329);y=B(y,w,v,u,e[o+1],Y,4129170786);u=B(u,y,w,v,e[o+6],X,3225465664);v=B(v,u,y,w,e[o+11],W,643717713);w=B(w,v,u,y,e[o+0],V,3921069994);y=B(y,w,v,u,e[o+5],Y,3593408605);u=B(u,y,w,v,e[o+10],X,38016083);v=B(v,u,y,w,e[o+15],W,3634488961);w=B(w,v,u,y,e[o+4],V,3889429448);y=B(y,w,v,u,e[o+9],Y,568446438);u=B(u,y,w,v,e[o+14],X,3275163606);v=B(v,u,y,w,e[o+3],W,4107603335);w=B(w,v,u,y,e[o+8],V,1163531501);y=B(y,w,v,u,e[o+13],Y,2850285829);u=B(u,y,w,v,e[o+2],X,4243563512);v=B(v,u,y,w,e[o+7],W,1735328473);w=B(w,v,u,y,e[o+12],V,2368359562);y=f(y,w,v,u,e[o+5],N,4294588738);u=f(u,y,w,v,e[o+8],L,2272392833);v=f(v,u,y,w,e[o+11],K,1839030562);w=f(w,v,u,y,e[o+14],J,4259657740);y=f(y,w,v,u,e[o+1],N,2763975236);u=f(u,y,w,v,e[o+4],L,1272893353);v=f(v,u,y,w,e[o+7],K,4139469664);w=f(w,v,u,y,e[o+10],J,3200236656);y=f(y,w,v,u,e[o+13],N,681279174);u=f(u,y,w,v,e[o+0],L,3936430074);v=f(v,u,y,w,e[o+3],K,3572445317);w=f(w,v,u,y,e[o+6],J,76029189);y=f(y,w,v,u,e[o+9],N,3654602809);u=f(u,y,w,v,e[o+12],L,3873151461);v=f(v,u,y,w,e[o+15],K,530742520);w=f(w,v,u,y,e[o+2],J,3299628645);y=S(y,w,v,u,e[o+0],t,4096336452);u=S(u,y,w,v,e[o+7],s,1126891415);v=S(v,u,y,w,e[o+14],q,2878612391);w=S(w,v,u,y,e[o+5],n,4237533241);y=S(y,w,v,u,e[o+12],t,1700485571);u=S(u,y,w,v,e[o+3],s,2399980690);v=S(v,u,y,w,e[o+10],q,4293915773);w=S(w,v,u,y,e[o+1],n,2240044497);y=S(y,w,v,u,e[o+8],t,1873313359);u=S(u,y,w,v,e[o+15],s,4264355552);v=S(v,u,y,w,e[o+6],q,2734768916);w=S(w,v,u,y,e[o+13],n,1309151649);y=S(y,w,v,u,e[o+4],t,4149444226);u=S(u,y,w,v,e[o+11],s,3174756917);v=S(v,u,y,w,e[o+2],q,718787259);w=S(w,v,u,y,e[o+9],n,3951481745);y=i(y,D);w=i(w,g);v=i(v,U);u=i(u,C)}var E=Z(y)+Z(w)+Z(v)+Z(u);return E.toLowerCase()};;
String.sanitize=function(A){return A.replace(/ /g,"_").replace(/[éèêë]/g,"e")};String.toAnchor=function(A){return A.unescapeHTML().replace(/ /g,"_").replace(/[éèêë]/g,"e")};String.isEmail=function(B){var A=/^([a-zA-Z0-9_.\-+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;return A.test(B)};String.parseQuery=function(C){var A={};if(C){var B=C.split(/[&;]/);if(B.length){B.each(function(E){var D=E.split("=");if(D.length&&D.length==2){A[decodeURIComponent(D[0])]=decodeURIComponent(D[1])}})}}return A};String.prototype.truncate=function(B,A){B=B||30;A=A===undefined?"...":A;return this.length>B?this.slice(0,B-A.length)+A:this};String.format=function(B){var A=Array.prototype.slice.call(arguments,1);return B.replace(/\{(\d+)\}/g,function(C,D){return A[D]})};String.prototype.format=function(){var A=arguments;return this.replace(/\{(\d+)\}/g,function(B,C){return A[C]})};String.prototype.s=function(){var A=arguments,B=-1;return this.replace(/%s/g,function(C){return A[++B]||C})};String.highlight=function(H,J,G){if(typeof H!="string"){return H}if(typeof G=="undefined"){G=false}highlightStartTag='<span class="highlight"><b>';highlightEndTag="</b></span>";var D="";var C=-1;var E=[];var K=H.toLowerCase();J=J.toLowerCase();E.push(J);if(J.indexOf("&")!=-1){var I=J.replace(/&/g,"&amp;");E.push(I)}var L=J.length;if(G){var C,F=0;for(var B=0;B<L;B++){C=0;while(C>-1){C=K.indexOf(E[B],C);if(C==-1){break}C+=1;F+=1}if(F>0){return F}}return false}while(H.length>0){var A=C+1;for(var B=0;B<L;B++){search=E[B];C=K.indexOf(search,A);if(C!=-1){break}}if(C<0){D+=H;break}if(H.lastIndexOf(">",C)<H.lastIndexOf("<",C)){continue}if(K.lastIndexOf("/script>",C)<K.lastIndexOf("<script",C)){continue}D+=H.substring(0,C)+highlightStartTag+H.substr(C,search.length)+highlightEndTag;H=H.substr(C+search.length);K=H.toLowerCase();C=-1}return D};String.prototype.htmlentities=function(){var D=this;var C=[];C["38"]="&amp;";C["60"]="&lt;";C["62"]="&gt;";C["160"]="&nbsp;";C["161"]="&iexcl;";C["162"]="&cent;";C["163"]="&pound;";C["164"]="&curren;";C["165"]="&yen;";C["166"]="&brvbar;";C["167"]="&sect;";C["168"]="&uml;";C["169"]="&copy;";C["170"]="&ordf;";C["171"]="&laquo;";C["172"]="&not;";C["173"]="&shy;";C["174"]="&reg;";C["175"]="&macr;";C["176"]="&deg;";C["177"]="&plusmn;";C["178"]="&sup2;";C["179"]="&sup3;";C["180"]="&acute;";C["181"]="&micro;";C["182"]="&para;";C["183"]="&middot;";C["184"]="&cedil;";C["185"]="&sup1;";C["186"]="&ordm;";C["187"]="&raquo;";C["188"]="&frac14;";C["189"]="&frac12;";C["190"]="&frac34;";C["191"]="&iquest;";C["192"]="&Agrave;";C["193"]="&Aacute;";C["194"]="&Acirc;";C["195"]="&Atilde;";C["196"]="&Auml;";C["197"]="&Aring;";C["198"]="&AElig;";C["199"]="&Ccedil;";C["200"]="&Egrave;";C["201"]="&Eacute;";C["202"]="&Ecirc;";C["203"]="&Euml;";C["204"]="&Igrave;";C["205"]="&Iacute;";C["206"]="&Icirc;";C["207"]="&Iuml;";C["208"]="&ETH;";C["209"]="&Ntilde;";C["210"]="&Ograve;";C["211"]="&Oacute;";C["212"]="&Ocirc;";C["213"]="&Otilde;";C["214"]="&Ouml;";C["215"]="&times;";C["216"]="&Oslash;";C["217"]="&Ugrave;";C["218"]="&Uacute;";C["219"]="&Ucirc;";C["220"]="&Uuml;";C["221"]="&Yacute;";C["222"]="&THORN;";C["223"]="&szlig;";C["224"]="&agrave;";C["225"]="&aacute;";C["226"]="&acirc;";C["227"]="&atilde;";C["228"]="&auml;";C["229"]="&aring;";C["230"]="&aelig;";C["231"]="&ccedil;";C["232"]="&egrave;";C["233"]="&eacute;";C["234"]="&ecirc;";C["235"]="&euml;";C["236"]="&igrave;";C["237"]="&iacute;";C["238"]="&icirc;";C["239"]="&iuml;";C["240"]="&eth;";C["241"]="&ntilde;";C["242"]="&ograve;";C["243"]="&oacute;";C["244"]="&ocirc;";C["245"]="&otilde;";C["246"]="&ouml;";C["247"]="&divide;";C["248"]="&oslash;";C["249"]="&ugrave;";C["250"]="&uacute;";C["251"]="&ucirc;";C["252"]="&uuml;";C["253"]="&yacute;";C["254"]="&thorn;";C["255"]="&yuml;";for(var B in C){var A=C[B];var E=String.fromCharCode(B);D=D.split(E).join(A)}return D};;
Smiley={list:{"(love)":"love","(yummy)":"miam","(blush)":"redden","(yawn)":"yawn","(puke)":"vomito",":@":"furax","|-)":"zzz",":d":"great_smile",":D":"great_smile",":p":"tongue_out",":P":"tongue_out",":)":"smile",";(":"cry","8)":"cool",":o":"surprised",":O":"surprised",":(":"sad","8|":"intello",";)":"wink",":\\":"undecided",":X":"silence",":x":"silence",":|":"without_voice","(cocktail)":"cocktail","(wine)":"wine","(beer)":"beer","(cola)":"coca","(coffee)":"coffee","(starbucks)":"starbucks","(roll)":"roll","(donut)":"donut","(egg)":"egg","(burger)":"burger","(fries)":"fries","(steak)":"steak","(sushi)":"sushi","(chicken)":"chicken","(eat)":"eat","(birthday)":"birthday","(fire)":"fire","(gun)":"gun","(foot)":"foot","(ladybug)":"ladybug","(bikini)":"bikini","(heart)":"heart","(phone)":"phone"},cache:false,path:NV_STATIC+"/modules/wall/smiley/{0}.gif?v=1001",detect:function(A){if(typeof A=="undefined"){A=".smiley"}var C=$$(A);for(var B=0,D;D=C[B];B++){D.set("html",Smiley.replace(D.get("text")));D.removeClass("smiley")}},replace:function(C){if(!Smiley.cache){Smiley.cache=new Array();for(var B in Smiley.list){Smiley.cache.push({regexp:new RegExp(B.escapeRegExp(),"g"),img:'<img title="'+B+'" alt="'+B+'" class="smiley" src="'+Smiley.path.replace("{0}",Smiley.list[B])+'" width="16" height="16" />'})}}for(var A=0,B;B=Smiley.cache[A];A++){C=C.replace(B.regexp,B.img)}return C}};;
Array.prototype.normalize=function(E,B){var A=0;var D=E/this.inject(0,function(F,G){return F+G});for(var C=0;C<this.length-1;C++){A+=(this[C]*=D);if(B){this[C]=this[C].round(B)}}this[this.length-1]=B?(E-A).round(B):E-A};if(!Array.prototype.equals){Array.prototype.equals=function(C){if(!C){return false}var A=this.length;if(A!=C.length){return false}for(var B=0;B<A;B++){if(this[B]!=C[B]){return false}}return true}};;
var Utils={};Utils.getChildrenByTagName=function(D,B){var C=(D&&D.childNodes)?D.childNodes.length:0;var A=[];for(var E=0;E<C;E++){if(D.childNodes[E].nodeName==B){A.push(D.childNodes[E])}}return A};Utils.getSafeUrl=function(C,A,G){if(typeof A=="undefined"){A=true}if(typeof G=="undefined"){G=false}var F;if(C.substr(0,7)=="http://"){F=7}else{if(C.substr(0,8)=="https://"){F=8}else{F=7;C="http://"+C}}if(!A){return C}var E=C.substr(F).indexOf("/");host=C.substr(F,E-F);var D=host.indexOf("@");if(D!=-1){var B=host.substr(0,D).indexOf(":");if(G){B=0;D+=1}if(B!=-1){host=host.substr(0,B)+host.substr(D);C=C.substr(0,F)+host+C.substr(E)}}return C};Utils.redirect=function(B,C,A){if(B&&B.href){new Request().post("/proxy/ajaxProxy.php","url="+encodeURIComponent("http://track.netvibes.com/?module="+C+"&uri="+B.href+"&referrer="+window.location.href+"&reg="+(App.registeredUser?"1":"0")));if(!A){window.open(B.href)}else{window.location.href=B.href}}};var ua=navigator.userAgent.toLowerCase();Browser.isMozilla=(typeof document.implementation!="undefined")&&(typeof document.implementation.createDocument!="undefined")&&(typeof HTMLDocument!="undefined");Browser.isIE=window.ActiveXObject?true:false;Browser.isFirefox=(ua.indexOf("firefox")!=-1)||(ua.indexOf("iceweasel")!=-1)||(ua.indexOf("minefield")!=-1);Browser.isSafari=(ua.indexOf("safari")!=-1);Browser.isOpera=(typeof window.opera!="undefined");Browser.isKonqueror=(ua.indexOf("konqueror")!=-1);Browser.isChrome=(ua.indexOf("chrome")!=-1);Browser.isWindows=Browser.Platform.win;Browser.isMacOS=Browser.Platform.mac;Browser.isLinux=Browser.Platform.linux;if(Browser.isMozilla){HTMLElement.prototype.removeNode=function(){this.parentNode.removeChild(this)}}Browser.os="unknown";Browser.osVersion="unknown";Browser.name="unknown";Browser.version=1;if(Browser.isFirefox){Browser.name="firefox";if(ua.indexOf("minefield")!=-1){Browser.version=3}else{Browser.version=parseFloat(ua.substr(ua.indexOf("firefox")+8,3))}}else{if(Browser.isOpera){Browser.name="opera";if(window.opera.version){Browser.version=parseInt(parseFloat(window.opera.version())*10)/10}else{Browser.version=7.5}}else{if(Browser.isIE){Browser.name="msie";var re=new RegExp("msie ([0-9]{1,}[.0-9]{0,})");if(re.exec(ua)!=null){Browser.version=parseInt(RegExp.$1,10)}else{Browser.version=3}}else{if(Browser.isSafari){Browser.name="safari";var kitName="applewebkit/";var kitVersion=ua.substring(ua.indexOf(kitName)+kitName.length,ua.length);kitVersion=parseInt(kitVersion.substring(0,kitVersion.indexOf(" ")));Browser.version=kitVersion>=500?3:kitVersion>=400?2:kitVersion>=300?1.3:kitVersion>100?1.2:1}else{if(Browser.isKonqueror){Browser.name="konqueror";var khtmlName="konqueror/";var khtmlVersion=ua.substring(ua.indexOf(khtmlName)+khtmlName.length,ua.length);Browser.version=parseFloat(khtmlVersion.substring(0,khtmlVersion.indexOf(";")))}}}}}if(Browser.isLinux){Browser.os="linux";if(ua.indexOf("ubuntu")>-1){Browser.osVersion="ubuntu"}else{if(ua.indexOf("suse")>-1){Browser.osVersion="suse"}else{if(ua.indexOf("fedora")>-1){Browser.osVersion="fedora"}else{if(ua.indexOf("debian")>-1){Browser.osVersion="debian"}}}}}else{if(Browser.isMacOS){Browser.os="macos";if(ua.indexOf("mac os x")>-1){Browser.osVersion="x"}else{if(ua.indexOf("iphone")>-1){Browser.osVersion="iphone"}}}else{if(Browser.isWindows){Browser.os="windows";if(ua.indexOf("windows nt 5.1")>-1){Browser.osVersion="xp"}else{if(ua.indexOf("windows nt 5.0")>-1){Browser.osVersion="2000"}else{if(ua.indexOf("windows nt 6.0")>-1){Browser.osVersion="vista"}else{if(ua.indexOf("windows nt 6.1")>-1){Browser.osVersion="seven"}else{if(ua.indexOf("windows nt")>-1){Browser.osVersion="nt"}else{if(ua.indexOf("windows 98")>-1){Browser.osVersion="98"}else{if(ua.indexOf("windows 95")>-1){Browser.osVersion="95"}}}}}}}}}}Browser.getDocumentWidth=function(){return(document.documentElement&&document.documentElement.scrollWidth)||document.body.scrollWidth};Browser.getDocumentHeight=function(){return(document.documentElement&&document.documentElement.scrollHeight)||document.body.scrollHeight};Browser.getClientWidth=function(){return(window.innerWidth||(document.documentElement&&document.documentElement.clientWidth)||(document.body&&document.body.clientWidth)||0)};Browser.getClientHeight=function(){return(window.innerHeight||(document.documentElement&&document.documentElement.clientHeight)||(document.body&&document.body.clientHeight)||0)};Browser.getScrollTop=function(){return(document.documentElement&&document.documentElement.scrollTop)||(document.body&&document.body.scrollTop)||0};Browser.getScrollLeft=function(){return(document.documentElement&&document.documentElement.scrollLeft)||(document.body&&document.body.scrollLeft)||0};if(!Object.prototype.hasOwnProperty){Object.prototype.hasOwnProperty=function(B){try{var A=this.constructor.prototype;while(A){if(A[B]==this[B]){return false}A=A.prototype}}catch(C){}return true}}document.setActiveStyleSheet=function(D){var A=document.getElementsByTagName("link");for(var B=0,C;C=A[B];B++){if(C.getAttribute("rel").indexOf("style")!=-1&&C.getAttribute("title")){C.disabled=true;if(C.getAttribute("title")==D){C.disabled=false}}}};document.getActiveStyleSheet=function(){var A=document.getElementsByTagName("link");for(var B=0,C;C=A[B];B++){if(C.getAttribute("rel").indexOf("style")!=-1&&C.getAttribute("title")&&!C.disabled){return C}}return null};function hex2dec(C){var D="0123456789ABCDEF";var B=0;for(var A=C.length-1;A>=0;A--){B+=Math.pow(16,C.length-A-1)*D.indexOf(C.charAt(A))}return B}if(typeof _!="function"){_=function(A){return A}};;
var proxyURL=NV_PATH+"proxy/xmlProxy.php?url=";var feedProxyURL=NV_PATH+"proxy/feedProxy.php?url=";var ecosystemURL="http://"+NV_ECO+"/";App.UI={};Netvibes={};Netvibes.UI={};Netvibes.UI._idIncrement=0;Netvibes.UI.createIcon=function(B,E,D,A,C){if(typeof C=="undefined"){return new Element("img",{src:App.getStaticUrl("/img/s.gif"),"class":"icon "+B,alt:E,title:E,width:D,height:A})}else{return'<img src="'+App.getStaticUrl("/img/s.gif")+'" width="'+D+'" height="'+A+'" class="icon '+B+'" alt="'+E+'" title="'+E+'" />'}};Netvibes.UI.createIconText=function(B,D,C,A){if(App.pageCustom.iconType=="img"){return new Element("img",{src:App.getStaticUrl("/img/s.gif"),"class":"icon "+B,alt:D,title:D,width:C,height:A})}else{return new Element("a",{href:"javascript:void(0)","class":"iconText "+B,text:D})}};if(App.visit&&!App.myUniverse){App.staticUniverse=true}User.feedsId=null;App.moduleList=[];var appLocation=window.location.href;var URLDomain=appLocation.substring(0,appLocation.indexOf("/",7));if(!URLDomain){URLDomain=appLocation}App.location=URLDomain;App.selectedTab=App.selectedTab||0;App.selectedTabObj=null;App.tabList=[];App.tabEditing=-1;App.tabTop=80;App.tabBottom=100;App.tabDrag=null;App.pageCustom={};App.draggingItem=false;Function.empty=function(){};App.isPremium=function(){return(typeof App.premium!="undefined"&&App.premium)};App.isSmartReader=(App.viewType==2)&&App.use_feedbackend;App.getStaticUrl=function(A){return NV_STATIC+A};App.getPageById=function(C){for(var B=0,A=App.pageList.length;B<A;B++){if(App.pageList[B].pid==C){return App.pageList[B]}}return null};App.getGmtOffset=function(){var D=new Date();var H=new Date(D.getFullYear(),0,1,0,0,0,0);var G=new Date(D.getFullYear(),6,1,0,0,0,0);var C=H.toGMTString();var F=new Date(C.substring(0,C.lastIndexOf(" ")-1));var C=G.toGMTString();var E=new Date(C.substring(0,C.lastIndexOf(" ")-1));var B=(H-F)/(1000*60*60);var A=(G-E)/(1000*60*60);if(A==B){return B}return A};App.runOnline=function(A){if(Browser.isIE&&Browser.version<=7){new Request({method:"head",url:"/img/s.gif",onSuccess:function(){A()}}).send()}else{if(navigator.onLine){A()}}};App.updateDynamicTheme=function(){App.runOnline(function(){var C=new Date().getHours();var A=document.getElementsByTagName("link");for(var B=0,D;D=A[B];B++){if(D.getAttribute("rel").indexOf("style")!=-1&&D.getAttribute("href").indexOf("custom")!=-1){var E=D.href.replace(/trait=\d+/,"trait="+C);if(D.href!=E){D.href=E}}}})};App.collapseAllModules=function(){var C=[];for(var B=0,A;A=App.moduleList[B];B++){if(A.dataObj.tab==App.selectedTab){if(A.dataObj.moduleName=="Meebo"){continue}A.collapse("nosave");C.push(A.dataObj.id)}}if(C.length>0){App.Request.saveUserData("page.collapseExpand",{data:{status:0,modules:C}})}};App.expandAllModules=function(){var C=[];for(var B=0,A;A=App.moduleList[B];B++){if(A.dataObj.tab==App.selectedTab){if(A.dataObj.moduleName=="Meebo"){continue}A.expand("nosave");C.push(A.dataObj.id)}}if(C.length>0){App.Request.saveUserData("page.collapseExpand",{data:{status:1,modules:C}})}};App.collapseExpand=function(C){var B=$("collapseExpand");var A=$(B.getElementsByTagName("img")[0]);if(B.rel=="collapse"){if(C){App.expandAllModules()}A.removeClass("actions-window-expand").addClass("actions-window-collapse");A.title=A.alt=_("Collapse all");B.rel="expand"}else{if(C){App.collapseAllModules()}A.removeClass("actions-window-collapse").addClass("actions-window-expand");A.title=A.alt=_("Expand all");B.rel="collapse"}};App.clearSelection=function(){try{if(window.getSelection){if(Browser.isSafari){window.getSelection().collapse()}else{window.getSelection().removeAllRanges()}}else{if(document.selection&&document.selection.clear){document.selection.clear()}}return true}catch(A){}};App.defaultSettings={showTitle:1,showFeedNav:1,rssSpace:0,hideFavIcons:0,dontPreload:1,keyboardNav:0,hideSearch:1,unreadPosition:"left",enableFx:1,searchTabShow:App.visit?0:1,searchTabInNewTab:0,searchTabAtTop:0,feedreaderMaximized:0,footerExpanded:1,iconType:"text"};App.FlashSupport={pluginType:null,fv:[0,0],init:function(){if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){App.FlashSupport.pluginType="npapi";var A=navigator.plugins["Shockwave Flash"].description;if(typeof A!="undefined"){A=A.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var B=parseInt(A.replace(/^(.*)\..*$/,"$1"),10);var E=/r/.test(A)?parseInt(A.replace(/^.*r(.*)$/,"$1"),10):0;App.FlashSupport.fv=[B,E]}}else{if(window.ActiveXObject){App.FlashSupport.pluginType="ax";try{var C=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(D){try{var C=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");App.FlashSupport.fv=[6,0];C.AllowScriptAccess="always"}catch(D){if(App.FlashSupport.fv[0]==6){return }}try{var C=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(D){}}if(typeof C=="object"){var A=C.GetVariable("$version");if(typeof A!="undefined"){A=A.replace(/^\S+\s+(.*)$/,"$1").split(",");App.FlashSupport.fv=[parseInt(A[0],10),parseInt(A[2],10)]}}}}}};window.addEvent("domready",App.FlashSupport.init);function findPosX(A){if(!A){return 0}var B=Position.cumulativeOffset(A);return B[0]}function findPosY(A){if(!A){return 0}var B=Position.cumulativeOffset(A);return B[1]}App.showHideState={};App.hide=function(){if($("sbox-window")){$("sbox-window").hide()}if($("sbox-overlay")){$("sbox-overlay").hide()}if($("nv-overlay")){$("nv-overlay").hide()}App.keyboardFocus="edit";if($("startMsg").style.display!="none"){App.showHideState.start=1;$("startMsg").style.display="none"}["shareModuleBalloon","modulePopupMenu","minitabsOptions","genericBalloon","pickupZone"].each(function(A){A=$(A);if(A){Element.hide(A)}});App.showHideState.app=1;$("application").style.display="none";$("top").style.display="none";App.Panel.close()};App.show=function(){App.keyboardFocus="module";$("siteInformation").style.display="none";if(App.showHideState.start){$("startMsg").style.display="block"}if(App.showHideState.app){if(!App.inSubscribePreview){$("application").style.display="block"}$("top").style.display="block"}App.showHideState={};if($("sbox-overlay")){$("sbox-overlay").show()}if($("nv-overlay")){$("nv-overlay").show()}};App.displaySiteInformation=function(C,B){function D(F,E){E.lastChild.innerHTML=F.responseText;if(B.id=="footerLink_feedback"){App.applyFeedbackEvents(E.lastChild)}}if(Browser.isMozilla){setTimeout(App.hide,1)}else{App.hide()}App.setBackButton();var A=$("siteInformation");A.style.display="block";A.innerHTML='<div style="margin-bottom:20px;text-align:center"><a id="backToPage" href="javascript:App.show()">« '+_("Back to my page")+'</a></div><div id="siteInformationFrame">'+_("Loading ...")+"</div>";App.Request.sendGET(C,D,A)};App.UI.getPagesDropDownList=function(B){if(!User.id){return""}var A='<select id="pageSelector" name="pid">';var D='<optgroup label="'+_("Private pages")+'">';App.pageList.each(function(F){var E=("www"!=F.brand)?"&#9658;":"";D+=(!App.subscribe&&F.pid==App.currentPage)?"":('<option value="'+F.pid+'">'+F.title+" "+E+"</option>")});D+="</optgroup>";var C="";if(User.universe){C+='<optgroup label="'+_("Public page")+'">';C+='<option value="'+User.universeId+'">http://'+NV_HOST+"/"+User.username+"</option>";C+="</optgroup>"}switch(B){case"top":A+=(C+D);break;case"hidden":A+=D;break;case"bottom":default:A+=(D+C);break}A+="</select>";return A};App.addNewFeed=function(F,E,D){var C;F=F.trim();if(D=="module"){return E("",F,D)}function A(G){if(G){var I=JSON.decode(G.responseText);if(I&&I.id){var H=[I.id]}else{var H=G.responseText.split(",")}}else{var H=[]}if(User.feedsId==null){User.feedsId=H[1]}E(C,F,H[0]);delete E;delete C}function B(G){var H=G.responseText.substr(0,1024);if(typeof D!="undefined"&&D!="rss"&&D!="feed"){return E(G,F,D)}else{if(H.indexOf("www.netvibes.com/api/")!=-1){return E(G,F,"api")}else{if(H.indexOf("www.netvibes.com/ns/")!=-1){return E(G,F,"uwa")}else{if(H.indexOf("nvFeed")!=-1){}else{if(H.toLowerCase().indexOf("<html")!=-1||H.indexOf('"code":200')!=-1){return E(G,F,"site")}else{if(H.indexOf("BEGIN")!=-1){return E(G,F,"webcal")}else{if(G.status==401||G.statusText.toLowerCase()=="unauthorized"||H.indexOf('"code":401')!=-1){return E(G,F,"auth")}else{if(G.responseText==""){return E(G,F)}}}}}}}}C=G;var J=new Feed(G);if(App.use_feedbackend){if(typeof J!=="undefined"&&!J.error){J=J.feeds[0]}else{return E(G)}}if(typeof J.error=="undefined"||!J.error){var I="title="+encodeURIComponent(J.title||"")+"&url="+encodeURIComponent(F)+"&link="+encodeURIComponent(J.htmlUrl||"")+"&content="+encodeURIComponent(J.description||"");if(App.visit&&App.visit.id){I+="&visit="+App.visit.id}App.Request.sendPOST(NV_API_PATH+"/feed/add?format=json",I,A)}else{A(null)}}url=(App.use_feedbackend)?NV_API_PATH+"/feed/preview?format=json&url="+encodeURIComponent(F):feedProxyURL+encodeURIComponent(F)+"&test=1";App.Request.sendGET(url,B)};App.getFaviconUrl=function(A){if(!A){return""}return App.getStaticUrl(NV_PATH+"proxy/favIcon.php?url="+encodeURIComponent(A))};App.getAvatarUrl=function(A){var A=A||48;return"http://"+NV_AVATARS+"/"+User.id+"/"+A+"?rnd="+Math.random()};App.Theme={refresh:function(A){Netvibes.Settings.Theme.Gallery.switchTo(App.pageCustom.themeUrl,App.pageCustom.themeTitle,A);Netvibes.Settings.Wallpaper.Header.update();Netvibes.Settings.Wallpaper.Body.update()},changeTheme:function(B,C){var A=document.getActiveStyleSheet();if(!A||B==A.href){return }$$("link").forEach(function(D){if(D.getAttribute("rel").indexOf("style")!=-1&&D.getAttribute("rel").indexOf("alt")==-1&&D.getAttribute("title")){D.remove()}});var C=C||"Netvibes's theme";new Element("link",{rel:"stylesheet",type:"text/css",href:B,title:C}).inject(document.head);setTimeout(function(){document.setActiveStyleSheet(C)},50)},undoTheme:function(){if(!$("NV_messageContainer")){new Element("div",{id:"NV_messageContainer"}).inject("divTabs","before")}var D=new App.UI.Message({className:"noteMessage",closeButton:null,text:_("Your theme has been changed. {0}Undo{1} | {2}Keep{3}").format('<a href="javascript:void(0)">',"</a>",'<a href="javascript:void(0)">',"</a>")}).addEvent("onClose",function(){delete App.pageCustom.undoTheme;App.savePageCustom()}).inject("NV_messageContainer","top");var C=D.box.getElements("a");if(C.length!=2){return }var A=C[0];var B=C[1];A.addEvent("click",function(){this.close();App.pageCustom=$merge(App.pageCustom,App.Theme.undoTheme.data);App.savePageCustom();App.Theme.refresh();delete App.Theme.undoTheme.data}.bind(D));B.addEvent("click",function(){this.close()}.bind(D));D.open()}};App.addIframes=function(){var A=$("iframes");var B=document.createElement("iframe");B.src=NV_STATIC+NV_PATH+"empty.txt";B.id="sessionFrame";B.style.width="1px";B.style.height="1px";B.style.border=0;B.style.visibility="hidden";A.appendChild(B);var D=document.createElement("iframe");D.src=NV_STATIC+NV_PATH+"empty.txt";D.id="upload_target";D.name="upload_target";D.style.width="1px";D.style.height="1px";D.style.border=0;D.style.visibility="hidden";A.appendChild(D);if(D.contentWindow){D.contentWindow.name="upload_target"}var C=document.createElement("iframe");C.src=NV_STATIC+NV_PATH+"empty.txt";C.id="commFrame";C.style.width="1px";C.style.height="1px";C.style.border=0;C.style.visibility="hidden";A.appendChild(C)};App.setBackButton=function(){try{var A=$("sessionFrame");var C=A.contentDocument;if(typeof C=="undefined"){if(typeof A=="undefined"||typeof A.contentWindow=="undefined"||typeof A.contentWindow.document=="undefined"){return false}C=A.contentWindow.document}C.open();C.write("<html><body></body></html>");C.close()}catch(B){return false}};App.swapLang=function(A){location.href=NV_PATH+"?lang="+A};App.savePageCustomTimeout=null;App.savePageCustom=function(){if(App.staticUniverse){return false}if(App.savePageCustomTimeout){clearTimeout(App.savePageCustomTimeout)}App.savePageCustomTimeout=setTimeout(App.savePageCustomNow,1000)};App.savePageCustomNow=function(){if(App.staticUniverse){return false}var B=$unlink(App.pageCustom);for(var A in B){if(typeof A!="number"&&typeof A!="string"){B[A]=JSON.encode(A)}}App.Request.saveUserData("page.custom",{data:{arrData:B}})};App.saveUserCustom=function(){App.Request.saveUserData("user.custom",{data:{arrData:User.custom}})};App.insertCssFile=function(B){var E=document.getElementsByTagName("head")[0];if(!E){return false}var A=E.getElementsByTagName("link");for(var D=0;D<A.length;D++){if(A[D].getAttribute("type")=="text/css"&&A[D].getAttribute("href")==B){return false}}var C=document.createElement("link");C.setAttribute("type","text/css");C.setAttribute("rel","stylesheet");C.setAttribute("href",B);E.appendChild(C);return C};App.scrollPos=function(){var A;if(self.pageYOffset){A=self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){A=document.documentElement.scrollTop}else{if(document.body){A=document.body.scrollTop}else{A=0}}}return A};var icons_png="img/icons.png?v=8796";var tabicons_png="img/tabicons.png?v=8796";App.iconMapping={"img/aol.gif":[icons_png,2,2],"img/arrowList.gif":[icons_png,20,2],"img/blogmarksnet.png":[icons_png,38,2],"img/blogsearch.png":[icons_png,56,2],"img/bookmark.gif":[icons_png,74,2],"img/boxnet.png":[icons_png,92,2],"img/cart.gif":[icons_png,110,2],"img/clear.gif":[icons_png,128,2],"img/closeMod.gif":[icons_png,146,2],"img/closeTab.gif":[icons_png,164,2],"img/delicious.gif":[icons_png,2,20],"img/digg.gif":[icons_png,20,20],"img/ebay.gif":[icons_png,38,20],"img/eco.png":[icons_png,56,20],"img/edit.gif":[icons_png,74,20],"img/flickr.png":[icons_png,92,20],"img/foxsports.png":[icons_png,110,20],"img/gmail.gif":[icons_png,128,20],"img/hideMod.gif":[icons_png,146,20],"img/hideModBlue.gif":[icons_png,164,20],"img/ical.gif":[icons_png,2,38],"img/icons/new.gif":[icons_png,20,38],"img/icons/world.gif":[icons_png,38,38],"img/info.gif":[icons_png,56,38],"img/kelkoo.gif":[icons_png,74,38],"img/meebo.png":[icons_png,92,38],"img/note.gif":[icons_png,110,38],"img/next.gif":[icons_png,128,38],"img/previous.gif":[icons_png,146,38],"img/popmail.gif":[icons_png,164,38],"img/publish.png":[icons_png,2,56],"img/refresh.gif":[icons_png,20,56],"img/search.gif":[icons_png,38,56],"img/showMod.gif":[icons_png,56,56],"img/showModBlue.gif":[icons_png,74,56],"img/signin.gif":[icons_png,92,56],"img/signout.gif":[icons_png,110,56],"img/speaker.gif":[icons_png,128,56],"img/tabOptions.gif":[icons_png,146,56],"img/todolist.gif":[icons_png,164,56],"img/uwa.png":[icons_png,2,74],"img/video-player.gif":[icons_png,20,74],"img/wand.png":[icons_png,38,74],"img/weather.gif":[icons_png,56,74],"img/writely.gif":[icons_png,74,74],"img/yahoomail.gif":[icons_png,92,74],"modules/aolMail/img/aol.png":[icons_png,110,74],"modules/alexa/img/favicon.png":[icons_png,128,74],"modules/craigslist/favicon.png":[icons_png,146,74],"modules/externalWidget/img/icon-api.gif":[icons_png,164,74],"modules/hotmail/img/hotmail.png":[icons_png,2,92],"modules/imagesSearch/favicon.png":[icons_png,20,92],"modules/macMail/icone_mac.png":[icons_png,38,92],"modules/myspace/icon-myspace.gif":[icons_png,56,92],"modules/twitter/twitter.ico":[icons_png,74,92],"modules/zoho/zoho.ico":[icons_png,92,92],"img/eco.png":[tabicons_png,1,2],"img/favicon.png":[tabicons_png,19,2],"img/icons/anchor.gif":[tabicons_png,37,2],"img/icons/attach.gif":[tabicons_png,55,2],"img/icons/basket.gif":[tabicons_png,73,2],"img/icons/bomb.gif":[tabicons_png,91,2],"img/icons/book.gif":[tabicons_png,109,2],"img/icons/book_addresses.gif":[tabicons_png,127,2],"img/icons/book_open.gif":[tabicons_png,145,2],"img/icons/brick.gif":[tabicons_png,163,2],"img/icons/briefcase.gif":[tabicons_png,181,2],"img/icons/bug.gif":[tabicons_png,199,2],"img/icons/cake.gif":[tabicons_png,217,2],"img/icons/calendar_view_day.gif":[tabicons_png,235,2],"img/icons/calendar_view_month.gif":[tabicons_png,1,20],"img/icons/camera.gif":[tabicons_png,19,20],"img/icons/car.gif":[tabicons_png,37,20],"img/icons/cd.gif":[tabicons_png,55,20],"img/icons/chart_bar.gif":[tabicons_png,73,20],"img/icons/chart_curve.gif":[tabicons_png,91,20],"img/icons/chart_organisation.gif":[tabicons_png,109,20],"img/icons/chart_pie.gif":[tabicons_png,127,20],"img/icons/clock.gif":[tabicons_png,145,20],"img/icons/clock_red.gif":[tabicons_png,163,20],"img/icons/cog.gif":[tabicons_png,181,20],"img/icons/coins.gif":[tabicons_png,199,20],"img/icons/color_swatch.gif":[tabicons_png,217,20],"img/icons/comment.gif":[tabicons_png,235,20],"img/icons/computer.gif":[tabicons_png,1,38],"img/icons/connect.gif":[tabicons_png,19,38],"img/icons/creditcards.gif":[tabicons_png,37,38],"img/icons/door.gif":[tabicons_png,55,38],"img/icons/door_open.gif":[tabicons_png,73,38],"img/icons/drink.gif":[tabicons_png,91,38],"img/icons/drink_empty.gif":[tabicons_png,109,38],"img/icons/email.gif":[tabicons_png,127,38],"img/icons/email_open.gif":[tabicons_png,145,38],"img/icons/email_open_image.gif":[tabicons_png,163,38],"img/icons/emoticon_evilgrin.gif":[tabicons_png,181,38],"img/icons/emoticon_grin.gif":[tabicons_png,199,38],"img/icons/emoticon_happy.gif":[tabicons_png,217,38],"img/icons/emoticon_smile.gif":[tabicons_png,235,38],"img/icons/emoticon_surprised.gif":[tabicons_png,1,56],"img/icons/emoticon_tongue.gif":[tabicons_png,19,56],"img/icons/emoticon_unhappy.gif":[tabicons_png,37,56],"img/icons/emoticon_waii.gif":[tabicons_png,55,56],"img/icons/emoticon_wink.gif":[tabicons_png,73,56],"img/icons/exclamation.gif":[tabicons_png,91,56],"img/icons/eye.gif":[tabicons_png,109,56],"img/icons/feed.gif":[tabicons_png,127,56],"img/icons/flag_blue.gif":[tabicons_png,145,56],"img/icons/flag_green.gif":[tabicons_png,163,56],"img/icons/flag_orange.gif":[tabicons_png,181,56],"img/icons/flag_pink.gif":[tabicons_png,199,56],"img/icons/flag_purple.gif":[tabicons_png,217,56],"img/icons/flag_red.gif":[tabicons_png,235,56],"img/icons/flag_yellow.gif":[tabicons_png,1,74],"img/icons/folder.gif":[tabicons_png,19,74],"img/icons/heart.gif":[tabicons_png,37,74],"img/icons/house.gif":[tabicons_png,55,74],"img/icons/image.gif":[tabicons_png,73,74],"img/icons/information.gif":[tabicons_png,91,74],"img/icons/ipod.gif":[tabicons_png,109,74],"img/icons/keyboard.gif":[tabicons_png,127,74],"img/icons/layout.gif":[tabicons_png,145,74],"img/icons/lightbulb.gif":[tabicons_png,163,74],"img/icons/lightbulb_off.gif":[tabicons_png,181,74],"img/icons/lock.gif":[tabicons_png,199,74],"img/icons/lock_open.gif":[tabicons_png,217,74],"img/icons/lorry.gif":[tabicons_png,235,74],"img/icons/lorry_flatbed.gif":[tabicons_png,1,92],"img/icons/magnifier.gif":[tabicons_png,19,92],"img/icons/money.gif":[tabicons_png,37,92],"img/icons/money_dollar.gif":[tabicons_png,55,92],"img/icons/money_euro.gif":[tabicons_png,73,92],"img/icons/money_pound.gif":[tabicons_png,91,92],"img/icons/money_yen.gif":[tabicons_png,109,92],"img/icons/monitor.gif":[tabicons_png,127,92],"img/icons/mouse.gif":[tabicons_png,145,92],"img/icons/music.gif":[tabicons_png,163,92],"img/icons/new.gif":[tabicons_png,181,92],"img/icons/note.gif":[tabicons_png,199,92],"img/icons/page.gif":[tabicons_png,217,92],"img/icons/page_copy.gif":[tabicons_png,235,92],"img/icons/page_white.gif":[tabicons_png,1,110],"img/icons/page_white_acrobat.gif":[tabicons_png,19,110],"img/icons/page_white_code.gif":[tabicons_png,37,110],"img/icons/page_white_compressed.gif":[tabicons_png,55,110],"img/icons/page_white_excel.gif":[tabicons_png,73,110],"img/icons/page_white_flash.gif":[tabicons_png,91,110],"img/icons/page_white_php.gif":[tabicons_png,109,110],"img/icons/page_white_picture.gif":[tabicons_png,127,110],"img/icons/page_white_powerpoint.gif":[tabicons_png,145,110],"img/icons/page_white_text.gif":[tabicons_png,163,110],"img/icons/page_white_word.gif":[tabicons_png,181,110],"img/icons/page_white_world.gif":[tabicons_png,199,110],"img/icons/palette.gif":[tabicons_png,217,110],"img/icons/paste_plain.gif":[tabicons_png,235,110],"img/icons/pencil.gif":[tabicons_png,1,128],"img/icons/phone.gif":[tabicons_png,19,128],"img/icons/photo.gif":[tabicons_png,37,128],"img/icons/picture.gif":[tabicons_png,55,128],"img/icons/printer.gif":[tabicons_png,73,128],"img/icons/printer_empty.gif":[tabicons_png,91,128],"img/icons/rainbow.gif":[tabicons_png,109,128],"img/icons/rosette.gif":[tabicons_png,127,128],"img/icons/server.gif":[tabicons_png,145,128],"img/icons/shield.gif":[tabicons_png,163,128],"img/icons/sport_8ball.gif":[tabicons_png,181,128],"img/icons/sport_basketball.gif":[tabicons_png,199,128],"img/icons/sport_football.gif":[tabicons_png,217,128],"img/icons/sport_golf.gif":[tabicons_png,235,128],"img/icons/sport_raquet.gif":[tabicons_png,1,146],"img/icons/sport_shuttlecock.gif":[tabicons_png,19,146],"img/icons/sport_soccer.gif":[tabicons_png,37,146],"img/icons/sport_tennis.gif":[tabicons_png,55,146],"img/icons/star.gif":[tabicons_png,73,146],"img/icons/stop.gif":[tabicons_png,91,146],"img/icons/tag_blue.gif":[tabicons_png,109,146],"img/icons/tag_green.gif":[tabicons_png,127,146],"img/icons/tag_orange.gif":[tabicons_png,145,146],"img/icons/tag_pink.gif":[tabicons_png,163,146],"img/icons/tag_purple.gif":[tabicons_png,181,146],"img/icons/tag_red.gif":[tabicons_png,199,146],"img/icons/tag_yellow.gif":[tabicons_png,217,146],"img/icons/telephone.gif":[tabicons_png,235,146],"img/icons/television.gif":[tabicons_png,1,164],"img/icons/thumb_down.gif":[tabicons_png,19,164],"img/icons/thumb_up.gif":[tabicons_png,37,164],"img/icons/time.png":[tabicons_png,55,164],"img/icons/trash.gif":[tabicons_png,73,164],"img/icons/tux.gif":[tabicons_png,91,164],"img/icons/user.gif":[tabicons_png,109,164],"img/icons/user_female.gif":[tabicons_png,127,164],"img/icons/user_gray.gif":[tabicons_png,145,164],"img/icons/user_green.gif":[tabicons_png,163,164],"img/icons/user_orange.gif":[tabicons_png,181,164],"img/icons/user_red.gif":[tabicons_png,199,164],"img/icons/user_suit.gif":[tabicons_png,217,164],"img/icons/vcard.gif":[tabicons_png,235,164],"img/icons/weather_clouds.gif":[tabicons_png,1,182],"img/icons/weather_cloudy.gif":[tabicons_png,19,182],"img/icons/weather_lightning.gif":[tabicons_png,37,182],"img/icons/weather_rain.gif":[tabicons_png,55,182],"img/icons/weather_snow.gif":[tabicons_png,73,182],"img/icons/weather_sun.gif":[tabicons_png,91,182],"img/icons/world.gif":[tabicons_png,109,182],"img/icons/zoom.gif":[tabicons_png,127,182],"img/uwa.png":[tabicons_png,145,182]};App.iconMapper=function(A){if(typeof A=="undefined"){return false}if(A.substr(0,NV_STATIC.length)==NV_STATIC){A=A.substr(NV_STATIC.length)}if(A.substr(0,NV_PATH.length)==NV_PATH){A=A.substr(NV_PATH.length)}A=A.replace(/^http:\/\/.*\.?netvibes\.(com|local)\//,"");if(typeof App.iconMapping[A]!="undefined"){return App.iconMapping[A]}return false};App.notifyModuleThemeUpdated=function(D){for(var B=0,C=App.moduleList.length;B<C;B++){var A=App.moduleList[B];if(A.dataObj&&A.content&&typeof A.content.updateTheme=="function"){A.content.updateTheme(D)}}};App.historyManager=function(){if(App.lastAnchor==document.location.hash){return }if(App.FeedReader.isOpen){document.location.hash=App.lastAnchor;App.FeedReader.close();return }App.lastAnchor=document.location.hash;var A=document.location.hash.substr(1);if(A==""){return false}if(A==App.selectedTab||A==String.toAnchor(App.selectedTabObj.dataObj.title)){return }var C=App.tabList.length;for(var B=0;B<C;B++){if(A==App.tabList[B].dataObj.id||A==String.toAnchor(App.tabList[B].dataObj.title)){if(App.tabList[B].dataObj.id==App.selectedTab){return }App.tabList[B].switchTo()}}};App.lastAnchor=document.location.hash;if(!(Browser.isSafari&&Browser.version<3)){window.setInterval(App.historyManager,200)}onresizeTimeout=null;window.onresize=function(){if(App.ColManager&&App.ColManager.drag){return }if(onresizeTimeout){clearTimeout(onresizeTimeout)}onresizeTimeout=setTimeout(function(){if(App.FeedReader){App.FeedReader.resize()}if(App.ColManager){App.ColManager.updateLayout(true)}App.checkSmallDisplay()},200)};App.checkSmallDisplay=function(){if(typeof window.getSize=="function"){$(document.body)[window.getSize().x<=800?"addClass":"removeClass"]("smalldisplay")}};window.onunload=function(){try{var C=App.moduleList.length;for(var E=0;E<C;E++){try{if(App.moduleList[E].content&&typeof App.moduleList[E].content.unload=="function"){App.moduleList[E].content.unload()}if(typeof App.moduleList[E].unload=="function"){App.moduleList[E].unload()}App.moduleList[E].data=null;App.moduleList[E].content=null;App.moduleList[E].self=null;delete App.moduleList[E];App.moduleList[E]=null}catch(D){}}delete App.moduleList;App.moduleList=null;for(var E=1;E<=4;E++){var A=App.ColManager["col"+E];var C=A.childNodes.length;for(var B=0;B<C;B++){delete A.childNodes[B].dataObj}}delete App.ColManager;delete App.Modules;App.Modules=null;var C=App.tabList.length;for(var E=0;E<C;E++){try{if(typeof App.tabList[E].unload=="function"){App.tabList[E].unload()}App.tabList[E].data=null;App.tabList[E].self=null;delete App.tabList[E];App.tabList[E]=null}catch(D){}}delete App.tabList;App.tabList=null;delete App.selectedTabObj;App.selectedTabObj=null;delete App.pageCustom;App.pageCustom=null;delete App.FeedReader;App.FeedReader=null;delete App.keyboardHandler;App.keyboardHandler=null;delete tabOptions;if(App.enableStats){App.checkServerVersion(true)}delete App;App=null}catch(D){}};;
App.ColManager=null;App.Columns=Class.create();App.Columns.MAX_COLNUM=4;App.Columns.prototype={initialize:function(F,C){var A=this;this.setOptions(C);this.columnDivs=[];if(C.standalone){this.container=new Element("div",{id:"columns","class":"autoclear"})}else{this.container=$("columns")}this.drag=false;this.numCols=-1;this.columnSizes=[];this.layout="";if(this.options.standalone){for(var D=0;D<App.Columns.MAX_COLNUM;D++){this.createColumn()}F.appendChild(this.container)}this.columnDivs=this.container.getElements("div.column");for(var D=1;D<=4;D++){var E=this.columnDivs[D-1];E.setAttribute("colNum",D);this["col"+D]=E;var B=E.getNext();B.style.visibility=this.options.enableResize?"visible":"hidden";B.style.cursor=Browser.isMozilla?"ew-resize":"e-resize";B.addEvents({mouseover:function(){if(!A.drag){this.addClass("hover")}},mouseout:function(){if(!A.drag){this.removeClass("hover")}},mousedown:this.onResizeStart.bindWithEvent(this),dblclick:this.onResizeDblClick.bindWithEvent(this)})}},setOptions:function(A){this.options={enableResize:true,minWidth:140};Object.extend(this.options,A||{})},createColumn:function(){var A=this.columnDivs.length+1;var C=document.createElement("div");C.className="column"+(this.options.enableResize?" resizable":"");C.setAttribute("colNum",A);C.id="column0"+A;this["col"+A]=C;var B=function(E){var F=new Element("div",{"class":"gripper",id:"gripper-0"+E});if(this.options.enableResize){F.style.cursor=Browser.isMozilla?"ew-resize":"e-resize";var D=this;F.addEvents({mouseover:function(){if(!D.drag){Element.addClassName(this,"hover")}},mouseout:function(){if(!D.drag){Element.removeClassName(this,"hover")}},mousedown:this.onResizeStart.bindWithEvent(this),dblclick:this.onResizeDblClick.bindWithEvent(this)})}else{F.style.visibility="hidden"}this.container.appendChild(F)}.bind(this);if(A<=App.Columns.MAX_COLNUM){B(A)}this.container.appendChild(C);if(A==App.Columns.MAX_COLNUM){B(A+1)}this.columnDivs.push(C)},onResizeStart:function(E){var C=Event.element(E);this.drag=true;document.body.style.cursor=Browser.isMozilla?"ew-resize":"e-resize";this.resizeInfos={startX:Event.pointerX(E),gripper:$(C),originalSizes:[]};for(var D=0,B;B=App.ColManager.columnDivs[D];D++){this.resizeInfos.originalSizes[D]=B.getSize().x}var A=$("resize-iframeFix");if(A){Element.remove(A)}A=document.createElement("div");A.id="resize-iframeFix";A.style.position="absolute";A.style.top="0";A.style.right="0";A.style.width="100%";A.style.height="100%";A.style.visibility="hidden";A.onmousemove=this.onResizing.bindAsEventListener(this);document.body.appendChild(A);Event.observe(document,"mousemove",this.onResizing.bindAsEventListener(this));Event.observe(document,"mouseup",this.onResizeEnd.bindAsEventListener(this));Event.stop(E)},onResizing:function(D){if(!this.drag){return }var A=$("resize-iframeFix");if(A.style.visibility!="visible"){A.style.visibility="visible"}var F=Event.pointerX(D)-this.resizeInfos.startX;var C=this.resizeInfos.gripper.id.match(/gripper-\d(\d)/)[1].toInt();var E=function(I,L,H){var H=$merge({sideEffects:false,altIndices:null},H);var K=H.altIndices||[I-2,I-1];var G=[App.ColManager.columnDivs[K[0]],App.ColManager.columnDivs[K[1]]];if(H.altIndices){var J=[this.resizeInfos.originalSizes[2]-L/2,this.resizeInfos.originalSizes[3]-L/2]}else{var J=[this.resizeInfos.originalSizes[2]+L/2,this.resizeInfos.originalSizes[3]+L/2]}if((this.resizeInfos.originalSizes[K[0]]+L<this.options.minWidth||this.resizeInfos.originalSizes[K[1]]-L<this.options.minWidth)||(H.sideEffects?J[0]<this.options.minWidth||J[1]<this.options.minWidth:false)){this.resizeInfos.gripper.addClass("max");return }G[0].setStyle("width",this.resizeInfos.originalSizes[K[0]]+L);G[1].setStyle("width",this.resizeInfos.originalSizes[K[1]]-L);if(H.sideEffects){if(H.altIndices){App.ColManager.columnDivs[2].setStyle("width",J[0]);App.ColManager.columnDivs[3].setStyle("width",J[1])}else{App.ColManager.columnDivs[2].setStyle("width",J[0]);App.ColManager.columnDivs[3].setStyle("width",J[1])}}this.resizeInfos.gripper.removeClass("max")}.bind(this);var B={};if(App.selectedTabObj.dataObj.layout=="4-1"&&C==2){B.sideEffects=true}else{if(App.selectedTabObj.dataObj.layout=="4-4"){if(C==3){B.sideEffects=true;B.altIndices=[1,0]}else{B.altIndices=[3,2]}}}E(C,F,B);Event.stop(D)},onResizeEnd:function(C){if(!this.drag){return }this.drag=false;document.body.style.cursor="default";var A=$("resize-iframeFix");if(A){Element.remove(A)}Event.stopObserving(document,"mousemove",this.onResizing);Event.stopObserving(document,"mouseup",this.onResizeEnd);Element.removeClassName(this.resizeInfos.gripper,"hover");Element.removeClassName(this.resizeInfos.gripper,"max");var D=Event.pointerX(C)-this.resizeInfos.startX;if(Math.abs(D)<=1){return }var B=[];this.columnDivs.each(function(F,E){B[E]=Element.visible(F)?Element.getDimensions(F).width:0});this.columnSizes=App.selectedTabObj.dataObj.columnSizes=App.FlexiLayout.px2percent(B);this.saveLayout();App.Modules.notifyResize()},onResizeDblClick:function(){this.resetLayout();this.saveLayout()},resetLayout:function(B){for(var A=0;A<App.Columns.MAX_COLNUM;A++){this.columnSizes[A]=(A<this.numCols)?1:0}this.updateLayout(true);App.Modules.notifyResize();if(B){Event.stop(B)}},updateLayout:function(B){if(this.numCols<0){return }if(!this.columnSizes){this.columnSizes=[]}var E=App.FlexiLayout.classPrefix+"-"+(this.layout||App.subscribe.data.layout||(this.numCols+"-0"));if(this.container.className.search(/flexilayout-\d-\d/)==-1){this.container.addClass(E)}else{this.container.className=this.container.className.replace(/flexilayout-\d-\d/,E)}if(Browser.isIE){if(this.layout=="4-1"){if(!$("forceClearLeft")){new Element("br",{id:"forceClearLeft",styles:{clear:"left"}}).inject(App.ColManager.columnDivs[1],"after")}}else{if($("forceClearLeft")){$("forceClearLeft").remove()}}if(this.layout=="4-4"){if(!$("forceClearRight")){new Element("br",{id:"forceClearRight",styles:{clear:"right"}}).inject($("gripper-03")||App.ColManager.columnDivs[1],"after")}}else{if($("forceClearRight")){$("forceClearRight").remove()}}if(this.layout=="4-6"){if(!$("forecClearLeft")){new Element("br",{id:"forceClearRight",styles:{clear:"left"}}).inject($("gripper-03")||App.ColManager.columnDivs[1],"after")}}else{if($("forecClearLeft")){$("forecClearLeft").remove()}}}var F=false;for(var A=0;A<App.Columns.MAX_COLNUM;A++){this.columnSizes[A]=parseFloat(this.columnSizes[A],10);if(this.columnSizes[A]>100){F=true}if(!this.columnSizes[A]){this.columnSizes[A]=1}if((A+1)>this.numCols){this.columnSizes[A]=0}}var D=$A(this.columnSizes);if(F){if(App.FlexiLayout.isDefault()){D=this.columnSizes=App.selectedTabObj.dataObj.columnSizes=App.FlexiLayout.px2percent(D);this.saveLayout()}else{this.resetLayout();App.selectedTabObj.dataObj.columnSizes=[];this.saveLayout()}}for(var A=0,C;C=this.columnDivs[A];A++){if(D[A]<=0.01){D[A]=0}if(D[A]!=1&&D[A]!=0){C.style.width=D[A]+"%"}else{C.style.width=""}}if(B){App.Modules.notifyResize()}},saveLayout:function(B){var A=$A(this.columnSizes);if(B||!A.equals(App.selectedTabObj._savedColumnSizes)){App.Request.saveUserData("tab",{data:App.selectedTabObj.dataObj});App.selectedTabObj._savedColumnSizes=A}}};App.LayoutManager={};App.LayoutManager.canMovePositionUp=function(A){return(App.LayoutManager.getModulePosition(A)[1]>0&&App.FlexiLayout.isDefault())};App.LayoutManager.canMovePositionDown=function(A){var C=App.LayoutManager.getModulePosition(A);var B=App.ColManager["col"+A.dataObj.container];return((C[1]+1)<App.LayoutManager.getModulesByColumn(B).length&&App.FlexiLayout.isDefault())};App.LayoutManager.canMovePositionLeft=function(A){return(A.dataObj.container>1&&App.FlexiLayout.isDefault())};App.LayoutManager.canMovePositionRight=function(A){return(A.dataObj.container<App.selectedTabObj.dataObj.cols&&App.FlexiLayout.isDefault())};App.LayoutManager.movePositionUp=function(B){if(!App.LayoutManager.canMovePositionUp(B)){return false}var D=App.ColManager["col"+B.dataObj.container];var C=App.LayoutManager.getModulesByColumn(D);for(var E=0,F;F=C[E];E++){if(F.dataObj.id!=B.dataObj.id){continue}var A=(E>0)?C[E-1]:null;if(A){D.insertBefore(B.elm_module,A);App.Modules.saveModulePosition(B)}}};App.LayoutManager.movePositionDown=function(B){if(!App.LayoutManager.canMovePositionDown(B)){return false}var D=App.ColManager["col"+B.dataObj.container];var C=App.LayoutManager.getModulesByColumn(D);for(var E=0,F;F=C[E];E++){if(F.dataObj.id!=B.dataObj.id){continue}var A=C[E+2];if(A){D.insertBefore(B.elm_module,A)}else{D.appendChild(B.elm_module)}App.Modules.saveModulePosition(B)}};App.LayoutManager.movePositionTop=function(A){var C=App.ColManager["col"+A.dataObj.container];var B=App.LayoutManager.getModulesByColumn(C);if(B.length>0){C.insertBefore(A.elm_module,B[0]);App.Modules.saveModulePosition(A)}};App.LayoutManager.movePositionBottom=function(A){var B=A.dataObj.container;App.ColManager["col"+B].appendChild(A.elm_module);App.Modules.saveModulePosition(A)};App.LayoutManager.getModulePosition=function(B){var A=B.dataObj.container;var D=App.ColManager["col"+A];var C=App.LayoutManager.getModulesByColumn(D);for(var E=0;E<C.length;E++){if(C[E].dataObj.id==B.dataObj.id){break}}return[A,E]};App.LayoutManager.getFreePosition=function(){for(var B=1,C=0;;B++){var A=App.ColManager["col"+B];if(typeof App.LayoutManager.getModulesByColumn(A)[C]=="undefined"){break}if(App.ColManager.numCols==B){B=0;C++}}return[B,C]};App.LayoutManager.getModulesByColumn=function(D,B){if(typeof B=="undefined"||!B){B=App.selectedTab}var A=[];var E=D.childNodes.length;for(var C=0;C<E;C++){var F=D.childNodes[C];if(F.dataObj&&F.dataObj.tab==B){A.push(F)}}return A};App.LayoutManager._movePosition=function(B,F){var H=App.LayoutManager.getModulePosition(B);var D=B.dataObj.container;if(F=="left"){D--}else{if(F=="right"){D++}}var G=App.ColManager["col"+D];if(G){var A=null;var C=App.LayoutManager.getModulesByColumn(G);for(var E=0;E<C.length;E++){if(H[1]==E){A=C[E];break}}if(A){G.insertBefore(B.elm_module,A)}else{G.appendChild(B.elm_module)}B.dataObj.container=D;App.Modules.saveModulePosition(B)}};App.LayoutManager.movePositionLeft=function(A){if(!App.LayoutManager.canMovePositionLeft(A)){return false}App.LayoutManager._movePosition(A,"left")};App.LayoutManager.movePositionRight=function(A){if(!App.LayoutManager.canMovePositionRight(A)){return false}App.LayoutManager._movePosition(A,"right")};App.LayoutManager.getResetColumnOrder=function(A){var C=A.dataObj.container;var B=A.dataObj.tab;var G=[];var F=App.ColManager["col"+C];var H=F.childNodes.length;var I=1000;for(var E=0;E<H;E++){var D=F.childNodes[E].dataObj;if(!D||(!D.id&&!D.tempId)){continue}if(B&&D.tab!=B){continue}D.row=I;G.push((D.id||D.tempId)+":"+I);I+=1000}return G.join(",")};App.LayoutManager.setDefaultColHeight=function(){var E=App.ColManager.columnDivs;for(var D=0,B;B=E[D++];){if(!(Browser.isIE&&Browser.version<7)){B.setStyle("height","auto")}else{var F=0;var C=B.getChildren();if(C.length>0){for(var A=0,G;G=C[A++];){if(G.style.display!="none"){B.setStyle("height","auto");F++;break}}}if(!F){B.setStyle("height","117px")}}}};App.LayoutManager.adjustColumnHeight=function(){var B=App.ColManager.columnDivs;var C=App.selectedTabObj.dataObj.layout.split("-");var A=App.FlexiLayout.instructionsByModel[C[0]][C[1]];if(!A){return }App.LayoutManager.setDefaultColHeight();(function(I){if(I[0] instanceof Array){for(var H=0,E;E=I[H++];){arguments.callee(E)}return }var D=0;for(var H=0;H<I.length;H++){var G=B[I[H]];var F=G.getSize().y+G.getPosition().y;D=Math.max(D,F)}if(D<=0){return }for(var H=0;H<I.length;H++){var G=B[I[H]];var F=G.getSize().y+G.getPosition().y;if(F<D){G.setStyle("height",(D-G.getPosition().y))}}})(A)};App.FlexiLayout={classPrefix:"flexilayout",modelsBynumCols:{"1":["0"],"2":["0"],"3":["0","1","2"],"4":["0","1","2","3","4","5","6"]},instructionsByModel:{"1":{"0":null},"2":{"0":[0,1]},"3":{"0":[0,1,2],"1":[1,2],"2":[0,1]},"4":{"0":[0,1,2,3],"1":[1,2,3],"2":[1,2,3],"3":[0,1,2],"4":[1,2,3],"5":[1,2],"6":[[0,1],[2,3]]}},px2percent:function(C){var C=$A(C);var A=App.selectedTabObj.dataObj.layout;var B=99;switch(A){case"2-0":B=98.8;C.normalize(B,2);return C;break;case"3-0":B=97.65;C.normalize(B,2);return C;break;case"4-0":B=96.6;C.normalize(B,2);return C;break;case"3-1":B=98;C[0]=0;C.normalize(B,2);C[0]=1;return C;break;case"4-2":B=97;C[0]=0;C.normalize(B,2);C[0]=1;return C;break;case"3-2":B=98;C[2]=0;C.normalize(B,2);C[2]=1;return C;break;case"4-4":case"4-1":B=98.9;secondarySizes=C.slice(2);C[2]=C[3]=0;C.normalize(B,2);secondarySizes.normalize(C[0]-1,2);C[2]=secondarySizes[0];C[3]=secondarySizes[1];return C;break;case"4-3":B=97;C[3]=0;C.normalize(B,2);C[3]=1;return C;break;case"4-5":B=98;C[0]=C[3]=0;C.normalize(B,2);C[0]=C[3]=1;return C;break;case"4-6":B=98.6;secondarySizes=C.slice(2);C[2]=C[3]=0;C.normalize(B,2);secondarySizes.normalize(B,2);C[2]=secondarySizes[0];C[3]=secondarySizes[1];return C;break}},getModelName:function(A,B){return(B?B:App.ColManager.numCols)+"-"+(A?A:0)},getClassName:function(A,B){return App.FlexiLayout.classPrefix+"-"+App.FlexiLayout.getModelName(A,B)},update:function(A){if(typeof A=="undefined"){A=App.FlexiLayout.getModelName()}App.selectedTabObj.dataObj.layout=App.ColManager.layout=A;App.ColManager.resetLayout();App.ColManager.saveLayout(true)},isDefault:function(){return App.selectedTabObj.dataObj.layout.slice(-2,App.selectedTabObj.dataObj.layout.length)=="-0"}};;
App.Login={};App.Login.Register={};App.Login.show=function(){SqueezeBox.fromElement($("nv-signin"),{handler:"adopt",classWindow:"modal",classOverlay:"wizard-overlay",closeWithOverlay:false,zIndex:9501,size:{x:550,y:"auto"},onClose:this.onClose.bind(this),onOpen:this.onShowSignIn.bind(this)});App.Login.attachSignInEvents(this)};App.Login.register=function(){var C=$("signinWrapper");C.hide();var A=$("nv-signup");if(!A){A=new App.Login.Register().toElement();A.injectAfter(C).addEvent("onUpdate",function(E){var D;if(D=E.getElementsByTagName("INPUT")[0]){setTimeout(function(){D.focus()},300)}})}else{A.show()}if(typeof (SqueezeBox)!="undefined"){var B={};B.x=430;B.y="auto";SqueezeBox.resize(B,true)}};App.showSignup=function(){App.Login.show();setTimeout(function(){App.Login.register()},300)};App.Login.attachSignInEvents=function(A){var E=$("signinForm");if(E){E.onsubmit=App.Login.onLoggingIn}var B=$("signupNow");if(B){B.onclick=function(){if(App.visit){window.location.href="http://"+NV_HOST+"/#signup"}else{App.Login.register()}return false}}var C=$("signinLostPassword");if(C){C.onclick=App.Login.onLostPassword}var D=$("signinEmail");if(D){(function(){D.focus()}).delay(600)}};App.Login.onShowSignIn=function(D){$("signinWrapper").show();var E=$("lostPassword");if(E){E.hide()}var C=$("resendConfirmation");if(C){C.hide()}var A=$("nv-signup");if(A){A.hide()}if(typeof (SqueezeBox)!="undefined"){var B={};B.x=550;B.y="auto";SqueezeBox.resize(B,true)}return false};App.Login.onClose=function(){$("netvibes-signin").adopt($("nv-signin"))};App.Login.onLoggingIn=function(E){var D=$("signinButton");var C=$("signinEmail").value.trim();var B=$("signinPassword").value;$("signinInfoMessage").hide();var G=true;if(!String.isEmail(C)){$("signinEmail").yellowFade();G=false}if(!B.length){$("signinPassword").yellowFade();G=false}if(!G){var A="<b>"+_("Please correct the errors above.")+"</b>";App.Login.loginError(A);$("signinLostPassword").show();return false}var F="email="+encodeURIComponent(C);if(!$("signinSessionOnly").checked){F+="&session_only=1"}new Request({onRequest:function(){D.disabled=true;D.set("value",_("Loading..."))},onSuccess:function(H){F+="&password="+encodeURIComponent(md5(H+B));new Request({onComplete:function(J){var K=J.split(" ");switch(K[0]){case"success":if(NV_PREMIUM){window.location.href="/token"}else{if(App.Login.callbackUrl){if(App.Login.callbackToken){window.location.href="/token?url="+encodeURIComponent(App.Login.callbackUrl)}else{window.location.href=App.Login.callbackUrl}}else{if(App.subscribe&&App.subscribe.query){window.location.href="subscribe.php?"+App.subscribe.query.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">")}else{if(Browser.Engine.webkit&&Browser.Engine.version>=420){window.location.hash="";window.location.reload()}else{window.location.href="/"}}}}break;case"notconfirmed":$("signinEmail").yellowFade();$("signinPassword").yellowFade();var I="<b>"+_("This account must be activated. The activation link has been sent to your email adress.")+"</b><br/>"+_("We can {0}").replace("{0}",'<a href="javascript:void(0);" id="signinResendConfirmation">'+_("send you the confirmation e-mail again.")+"</a>");App.Login.loginError(I);$("signinLostPassword").hide();D.set("value",_("Sign in"));D.disabled=false;$("signinResendConfirmation").addEvent("click",App.Login.onResendConfirmation.bindWithEvent(this,K[1]));break;case"wrongpassword":case"nomatch":default:$("signinPassword").yellowFade();$("signinEmail").yellowFade();var I="<b>"+_("Invalid e-mail or password.")+"</b>";App.Login.loginError(I);$("signinLostPassword").show();D.set("value",_("Sign in"));D.disabled=false;break}}}).post("/ajax/user/signIn.php",F)}}).get("/ajax/user/signIn.php",{seed:1});return false};App.Login.onResendConfirmation=function(G,C){var D=$("signinWrapper").hide();var B=$("resendConfirmation");if(!B){var F="";F+='<h2 class="title">'+_("Sign in")+"</h2>";F+='<form id="resendConfirmationForm" method="post">';F+='<p id="resendConfirmationMsg" class="error" style="display: none;"></p>';F+="<p>"+_("Send a confirmation e-mail again:")+"</p>";F+="<p>";F+='<span id="resendConfirmationEmailLabel" for="resendConfirmationEmail" class="field">'+_("Email:")+"</span> ";F+='<span id="resendConfirmationEmail">'+C+"</span>";F+="</p>";F+='<p class="updateEmailLink">';F+='<a id="updateEmailLink" href="javascript:void(0)">'+_("Entered a wrong e-mail address during signup?")+"</a> ";F+="</p>";F+='<div id="updateEmailForm" style="display:none;">';F+='  <p class="field">';F+='  <label for="updateEmailPassword">'+_("Enter your password:")+"</label>";F+='  <input id="updateEmailPassword" class="text" type="password" tabindex="1" />';F+="  </p>";F+='  <p class="field">';F+='  <label for="updateEmailNew">'+_("Enter your new e-mail address:")+"</label>";F+='  <input id="updateEmailNew" type="text" class="text email" autocomplete="off" tabindex="2" />';F+="  </p>";F+="</div>";F+='<p class="submit">';F+='<input id="resendConfirmationButton" type="submit" class="nv-button nv-primary-button" value="'+_("Send")+'" />';F+="</p>";F+='<p class="backToSignIn">';F+=_("or")+' <a id="backToSignIn" href="javascript:void(0)" rel="prev">'+_("Back")+"</a>";F+="</p>";F+='<p class="endForm"></p>';F+="</form>";B=new Element("div",{id:"resendConfirmation"}).setHTML(F).injectAfter(D);var A=$("backToSignIn");A.onclick=function(){B.hide();$("signinLostPassword").show();$("signinErrorMessage").hide();$("signinError").show();$("signinError").addClass("description");$("signinError").removeClass("error");D.show()};var H=$("updateEmailLink");H.addEvent("click",App.Login.onUpdateEmail.bindWithEvent(this));var C=$("resendConfirmationEmail").value;if(String.isEmail(C)){$("resendConfirmationEmail").value=C}var E=B.getElementsByTagName("form")[0];E.onsubmit=App.Login.onResendingConfirmation}$("resendConfirmationMsg").hide();B.show()};App.Login.onUpdateEmail=function(){if($("updateEmailForm").getStyle("display")=="none"){$("updateEmailForm").show()}else{$("updateEmailForm").hide();$("updateEmailPassword").value="";$("updateEmailNew").value=""}};App.Login.resendConfirmation=null;App.Login.onResendingConfirmation=function(){var A=$("resendConfirmationMsg");var C=$("resendConfirmationEmail").getHTML();var B=$("updateEmailPassword").value.trim();var D=$("updateEmailNew").value.trim();if((B.length||D.length)&&!String.isEmail(D)){$("updateEmailNew").yellowFade().focus();A.className="error";A.set("text",_("Please enter a valid email.")).show()}else{if(!(App.Login.resendConfirmation&&App.Login.resendConfirmation.running)){App.Login.resendConfirmation=new Request({url:"/ajax/user/sendActivation.php",onComplete:App.Login.onResendConfirmationResponse}).POST({email:C,password:B,newEmail:D,callbackUrl:App.Login.callbackUrl})}}return false};App.Login.onResendConfirmationResponse=function(B){var A=$("resendConfirmationMsg");switch(B){case"success":$("updateEmailForm").hide();App.Login.onShowSignIn();$("signinError").hide();$("signinInfoMessage").set("text",_("We just sent you a confirmation e-mail. Click on the activation link to complete your sign up.")).show();if($("updateEmailNew").value.length){$("resendConfirmationEmail").innerHTML=$("updateEmailNew").value}break;case"alreadyconfirmed":A.className="error";A.set("text",_("This account was already confirmed.")).show();break;case"inuse":A.className="error";A.set("text",_("Sorry, this email address is already in use")).show();break;case"wrongpassword":A.className="error";A.set("text",_("Invalid password.")).show();break;case"nomatch":default:$("resendConfirmationEmail").focus();A.className="error";A.set("text",_("There is no match in the database, check your info and try again.")).show();break}App.Login.resendConfirmation=null};App.Login.loginError=function(A){$("signinErrorMessage").set("html",A).show();$("signinError").show();$("signinError").removeClass("description");$("signinError").addClass("error")};App.Login.onLostPassword=function(){var D=$("signinWrapper").hide();var B=$("lostPassword");if(!B){var F="";F+='<h2 class="title">'+_("Sign in")+"</h2>";F+='<form id="lostPasswordForm" method="post">';F+='<p id="forgotErrorMsg" class="error" style="display: none;"></p>';F+="<p>"+_("Enter your e-mail address to recover your password.")+"</p>";F+='<p class="field">';F+='<label id="forgotEmailLabel" for="forgotEmail" class="field">'+_("Email:")+"</label>";F+='<input id="forgotEmail" name="email" type="text" class="text email" maxlength="50" />';F+="</p>";F+='<p class="submit">';F+='<input id="forgotButton" type="submit" class="nv-button nv-primary-button" value="'+_("Send")+'" />';F+="</p>";F+='<p class="backToSignIn">';F+=_("or")+' <a id="backToSignIn" href="javascript:void(0)" rel="prev">'+_("Back")+"</a>";F+="</p>";F+='<p class="endForm"></p>';F+="</form>";B=new Element("div",{id:"lostPassword"}).setHTML(F).injectAfter(D);var A=$("backToSignIn");A.onclick=function(){B.hide();$("signinLostPassword").show();$("signinErrorMessage").hide();$("signinError").show();$("signinError").addClass("description");$("signinError").removeClass("error");D.show()};var C=$("signinEmail").value;if(String.isEmail(C)){$("forgotEmail").value=C}var E=B.getElementsByTagName("form")[0];E.onsubmit=App.Login.onSendingPassword}$("forgotErrorMsg").hide();B.show()};App.Login.requestPwd=null;App.Login.onSendingPassword=function(){var A=$("forgotErrorMsg");var B=$("forgotEmail").value.trim();if(!String.isEmail(B)){$("forgotEmail").yellowFade().focus();A.className="error";A.set("text",_("Please enter a valid email.")).show()}else{if(!(App.Login.requestPwd&&App.Login.requestPwd.running)){App.Login.requestPwd=new Request({url:"/recoverPwd.php",onComplete:App.Login.onLostPasswordResponse}).POST({action:"sendpwd",email:B})}}return false};App.Login.onLostPasswordResponse=function(B){var A=$("forgotErrorMsg");switch(B){case"success":App.Login.onShowSignIn();$("signinInfoMessage").set("text",_("The new password procedure has been sent to your email.")).show();break;case"nomatch":default:$("forgotEmail").focus();A.className="error";A.set("text",_("There is no match in the database, check your info and try again.")).show();break}App.Login.requestPwd=null};App.Login.Register=new Class({toElement:function(){this.element=new Element("div",{id:"nv-signup"});if(document.referrer.test("http://"+NV_HOST+"/[0-9a-z-_]+/?(#[a-zA-Z0-9]*)?$")){var B=_("Create a free account to create your own public page.")}else{if(document.referrer.test("http://"+NV_ECO)){var B=_("Create a free account to create or submit a widget.")}else{var B=_("Signing up is free. It ensures that your page is saved and accessible everywhere.")}}B+=' <span class="signin">'+_("Do you already have an account?")+' <a href="/signin" class="signInLink">'+_("Sign in")+"</a>.</span>";var A="";A+='<h2 class="title">'+_("Sign up")+"</h2>";A+='<p id="signupInfo">'+B+"</p>";if(!this.wizard){A+='<form id="signupForm" method="post">'}A+='<p class="error" style="display:none"></p>';A+='<p class="field">';A+='<label for="signupUsername" class="signupUsername">'+_("Username:")+"</label>";A+='<em id="signupUsernameDescription" class="description signupUsername" style="display:none;">'+_("(3 to 50 characters, allowed characters are lower-case letters, numbers, '_' and '-')")+"</em>";A+='<input id="signupUsername" tabindex="1" name="username" type="text" class="text" autocomplete="off" /><img src="'+App.getStaticUrl("/img/s.gif")+'" width="16" height="16" />';A+="</p>";A+='<p class="field">';A+='<label for="signupEmail">'+_("Valid e-mail address:")+"</label>";A+='<input id="signupEmail" tabindex="2" name="email" type="text" class="text email" autocomplete="off" /><img src="'+App.getStaticUrl("/img/s.gif")+'" width="16" height="16" />';A+='<em class="description">'+_("Don't worry, we will never sell or spam your email.")+"</em>";A+="</p>";A+='<p class="field">';A+='<label for="signupPassword" class="signupPassword">'+_("Password:")+"</label>";A+='<em class="description signupPassword">'+_("at least 6 characters")+"</em>";A+='<input id="signupPassword" tabindex="3" class="text" name="password" type="password" /><img src="'+App.getStaticUrl("/img/s.gif")+'" width="16" height="16" />';A+="</p>";A+='<p class="field">';A+='<label for="signupConfirmPassword">'+_("Confirm Password:")+"</label>";A+='<input id="signupConfirmPassword" tabindex="4" name="confirmPassword" class="text" type="password" /><img src="'+App.getStaticUrl("/img/s.gif")+'" width="16" height="16" />';A+="</p>";A+='<p class="acceptTos">';A+='<input id="acceptTos" tabindex="5" type="checkbox" /> <label for="acceptTos">'+_('I agree with the <a href="{0}" target="_blank">Terms of Service</a>').format("http://"+NV_HOST+"/static.php?show=tos&target=_blank")+'</label><img src="'+App.getStaticUrl("/img/s.gif")+'" width="16" height="16" />';A+="</p>";if(App.isPremium()){if(App.premium&&App.premium.register&&App.premium.register.length){A+="<p>";A+='<input id="signupAcceptEmails" name="acceptEmails" type="checkbox" class="checkbox" '+(App.premium.register[0].checked?'checked="checked"':"")+' value="1" /> ';A+='<label for="signupAcceptEmails" id="signupAcceptPremiumLabel">'+App.premium.register[0].text+"</label>";A+="</p>"}if(App.premium&&App.premium.register&&App.premium.register.length>1){A+="<p>";A+='<input id="signupAcceptPartners" name="acceptPartners" type="checkbox" class="checkbox" '+(App.premium.register[1].checked?'checked="checked"':"")+' value="1" /> ';A+='<label for="signupAcceptPartners" id="signupAcceptPartnerLabel">'+App.premium.register[1].text+"</label>";A+="</p>"}}if(!this.wizard){A+='<p class="submit">';A+='<input id="signupButton" tabindex="6" type="submit" class="nv-button nv-primary-button" value="'+_("Sign up")+'" />';A+="</p>"}A+='<div id="frameTos"></div>';if(!this.wizard){A+="</form>"}this.element.set("html",A);this.attachEvents();return this.element},attachEvents:function(){var A=this.element.getElements("input");this.inputUsername=A[0];this.inputEmail=A[1];this.inputPassword=A[2];this.inputConfirmPassword=A[3];this.inputAcceptTos=A[4];this.errorMsg=this.element.getElement(".error");this.inputUsername.addEvent("blur",this.validateUsername.bindWithEvent(this));this.inputEmail.addEvent("blur",this.validateEmail.bindWithEvent(this));this.inputPassword.addEvent("blur",this.validatePassword.bindWithEvent(this));this.inputConfirmPassword.addEvents({blur:this.validateConfirmPassword.bindWithEvent(this),keyup:this.validateConfirmPassword.bindWithEvent(this)});this.inputAcceptTos.addEvent("change",this.validateTos.bind(this));var B=$(this.element.getElementsByTagName("form")[0]);if(B){B.addEvent("submit",function(C){C.stop();this.onFinish()}.bind(this))}this.element.getElement(".signInLink").addEvent("click",App.Login.onShowSignIn.bind(this))},onShowTOS:function(A){App.displaySiteInformation(NV_PATH+"js/loc/"+App.lang.substring(0,2)+"_tos.html",A.target);A.stop()},validate:function(){var A=(this.validateUsername()&this.validateEmail()&this.validatePassword()&this.validateConfirmPassword()&this.validateTos());if(A){}else{this.errorMsg.show().innerHTML=_("Please correct the errors below")}return A},validateUsername:function(B){var C=this.inputUsername.value;var A=C.test(/^[a-z0-9][a-z0-9_\-]{1,48}[a-z0-9]$/);if(this.inputUsername.value.length||!B){this.inputUsername.getNext().className=A?"valid":"invalid";if(A){$("signupUsernameDescription").hide()}else{$("signupUsernameDescription").show()}}return A},validateEmail:function(B){var A=String.isEmail(this.inputEmail.value);if(this.inputEmail.value.length||!B){this.inputEmail.getNext().className=A?"valid":"invalid"}return A},validatePassword:function(C){var B=this.inputPassword.value.length;var A=(B>=6);if(this.inputPassword.value.length||!C){this.inputPassword.getNext().className=A?"valid":"invalid"}return A},validateConfirmPassword:function(C){var B=this.inputConfirmPassword.value.length;var A=(B>=6&&this.inputPassword.value==this.inputConfirmPassword.value);if(this.inputConfirmPassword.value.length||!C){this.inputConfirmPassword.getNext().className=A?"valid":"invalid"}return A},validateTos:function(){var A=!!(this.inputAcceptTos.checked);this.inputAcceptTos.getNext("img").className=A?"valid":"invalid";return A},onFinish:function(D){if(this.validate()&&!(this.request&&this.request.running)){var C=$("signupButton");C.disabled=true;C.value=_("Saving...");var B={username:this.inputUsername.value,email:this.inputEmail.value,password:this.inputPassword.value,callbackUrl:App.Login.callbackUrl};var A=$("signupAcceptEmails");if(A){B.acceptEmails=A.checked?1:0}var E=$("signupAcceptPartners");if(E){B.acceptPartners=E.checked?1:0}this.request=new Request({url:"/ajax/user/signUp.php",onComplete:this.onRegistered.bind(this),data:B}).post()}},onRegistered:function(B){var C=B.split(" ");switch(C[0]){case"success":this.confirmRegistration();break;case"emailinuse":var A=$("signupButton");if(A){A.disabled=false;A.value=_("Sign up")}this.errorMsg.show().innerHTML=_("Sorry, this email address is already in use");this.inputEmail.getNext().className="invalid";this.inputEmail.yellowFade();this.inputEmail.focus();break;case"usernameinuse":var A=$("signupButton");if(A){A.disabled=false;A.value=_("Sign up")}this.errorMsg.show().innerHTML=_("Sorry, this username is already in use");this.inputUsername.getNext().className="invalid";this.inputUsername.yellowFade();this.inputUsername.focus();break;case"pending":var A=$("signupButton");if(A){A.disabled=false;A.value=_("Sign up")}this.errorMsg.show().innerHTML=_("Sorry, this session is already registered and must be activated. The activation link has been sent to your email adress. We can {0}.").format('<a href="javascript:void(0);" id="signupResendActivationLink">'+_("send you the confirmation e-mail again")+"</a>");$("signupResendActivationLink").addEvent("click",this.resendActivation.bindWithEvent(this,C[1]));break;case"error":default:var A=$("signupButton");if(A){A.disabled=false;A.value=_("Sign up")}this.errorMsg.show().innerHTML=_("Sorry, an error has occurred. Try again later.");break}this.request=null},resendActivation:function(B,A){App.Login.onShowSignIn();App.Login.onResendConfirmation(B,A)},confirmRegistration:function(){var A="";A+='<h2 class="title">'+_("Sign up")+"</h2>";A+='<div id="signupComplete">';A+="    <h3>"+_("Thanks for signing up!")+"</h3>";A+="    <p>"+_("We just sent you a confirmation e-mail. Click on the activation link to complete your sign up.")+"</p>";if(!App.Login.callbackUrl){A+='    <p class="submit"><a class="nv-button" id="close"><span>'+_("Close")+"</span></a></p>"}A+='    <p style="clear:both;"></p>';A+="</div>";this.element.set("html",A);if(!App.Login.callbackUrl){$("close").addEvent("click",this.close)}},close:function(A){if(typeof (SqueezeBox)!="undefined"){SqueezeBox.close()}}});App.Login.Register.onClose=function(){$("netvibes-signin").adopt($("nv-signin"))};;
App.Request={};App.Request.JSON={};Request.implement({initialize:function(A){this.xhr=new Browser.Request();this.setOptions(A);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers=new Hash(this.options.headers);this.addEvents({onRequest:App.Request.onRequest.bind(this),onComplete:App.Request.onComplete.bind(this),onFailure:App.Request.onFailure.bind(this),onCancel:App.Request.hideThrobber.bind(this)})}});App.Request.newRequest=function(A){return new Request(A||{})};App.Request.onRequest=function(){if(this.options.method.toLowerCase()=="post"){App.Request.showThrobber()}};App.Request.showThrobber=function(){var A=$("savingStatus");if(A){A.setStyles({visibility:"visible","background-color":"#FF0000"})}};App.Request.hideThrobber=function(){var A=$("savingStatus");if(A){A.setStyle("visibility","hidden")}};App.Request.onComplete=function(){App.Request.hideThrobber()};App.Request.onFailure=function(A){};App.Request.saveUserData=function(F,B){if(App.staticUniverse&&F!="lastAccess"){return false}B=B||{};B.url="/ajax/save/userData.php?"+F;B.data=B.data||{};B.data.mode=F;B.data.pid=B.data.pid||App.currentPage;if(App.visit){B.data.visit=App.visit.id}switch(F){case"lastAccess":B.data.browser=Browser.name;B.data.browser_version=Browser.version;B.data.os=Browser.os;B.data.os_version=Browser.osVersion;B.data.screensize=screen.width+"x"+screen.height;break;case"tab.order":B.data.sort="";if(App.isSmartReader){B.data.sort=App.SmartReader.data.sectionsOrder.join(":")}else{for(var D=0,A=App.tabList.length,C="";D<A;D++){B.data.sort+=C+App.tabList[D].dataObj.id;C=":"}}break}var E=new Request(B);E.addEvent("success",function(J){var G=JSON.decode(J);if(!G){return }if(G.defaultModulesIds){App.Modules.synchDefaultModules(G.defaultModulesIds)}switch(G.mode){case"module.new":break;case"module.archive":case"module.close":var H=App.Modules.getById(G.params.id);if(H){if(G.mode=="module.close"){var I={name:H.dataObj.moduleName,id:H.dataObj.id,ident:H.getIdentifier()};if(H.dataObj.campaignId){I.campaignId=H.dataObj.campaignId}App.report("module.remove",I)}H.remove(false)}break;case"tab.new":App.Tabs.setTabId(G.params.tempId,G.params.newId);break;case"tab.delete":App.moduleList=App.moduleList.filter(function(K){if(K.dataObj.tab==G.params.tid){K.elm_module.remove();return false}return true});App.tabList=App.tabList.filter(function(K){if(K.dataObj.id==G.params.tid){K.elm.remove();return false}return true});App.tabList.getLast().switchTo();break}});E.POST();return E};var feedProxyCache={};var feedProxyBuffer=null;var feedProxyCacheUsed=false;var feedProxyCacheWaitTime=800;App.Request.send=function(C,A,L,G,E,D,I){if($type(C)!="string"||C.substr(0,1)=="["){return }var J;var K=false;if(window.XMLHttpRequest){J=new XMLHttpRequest()}else{if(window.ActiveXObject){J=new ActiveXObject("Microsoft.XMLHTTP")}}if(typeof D=="undefined"){D=""}else{D+="\n"}if(typeof I=="undefined"){I=false}var B=function(){if(J.readyState==4){if(J.status<400){if(A=="POST"){if(K){var M=J.responseText.split("|n||FEED||v|");for(i in M){if(typeof M[i]!="string"){continue}var P=M[i].split("|n||URL||v|");C=P[0];if(typeof C=="undefined"){continue}var O="nv"+escape(C);var R=feedProxyCache[O];if(typeof R=="undefined"){O+="&rss=1";R=feedProxyCache[O];if(typeof R=="undefined"){continue}C+="&rss=1"}for(var N=R.length-1;N>=0;N--){var Q=R[N];J={responseText:P[1]};L=Q[0];G=Q[1];if(typeof L=="function"){L(J,G)}delete L;feedProxyCache[O][N]=null}feedProxyCache[O]=null}for(i in feedProxyCache){if(i.substr(0,2)!="nv"){continue}C=unescape(i.substr(2));var R=feedProxyCache[i];if(!R){continue}for(var N=R.length-1;N>=0;N--){var Q=R[N];L=Q[0];G=Q[1];if(C.substr(C.length-6)=="&rss=1"){myurl=feedProxyURL+escape(C.substr(0,C.length-6))+"&rss=1"}else{myurl=feedProxyURL+escape(C)}App.Request.send(myurl,"GET",L,G,false,"",true)}}M=null;R=null;Q=null;P=null;feedProxyCache={};feedProxyCacheUsed=false}else{if(typeof L=="function"){L(J)}}}else{if(typeof L=="function"){L(J,G)}}}else{if(typeof J=="undefined"||typeof J.status=="undefined"){}else{if(J.status==401||J.statusText.toLowerCase()=="unauthorized"){L(J)}else{if(J.status==404){}else{if(App.errorShowing){return false}App.errorShowing=true;switch(J.status){case 12002:case 12007:case 12029:case 12030:case 12031:case 12152:case 13030:if(App.showErrors){alert(D+_("There was a network problem. Please reload the page."))}break;case 500:case 503:if(App.showErrors){alert(D+_("There was an internal server error. Please try later."))}break;default:if(App.showErrors){alert(_("There was a problem loading data:")+"\nstatus: "+J.status+"/"+J.statusText+"\n"+C)}}App.errorShowing=false}}}}delete L;L=null;delete J;J=null}};function H(){if(A=="POST"){J.open("POST",C,true);if(E){J.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.onreadystatechange=B;J.send(G)}else{J.open("GET",C,true);J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.onreadystatechange=B;J.send(null)}}urlCheck=new RegExp("(getpassword|nocache|test|item)=","i");if(A!="POST"&&!I&&App.speedUp&&!App.eTag&&C.substr(0,feedProxyURL.length)==feedProxyURL&&!feedProxyCacheUsed&&C.substr(C.length-6)=="&rss=1"&&!urlCheck.test(C)){var F="nv"+C.substr(feedProxyURL.length).replace(/&rnd=[0-9.]+/,"");if(!feedProxyCache[F]){feedProxyCache[F]=[]}feedProxyCache[F][feedProxyCache[F].length]=[L,G];if(feedProxyBuffer){clearTimeout(feedProxyBuffer)}feedProxyBuffer=setTimeout(function(){C=feedProxyURL.replace(/\?url=/,"");G="";t="";for(i in feedProxyCache){if(i.substr(0,2)!="nv"){continue}G+=t+"url[]="+i.substr(2);t="&"}K=true;feedProxyCacheUsed=true;A="POST";E=true;H()},feedProxyCacheWaitTime);feedProxyCacheWaitTime=300;return false}H();return J};App.Request.sendRawPOST=function(B,C,D,A){App.Request.send(B,"POST",D,C,false,A)};App.Request.sendPOST=function(B,C,D,A){App.Request.send(B,"POST",D,C,true,A)};App.Request.sendGET=function(C,D,B,A){return App.Request.send(C,"GET",D,B,A)};App.reportBuffer=null;App.reportBufferCounter=0;App.reportTimeout=null;App.report=function(D,E){if(!App.enableStats){return false}E=$merge(E,{browser:Browser.name,browser_version:Browser.version,os:Browser.os,os_version:Browser.osVersion,screensize:screen.width+"x"+screen.height,locale:App.locale});var B="",C="";if(D=="module.view"){if(App.reportTimeout){clearTimeout(App.reportTimeout)}if(!App.reportBuffer){App.reportBuffer="";App.reportBufferCounter=0}B="["+App.reportBufferCounter+"]";App.reportBufferCounter+=1}for(var A in E){if(typeof E.hasOwnProperty!="string"&&!E.hasOwnProperty(A)){continue}if(typeof E[A]=="function"){continue}C+="&"+A+B+"="+encodeURIComponent(E[A])}if(D=="module.view"){App.reportBuffer+=C;App.reportTimeout=setTimeout(App.doReport,400);return }App.doReport(D,C)};App.doReport=function(A,B){if(App.reportBuffer){A="module.view";B=App.reportBuffer;App.reportBuffer=null;App.reportBufferCounter=0}if(App.visit&&App.visit.id){B+="&visit="+App.visit.id}if(App.brand){B+="&brand="+App.brand}if(typeof A=="undefined"||!A){return }App.Request.sendPOST(NV_PATH+"report.php","event="+A+B,function(){})};App.serverVersion=null;App.checkServerInterval=15000;App.arriveTime=new Date();App.lastStay=false;App.sleepTime=0;App.checkServerVersion=function(C){if(typeof C=="undefined"){C=false}var E="";var D=App.arriveTime.getTime();var A=(new Date()).getTime()-D;A=Math.ceil(A/1000);if(A<0||A>86400||D<1000000000000||App.arriveTime.getDate()!=(new Date).getDate()){A=App.checkServerInterval;App.arriveTime=new Date();D=App.arriveTime.getTime();App.lastStay=false;App.sleepTime=0}else{if(App.lastStay!==false&&Math.abs(A-App.lastStay)>900){App.sleepTime+=Math.abs(A-App.lastStay)}}App.lastStay=A;E+="&arrive="+Math.ceil(D/1000);E+="&stay="+(A-App.sleepTime);var B="anon";if(App.newUser){B="new"}else{if(App.registeredUser){B="reg"}}E+="&status="+B;if(App.visit&&App.visit.id){E+="&visit="+App.visit.id}App.Request.sendPOST(NV_PATH+"status.php",E,function(G){if(C){return false}var F="";try{F=G.responseXML.firstChild.firstChild.nodeValue}catch(H){return true}if(F=="reboot"){setTimeout(function(){location.href="/"},60000);alert(_("Netvibes will be upgrading the server in one minute.\nPlease finish your work and close the browser window."));if(App.checkServer){clearInterval(App.checkServer)}return true}if(!App.serverVersion){App.serverVersion=F;return true}if(F!=App.serverVersion){location.href=NV_PATH}});if(App.checkServerInterval<120000){App.checkServerInterval=App.checkServerInterval*2}if(!C){window.setTimeout(App.checkServerVersion,App.checkServerInterval)}};window.setTimeout(App.checkServerVersion,App.checkServerInterval);;
if(!App.Modules){App.Modules={}}App.Modules.moduleObjWaitingForId=[];App.Modules.store=function(C,F){var A=Math.random()*100000;C.dataObj.tempId=A;var B=App.Modules.getModuleRow(C);C.dataObj.row=B;var E={moduleRndId:C.dataObj.tempId,widgetId:C.dataObj.widgetId||"",name:C.dataObj.moduleName,title:C.dataObj.title||"",tid:C.dataObj.tab,history:C.dataObj.history||"",status:1,col:C.dataObj.container||1,row:C.dataObj.row,arrData:C.dataObj.data};if(C.dataObj.feedUrl){E.feedUrl=C.dataObj.feedUrl}if(B<=0){E.order=App.LayoutManager.getResetColumnOrder(C)}if(C.dataObj.subscribeType){E.subscribe=C.dataObj.subscribeType;E.pid=C.dataObj.pageId;E.newUser=App.newUser?1:0;E.referrer=App.subscribe.referrer}if(C.dataObj.subscription){App.subscribeTempId=A;C.dataObj.subscription=null}if(C.dataObj.preconfigId){E.preconfigId=C.dataObj.preconfigId}if(C.dataObj.from){E.from=C.dataObj.from}if(C.dataObj.campaignId){E.campaignId=C.dataObj.campaignId}if(App.isPremium()){E.premium=App.premium.universe}if(App.visit){E.visit=App.visit.id}if(C.dataObj.campaignActive){var D={ecoId:C.dataObj.ecoId||C.dataObj.widgetId};if(C.dataObj.fromQuery){D.query=C.dataObj.fromQuery}E.campaignId=D.campaignId=C.dataObj.campaignId;if(!C.dataObj.campaignId||C.dataObj.campaignId==C.dataObj.ecoId||C.dataObj.campaignId==C.dataObj.widgetId){App.report("adc.spon.install",D);new Request().get("/proxy/ajaxProxy.php",{url:"http://"+NV_ECO_API+"/pingcampaign/"+(C.dataObj.ecoId||C.dataObj.widgetId)})}else{App.report("camp.install",D)}}App.Modules.moduleObjWaitingForId.push(C);App.Request.saveUserData("module.new",{data:E,onSuccess:function(J){var I=JSON.decode(J);if(I&&I.success){var H=I.params;var G=App.Modules.setModuleId(H.tempId,H.newId);if(H.feedId){G.dataObj.data.feedId=H.feedId}if(I.defaultModulesIds){App.Modules.synchDefaultModules(H.defaultModulesIds)}if(typeof F=="function"){F(G)}}}})};App.Modules.synchDefaultModules=function(D){if(!D){return }for(var E in D.tabs){var A=D.tabs[E];if(App.selectedTab==E){App.selectedTab=A}var C=App.Tabs.getById(E);if(C){C.getModules().each(function(F){F.dataObj.tab=A});C.dataObj.id=A;C.elm.id="tab"+A;C.dataObj.tempId=null}}for(var E in D.modules){var A=D.modules[E];var B=App.Modules.getById(E);if(B){B.dataObj.id=A;B.dataObj.tempId=null;if(B.dataObj.moduleName=="Weather"){B.save()}App.getDragModuleFactory().updateModuleId(E,A)}}};App.Modules.saveModulePosition=function(B){var C;if(B.order){C={col:B.col,order:B.order}}else{var A=App.Modules.getModuleRow(B);if(A<=0){C={col:B.dataObj.container,order:App.LayoutManager.getResetColumnOrder(B)}}else{B.dataObj.row=A;C={id:B.dataObj.id,col:B.dataObj.container,row:A}}}C.tid=B.dataObj.tab;App.Request.saveUserData("module.pos",{data:C})};App.Modules.setModuleId=function(E,B){for(var D=0,A=App.Modules.moduleObjWaitingForId.length;D<A;D++){var C=App.Modules.moduleObjWaitingForId[D];if(C.dataObj.tempId==E){C.dataObj.id=B;C.dataObj.tempId=null;C.setUnread();App.Modules.moduleObjWaitingForId.splice(D,1);break}}C.loadContent();return C};App.Modules.getById=function(C){for(var B=0,A=App.moduleList.length;B<A;B++){if(App.moduleList[B].dataObj.id==C){return App.moduleList[B]}}return null};App.Modules.notifyResize=function(D){for(var C=0,A=App.moduleList.length;C<A;C++){var B=App.moduleList[C];if(!B.content||B.dataObj.tab!=App.selectedTab){continue}if(typeof B.content.resize=="function"){B.content.resize(D)}}};App.Modules.nativiseModule=function(B){if(B.moduleName=="UWA"&&B.data.moduleUrl){var D=B.data.moduleUrl.parseUrl();if(D.host=="www.netvibes.com"||D.host==NV_HOST){var F=D.path.split("/");if(F[1]=="modules"){var G=F[2].toLowerCase();for(var E in App.Modules){var A=App.Modules[E];if(typeof A!="object"||!A.defaultObj){continue}var C=A.defaultObj.moduleName.toLowerCase();if(C==G){B.moduleName=A.defaultObj.moduleName;B.data=String.parseQuery(D.query);if(B.data.title){B.data.title=B.data.title.replace(/\+/g," ")}return B}}}}}return B};App.Modules.sortModulesByRow=function(G){var C=[];var F=[[],[],[],[]];for(var E=0,A=G.length;E<A;E++){var D=G[E];F[Math.max(D.dataObj.container-1,0)].push(D)}var H=false,D=null;for(var E=0;E<4;E=(E+1)%4){if(E==0){H=true}var B=F[E];if(B.length==0){if(E==3&&H){break}continue}H=false;C.push(B.shift())}return C};App.Modules.getModuleRow=function(B){if(App.isSmartReader&&App.SmartReader.data){var G=$("section-"+B.dataObj.tab);if(!G){return 1000}if(B.dataObj.moduleName.toLowerCase()=="rssreader"){var E=G.getElement(".nv-treeview-feeds");var K=E.getFirst();if(!K.hasClass("empty-section")){var H=K.getElement(".nv-treeview-row");var L=App.SmartReader.data.feedModules[H.id].module.dataObj.row/2;return L}else{return 1000}}else{var E=G.getElement(".nv-treeview-widgets");var K=E.getFirst();if(K){var H=K.getElement(".nv-treeview-row");var L=App.SmartReader.data.widgets[H.id].dataObj.row/2;return L}else{return 1000}}}else{var C=B.elm_module.previousSibling;var A=-1;while(C){if(C.dataObj&&C.dataObj.tab==B.dataObj.tab){A=parseInt(C.dataObj.row,10);break}C=C.previousSibling}var D=B.elm_module.nextSibling;var I=-1;while(D){if(D.dataObj&&D.dataObj.tab==B.dataObj.tab){I=parseInt(D.dataObj.row,10);break}D=D.nextSibling}if(A<0&&I<0){return 1000}if(I<0){return A+1000}if(A<0){return(I>0)?I/2:1000}var F=(I-A);var J=A+F/2;if(F<=1){return 0}return J}};App.Modules.cloneModule=function(B){var A=$unlink(B.dataObj);A.tab=App.selectedTab;delete A.id;var C=new Module(A).inject(B.elm_module,"before");C.dataObj.row=App.Modules.getModuleRow(B);C.load();delete C.dataObj.id;App.moduleList.push(C);App.Modules.store(C)};App.Modules.removeModule=function(B,A){};App.Modules.printModule=function(C){var D=C.content.print();var B=$("print_target");if(!B){var B=document.createElement("iframe");B.style.width="1px";B.style.height="1px";B.style.border="0px";B.style.position="absolute";B.style.top="-10px";B.id="print_target";document.body.appendChild(B)}var A=function(){if(Browser.isIE){var E=$("print_target").contentWindow.document.body}else{var E=$("print_target").contentDocument.body}try{E.innerHTML=""}catch(G){window.setTimeout(A,100);return }if(Browser.isIE){var F=document.createElement("div");F.appendChild(D);E.innerHTML=F.innerHTML;window.setTimeout(function(){$("print_target").contentWindow.print()},200)}else{E.appendChild(D);$("print_target").contentWindow.print()}$("print_target").isLoaded=true};if(B.isLoaded){A()}else{if(Browser.isFirefox){B.onload=function(){A()}}else{A()}}return false};App.Modules.LoadQueue={limit:5,timeout:null,selectedTabLoaded:false,items:[],loadingItems:[]};App.Modules.LoadQueue.process=function(){if(this.timeout){clearTimeout(this.timeout)}while(this.loadingItems.length>0&&(typeof this.loadingItems[0]=="undefined"||this.loadingItems[0]=="undefined"||this.loadingItems[0].loaded)){this.loadingItems.splice(0,1)}if(this.loadingItems.length>this.limit){if(this.items.length>0){this.limit+=5;this.timeout=App.Modules.LoadQueue.process.delay(1000,this)}else{this.timeout=App.Modules.LoadQueue.process.delay(5000,this)}return false}if(this.items.length==0){return false}this.limit=5;while(this.items.length>0&&(typeof this.items[0]=="undefined"||this.items[0]=="undefined"||this.items[0].loaded)){this.items.splice(0,1)}var C=null;for(var B=0,A=this.items.length;B<A;B++){if(this.items[B].dataObj.tab==App.selectedTab){C=this.items[B];this.items.splice(B,1);C.onqueue=false;break}}if(!C){if(!this.selectedTabLoaded){this.selectedTabLoaded=true;this.timeout=App.Modules.LoadQueue.process.delay(1000,this);return }do{if(this.items.length==0){return false}C=this.items.shift()}while(C.loading||C.loaded)}else{this.selectedTabLoaded=false}C.loadContent();this.timeout=App.Modules.LoadQueue.process.delay(10,this)};App.Modules.getByNames=function(A){var B={};if(typeof A=="string"){A=[A]}App.moduleList.each(function(E,D){var C=E.dataObj.moduleName;if(A.contains(C)){if(!B[C]){B[C]=[]}B[C].push(E.dataObj)}});return B};;
App.Search={};App.Search.attachEvents=function(){App.searchBox=$("globalSearch");if(!App.searchBox){return }App.searchBox.getElement("div").setStyles({position:"relative",zoom:"1"});App.searchBoxInput=App.searchBox.getElementsByTagName("input")[0];App.searchBoxForm=App.searchBox.getElementsByTagName("form")[0];App.searchBoxInput.value=_("In my page");App.searchBoxInput.setDefaultState=function(){this.className="text search defaultText";this.value=_("In my page");this.blur()};App.searchBoxInput.onfocus=function(){if(_("In my page")==this.value){App.searchBoxInput.value="";App.searchBoxInput.className="text search"}};App.searchBoxInput.onblur=function(){if(""==this.value){App.searchBoxInput.setDefaultState()}};App.searchBoxForm.onsubmit=function(){if(App.searchBoxInput.value!=App.query){App.searchInNetvibes(App.searchBoxInput.value)}return false};App.searchBoxClear=new Element("img",{src:App.getStaticUrl("/img/clear.gif"),title:_("Clear"),styles:{cursor:"pointer",position:"absolute",top:"0px",display:"none"}});App.searchBoxClear.setStyle(App.dirRTL?"left":"right","22px");if(Browser.Engine.trident){App.searchBoxClear.setStyle("top","4px")}App.searchBoxClear.injectAfter(App.searchBoxInput);App.searchBoxClear.onclick=function(){App.searchInNetvibes("");return false};App.isOnSearch=false;App.searchDone=false;App.dlaFilter=true;if(App.queryStart!=""){App.searchBoxInput.value=App.queryStart;App.searchBoxInput.className="text search";App.searchInNetvibes(App.queryStart)}};App.searchInNetvibes=function(D){$("tooltip").style.display="none";var C=App.moduleList.length;if(D==App.query){var A=true}else{var A=false}App.query=D;var B=App.selectedTab;if(D!=""){App.report("click.inpage.search",{query:D});if(!App.isOnSearch){App.isOnSearch=true;Element.addClassName(document.body,"search");App.searchBoxClear.style.display="inline";App.searchBoxClear.disabled="";for(var F=0;F<C;F++){if(!App.moduleList[F].content){continue}if(parseInt(App.moduleList[F].dataObj.oldStatus,10)!=1&&parseInt(App.moduleList[F].dataObj.oldStatus,10)!=0){App.moduleList[F].dataObj.oldStatus=parseInt(App.moduleList[F].dataObj.status,10)}try{if(!App.searchDone&&typeof App.moduleList[F].dataObj.extendSearch=="number"){App.moduleList[F].dataObj.extendSearch=(App.dlaFilter)?0:1}if(typeof App.moduleList[F].content.doSearch=="function"){App.moduleList[F].content.doSearch(D)}else{App.moduleList[F].collapse(true);App.moduleList[F].elm_module.addClass("transparent")}}catch(E){}}App.searchDone=true}else{if(App.searchDone){var C=App.moduleList.length;for(var F=0;F<C;F++){if(!App.moduleList[F].content){continue}try{if(typeof App.moduleList[F].dataObj.extendSearch=="number"){App.moduleList[F].dataObj.extendSearch=(App.dlaFilter)?0:1;App.moduleList[F].content.doSearch(App.query)}else{if(!A){if(typeof App.moduleList[F].content.doSearch=="function"){App.moduleList[F].content.doSearch(D)}}}}catch(E){}}}}}else{if(document.location.search&&document.location.search.indexOf("?q=")!=-1){document.location.search=""}else{App.isOnSearch=false;App.searchDone=false;Element.removeClassName(document.body,"search");App.searchBoxClear.style.display="none";App.searchBoxInput.setDefaultState();for(var F=0;F<C;F++){if(!App.moduleList[F].content){continue}App.moduleList[F].dataObj.status=App.moduleList[F].dataObj.oldStatus;App.moduleList[F].dataObj.oldStatus=-1;try{if(typeof App.moduleList[F].content.doSearch=="function"){App.moduleList[F].content.doSearch("");if(typeof App.moduleList[F].dataObj.data.oldQuery=="string"){App.moduleList[F].dataObj.data.oldQuery=""}}App.moduleList[F].restoreStatus()}catch(E){}}}}};;
var ModalDialog=new Class({Implements:Options,options:{className:"modalDialog nv-settings",overlayClassName:"overlay_dialog",showCenter:true,showCloseButton:true,showTitle:true,minWidth:300,minHeight:200,width:650,height:450,zoomEffect:null,fadeEffect:false,onClosed:$empty,draggable:false},initialize:function(C,A){this.setOptions(A);if(App.isPremium()){this.options.showCenter=false}this.container=$(C);if(!this.container){this.container=new Element("div");this.container.setAttribute("id",C);this.container.className=this.options.className;this.container.style.display="none";this.container.style.position="absolute";this.container.style.zIndex=9000;document.body.appendChild(this.container)}this.innerFrame=new Element("div",{"class":"innerFrame"}).inject(this.container);if(this.options.showTitle){this.heading=document.createElement("h1");this.innerFrame.appendChild(this.heading)}if(this.options.showCloseButton){var B=Netvibes.UI.createIcon("actions-window-close close",_("Close"),16,16);this.container.appendChild(B);Event.observe(B,"click",this.hide.bindAsEventListener(this))}this.eventResize=this.onResized.bindAsEventListener(this);Event.observe(window,"resize",this.eventResize);if(Browser.isOpera&&Browser.version<9){this.options.fadeEffect=false}if(this.options.draggable){new Drag.Move(this.container,{handle:this.heading})}},disableScreen:function(A){this.overlay=new Overlay({fadeEffect:this.options.fadeEffect,hideOnClick:this.options.hideOverlayOnClick});this.overlay.addEvent("show",this._showDialog.bind(this));this.overlay.show()},enableScreen:function(){var A=$("nv-overlay");if(this.overlay.elm){this.overlay.hide()}},fixIEOverlapping:function(){Position.clone(this.container,this.iefix);this.iefix.style.zIndex=this.container.style.zIndex-1;Element.show(this.iefix)},show:function(){if(this.showing||this.hidding){return }this.showing=true;this.disableScreen();if(!this.options.fadeEffect){this._showDialog()}},_showDialog:function(){var B=Element.getDimensions(this.container);if(this.options.showCenter){this._centerDialog()}else{var C=this.options.width;var A=B.height;var F=Browser.getScrollTop();var E=30;var D=(Browser.getClientWidth()-C)/2+Browser.getScrollLeft();this.setPlacement(E,D,C,A)}if(Browser.getClientHeight()<B.height){$(document.body).setStyle("overflow","auto")}if(!this.iefix&&Browser.isIE&&(navigator.userAgent.indexOf("Opera")<0)){this.container.insertAdjacentHTML("afterEnd",'<iframe id="'+this.container.id+'_iefix" style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" src="javascript:false;" frameborder="0" scrolling="no"></iframe>');this.iefix=$(this.container.id+"_iefix")}if(this.iefix){setTimeout(this.fixIEOverlapping.bind(this),50)}if(typeof this.onShow=="function"){this.onShow()}Element.show(this.container);this.showing=false},hide:function(A){if(this.showing||this.hidding){return }if(App.isSmartReader){$(window).fireEvent("resize")}this.hidding=true;Element.hide(this.container);if(typeof this.onClose=="function"){this.onClose()}if(this.iefix){Element.hide(this.iefix)}this.hidding=false;if(A){this.enableScreen()}this.options.onClosed();if(!this.options.fadeEffect){this.hidding=false}if(App.isSmartReader){$(document.body).setStyle("overflow","hidden")}},isVisible:function(){return Element.visible(this.container)},setTitle:function(A){if(this.heading){this.heading.innerHTML=A}},setPlacement:function(D,C,B,A){if(D<0){D=0}if(C<0){C=0}if(B<this.options.minWidth){B=this.options.minWidth}if(A<this.options.minHeight){A=this.options.minHeight}Element.setStyle(this.container,{top:D+"px",left:C+"px",width:B+"px"})},updatePlacement:function(A){if(this.options.showCenter){this._centerDialog()}},onResized:function(A){if(this.isVisible()){this.updatePlacement(A)}},onScroll:function(A){},setSize:function(B,A){this.options.width=B;this.options.height=A;this.container.style.width=this.options.width+"px";this.container.style.height=this.options.height+"px";this.updatePlacement()},_centerDialog:function(){var B=Element.getDimensions(this.container);var C=this.options.width;var A=B.height;var F=Browser.getScrollTop();var E=(Browser.getClientHeight()-A)/2+Browser.getScrollTop()+F;var D=(Browser.getClientWidth()-C)/2+Browser.getScrollLeft();this.setPlacement(E/2,D,C,A)},destroy:function(){this.container.destroy();Event.stopObserving(window,"resize",this.eventResize);Event.stopObserving(window,"scroll",this.eventResize)}});var Overlay=new Class({Implements:[Events,Options],options:{id:"nv-overlay",className:"overlay_dialog",fadeEffect:true,opacity:0.6,duration:200,hideOnClick:true},initialize:function(A){this.setOptions(A);this.elm=$(this.options.id);this.isClear=false;if(!this.elm){this.elm=new Element("div",{id:this.options.id,"class":this.options.className,styles:{display:"none",position:"absolute",top:0,left:0,width:"100%"}}).inject(document.body);if(this.options.hideOnClick){this.elm.addEvent("click",this.hide.bindWithEvent(this))}this.adapt();var B=this.adapt.bind(this);$(window).addEvent("scroll",B);$(window).addEvent("resize",B);this.addEvent("hide",function(){$(window).removeEvent("resize",B);$(window).removeEvent("scroll",B)})}if(Browser.isOpera&&Browser.version<9){this.elm.style.background="none"}return this},adapt:function(B){if(B){B.stop()}var A=Browser.getDocumentHeight();if(A<Browser.getClientHeight()){A=Browser.getClientHeight()}this.elm.setStyles({height:A+"px"});return this},setClear:function(){if(this.isClear){return }if(App.pageCustom.enableFx=="1"&&this.options.fadeEffect){var A=new Fx.Morph(this.elm,{duration:this.options.duration,wait:false});A.start({opacity:[this.options.opacity,0]})}else{this.elm.setOpacity(0)}this.isClear=true},setDark:function(){if(!this.isClear){return }if(App.pageCustom.enableFx=="1"&&this.options.fadeEffect){var A=new Fx.Morph(this.elm,{duration:this.options.duration,wait:false});A.start({opacity:[0,this.options.opacity]})}else{this.elm.setOpacity(this.options.opacity)}this.isClear=false},show:function(B){if(B){B.stop()}if(Browser.isIE&&Browser.version<7){$A(document.getElementsByTagName("select")).each(function(C){if(Element.visible(C)&&C.id!="optionUnreadPosition"){C.setAttribute("autohide","autohide");Element.show(C)}})}if(App.pageCustom.enableFx=="1"&&this.options.fadeEffect&&!this.isClear){this.elm.setOpacity(0);this.elm.show();var A=new Fx.Morph(this.elm,{duration:this.options.duration,wait:false});A.start({opacity:[0,this.options.opacity]}).chain(function(){this.fireEvent("show")}.bind(this))}else{this.elm.show();this.fireEvent("show")}return this},hide:function(B){if(B){B.stop()}if(Browser.isIE&&Browser.version<7){$A(document.getElementsByTagName("select")).each(function(C){if(C.getAttribute("autohide")=="autohide"){C.setAttribute("autohide","");Element.show(C)}})}this.fireEvent("beforeHide");if(App.pageCustom.enableFx=="1"&&this.options.fadeEffect&&!this.isClear){var A=new Fx.Morph(this.elm,{duration:this.options.duration,wait:false});A.start({opacity:[this.options.opacity,0]}).chain(function(){this.elm.destroy();this.fireEvent("hide")}.bind(this))}else{this.elm.destroy();this.fireEvent("hide")}return this}});;
App.Drag={scrollPos:null,obj:null,init:function(C,D,B){if(B==null){C.onmousedown=App.Drag.start}C.root=D;if(isNaN(parseInt(C.root.style.left))){C.root.style.left="0px"}if(isNaN(parseInt(C.root.style.top))){C.root.style.top="0px"}C.root.onDragStart=new Function();C.root.onDragEnd=new Function();C.root.onDrag=new Function();if(B!=null){var A=App.Drag.obj=C;B=App.Drag.fixE(B);var F=parseInt(A.root.style.top);var E=parseInt(A.root.style.left);A.root.onDragStart(E,F,B.clientX,B.clientY);A.lastMouseX=B.clientX;A.lastMouseY=B.clientY;document.onmousemove=App.Drag.drag;document.onmouseup=App.Drag.end}},start:function(B){B=App.Drag.fixE(B);if(B.which==3||(B.button==2)){return true}var A=App.Drag.obj=this;var D=parseInt(A.root.style.top);var C=parseInt(A.root.style.left);A.root.onDragStart(C,D,B.clientX,B.clientY);A.lastMouseX=B.clientX;A.lastMouseY=B.clientY;document.onmousemove=App.Drag.drag;document.onmouseup=App.Drag.end;App.Drag.scrollPos=App.scrollPos();return false},drag:function(I){I=App.Drag.fixE(I);var H=App.Drag.obj;var G=I.clientY;var F=I.clientX;var E=parseInt(H.root.style.top);var D=parseInt(H.root.style.left);var B,C;B=D+F-H.lastMouseX;C=E+G-H.lastMouseY;var A=App.scrollPos();C-=App.Drag.scrollPos-A;App.Drag.scrollPos=A;H.root.style.left=B+"px";H.root.style.top=C+"px";H.lastMouseX=F;H.lastMouseY=G;H.root.onDrag(B,C,I.clientX,I.clientY);return false},end:function(){document.onmousemove=null;document.onmouseup=null;App.Drag.obj.root.onDragEnd(parseInt(App.Drag.obj.root.style.left),parseInt(App.Drag.obj.root.style.top));App.Drag.obj=null},fixE:function(A){if(typeof A=="undefined"){A=window.event}if(typeof A.layerX=="undefined"){A.layerX=A.offsetX}if(typeof A.layerY=="undefined"){A.layerY=A.offsetY}return A}};;
App.Drag=App.Drag||{};App.Drag.cache=new Hash();App.Drag.clearCache=function(A){if(A){App.Drag.cache=new Hash()}else{App.Drag.cache.each(function(C,B){if(C.type!="li"){delete App.Drag.cache[B]}})}};App.DragModule=new Class({Extends:Sortables,initialize:function(A,B){this.parent(A,B);this.tabDrag_zone=$$("#divTabs li");this.scroller=new Scroller(window);this.overlay=new Overlay({fadeEffect:false,hideOnClick:false,id:"dragOverlay",className:null});this.overlay.elm.setStyles({"z-index":200})},addModule:function(B){if(typeof B.dataObj.id=="undefined"){var A=arguments.callee.bind(this);setTimeout(function(){A(B)},1000);return this}this.modules=this.modules||{};this.modules[B.dataObj.id]=B;this.addItems(B.elm_module);return this},updateModuleId:function(B,A){this.modules[A]=this.modules[B]},getDroppables:function(){var A=this.list?this.list.getChildren():[];this.tabDrag_zone=$$("#divTabs li").erase(App.selectedTabObj.elm);A.combine(this.tabDrag_zone);if(!this.options.constrain){A=this.lists.concat(A).erase(this.list)}return A.erase(this.clone).erase(this.elementGhost)},insert:function(E,B){if(this.tabDrag_zone.contains(B)){E.addClass("transparent");this.elementGhost.style.display="none";App.Drag.clearCache(true);var D=null;for(var F=0,C;C=App.tabList[F++];){if(C.elm==B){D=C;break}}if(D&&D.dataObj.type!="search"){D.elm.addClass("dndTarget");if(!App.tabDrag||D!=App.tabDrag){window.clearTimeout(App.timerTabSwitch);App.timerTabSwitch=window.setTimeout(function(){if(App.tabDrag){App.tabDrag.switchTo();D.elm.removeClass("dndTarget");App.tabDrag=false;this.elementGhost.inject(App.ColManager.col1,"top");this.elementGhost.style.display="block";App.Drag.clearCache()}}.bind(this),1000)}App.tabDrag=D}return }if(App.selectedTabObj.dataObj.type=="search"){return }var A="top";if(this.drag.mouse.now.y>(this.element.getPosition().y-this.element.getSize().y/2)){A="bottom"}if(this.lists.contains(B)){this.list=B;this.drag.droppables=this.getDroppables()}else{A=this.elementGhost.getAllPrevious().contains(B)?"before":"after"}this.elementGhost.inject(B,A);this.elementGhost.style.display="block";App.Drag.clearCache();if(this.element.style.display!="none"&&(this.elementGhost.getPrevious()==this.element||this.elementGhost.getNext()==this.element)){this.elementGhost.setStyle("display","none");App.Drag.clearCache()}App.LayoutManager.adjustColumnHeight();this.fireEvent("sort",[this.element,this.clone])},leaveZone:function(B,A){if(this.tabDrag_zone.contains(A)){A.removeClass("dndTarget");B.removeClass("transparent");if(App.tabDrag){window.clearTimeout(App.timerTabSwitch);App.tabDrag=null}}},start:function(C,B){if(!this.idle){return }this.idle=false;this.element=B;this.clone=this.getClone(C,B);var D=this.type=="item"?this.clone:this.element;this.elementGhost=($("moduleGhost")||new Element("div",{id:"moduleGhost"})).setStyles({height:D.getSize().y,display:"none"});this.opacity=B.get("opacity");this.list=B.getParent(".column");this.orginalTab=App.selectedTabObj;if($("tooltip")){$("tooltip").hide()}if($("maintable")){var A=$("divTabs").getPosition();this.appLimit=$("maintable").getPosition();this.appLimit.y=A.y}this.drag=new Drag.Move(this.clone,{preventDefault:true,snap:this.options.snap,container:this.options.constrain&&this.element.getParent(),droppables:this.getDroppables(),onSnap:function(){C.stop();this.overlay.elm.show();$("modulesArea").addClass("editMode");App.draggingItem=true;this.clone.setStyle("visibility","visible");this.element.set("opacity",this.options.opacity||0);App.LayoutManager.adjustColumnHeight();this.scroller.start();this.fireEvent("start",[this.element,this.clone])}.bind(this),onDrag:this.onDrag.bind(this),onEnter:this.insert.bind(this),onLeave:this.leaveZone.bind(this),onCancel:this.reset.bind(this,"cancel"),onComplete:this.end.bind(this)});App.Drag.clearCache();this.drag.checkAgainst=function(F){F=F.getCoordinates_cache(App.Drag.cache);var E=this.mouse.now;return(E.x>F.left&&E.x<F.right&&E.y<F.bottom&&E.y>F.top)}.bind(this.drag);this.drag.start(C)},onDrag:function(){if(this.drag.mouse.now.y<this.appLimit.y&&this.elementGhost.style.display!="none"){this.drag.droppables.push(this.elementGhost.getParent());this.elementGhost.setStyle("display","none");App.Drag.clearCache()}},end:function(){this.drag.detach();var A;if(this.elementGhost.style.display=="block"){A=this.elementGhost;if(this.type!="item"){this.element.style.display="none";App.Drag.clearCache()}}else{if(App.tabDrag){window.clearTimeout(App.timerTabSwitch);A=App.tabDrag.elm;App.tabDrag.elm.removeClass("dndTarget");if(this.type!="item"){this.element.style.display="none"}}else{A=this.element}}this.element.set("opacity",1);if(this.effect){var B=A.getStyles("width","height");var C=this.clone.computePosition(A.getPosition(this.clone.offsetParent));this.effect.element=this.clone;this.effect.start({top:C.top,left:C.left,width:B.width,height:B.height,opacity:0.25}).chain(this.reset.bind(this))}else{this.reset()}},reset:function(A){delete App.draggingItem;App.Drag.clearCache(true);this.overlay.elm.hide();$("modulesArea").removeClass("editMode");this.idle=true;this.clone.destroy();this.scroller.stop();this.element.removeAttribute("style");if(A!="cancel"){this.fireEvent("complete",this.element)}}});App.getDragModuleFactory=function(){App.DragModuleFactory=App.DragModuleFactory||new App.DragModule("div.column",{revert:parseInt(App.pageCustom.enableFx)?{duration:300}:false,handle:"div.moduleHeaderContainer",clone:function(C,D,G){var A=C.event;var I=window.getScroll();var B=D.dataObj||$unlink(D.retrieve("dataObj"));var H=D.getElement(".hicon");var E=H?H.clone():null;var F=D.className.match(/(\w+)-module/)?D.className.match(/(\w+)-module/):["",""];return new Element("table",{id:"moduleClone"}).adopt(new Element("tbody").adopt(new Element("tr").adopt(new Element("td",{styles:{height:"20px","vertical-align":"top"}}).adopt(new Element("div",{"class":F[0]}).adopt(new Element("div",{"class":"moduleHeaderContainer"}).adopt(new Element("div",{"class":"moduleHeader "+F[1]}).adopt(E))))),new Element("tr").adopt(new Element("td",{text:B.title,styles:{"vertical-align":"middle","text-align":"center",height:"75%"}})))).setStyles({top:A.clientY-25+I.y,left:A.clientX-50+I.x}).inject(document.body)},opacity:0.5,onComplete:function(){if(this.elementGhost.style.display=="none"&&!App.tabDrag){return }var A=this.modules[this.element.dataObj.id];if(A.content&&typeof A.content.resize=="function"){A.content.resize.delay(500,this)}(App.tabDragManage.bind(this))(A);App.Modules.saveModulePosition(A);App.tabDrag=null;App.LayoutManager.setDefaultColHeight()}});return App.DragModuleFactory};App.DragItem=new Class({Extends:App.DragModule,initialize:function(A,B){this.type="item";this.refStacks={};this.parent(A,B)},addItem:function(D,A,C,B){$(D).store("dataObj",$unlink(A));D.store("getClone",C);if(B){if(this.refStacks[B]==undefined){this.refStacks[B]=[]}this.refStacks[B].push(D)}this.addItems(D)},removeItem:function(B){$(B).eliminate("dataObj");B.eliminate("getClone");this.elements.remove(B);var A=B.retrieve("sortables:start",this.start.bindWithEvent(this,B));B.removeEvent("mousedown",A);B.eliminate("sortables:start")},clearStack:function(A){if(this.refStacks[A]!=undefined){this.refStacks[A].each(this.removeItem.bind(this));this.refStacks[A]=[]}},insert:function(B,A){if(A.hasClass("widget")){return }this.parent(B,A)}});App.getDragItemFactory=function(){if(App.visit&&!App.visit.my||App.isSmartReader){return{addItem:$empty}}App.DragItemFactory=App.DragItemFactory||new App.DragItem("div.column",{revert:parseInt(App.pageCustom.enableFx)?{duration:300}:false,handle:"div.moduleHeaderContainer",clone:function(E,C,G){var F=E.event;var A=window.getScroll();var D=C.retrieve("getClone");var H=(D&&typeof D=="function")?D(E,C,G):C.clone(true);if(C.retrieve("richIcon")){H.getFirst("img").src=C.retrieve("richIcon")}var B=new Element("div",{id:"ghostContainer"});H.inject(B);H=B;var F=E.event;var A=window.getScroll();return H.setStyles({position:"absolute",zIndex:"3000",visibility:"hidden",cursor:"move",top:F.clientY-(C.getSize().y/2)+A.y,left:F.clientX-(C.getSize().x/2)+A.x}).inject(document.body)},opacity:0.5,onComplete:function(){if(this.elementGhost.style.display=="none"&&!App.tabDrag){return }this.elementGhost.getParent().setStyle("height","auto");var A=new Module($extend($unlink(this.element.retrieve("dataObj")),{admin:false}),{nativise:true}).load();this.element=A.elm_module;(App.tabDragManage.bind(this))(A);App.moduleList.push(A);App.Modules.store(A);App.tabDrag=null}});return App.DragItemFactory};App.tabDrag=false;App.tabDragManage=function(B){if(!App.tabDrag){this.elementGhost.style.display="none";this.element.inject(this.elementGhost,"before");this.element.style.display="block";App.Drag.clearCache()}else{this.element.inject(App.ColManager.col1,"top");this.element.style.display="none"}var A;if(App.tabDrag){B.dataObj.tab=App.tabDrag.dataObj.id;B.dataObj.container=1;A=App.tabDrag}else{B.dataObj.tab=App.selectedTab;B.dataObj.container=this.element.getParent().getAttribute("colNum");A=App.selectedTabObj}if(B.dataObj.tab!=this.orginalTab.dataObj.id){A.unRead[B.dataObj.id]=this.orginalTab.unRead[B.dataObj.id];A.setTitle();this.orginalTab.unRead[B.dataObj.id]=0;this.orginalTab.setTitle()}};;
var Module=new Class({Implements:[Events,Options],options:{confirmOnClose:true,nativise:false,editable:true,preview:false,draggable:true},initialize:function(B,A){this.setOptions(A);if(!B.tab){B.tab=App.selectedTab}if(typeof B.status=="undefined"){B.status=1}this.dataObj=B;if(!App.Modules[B.moduleName+"Infos"]){return false}this.editMode=false;this.loaded=false;this.loading=false;this.onqueue=false;this.previewMode=!!(this.options.preview);this.refreshMode=false;this.unRead=0;this.dontUnHighlight=false;this.readOnly=App.staticUniverse;this.saveTimeout=null;this.saveHistoryTimeout=null;if(this.options.nativise){this.dataObj=App.Modules.nativiseModule(this.dataObj)}if($type(this.dataObj.data)=="array"&&!this.dataObj.data.length){this.dataObj.data={}}if(B.moduleName!="RssReader"){this.ico=App.Modules[B.moduleName+"Infos"].ico}},getIdentifier:function(){var B=false;if(typeof this.content!="undefined"&&typeof this.content.getIdentifier=="function"){B=this.content.getIdentifier()}if(!B){switch(this.dataObj.moduleName){case"Flash":B=this.dataObj.data.flashUrl;break;case"RssReader":B=this.dataObj.data.feedId;break;case"Ical":B=this.dataObj.data.icalUrl;break;case"Api":case"UWA":B=this.dataObj.data.moduleUrl;break;case"MultipleFeeds":B=this.dataObj.data.provider;if(B=="custom"){var A=this.dataObj.data.url.match(/\/\d+/g);var C=A.map(function(D){return D.substr(1)}).join("");B="custom:"+C}break}}if(!B){B=-1}return B},reportView:function(){var B,A={name:this.dataObj.moduleName,id:this.dataObj.id};if(B=this.getIdentifier()){A.ident=B}if(this.dataObj.campaignId){A.campaignId=this.dataObj.campaignId}App.report("module.view",A)},enableDragging:function(){if(!this.options.draggable||this.previewMode||this.readOnly){this.elm_moduleHeader.style.cursor="default";return false}this.previewMode=false;this.elm_moduleHeader.style.cursor="move";var A=this.elm_moduleHeader;App.getDragModuleFactory().addModule(this)},build:function(){if(this.elm_module){return true}this.elm_module=$("m"+this.dataObj.id);var C=!!this.elm_module;if(!C){this.elm_module=new Element("div",{"class":"module"})}this.elm_module.addEvent("mouseover",this.highlight.bind(this));this.elm_module.addEvent("mouseleave",this.unHighlight.bind(this));if(this.dataObj.moduleName=="Meebo"){this.elm_module.style.position="static"}this.elm_module.dataObj=this.dataObj;if(C){var B=this.elm_module.getFirst();var D=B.getFirst();this.elm_editContent=B.getElement(".editContent");this.elm_moduleContent=this.elm_editContent.getNext()}else{var B=new Element("div",{"class":"moduleFrame moduleunHighlight"});var D=new Element("div",{"class":"moduleHeaderContainer"}).inject(B);this.elm_editContent=new Element("div",{"class":"editContent"}).inject(B);this.elm_moduleContent=new Element("div",{"class":"moduleContent"}).inject(B);this.elm_moduleContent.innerHTML=_("Loading ...")}if(this.dataObj.status==0){this.elm_moduleContent.style.display="none"}if(C){this.elm_moduleHeader=D.getFirst();this.elm_title=this.elm_moduleHeader.getElement(".title")}else{this.elm_moduleHeader=new Element("div",{"class":"moduleHeader"}).inject(D);this.elm_title=new Element("h2",{"class":"title",text:this.dataObj.title})}if(C){this.elm_showHide=this.elm_moduleHeader.getElement(".showHide")}else{this.elm_showHide=new Element("a",{"class":"showHide"})}this.elm_showHide.set({href:"javascript:void(0)",styles:{visibility:"hidden"},events:{mousedown:this.onCollapseExpand.bindWithEvent(this)}}).adopt(Netvibes.UI.createIcon(this.dataObj.status==0?"actions-window-expand":"actions-window-collapse",this.dataObj.status==0?_("Expand"):_("Collapse"),15,15));if(C){this.elm_ico=this.elm_moduleHeader.getElement(".ico")}else{this.elm_ico=new Element("a",{"class":"ico",href:"javascript:void(0)"})}if(this.ico&&this.dataObj.moduleName!="RssReader"){var A;if(A=App.iconMapper(this.ico)){this.elm_ico.innerHTML='<img width="16" height="16" src="'+App.getStaticUrl(NV_PATH+"img/s.gif")+'" style="width: 16px; height: 16px; background-image: url(\''+App.getStaticUrl(NV_PATH+A[0])+"'); background-position: -"+A[1]+"px -"+A[2]+'px;" class="hicon" />'}else{this.elm_ico.innerHTML='<img width="16" height="16" src="'+this.ico+'" class="hicon" />';if(!Browser.isOpera){this.elm_ico.firstChild.style.display="none"}this.elm_ico.firstChild.onload=function(){this.style.display="block"}}if(App.pageCustom.hideFavIcons=="1"){this.elm_ico.firstChild.style.visibility="hidden"}}if(C){this.elm_actions=this.elm_moduleHeader.getElement(".actions")}else{this.elm_actions=new Element("span",{"class":"actions"})}if(!this.readOnly){this.elm_options=new Element("a",{"class":"options",href:"javascript:void(0)",styles:{display:"none"},events:{mousedown:this.showPopupMenu.bindWithEvent(this)}}).adopt(Netvibes.UI.createIcon("actions-view-options",_("Options"),13,16));this.elm_edit=Netvibes.UI.createIconText("actions-view-editModule edit",_("Edit"),16,16);this.elm_edit.addEvent("mousedown",this.onEnterEdit.bindWithEvent(this));this.elm_close=new Element("a",{"class":"close",href:"javascript:void(0)",events:{mousedown:this.onClosing.bindWithEvent(this)}}).adopt(Netvibes.UI.createIcon("actions-window-close",_("Close"),13,16))}this.elm_shareModule=Netvibes.UI.createIconText("actions-view-shareModule edit share",_("Share"),16,16);this.elm_shareModule.addEvent("mousedown",this.onShareWidget.bindWithEvent(this));this.elm_refresh=new Element("a",{"class":"refresh",href:"javascript:void(0)",styles:{display:"none"},events:{mousedown:this.refresh.bindWithEvent(this)}}).adopt(Netvibes.UI.createIcon("actions-view-refresh",_("Refresh"),12,16));this.elm_add=this.elm_moduleHeader.getElement(".info");this.elm_add=document.createElement("span");this.elm_add.className="info";this.elm_add.style.display="none";if(!C){this.elm_moduleHeader.appendChild(this.elm_actions)}if(!this.readOnly){this.elm_actions.appendChild(this.elm_close);this.elm_actions.appendChild(this.elm_edit);this.elm_actions.appendChild(this.elm_shareModule);this.elm_actions.appendChild(this.elm_refresh);this.elm_actions.appendChild(this.elm_options);this.elm_actions.appendChild(this.elm_add);if(C){this.enableDragging()}}else{this.elm_actions.appendChild(this.elm_shareModule);this.elm_actions.appendChild(this.elm_refresh);this.elm_actions.appendChild(this.elm_add)}if(!C){this.elm_moduleHeader.appendChild(this.elm_showHide);this.elm_moduleHeader.appendChild(this.elm_ico);this.elm_title.inject(this.elm_moduleHeader);this.elm_module.appendChild(B)}this.colorize();this.unHighlight();return this.elm_module},onEnterEdit:function(B){B.stop();var A=$("shareModuleBalloon");if(A){A.hide()}var C=$("modulePopupMenu");if(C){C.hide()}if(this.editMode){this.editMode=false;if(this.elm_edit.hasClass("iconText")){this.elm_edit.set("text",_("Edit"))}this.elm_editContent.innerHTML="";this.elm_editContent.style.display="none";this.elm_module.removeClass("moduleEdit");this.elm_module.addClass("module");App.keyboardFocus="module";if(typeof this.content.onCloseEdit=="function"){this.content.onCloseEdit()}if(App.isOnSearch&&this.dataObj.editStatus==0){this.hide()}}else{this.editModule()}},setUnread:function(A){if(A==undefined){A=this.unread}else{this.unread=A}App.setTabUnread(this.dataObj.id,this.dataObj.tab,A)},showPopupMenu:function(K,O){Event.stop(K);var H=$("shareModuleBalloon");if(H&&Element.visible(H)){Element.remove(H)}this.popupMenu=$("modulePopupMenu");if(!this.popupMenu){this.popupMenu=new Element("div",{id:"modulePopupMenu","class":"modulePopupMenu",styles:{display:"none",position:"absolute"}}).inject(document.body);Event.observe(document,"mousedown",this.hidePopupMenu.bindAsEventListener(this));Event.observe(document,"mousedown",App.hideModulePopupMenu,true)}if(Element.visible(this.popupMenu)&&this.dataObj.id==this.popupMenu.getAttribute("moduleId")){this.hidePopupMenu();return }var B=[];if(!App.isSmartReader&&typeof this.content.print=="function"&&!(Browser.isOpera||Browser.isIE)){B.push({name:"print",className:"print",text:_("Print this module")})}if(!App.staticUniverse){if(!App.isSmartReader){B.push({name:"clone",className:"clone separator",text:_("Duplicate this module")})}B.push({name:"color",className:"color",text:"color"});if(!App.isSmartReader){B.push({name:"moveTop",className:"moveTop",text:_("Move to top")});B.push({name:"moveUp",className:"moveUp",text:_("Move up")});B.push({name:"moveRight",className:"moveRight",text:_("Move right")});B.push({name:"moveLeft",className:"moveLeft",text:_("Move left")});B.push({name:"moveDown",className:"moveDown",text:_("Move down")});B.push({name:"moveBottom",className:"moveBottom",text:_("Move to bottom")})}}this.popupMenu.setAttribute("moduleId",this.dataObj.id);this.popupMenu.innerHTML="";var D=document.createElement("ul");this.popupMenu.appendChild(D);for(var F=0,A;A=B[F];F++){var P=document.createElement("li");P.setAttribute("name",A.name);if(A.className){P.className=A.className}if((B.length-1)==F){Element.addClassName(P,"last")}if(F==0){Element.addClassName(P,"first")}if(!App.isSmartReader){if((A.name=="moveTop"||A.name=="moveUp")&&!App.LayoutManager.canMovePositionUp(this)){continue}else{if((A.name=="moveDown"||A.name=="moveBottom")&&!App.LayoutManager.canMovePositionDown(this)){continue}else{if(A.name=="moveLeft"&&!App.LayoutManager.canMovePositionLeft(this)){continue}else{if(A.name=="moveRight"&&!App.LayoutManager.canMovePositionRight(this)){continue}}}}}var N=document.createElement("a");N.href=(A.htmlUrl||"javascript:void(0)");if(A.name=="collapse"){Element.addClassName(P,this.dataObj.status?"collapse":"expand");N.appendChild(document.createTextNode(this.dataObj.status?_("Collapse"):_("Expand")))}else{if(A.name=="color"){Element.addClassName(N,"postItcolorSelection");if(!Browser.isIE||Browser.version>=7){N.style.height="16px"}else{N.style.paddingBottom="16px"}var J='<div class="red" myColor="red"></div><div class="orange" myColor="orange"></div><div class="yellow" myColor="yellow"></div><div class="green" myColor="green"></div><div class="blue" myColor="blue"></div><div class="white" myColor="white"></div><div class="borderless" myColor="borderless"></div><div class="unpaint" myColor="unpaint" title="'+_("Default color")+'"></div>';N.innerHTML=J;var L=N.getElementsByTagName("div").length;for(var M=0;M<L;M++){N.getElementsByTagName("div")[M].onclick=function(R){var Q=this.parentNode.parentNode;Q.setAttribute("name",this.getAttribute("myColor"))}}}else{N.appendChild(document.createTextNode(A.text))}}P.onclick=this.eventMenuItemClicked.bindAsEventListener(this);P.appendChild(N);D.appendChild(P)}var G=this[(O?"elm_sendModule":"elm_options")].getPosition();var C=Element.getDimensions(this.popupMenu).width;this.popupMenu.style.top=G.y+20+"px";this.popupMenu.style.left=G.x-(App.dirRTL?C-305:C/2)+"px";if(Browser.isIE){var I=this.elm_editContent.getElementsByTagName("select");for(var E=0;E<I.length;E++){Element.addClassName(I[E],"hidden")}}this.dontUnHighlight=true;Element.show(this.popupMenu)},hidePopupMenu:function(D){if(!this.popupMenu){return }var C=$("shareModuleBalloon");if(C&&Element.visible(C)){return true}if(D&&Position.within(this.popupMenu,Event.pointerX(D),Event.pointerY(D))){Event.stop(D);return false}if(Browser.isIE){var B=this.elm_editContent.getElementsByTagName("select");for(var A=0;A<B.length;A++){Element.removeClassName(B[A],"hidden")}}this.dontUnHighlight=false;this.unHighlight();Element.hide(this.popupMenu);Event.stopObserving(document,"mousedown",this.hidePopupMenu);this.popupMenu=null},eventMenuItemClicked:function(D){var B=Event.findElement(D,"LI");if(Element.hasClassName(B,"disabled")){return }var C=$("shareModuleBalloon");if(C&&Element.visible(C)){Element.remove(C)}var A=B.getAttribute("name");switch(A){case"collapse":this.collapseExpand();break;case"edit":this.editModule.bindWithEvent(this);break;case"clone":App.Modules.cloneModule(this);break;case"moveUp":App.LayoutManager.movePositionUp(this);break;case"moveDown":App.LayoutManager.movePositionDown(this);break;case"moveTop":App.LayoutManager.movePositionTop(this);break;case"moveBottom":App.LayoutManager.movePositionBottom(this);break;case"moveLeft":App.LayoutManager.movePositionLeft(this);break;case"moveRight":App.LayoutManager.movePositionRight(this);break;case"white":case"yellow":case"green":case"red":case"blue":case"borderless":case"orange":this.dataObj.data.color=A;this.colorize(true);break;case"unpaint":delete this.dataObj.data.color;this.colorize(true);break;case"print":App.Modules.printModule(this);break}this.hidePopupMenu();Event.stop(D)},addModuleToPage:function(A){this.previewMode=false;this.dataObj.tab=A||App.selectedTab;if(!App.isSmartReader){if(App.selectedTabObj&&App.selectedTabObj.dataObj.type=="search"){new App.UI.ConfirmDialog({titleText:_("Can't install this widget here"),message:"<p>"+_("Please install this widget inside another tab.")+"</p>",confirm:{text:_("Close")},discard:{text:""},cancelText:""}).show();return false}if(!this.dataObj.container){if(DefaultColForLayout&&App.selectedTabObj.dataObj.layout){this.dataObj.container=DefaultColForLayout[App.selectedTabObj.dataObj.layout][App.dirRTL?"rtl":"ltr"]}else{this.dataObj.container=App.dirRTL?App.selectedTabObj.dataObj.cols:1}}if(this.widget&&this.widget.isIframed){var B=new Module(this.dataObj,{nativise:true}).inject().load();this.elm_module=B.elm_module;return B}else{this.inject();if(this.content&&typeof this.content.resize=="function"){this.content.resize.delay(500,this)}return this}}else{return this}},updateFavicon:function(B,A){if(typeof A=="undefined"||A){this.ico=App.getFaviconUrl(B)}else{this.ico=B}if(!this.elm_ico){return }var C=this.elm_ico.getElement("img")||new Element("img",{"class":"hicon",width:"16",height:"16"}).inject(this.elm_ico);C.src=this.ico;if(App.pageCustom.hideFavIcons=="1"){C.style.display="none";this.elm_ico.style.width="16px";this.elm_ico.firstChild.style.visibility="hidden"}else{C.style.display="block"}C.onload=function(){this.style.display="block"};this.fireEvent("updateFavicon",{moduleId:this.dataObj.id,iconUrl:C.src})},refresh:function(A){if(typeof this.content.refresh=="function"){this.reportView();this.content.refresh()}if(A){A.stop()}},share:function(){var A={id:this.dataObj.id,title:this.dataObj.title,picture:App.Modules[this.dataObj.moduleName+"Infos"].richIcon,type:"widget"};if(this.dataObj.widgetId){A.widgetId=this.dataObj.widgetId}App.Share.show(A)},colorize:function(F){if(F){var B=["white","yellow","green","red","blue","orange","borderless"];for(var D=0,A=B.length;D<A;D++){var E=B[D];this.elm_moduleHeader.removeClass(E);if(this.dataObj.moduleName=="PostIt"){this.elm_module.removeClass(E+"-webnote")}this.elm_module.removeClass(E+"-module")}this.save()}var C=this.dataObj.data.color;if(!C&&this.dataObj.moduleName=="PostIt"){C="yellow"}if(C){this.elm_moduleHeader.addClass(C);if(this.dataObj.moduleName=="PostIt"){this.elm_module.addClass(C+"-webnote")}this.elm_module.addClass(C+"-module")}if(this.content&&typeof this.content.colorize=="function"){this.content.colorize()}},save:function(A){if(this.dataObj.tempId&&App.Start){return false}if(isNaN(parseInt(this.dataObj.container,10))||this.previewMode){return }if(this.saveTimeout){clearTimeout(this.saveTimeout)}if(typeof this.dataObj.id=="undefined"||this.dataObj.id=="undefined"){this.saveTimeout=setTimeout((function(){this.save()}).bind(this),1000);return }this.saveTimeout=setTimeout((function(){if(A){A.id=this.dataObj.id;App.Request.saveUserData(A.mode,{data:A})}else{App.Request.saveUserData("module.edit",{data:{id:this.dataObj.id,title:this.dataObj.title,arrData:this.dataObj.data}})}}).bind(this),1500);return this},saveHistory:function(){if(this.saveHistoryTimeout){clearTimeout(this.saveHistoryTimeout)}if(isNaN(parseInt(this.dataObj.container,10))){return }this.saveHistoryTimeout=setTimeout((function(){App.Request.saveUserData("history",{data:{id:this.dataObj.id,history:this.dataObj.history}})}).bind(this),1500)},showEdit:function(){this.endEditMode();this.highlight();this.editModule()},endEditMode:function(){this.editMode=false;if(this.elm_edit){this.elm_edit.set("text",_("Edit"));this.elm_editContent.empty();this.elm_editContent.style.display="none"}this.unHighlight();this.elm_module.removeClass("moduleEdit");this.elm_module.addClass("module");App.keyboardFocus="module"},editModule:function(A){this.highlight();this.editMode=true;App.keyboardFocus="module.edit";this.content.edit();Element.removeClassName(this.elm_module,"module");Element.addClassName(this.elm_module,"moduleEdit");this.elm_editContent.style.display="block";if(this.elm_edit.hasClass("iconText")){this.elm_edit.set("text",_("Close Edit"))}if(App.isOnSearch){this.dataObj.editStatus=this.dataObj.status}if(this.elm_moduleContent.style.display=="none"){this.expand()}else{this.expand("nosave")}App.keyboardFocus="module.edit"},highlight:function(){if(!this.editMode){if(!this.previewMode){this.elm_showHide.style.visibility="visible";this.elm_showHide.style.width="16px";this.elm_ico.style.display="none";if(this.elm_options){this.elm_options.style.display="block"}if(this.elm_close){this.elm_close.style.display="block"}this.elm_shareModule.style.display="block";if(this.elm_refresh&&this.refreshMode){this.elm_refresh.style.display="block"}this.elm_actions.addClass("hover")}else{if(this.elm_close){this.elm_close.style.display="none"}this.elm_shareModule.style.display="none"}if(this.elm_edit&&this.loaded&&this.options.editable){this.elm_edit.style.display="block"}}this.elm_module.addClass("hover")},unHighlight:function(){if(this.editMode||this.dontUnHighlight){return }if(this.elm_showHide){this.elm_showHide.style.visibility="hidden";this.elm_showHide.style.width=0}if(this.previewMode){if(this.elm_close){this.elm_close.style.display="none"}if(this.elm_shareModule){this.elm_shareModule.style.display="none"}}if(this.elm_ico){this.elm_ico.style.display="block"}if(this.elm_refresh){this.elm_refresh.style.display="none"}if(this.elm_options){this.elm_options.style.display="none"}this.elm_actions.removeClass("hover");$_("tooltip").style.display="none";this.elm_module.removeClass("hover")},onCollapseExpand:function(A){A.stop();if(this.dataObj.moduleName=="Meebo"){return false}this.collapseExpand()},collapseExpand:function(A){if(this.elm_moduleContent.style.display=="none"||this.elm_moduleContent.style.visibility=="hidden"){this.expand(A)}else{this.collapse(A)}},collapse:function(A){if(this.dataObj.moduleName=="Meebo"){this.elm_moduleContent.style.visibility="hidden"}else{this.elm_moduleContent.style.display="none"}this.elm_showHide.firstChild.className="actions-window-expand";this.elm_showHide.firstChild.alt=this.elm_showHide.firstChild.title=_("Expand");this.dataObj.status=0;if(undefined==A){this.save({mode:"module.status",status:0})}},expand:function(A){if(this.dataObj.moduleName=="Meebo"){this.elm_moduleContent.style.visibility="visible"}else{this.elm_moduleContent.style.display="block"}this.elm_showHide.firstChild.className="actions-window-collapse";this.elm_showHide.firstChild.alt=this.elm_showHide.firstChild.title=_("Collapse");this.dataObj.status=1;if(undefined==A){this.save({mode:"module.status",status:1})}if(this.content&&typeof this.content.resize=="function"){this.content.resize()}},onClosing:function(B){if(B){B.stop()}var A=new App.UI.ConfirmDialog.DeleteWidget(this,{}).show()},onShareWidget:function(A){if(A){A.stop()}this.share()},remove:function(D){if(undefined==D){D=true}var C=null;for(var B=0,A=App.tabList.length;B<A;B++){if(App.tabList[B].dataObj.id==this.dataObj.tab){C=App.tabList[B]}}C.unRead[this.dataObj.id]=0;C.setTitle();App.moduleList.remove(this);this.elm_module.remove();["shareModuleBalloon","modulePopupMenu","minitabsOptions"].each(function(E){E=$(E);if(E){E.hide()}});if(typeof this.content.remove=="function"){this.content.remove()}this.fireEvent("remove",{id:this.dataObj.id});if(D){App.Request.saveUserData("module.close",{data:{id:this.dataObj.id,name:this.dataObj.moduleName}})}return true},restoreStatus:function(){this.elm_module.removeClass("transparent");if(this.dataObj.status==0){this.collapse("nosave")}else{this.expand("nosave")}},show:function(A){if(!this.elm_module){this.build()}this.elm_module.style.visibility="visible";this.elm_module.style.display="block";$(App.ColManager["col"+this.dataObj.container]).setStyle("height","auto")},hide:function(A){if(!this.elm_module){this.build()}this.elm_module.style.display="none"},isPrefetchable:function(){return["RssReader","UWA"].contains(this.dataObj.moduleName)},isVisible:function(){return(this.elm_module&&this.elm_module.style.display!="none"&&this.elm_module.parentNode&&this.elm_module.parentNode.nodeType!=11)},_attachContent:function(){if(typeof this.content=="object"){return true}this.loading=true;App.Modules.LoadQueue.loadingItems.push(this.dataObj.id);this._attachCSS();var B=this.dataObj.moduleName;var D=function(){if(App.Modules[B]){return App.Modules[B]}else{if(App.Modules[B.toLowerCase()]){return App.Modules[B]=App.Modules[B.toLowerCase()]}}return null};var C=D();if(C){this.content=new C(this);this.search()}else{if(App.Modules[this.dataObj.moduleName+"Infos"]){var A=new Asset.javascript(App.Modules[this.dataObj.moduleName+"Infos"].path,{onload:function(){var E=D();if(!this.content){this.content=new E(this)}this.search()}.bind(this),check:D})}}},_attachCSS:function(){if(App.Modules[this.dataObj.moduleName+"Infos"]){var A=App.Modules[this.dataObj.moduleName+"Infos"].css;if(A){if(typeof A=="array"){A.each(function(B){App.insertCssFile(B)})}else{App.insertCssFile(A)}}}},search:function(){if(App.isOnSearch){if(parseInt(this.dataObj.oldStatus,10)!=1&&parseInt(this.dataObj.oldStatus,10)!=0){this.dataObj.oldStatus=this.dataObj.status}if(typeof this.content.doSearch=="function"){if(typeof this.dataObj.extendSearch=="number"){this.dataObj.extendSearch=(App.dlaFilter)?0:1}this.content.doSearch(App.query)}else{App.moduleList[z].collapse(true);App.moduleList[z].elm_module.addClass("transparent")}}},inject:function(C,B){if(!this.elm_module){this.build()}if(C){this.elm_module.inject(C,B)}else{if(typeof this.dataObj.container=="object"){this.dataObj.container.appendChild(this.elm_module)}else{if(Number(this.dataObj.container)>0){var A=App.ColManager["col"+this.dataObj.container];if(typeof this.isNew=="function"&&this.isNew()&&A.hasChildNodes()){if(this.dataObj.row==undefined){A.insertBefore(this.elm_module,A.firstChild)}else{A.appendChild(this.elm_module)}}else{A.appendChild(this.elm_module)}}}}if(!this.previewMode&&!this.readOnly){this.enableDragging()}else{this.elm_moduleHeader.style.cursor="default"}return this},isNew:function(){return !(this.dataObj.id&&this.dataObj.id>0)},onLoadModule:function(){this.loaded=true;this.loading=false;App.Modules.LoadQueue.loadingItems.remove(this.dataObj.id);if(App.Modules.LoadQueue.items.length){App.Modules.LoadQueue.process()}if(this.previewMode){this.highlight()}},load:function(A){if(this.loaded||this.loading){return }if(!this.elm_module||!this.elm_module.parentNode||this.elm_module.parentNode.nodeType==11){this.inject()}if(A){App.Modules.LoadQueue.items.push(this);this.onqueue=true;if(App.Modules.LoadQueue.timeout){clearTimeout(App.Modules.LoadQueue.timeout)}App.Modules.LoadQueue.timeout=App.Modules.LoadQueue.process.delay(10,App.Modules.LoadQueue)}else{this.loadContent()}return this},loadContent:function(){this._attachContent();if(this.dataObj.moduleName=="RssReader"&&App.isOnSearch){if(typeof this.dataObj.oldStatus!="number"||this.dataObj.oldStatus==-1){this.dataObj.oldStatus=this.dataObj.status}}},unload:function(){delete this.elm_module;delete this.elm_moduleHeader;delete this.elm_moduleContent;delete this.elm_editContent;delete this.elm_showHide;delete this.elm_edit;delete this.elm_refresh;delete this.elm_title;if(this){delete this}}});App.hideModulePopupMenu=function(E){var H=$("modulePopupMenu");var D=$("shareModuleBalloon");if(D&&Element.visible(D)){return true}if(H&&Element.visible(H)){if(E){var A=Event.findElement(E,"DIV")}else{A=null}if(A&&A.className=="options"&&Element.visible(H)){return }if(E&&Position.within(H,Event.pointerX(E),Event.pointerY(E))){Event.stop(E);return false}var G=H.getAttribute("moduleId");var B=App.moduleList.length;for(var F=0;F<B;F++){if(App.moduleList[F].dataObj.id==G){var C=true;break}}if(C){App.moduleList[F].dontUnHighlight=false;App.moduleList[F].unHighlight()}Element.hide(H)}};;
App.TabOptions={build:function(){var B=$("tabOptions");var A=new Element("div",{"class":"tabOptionsInner autoclear",id:"tabOptionsContainerDefault"});$(Netvibes.UI.createIcon("actions-window-close close",_("Close"),16,16)).addEvent("click",App.TabOptions.close).inject(A);new Element("div",{"class":"option",id:"tabGlobalOption"}).adopt(new Element("strong",{"class":"title",html:_("General options")})).adopt(new Element("p",{"class":"suboption"}).adopt(new Element("button",{id:"bt-tabIco","class":"nv-button",html:'<img src="'+App.getStaticUrl("/img/s.gif")+'" id="previewIconTab" />'}).addEvent("click",App.TabOptions.showIconsPanel),new Element("input",{type:"text",id:"field-tabName",styles:{"float":"right"},"class":"text",value:"",events:{focus:function(C){this.addClass("gotFocus")},keyup:function(D){var C=this.value.trim().escapeHTML();App.selectedTabObj.setTempTitle(C);if(!Browser.isSafari){if(D.key=="enter"||D.key=="esc"){this.blur()}}},blur:function(E){var D=this.value.trim().escapeHTML();var C=App.selectedTabObj;this.removeClass("gotFocus");if(C.dataObj.title==D){return }C.elm.title=D;C.dataObj.title=D;App.Request.saveUserData("tab.title",{data:{tid:C.dataObj.id,title:C.dataObj.title}});if(Browser.isSafari&&Browser.version<3){}else{if(D==""){document.location="#"+C.dataObj.id}else{document.location="#"+encodeURIComponent(String.toAnchor(C.dataObj.title))}}C.setTitle()}}})),new Element("p",{"class":"suboption"}).adopt(new Element("button",{id:"bt-tabShare","class":"nv-button",html:'<img src="'+App.getStaticUrl("/img/sendModule/share-hover.png")+'" />'+_("Share this tab")}).addEvent("click",function(C){App.selectedTabObj.share(C)}))).inject(A);new Element("div",{"class":"option",id:"tabDelete"}).adopt(new Element("strong",{"class":"title",html:_("Delete this tab")})).adopt(new Element("button",{"class":"nv-button",text:_("Delete this tab")}).addEvent("click",function(C){App.selectedTabObj.remove(C)})).inject(A);new Element("div",{"class":"option",id:"tabLayout"}).adopt(new Element("strong",{"class":"title",html:_("Layout")})).adopt(new Element("p").adopt(new Element("strong",{html:' <span id="tabLayout-columns"><button class="nv-button">1</button><button class="nv-button">2</button><button class="nv-button">3</button><button class="nv-button">4</button></span> '+("boxes")}),new Element("ul",{"class":"option",id:"tabLayout-galery"}))).inject(A);A.inject(B)},isOpen:false,close:function(B){if(!App.TabOptions.isOpen){return }var A=$("tabOptions");if($("tabOptionsRename")&&$("tabOptionsRename").hasClass("gotFocus")){$("tabOptionsRename").blur()}if(App.pageCustom.enableFx==1&&!App.isPremium()&&!(Browser.isFirefox&&Browser.Platform.win)){A.slide("out")}else{A.getParent().setStyle("height","auto");A.style.margin=0;A.style.display="none"}if($("shareModuleBalloon")){Element.remove($("shareModuleBalloon"))}if(self.hasBeenDragged){self.hasBeenDragged=false;return }App.TabOptions.isOpen=false;App.TabOptions.update();if(App.ColManager){App.ColManager.updateLayout()}},open:function(B){if(App.TabOptions.isOpen){return }if(!B){B=window.event}if(B){B.cancelBubble=true}App.hideModulePopupMenu();var A=$("tabOptions");if(A.innerHTML==""){App.TabOptions.build()}if(App.pageCustom.enableFx==1&&!App.isPremium()&&!(Browser.isFirefox&&Browser.Platform.win)){A.slide("hide").slide("in")}else{A.getParent().setStyle("height","auto");A.style.margin=0;A.style.display="block"}if(self.hasBeenDragged){self.hasBeenDragged=false;return }App.TabOptions.isOpen=true;App.report("click.tab.options");App.TabOptions.update();if(App.ColManager){App.ColManager.updateLayout()}},toggle:function(){if(App.TabOptions.isOpen){$("field-tabName").fireEvent("blur");App.TabOptions.close()}else{App.TabOptions.open()}},update:function(){$("field-tabName").value=App.selectedTabObj.dataObj.title.unescapeHTML();$("previewIconTab").src=App.selectedTabObj.dataObj.icon||NV_STATIC+"/img/s.gif";App.TabOptions.updateLayoutOption()},updateLayoutOption:function(E){var D=App.selectedTabObj;var J=$$("#tabLayout-columns button");var A=$("tabLayout-galery");var F=E||App.selectedTabObj.dataObj.cols;var B=App.FlexiLayout.modelsBynumCols[F];for(var G=0,I;I=J[G++];){if(G==parseInt(F)){I.className="nv-button-pressed";I.disabled="disabled"}else{I.className="nv-button";I.disabled=false}I.onclick=function(N){var N=new Event(N);var M=N.target.innerHTML;if(App.selectedTabObj.updateColNums(M)){App.TabOptions.updateLayoutOption(M)}}.bind(this)}A.empty();for(var G=0,H;H=B[G++];){var C=App.FlexiLayout.getClassName(G-1,F);new Element("li").adopt(new Element("a",{href:"#_",id:C,"class":C==(App.FlexiLayout.classPrefix+"-"+D.dataObj.layout)?"selected":""})).inject(A)}var L=A.getElements("a");for(var G=0,K;K=L[G++];){K.addEvent("click",function(O){O.stop();for(var N=0,M;M=L[N++];){M.removeClass("selected")}var P=O.target;P.addClass("selected");App.FlexiLayout.update(P.id.substring(P.id.indexOf("-")+1))})}},panelIcons:["img/eco.png","img/favicon.png","img/icons/anchor.gif","img/icons/attach.gif","img/icons/basket.gif","img/icons/bomb.gif","img/icons/book.gif","img/icons/book_addresses.gif","img/icons/book_open.gif","img/icons/brick.gif","img/icons/briefcase.gif","img/icons/bug.gif","img/icons/cake.gif","img/icons/calendar_view_day.gif","img/icons/calendar_view_month.gif","img/icons/camera.gif","img/icons/car.gif","img/icons/cd.gif","img/icons/chart_bar.gif","img/icons/chart_curve.gif","img/icons/chart_organisation.gif","img/icons/chart_pie.gif","img/icons/clock.gif","img/icons/clock_red.gif","img/icons/cog.gif","img/icons/coins.gif","img/icons/color_swatch.gif","img/icons/comment.gif","img/icons/computer.gif","img/icons/connect.gif","img/icons/creditcards.gif","img/icons/door.gif","img/icons/door_open.gif","img/icons/drink.gif","img/icons/drink_empty.gif","img/icons/email.gif","img/icons/email_open.gif","img/icons/email_open_image.gif","img/icons/emoticon_evilgrin.gif","img/icons/emoticon_grin.gif","img/icons/emoticon_happy.gif","img/icons/emoticon_smile.gif","img/icons/emoticon_surprised.gif","img/icons/emoticon_tongue.gif","img/icons/emoticon_unhappy.gif","img/icons/emoticon_waii.gif","img/icons/emoticon_wink.gif","img/icons/exclamation.gif","img/icons/eye.gif","img/icons/feed.gif","img/icons/flag_blue.gif","img/icons/flag_green.gif","img/icons/flag_orange.gif","img/icons/flag_pink.gif","img/icons/flag_purple.gif","img/icons/flag_red.gif","img/icons/flag_yellow.gif","img/icons/folder.gif","img/icons/heart.gif","img/icons/house.gif","img/icons/image.gif","img/icons/information.gif","img/icons/ipod.gif","img/icons/keyboard.gif","img/icons/layout.gif","img/icons/lightbulb.gif","img/icons/lightbulb_off.gif","img/icons/lock.gif","img/icons/lock_open.gif","img/icons/lorry.gif","img/icons/lorry_flatbed.gif","img/icons/magnifier.gif","img/icons/money.gif","img/icons/money_dollar.gif","img/icons/money_euro.gif","img/icons/money_pound.gif","img/icons/money_yen.gif","img/icons/monitor.gif","img/icons/mouse.gif","img/icons/music.gif","img/icons/new.gif","img/icons/note.gif","img/icons/page.gif","img/icons/page_copy.gif","img/icons/page_white.gif","img/icons/page_white_acrobat.gif","img/icons/page_white_code.gif","img/icons/page_white_compressed.gif","img/icons/page_white_excel.gif","img/icons/page_white_flash.gif","img/icons/page_white_php.gif","img/icons/page_white_picture.gif","img/icons/page_white_powerpoint.gif","img/icons/page_white_text.gif","img/icons/page_white_word.gif","img/icons/page_white_world.gif","img/icons/palette.gif","img/icons/paste_plain.gif","img/icons/pencil.gif","img/icons/phone.gif","img/icons/photo.gif","img/icons/picture.gif","img/icons/printer.gif","img/icons/printer_empty.gif","img/icons/rainbow.gif","img/icons/rosette.gif","img/icons/server.gif","img/icons/shield.gif","img/icons/sport_8ball.gif","img/icons/sport_basketball.gif","img/icons/sport_football.gif","img/icons/sport_golf.gif","img/icons/sport_raquet.gif","img/icons/sport_shuttlecock.gif","img/icons/sport_soccer.gif","img/icons/sport_tennis.gif","img/icons/star.gif","img/icons/stop.gif","img/icons/tag_blue.gif","img/icons/tag_green.gif","img/icons/tag_orange.gif","img/icons/tag_pink.gif","img/icons/tag_purple.gif","img/icons/tag_red.gif","img/icons/tag_yellow.gif","img/icons/telephone.gif","img/icons/television.gif","img/icons/thumb_down.gif","img/icons/thumb_up.gif","img/icons/time.png","img/icons/trash.gif","img/icons/tux.gif","img/icons/user.gif","img/icons/user_female.gif","img/icons/user_gray.gif","img/icons/user_green.gif","img/icons/user_orange.gif","img/icons/user_red.gif","img/icons/user_suit.gif","img/icons/vcard.gif","img/icons/weather_clouds.gif","img/icons/weather_cloudy.gif","img/icons/weather_lightning.gif","img/icons/weather_rain.gif","img/icons/weather_snow.gif","img/icons/weather_sun.gif","img/icons/world.gif","img/icons/zoom.gif","img/uwa.png"],showIconsPanel:function(F){if($("panelIcons")){var A=$("panelIcons")}else{var E=new Element("div",{id:"panelIcons-middle"});var A=new Element("div",{id:"panelIcons"}).adopt(new Element("div",{id:"panelIcons-top"}),E,new Element("div",{id:"panelIcons-bottom"}));$(Netvibes.UI.createIcon("actions-window-close close",_("Close"),16,16)).addEvent("click",function(){B.hide()}).inject(E);new Element("h3",{text:_("Choose an icon for this tab")}).inject(E);for(var C=0,I,J,H;I=App.TabOptions.panelIcons[C];C++){J=-18*(C%14)-2;H=-18*parseInt(C/14)-2;new Element("a",{href:App.getStaticUrl("/"+I),styles:{width:"16px",height:"16px","background-image":"url("+App.getStaticUrl("/img/tabicons.png")+")","background-position":J+"px "+H+"px",margin:"2px",display:"block","float":"left"}}).addEvent("click",function(K){K.stop();$("previewIconTab").src=this.href;App.selectedTabObj.setIcon(this.href);B.hide()}).inject(E)}new Element("ul").adopt(new Element("li").adopt(new Element("input",{type:"radio",id:"noTabIcon",name:"alternativeTabIcon"}).addEvent("click",function(K){K.stop();$("previewIconTab").src=App.getStaticUrl("/img/s.gif");App.selectedTabObj.setIcon("");B.hide()}),new Element("label",{text:_("No icon"),"for":"noTabIcon"})),new Element("li").adopt(new Element("input",{type:"radio",id:"urlTabIcon",name:"alternativeTabIcon"}).addEvent("click",function(){$("urlTabIcon-input").fireEvent("blur")}),new Element("label",{text:_("url:"),"for":"urlTabIcon"}),new Element("input",{type:"text","class":"text",id:"urlTabIcon-input"}).addEvent("blur",function(){var K=this.value.trim();if(K==""&&!K.test(/^(http|https):\/\//i)){return }$("urlTabIcon").checked=true;$("previewIconTab").src=K;App.selectedTabObj.setIcon(K);B.hide()}))).inject(E)}var B=new Overlay({id:"simpleOverlay",className:null,fadeEffect:false}).addEvents({show:function(){A.style.display="block"},hide:function(){A.style.display="none"}});if(F){F.stop();var G=F.target.getPosition();var D=F.target.getSize();G.x=App.dirRTL?G.x-300+D.x:G.x;A.setStyles({top:G.y+D.y+20,left:G.x})}A.inject(document.body);if(!App.selectedTabObj.dataObj.icon){$("noTabIcon").checked=true}else{$("urlTabIcon").checked=true;$("urlTabIcon-input").value=App.selectedTabObj.dataObj.icon}B.show()}};var tabGhost=document.createElement("li");tabGhost.id="tabGhost";tabGhost.innerHTML='<img src="'+NV_STATIC+'/img/s.gif"/>&nbsp;';App.setTabUnread=function(D,C,A){var B=null,E=App.tabList.length;var G=0;for(var F=0;F<E;F++){if(App.tabList[F].dataObj.id!=C){G+=App.tabList[F].unReadCache;continue}B=App.tabList[F]}if(B&&D>0){B.unRead[D]=parseInt(A,10);B.setTitle();G+=B.unReadCache}if(G>0){document.title=App.pageTitle+" ("+G+")"}else{document.title=App.pageTitle}};var PageTab=function(obj){var self=this;this.dataObj=obj;this.elm=null;this.icon=new Image();this.hasBeenDragged=false;this.unRead={};this.unReadCache=0;var showEco=true;var showSendByMail=true;this.setIcon=function(s,updateInput){if(typeof s!="string"){s=this.src}s=s.replace(/^http:\/\/.*\.?netvibes\.(com|local)\/img\/icon/,App.getStaticUrl("/img/icon"));if(this.dataObj.icon==s){return false}this.dataObj.icon=s;App.Request.saveUserData("tab.icon",{data:{tid:this.dataObj.id,icon:this.dataObj.icon}});this.setTitle(null,true)};this.updateColNums=function(colNums){var newCols=parseInt(colNums);var actualCols=parseInt(this.dataObj.cols);var computeUpdate=function(){this.dataObj.cols=colNums;App.ColManager.numCols=this.dataObj.cols;App.ColManager.columnSizes=this.dataObj.columnSizes;App.FlexiLayout.update();App.ColManager.resetLayout()};if(newCols==actualCols){return false}else{if(newCols<actualCols){var modToMove=App.moduleList.filter(function(module){return(module.dataObj.tab==this.dataObj.id&&newCols<parseInt(module.dataObj.container))},this);if(modToMove.length){if(confirm(_("You have content on a column that would be removed. Should we move it for you?"))){for(var i=0,m;m=modToMove[i++];){App.ColManager["col"+colNums].appendChild(m.elm_module);m.dataObj.container=colNums}App.Request.saveUserData("module.pos",{data:{col:colNums,order:App.LayoutManager.getResetColumnOrder(modToMove[0])},onComplete:computeUpdate.bind(this)});return true}else{return false}}}}computeUpdate.apply(this);return true},this.selectionMark=function(){if(!self.elm){return }if(App.selectedTab==self.dataObj.id){Element.addClassName(self.elm,"selected");self.dataObj.unread=self.unReadCache;App.openTabId=self.dataObj.id;if(App.visit&&App.visit.my){Cookie.set("opentab_u",App.openTabId,{path:"/",duration:60})}else{if(!App.visit){Cookie.set("opentab",App.openTabId,{path:"/",duration:60})}}}else{if(self.unReadCache>(self.dataObj.unread||0)){Element.removeClassName(self.elm,"selected")}else{Element.removeClassName(self.elm,"selected");var el=$(self.elm).getElement(".actions-tab-options")||(self.elm).getElement(".actions-window-close");if(el){el.remove()}}}};this.hasModules=function(){var ln=App.moduleList.length;for(var z=0;z<ln;z++){if(App.moduleList[z].dataObj.tab==this.dataObj.id){return true}}return false};this.hasAllCollapsed=function(){var collapsed=0,count=0;for(var i=0,m;m=App.moduleList[i];i++){if(m.dataObj.tab==this.dataObj.id){if(m.dataObj.status==0){collapsed++}count++}}return(count&&collapsed==count)};this.remove=function(e){if(!e){e=window.event}e.cancelBubble=true;var confirmText=_('Do you really want to delete the tab "{0}"?').format(self.dataObj.title.unescapeHTML());if(self.dataObj.title.length==0){confirmText=_("Do you really want to delete this tab?")}var hasModules=self.hasModules();var ln=App.tabList.length;var alternative=null;for(var z=0;z<ln;z++){if(App.tabList[z].dataObj.type!="search"){if(App.tabList[z]==self){break}alternative=App.tabList[z]}}if(!alternative){for(z=z+1;z<ln;z++){if(App.tabList[z].dataObj.type!="search"){alternative=App.tabList[z];break}}}if(!alternative){alert(_("You cannot delete the only tab."));return false}mode="tab.delete";if(hasModules){confirmText+="\n("+_("all modules on this page will be DELETED!")+")"}var confirmDialog=new App.UI.ConfirmDialog({titleText:self.dataObj.title.unescapeHTML(),message:confirmText,confirm:{text:_("Delete this tab")},discard:{text:""},onConfirm:function(){App.Request.saveUserData(mode,{data:{tid:self.dataObj.id}});self.closeTabOptions();if(self.dataObj.type=="search"){self.destroy()}}}).show();return true};this.createImage=function(append,type){switch(type){case"close":Netvibes.UI.createIconText("actions-tab-options",_("Edit"),10,10).inject(append,(App.dirRTL&&App.pageCustom.iconType=="text")?"top":"bottom");break;case"spacer":var img=document.createElement("img");img.className="spacer meta";img.width=7;img.height=7;img.src=App.getStaticUrl(NV_PATH+"img/s.gif");append.appendChild(img);break}};this.share=function(e){e.stop();var self=App.selectedTabObj;var nbWidgets=self.getModules().length;var iconUrl=self.dataObj.icon;if(iconUrl.charAt(0)=="/"){iconUrl=NV_STATIC+iconUrl}var item={id:self.dataObj.id,type:"tab",title:self.dataObj.title,picture:iconUrl,baseLine:nbWidgets+" widget"+((nbWidgets>1)?"s":"")};App.Share.show(item)};this.closeTabOptions=App.TabOptions.close;this.saveTimeout=null;this.save=function(){if(self.saveTimeout){clearTimeout(self.saveTimeout)}self.saveTimeout=setTimeout(function(){App.Request.saveUserData("tab",{data:self.dataObj})},1500)};this.unShare=function(){};this.showTabOptions=function(e){if(App.selectedTab!=self.dataObj.id&&App.staticUniverse||this.dataObj.type=="search"){return }App.TabOptions.toggle(e)};this.rename=function(){if(this.dataObj.type=="search"){return }App.keyboardFocus="tab";self.elm.innerHTML="";var span=document.createElement("span");span.className="innerTab";self.elm.appendChild(span);var t=self.dataObj.title.unescapeHTML();var inputElm=document.createElement("input");inputElm.type="text";inputElm.value=t;inputElm.style.width=((t.length*6)+20)+"px";inputElm.setAttribute("maxlength",50);span.appendChild(inputElm);self.createImage(span,"spacer");inputElm.focus();inputElm.select();function onEnterDown(e){e=new Event(e);if(!Browser.isSafari){if(e.key=="enter"||e.key=="esc"){inputElm.onblur()}}}if(self.dataObj.id<0){App.Request.saveUserData("tab.new",{data:this.dataObj})}Event.observe(inputElm,"keydown",onEnterDown,false);inputElm.onkeyup=function(){App.keyboardFocus="tab.edit";this.style.width=(this.value.length*6)+20+"px"};inputElm.onmousedown=function(e){if(!e){e=window.event}e.cancelBubble=true;return true};inputElm.onblur=function(e){var value=this.value.trim().escapeHTML();if(value!=self.dataObj.title){self.elm.title=value;self.dataObj.title=value;App.Request.saveUserData("tab.title",{data:{tid:self.dataObj.id,title:self.dataObj.title}});if(Browser.isSafari&&Browser.version<3){}else{if(value==""){document.location="#"+self.dataObj.id}else{document.location="#"+encodeURIComponent(String.toAnchor(self.dataObj.title))}}}App.tabEditing=-1;App.keyboardFocus="module";App.retainKeyboardFocus();self.setTitle();return true};App.tabEditing=self.elm.id};this.setTempTitle=function(tempTitle){return this.setTitle(false,false,tempTitle)};this.setTitle=function(el,rebuild,tempTitle){if(!el){el=self.elm}if(App.tabEditing==el.id){return false}var icon,title,unread;if(typeof rebuild=="undefined"){rebuild=false}if(!rebuild){try{var img=el.getElementsByTagName("img");if(img.length<1||img[0].className!="icon"){throw ("rebuild")}var span=el.getElementsByTagName("span");if(span.length<1||span[0].className!="innerTab"){throw ("rebuild")}innerTabSpan=span[0];var span=el.getElementsByTagName("span");if(span.length<2||span[1].className!="tabName"){throw ("rebuild")}if(!App.isOnSearch){if(span.length<3||span[2].className!="unread"){throw ("rebuild")}}else{if(span.length<3||span[2].className!="result"){throw ("rebuild")}}}catch(e){rebuild=true}}if(rebuild){el.innerHTML="";var innerTabSpan=document.createElement("span");innerTabSpan.className="innerTab";el.appendChild(innerTabSpan);icon=document.createElement("img");icon.className="icon";if(!document.all||window.opera){icon.style.marginLeft="-3px"}innerTabSpan.appendChild(icon);var title=document.createElement("span");title.className="tabName";title.onclick=function(e){if(!e){e=window.event}e.cancelBubble=true;tabOnClick("rename")};innerTabSpan.appendChild(title);var unread=document.createElement("span");if(App.isOnSearch){unread.className="result"}else{unread.className="unread"}if(!App.isOnSearch){unread.onclick=function(e){var myId=this.parentNode.parentNode.id.substr(3);if(App.selectedTab!=myId){return true}if(!e){e=window.event}e.cancelBubble=true;if(!confirm(_("Really mark all rss items on this tab as read?"))){return false}var ln=App.moduleList.length;for(var z=0;z<ln;z++){var m=App.moduleList[z];if(m.dataObj.tab!=myId){continue}if(m.content&&typeof m.content.setAllAsReadOnMouseDown=="function"){m.content.setAllAsReadOnMouseDown()}}App.selectedTabObj.setTitle();m=null;if(App.FeedReader.isOpen){App.FeedReader.readAll()}}}innerTabSpan.appendChild(unread)}else{var img=innerTabSpan.getElementsByTagName("img");icon=img[0];var span=innerTabSpan.getElementsByTagName("span");title=span[0];unread=span[1]}if(self.dataObj.icon!=""){s=self.icon.src;s=s.replace(/^http:\/\/.*\.?netvibes\.(com|local)\/img\/icon/,App.getStaticUrl(NV_PATH+"img/icon"))}else{s=App.getStaticUrl(NV_PATH+"img/s.gif")}if(icon.src.indexOf(s)==-1){if(s.trim()==""){s=App.getStaticUrl(NV_PATH+"img/s.gif")}if(self.dataObj.icon!=""){icon.onclick=function(){if(self.dataObj.id==App.selectedTab){self.showTabOptions}};icon.style.width="16px";icon.width=16;icon.style.width="16px";icon.style.height="16px";var cssSprite;if(cssSprite=App.iconMapper(self.dataObj.icon)){icon.src=App.getStaticUrl(NV_PATH+"img/s.gif");icon.style.backgroundPosition="-"+cssSprite[1]+"px -"+cssSprite[2]+"px";icon.style.backgroundImage="url('"+App.getStaticUrl(NV_PATH+cssSprite[0])+"')"}else{icon.src=self.dataObj.icon;icon.style.backgroundPosition=0;icon.style.backgroundImage=""}}else{icon.style.width="1px";icon.width=1;icon.src=s}}var t=self.dataObj.title;if(typeof tempTitle!="undefined"){t=tempTitle}if(t==""){t="\u00a0"}if(title.innerHTML!=t){title.title=t.unescapeHTML();title.innerHTML=t}t=0;var c=0;for(var i in self.unRead){c=parseInt(self.unRead[i],10);if(!isNaN(c)){t+=c}}self.unReadCache=t;if(!App.staticUniverse&&t>0&&this.dataObj.type!="search"){if(unread.innerHTML!="("+t+")"){if(!App.isOnSearch){unread.title=_("Read All")}else{unread.title=_("Results")}unread.innerHTML="("+t+")"}Element.removeClassName(unread,"nounread")}else{unread.innerHTML=""}self.selectionMark();while(el.lastChild.tagName&&el.lastChild.tagName.toLowerCase()=="img"){Element.remove(el.lastChild)}if(!App.staticUniverse&&App.selectedTab&&App.selectedTab==self.dataObj.id){if(el.getElementsByClassName("actions-tab-options").length==0){if(this.dataObj.type!="search"){this.createImage(el.firstChild,"close")}else{if(el.getElementsByClassName("actions-window-close").length==0){Netvibes.UI.createIcon("actions-window-close",_("Close"),10,10).setStyle("width","10px").addEvent("click",this.remove).inject(el.firstChild)}}}}};this.showMessage=function(msg){};this.getModules=function(){return App.moduleList.filter(function(module){return module.dataObj.tab==this.dataObj.id},this)};this.isPrefetchable=function(){if(!(parseInt(App.pageCustom.dontPreload)==1&&App.use_prefetcheddata===true)){return false}return App.moduleList.some(function(module){return module.dataObj.tab==this.dataObj.id&&["RssReader","MultipleFeeds","UWA"].contains(module.dataObj.moduleName)},this)};this.checkModuleContainer=function(module){if(module.dataObj.container>this.dataObj.cols){module.dataObj.container=this.dataObj.cols;App.Modules.saveModulePosition(module)}};this.loadModules=function(queued){if(undefined==queued){queued=true}var modules=this.getModules();if(!this.loaded){modules=App.Modules.sortModulesByRow(modules);for(var i=0,module;module=modules[i];i++){if(module.dataObj.tab!=App.selectedTab){module.hide()}module.load(queued);this.checkModuleContainer(module)}this.loaded=true}return modules};this.onModulesPrefetching=function(){var modules=App.Modules.sortModulesByRow(this.getModules());for(var i=0,l=modules.length;i<l;i++){var module=modules[i];module.inject().show();if(!module.isPrefetchable()){module.load(true)}this.checkModuleContainer(module)}};this.onModulesPrefetched=function(data){eval(data);this.loadModules(false)};this.switchTo=function(firstRun){firstRun=!!firstRun;if(this.loaded&&App.selectedTab==this.dataObj.id){return }this.closeTabOptions();if(App.FeedReader.isOpen){App.FeedReader.close()}var shareModuleBalloon=$("shareModuleBalloon");if(shareModuleBalloon){Element.remove(shareModuleBalloon)}if(App.hideModulePopupMenu){App.hideModulePopupMenu()}var lastSelected=App.selectedTab;App.selectedTab=this.dataObj.id;try{if(App.selectedTabObj){App.selectedTabObj.setTitle();App.selectedTabObj.selectionMark()}if(App.selectedTabObj.hide){App.selectedTabObj.hide()}else{var previousModules=App.selectedTabObj.getModules();for(var i=0,l=previousModules.length;i<l;i++){var module=previousModules[i];if(module.elm_module&&module.isVisible()&&module.elm_module.isDragging){continue}module.hide()}}}catch(e){}App.selectedTabObj=this;App.selectedTab=this.dataObj.id;this.setTitle();App.ColManager.columnSizes=this.dataObj.columnSizes;App.ColManager.numCols=this.dataObj.cols;if(!this.dataObj.layout||this.dataObj.layout=="undefined"){this.dataObj.layout=App.FlexiLayout.getModelName()}App.ColManager.layout=this.dataObj.layout;App.ColManager.updateLayout(false);var prefetching=false;if(this.dataObj.type!="search"){var modules=null;if(!this.loaded){var prefetchable=this.isPrefetchable();if(!firstRun&&prefetchable){prefetching=true;var params={tab:this.dataObj.id};if(App.visit){params.visit=App.visit.username}App.Request.newRequest({url:"/ajax/tab/prefetch.php",onRequest:this.onModulesPrefetching.bind(this),onSuccess:this.onModulesPrefetched.bind(this),onFailure:this.loadModules.bind(this)}).get(params)}else{modules=this.loadModules(!prefetchable)}}else{modules=this.getModules()}if(!modules){modules=this.getModules()}for(var i=0,l=modules.length;i<l;i++){modules[i].show(true);modules[i].reportView()}}else{this.loaded?this.show():this.setContent()}var collapseExpand=$("collapseExpand");if(collapseExpand){collapseExpand.rel=this.hasAllCollapsed()?"expand":"collapse";App.collapseExpand()}App.Modules.notifyResize(true);var fullReload=(App.tabSeo&&!firstRun);if(Browser.isSafari&&Browser.version<3){}else{if(this.dataObj.title==""){if(!fullReload){document.location.hash=this.dataObj.id}else{document.location="http://"+NV_HOST+"/"+App.visit.username+"#"+this.dataObj.id}}else{if(!fullReload){document.location.hash=encodeURIComponent(String.toAnchor(this.dataObj.title))}else{document.location="http://"+NV_HOST+"/"+App.visit.username+"#"+encodeURIComponent(String.toAnchor(this.dataObj.title))}}}};function tabOnClick(action){if(self.hasBeenDragged){self.hasBeenDragged=false;return }if(typeof action=="undefined"){action="tabOptions"}if(App.selectedTab==self.dataObj.id){if(App.staticUniverse){if(App.FeedReader.isOpen){App.FeedReader.close()}return false}if(App.tabEditing==self.elm.id){return }if(App.FeedReader.isOpen){App.FeedReader.close();return }if(action!="tabOptions"){self.rename()}else{self.showTabOptions()}}else{if(App.tabEditing!=-1){var v=$(App.tabEditing);if(v&&v.firstChild&&v.firstChild.firstChild&&v.firstChild.firstChild.onblur){v.firstChild.firstChild.onblur(v.firstChild.firstChild)}}self.switchTo()}}function build(){if(self.dataObj.type=="search"){App.SearchTab.extendTab(self)}var container=$("divTabs");var ul=container.firstChild;if(typeof self.dataObj.cols=="undefined"||self.dataObj.cols==0){self.dataObj.cols=3}var li=$("tab"+self.dataObj.id);if(li){self.icon=li.getElement("img.icon")}else{var li=new Element("li");li.id="tab"+self.dataObj.id;s=self.dataObj.icon;s=s.replace(/^http:\/\/.*\.?netvibes\.(com|local)\/img\/icon/,App.getStaticUrl("/img/icon"));if(s.trim()==""){s=App.getStaticUrl(NV_PATH+"img/s.gif")}self.icon.src=s;self.setTitle(li);ul.appendChild(li)}li.onclick=function(e){e=new Event(e);if(e.target.className=="tabName"){tabOnClick("rename")}else{if(e.target.className=="unread"){var myId=e.target.parentNode.parentNode.id.substr(3);if(App.selectedTab!=myId||e.target.innerHTML==""){tabOnClick("tabOptions");return true}if(!confirm(_("Really mark all rss items on this tab as read?"))){return false}if(App.use_feedbackend){App.FeedWidgetManager.setTabFeedsReadState(myId,true)}else{var ln=App.moduleList.length;for(var z=0;z<ln;z++){var m=App.moduleList[z];if(m.dataObj.tab!=myId){continue}if(m.content&&typeof m.content.setAllAsReadOnMouseDown=="function"){m.content.setAllAsReadOnMouseDown()}}if(App.FeedReader.isOpen){App.FeedReader.readAll()}}m=null;App.selectedTabObj.setTitle()}else{tabOnClick("tabOptions")}}};if(!App.staticUniverse){App.Drag.init(li,li);li.onDragStart=function(x,y,mousex,mousey){var delta=0;var header=$("header");if(header&&(header.getStyle("position")=="relative")){delta=findPosY($("header"))}var posX=findPosX(this);var posY=findPosY(this)-delta;this.style.left=posX+"px";this.style.top=posY+"px";this.setAttribute("posx",posX);this.setAttribute("posy",posY);tabGhost.style.display="none";tabGhost.firstChild.style.height=8+"px";$("divTabs").firstChild.insertBefore(tabGhost,this);var ln=App.tabList.length;if(App.staticUniverse){var maxWidth=this.offsetWidth}else{var maxWidth=-1,w;for(var z=0;z<ln;z++){w=App.tabList[z].elm.offsetWidth;if(maxWidth<w){maxWidth=w}if(App.tabList[z].elm==this){App.tabList[z].elm.setAttribute("pos",z)}}}tabGhost.firstChild.style.width=maxWidth+"px";self.hasBeenDragged=false;var l=App.tabList[App.tabList.length-1].elm;App.tabBottom=findPosY(l)+l.offsetHeight;l=App.tabList[0].elm;App.tabTop=findPosY(l);App.dropBoxDrag=null};li.onDrag=function(x,y,mousex,mousey){var t=parseInt(this.style.top,10);var l=parseInt(this.style.left,10);if(this.style.position!="absolute"&&(Math.abs(t-this.getAttribute("posy"))>10||Math.abs(l-this.getAttribute("posx"))>10)){this.style.position="absolute";self.hasBeenDragged=true;App.draggingItem=true;tabGhost.style.display="inline"}if(this.style.position=="absolute"){l=Math.max(0,l);if(!App.staticUniverse){var tabs=$("divTabs").getElementsByTagName("li");var hy=0;for(var z=0;z<tabs.length;z++){if(tabs[z]==this){continue}x=findPosX(tabs[z]);y=findPosY(tabs[z]);hy=y+tabs[z].offsetHeight;if(y<=App.tabTop){y-=200}else{if(hy>=App.tabBottom){hy+=200}}if(x<=mousex&&mousex<=x+tabs[z].offsetWidth&&y<=mousey&&mousey<=hy){if(tabGhost==tabs[z]){break}if(typeof tabs[z]=="undefined"){break}Element.remove(tabGhost);if(typeof tabs[z]=="undefined"){$("divTabs").firstChild.appendChild(tabGhost)}else{$("divTabs").firstChild.insertBefore(tabGhost,tabs[z])}tabGhost.setAttribute("pos",z);break}}}}};li.onDragEnd=function(x,y,mousex,mousey){this.style.position="static";this.style.top="";this.style.left="";Element.removeClassName(this,"transparent");if(self.hasBeenDragged){App.draggingItem=false;Element.remove(this);$("divTabs").firstChild.insertBefore(this,tabGhost);var li=$("divTabs").firstChild.firstChild;var oldTabList=App.tabList.slice();App.tabList=[];var i=0;do{var ln=oldTabList.length;for(var z=0;z<ln;z++){if(oldTabList[z].elm==li){oldTabList[z].sort=i++;App.tabList[App.tabList.length]=oldTabList[z];oldTabList.splice(z,1);break}}}while(li=li.nextSibling);App.Request.saveUserData("tab.order")}Element.remove(tabGhost)}}self.elm=li}this.unload=function(){delete this.icon;delete this.unRead;delete self;self=null};build()};var NewPageTab=function(B){App.report("click.adc.newtab",{locale:App.locale});var B=$merge({title:undefined,i:undefined,defaultDataObj:null,switchTo:true},B);if(typeof B.i=="undefined"){B.i=-Math.floor(Math.random()*20+2)}var A={id:B.i,title:B.title||_("New Tab")+" "+App.tabList.length,sort:App.tabList.length,unread:0,icon:"",cols:3,columnSizes:[],layout:App.FlexiLayout.getModelName(0,3)};for(var C in B.defaultDataObj){A[C]=B.defaultDataObj[C]}var D=new PageTab(A);App.tabList.push(D);if(B.switchTo){D.switchTo()}if(typeof B.title=="undefined"){D.rename()}return D};App.Tabs={};App.Tabs.getById=function(C){for(var B=0,A=App.tabList.length;B<A;B++){if(App.tabList[B].dataObj.id==C){return App.tabList[B]}}return null};App.Tabs.createNewTab=function(E,B){var A={id:-Math.floor(Math.random()*20+2),title:E||_("New Tab")+" "+App.tabList.length,sort:App.tabList.length,unread:0,icon:"",cols:3,columnSizes:[],layout:App.FlexiLayout.getModelName(0,3)};for(var C in B){A[C]=B[C]}var D=new PageTab(A);App.tabList.push(D);if(typeof E=="undefined"){D.rename()}App.Request.saveUserData("tab.new",{data:D.dataObj});return D};App.Tabs.processTabDelete=function(D,C){var B=null;var E=App.tabList.length;var A=-1;for(var F=0;F<E;F++){if(App.tabList[F].dataObj.id==D){A=F}else{if(App.tabList[F].dataObj.id==C){B=App.tabList[F]}}}var E=App.moduleList.length;for(var F=0;F<E;F++){if(App.moduleList[F].dataObj.tab==D){App.moduleList[F].dataObj.tab=C;B.unRead[App.moduleList[F].dataObj.id]=App.moduleList[F].dataObj.unRead}}if(B){B.switchTo()}if(A>-1){Element.remove(App.tabList[A].elm);App.tabList[A].self=null;delete App.tabList[A];App.tabList[A]=null;App.tabList.splice(A,1)}};App.Tabs.setTabId=function setTabId(E,B){for(var D=0,A=App.tabList.length;D<A;D++){var F=App.tabList[D];if(F.dataObj.id==E){F.dataObj.id=B;F.elm.id="tab"+B;if(App.selectedTab==E){App.selectedTab=B}break}}for(var D=0,A=App.moduleList.length;D<A;D++){var C=App.moduleList[D];if(C.dataObj.tab==E){C.dataObj.tab=B;C.save()}}};App.Tabs.createLostTab=function(B){var A={id:-1,title:_("Lost & found"),sort:999,unread:0,icon:"/img/icons/zoom.gif",cols:3};var C=new PageTab(A);App.tabList.push(C)};App.SearchTab={favicons:{google:"http://www.google.com/favicon.ico",yahoo:"http://www.yahoo.com/favicon.ico"},extendTab:function(A){if(!A.dataObj.engine){A.dataObj.engine="google"}$extend(A,App.SearchTab.toImplement)},locale2Lang:function(A){if(User.isp=="numericable"){return"fr"}if(A=="ca"||A=="ar"||A.length==3){return App.shortLang}else{return A}},toImplement:{setContent:function(){var D=Math.round(Math.random()*1000);this.setTabName();this.destroy();switch(this.dataObj.engine.toLowerCase()){case"google":this._content=new Element("div",{id:"googleResults-"+D,"class":"autoclear",text:_("Loading..."),styles:{background:"#FFF",padding:"10px"}});App.ColManager.col1.appendChild(this._content);var A=this;var B=function(){var F=new google.search.SearcherOptions();F.setExpandMode(GSearchControl.EXPAND_MODE_OPEN);var K=new google.search.SearchControl(null);K.setResultSetSize(GSearch.LARGE_RESULTSET);webSearch=new google.search.WebSearch();webSearch.setRestriction(GSearch.RESTRICT_EXTENDED_ARGS,{lr:"lang_"+App.SearchTab.locale2Lang(App.locale)});K.enableAds("pub-2262783781756955",{includeVerticalAds:true,numSideAds:6,numTopAds:4,channel:App.isPremium()?"netvibes_pu_"+App.premium.universe:"netvibes_www"});K.addSearcher(webSearch,F);K.addSearcher(new google.search.VideoSearch(),F);K.addSearcher(new google.search.BlogSearch(),F);K.addSearcher(new google.search.NewsSearch(),F);K.addSearcher(new google.search.ImageSearch(),F);K.addSearcher(new google.search.BookSearch(),F);var J=new GdrawOptions();J.setDrawMode(GSearchControl.DRAW_MODE_TABBED);K.draw(A._content,J);K.execute(A.dataObj.keyword);var E=A._content.getElementsByTagName("INPUT");var I=$(E[0]);var H=$(E[1]);var G=function(L){if(L.type=="keyup"&&L.key!="enter"){return }A.dataObj.keyword=I.value;A.setTabName()};H.addEvent("click",G);if(Browser.isIE){I.addEvent("keyup",G)}};var C=function(){google.load("search","1",{language:App.SearchTab.locale2Lang(App.locale),callback:B})};if(!window.google||!window.google.search){new Asset.javascript("http://www.google.com/jsapi?key="+App.apiKeys.google_jsapi,{charset:"utf8"});(function(){!window.google||!window.google.load?setTimeout(arguments.callee,10):C()})()}else{C()}break}this.loaded=true},setTabName:function(){var A=this.dataObj.engine+" : "+this.dataObj.keyword;if(this.dataObj.title==A){return }this.elm.title=A;this.dataObj.title=A;App.Request.saveUserData("tab",{data:this.dataObj});if(Browser.isSafari&&Browser.version<3){}else{document.location.hash=encodeURIComponent(String.toAnchor(this.dataObj.title))}this.setTitle()},hide:function(){if(this._content){this._content.hide()}},show:function(){if(this._content){this._content.show()}},destroy:function(){if(this._content){this._content.destroy()}delete this.adSenseNarrowBox;delete this.adSenseWideBox}},createNewSearchTab:function(B,A){var A=A.stripScripts();var C=B+" : "+A;App.Tabs.createNewTab(C,{icon:App.SearchTab.favicons[B.toLowerCase()]?App.SearchTab.favicons[B.toLowerCase()]:"img/icons/magnifier.gif",cols:1,type:"search",engine:B,keyword:A,layout:App.FlexiLayout.getModelName(0,1)}).switchTo()},attachEvents:function(E){E.stop();var G=this;var D=G.getElementsByTagName("INPUT")[0].value.trim();var C="Google";if(!D){return }if(parseInt(App.pageCustom.searchTabInNewTab,10)==1){App.SearchTab.createNewSearchTab(C,D)}else{var F;if(App.selectedTabObj.dataObj.type=="search"){F=App.selectedTabObj}else{for(var A=0,B;B=App.tabList[A];A++){if(B.dataObj.type=="search"){F=B}}}if(F){F.dataObj.keyword=D;F.dataObj.engine=C;F.setContent();F.switchTo()}else{App.SearchTab.createNewSearchTab(C,D)}}},positionForm:function(){var B=$("tabSearchSubmit");var C=$("tabSearchForm");var A=B.getSize().x;maxWidth=arguments.callee.lastWidth||83;if(A>maxWidth){C.style.width=C.getSize().x+(A-maxWidth)+"px"}if(App.pageCustom.searchTabAtTop==1){C.style.marginLeft="-"+C.getSize().x/2+"px"}arguments.callee.lastWidth=A}};;
if(top.location!=location&&NV_PREMIUM&&!App.noResize){var premiumUniverse=NV_PREMIUM;if(premiumUniverse=="lefigaro"){var universeHost="http://www.lefigaro.fr/monfigaro/"}else{if(premiumUniverse=="lesechos"){var universeHost="http://www.mesechos.fr/"}else{if(premiumUniverse=="thestartingline"){var universeHost="http://remix.startinglinerock.com/"}else{if(premiumUniverse=="tagged"){var universeHost="http://start.tagged.com/"}else{if(premiumUniverse=="campusb"){var universeHost="http://www.campusb.fr/"}else{if(premiumUniverse=="sport24"){var universeHost="http://www.sport24.com/tabs/flux/"}else{if(premiumUniverse=="ilsole24ore"){var universeHost="http://www.my24.ilsole24ore.com/"}else{if(premiumUniverse=="airtraffic"){var universeHost="http://www.air-traffic.co.uk/"}else{if(premiumUniverse=="captaintheband"){var universeHost="http://www.captaintheband.com/"}else{if(premiumUniverse=="vortex"){var universeHost="http://www.vortexme.com/vortex/"}else{if(premiumUniverse=="vmn"){var universeHost="http://www.vmn.net/"}else{if(premiumUniverse=="unab"){var universeHost="http://escritorio.unab.cl/"}else{if(premiumUniverse=="my_msf"){var universeHost="http://www.msf.fr/"}else{if(premiumUniverse=="vmnfr"){var universeHost="http://www.vmn.net/"}else{if(premiumUniverse=="cofidis"){var universeHost="http://www.cofidis.fr/commun/contenu/file/bibliosite/netvibes/"}else{if(premiumUniverse=="reganam"){var universeHost="http://www.my.reganam.com/"}else{if(premiumUniverse=="minarena"){var universeHost="http://fotbollskanalen.se/common/netvibes/"}else{if(premiumUniverse=="minanyheter"){var universeHost="http://nyhetskanalen.se/common/netvibes/"}else{if(premiumUniverse=="varsityfanclub"){var universeHost="http://www.varsityfanclub.com/main/"}else{if(premiumUniverse=="numericable"){var universeHost="http://my.numericable.fr/"}else{if(premiumUniverse=="mixme"){var universeHost="http://mixme.mediaibox.com.br/"}else{if(premiumUniverse=="sweetimus"){var universeHost="http://home.sweetim.com/"}else{if(premiumUniverse=="sweetimuk"){var universeHost="http://home.sweetim.com/"}else{if(premiumUniverse=="sweetimfr"){var universeHost="http://home.sweetim.com/"}else{if(premiumUniverse=="itv2"){var universeHost="http://www.itv.com/documents/html/"}else{if(premiumUniverse=="meuig"){var universeHost="http://meu.ig.com.br/"}else{if(premiumUniverse=="attractabrennan"){var universeHost="http://www.iot-portal.ie/"}else{if(premiumUniverse=="daemontoolspu"){var universeHost="http://my.daemon-tools.cc/"}else{if(premiumUniverse=="ahoratodoseune"){var universeHost="http://ahoratodoseune.netvibes.com/"}else{if(premiumUniverse=="thedailyinfluence"){var universeHost="http://www.thedailyinfluence.com/"}else{if(premiumUniverse=="santaanastarcasino"){var universeHost="http://www.santaanastar.com/nvmyhomepage/"}else{if(premiumUniverse=="eztracks"){var universeHost="http://home.ez-tracks.com/"}else{if(premiumUniverse=="eztracks-es"){var universeHost="http://home.ez-tracks.com/"}else{if(premiumUniverse=="bibliocnrs"){var universeHost="http://www.bibliocnrs.fr/"}else{if(premiumUniverse=="skidmoreowingsandmerrill"){var universeHost="http://portal.som.com/"}else{if(premiumUniverse=="bambuu"){var universeHost="http://www.glasgowstudentaccommodation.co.uk/"}else{if(premiumUniverse=="place-medicale"){var universeHost="http://www.place-medicale.pro/"}else{if(premiumUniverse=="gazetaonline"){var universeHost="http://www.mygsp.ro/"}else{if(premiumUniverse=="francediplomatie"){var universeHost="http://mapage.diplomatie.gouv.fr/"}else{if(premiumUniverse=="t-online"){var universeHost="http://www.t-online.de/meine-seite/"}else{if(premiumUniverse=="samsungledtvstudio"){var universeHost="http://www.samsung.com/ledtvstudio/"}else{if(premiumUniverse=="ccc-joneswalker"){var universeHost="http://ccclients.com/nv/"}else{if(premiumUniverse=="zebazar"){var universeHost="http://www.zebazar.com/"}else{if(premiumUniverse=="ubc-social"){var universeHost="http://www.connectionsforlife.ubc.ca/"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}function iframeResize(){try{var A=document.body.offsetHeight;if(A<700){A=700}if($("nv-settings")&&$("nv-settings").offsetHeight>A){A=$("nv-settings").offsetHeight+150}if($("startMsg")&&$("startMsg").offsetHeight>A){A=$("startMsg").offsetHeight+300}if($("feedReader")&&parseInt($("feedReader").offsetHeight)>0){return }if(App.height&&App.height==A){return }App.height=A;document.getElementById("commFrame").src=universeHost+"resize.html?height="+A+"&rnd="+Math.random()*100000}catch(B){}}setInterval(function(){if(document.body){iframeResize()}},1000)};;
if(typeof Netvibes=="undefined"||!Netvibes){var Netvibes={}}if(typeof Netvibes.UI=="undefined"||!Netvibes.UI){Netvibes.UI={}}Netvibes.UI.TabView=Class.create();Netvibes.UI.TabView.prototype={setOptions:function(A){this.options={autohideDropdowns:true,classTabSet:"nv-tabSet",classTabList:"nv-tabList",classTabContent:"nv-tabContent",softPadding:false,orientation:"top",dataKey:"text",extendedAction:false,allowReload:false};Object.extend(this.options,A||{})},initialize:function(A){this.setOptions(A);this.dataItems={};this.selectedTab=null;this.selectedIndex=this.options.selectedIndex||0},_createTabSet:function(){this.tabSet=document.createElement("div");this.tabSet.className=this.options.classTabSet;this.tabList=document.createElement("ul");this.tabList.className=this.options.classTabList+" autoclear";this.tabList.style.padding="0";if(/^(top|bottom|left|right)$/.test(this.options.orientation)){Element.addClassName(this.tabList,this.options.orientation)}this.tabSet.appendChild(this.tabList)},_createTabItem:function(J,A,K){if(typeof K=="undefined"){K={}}var G=document.createElement("a");G.href="javascript:void(0)";G.title=A.tooltip||"";G.target="_blank";G.style.whiteSpace="nowrap";G.onclick=function(){return false};if(A.length){if(A[0].image){var I=document.createElement("img");I.src=A[0].image;G.appendChild(I)}else{if(A[0].picto){var C=document.createElement("img");C.src=A[0].picto;C.style.marginRight="4px";C.style.marginBottom="-2px";G.appendChild(C)}else{if(A[0].icon){var F=document.createElement("img");F.src=A[0].icon;F.style.marginRight="4px";F.style.marginBottom="-2px";G.appendChild(F)}}var B=document.createElement("span");B.appendChild(document.createTextNode(K.staticText||A[0].text));G.appendChild(B)}J.setAttribute("key",A[0][this.options.dataKey]);var D=document.createElement("span");D.className="dropdown";do{var E="dropdownTab-"+(++Netvibes.UI._idIncrement)}while($(E));D.setAttribute("id",E);var H=document.createElement("img");H.src="http://"+NV_HOST+"/img/s.gif";H.width=14;H.height=14;H.style.verticalAlign="middle";H.className="placeHolder";D.appendChild(H);G.appendChild(D);D.onmousedown=this.eventDropDown.bindAsEventListener(this)}else{if(A.image){var I=document.createElement("img");I.src=A.image;G.appendChild(I)}else{if(A.picto){var C=document.createElement("img");C.src=A.picto;C.style.marginRight="4px";C.style.marginBottom="-2px";G.appendChild(C)}else{if(A.icon){var F=document.createElement("img");F.src=A.icon;F.style.marginRight="4px";F.style.marginBottom="-2px";G.appendChild(F)}}if(typeof A.text=="string"){G.appendChild(document.createTextNode(A.text))}else{if(typeof A.text!="undefined"){G.appendChild(A.text)}}}}return(G)},appendTo:function(A){if(!this.tabSet){this._createTabSet()}if(!this.selectedTab&&this.tabList.hasChildNodes()){this.selectTab(0,false)}$(A).appendChild(this.tabSet);if(typeof widget=="object"&&typeof widget.callback=="function"){widget.callback("onUpdateBody")}},addTab:function(D,C,B){if(!this.tabSet){this._createTabSet()}if(typeof B=="undefined"){B={}}var A=document.createElement("li");A.className="tab "+D;A.setAttribute("name",D);if(C.disabled){Element.addClassName(A,"disabled")}else{A.onclick=this.eventTabClicked.bindAsEventListener(this);if(B.staticText){A.setAttribute("static","static")}}A.appendChild(this._createTabItem(A,C,B));if(this.selectedTab==null){}this.tabList.appendChild(A);this.createTabContent(D);this.dataItems[D]=C;return A},removeTab:function(A){var B=this.getTab(A);Element.remove(B)},setTab:function(C,B,A){var D=this.getTab(C);this.dataItems[C]=UWA.merge(B,this.dataItems[C]);D.setHTML("");D.appendChild(this._createTabItem(D,this.dataItems[C],A))},addExternalLink:function(B,A){var C=this.getTab(B);C.firstChild.setAttribute("href",A)},eventTabClicked:function(B){if(Event.element(B).className=="placeHolder"){return false}var A=Event.findElement(B,"LI");if(!Element.hasClassName(A,"disabled")){this.selectTab(A)}return false},eventExtendedActionClicked:function(A){this.hidePopupMenu();this._notify("extendedActionClicked");return false},enableTab:function(B,A){var C=this.getTab(B);if(A){Element.removeClassName(C,"disabled")}else{Element.addClassName(C,"disabled")}},selectTab:function(E,I){if(typeof E=="number"||typeof E=="string"){E=this.getTab(E)}var A=E.getAttribute("name");if(this.selectedTab&&(this.selectedTab.getAttribute("name")==A)&&I==undefined&&!this.options.allowReload){return }var G=this.tabList.getElementsByTagName("li");for(var D=0,H;H=G[D];D++){Element.removeClassName(H,"selected");if(this.popupMenu){this.hidePopupMenu()}if(this.options.autohideDropdowns){var C=$(H).getElementsByClassName("dropdown");$A(C).each(function(J){Element.hide(J)})}}Element.addClassName(E,"selected");if(this.options.autohideDropdowns){var C=$(E).getElementsByClassName("dropdown");$A(C).each(function(J){Element.show(J)})}for(var D=0,F;F=this.contentArray[D];D++){if(Browser.isSafari&&Browser.version<3&&F.getElementsByTagName("iframe").length==1&&F.getElementsByTagName("iframe")[0].style.width=="100%"){if(A==F.getAttribute("name")){F.style.visibility="visible";F.style.position="static"}else{var B=F.getElementsByTagName("iframe")[0];F.style.width=B.contentWindow.innerWidth+"px";F.style.visibility="hidden";F.style.position="absolute";F.style.left="0px";F.style.top="0px"}}else{if(A==F.getAttribute("name")){Element.show(F)}else{Element.hide(F)}}}this.selectedTab=E;this.selectedIndex=E.getAttribute("index");if(I===false){return }this._notify("activeTabChange")},hide:function(){Element.hide(this.tabSet)},show:function(){Element.show(this.tabSet)},hideTabList:function(){Element.hide(this.tabList)},showTabList:function(){Element.show(this.tabList)},reload:function(){this._notify("activeTabChange")},eventDropDown:function(B){var A=Event.findElement(B,"LI");this.popupMenu=$("minitabsOptions");if(!this.popupMenu){this.popupMenu=document.createElement("ul");this.popupMenu.setAttribute("id","minitabsOptions");this.popupMenu.className="popupMenu";this.popupMenu.style.position="absolute";document.getElementsByTagName("body").item(0).appendChild(this.popupMenu);Element.hide(this.popupMenu);Event.observe(document,"mousedown",this.hidePopupMenu.bindAsEventListener(this))}var C=$(A).getElementsByClassName("dropdown")[0];if(Element.visible(this.popupMenu)&&this.popupMenu.getAttribute("dropdownId")==C.id){this.hidePopupMenu();return }this._showPopupMenu(A);this.popupMenu.setAttribute("dropdownId",C.id);Event.stop(B);return false},getTabContent:function(B){var D=(typeof B=="number")?"index":"name";for(var C=0,A=this.contentArray.length;C<A;C++){if(this.contentArray[C].getAttribute(D)==B){return this.contentArray[C]}}},setContent:function(A,C){var B=this.getTabContent(A);if(B){if(typeof C=="string"){B.innerHTML=C}else{B.innerHTML="";B.appendChild(C)}}if(typeof widget=="object"&&typeof widget.callback=="function"){widget.callback("onUpdateBody")}},getTab:function(B){if(typeof B=="string"||typeof B=="number"){var A=this.tabList.getElementsByTagName("li");for(var C=0,D;D=A[C];C++){if(typeof B=="number"&&B==C){return D}if(B==D.getAttribute("name")){return D}}}return B},observe:function(B,A){if(!this.observers){this.observers=[]}this.observers.push([B,A])},_notify:function(D){if(!this.observers){return }var C=this.selectedTab;var B=this.dataItems[C.getAttribute("name")];if(B.length){var F=this.options.dataKey;for(var E=0,A=B.length;E<A;E++){if(B[E][F]==C.getAttribute("key")){B=B[E];break}}}this.observers.each(function(G){if(G[0]==D&&typeof (G[1])=="function"){G[1](C.getAttribute("name"),B)}})},_showPopupMenu:function(R){var D=Position.cumulativeOffset(R);this.popupMenu.innerHTML="";try{var A=R.getAttribute("name");var C=this.dataItems[A];var T=R.getAttribute("key");for(var M=0,P;P=C[M];M++){if(P[this.options.dataKey]==T&&R.getAttribute("static")!="static"){continue}var H=document.createElement("li");var S=document.createElement("a");if(P.picto){var I=document.createElement("img");I.src=P.picto;I.style.marginRight="4px";I.style.marginBottom="-2px";S.appendChild(I)}else{if(P.icon){var N=document.createElement("img");N.src=P.icon;N.style.marginRight="4px";N.style.marginBottom="-2px";S.appendChild(N)}}S.href=(P.htmlUrl||"javascript:void(0)");S.setAttribute("context",A);S.appendChild(document.createTextNode(P.text));S.setAttribute("key",P[this.options.dataKey]);if(!this.options.extendedAction&&(C.length-1)==M){Element.addClassName(S,"last")}S.onclick=this.eventPopupMenuClicked.bindAsEventListener(this);H.appendChild(S);this.popupMenu.appendChild(H)}if(this.options.extendedAction){var H=document.createElement("li");var S=document.createElement("a");S.href="javascript:void(0)";Element.addClassName(S,"action");S.setAttribute("context",A);S.appendChild(document.createTextNode(this.options.extendedAction));S.onclick=this.eventExtendedActionClicked.bindAsEventListener(this);H.appendChild(S);this.popupMenu.appendChild(H)}}catch(O){}var F=Element.getDimensions(R);var Q=(typeof App!="undefined"&&App.pageCustom&&(App.pageCustom.themeTitle=="Coriander"))?0:1;if(Browser.isSafari||Browser.isOpera){Q=0}this.popupMenu.style.left=(D[0]+Q)+"px";this.popupMenu.style.top=(D[1]+Q+F.height)+"px";this.popupMenu.style.width="auto";var B=Element.getDimensions(this.popupMenu).width;if(B<F.width){var Q=12;if(Browser.isIE){Q=11}this.popupMenu.style.width=F.width-Q+"px"}Element.show(this.popupMenu);var L=$(this.tabList).getElementsByClassName("dropped");$A(L).each(function(U){Element.removeClassName(U,"dropped")});Element.addClassName(R,"dropped");if(typeof widget=="object"&&typeof widget.callback=="function"){var P;var K;P=widget.body;var E=0;while(P&&P!=document.body){E+=P.offsetTop;P=P.offsetParent}P=this.popupMenu;var J=0;while(P&&P!=document.body){J+=P.offsetTop;P=P.offsetParent}popupDim=Element.getDimensions(this.popupMenu);bodyDim=widget.body.getDimensions();var G=J-E+popupDim.height;if(bodyDim.height<G){widget.body.style.height=G+"px"}widget.callback("onUpdateBody")}},eventPopupMenuClicked:function(F){var D=Event.findElement(F,"A");var E=D.getAttribute("context");var H=this.getTab(E);if(H.getAttribute("static")!="static"){var G=this.options.dataKey;var B;for(var C=0,A=this.dataItems[E].length;C<A;C++){if(this.dataItems[E][C][G]==D.getAttribute("key")){B=this.dataItems[E][C];break}}H.getElementsByTagName("span")[0].innerHTML=B.text;if(B.picto){H.getElementsByTagName("img")[0].src=B.picto}else{if(B.icon){H.getElementsByTagName("img")[0].src=B.icon}}}H.setAttribute("key",D.getAttribute("key"));this._notify("activeTabChange");this.selectTab(H);this.hidePopupMenu();Event.stop(F);return false},selectKey:function(D,F,A){var H=this.getTab(D);var C=null;var G=this.options.dataKey;for(var E=0,B=this.dataItems[D].length;E<B;E++){if(this.dataItems[D][E][G]==F){C=this.dataItems[D][E];break}}if(C){H.getElementsByTagName("span")[0].innerHTML=C.text;H.setAttribute("key",F);if(C.icon){H.getElementsByTagName("img")[0].src=C.icon}if(A==undefined||A){this.selectTab(H)}}},hidePopupMenu:function(A){if(!this.popupMenu){return false}if(A&&Position.within(this.popupMenu,Event.pointerX(A),Event.pointerY(A))){Event.stop(A);return false}Element.hide(this.popupMenu);var B=$(this.tabList).getElementsByClassName("dropped");$A(B).each(function(C){Element.removeClassName(C,"dropped")});if(typeof widget=="object"&&typeof widget.callback=="function"){widget.body.style.height="";widget.callback("onUpdateBody")}},createTabContent:function(B,A){var C=document.createElement("div");if(this.options.softPadding){if(Browser.isIE){C.style.padding="3px 3px 3px 3px"}else{C.style.padding="6px 3px 3px 3px"}}C.className=this.options.classTabContent+" "+B;C.setAttribute("name",B);C.innerHTML=_("Loading...");this.tabSet.appendChild(C);if(!this.contentArray){this.contentArray=[]}this.contentArray.push(C);C.setAttribute("tabIndex",this.contentArray.length-1)},restoreState:function(A){var C=A.dataObj.data;if(typeof C.miniTabViewState!="undefined"){var B=C.miniTabViewState.parseJSON();if(B&&typeof B.selectedKey=="string"){this.selectKey(B.selectedKey);return }if(B&&typeof B.selectedTab=="string"){this.selectTab(B.selectedTab);return }}this.selectTab(0)},saveState:function(C){var B=null;var A=this.selectedTab.getAttribute("key");if(typeof A=="string"){B='{"selectedKey": "'+A+'"}'}else{B='{"selectedTab": "'+this.selectedTab.getAttribute("name")+'"}'}if(B&&B!=C.dataObj.data.miniTabViewState){C.dataObj.data.miniTabViewState=B;C.save()}},destroy:function(){Event.stopObserving(document,"mousedown",this.hidePopupMenu)}};var MiniTabs={};MiniTabs.create=function(C,A){var B=new Netvibes.UI.TabView(A);B.appendTo(C);return B};;
Netvibes.UI.ColorPicker=Class.create();Netvibes.UI.ColorPicker.prototype={setOptions:function(A){this.options={color:null,onSelectionChange:Function.empty};Object.extend(this.options,A||{});if(typeof this.options.color=="string"&&this.options.color.indexOf("#")==0){this.options.color=[hex2dec(this.options.color.substr(1,2)),hex2dec(this.options.color.substr(3,2)),hex2dec(this.options.color.substr(5,2))]}},initialize:function(A){this.setOptions(A);this.colorPicker=document.createElement("div");this.colorPicker.id="nv-colorPicker";this.colorPicker.style.border="2px solid #444";this.colorPicker.style.backgroundColor="white";this.colorPicker.style.position="absolute";this.colorPicker.style.padding="6px";this.colorPicker.style.zIndex="10000";document.body.appendChild(this.colorPicker);Event.observe(document,"click",this.hide.bindAsEventListener(this),!Browser.isIE)},ToRGB1:function(C,B,A){if(A>360){A-=360}else{if(A<0){A+=360}}if(A<60){C=C+(B-C)*A/60}else{if(A<180){C=B}else{if(A<240){C=C+(B-C)*(240-A)/60}}}return Math.round(C*255)},HSLtoRGB:function(C,B,A){var D,E;if(B==0){return[A,A,A]}C=C*360/255;B/=255;A/=255;if(A<=0.5){D=A+A*B}else{D=A+B-A*B}E=2*A-D;return[this.ToRGB1(E,D,C+120),this.ToRGB1(E,D,C),this.ToRGB1(E,D,C-120)]},cssColorToRGB:function(B){var A;if(B.indexOf("#")==0){B=B.toUpperCase();return[this.hex2dec(B.substr(1,2)),this.hex2dec(B.substr(3,2)),this.hex2dec(B.substr(5,2))]}else{if(B.indexOf("rgb")==0){A=(B.substr(4,B.indexOf(")")-4)).split(",");return A}}},hex2dec:function(B){var C="0123456789ABCDEF";var A=0;for(a=B.length-1;a>=0;a--){A+=Math.pow(16,B.length-a-1)*C.indexOf(B.charAt(a))}return A},dec2hex:function(C){var B="0123456789ABCDEF";var A=B.substr(C&15,1);while(C>15){C>>=4;A=B.substr(C&15,1)+A}if(A.length==1){A="0"+A}return A},build:function(){var C=document.createElement("table");C.style.borderCollapse="collapse";C.style.cursor="pointer";C.style.clear="both";var B=document.createElement("tbody");for(l=0;l<=250;l+=10){if(l==250){l=255}var D=document.createElement("tr");var F=document.createElement("td");F.style.height="10px";F.style.width="10px";F.style.backgroundColor="rgb("+l+","+l+","+l+")";if(this.options.color&&this.options.color[0]==l&&this.options.color[1]==l&&this.options.color[2]==l){if(l>130){F.style.color="black"}else{F.style.color="white"}F.style.textAlign="center";if(Browser.isIE){F.innerHTML="<div style='position: absolute; margin-top: -4px;margin-left:-2px'>x</div>"}else{F.innerHTML="<div style='position: absolute; margin-top: -9px;margin-left:2px'>x</div>"}var E=F.firstChild;this.current=false}D.appendChild(F);F.onclick=this.onColorPicked.bindAsEventListener(this);for(t=0;t<=240;t+=10){F=document.createElement("td");var A=this.HSLtoRGB(t,240,l);F.style.height="10px";F.style.width="10px";if(this.current&&this.options.color[0]==A[0]&&this.options.color[1]==A[1]&&this.options.color[2]==A[2]){F.style.color="rgb("+(255-A[0])+","+(255-A[1])+","+(255-A[2])+")";F.style.textAlign="center";if(Browser.isIE){F.innerHTML="<div style='position: absolute; margin-top: -4px;margin-left:-2px'>x</div>"}else{F.innerHTML="<div style='position: absolute; margin-top: -9px;margin-left:2px'>x</div>"}var E=F.firstChild;this.current=false}F.style.backgroundColor="rgb("+A[0]+","+A[1]+","+A[2]+")";F.onclick=this.onColorPicked.bindAsEventListener(this);D.appendChild(F)}B.appendChild(D)}C.appendChild(B);return C},onColorPicked:function(B){var C=Event.findElement(B,"TD");var A=this.cssColorToRGB(C.style.backgroundColor);A=this.dec2hex(A[0])+this.dec2hex(A[1])+this.dec2hex(A[2]);this.options.onSelectionChange(A);Element.hide(this.colorPicker);Event.stop(B)},show:function(B){this.element=$(B);this.colorPicker.innerHTML="";this.colorPicker.appendChild(this.build());if(this.options.top===undefined){var C=Position.cumulativeOffset(B);var A=Element.getDimensions(B);this.colorPicker.style.left=C[0]+"px";this.colorPicker.style.top=(C[1]+A.height)+"px"}else{this.colorPicker.style.left=this.options.left+"px";this.colorPicker.style.top=this.options.top+"px"}this.colorPicker.style.display=""},hide:function(A){if(!Position.within(this.colorPicker,Event.pointerX(A),Event.pointerY(A))&&!Position.within(this.element,Event.pointerX(A),Event.pointerY(A))){Element.hide(this.colorPicker)}}};window._colorPicker=null;Netvibes.UI.showColorPicker=function(B,A){if(window._colorPicker==null){window._colorPicker=new Netvibes.UI.ColorPicker(A)}window._colorPicker.setOptions(A);if(Browser.isIE){Event.stop(window.event)}window._colorPicker.show(B)};;
Netvibes.UI.FlashPlayer=Class.create();Netvibes.UI.FlashPlayer._maxzIndex=9010;Netvibes.UI.FlashPlayer.prototype={setOptions:function(A){this.options={flashVars:"",flashUrl:"",width:320,height:240,wmode:"opaque",showToolbar:true,showFullScreenLink:true,fixModuleId:0};Object.extend(this.options,A||{})},initialize:function(B,A){this.setOptions(A);this.parent=B;this.container=null;this.linuxIframe=null;this.isFullScreen=false},show:function(D,C,A){if(typeof A=="undefined"){A={}}this.options.flashUrl=D;if(Browser.isIE){if(this.options.flashUrl.indexOf("?")!=-1){this.options.flashUrl+=("&"+Math.round(Math.random()*100))}}this.options.flashVars=C;if(!this.container){this.container=document.createElement("div");this.container.className="flashplayer";this.container.align="center";this.container.style.position="absolute";this.container.style.zIndex="8000";this.container.style.background="#ffffff";this.parent.appendChild(this.container);if(!Browser.isIE){this.container.style.position="absolute";this.placeHolder=document.createElement("div");this.placeHolder.style.height=this.options.height+"px";this.parent.appendChild(this.placeHolder)}}else{this.container.innerHTML=""}var B="";B+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+this.options.width+'" height="'+this.options.height+'">';B+='<param name="allowScriptAccess" value="sameDomain" />';B+='<param name="movie" value="'+this.options.flashUrl+'" />';B+='<param name="quality" value="high" />';B+='<param name="wmode" value="'+this.options.wmode+'" />';B+='<param name="bgcolor" value="#ffffff" />';B+='<param value="true" name="allowfullscreen"/>';B+='<param name="flashVars" value="'+this.options.flashVars+'" />';B+='<embed wmode="'+this.options.wmode+'" src="'+this.options.flashUrl+'" quality="high" bgcolor="#ffffff" width="'+this.options.width+'" height="'+this.options.height+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashVars="'+this.options.flashVars+'" allowfullscreen="true"/>';B+="</object>";this.container.innerHTML=B;this.element=this.parent.getElementsByTagName((Browser.isIE||Browser.isSafari)?"object":"embed")[0];if(this.options.showToolbar){this._createLinks(A.mediaLinkUrl,A.mediaLinkText)}Element.show(this.container);if(this.placeHolder){Element.show(this.placeHolder)}this.resize()},hide:function(){if(this.container){this.container.innerHTML="";Element.hide(this.container);if(this.placeHolder){Element.hide(this.placeHolder)}}if(this.hide&&this.links){Element.hide(this.links)}if(typeof widget=="object"&&typeof widget.callback=="function"){widget.callback("onUpdateBody")}return false},setFullScreenMode:function(A){this.isFullScreen=(typeof (A)!="undefined"&&A)?true:false;this._fixAdjacentModules();if(this.isFullScreen){window.scrollTo(0,0);if(Browser.isIE){this.container.style.position="absolute"}this.container.style.top="0px";this.container.style.left="0px";this.container.style.marginLeft="0";this.container.style.zIndex=++Netvibes.UI.FlashPlayer._maxzIndex;this._createCloseButton();Event.observe(window,"resize",this.resize.bindAsEventListener(this))}else{Element.remove(this.closeButton);if(Browser.isLinux&&Browser.isFirefox){Element.remove(this.linuxIframe)}Event.stopObserving(window,"resize",this.resize)}this.resize();if(Browser.isLinux&&Browser.isFirefox){this.linuxIframe=document.createElement("iframe");this.linuxIframe.style.position="absolute";this.linuxIframe.style.width=this.closeButton.offsetWidth+"px";this.linuxIframe.style.height=this.closeButton.offsetHeight+"px";this.linuxIframe.style.left=this.closeButton.offsetLeft+"px";this.linuxIframe.style.top=this.closeButton.offsetTop+"px";this.linuxIframe.setAttribute("frameborder","0");this.linuxIframe.setAttribute("scrolling","no");this.linuxIframe.style.zIndex=parseInt(this.container.style.zIndex)+1;document.body.appendChild(this.linuxIframe)}return false},resize:function(A,C){if(!this.container){return }if(this.isFullScreen){if(this.container.style.width!=Browser.getDocumentWidth()){this.container.style.width="1px";this.container.style.height="1px";this.element.style.width="1px";this.container.style.width=Browser.getDocumentWidth()+"px";this.container.style.height=Browser.getDocumentHeight()+"px";this.element.style.height=Browser.getClientHeight()-(Browser.isFirefox?3:0)+"px";this.element.style.width=Browser.getDocumentWidth()+"px"}return }this.container.style.top="";this.container.style.left="";this.container.style.width="1px";this.container.style.height="1px";if(typeof A!="undefined"&&typeof C!="undefined"){this.container.style.width=A+"px";if(!Browser.isIE){this.placeHolder.style.height=C+"px";this.container.style.marginLeft="0px"}this.container.style.height=C+"px";this.element.style.width=A+"px";this.element.style.height=C+"px";return }if(Browser.isIE){this.container.style.position="";var D=Element.getDimensions(this.parent);this.container.style.width=D.width+"px";this.container.style.height=this.options.height+"px";this.element.style.width=this.options.width+"px";this.element.style.height=this.options.height+"px"}else{var D=Element.getDimensions(this.placeHolder);var B=Math.min(this.options.width,D.width);this.container.style.width=B+"px";this.container.style.height=D.height+"px";this.element.style.width=B+"px";this.element.style.height=D.height+"px";this.container.style.marginLeft=Math.round((D.width-B)/2)+"px"}},_createCloseButton:function(){this.closeButton=document.createElement("input");this.closeButton.type="button";this.closeButton.id="flashplayer-back";this.closeButton.style.position="absolute";this.closeButton.style.top="2px";this.closeButton.style.right="2px";this.closeButton.value=_("Back to my page");this.closeButton.style.zIndex=parseInt(this.container.style.zIndex)+2;if(Browser.isIE&&Browser.version>6){this.closeButton.style.width=(this.closeButton.value.length)+"em"}this.closeButton.onclick=function(){this.setFullScreenMode(false)}.bind(this);document.body.appendChild(this.closeButton)},_createLinks:function(A,C){if(this.links){Element.remove(this.links)}this.links=document.createElement("p");this.links.align="center";this.links.style.padding="4px";if(A&&C){var B=document.createElement("a");B.href=A;B.rel="external";B.target="_blank";B.innerHTML=C.stripTags();this.links.appendChild(B)}this.links.appendChild(document.createTextNode(" | "));var D=document.createElement("a");D.href="javascript:void(0)";D.onclick=this.hide.bind(this);D.innerHTML="<strong>"+_("Close Video")+"</strong>";this.links.appendChild(D);this.parent.appendChild(this.links)},_fixAdjacentModules:function(){if(!this.options.fixModuleId){return }var A=$("application").getElementsByClassName("gripper");for(var D=0;D<A.length;D++){var B=A[D];if(this.isFullScreen){B.style.visibility="hidden"}else{B.style.visibility=""}}for(var D=0,C;C=App.moduleList[D];D++){if(C.dataObj.tab==App.selectedTab&&C.dataObj.fixId!=this.options.fixModuleId){if(this.isFullScreen){C.hide()}else{C.show()}}}}};;
if(typeof App=="undefined"){var App={}}App.toolTip=function(A,B,I,D,H){if(App&&App.draggingItem){return true}var E=0;var J=13;var G=false;var F=$("tooltip");if(I==null){I=150}if(D==null){D="center"}if(App.dirRTL&&D=="left"){D="right"}function C(){return(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body}this.display=function(M,K,L,N){this.node=M;if(document.addEventListener){document.addEventListener("mousemove",this.positiontip.bind(this),false);M.addEventListener("mouseout",this.hide.bind(this),false)}else{document.attachEvent("onmousemove",this.positiontip.bind(this));M.attachEvent("onmouseout",this.hide.bind(this))}F.style.textAlign=N;F.innerHTML='<div class="tooltipFrame"><div class="tooltipFrame2">'+K+"</div></div>";F.style.display="block";if(F.offsetWidth>L){F.style.width=L+"px"}else{F.style.width=F.offsetWidth+"px"}G=true};this.positiontip=function(P){if(G){var L=Event.pointerX(P);var K=Event.pointerY(P);var N=Browser.isIE&&!window.opera?C().clientWidth-P.clientX-E:window.innerWidth-P.clientX-E-20;var M=Browser.isIE&&!window.opera?C().clientHeight-P.clientY-J:window.innerHeight-P.clientY-J-20;var R=(E<0)?E*(-1):-1000;if(F.offsetWidth>I){F.style.width=I+"px"}var O=parseInt(F.style.width);if(App.dirRTL){if(N<O){if(Browser.isIE){F.style.left=C().scrollLeft+P.clientX-O+"px"}else{F.style.left=L+E-O+"px"}}else{if(L<O+5){F.style.left="5px"}else{F.style.left=L+E-O+"px"}}}else{if(N<O){if(Browser.isIE){F.style.left=C().scrollLeft+P.clientX-O+"px"}else{F.style.left=L+E-O+"px"}}else{if(L<R){F.style.left="5px"}else{F.style.left=L+E+"px"}}}if(M<F.offsetHeight){var Q=(Browser.isSafari)?0:window.pageYOffset;F.style.top=(Browser.isIE)?C().scrollTop+P.clientY-F.offsetHeight-J+"px":Q+P.clientY-F.offsetHeight-J+"px"}else{F.style.top=K+J+"px"}F.style.visibility="visible"}};this.hide=function(){if(document.removeEventListener){document.removeEventListener("mousemove",this.positiontip,false);A.removeEventListener("mouseout",this.hide,false)}else{document.detachEvent("onmousemove",this.positiontip);A.detachEvent("onmouseout",this.hide)}G=false;F.style.visibility="hidden";F.style.top="-1000px";F.style.backgroundColor="";F.style.width=""};this.display(A,B,I,D)};;
var AudioPlayer=new Object();AudioPlayer.onInit=function(){};AudioPlayer._getControl=function(){if(Browser.isIE){}return document.getElementById("playermp3Control")};AudioPlayer._createPlayer=function(){if(!$("playermp3Display")){var D=$$("#top span.create");if(D){D.setStyle("display","none")}var B=$("playermp3Container");var K=document.createElement("div");K.id="playermp3Display";var H=document.createElement("a");H.href="javascript:AudioPlayer.play()";H.innerHTML=Netvibes.UI.createIcon("actions-playermp3-play",_("Play"),16,16,true);K.appendChild(H);this.playButton=H;var L=document.createElement("a");L.href="javascript:AudioPlayer.pause()";L.innerHTML=Netvibes.UI.createIcon("actions-playermp3-pause",_("Pause"),16,16,true);K.appendChild(L);this.pauseButton=L;var O=document.createElement("a");O.href="javascript:AudioPlayer.stop()";O.innerHTML=Netvibes.UI.createIcon("actions-playermp3-stop",_("Stop"),16,16,true);K.appendChild(O);this.stopButton=O;var P=document.createElement("span");Element.addClassName(P,"playermp3-elapsedtime");Event.observe(P,"mousedown",this.timeClick.bindAsEventListener(this));P.innerHTML="00:00";K.appendChild(P);this.elapsedTime=P;var F=document.createElement("span");Element.addClassName(F,"playermp3-remainingtime");Event.observe(F,"mousedown",this.timeClick.bindAsEventListener(this));F.innerHTML="00:00";K.appendChild(F);this.remainingTime=F;var E=document.createElement("span");Element.addClassName(E,"playermp3-percentloaded");Event.observe(E,"mousedown",this.timeClick.bindAsEventListener(this));E.innerHTML="0%";K.appendChild(E);this.percentLoaded=E;var M=document.createElement("span");Event.observe(M,"mousedown",this.timelineClick.bindAsEventListener(this));Event.observe(M,"mouseover",this.timelineOver.bindAsEventListener(this));Element.addClassName(M,"playermp3-timeline");var I=document.createElement("span");Element.addClassName(I,"playermp3-timeline-elapsed");I.innerHTML="&nbsp;";M.appendChild(I);var G=document.createElement("span");Element.addClassName(G,"playermp3-timeline-title");M.appendChild(G);K.appendChild(M);this.timeline=M;this.timelineTitle=G;this.timelineElapsed=I;var A=document.createElement("span");Element.addClassName(A,"playermp3-volume");Event.observe(A,"mousedown",this.volumeDown.bindAsEventListener(this));Event.observe(document,"mousemove",this.volumeMove.bindAsEventListener(this));Event.observe(document,"mouseup",this.volumeUp.bindAsEventListener(this));var J=document.createElement("span");Element.addClassName(J,"playermp3-volume-indicator");A.appendChild(J);K.appendChild(A);this.volumeButton=A;this.volumeIndicator=J;var N=document.createElement("img");N.src="/img/s.gif";this.eq=N;Element.addClassName(this.eq,"playermp3-eq");K.appendChild(this.eq);var C=document.createElement("a");C.href="javascript:AudioPlayer.close()";C.innerHTML=Netvibes.UI.createIcon("actions-window-close",_("Close"),16,16,true);K.appendChild(C);this.closeButton=C;B.appendChild(K)}};AudioPlayer.onUpdate=function(){var E=this._getControl();var H=parseInt(this.position);var A=parseInt(this.duration);var K=Math.round(H/A*100);var B=A-H;var G=this.volume;if(this.volumeButton){var I=Element.getStyle(this.volumeButton,"width");I=parseInt(I.substr(0,I.length-2));var F=G/200*I;Element.setStyle(this.volumeIndicator,{width:F+"px"});var D=Math.floor(H/(1000*60));var J=Math.floor(H/1000)%60;this.elapsedTime.innerHTML=((D<10)?"0"+D:D)+":"+((J<10)?"0"+J:J);D=Math.floor(B/(1000*60));J=Math.floor(B/1000)%60;this.remainingTime.innerHTML="-"+((D<10)?"0"+D:D)+":"+((J<10)?"0"+J:J);this.percentLoaded.innerHTML=((this.bytesPercent=="NaN")?0:this.bytesPercent)+"%";if(this.bytesPercent=="100"&&Element.getStyle(this.percentLoaded,"display")=="block"){this.elapsedTime.style.display="block";this.remainingTime.style.display="none";this.percentLoaded.style.display="none"}this.timelineTitle.innerHTML=this.title;var L=Element.getStyle(this.timeline,"width");var C=parseInt(L.substr(0,L.length-2));C=C/this.bytesTotal*this.bytesLoaded;C=Math.round(C/100*K);if(!isNaN(C)){Element.setStyle(this.timelineElapsed,{width:C+"px"})}if(A>0&&H==A){this.stop();this.onUpdate()}}};AudioPlayer.play=function(A,B){App.report("click.flashplayer");if(App.FlashSupport.fv[0]<6){alert(_("You need to install Flash Player to use this feature.\n Go to http://www.adobe.com/go/getflashplayer"));return false}if(A){this.url=A;this.position=0}if(B){this.title=B.stripTags()}this._createPlayer();var C=this._getControl();if(A){C.SetVariable("method:setUrl",this.url)}C.SetVariable("method:play","");C.SetVariable("enabled","true");Element.hide(this.playButton);Element.show(this.pauseButton);Element.removeClassName(this.eq,"playermp3-eq-stop");Element.addClassName(this.eq,"playermp3-eq")};AudioPlayer.pause=function(){var A=this._getControl();A.SetVariable("method:pause","");Element.hide(this.pauseButton);Element.show(this.playButton);Element.removeClassName(this.eq,"playermp3-eq");Element.addClassName(this.eq,"playermp3-eq-stop")};AudioPlayer.stop=function(){var A=this._getControl();this.position=0;A.SetVariable("method:setPosition",this.position);A.SetVariable("method:stop","");Element.hide(this.pauseButton);Element.show(this.playButton);Element.removeClassName(this.eq,"playermp3-eq");Element.addClassName(this.eq,"playermp3-eq-stop")};AudioPlayer.timelineClick=function(C){var E=this._getControl();var D=Element.getStyle(this.timeline,"width");D=parseInt(D.substr(0,D.length-2));var B=findPosX(this.timeline);var A=Event.pointerX(C);this.position=Math.round((A-B)/D*this.duration);E.SetVariable("method:setPosition",this.position);this.onUpdate();Event.stop(C)};AudioPlayer.timelineOver=function(A){App.toolTip(this.timeline,this.title,300)};AudioPlayer.timeClick=function(B){var C=Element.getStyle(this.elapsedTime,"display");var A=Element.getStyle(this.remainingTime,"display");var D=Element.getStyle(this.percentLoaded,"display");if(C=="block"){this.elapsedTime.style.display="none";this.remainingTime.style.display="block";this.percentLoaded.style.display="none"}else{if(A=="block"){if(this.bytesPercent=="100"){this.elapsedTime.style.display="block";this.remainingTime.style.display="none";this.percentLoaded.style.display="none"}else{this.elapsedTime.style.display="none";this.remainingTime.style.display="none";this.percentLoaded.style.display="block"}}else{this.elapsedTime.style.display="block";this.remainingTime.style.display="none";this.percentLoaded.style.display="none"}}};AudioPlayer.volumeDown=function(A){this.volumePressed=true;this.volumeMove(A);Event.stop(A)};AudioPlayer.volumeMove=function(E){if(this.volumePressed){var F=this._getControl();var G=Element.getStyle(this.volumeButton,"width");var D=Element.getStyle(this.volumeButton,"height");G=parseInt(G.substr(0,G.length-2));var C=findPosX(this.volumeButton);var B=findPosY(this.volumeButton);var A=Event.pointerX(E);var H=Event.pointerY(E);if(A<C){this.volume=0}else{if(A>C+G){this.volume=200}else{this.volume=Math.round((A-C)/G*200)}}F.SetVariable("method:setVolume",this.volume)}};AudioPlayer.volumeUp=function(A){this.volumePressed=false};AudioPlayer.close=function(){this.stop();var A=this._getControl();A.SetVariable("enabled","false");Element.remove($("playermp3Display"));var B=$$("#top span.create");if(B){B.setStyle("display","")}};App.launchPlayer=function(A,B){AudioPlayer.play(A,B)};PodcastPlayer={};PodcastPlayer.play=function(A,B){AudioPlayer.play(A,B)};;
Netvibes.UI.NoWheelScrollbar=new Class({initialize:function(A){this.element=$(A);if(this.element.nowheel){return }this.element.nowheel=true;this.reset();this.element.addEvent("mousewheel",function(B){if(this.element.getSize().y==this.element.getScrollSize().y){}else{B.stop();if(B.wheel<0){if(this.scrollOffset<this.element.getScrollSize().y-this.element.getSize().y){this.element.scrollTo(0,this.scrollOffset+this.scrollSize)}}else{if(B.wheel>0){if(this.scrollOffset>0){this.element.scrollTo(0,this.scrollOffset-this.scrollSize)}}}}}.bind(this));this.element.addEvent("scroll",function(B){this.scrollOffset=this.element.getScroll().y}.bind(this))},reset:function(){this.scrollOffset=0;this.scrollSize=20;this.element.scrollTo(0,0)}});Netvibes.UI.AjaxScrollbar=new Class({Implements:[Events,Options],options:{size:50,snap:80,length:-1,params:{},evalScripts:false,appendExtraParams:true,stop:false},initialize:function(C,B,A){this.setOptions(A);this.element=$(C);this.nowheel=new Netvibes.UI.NoWheelScrollbar(this.element);this.reset();this.element.addEvent("scroll",this.onScroll.bind(this));this.baseUrl=B;this.ajax=new Request({url:B,method:"get",evalScripts:this.options.evalScripts,link:"cancel"});this.ajax.addEvent("success",this.onComplete.bind(this))},reset:function(){this.amount=0;this.scroll={y:0};this.nowheel.reset();this.element.scrollTo(0,0);this.options.stop=false},refresh:function(){this.element.empty();this.reset();this.requestData()},onScroll:function(A){if(this.amount==0||this.options.length>0&&(this.amount>=this.options.length)){return false}if(this.element.getScroll().y<this.scroll.y){return false}this.scroll.y=this.element.getScroll().y;var B=(100*(this.element.getScroll().y+this.element.getSize().y))/this.element.getScrollSize().y;if(B>this.options.snap&&!this.ajax.running&&!this.options.stop){this.requestData()}},requestData:function(){this.fireEvent("onRequest");new Element("div",{"class":"loading ajaxScrollbarLoader"}).set("text",_("Loading...")).inject(this.element);if(this.options.appendExtraParams){var A=new Hash($merge({offset:this.amount,count:this.options.size},this.options.params));if(this.baseUrl.substr(0,7)=="http://"){var B=this.baseUrl+(this.baseUrl.indexOf("?")<0?"?":"&")+A.toQueryString();A.extend({url:(B)});this.ajax.options.url=UWA.proxies.ajax}this.ajax.send({data:A});this.ajax.options.url=this.baseUrl}else{this.ajax.send({data:this.options.params})}},onComplete:function(A,B){if(this.element.lastChild){$(this.element.lastChild).remove()}this.fireEvent("onLoad",[A,B,this.amount]);if(this.amount==0){this.fireEvent("onStart")}this.amount+=this.options.size},stop:function(){this.setOptions({stop:true})}});;
var SqueezeBox={presets:{size:{x:600,y:450},sizeLoading:{x:200,y:150},marginInner:{x:20,y:20},marginImage:{x:50,y:75},handler:false,target:null,closable:true,closeBtn:true,zIndex:65555,overlayOpacity:0.7,classWindow:"",classOverlay:"",overlayFx:{},resizeFx:{},contentFx:{},parse:false,parseSecure:false,ajaxOptions:{},onOpen:$empty,onClose:$empty,onUpdate:$empty,onResize:$empty,onMove:$empty,onShow:$empty,onHide:$empty},initialize:function(A){if(this.options){return this}this.presets=$merge(this.presets,A);this.options={};this.setOptions(this.presets).build();this.bound={window:this.reposition.bind(this,[null]),scroll:this.checkTarget.bind(this),close:this.close.bind(this),key:this.onKey.bind(this)};this.isOpen=this.isLoading=false;return this},build:function(){this.overlay=new Element("div",{id:"sbox-overlay",styles:{display:"none",zIndex:this.options.zIndex}});this.content=new Element("div",{id:"sbox-content"});this.closeBtn=new Element("a",{id:"sbox-btn-close",href:"#"});this.win=new Element("div",{id:"sbox-window",styles:{display:"none",zIndex:this.options.zIndex+2}}).adopt(this.closeBtn,this.content);this.fx={overlay:new Fx.Tween(this.overlay,$merge({property:"opacity",onStart:Events.prototype.clearChain,duration:250,link:"cancel"},this.options.overlayFx)).set(0),win:new Fx.Morph(this.win,$merge({onStart:Events.prototype.clearChain,unit:"px",duration:750,transition:Fx.Transitions.Quint.easeOut,link:"cancel",unit:"px"},this.options.resizeFx)),content:new Fx.Tween(this.content,$merge({property:"opacity",duration:250,link:"cancel"},this.options.contentFx)).set(0)};$(document.body).adopt(this.overlay,this.win)},assign:function(B,A){return B.addEvent("click",function(){return !SqueezeBox.fromElement(this,A)})},fromElement:function(E,B){this.initialize();if(this.element){this.trash()}this.element=$(E);this.setOptions($merge(this.presets,B||{}));if(this.element&&this.options.parse){var D=this.element.getProperty(this.options.parse);if(D&&(D=JSON.decode(D,this.options.parseSecure))){this.setOptions(D)}}this.assignOptions();this.url=((this.element)?(this.options.url||this.element.get("href")):E)||"";var C=this.options.handler;if(C){return this.setContent(C,this.parsers[C].call(this,true))}var A=false;this.parsers.some(function(H,F){var G=H.call(this);if(G){A=this.setContent(F,G);return true}return false},this);return A},assignOptions:function(){this.overlay.set("class",this.options.classOverlay);this.win.set("class",this.options.classWindow);if(Browser.Engine.trident4){this.win.addClass("sbox-window-ie6")}},close:function(B){var A=($type(B)=="event");if(A){B.stop()}if(!this.isOpen||(A&&!$lambda(this.options.closable).call(this,B))){return this}this.fx.overlay.start(0).chain(this.toggleOverlay.bind(this));this.win.setStyle("display","none");this.isOpen=false;this.fireEvent("onClose",[this.content]);this.trash();this.toggleListeners();return this},trash:function(){this.element=this.asset=null;this.options={};this.removeEvents().setOptions(this.presets).callChain()},onError:function(){this.asset=null;this.setContent("string","Error during loading")},setContent:function(A,B){if(!this.handlers[A]){return false}this.content.className="sbox-content-"+A;this.applyTimer=this.applyContent.delay(this.fx.overlay.options.duration,this,this.handlers[A].call(this,B));if(this.overlay.retrieve("opacity")){return this}this.toggleOverlay(true);this.fx.overlay.start(this.options.overlayOpacity);return this.reposition()},applyContent:function(B,A){this.applyTimer=$clear(this.applyTimer);this.hideContent();if(!B){this.toggleLoading(true)}else{if(this.isLoading){this.toggleLoading(false)}this.fireEvent("onUpdate",[this.content],20)}this.content.empty();if(["string","array",false].contains($type(B))){this.content.set("html",B||"")}else{this.content.adopt(B)}this.callChain();if(!this.isOpen){this.toggleListeners(true);this.resize(A,true);this.isOpen=true;this.fireEvent("onOpen",[this.content])}else{this.resize(A)}},resize:function(C,B){this.win.setStyle("visibility","hidden");var D=document.getSize(),A=document.getScroll();this.size=$merge((this.isLoading)?this.options.sizeLoading:this.options.size,C);var E={width:this.size.x,height:this.size.y,left:(A.x+(D.x-this.size.x-this.options.marginInner.x)/2).toInt(),top:(A.y+(D.y-this.size.y-this.options.marginInner.y)/2).toInt()};$clear(this.showTimer||null);this.hideContent();if(!B){this.fx.win.start(E).chain(this.showContent.bind(this))}else{this.win.setStyles(E).setStyle("display","");this.showTimer=this.showContent.delay(50,this)}this.win.setStyle("visibility","visible");return this.reposition()},toggleListeners:function(B){var A=(B)?"addEvent":"removeEvent";this.closeBtn[A]("click",this.bound.close);this.overlay[A]("click",this.bound.close);document[A]("keydown",this.bound.key)[A]("mousewheel",this.bound.scroll);window[A]("resize",this.bound.window)[A]("scroll",this.bound.window)},toggleLoading:function(A){this.isLoading=A;this.win[(A)?"addClass":"removeClass"]("sbox-loading");if(A){this.fireEvent("onLoading",[this.win])}},toggleOverlay:function(A){this.overlay.setStyle("display",(A)?"":"none");$(document.body)[(A)?"addClass":"removeClass"]("body-overlayed")},showContent:function(){if(this.content.get("opacity")){this.fireEvent("onShow",[this.win])}this.fx.content.start(1)},hideContent:function(){if(!this.content.get("opacity")){this.fireEvent("onHide",[this.win])}this.fx.content.set(0)},onKey:function(A){switch(A.key){case"esc":this.close(A);case"up":case"down":return false}},checkTarget:function(A){return this.content.hasChild(A.target)},reposition:function(){var B=document.getSize(),A=document.getScroll();this.overlay.setStyles({left:A.x+"px",top:A.y+"px",width:B.x+"px",height:B.y+"px"});if(B.y<this.win.getSize().y){return }if(this.options.forcePosition){this.win.setStyles({left:(A.x+(B.x-this.win.offsetWidth)/2).toInt()+"px",top:A.x+(this.options.forcePosition.y-this.win.offsetHeight/2).toInt()+"px"})}else{if(App.isPremium()&&App.premium.mouse){var C=(App.premium.mouse.y-this.win.offsetHeight/2).toInt();if(C<40){C=40}this.win.setStyles({left:(A.x+(B.x-this.win.offsetWidth)/2).toInt()+"px",top:C+"px"})}else{this.win.setStyles({left:(A.x+(B.x-this.win.offsetWidth)/2).toInt()+"px",top:(A.y+(B.y-this.win.offsetHeight)/2).toInt()+"px"})}}return this.fireEvent("onMove",[this.overlay,this.win])},removeEvents:function(A){if(!this.$events){return this}if(!A){this.$events=null}else{if(this.$events[A]){this.$events[A]=null}}return this},extend:function(A){return $extend(this,A)},handlers:new Hash(),parsers:new Hash()};SqueezeBox.extend(new Events($empty)).extend(new Options($empty)).extend(new Chain($empty));SqueezeBox.parsers.extend({image:function(A){return(A||(/\.(?:jpg|png|gif)$/i).test(this.url))?this.url:false},clone:function(A){if($(this.options.target)){return $(this.options.target)}if(this.element&&!this.element.parentNode){return this.element}var B=this.url.match(/#([\w-]+)$/);return(B)?$(B[1]):(A?this.element:false)},ajax:function(A){return(A||(this.url&&!(/^(?:javascript|#)/i).test(this.url)))?this.url:false},iframe:function(A){return(A||this.url)?this.url:false},string:function(A){return true}});SqueezeBox.handlers.extend({image:function(A){var C,B=new Image();this.asset=null;B.onload=B.onabort=B.onerror=(function(){B.onload=B.onabort=B.onerror=null;if(!B.width){this.onError.delay(10,this);return }var E=document.getSize();E.x-=this.options.marginImage.x;E.y-=this.options.marginImage.y;C={x:B.width,y:B.height};for(var D=2;D--;){if(C.x>E.x){C.y*=E.x/C.x;C.x=E.x}else{if(C.y>E.y){C.x*=E.y/C.y;C.y=E.y}}}C.x=C.x.toInt();C.y=C.y.toInt();this.asset=$(B);B=null;this.asset.setProperties({width:C.x,height:C.y});if(this.isOpen){this.applyContent(this.asset,C)}}).bind(this);B.src=A;if(B&&B.onload&&B.complete){B.onload()}return(this.asset)?[this.asset,C]:null},clone:function(A){return A.clone()},adopt:$arguments(0),ajax:function(A){this.asset=new Request.HTML($merge({method:"get"},this.options.ajaxOptions)).addEvents({onSuccess:function(B){this.applyContent(B);this.asset=null}.bind(this),onFailure:this.onError.bind(this)});this.asset.send.delay(10,this.asset,[{url:A}])},iframe:function(A){return new Element("iframe",$merge({src:A,frameBorder:0,width:this.options.size.x,height:this.options.size.y},this.options.iframeOptions))},string:function(A){return A}});SqueezeBox.handlers.url=SqueezeBox.handlers.ajax;SqueezeBox.parsers.url=SqueezeBox.parsers.ajax;SqueezeBox.parsers.adopt=SqueezeBox.parsers.clone;;
var Calendar=new Class({initialize:function(D,B){this.props=Object.extend({blocked:[],classes:["calendar","prev","next","month","year","invalid","valid","inactive","active","hover"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],direction:0,draggable:true,months:["January","February","March","April","May","June","July","August","September","October","November","December"],navigation:1,offset:0,pad:1,inject:false},B||{});if(D==null||D.length==0){return false}this.props.offset%=7;if(!this.props.inject){this.calendar=new Element("div",{styles:{left:"-1000px",opacity:0,position:"absolute",top:"-1000px",zIndex:1000}}).addClass(this.props.classes[0]).injectInside(document.body);this.calendar.coord=this.calendar.getCoordinates();if(window.Drag&&this.props.draggable){new Drag.Move(this.calendar)}}else{this.calendar=new Element("div").addClass(this.props.classes[0]).inject(this.props.inject)}this.fx=this.calendar.effect("opacity",{onStart:function(){if(this.element.getStyle("opacity")==0){this.element.setStyle("display","block")}},onComplete:function(){if(this.element.getStyle("opacity")==0){this.element.setStyle("display","none")}}});this.calendars=[];var F=0;var E=new Date();E.setDate(E.getDate()+this.props.direction.toInt());for(var A in D){var C={button:new Element("button",{type:"button"}),el:$(A),els:[],id:F++,month:E.getMonth(),visible:false,year:E.getFullYear()};this.element(A,D[A],C);C.el.addClass(this.props.classes[0]);if(!this.props.inject){C.button.addClass(this.props.classes[0]).addEvent("click",function(G){this.toggle(G)}.pass(C,this)).injectAfter(C.el)}C.val=this.evaluate(C);C.bounds=this.bounds(C);this.options(C);this.calendars.push(C);this.display(C)}},blocked:function(C){var A=[];var D=new Date(C.year,C.month,1).getDay();var B=new Date(C.year,C.month+1,0).getDate();this.props.blocked.each(function(G){var F=G.split(" ");for(var H=0;H<3;H++){if(!F[H]){F[H]="*"}F[H]=F[H].contains(",")?F[H].split(","):new Array(F[H])}if(F[2].contains(C.year+"")||F[2].contains("*")){if(F[1].contains(C.month+1+"")||F[1].contains("*")){F[0].each(function(I){if(I>0){A.push(I.toInt())}});if(F[3]){F[3]=F[3].contains(",")?F[3].split(","):new Array(F[3]);for(var H=0;H<B;H++){var E=(H+D)%7;if(F[3].contains(E+"")){A.push(H+1)}}}}}},this);return A},bounds:function(A){var B=new Date(1000,0,1);var F=new Date(2999,11,31);var D=new Date().getDate()+this.props.direction.toInt();if(this.props.direction>0){B=new Date();B.setDate(D+this.props.pad*A.id)}if(this.props.direction<0){F=new Date();F.setDate(D-this.props.pad*(this.calendars.length-A.id-1))}var K,C,M;A.els.each(function(N){if(N.get("name")=="select"){if(N.format.test("(y|Y)")){K=[];N.getChildren().each(function(P){var O=this.unformat(P.value,N.format);if(!K.contains(O[0])){K.push(O[0])}},this);K.sort(this.sort);if(K[0]>B.getFullYear()){d=new Date(K[0],B.getMonth()+1,0);if(B.getDate()>d.getDate()){B.setDate(d.getDate())}B.setYear(K[0])}if(K.getLast()<F.getFullYear()){d=new Date(K.getLast(),F.getMonth()+1,0);if(F.getDate()>d.getDate()){F.setDate(d.getDate())}F.setYear(K.getLast())}}if(N.format.test("(F|m|M|n)")){C=[];N.getChildren().each(function(P){var O=this.unformat(P.value,N.format);if($type(O[0])!="number"||O[0]==A.year){if(!C.contains(O[1])){C.push(O[1])}}},this);C.sort(this.sort);if(B.getFullYear()==A.year&&C[0]>B.getMonth()){d=new Date(B.getFullYear(),C[0]+1,0);if(B.getDate()>d.getDate()){B.setDate(d.getDate())}B.setMonth(C[0])}if(F.getFullYear()==A.year&&C.getLast()<F.getMonth()){d=new Date(B.getFullYear(),C.getLast()+1,0);if(F.getDate()>d.getDate()){F.setDate(d.getDate())}F.setMonth(C.getLast())}}if(N.format.test("(d|j)")&&!N.format.test("^(d|j)$")){M=[];N.getChildren().each(function(P){var O=this.unformat(P.value,N.format);if(O[0]==A.year&&O[1]==A.month){if(!M.contains(O[2])){M.push(O[2])}}},this)}}},this);var J=1;var L=new Date(A.year,A.month+1,0).getDate();var E={month:true,year:true};var I={month:true,year:true};if(A.year==B.getFullYear()){E.year=false}if(A.year==F.getFullYear()){I.year=false}if(A.year==B.getFullYear()&&A.month==B.getMonth()){if(this.props.navigation==1){E.month=false}J=B.getDate()}if(A.year==F.getFullYear()&&A.month==F.getMonth()){if(this.props.navigation==1){I.month=false}L=F.getDate()}var H=this.blocked(A);if($type(M)=="array"){M=M.filter(function(N){if(N>=J&&N<=L&&!H.contains(N)){return N}})}else{M=[];for(var G=J;G<=L;G++){if(!H.contains(G)){M.push(G)}}}M.sort(this.sort);return{days:M,months:C,years:K,prev:E,next:I,start:B,end:F}},caption:function(F){var A=new Element("caption");var D=new Element("a").addClass(this.props.classes[1]).set("text","\x3c");var C=new Element("a").addClass(this.props.classes[2]).set("text","\x3e");if(this.props.navigation==2){var E=new Element("span").addClass(this.props.classes[3]).injectInside(A);if(F.bounds.prev.month){D.clone().addEvent("click",function(G){this.navigate(G,"m",-1)}.pass(F,this)).injectInside(E)}E.adopt(new Element("span").set("text",this.props.months[F.month]));if(F.bounds.next.month){C.clone().addEvent("click",function(G){this.navigate(G,"m",1)}.pass(F,this)).injectInside(E)}var B=new Element("span").addClass(this.props.classes[4]).injectInside(A);if(F.bounds.prev.year){D.clone().addEvent("click",function(G){this.navigate(G,"y",-1)}.pass(F,this)).injectInside(B)}B.adopt(new Element("span").set("text",F.year));if(F.bounds.next.year){C.clone().addEvent("click",function(G){this.navigate(G,"y",1)}.pass(F,this)).injectInside(B)}}else{if(F.bounds.prev.month&&this.props.navigation){D.clone().addEvent("click",function(G){this.navigate(G,"m",-1)}.pass(F,this)).injectInside(A)}A.adopt(new Element("span").addClass(this.props.classes[3]).set("text",this.props.months[F.month]));A.adopt(new Element("span").addClass(this.props.classes[4]).set("text",F.year));if(F.bounds.next.month&&this.props.navigation){C.clone().addEvent("click",function(G){this.navigate(G,"m",1)}.pass(F,this)).injectInside(A)}}return A},changed:function(A){A.val=this.evaluate(A);A.bounds=this.bounds(A);this.options(A);if(A.val){if(A.val.getDate()<A.bounds.days[0]){A.val.setDate(A.bounds.days[0])}if(A.val.getDate()>A.bounds.days.getLast()){A.val.setDate(A.bounds.days.getLast())}A.els.each(function(B){B.value=this.format(A.val,B.format)},this)}if(!A.val){return }this.check(A);if(A.visible){this.display(A)}},clicked:function(A){this.options(A);A.els.each(function(B){B.value=this.format(A.val,B.format);if(this.props.onChange){this.props.onChange(B.value)}if(this.props.inject){this.display(A)}},this)},check:function(A){if(!A.val){return }this.calendars.each(function(D,B){if(D.val){var E=false;if(B<A.id){var C=new Date(Date.parse(A.val));C.setDate(C.getDate()-(this.props.pad*(A.id-B)));if(C<D.val){E=true}}if(B>A.id){var C=new Date(Date.parse(A.val));C.setDate(C.getDate()+(this.props.pad*(B-A.id)));if(C>D.val){E=true}}if(E){if(D.bounds.start>C){C=D.bounds.start}if(D.bounds.end<C){C=D.bounds.end}D.val=C;D.month=C.getMonth();D.year=C.getFullYear();D.bounds=this.bounds(D);this.clicked(D);if(D.visible){this.display(D)}}}},this)},display:function(C){this.calendar.empty();this.calendar.className=this.props.classes[0]+" "+this.props.months[C.month].toLowerCase();var B=new Element("div").injectInside(this.calendar);var Q=new Element("table").injectInside(B).adopt(this.caption(C));var L=new Element("thead").injectInside(Q);var M=new Element("tr").injectInside(L);for(var I=0;I<=6;I++){var D=this.props.days[(I+this.props.offset)%7];M.adopt(new Element("th",{title:D}).set("text",D.substr(0,1)))}var J=new Element("tbody").injectInside(Q);var M=new Element("tr").injectInside(J);var H=new Date(C.year,C.month,1).getDay()-this.props.offset;var O=new Date(C.year,C.month+1,0).getDate();var K=new Date(C.year,C.month,0).getDate();var G=this.value(C);var E=[];this.calendars.each(function(R){if(R!=C&&R.val){if(C.year==R.val.getFullYear()&&C.month==R.val.getMonth()){E.push(R.val.getDate())}}},this);var A=C.bounds.days;for(var I=1;I<43;I++){if((I-1)%7==0){M=new Element("tr").injectInside(J)}var F=new Element("td").injectInside(M);var N=I-H;var P="";if(N===G){P=this.props.classes[8]}else{if(E.contains(N)){P=this.props.classes[7]}else{if(A.contains(N)){P=this.props.classes[6]}else{if(N>=1&&N<=O){P=this.props.classes[5]}}}}F.addClass(P);if(A.contains(N)){F.setProperty("title",this.format(new Date(C.year,C.month,N),"D M jS Y"));F.addEvents({click:function(T,R,S){S.val=(this.value(S)==R)?null:new Date(S.year,S.month,R);this.clicked(S);if(!S.val){S.val=this.evaluate(S)}if(S.val){this.check(S);if(!this.props.inject){this.toggle(S)}}else{T.addClass(this.props.classes[6]);T.removeClass(this.props.classes[8])}}.pass([F,N,C],this),mouseover:function(S,R){S.addClass(R)}.pass([F,this.props.classes[9]]),mouseout:function(S,R){S.removeClass(R)}.pass([F,this.props.classes[9]])})}if(N<1){N=K+N}else{if(N>O){N=N-O}}F.set("text",N)}},element:function(B,C,D){if($type(C)=="object"){for(var A in C){this.element(A,C[A],D)}return }B=$(B);B.format=C;if(B.get("name")=="select"){B.addEvent("change",function(E){this.changed(E)}.pass(D,this))}else{B.readOnly=true;B.addEvent("focus",function(E){this.toggle(E)}.pass(D,this))}D.els.push(B)},evaluate:function(C){var A=[null,null,null];C.els.each(function(F){var E=this.unformat(F.value,F.format);E.each(function(H,G){if($type(H)=="number"){A[G]=H}})},this);if($type(A[0])=="number"){C.year=A[0]}if($type(A[1])=="number"){C.month=A[1]}var D=null;if(A.every(function(E){return $type(E)=="number"})){var B=new Date(A[0],A[1]+1,0).getDate();if(A[2]>B){A[2]=B}D=new Date(A[0],A[1],A[2])}return(C.val==D)?null:D},format:function(A,E){var D="";if(A){var G=A.getDate();var J=this.props.days[A.getDay()];var B=A.getMonth()+1;var F=this.props.months[A.getMonth()];var I=A.getFullYear()+"";for(var C=0;C<E.length;C++){var H=E.charAt(C);switch(H){case"y":I=I.substr(2);case"Y":D+=I;break;case"m":if(B<10){B="0"+B}case"n":D+=B;break;case"M":F=F.substr(0,3);case"F":D+=F;break;case"d":if(G<10){G="0"+G}case"j":D+=G;break;case"D":J=J.substr(0,3);case"l":D+=J;break;case"S":if(G%10==1&&G!="11"){D+="st"}else{if(G%10==2&&G!="12"){D+="nd"}else{if(G%10==3&&G!="13"){D+="rd"}else{D+="th"}}}break;default:D+=H}}}return D},navigate:function(C,B,D){switch(B){case"m":if($type(C.bounds.months)=="array"){var A=C.bounds.months.indexOf(C.month)+D;if(A<0||A==C.bounds.months.length){if(this.props.navigation==1){this.navigate(C,"y",D)}A=(A<0)?C.bounds.months.length-1:0}C.month=C.bounds.months[A]}else{var A=C.month+D;if(A<0||A==12){if(this.props.navigation==1){this.navigate(C,"y",D)}A=(A<0)?11:0}C.month=A}break;case"y":if($type(C.bounds.years)=="array"){var A=C.bounds.years.indexOf(C.year)+D;C.year=C.bounds.years[A]}else{C.year+=D}break}C.bounds=this.bounds(C);if($type(C.bounds.months)=="array"){var A=C.bounds.months.indexOf(C.month);if(A<0){C.month=C.bounds.months[0]}}this.display(C)},options:function(A){A.els.each(function(B){if(B.get("name")=="select"&&B.format.test("^(d|j)$")){var C=this.value(A);if(!C){C=B.value.toInt()}B.empty();A.bounds.days.each(function(D){var E=new Element("option",{selected:(C==D),value:((B.format=="d"&&D<10)?"0"+D:D)}).set("text",D).injectInside(B)},this)}},this)},sort:function(B,A){return B-A},toggle:function(B){if(!this.props.inject){document.removeEvent("mousedown",this.fn)}if(B.visible){B.visible=false;B.button.removeClass(this.props.classes[8]);this.fx.start(1,0)}else{this.fn=function(G,F){var G=new Event(G);var E=G.target;var D=false;while(E!=document.body&&E.nodeType==1){if(E==this.calendar){D=true}this.calendars.each(function(H){if(H.button==E||H.els.contains(E)){D=true}});if(D){G.stop();return false}else{E=E.parentNode}}this.toggle(F)}.create({"arguments":B,bind:this,event:true});if(!this.props.inject){document.addEvent("mousedown",this.fn)}this.calendars.each(function(D){if(D==B){D.visible=true;D.button.addClass(this.props.classes[8])}else{D.visible=false;D.button.removeClass(this.props.classes[8])}},this);var C=B.button.getCoordinates();var A=window.getSize();if(C.right+this.calendar.coord.width>A.x){C.right-=(C.right+this.calendar.coord.width-A.x)}if(C.top+this.calendar.coord.height>A.y){C.top-=(C.top+this.calendar.coord.height-A.y)}this.calendar.setStyles({left:C.right+"px",top:C.top+"px"});this.display(B);this.fx.start(0,1)}},unformat:function(B,G){G=G.escapeRegExp();var I={d:"([0-9]{2})",j:"([0-9]{1,2})",D:"("+this.props.days.map(function(J){return J.substr(0,3)}).join("|")+")",l:"("+this.props.days.join("|")+")",S:"(st|nd|rd|th)",F:"("+this.props.months.join("|")+")",m:"([0-9]{2})",M:"("+this.props.months.map(function(J){return J.substr(0,3)}).join("|")+")",n:"([0-9]{1,2})",Y:"([0-9]{4})",y:"([0-9]{2})"};var E=[];var F="";for(var C=0;C<G.length;C++){var H=G.charAt(C);if(I[H]){E.push(H);F+=I[H]}else{F+=H}}var D=B.match("^"+F+"$");var A=new Array(3);if(D){D=D.slice(1);E.each(function(K,J){J=D[J];switch(K){case"y":J="19"+J;case"Y":A[0]=J.toInt();break;case"F":J=J.substr(0,3);case"M":J=this.props.months.map(function(L){return L.substr(0,3)}).indexOf(J)+1;case"m":case"n":A[1]=J.toInt()-1;break;case"d":case"j":A[2]=J.toInt();break}},this)}return A},value:function(B){var A=null;if(B.val){if(B.year==B.val.getFullYear()&&B.month==B.val.getMonth()){A=B.val.getDate()}}return A}});;
Netvibes.UI.MultiPage=new Class({Implements:[Events,Options],options:{className:"multipage",nextText:_("next"),previousText:_("previous"),items:[],perPage:10,layout:{container:null,availableWidth:-1,itemWidth:-1,numRows:-1},windowResize:true},initialize:function(A){this.setOptions(A);this.offset=0;this.currentPage=1;this.items=this.options.items||[];this.total=this.options.total||this.items.length;this.ajax=null;this.container=new Element("div",{"class":this.options.className});this.computePerPage();if(this.items.length){this.buildPager()}this.bound={resize:this.onResize.bind(this)};if(this.options.windowResize){$(window).addEvent("resize",this.bound.resize)}return this.container},onResize:function(){if($type(this.container)!="element"){return }if(this.container.getSize().x==0){return }if(this.container.getParent()===null){this.removeEvents();return }if(arguments.callee.timer){clearTimeout(arguments.callee.timer)}arguments.callee.timer=setTimeout(function(){this.onPageChanged(this.offset)}.bind(this),1000)},destroy:function(){$(window).removeEvent("resize",this.bound.resize);if(this.ajax&&this.ajax.running){this.ajax.cancel();this.ajax=null}},computePerPage:function(){if(this.options.layout.container){this.options.layout.availableWidth=$(this.options.layout.container).getSize().x}if(this.options.layout.availableWidth>0){this.options.perPage=Math.floor(this.options.layout.availableWidth/this.options.layout.itemWidth)*this.options.layout.numRows;if(!$defined(this.cache)||this.cache.perPage!=this.options.perPage){this.initCache()}}this.totalPages=Math.ceil(this.total/this.options.perPage)},initCache:function(){this.cache={perPage:this.options.perPage,pages:[]};if(this.items.length){var B=Math.floor(this.items.length/this.options.perPage);for(var A=0;A<B;A++){this.cache.pages[A+1]=this.items.slice(A*this.options.perPage,(A+1)*this.options.perPage)}if(this.total==this.items.length){if(this.items.length%this.options.perPage!=0){this.cache.pages[B+1]=this.items.slice(B*this.options.perPage,(B+1)*this.options.perPage)}}}return this.cache[this.currentPage]},buildPager:function(){this.computePerPage();this.totalPages==1?this.container.hide():this.container.show();this.currentPage=Math.ceil(this.offset/this.options.perPage)+1;this.container.empty();if(this.options.layout.availableWidth>0){this.container.setStyle("width",this.options.layout.availableWidth)}this.prev=new Element("a",{rel:"prev",href:"javascript:void(0)",text:this.options.previousText,styles:{display:"none"}}).inject(this.container);if(this.totalPages<7){var E=[1,2,3,4,5,6].slice(0,this.totalPages)}else{var E=[1,2];if(this.currentPage-1>0&&!E.contains(this.currentPage-1)){E.push(this.currentPage-1)}if(!E.contains(this.currentPage)){E.push(this.currentPage)}if(this.currentPage+1<=this.totalPages&&!E.contains(this.currentPage+1)){E.push(this.currentPage+1)}if(!E.contains(this.totalPages-1)){E.push(this.totalPages-1)}if(!E.contains(this.totalPages)){E.push(this.totalPages)}}var A=0;for(var B=0,D;D=E[B++];){if(D-A!=1){new Element("span",{text:"..."}).inject(this.container)}new Element("a",{rel:D,href:"javascript:void(0)","class":D==this.currentPage?"selected":"",text:D}).inject(this.container);A=D}this.next=new Element("a",{rel:"next",href:"javascript:void(0)",text:this.options.nextText,styles:{display:"none"}}).inject(this.container);this.container.getElements("a").addEvent("click",this.onPageChanged.bindWithEvent(this));var C={items:this.cache.pages[this.currentPage],page:{current:this.currentPage,offset:this.offset,total:this.total,size:this.options.perPage}};this.prev.setStyle("display",(this.offset>0)?"":"none");this.next.setStyle("display",(this.offset<this.total-this.options.perPage)?"":"none");this.fireEvent("onPageChange",C)},inject:function(A,B){$(A).adopt(this.container);return this},show:function(){if(this.total>this.options.perPage){this.container.setStyle("display","")}return this},hide:function(){this.container.setStyle("display","none");return this},onPageChanged:function(C){if($type(C)=="number"){this.offset=C;this.computePerPage();var B=this.currentPage=Math.ceil(this.offset/this.options.perPage)+1}else{var A=Event.findElement(C,"A");if(!A||A.hasClass("disabled")||this.container.hasClass("loading")){return false}if(this.ajax&&this.ajax.running){return false}var B=this.currentPage;if(A.rel=="prev"&&this.currentPage-1>0){B=this.currentPage-1}else{if(A.rel=="next"&&this.currentPage+1<=this.totalPages){B=this.currentPage+1}else{B=this.currentPage=A.innerHTML.toInt()}}this.offset=this.options.perPage*(B-1)}if(!$defined(this.cache.pages[B])){if(this.ajax){this.onRequesting(this.offset,B);return false}else{this.offset=0}}this.buildPager();return false},onRequesting:function(C,B){this.container.addClass("loading");var A={request:this.ajax,page:B,offset:C,perPage:this.options.perPage};this.fireEvent("onRequesting",A);if(this.ajax.options.data==""){this.ajax.get({offset:C,count:this.options.perPage,format:"json"})}else{this.ajax.get()}}});Netvibes.UI.MultiPage.JSON=new Class({Extends:Netvibes.UI.MultiPage,options:{requestUrl:"",responseParams:{items:"",total:""}},initialize:function(A){this.parent(A);this.initCache();this.ajax=new Request.JSON({url:A.requestUrl,link:"cancel",secure:false,onComplete:this.onComplete.bind(this),onFailure:this.onFailure.bind(this)});if(!this.options.total){this.onRequesting(0,1)}},onComplete:function(D){if(D.success!=undefined&&D.success==false){var A={error:D.error||"Unknown error"};this.fireEvent("onPageChange",A);return false}this.container.removeClass("loading");var C=Math.ceil(this.offset/this.options.perPage)+1;if(D[this.options.responseParams.total]){this.total=D[this.options.responseParams.total].toInt();var B=Math.ceil(this.total/this.options.perPage);if(C>B){C=B}}this.cache.pages[C]=D[this.options.responseParams.items];this.buildPager()},onFailure:function(){this.fireEvent("onFailure");return false}});;
var Countable=new Class({Implements:[Options],options:{className:"countable",errorClass:"error"},initialize:function(B,A,C){this.input=$(B);this.max=A;this.handle=new Element("span",{"class":this.options.className});this.handle.set("html","&nbsp;").inject(this.input,"after");this.input.addEvent("keydown",this.onKeyPress.bindWithEvent(this));this.input.addEvent("keyup",this.onKeyPress.bindWithEvent(this));this.update()},onKeyPress:function(A){A=new Event(A);if(!A.shift&&!A.control&&!A.alt&&!A.meta){this.update()}},update:function(){if(this.input.value.length>this.max){this.input.value=this.input.value.substring(0,this.max)}var B=this.max-this.input.value.length;if(B==0){var A='<span class="'+this.options.errorClass+'">'+_("No characters left")+"</span>"}else{if(B==1){var A=_("1 character left")}else{var A=String.format(_("{0} characters left"),B)}}this.handle.set("html",A)}});;
Netvibes.UI.Timeline=new Class({Implements:[Events,Options],options:{url:NV_API_PATH+"/timeline",headers:{Accept:"text/json","Content-type":"text/json"},id:null,widget:null,icons:null,search:null,timelineSize:20,pagerSize:5,showFilters:false,filter:""},elements:{},widget:null,pagerOffset:0,initialize:function(B){var A=null;if(B.widget){this.widget=B.widget;delete B.widget}this.setOptions(B);if(this.options.search==null&&!this.widget){throw'The option "search" is mandatory'}this.elements.container=new Element("div",{id:(typeof this.options.id=="string"?this.options.id:""),"class":"timeline"});if(B.showFilters){var C=new Element("div",{"class":"filters"}).inject(this.elements.container);new Element("input",{type:"radio",name:"filter",id:"timeline_filter_all",value:"",checked:"checked"}).addEvent("click",this.onFilterChange.bind(this)).inject(C);new Element("label",{"for":"timeline_filter_all",text:_("All")}).inject(C);new Element("input",{type:"radio",name:"filter",id:"timeline_filter_status",value:"type:status"}).addEvent("click",this.onFilterChange.bind(this)).inject(C);new Element("label",{"for":"timeline_filter_status",text:_("Status")}).inject(C);new Element("input",{type:"radio",name:"filter",id:"timeline_filter_link",value:"type:star"}).addEvent("click",this.onFilterChange.bind(this)).inject(C);new Element("label",{"for":"timeline_filter_link",text:_("Links")}).inject(C)}this.elements.events=new Element("ul",{"class":"events"}).inject(this.elements.container);if(!this.widget){var B={size:this.options.timelineSize,params:{format:"json",query:this.getQuery(),count:null}};this.elements.scrollbar=new Netvibes.UI.AjaxScrollbar(this.elements.events,this.options.url,B);this.elements.scrollbar.addEvent("onLoad",this.onLoadData.bind(this));this.elements.scrollbar.requestData()}else{new Element("li",{"class":"odd"}).set("text",_("Loading...")).inject(this.elements.events);UWA.Data.getText(this.options.url+"&count="+this.options.timelineSize,this.onLoadData.bind(this))}},getQuery:function(){if(typeof this.options.filter=="undefined"||!this.options.filter||this.options.filter==""){return this.options.search}else{return"("+this.options.search+") AND ("+this.options.filter+")"}},onFilterChange:function(A){this.options.filter=A.target.value;this.elements.scrollbar.options.params.query=this.getQuery();this.elements.scrollbar.refresh()},onLoadData:function(D,E,F){var C=JSON.decode(D,false);if(C.timeline){if(this.widget){this.elements.events.empty()}if(C.timeline.length==0){if(this.elements.scrollbar){this.elements.scrollbar.stop()}if(F==0||this.widget){new Element("p",{"class":"empty",text:_("No events")}).inject(this.elements.events)}}else{if(this.widget){for(var A=0;A<C.timeline.length;A++){var B=Netvibes.UI.Timeline.Renderer[C.timeline[A].type];if(!B){C.timeline.splice(A,1)}}}this.build(C.timeline)}}this.fireEvent("complete")},getElement:function(){return this.elements.container},buildPager:function(C){var A=new UWA.Controls.Pager({module:this.widget,limit:this.options.pagerSize,offset:this.pagerOffset,dataArray:C});A.onChange=function(E){this.elements.events.empty();this.pagerOffset=E;this.build(C)}.bind(this);var D=new Element("div").inject(this.elements.events);var B=A.getContent();$(B).inject(D)},build:function(F){var G=(this.widget)?parseInt(this.pagerOffset):0;var C=F.length;var B=0;for(var D=G;D<C&&D<F.length;D++){var E=Netvibes.UI.Timeline.Renderer[F[D].type];if(E){var A=new Element("li",{"class":"event"+(B%2==1?" odd":" even")}).inject(this.elements.events).store("id",F[D].id);this.renderEvent(A,F[D],E);B++;if(this.widget&&B==parseInt(this.options.pagerSize)){break}}}if(this.widget){this.buildPager(F)}},renderEvent:function(I,A,G){I.empty();new Element("a",{"class":"date",text:String.parseRelativeTime(A.updatedOn),target:"_blank",href:"/"+A.userName+"/activities/"+A.id}).inject(I);var H=new Element("img",{src:"http://"+NV_AVATARS+"/"+A.userId+"/32","class":"avatar",height:"32",width:"32"}).inject(I);if(A.userName){H.addEvent("click",function(){App.Panel.showProfile(this.userId);return false}.bind(A))}var L=new Element("div",{"class":"content"}).inject(I);if(G.icon){var M=(this.options.icons&&typeof (this.options.icons[A.type]=="string"))?this.options.icons[A.type]:G.icon(A);new Element("img",{src:M,"class":"icon"}).inject(L)}var K=G.text(A,I);if(typeof K=="string"){new Element("span",{text:K}).inject(L)}else{if(typeof K=="object"){K.inject(L)}}if(typeof A.comment=="string"&&A.comment.length>0){new Element("div",{"class":"comment"}).setHTML(A.comment.nl2br().setURL()).inject(L)}else{A.comment=""}var B=new Element("div",{"class":"options"});if(A.userId==Cookie.get("activeUserID")){var C=new Element("a",{"class":"addComment",href:"javascript:void(0);",text:_("Comment")}).inject(B).addEvent("click",function(P,N){var Q=N.getElementsByClassName("comment");if(Q.length==1){var R=Q[0]}else{var R=new Element("div",{"class":"comment"}).injectBefore(B)}R.old=P.comment;R.empty();R.event=P;R.timeline=this;var O=function(S){if((S.type=="keyup"&&(S.code==13||S.code==10))||(S.type=="click"&&S.target.name=="ok")){var T=this.firstChild.value;this.firstChild.value=(_("Saving..."));this.firstChild.disabled="disabled";this.event.comment=T;new Request().setHeader("Accept","application/json").addEvent("complete",function(V,U){V.empty();if(U==""){V.remove()}else{V.setHTML(U.stripTags().setURL())}}.pass([this,T])).post(this.timeline.options.url+"/edit/"+this.event.id,this.event)}if((S.type=="keyup"&&S.code==27)||(S.type=="click"&&S.target.name=="cancel")){this.empty();if(this.old==""){this.remove()}else{this.set("text",this.old)}}}.bind(R);new Element("textarea",{"class":"text",text:R.old}).inject(R).focus();new Element("input",{type:"button",value:_("Cancel"),name:"cancel"}).addEvent("click",O).inject(R);new Element("input",{type:"button",value:_("Ok"),name:"ok"}).addEvent("click",O).inject(R)}.pass([A,I],this));var D=function(){new Request().setHeader("X-Requested-Method","delete").setHeader("Accept","application/json").addEvent("complete",function(){this.addClass("deleted");this.getElementsByClassName("options")[0].remove();this.getElements("a").removeEvents()}.bind(I)).get(this.options.url+"/delete/"+A.id)}.bind(this);var J=new Element("a",{"class":"delete",href:"javascript:void(0);",text:_("Delete")}).inject(B).addEvent("click",function(){if(confirm(_("Are you sure you want to delete this event?"))){D()}});if(A.type==12){var F=new Element("a",{"class":"restore",href:"javascript:void(0);",text:_("Restore")}).inject(B).addEvent("click",function(){var N=new App.UI.Preview({archive:A.data.moduleId,timelineId:A.id});N.addEvent("addToMyPage",function(){I.addClass("deleted");I.getElementsByClassName("options")[0].remove()});N.open()})}}else{if(A.type==6&&App.Share){var E=new Element("a",{"class":"star",href:"javascript:void(0);",text:_("Share as favorite")}).inject(B).addEvent("click",function(N){App.Share.show($merge(N.data,{fromUserId:N.userId}))}.pass([A]))}new Element("a",{href:"javascript:",html:"&nbsp;","class":"reply"}).interpolate(_("Reply to {user}"),{user:A.userFullName}).inject(B).addEvent("click",function(){if($("replyto"+A.id)){return }var P="@"+A.userName+" ";var O=new Element("form",{"class":"replyform",id:"replyto"+A.id});var N=new Element("input",{size:40,type:"text",value:P}).inject(O);O.addEvent("submit",function(R){R.stop();N.value=N.value.trim().stripTags();if(N.value!=""&&N.value!="@"+A.userName){var Q=new Request.JSON({secure:false,onComplete:function(){O.dispose()}}).post(NV_API_PATH+"/timeline/create",{type:1,data:N.value})}});new Element("input",{type:"submit",value:_("Reply")}).inject(O);new Element("input",{type:"button",value:_("Cancel")}).addEvent("click",function(){O.dispose()}).inject(O);O.injectAfter(this);N.focus()})}if(B.getFirst()){B.inject(L)}}});Netvibes.UI.Timeline.Query={"private":"status:private","public":"status:public",friends:"friendsof:"+Cookie.get("activeUserID")};Netvibes.UI.Timeline.Helper={name:function(A){if(A.userName){return new Element("a",{"class":"username",text:A.userFullName,href:"http://"+NV_HOST+"/"+A.userName}).addEvent("click",function(){App.Panel.showProfile(this.userId);return false}.bind(A))}else{return A.userFullName}},feed:function(B){var A=(B.type==2?"feedSubscribe":"feedUnsubscribe");return new Element("a",{"class":A,href:"javascript:void(0);",text:B.data.title}).addEvent("click",function(){var C={moduleName:"RssReader",title:this.data.title,data:{feedUrl:this.data.url}};App.Panel.AddContent.showPopup(C)}.bind(B))},widget:function(B){var A=(B.type==4?"widgetAdd":"widgetRemove");return new Element("a",{"class":A,href:"javascript:void(0);",text:B.data.title}).addEvent("click",function(){if(this.data.name=="MultipleFeeds"){var C={moduleName:this.data.name,title:this.data.title,data:this.data.data}}else{var C={moduleName:this.data.name,title:this.data.title,data:{moduleUrl:this.data.url}}}App.Panel.AddContent.showPopup(C)}.bind(B))},friend:function(B){var A=(B.type==8?"friendSubscribe":"friendUnsubscribe");return new Element("a",{"class":A,href:"http://"+NV_HOST+"/"+B.data.friendName,text:B.data.friendFullName}).addEvent("click",function(){App.Panel.showProfile(this.data.friendId);return false}.bind(B))},fromUser:function(A){return new Element("a",{"class":"username",text:A.data.fromUserFullName,href:"http://"+NV_HOST+"/"+A.data.fromUserName}).addEvent("click",function(){App.Panel.showProfile(this.data.fromUserId);return false}.bind(A))},twitterify:function(B){var A=/\B@(\w+)/ig;return B.setURL().replace(A,'<a href="javascript:void(0)" onclick="App.Panel.showProfile(\'$1\');" class="atFriend">@$1</a>')},src:function(B){if(B.data.srcType){var D,C,A=false;switch(B.data.srcType){case"uwa":C=B.data.srcTitle;if(typeof App!="undefined"&&B.data.srcModule){D="http://"+NV_HOST+"/subscribe.php?from=act&module="+B.data.srcModule;A=App.Modules[B.data.srcModule.capitalize()+"Infos"].defaultObj}else{D="http://"+NV_HOST+"/subscribe.php?from=act&uwa="+encodeURIComponent(B.data.srcUrl);A={moduleName:"UWA",title:C,data:{moduleUrl:B.data.srcUrl}}}break;case"feed":D="http://"+NV_HOST+"/subscribe.php?from=act&feed="+encodeURIComponent(B.data.srcUrl);C=B.data.srcTitle;A={moduleName:"RssReader",title:B.data.srcTitle,data:{feedUrl:B.data.srcUrl}};break;case"firefox":D="http://eco.netvibes.com/tools/firefox";C="Firefox";return new Element("a",{href:D,target:"_blank",text:C,"class":"src"});break;case"multiplefeeds":D="http://"+NV_HOST+"/subscribe.php?from=act&module=MultipleFeeds&provider="+encodeURI(B.data.srcUrl);C=B.data.srcTitle;A={moduleName:"MultipleFeeds",title:B.data.srcTitle,data:{provider:B.data.srcUrl}};break;case"extern":D=B.data.srcUrl;C=_("a website");break;case"static":D="http://"+NV_HOST+"/share";C="Netvibes";break}if(A){return new Element("a",{href:D,target:"_blank",text:C,"class":"src"}).addEvent("click",function(E){E.stop();App.Panel.AddContent.showPopup(A);return false})}else{return new Element("a",{href:D,target:"_blank",text:C,"class":"src"})}}}};Netvibes.UI.Timeline.Renderer={1:{text:function(A){if(A.userId==Cookie.get("activeUserID")){return new Element("span").interpolate(_("You {status}"),{status:new Element("em").setHTML(Netvibes.UI.Timeline.Helper.twitterify(A.data))})}else{return new Element("span").interpolate("{name} {status}",{name:Netvibes.UI.Timeline.Helper.name(A),status:new Element("em").setHTML(Netvibes.UI.Timeline.Helper.twitterify(A.data))})}},nostatus:true},2:{icon:function(A){return"/img/timeline/feed_add.png"},text:function(A){if(A.userId==Cookie.get("activeUserID")){return new Element("span").interpolate(_("You subscribed to {feed}"),{feed:Netvibes.UI.Timeline.Helper.feed(A)})}else{return new Element("span").interpolate(_("{name} subscribed to {feed}"),{name:Netvibes.UI.Timeline.Helper.name(A),feed:Netvibes.UI.Timeline.Helper.feed(A)})}}},4:{icon:function(A){return"/img/timeline/application_add.png"},text:function(A){if(A.userId==Cookie.get("activeUserID")){return new Element("span").interpolate(_("You added {widget}"),{widget:Netvibes.UI.Timeline.Helper.widget(A)})}else{return new Element("span").interpolate(_("{name} added {widget}"),{name:Netvibes.UI.Timeline.Helper.name(A),widget:Netvibes.UI.Timeline.Helper.widget(A)})}}},6:{icon:function(A){return"/img/timeline/starring.png"},text:function(B){var D=B.data.title;if(!D||D.trim()==""){D=_("Untitled")}var C="";var A={name:Netvibes.UI.Timeline.Helper.name(B),link:new Element("a",{href:B.data.url,"class":"star",target:"_blank",text:D})};if(B.data.srcType){A.src=Netvibes.UI.Timeline.Helper.src(B)}if(B.data.fromUserId&&B.status=="public"){if(B.data.srcType){C=_("{name} broadcasted: {friend} shared as favorite {link} from {src}")}else{C=_("{name} broadcasted: {friend} shared as favorite {link}")}A.friend=Netvibes.UI.Timeline.Helper.fromUser(B)}else{if(B.data.srcType){C=_("{name} shared as favorite {link} from {src}")}else{C=_("{name} shared as favorite {link}")}}return new Element("span").interpolate(C,A)}},7:{icon:function(A){return"/favicon.ico"},text:function(A){return new Element("span",{text:_("Your account has been created")})},nostatus:true},8:{icon:function(A){return"/img/universe.png"},text:function(A){if(A.userId==Cookie.get("activeUserID")){return new Element("span").interpolate(_("You are now following {name2}"),{name2:Netvibes.UI.Timeline.Helper.friend(A)})}else{return new Element("span").interpolate(_("{name1} are now following {name2}"),{name1:Netvibes.UI.Timeline.Helper.name(A),name2:Netvibes.UI.Timeline.Helper.friend(A)})}}},9:{icon:function(A){return"/img/universe.png"},text:function(A){if(A.userId==Cookie.get("activeUserID")){return new Element("span").interpolate(_("You are not following {name2} anymore"),{name2:Netvibes.UI.Timeline.Helper.friend(A)})}else{return new Element("span").interpolate(_("{name1} is not following {name2} anymore"),{name1:Netvibes.UI.Timeline.Helper.name(A),name2:Netvibes.UI.Timeline.Helper.friend(A)})}}},10:{icon:function(A){return"/img/timeline/feed_add.png"},text:function(A){return new Element("span").interpolate(_("{feed} has been imported to your activites"),{feed:Netvibes.UI.Timeline.Helper.feed(A)})}},11:{icon:function(A){return"/favicon.ico"},text:function(A){return new Element("span",{text:_("Your account has been migrated")})},nostatus:true},12:{icon:function(A){return"/img/timeline/archived_widget.png"},text:function(C,B){var A=C.data.page=="public"?_("You archived the widget {title} from your universe"):_("You archived the widget {title} from your private page");return new Element("span").interpolate(A,{title:new Element("a",{href:"javascript:void(0)","class":"archive",text:C.data.title}).addEvent("click",function(E){var D=new App.UI.Preview({archive:C.data.moduleId,timelineId:C.id});D.addEvent("addToMyPage",function(){B.addClass("deleted");B.getElementsByClassName("options")[0].remove();B.getElements("a").removeEvents()});D.open()})})},nostatus:true},15:{icon:function(A){return"/img/timeline/starring.png"},text:function(A){return new Element("span").interpolate(_("{name} shared a widget as favorite: {link}"),{name:Netvibes.UI.Timeline.Helper.name(A),link:new Element("a",{href:"/subscribe.php?from=act&preconfig="+A.data.preconfig,"class":"star",target:"_blank",text:A.data.title}).addEvent("click",function(B){B.stop();new App.UI.Preview({preconfig:A.data.preconfig,from:"act"}).open()})})},nostatus:true}};;
var Autocompleter=new Class({Implements:[Options,Events],options:{minLength:1,markQuery:true,width:"inherit",maxChoices:10,injectChoice:null,customChoices:null,emptyChoices:null,visibleChoices:true,className:"autocompleter-choices",zIndex:42,delay:400,observerOptions:{},fxOptions:{},autoSubmit:false,overflow:false,overflowMargin:25,selectFirst:false,filter:null,filterCase:false,filterSubset:false,forceSelect:false,selectMode:true,choicesMatch:null,multiple:false,separator:", ",separatorSplit:/\s*[,;]\s*/,autoTrim:false,allowDupes:false,cache:true,relative:false},initialize:function(B,A){this.element=$(B);this.setOptions(A);this.build();this.observer=new Observer(this.element,this.prefetch.bind(this),$merge({delay:this.options.delay},this.options.observerOptions));this.queryValue=null;if(this.options.filter){this.filter=this.options.filter.bind(this)}var C=this.options.selectMode;this.typeAhead=(C=="type-ahead");this.selectMode=(C===true)?"selection":C;this.cached=[]},build:function(){if($(this.options.customChoices)){this.choices=this.options.customChoices}else{this.choices=new Element("ul",{"class":this.options.className,styles:{zIndex:this.options.zIndex}}).inject(document.body);this.relative=false;if(this.options.relative){this.choices.inject(this.element,"after");this.relative=this.element.getOffsetParent()}this.fix=new OverlayFix(this.choices)}if(!this.options.separator.test(this.options.separatorSplit)){this.options.separatorSplit=this.options.separator}this.fx=(!this.options.fxOptions)?null:new Fx.Tween(this.choices,$merge({property:"opacity",link:"cancel",duration:200},this.options.fxOptions)).addEvent("onStart",Chain.prototype.clearChain).set(0);this.element.setProperty("autocomplete","off").addEvent((Browser.Engine.trident||Browser.Engine.webkit)?"keydown":"keypress",this.onCommand.bind(this)).addEvent("click",this.onCommand.bind(this,[false])).addEvent("focus",this.toggleFocus.create({bind:this,arguments:true,delay:100})).addEvent("blur",this.toggleFocus.create({bind:this,arguments:false,delay:100}))},destroy:function(){if(this.fix){this.fix.destroy()}this.choices=this.selected=this.choices.destroy()},toggleFocus:function(A){this.focussed=A;if(!A){this.hideChoices(true)}this.fireEvent((A)?"onFocus":"onBlur",[this.element])},onCommand:function(B){if(!B&&this.focussed){return this.prefetch()}if(B&&B.key&&!B.shift){switch(B.key){case"enter":if(this.element.value!=this.opted){return true}if(this.selected&&this.visible){this.choiceSelect(this.selected);return !!(this.options.autoSubmit)}break;case"up":case"down":if(!this.prefetch()&&this.queryValue!==null){var A=(B.key=="up");this.choiceOver((this.selected||this.choices)[(this.selected)?((A)?"getPrevious":"getNext"):((A)?"getLast":"getFirst")](this.options.choicesMatch),true)}return false;case"esc":case"tab":this.hideChoices(true);break}}return true},setSelection:function(F){var G=this.selected.inputValue,H=G;var A=this.queryValue.length,C=G.length;if(G.substr(0,A).toLowerCase()!=this.queryValue.toLowerCase()){A=0}if(this.options.multiple){var E=this.options.separatorSplit;H=this.element.value;A+=this.queryIndex;C+=this.queryIndex;var B=H.substr(this.queryIndex).split(E,1)[0];H=H.substr(0,this.queryIndex)+G+H.substr(this.queryIndex+B.length);if(F){var D=H.split(this.options.separatorSplit).filter(function(J){return this.test(J)},/[^\s,]+/);if(!this.options.allowDupes){D=[].combine(D)}var I=this.options.separator;H=D.join(I)+I;C=H.length}}this.observer.setValue(H);this.opted=H;if(F||this.selectMode=="pick"){A=C}this.element.selectRange(A,C);this.fireEvent("onSelection",[this.element,this.selected,H,G])},showChoices:function(){var C=this.options.choicesMatch,B=this.choices.getFirst(C);this.selected=this.selectedValue=null;if(this.fix){var E=this.element.getCoordinates(this.relative),A=this.options.width||"auto";this.choices.setStyles({left:E.left,top:E.bottom,width:(A===true||A=="inherit")?E.width:A})}if(!B){return }if(!this.visible){this.visible=true;this.choices.setStyle("display","");if(this.fx){this.fx.start(1)}this.fireEvent("onShow",[this.element,this.choices])}if(this.options.selectFirst||this.typeAhead||B.inputValue==this.queryValue){this.choiceOver(B,this.typeAhead)}var D=this.choices.getChildren(C),F=this.options.maxChoices;var I={overflowY:"hidden",height:""};this.overflown=false;if(D.length>F){var J=D[F-1];I.overflowY="scroll";I.height=J.getCoordinates(this.choices).bottom;this.overflown=true}this.choices.setStyles(I);this.fix.show();if(this.options.visibleChoices){var H=document.getScroll(),K=document.getSize(),G=this.choices.getCoordinates();if(G.right>H.x+K.x){H.x=G.right-K.x}if(G.bottom>H.y+K.y){H.y=G.bottom-K.y}window.scrollTo(Math.min(H.x,G.left),Math.min(H.y,G.top))}},hideChoices:function(A){if(A){var C=this.element.value;if(this.options.forceSelect){C=this.opted}if(this.options.autoTrim){C=C.split(this.options.separatorSplit).filter($arguments(0)).join(this.options.separator)}this.observer.setValue(C)}if(!this.visible){return }this.visible=false;if(this.selected){this.selected.removeClass("autocompleter-selected")}this.observer.clear();var B=function(){this.choices.setStyle("display","none");this.fix.hide()}.bind(this);if(this.fx){this.fx.start(0).chain(B)}else{B()}this.fireEvent("onHide",[this.element,this.choices])},prefetch:function(){var F=this.element.value,E=F;if(this.options.multiple){var C=this.options.separatorSplit;var A=F.split(C);var B=this.element.getSelectedRange().start;var G=F.substr(0,B).split(C);var D=G.length-1;B-=G[D].length;E=A[D]}if(E.length<this.options.minLength){this.hideChoices()}else{if(E===this.queryValue||(this.visible&&E==this.selectedValue)){if(this.visible){return false}this.showChoices()}else{this.queryValue=E;this.queryIndex=B;if(!this.fetchCached()){this.query()}}}return true},fetchCached:function(){return false;if(!this.options.cache||!this.cached||!this.cached.length||this.cached.length>=this.options.maxChoices||this.queryValue){return false}this.update(this.filter(this.cached));return true},update:function(B){this.choices.empty();this.cached=B;var A=B&&$type(B);if(!A||(A=="array"&&!B.length)||(A=="hash"&&!B.getLength())){(this.options.emptyChoices||this.hideChoices).call(this)}else{if(this.options.maxChoices<B.length&&!this.options.overflow){B.length=this.options.maxChoices}B.each(this.options.injectChoice||function(D){var C=new Element("li",{html:this.markQueryValue(D)});C.inputValue=D;this.addChoiceEvents(C).inject(this.choices)},this);this.showChoices()}},choiceOver:function(C,D){if(!C||C==this.selected){return }if(this.selected){this.selected.removeClass("autocompleter-selected")}this.selected=C.addClass("autocompleter-selected");this.fireEvent("onSelect",[this.element,this.selected,D]);if(!this.selectMode){this.opted=this.element.value}if(!D){return }this.selectedValue=this.selected.inputValue;if(this.overflown){var F=this.selected.getCoordinates(this.choices),E=this.options.overflowMargin,G=this.choices.scrollTop,A=this.choices.offsetHeight,B=G+A;if(F.top-E<G&&G){this.choices.scrollTop=Math.max(F.top-E,0)}else{if(F.bottom+E>B){this.choices.scrollTop=Math.min(F.bottom-A+E,B)}}}if(this.selectMode){this.setSelection()}},choiceSelect:function(A){if(A){this.choiceOver(A)}this.setSelection(true);this.queryValue=false;this.hideChoices()},filter:function(A){return(A||this.tokens).filter(function(B){return this.test(B)},new RegExp(((this.options.filterSubset)?"":"^")+this.queryValue.escapeRegExp(),(this.options.filterCase)?"":"i"))},markQueryValue:function(A){return(!this.options.markQuery||!this.queryValue)?A:A.replace(new RegExp("("+((this.options.filterSubset)?"":"^")+this.queryValue.escapeRegExp()+")",(this.options.filterCase)?"":"i"),'<span class="autocompleter-queried">$1</span>')},addChoiceEvents:function(A){return A.addEvents({mouseover:this.choiceOver.bind(this,[A]),click:this.choiceSelect.bind(this,[A])})}});var OverlayFix=new Class({initialize:function(A){if(Browser.Engine.trident){this.element=$(A);this.relative=this.element.getOffsetParent();this.fix=new Element("iframe",{frameborder:"0",scrolling:"no",src:"javascript:false;",styles:{position:"absolute",border:"none",display:"none",filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}}).inject(this.element,"after")}},show:function(){if(this.fix){var A=this.element.getCoordinates(this.relative);delete A.right;delete A.bottom;this.fix.setStyles($extend(A,{display:"",zIndex:(this.element.getStyle("zIndex")||1)-1}))}return this},hide:function(){if(this.fix){this.fix.setStyle("display","none")}return this},destroy:function(){if(this.fix){this.fix=this.fix.destroy()}}});Element.implement({getSelectedRange:function(){if(!Browser.Engine.trident){return{start:this.selectionStart,end:this.selectionEnd}}var E={start:0,end:0};var A=this.getDocument().selection.createRange();if(!A||A.parentElement()!=this){return E}var C=A.duplicate();if(this.type=="text"){E.start=0-C.moveStart("character",-100000);E.end=E.start+A.text.length}else{var B=this.value;var D=B.length-B.match(/[\n\r]*$/)[0].length;C.moveToElementText(this);C.setEndPoint("StartToEnd",A);E.end=D-C.text.length;C.setEndPoint("StartToStart",A);E.start=D-C.text.length}return E},selectRange:function(D,A){if(Browser.Engine.trident){var C=this.value.substr(D,A-D).replace(/\r/g,"").length;D=this.value.substr(0,D).replace(/\r/g,"").length;var B=this.createTextRange();B.collapse(true);B.moveEnd("character",D+C);B.moveStart("character",D);B.select()}else{this.focus();this.setSelectionRange(D,A)}return this}});Autocompleter.Base=Autocompleter;;
Autocompleter.Request=new Class({Extends:Autocompleter,options:{postData:{},ajaxOptions:{},postVar:"value"},query:function(){var C=$unlink(this.options.postData)||{};C[this.options.postVar]=this.queryValue;var B=$(this.options.indicator);if(B){B.setStyle("display","")}var A=this.options.indicatorClass;if(A){this.element.addClass(A)}this.fireEvent("onRequest",[this.element,this.request,C,this.queryValue]);this.request.send({data:C})},queryResponse:function(){var B=$(this.options.indicator);if(B){B.setStyle("display","none")}var A=this.options.indicatorClass;if(A){this.element.removeClass(A)}return this.fireEvent("onComplete",[this.element,this.request])}});Autocompleter.Request.JSON=new Class({Extends:Autocompleter.Request,initialize:function(C,B,A){this.parent(C,A);this.request=new Request.JSON($merge({url:B,link:"cancel"},this.options.ajaxOptions)).addEvent("onComplete",this.queryResponse.bind(this))},queryResponse:function(A){this.parent();this.update(A)}});Autocompleter.Request.HTML=new Class({Extends:Autocompleter.Request,initialize:function(C,B,A){this.parent(C,A);this.request=new Request.HTML($merge({url:B,link:"cancel",update:this.choices},this.options.ajaxOptions)).addEvent("onComplete",this.queryResponse.bind(this))},queryResponse:function(A,B){this.parent();if(!B||!B.length){this.hideChoices()}else{this.choices.getChildren(this.options.choicesMatch).each(this.options.injectChoice||function(C){var D=C.innerHTML;C.inputValue=D;this.addChoiceEvents(C.set("html",this.markQueryValue(D)))},this);this.showChoices()}}});Autocompleter.Ajax={Base:Autocompleter.Request,Json:Autocompleter.Request.JSON,Xhtml:Autocompleter.Request.HTML};;
var Observer=new Class({Implements:[Options,Events],options:{periodical:false,delay:1000},initialize:function(C,A,B){this.element=$(C)||$$(C);this.addEvent("onFired",A);this.setOptions(B);this.bound=this.changed.bind(this);this.resume()},changed:function(){var A=this.element.get("value");if($equals(this.value,A)){return }this.clear();this.value=A;this.timeout=this.onFired.delay(this.options.delay,this)},setValue:function(A){this.value=A;this.element.set("value",A);return this.clear()},onFired:function(){this.fireEvent("onFired",[this.value,this.element])},clear:function(){$clear(this.timeout||null);return this},pause:function(){if(this.timer){$clear(this.timer)}else{this.element.removeEvent("keyup",this.bound)}return this.clear()},resume:function(){this.value=this.element.get("value");if(this.options.periodical){this.timer=this.changed.periodical(this.options.periodical,this)}else{this.element.addEvent("keyup",this.bound)}return this}});var $equals=function(B,A){return(B==A||JSON.encode(B)==JSON.encode(A))};;
Netvibes.UI.Balloon=new Class({Implements:[Options,Events],options:{id:"balloon",className:"balloon",width:300},initialize:function(A){this.setOptions(A);this.build();return this},build:function(){this.smWindow=new Element("div",{id:this.options.id,"class":this.options.className,styles:{position:"absolute",zIndex:10000,width:this.options.width+"px",display:"none"}});this.closeButton=new Element("img",{src:App.getStaticUrl("/img/closeMod.gif"),alt:"","class":"close"}).inject(this.smWindow).addEvent("click",this.hide.bindWithEvent(this));this.content=new Element("div",{"class":"content"});document.getElementsByTagName("body")[0].appendChild(this.smWindow);this.smWindow.appendChild(this.content)},show:function(A){if(A){var C=A.target.getPosition();var B=C.x+30}if(Browser.getDocumentWidth()-this.options.width<B){this.smWindow.className="balloonRight";B-=this.options.width-47}else{this.smWindow.className="balloon";B-=33}if(A){Element.setStyle(this.smWindow,{left:B+"px",top:(C.y+A.target.getSize().y)+"px"})}this.smWindow.show()},hide:function(A){if(A){A.stop()}this.smWindow.destroy();this.fireEvent("onHide")}});;
App.Wizard=new Class({Implements:[Events,Options],options:{duration:200,nextStepButtonText:_("Next"),prevStepButtonText:"< "+_("Previous"),cancelButtonText:_("Cancel"),finishButtonText:_("Finish"),title:"",formAction:"",initialStatus:null},initialize:function(A,B){this.setOptions(B);this.steps=A;this.trail=[];this.length=this.steps.length;this.currentStep=0;this.data={};this.build()},build:function(){this.overlay=new Overlay({hideOnClick:false}).show();this.container=new Element("form",{id:"wizard",method:"post",action:this.options.formAction}).setStyle("visibility","hidden").inject("application","top");new Element("h1",{id:"wizard-title"}).set("html",this.options.title).inject(this.container,"top");Netvibes.UI.createIcon("actions-window-close close",_("Close"),16,16).addEvent("click",this.close.bind(this)).inject(this.container);var B=new Element("ul",{"class":"autoclear",styles:{margin:0,padding:0}}).inject(this.container);for(var C=0;C<this.length;C++){var A=new Element("li",{"class":"wizard-step",styles:{width:(this.length<=2)?350:Math.floor(95/this.length)+"%"}});this.trail[C]={};this.trail[C].head=new Element("a",{"class":"wizard-head",id:"wizard-head-"+C}).set("html","<strong>"+(C+1)+"</strong><div>"+this.steps[C].title+"</div>").addEvents({click:this.displayPreviousStep.bindWithEvent(this,C),mouseover:function(F,E){if(E<this.currentStep){F.target.style.cursor="pointer"}}.bindWithEvent(this,C),mouseout:function(F,E){F.target.style.cursor="default"}.bindWithEvent(this,C)}).inject(A);if(C==this.currentStep){this.trail[C].head.addClass("wizard-active")}this.trail[C].balloonContent=new Element("div",{"class":"in1"});this.trail[C].balloon=new Element("div",{"class":"wizard-balloon",id:"wizard-balloon-"+C,styles:{visibility:C==this.currentStep?"visible":"hidden"}}).grab(this.trail[C].balloonContent).inject(A);this.trail[C].step=new this.steps[C].content(this);this.setBalloon(C);A.inject(B)}if(App.pageCustom.enableFx=="1"){var D=new Fx.Morph(this.container,{duration:this.options.duration,wait:false});D.start({opacity:[0,1]}).chain(function(){this.fireEvent("load")}.bind(this))}else{this.container.style.visibility="visible";this.fireEvent("load")}},setBalloon:function(A){this.trail[A].balloonContent.empty().adopt(this.trail[A].step.toElement());var C=new Element("a",{href:"javascript:void(0)",styles:{display:"block","float":App.dirRTL?"right":"left"}});var B=new Element("a",{href:"javascript:void(0)",styles:{display:"block","float":App.dirRTL?"left":"right"}});if(A==0){C.set("text",this.options.cancelButtonText);C.addEvent("click",this.close.bindWithEvent(this))}else{C.grab(new Element("span",{text:this.options.prevStepButtonText}));C.set({rel:"prev"}).addEvent("click",this.prevStep.bindWithEvent(this))}if(A==this.length-1){B.grab(new Element("span",{text:this.options.finishButtonText}));B.set({"class":"wizard-button",id:"wizard-finish"}).addEvent("click",this.onFinish.bindWithEvent(this))}else{B.grab(new Element("span",{text:this.options.nextStepButtonText}));B.set({rel:"next","class":"wizard-button"}).addEvent("click",this.nextStep.bindWithEvent(this))}var D=new Element("div",{"class":"wizard-balloon-footer autoclear"}).grab(C).grab(B);D.inject(this.trail[A].balloonContent)},close:function(A){if(A){A.stop();this.overlay.hide()}if(App.welcomeMessage){App.welcomeMessage.onDismiss()}this.container.destroy()},positionBalloon:function(C){var B=this.trail[C].balloon.getSize().x;var A=this.trail[C].head.getSize().x;if(B>A){this.trail[C].balloon.style.marginLeft="-"+(B-A)/2+"px"}},nextStep:function(A){if(A){A.stop()}if(A&&this.trail[this.currentStep].step.onNextStep){if(!this.trail[this.currentStep].step.onNextStep()){return false}}if(this.currentStep!=this.length){this.goToStep(this.currentStep+1)}},prevStep:function(A){if(A){A.stop()}if(this.trail[this.currentStep].step.onPrevStep){if(!this.trail[this.currentStep].step.onPrevStep()){return false}}if(this.currentStep!=0){this.goToStep(this.currentStep-1)}},goToStep:function(A){if(A<0||A>=this.length){return }this.trail[this.currentStep].balloon.style.visibility="hidden";this.trail[this.currentStep].head.removeClass("wizard-active");if(this.trail[this.currentStep-1]){this.trail[this.currentStep-1].head.removeClass("wizard-previous")}this.currentStep=A;this.positionBalloon(A);this.trail[this.currentStep].balloon.style.visibility="visible";this.trail[this.currentStep].head.addClass("wizard-active");if(this.trail[this.currentStep-1]){this.trail[this.currentStep-1].head.addClass("wizard-previous")}if(typeof this.trail[this.currentStep].step.onShow=="function"){this.trail[this.currentStep].step.onShow()}},displayPreviousStep:function(B,A){if(B){B.stop()}if(A>=this.currentStep){return }this.goToStep(A)},getNextButton:function(){return this.trail[this.currentStep].balloon.getElement("a.wizard-button")},onFinish:function(A){this.trail[this.currentStep].step.onFinish(A)}});App.WizardExtended=new Class({Extends:ModalDialog,initialize:function(){this.parent("wizard-modal",{className:"modalDialog",overlayClassName:"wizard-overlay",showCloseButton:false,showTitle:false,width:900,height:"auto",hideOverlayOnClick:false,fadeEffect:true});this.sponsoredManager=new App.Wizard.Custom.CustomFinish(this);this.categsManager=new App.Wizard.Custom.Interest(this);this.data={};this.build();App.report("wizard.step0",{locale:App.locale});this.show();this.overlay.addEvent("hide",this.close.bind(this))},close:function(A){if(A){A.stop();this.hide(A);if(App.pageCustom.welcomeMessage){App.pageCustom.welcomeMessage="0";App.savePageCustom()}}this.destroy()},build:function(){this.buildInfo().inject(this.container);this.buildForm().inject(this.container);this.addEvents()},buildInfo:function(){var A=new Element("div",{"class":"wizard-info",html:'<div id="wizard-logo"></div><div class="wizard-intro"><p>'+_("Welcome to netvibes,")+_("your personalized startpage!")+"</p><p>"+_("Netvibes is a <strong>free</strong> web service that brings together your favorite media sources and online services.")+"<br /><br />"+_("Everything that matters to you &#8212; blogs, news, weather, videos, photos, social networks, email and much more &#8212; is automatically updated every time you visit your page.")+"<br /><br />"+_("The wizard is a tool to help you <strong>easily create</strong> your very own start page.")+"<br /><br />"+_("Learn more? {0}Take a tour{1}").format('<a href="http://'+NV_TOUR+'" target="_blank">',"</a>")+"</p></div>"});if(!User.registered){new Element("div",{html:'<p class="wizard-signin">'+_("Are you already registered?")+' <a href="http://'+NV_HOST+'/signin" class="button"><span>'+_("Sign In")+'</span></a></p><p class="wizard-signup">'+_("Not yet? Register for free")+' <a href="http://'+NV_HOST+'/signup" class="button"><span>'+_("Sign up")+"</span></a></p>"}).inject(A,"bottom")}return A},buildForm:function(){return new Element("form",{"class":"wizard-create-page",method:"post",action:"/"}).adopt(new Element("div",{"class":"autoclear"}).adopt(this.buildCategories(),this.buildSponsored()),this.buildFinish())},buildCategories:function(){var B=new Element("div",{"class":"wizard-categories"}).adopt(new Element("p",{text:_("Start with:")}));var A=new Element("ul").inject(B,"bottom");this.categsManager.categs.each(function(C,D){new Element("li",{"class":"wizard-category",id:"wizard-category-"+D}).adopt(new Element("label",{"for":D+"-id"}).adopt(new Element("img",{src:App.getStaticUrl("/img/s.gif"),width:24,height:24,valign:"middle"}),new Element("input",{type:"checkbox",id:D+"-id",name:D,checked:(D=="news"?"checked":"")}),new Element("span",{html:C.name}))).inject(A)});return B},buildSponsored:function(){this.sponsoredManager.sponsoredElm=new Element("div",{"class":"wizard-partners"});this.sponsoredManager.populate(App.locale);return this.sponsoredManager.sponsoredElm},buildFinish:function(){return new Element("div",{"class":"wizard-finish autoclear"}).adopt(new Element("div",{id:"wizard-terminal",style:{visibility:"hidden"}}),new Element("a",{href:"/",id:"wizard-finish","class":"nv-green-button"}).grab(new Element("span",{text:_("Create my page now")})),new Element("br"),new Element("a",{href:"/",id:"wizard-cancel",text:_("No thanks, let me try first")}))},addEvents:function(){if(!User.registered){this.container.getElement(".wizard-signin").addEvent("click",function(A){A.stop();this.overlay.hide();this.destroy();App.Login.show()}.bindWithEvent(this));this.container.getElement(".wizard-signup").addEvent("click",function(A){A.stop();this.overlay.hide();this.destroy();App.showSignup()}.bindWithEvent(this))}this.container.getElement("#wizard-cancel").addEvent("click",this.close.bindWithEvent(this));this.container.getElement("#wizard-finish").addEvent("click",function(C){C.stop();$("wizard-finish").hide();$("wizard-terminal").set("html",_("Creating your page...")).setStyle("visibility","visible").show();this.data.locale=App.locale;this.data.interest={};this.data.interest.category=[];var B=this.container.getElements(".wizard-categories input");B.each(function(D){if(D.checked){var E={};E[this.categsManager.categs[D.name].id]=this.categsManager.categs[D.name].name;this.data.interest.category.push(E)}}.bind(this));if(this.data.interest.category.length<=0){delete this.data.interest}this.data.sponsored=[];var A={};var B=this.container.getElements(".wizard-partners input");B.each(function(D,E){if(D.id=="setAsDefaultHomepage"){return }A[this.sponsoredManager.items[E].id]=D.checked;if(D.checked){this.data.sponsored.push(this.sponsoredManager.items[E])}}.bind(this));if(A.length>0){App.report("wizard.thumbs",A)}if(this.data.sponsored.length==0){delete this.data.sponsored}this.sponsoredManager.postData()}.bindWithEvent(this))}});App.wizardCustomLocales=["fr","us","de","gb","ca","qc","au","br","mx"];App.wizardDisabledFor=["itv2","skidmoreowingsandmerrill","vmn","vmnfr","attractabrennan","meuig","gazetaonline","t-online","redbullbrandwatch","ijangostart"];App.PUWithWizardCustomByDefault=["tagged","reganam","safeappsoftware","eztracks","eztracks-es"];App.wizardCustomByDefault=App.wizardCustomLocales;App.wizardCustomEnabled=function(){if(!App.visit&&App.wizardCustomLocales.contains(App.locale)){if(App.isPremium()&&App.wizardDisabledFor.contains(App.premium.universe)){return false}else{return true}}else{return false}};App.Wizard.Custom={};App.Wizard.Custom.Country=new Class({Implements:Events,initialize:function(A){this.wizard=A},toElement:function(){this.content=new Element("div");var A='<p style="font-weight: bold">'+_("Get weather, news and information based on your location.")+"</p>";A+=this.buildForm();A+='<input type="checkbox" id="wizard-country-save" checked="checked" style="display: none" /><label for="wizard-country-save">'+_("Your page will be localized for this region")+"</label>";this.content.set("html",A);this.attachEvents();return this.content},buildForm:function(){var D="";D+='<p class="field" style="margin: 10px 0 5px 0">';D+='<label for="wizard-hometown">'+_("City:")+"</label>";D+='<input type="text" class="text wizard-hometown defaultText" value="" id="wizard-hometown" />';D+='<div id="wizard-hometown-results" class="wizard-hometown-results inner" style="display: none"></div>';D+="</p>";D+='<p class="field" style="margin: 10px 0 5px 0">';D+='<label for="wizard-country-select">'+_("Local content:")+"</label>";D+='<select id="wizard-country-select">';var A=Netvibes.Settings.locales.sort(function(G,F){var H=G.name.replace(/é|è|ê|ë|ê/gi,"e").replace(/à|â|ä/gi,"a").replace(/î|ï/gi,"i").replace(/ù|ü|û/gi,"u").replace(/ô|ö/gi,"o").toLowerCase();var I=F.name.replace(/è|é|ê|ë|ê/gi,"e").replace(/à|â|ä/gi,"a").replace(/î|ï/gi,"i").replace(/ù|ü|û/gi,"u").replace(/ô|ö/gi,"o").toLowerCase();if(H<I){return -1}if(H>I){return 1}return 0});var C="";for(var B=0,E;E=A[B++];){if(C==E.code){continue}D+='<option value="'+E.code+'"';if(E.code==App.locale){D+=' selected="selected"'}D+=">"+E.name+"</option>";C=E.code}D+="</select>";D+="<br />";D+="</p>";return D},attachEvents:function(B){if(!B){App.report("wizard.step1",{locale:this.wizard.data.locale||App.locale})}this.input=$(this.content.getElementsByClassName("wizard-hometown")[0]);this.resultDiv=$(this.content.getElementsByClassName("wizard-hometown-results")[0]);this.wizard.data.locale=App.locale;var A=this.content.getElementsByTagName("select")[0];$(A).addEvent("change",function(){this.wizard.data.locale=$("wizard-country-select").value||App.locale;this.fireEvent("localChange")}.bind(this));this.input.addEvents({keyup:this.updateHometown.bind(this)});this.addEvent("localChange",function(){this.wizard.trail[1].step.checkCategs()}.bind(this))},updateHometown:function(B){if(this.input.value.trim()==""){this.resultDiv.hide();return true}if(arguments.callee.timer){clearTimeout(arguments.callee.timer)}if(typeof B=="object"){B.stop();if(B.type=="keyup"&&B.key=="enter"){arguments.callee.queue=arguments.callee.queue||0;if(arguments.callee.queue>0){return }++arguments.callee.queue;setTimeout(function(){this.queue=0}.bind(arguments.callee),1000)}else{if(B.type=="keyup"){var A=arguments.callee.bind(this);arguments.callee.timer=setTimeout(A,1000);return }}}var C=new Hash({name:this.input.value,maxRows:10,type:"json",featureClass:"P",lang:App.lang.substring(0,2)});new Request.JSON({onComplete:this.displayResultList.bind(this),onRequest:function(){this.resultDiv.show();this.resultDiv.set("text",_("Loading..."))}.bind(this),onFailure:function(){this.resultDiv.set("html",'<span class="error">'+_("service unavailable")+"</span>")}.bind(this)}).get("/proxy/ajaxProxy.php",{url:"http://ws5.geonames.org/search?"+C.toQueryString(),cache:60*60*24*30})},displayResultList:function(B){if(!B){return }var D=B.geonames;var C=D.length;this.resultDiv.empty();if(C==0){this.resultDiv.empty();this.resultDiv.set("text",_("No result"));this.setHometown(false)}else{var A=document.createElement("ul");for(var E=0;E<C;E++){new Element("li",{"class":E%2==0?"odd":"even"}).grab(new Element("a",{href:"javascript:void(0)"}).addEvent("click",this.setHometown.bind(this,D[E])).set("html",D[E].name+" ("+(D[E].adminName1||D[E].adminCode1)+", "+D[E].countryName+")")).inject(A)}this.resultDiv.innerHTML="";this.resultDiv.appendChild(A);this.resultDiv.style.display="block"}},setHometown:function(A){if(!A){delete this.wizard.data.location}else{this.wizard.data.location={};this.wizard.data.location.id=A.geonameId;this.wizard.data.location.name=A.name;this.wizard.data.location.countryName=A.countryName;this.wizard.data.location.countryCode=A.countryCode;this.input.value=A.name+" ("+(A.adminName1||A.adminCode1)+", "+A.countryName+")";this.synchToLocalContent(A.countryCode)}this.resultDiv.empty();this.resultDiv.hide()},synchToLocalContent:function(E){this.wizard.data.locale=E.toLowerCase()||App.locale;this.fireEvent("localChange");var F=E.toLowerCase();var A=$("wizard-country-select");var C=A.getElementsByTagName("option");for(var D=0;D<C.length;D++){if(C[D].value.substring(0,2)==F){A.selectedIndex=D;return }if(C[D].value=="us"){var B=D}}A.selectedIndex=B},onNextStep:function(){var A=$("wizard-country-select").value;this.wizard.data.locale=A||App.locale;this.wizard.trail[2].step.populate(A);App.report("wizard.step2",{locale:this.wizard.data.locale||App.locale});return true}});App.Wizard.Custom.Interest=new Class({initialize:function(A){this.wizard=A;this.categs=new Hash({news:{name:_("News"),id:1},business:{name:_("Business"),id:2},sport:{name:_("Sport"),id:3},movie:{name:_("TV, movies & music"),id:4},techno:{name:_("Tools & technology"),id:6},games:{name:_("Fun & games"),id:7},life:{name:_("Lifestyle"),id:8},shopping:{name:_("Shopping"),id:10},travel:{name:_("Travel"),id:13}})},toElement:function(){this.content=new Element("div",{"class":"minWidth"});var A="<h2>"+_("Interests")+"</h2>";A+="<p><strong>"+_("What do you like on your own?")+"</strong></p>";A+='<ul class="autoclear wizard-thumbs" id="wizard-categ">';A+=this.buildCategs();A+="</ul>";A+="<p>";A+=_("We recommend the most popular widget for each category");A+="</p>";this.content.set("html",A);this.attachEvents();return this.content},buildCategs:function(){var A=0;var B="";this.categs.each(function(C,D){B+='<li class="picto-'+D+'"><a href="javascript:void(0)"><div class="vignette"></div><input type="checkbox" class="checkbox" id="'+D+'-id" name="'+D+'"';if(D=="news"){B+=' checked="checked" '}B+="/>";B+="<label>"+C.name+"</label></a>";B+="</li>"});return B},attachEvents:function(){var A=this.content.getElementsByTagName("ul")[0];$A(A.getElementsByTagName("a")).each(function(C){$(C).addEvent("click",function(E){var D=this.getElementsByTagName("input")[0];if(D.name!="dla"&&!E.target.type){D.checked=!D.checked}})});var B=this.content.getElementsByClassName("dla-keyword-input")[0];if(B){B.addEvents({blur:function(){if(this.value.trim()==""){this.value=_("keyword");this.style.color="#666"}else{this.parentNode.firstChild.checked=true}},focus:function(){if(this.value.trim()==_("keyword")){this.value="";this.style.color="#000"}}})}},onNextStep:function(){this.computeState();App.report("wizard.step3",{locale:this.wizard.data.locale||App.locale});return true},computeState:function(){var A=$A($("wizard-categ").getElementsByClassName("checkbox"));this.wizard.data.interest={};this.wizard.data.interest.category=[];A.each(function(B){if(B.checked){var C={};C[this.categs[B.name].id]=this.categs[B.name].name;this.wizard.data.interest.category.push(C)}}.bind(this));delete this.wizard.data.keyword;if($("wizard-dla-chk")&&$("wizard-dla-chk").checked){this.wizard.data.keyword=$("wizard-dla").value}},repartition:{1:[9],2:[5,4],3:[3,3,3],4:[3,2,2,2],5:[2,2,2,2,1],6:[2,2,2,1,1,1],7:[2,2,1,1,1,1,1],8:[2,1,1,1,1,1,1,1],9:[1,1,1,1,1,1,1,1,1]},populate:function(A){if(this.wizard.data.interest.category.length<=0){delete this.wizard.data.interest}$("wizard-finish").hide();$("wizard-terminal").set("html",_("Creating your page...")).setStyle("visibility","visible").show();this.wizard.trail[2].step.postData()}});App.Wizard.Custom.CustomFinish=new Class({initialize:function(A){this.wizard=A},toElement:function(){this.content=new Element("div",{"class":"minWidth"});var A="<h2>"+_("Your page is ready")+"</h2>";A+="<p>";A+=_("Congratulations! Your personalized startpage is ready! At any time you can add cool new widgets, remove ones you don't want, and update the layout exactly the way you want it.");A+="</p>";this.sponsoredElm=new Element("div");this.content.set("html",A);this.sponsoredElm.inject(this.content);new Element("div",{id:"wizard-terminal","class":"autoclear",styles:{textAlign:"center",paddingTop:"10px",marginTop:"10px",display:"none"}}).inject(this.content);if(Browser.isIE){this.setHomePage=true;new Element("input",{id:"setAsDefaultHomepage",type:"checkbox",checked:"checked",styles:{display:"block","float":"left",marginTop:"10px",marginBottom:"10px",marginRight:"10px"},events:{click:(function(C){var B=(C.target||C.srcElement);this.setHomePage=B.checked}).bindAsEventListener(this)}}).inject(this.content);new Element("label",{"for":"setAsDefaultHomepage",styles:{display:"block",paddingTop:"10px",cursor:"pointer"},text:_("Set netvibes as my default homepage")}).inject(this.content)}return this.content},populate:function(A){this.code=A;var D=0;if(App.isPremium()){var F="http://"+NV_ECO_API+"/campaigns?";var E=new Hash({nocache:1,section:"wizard",region:A,format:"json",thumbheight:48,thumbwidth:64,thumbtype:"ginger",brand:App.brand});var B=F+E.toQueryString();E.region="zz";var G=F+E.toQueryString()}else{var B="/proxy/cache/eco/wizard-sponsored-"+A+".json";var G="/proxy/cache/eco/wizard-sponsored-zz.json"}var C=new Request.JSON({onComplete:function(I){D++;if((!I||I.items.length==0)&&D<2){setTimeout(function(){if(App.isPremium()){C.get("/proxy/ajaxProxy.php",{url:G,cache:60*60*24})}else{C.get(G)}},500);return }this.items=I.items.slice(0,3);this.sponsoredElm.empty();var H=new Element("ul",{id:"wizard-sponsored","class":"autoclear wizard-thumbs"});this.sponsoredElm.grab(new Element("div",{"class":"inner"}).adopt(new Element("p",{html:_("Suggested partner widgets to add to your page:")}),H));this.items.each(function(L,J){if(typeof L=="undefined"){return }var K=null;if(typeof L.descriptions=="array"){if(L.descriptions[App.shortLang]){K=L.descriptions[App.shortLang]}else{if(L.descriptions.en){K=L.descriptions.en}else{if(L.descriptions[0]){K=L.descriptions[0]}}}}else{K=L.description}App.report("camp.browse",{ecoId:(L.id),campaignId:L.campaignId});new Element("li").grab(new Element("a",{href:"javascript:void(0)"}).addEvent("click",function(N){if(!N.target.type){var M=this.getElementsByTagName("input")[0];M.checked=!M.checked}}).set("html",'<div class="vignette" style="background: url('+L.thumbnail+') left top no-repeat"></div><input type="checkbox" class="checkbox" id="'+L.id+'-id" name="'+L.id+'"'+(App.locale=="us"&&J==0?"":' checked="checked"')+"  /><label>"+L.title+"</label><p>"+K.truncate(70)+"</p>")).inject(H)}.bind(this));new Element("p",{"class":"wizard-manual",html:_("At any time you can add cool new widgets, remove ones you don't want, and update the layout exactly the way you want it.")}).inject(this.sponsoredElm,"bottom")}.bind(this),onRequest:function(){this.sponsoredElm.empty().set("html",_("Loading..."))}.bind(this),onFailure:function(){}.bind(this)});if(App.isPremium()){C.get("/proxy/ajaxProxy.php",{url:B,cache:60*60*24})}else{C.get(B)}},onFinish:function(C){if(Browser.isIE&&this.setHomePage==true){var B=(C.target||C.srcElement);B.style.behavior="url(#default#homepage)";B.setHomePage("http://"+NV_HOST)}this.wizard.data.sponsored=[];var A={};$A(this.content.getElementsByTagName("input")).each(function(D,E){if(D.id=="setAsDefaultHomepage"){return }A[this.items[E].id]=D.checked;if(D.checked){this.wizard.data.sponsored.push(this.items[E])}}.bind(this));if(A.length>0){App.report("wizard.thumbs",A)}if(this.wizard.data.sponsored.length==0){delete this.wizard.data.sponsored}this.wizard.trail[1].step.populate(this.wizard.data.locale||App.locale)},postData:function(){if(typeof this.wizard.data.location=="undefined"){this.wizard.data.location={};if($("wizard-hometown")&&$("wizard-hometown").value.trim()!=""){this.wizard.data.location.name=$("wizard-hometown").value}}if(App.isPremium()){this.wizard.data.premium=App.premium.universe}var A=function(C){var B=_("Sorry, an error has occurred. Try again later.");if(typeof C=="string"){B=C}$("wizard-terminal").set("html",'<span class="error">'+B+"</span>");$("wizard-finish").setStyle("visibility","visible");$("wizard-finish").show()};this.wizard.data.stats={browser:Browser.name,browser_version:Browser.version,os:Browser.os,os_version:Browser.osVersion,screensize:screen.width+"x"+screen.height,locale:this.wizard.data.locale||App.locale,wizard:true};if(App.brand){this.wizard.data.stats.brand=App.brand}if(App.visit&&App.visit.id){this.wizard.data.stats.visit=App.visit.id}this.wizard.data.layout=App.selectedTabObj.dataObj.layout;this.wizard.data.pid=App.currentPage;new Request.JSON({onComplete:function(B){if(B&&B.success){App.pageCustom.welcomeMessage="0";App.savePageCustomNow();setTimeout(function(){document.location.reload()},1000)}else{if(B==""||(B&&B.error)){A(B.error)}}},onFailure:A}).post("/ajax/tab/custom.php",JSON.encode(this.wizard.data))}});App.showWizardCustom=function(){App.Panel.close();return new App.Wizard([{title:_("Local content"),content:App.Wizard.Custom.Country},{title:_("Interests"),content:App.Wizard.Custom.Interest},{title:_("Your page is ready"),content:App.Wizard.Custom.CustomFinish}],{title:_("Personalize your page"),finishButtonText:_("Show me my page")})};App.showWizardCustomExtended=function(){if(App.isPremium()){App.showWizardCustom();return }App.Panel.close();return new App.WizardExtended()};App.Wizard.Register={};App.Wizard.Register.ProfileStep=new Class({initialize:function(A){this.wizard=A},toElement:function(){this.content=new Element("div");var A="";A+='<p class="field">';A+='<label for="signupFullname">'+_("What's your full name?")+"</label>";A+='<input id="signupFullname" name="fullname" type="text" class="text" value="" autocomplete="off" /><img src="'+App.getStaticUrl("/img/s.gif")+'" width="16" height="16" />';A+='<em class="description">'+_("ex: John Smith")+"</em>";A+="</p>";A+='<p class="field">';A+="<label>"+_("Account type:")+"</label>";A+='<select name="accountType">';A+='<option value="personnal">'+_("Personal")+"</option>";A+='<option value="pro">'+_("Pro")+"</option>";A+="</select>";A+='<em class="description personnal">'+_("I am using this public page for my personal use (e.g. johnsmith, sandra 95)")+"</em>";A+='<em class="description pro" style="display: none">'+_("I am using this public page on behalf of a brand, a celebrity or an organization (e.g. Nike, Cartier, Coke)")+"</em>";A+="</p>";A+='<p class="field personnal">';A+="<label>"+_("Gender:")+"</label>";A+='<select name="gender">';A+='<option value="male">'+_("Male")+"";A+='<option value="female">'+_("Female")+"";A+="</select>";A+="</p>";A+='<p class="field personnal">';A+="<label>"+_("What's your age?")+"</label>";A+='<select id="birthdayMonth" name="month">';A+="<option>"+_("Month:")+"</option>";A+='<option value="1">'+_("January")+"</option>";A+='<option value="2">'+_("February")+"</option>";A+='<option value="3">'+_("March")+"</option>";A+='<option value="4">'+_("April")+"</option>";A+='<option value="5">'+_("May")+"</option>";A+='<option value="6">'+_("June")+"</option>";A+='<option value="7">'+_("July")+"</option>";A+='<option value="8">'+_("August")+"</option>";A+='<option value="9">'+_("September")+"</option>";A+='<option value="10">'+_("October")+"</option>";A+='<option value="11">'+_("November")+"</option>";A+='<option value="12">'+_("December")+"</option>";A+="</select> ";A+='<select id="birthdayDay" name="day"></select> ';A+='<select id="birthdayYear" name="year">';A+="<option>"+_("Year:")+"</option>";for(var B=2008;B>=1910;B--){A+='<option value="'+B+'">'+B+"</option>"}A+='</select><img src="'+App.getStaticUrl("/img/s.gif")+'" width="16" height="16" />';A+="</p>";A+='<p class="error" style="display:none"></p>';A+='<p class="personnal">';A+='<input id="birthdayVisibility" name="birthdayVisibility" type="checkbox" value="0" /><label for="birthdayVisibility">'+_("Don't display my age on my public profile")+"</label>";A+="<p>";this.content.set("html",A);this.attachEvents();return this.content},rebuildDays:function(){var A=31;if(this.selectMonth.selectedIndex){A=new Date(this.selectYear.selectedIndex>0?this.selectYear.value:1920,this.selectMonth.value,0).getDate()}var C=(this.selectDay.selectedIndex>0)?this.selectDay.selectedIndex:0;this.selectDay.empty();for(var B=0;B<=A;B++){new Element("option",{text:(B==0)?_("Day:"):B,value:B}).inject(this.selectDay)}this.selectDay.selectedIndex=(this.selectDay.options.length>C)?C:0},attachEvents:function(){this.errorMsg=this.content.getElement(".error");var A=this.content.getElements("select");this.inputFullname=$(this.content.getElementsByTagName("input")[0]);this.selectUsage=A[0];this.selectGender=A[1];this.selectMonth=A[2];this.selectDay=A[3];this.selectYear=A[4];this.birthdayVisibility=$(this.content.getElementsByTagName("input")[1]);this.rebuildDays();this.inputFullname.value=User.displayName;if(this.wizard.options.initialStatus.universe.brand){this.selectUsage.value="pro";this.changeUsage()}this.selectGender.value=User.gender;if($defined(User.birthday)){this.selectMonth.selectedIndex=parseInt(this.wizard.options.initialStatus.user.birthday.month,10);this.selectYear.value=this.wizard.options.initialStatus.user.birthday.year;this.selectDay.selectedIndex=parseInt(this.wizard.options.initialStatus.user.birthday.day,10)}if(User.birthday===false){this.birthdayVisibility.checked=true}this.selectUsage.addEvent("change",this.changeUsage.bindWithEvent(this));this.inputFullname.addEvent("blur",this.validateFullname.bindWithEvent(this));this.selectMonth.addEvent("change",this.rebuildDays.bindWithEvent(this));this.selectYear.addEvent("change",this.rebuildDays.bindWithEvent(this));this.selectMonth.addEvent("change",this.validateBirthday.bindWithEvent(this));this.selectYear.addEvent("change",this.validateBirthday.bindWithEvent(this));this.selectDay.addEvent("change",this.validateBirthday.bindWithEvent(this))},changeUsage:function(){var D=this.selectUsage.value;var C=this.content.getElements(".personnal");var B=this.content.getElements(".pro");if(D!="personnal"){C.hide();B.show()}else{C.show();B.hide()}var A=setInterval(function(){if(!this.wizard.trail[2].step.onAccountTypeChange){return }else{this.wizard.trail[2].step.onAccountTypeChange(D);clearInterval(A)}}.bind(this),100);this.errorMsg.hide()},validateFullname:function(){var A=this.inputFullname.value.trim().length>0;this.inputFullname.getNext().className=A?"valid":"invalid";return A},is13YearsOld:function(){var A=new Date();return(new Date(this.selectYear.value,this.selectMonth.selectedIndex,this.selectDay.selectedIndex)<new Date().setFullYear(A.getFullYear()-13,A.getMonth(),A.getDate()))},validateBirthday:function(){if(this.selectUsage.value=="pro"){return true}var A=(this.selectMonth.selectedIndex&&this.selectDay.selectedIndex&&this.selectYear.selectedIndex&&this.is13YearsOld());this.selectYear.getNext().className=A?"valid":"invalid";return A},onNextStep:function(){var A=(this.validateBirthday()&this.validateFullname());if(this.selectUsage.value=="personnnal"&&!this.is13YearsOld()){this.errorMsg.set("html",_("Sorry, you must be at least 13 years old to use netvibes")).show();return false}this.errorMsg.hide();if(A&&!(this.request&&this.request.running)){this.request=new Request({url:"/ajax/user/suggest.php",data:$("wizard").toQueryString(),onRequest:function(){var B=this.wizard.getNextButton();B.addClass("wizard-button-disabled");B.getFirst().set("text",_("Loading..."))}.bind(this),onComplete:this.onSuggestResponse.bind(this)}).POST()}return false},onSuggestResponse:function(C){var A=JSON.decode(C);if(typeof A=="object"){A=$A(A)}else{A=[]}this.wizard.suggest=A;var B=this.wizard.getNextButton();B.removeClass("wizard-button-disabled");B.getFirst().set("text",this.wizard.options.nextStepButtonText);this.wizard.nextStep();this.request=null}});App.Wizard.Register.NetvibesID=new Class({initialize:function(A){this.wizard=A},toElement:function(){this.content=new Element("div");var A="";A+="<h3>"+_("Your public page will have this url:")+"</h3>";A+='<p class="error" style="display:none"></p>';A+='<p class="field username">';A+="</p>";A+='<p class="info">'+_("Avoid using generic dictionary names, brands or people names.")+"</p>";A+="<h3>"+_("Your public picture:")+"</h3>";A+='<iframe id="targetAvatar" style="display: none;" border="0" name="targetAvatar"></iframe>';A+='<form id="avatarForm" action="http://'+NV_AVATARS+'" enctype="multipart/form-data" method="post" target="targetAvatar">';A+='<p class="field">';A+='<input id="avatarAction" type="hidden" name="action"/>';A+='<input id="avatarUserId" type="hidden" name="userId"/>';A+='<input id="avatarSessionId" type="hidden" name="sessionId"/>';A+='<input id="avatarCs" type="hidden" name="cs"/>';A+='<div style="float: right">';A+='<input type="file" name="avatar" class="file" id="avatarupload" /><br />';A+='<input type="submit" id="submitAvatar" class="nv-button" value="'+_("Upload")+'" /> &nbsp;';A+='<input type="button" id="deleteButton" class="nv-button" value="'+_("Delete")+'" />';A+="</div>";A+='<img src="'+App.getAvatarUrl()+'" alt="" style="float: left" id="avatarImg" />';A+="</p>";A+='<br style="clear: both" />';A+="</form>";this.content.set("html",A);this.attachEvents();return this.content},attachEvents:function(){this.errorMsg=this.content.getElement(".error");this.uploadAvatar()},onShow:function(){var A=this.content.getElement("p.username").empty();if(this.wizard.suggest.length>0){var C=new Element("label",{"for":"usernameSuggest1"}).grab(new Element("input",{id:"usernameSuggest1",type:"radio",name:"suggest",value:this.wizard.suggest[0],checked:"checked",events:{click:this.onRadioUsernameChange.bindWithEvent(this)}})).grab(new Element("span",{text:"netvibes.com/"+this.wizard.suggest[0]})).inject(A)}if(this.wizard.suggest.length>1){var C=new Element("label",{"for":"usernameSuggest2"}).grab(new Element("input",{id:"usernameSuggest2",type:"radio",name:"suggest",value:this.wizard.suggest[1],events:{click:this.onRadioUsernameChange.bindWithEvent(this)}})).grab(new Element("span",{text:"netvibes.com/"+this.wizard.suggest[1]})).inject(A)}if(this.wizard.suggest.length>2){var C=new Element("label",{"for":"usernameSuggest3"}).grab(new Element("input",{id:"usernameSuggest3",type:"radio",name:"suggest",value:this.wizard.suggest[2],events:{click:this.onRadioUsernameChange.bindWithEvent(this)}})).grab(new Element("span",{text:"netvibes.com/"+this.wizard.suggest[2]})).inject(A)}var C=new Element("label",{"for":"usernameCustom",styles:{display:"inline"}});if(this.wizard.suggest.length>0){C.grab(new Element("input",{id:"usernameCustom",type:"radio",name:"suggest",value:"",events:{click:this.onRadioUsernameChange.bindWithEvent(this)}}));this.content.getElement("p.info").hide()}C.grab(new Element("span",{text:"netvibes.com/"})).inject(A);var B=new Element("input",{id:"inputNetvibesID",name:"username","class":"text",events:{focus:this.onFocusCustomUsername.bindWithEvent(this)}}).inject(A)},onFocusCustomUsername:function(){$("usernameCustom").set("checked","checked");this.content.getElement("p.info").show()},onRadioUsernameChange:function(B){var A=this.content.getElement("p.info");switch(B.target.id){case"usernameCustom":A.show();break;default:A.hide();$("inputNetvibesID").value="";break}},validate:function(){if($("usernameCustom").get("checked")){var B=$("inputNetvibesID");var A=B.value.test(/^[a-z0-9][a-z0-9_\-]{1,48}[a-z0-9]$/);if(!A){this.errorMsg.show().set("html",_("Invalid user name"));B.yellowFade()}return A}return true},onPrevStep:function(){this.errorMsg.hide();return true},onNextStep:function(A){if(this.validate()){if($("usernameCustom").get("checked")){var B=this.wizard.getNextButton();B.addClass("wizard-button-disabled");B.getFirst().set("text",_("Loading..."));if(!(this.request&&this.request.running)&&!B.disabled){this.request=new Request({url:"/ajax/user/checkUsername.php",data:$("wizard").toQueryString(),onComplete:this.onRegistered.bind(this)}).post()}}else{return true}}},uploadAvatar:function(){var B=this.content.getElement("input[type=submit]");var G=B.value;var F=this.content.getElement("input[type=button]");var E=F.value;var C=this.content.getElement("iframe");C[Browser.Engine.trident?"onreadystatechange":"onload"]=function(){if(this.readyState&&this.readyState!="complete"){return }if($defined(this.uploaded)){$("avatarImg").src=App.getAvatarUrl();B.value=G;B.disabled=false;F.value=E;F.disabled=false;if($("userProfile")){var H=$("userProfile").style.backgroundImage;$("userProfile").style.backgroundImage=H.substring(0,H.indexOf("?")+1)+Math.round(Math.random()*1000000)+")"}}};var A=this.content.getElement("form");if(A){var D=this.content.getElements("input[type=hidden]");A.onsubmit=function(){D[0].value="upload";D[1].value=Cookie.read("activeUserID");D[2].value=Cookie.read("activeSessionID");D[3].value=Cookie.read("cs");B.value="...";B.disabled=true;F.disabled=true;C.uploaded=true;return true};F.onclick=function(){D[0].value="delete";D[1].value=Cookie.read("activeUserID");D[2].value=Cookie.read("activeSessionID");D[3].value=Cookie.read("cs");B.disabled=true;F.disabled=true;F.value="...";C.uploaded=true;A.submit()}}},onRegistered:function(B){var A=this.wizard.getNextButton();A.removeClass("wizard-button-disabled");A.getFirst().set("text",this.wizard.options.nextStepButtonText);switch(B){case"inuse":this.errorMsg.show().set("html",_("Sorry, this Netvibes ID is already in use. Please try another one."));return false;break;default:this.errorMsg.hide();this.wizard.nextStep();return true;break}}});App.Wizard.Register.UniverseInfos=new Class({initialize:function(A){this.wizard=A},toElement:function(){this.content=new Element("div");var C="";C+='<p class="error" style="display:none"></p>';C+='<p class="field">';C+='<label for="universeTitle">'+_("Title:")+"</label>";C+='<input type="text" id="universeTitle" name="title" class="text" />';C+="</p>";C+='<p class="field">';C+='<label for="universeDescription">'+_("Description:")+"</label>";C+='<textarea id="universeDescription" name="description" class="text" rows="3"></textarea>';C+="</p>";if(App.Panel.AddContent.EcoUniverses){C+='<p class="field">';C+='<label for="universeCateg">'+_("Choose the most appropriate category:")+"</label>";C+='<select id="universeCateg" name="category">';C+='<option value="0" selected="selected">'+_("Choose a category")+"</option>";for(var B=0,A;A=App.Panel.AddContent.EcoUniverses.categories[B++];){C+='<option value="'+A.id+'">'+A.label+"</option>"}C+="</select>";C+='<em class="description"></em>';C+="</p>"}C+='<p class="field">';C+='<label for="universeTags">'+_("Enter descriptive keywords:")+"</label>";C+='<em class="description">('+_("max 6, space separated. E.g. sport football blog")+")</em>";C+='<input type="text" class="text" name="tags" id="universeTags"/><img src="'+App.getStaticUrl("/img/s.gif")+'" width="16" height="16" />';C+="</p>";this.content.set("html",C);this.attachEvents();return this.content},attachEvents:function(){this.errorMsg=this.content.getElement(".error");this.titleField=this.content.getElements("input[type=text]")[0];this.titleField.value=this.wizard.options.initialStatus.universe.title?this.wizard.options.initialStatus.universe.title:"";new Countable(this.titleField,80);this.descriptionField=this.content.getElement("textarea");this.descriptionField.value=this.wizard.options.initialStatus.universe.description?this.wizard.options.initialStatus.universe.description:"";new Countable(this.descriptionField,255);if(App.Panel.AddContent.EcoUniverses){this.content.getElement("select").addEvent("change",this.updateDescription.bindWithEvent(this))}this.tagsInput=this.content.getElements("input[type=text]")[1];this.tagsInput.value=this.wizard.options.initialStatus.universe.keywords?this.wizard.options.initialStatus.universe.keywords:"";this.tagsInput.addEvent("keyup",this.validateTags.bind(this));this.content.getElement("select").value=this.wizard.options.initialStatus.universe.category?this.wizard.options.initialStatus.universe.category:"";this.updateDescription();this.onAccountTypeChange("personnal")},onAccountTypeChange:function(A){if(this.wizard.options.initialStatus.universe.category=="0"){this.content.getElement("select").value=(A=="pro"?"0":"15");this.updateDescription()}},updateDescription:function(D){var B=this.content.getElement("select").value;var E="";for(var C=0,A;A=App.Panel.AddContent.EcoUniverses.categories[C++];){if(A.id==B){E=A.description;break}}this.content.getElement("em.description").set("text",E)},validateTags:function(){var A=this.tagsInput.value.trim().split(" ").length<7;this.tagsInput.getNext().className=A?"valid":"invalid";return A},onFinish:function(){if(this.validateTags()&&this.descriptionField.value.length<=255&&this.titleField.value.length<=80){var A=$("wizard-finish");A.addClass("wizard-button-disabled");A.getFirst().set("text",_("Loading..."));if(!(this.request&&this.request.running)&&!A.disabled){this.request=new Request({url:"/ajax/user/signUp.php",data:$("wizard").toQueryString(),onComplete:this.onRegistered.bind(this)}).post()}}},onRegistered:function(B){switch(B){case"success":Cookie.set("registered",2);document.location.reload();return true;break;case"inuse":this.errorMsg.show().set("html",_("Sorry, this Netvibes ID is already in use. Please try another one."));break;default:this.errorMsg.show().set("html",_("Sorry, an error has occurred. Try again later."));break}var A=$("wizard-finish");A.disabled=false;A.removeClass("wizard-button-disabled");A.getFirst().set("text",this.wizard.options.finishButtonText)}});App.showCreateUniverseWizard=function(){var A=[];A.push({title:_("Your public profile"),content:App.Wizard.Register.ProfileStep});A.push({title:_("Your public address"),content:App.Wizard.Register.NetvibesID});A.push({title:_("Your public page"),content:App.Wizard.Register.UniverseInfos});App.Panel.close();new Request.JSON({method:"get",url:"/ajax/user/getUniverseInfos.php",onComplete:function(B){new App.Wizard(A,{formAction:"/ajax/user/signUp.php",title:_("Create your public page"),initialStatus:$merge({universe:{title:"",description:"",category:"",keywords:"",brand:""},user:{birthday:{year:0,month:0,day:0}}},B)})}}).send()};;
App.UI.Message=new Class({Implements:[Events,Options],options:{title:"",text:"",type:"info",cssId:"messageBox",className:"messageBox",closeButton:{"class":"close actions-window-close",title:_("Close"),width:16,height:16},actionButton:null,appendBR:false,fx:true},initialize:function(A){this.setOptions(A);this.options.fx=(App.pageCustom.enableFx==1)},inject:function(B,A){this.build().inject(B,A);return this},build:function(){this.box=new Element("div",{id:this.options.cssId,"class":this.options.className+" "+this.options.className+"-"+this.options.type,styles:{display:"none"}});if(this.options.fx){this.box.set("tween",{duration:600})}this.content=new Element("div",{"class":"content"}).inject(this.box);if(this.options.title){var E=new Element("h2",{text:this.options.title}).inject(this.content);if(!this.options.text){E.addClass("message")}}if(this.options.text){new Element("p",{"class":"description",html:this.options.text}).inject(this.content)}if(this.options.actionButton){var D=new Element("div",{"class":"action"}).inject(this.box);var C=new Element("div").inject(D);var B=new Element("a",{"class":"nv-button",events:{click:this.onButtonClick.bindWithEvent(this)}}).adopt(new Element("span",{text:this.options.actionButton.text})).inject(C);if(this.options.actionButton.altern){new Element("a",{text:this.options.actionButton.altern.text,"class":"alternAction",events:{click:this.options.actionButton.altern.action.bindWithEvent(this)}}).inject(C)}}if(this.options.closeButton){var A=new Element("img",{src:App.getStaticUrl("/img/s.gif"),events:{click:this.close.bindWithEvent(this)}}).set(this.options.closeButton).inject(this.box,"top");this.box.addClass("messageBox-closable")}return this.box},open:function(){if(this.options.appendBR){this.breakLine=new Element("br").inject(this.box,"after")}if(this.options.fx){this.box.setOpacity(0).show().get("tween",{property:"opacity"}).start(0.99999)}else{this.box.show()}return this.box},close:function(A){if(this.closing===true){return }if(this.options.fx){this.closing=true;this.box.get("tween",{property:"opacity"}).start(0.99999,0).chain((function(){this.box.style.display="none";this.fireEvent("onClose");this.closing=false;if(App.isSmartReader){App.SmartReader.resizeApp()}}).bind(this))}else{this.box.hide();this.fireEvent("onClose");if(App.isSmartReader){App.SmartReader.resizeApp()}}if(this.options.appendBR){this.breakLine.remove()}},setMessage:function(A){this.content.set("html",A);this.fireEvent("onMessageSetted");this.open()},onButtonClick:function(){}});App.UI.Message._instance=null;App.showMessage=function(A){if(null==App.UI.Message._instance){App.UI.Message._instance=new App.UI.Message({text:A}).inject("maintable","top")}App.UI.Message._instance.setMessage(A)};App.messageWithID=function(B,A){if(typeof B!="number"){throw new Error("messageWithID : id is mandatory")}if(!User.custom.announcement){throw new Error("messageWithID : Annouvements array doesn't exist")}if(!$("NV_messageContainer")){new Element("div",{id:"NV_messageContainer"}).inject("divTabs","before")}if(!User.custom.announcement.contains(B)){return new App.UI.Message({cssId:"noteMessage-"+B,className:"noteMessage",id:B,text:A,appendBR:true}).addEvent("onClose",function(){User.custom.announcement.push(B);App.saveUserCustom()}).inject("NV_messageContainer","top").open()}};App.lastMessage=function(C,A,B){if(!$("NV_messageContainer")){new Element("div",{id:"NV_messageContainer"}).inject("divTabs","before")}if(!User.custom.messageId||User.custom.messageId<C){arguments.callee.messageQueue=arguments.callee.messageQueue||[];arguments.callee.messageQueue.push(C);if(B&&C!=arguments.callee.messageQueue[0]){return }return new App.UI.Message({cssId:"noteMessage-"+C,className:"noteMessage",id:C,text:A,appendBR:true}).addEvent("onClose",function(){User.custom.messageId=C;App.saveUserCustom()}).inject("NV_messageContainer","top").open()}};App.UI.Message.WelcomeSimple=new Class({Extends:App.UI.Message,options:{title:_("Welcome to your personalized page!"),text:_("This wizard will help you create your very own start page."),type:"action welcome",closeButton:null,actionButton:{text:_("Start")}},build:function(){var B=this.parent();var E=new Element("a",{text:_("No thanks"),href:"javascript:void(0)",events:{click:this.onDismiss.bindWithEvent(this)}}).inject(B.getElement("div.action"));if(User.isp=="numericable"&&!App.isPremium()){this.box.addClass("welcomeNC");var A=new Element("div",{"class":"partnerMessage"});var D=new Element("div",{"class":"numericableMessage"}).inject(A);D.adopt(new Element("div",{id:"logoNC"}));D.adopt(new Element("h3",{text:"Utilisateur de Numericable"}));D.adopt(new Element("a",{text:"Découvrez le portail Netvibes préparé spécialement pour vous",href:"/partner/numericable.php"}));A.inject(B)}if(!App.registeredUser){var A=new Element("div",{"class":"openMyPage"});A.adopt(new Element("h3",{text:_("You are already registered?")}));A.adopt(new Element("a",{text:_("Sign In"),href:"javascript:void(0)",events:{click:this.onOpenMyPage.bind(this)}}));A.inject(B)}else{var C=B.getElement("div.partnerMessage");if(C){C.style.width="40%";B.getElement("div.content").style.width="40%"}else{B.getElement("div.content").style.width="70%"}}return B},onGoToNC:function(A){A.stop();if(!App.registeredUser){Cookie.get("sessionID")}},onOpenMyPage:function(){App.Login.show()},onDismiss:function(A){App.pageCustom.welcomeMessage="0";App.savePageCustom();if(this.box){this.close()}},onButtonClick:function(){App.showWizardCustomExtended()}});App.UI.Message.WelcomeWizard=new Class({Extends:App.UI.Message,options:{type:"action wizard",closeButton:{"class":"close actions-window-close",title:_("Close"),width:16,height:16,id:"wizard-close"}},wizard:{data:{locale:App.locale}},build:function(){App.report("wizard.step0",{locale:App.locale});var A=this.parent();A.addClass("autoclear");var I=$(A.getElementsByClassName("content")[0]);I.addClass("autoclear");var J=new Element("div",{id:"step1","class":"autoclear",styles:{display:"block"}});J.inject(I);var C="<h2>"+_("Welcome to")+"</h2>";C+='<div class="p">'+_("Your personalized startpage!")+"</div>";C+='<div class="p">'+_("Netvibes is a <strong>free</strong> web service that brings together your favorite media sources and online services.")+"</div>";C+='<div class="p">'+_("Everything that matters to you &#8212; blogs, news, weather, videos, photos, social networks, email and much more &#8212; is automatically updated every time you visit your page.")+"</div>";C+='<br /><div class="p">'+_("Learn more? {0}Take a tour{1}").format('<a href="http://'+NV_TOUR+'">',"</a>")+"</div><br />";if(!User.registered){C+='<div class="p">'+_("Are you already registered?")+' <a href="http://'+NV_HOST+'/signin">'+_("Sign In")+"</a></div>";C+='<div class="p">'+_("Not a member yet?")+" "+_("{0}Sign up{1}, it's free").format('<a href="http://'+NV_HOST+'/signup">',"</a>")+"</div>"}var G=new Element("div",{id:"incipit","class":"wizard-block",html:C}).inject(J);if(!User.registered){G.getElements("a")[1].addEvent("click",function(L){L.stop();App.Login.show()});G.getElements("a")[2].addEvent("click",function(L){L.stop();App.showSignup()})}if(User.isp=="numericable"&&!App.isPremium()){this.box.addClass("welcomeNC");var D=new Element("div",{"class":"partnerMessage"});var E=new Element("div",{"class":"numericableMessage"}).inject(D);E.adopt(new Element("div",{id:"logoNC"}));E.adopt(new Element("h3",{text:"Utilisateur de Numericable"}));E.adopt(new Element("a",{text:"Découvrez le portail Netvibes préparé spécialement pour vous",href:"/partner/numericable.php"}));D.inject(J.getElementsByClassName("wizard-block")[0])}this.interestsStep=new App.Wizard.Custom.Interest(this.wizard);this.interestsStep.content=new Element("div",{"class":"step wizard-block",id:"interestsStep",html:"<h3><strong>1</strong>"+_("Interests")+'</h3><p style="clear: both; padding: 10px 0 0 0">'+_("What do you like on your own?")+'</p><div id="interestsContainer" class="autoclear"><ul class="autoclear wizard-thumbs" id="wizard-categ">'+this.interestsStep.buildCategs()+"</ul></div><div>"+_("We recommend the most popular widget for each category")+"</div>"}).inject(J);this.interestsStep.attachEvents();this.suggestedStep=new App.Wizard.Custom.CustomFinish(this.wizard);this.suggestedStep.content=new Element("div",{"class":"step wizard-block",id:"suggestedStep",html:"<h3><strong>2</strong>"+_("Suggested widgets")+'</h3><p style="clear: both; padding: 10px 0 0 0">'+_("At any time you can add cool new widgets, remove ones you don't want, and update the layout exactly the way you want it.")+'</p><div id="suggestContainer" class="autoclear"></div>'}).inject(J);this.suggestedStep.sponsoredElm=$(this.suggestedStep.content.getElementsByClassName("autoclear")[0]);this.suggestedStep.populate(App.locale);if(Browser.isIE){this.setHomePage=true;new Element("input",{id:"setAsDefaultHomepage",type:"checkbox",checked:"checked",styles:{display:"block","float":"left",marginTop:"10px",marginBottom:"10px",marginRight:"10px"},events:{click:(function(M){var L=(M.target||M.srcElement);this.setHomePage=L.checked}).bindAsEventListener(this)}}).inject(this.suggestedStep.content);new Element("label",{"for":"setAsDefaultHomepage",styles:{display:"block",paddingTop:"10px",cursor:"pointer"},text:_("Set netvibes as my default homepage")}).inject(this.suggestedStep.content)}var H=new Element("div",{id:"wizard-terminal","class":"autoclear",styles:{textAlign:"center",padding:"10px 0",marginTop:"10px",visibility:"hidden"}}).inject(this.suggestedStep.content);var F=new Element("div",{"class":"wizard-footer",html:'<a href="#_" class="wizard-button" id="wizard-finish"><span>'+_("Show me my page")+'</span></a><a href="#_" id="cancelLink">'+_("No thanks, let me try first")+"</strong>"}).inject(J,"bottom");var B=F.getElementsByTagName("a")[1];$(B).addEvent("click",this.close.bindWithEvent(this));var K=F.getElementsByClassName("wizard-button")[0];$(K).addEvent("click",this.completeWizard.bindWithEvent(this));this.wizard.trail=[{step:this.locationStep},{step:this.interestsStep},{step:this.suggestedStep}];this.addEvent("onClose",this.onDismiss.bindWithEvent(this));return A},completeWizard:function(B){if(B){B.stop()}if(Browser.isIE&&this.setHomePage==true){var A=(B.target||B.srcElement);A.style.behavior="url(#default#homepage)";A.setHomePage("http://"+NV_HOST)}this.interestsStep.computeState();this.suggestedStep.onFinish()},onDismiss:function(A){App.pageCustom.welcomeMessage="0";App.savePageCustom();this.close()}});App.UI.Message.SaveYourPage=new Class({Extends:App.UI.Message,options:{title:_("Save your page permanently (and access it anywhere too!)"),type:"action",closeButton:null,actionButton:{text:_("Sign up"),altern:{text:_("Not now"),action:function(){this.close()}}}},onButtonClick:function(){App.showSignup()}});App.UI.Message.ConfirmRegistered=new Class({Extends:App.UI.Message,options:{title:_("Congratulations, you're now registered!"),text:_("Your data are saved! Last step now is to create your public page to publish your own page."),type:"action registered",actionButton:{text:_("Create your public page")}},onButtonClick:function(){App.showCreateUniverseWizard()}});App.UI.Message.FindFriends=new Class({Extends:App.UI.Message,options:{title:_("Congratulations!"),text:_("Your public page is available here: {0}. Invite your friends to discover your digital life.").format('<a href="http://'+NV_HOST+"/"+User.username+'">'+NV_HOST+"/"+User.username+"</a>"),type:"action registered",actionButton:{text:_("Find friends on Netvibes")}},onButtonClick:function(){App.Panel.open("Friends");App.Panel.Friends.tabs.selectTab("addFriends")}});App.noMessageBox={premium:{itv2:true,sweetimus:true,vmn:true,vmnfr:true,skidmoreowingsandmerrill:true,attractabrennan:true,meuig:true,gazetaonline:true,"t-online":true,redbullbrandwatch:true,ijangostart:true}};App.showMessageBox=function(A){App.UI.Message.Welcome=App.UI.Message.WelcomeSimple;if(App.isPremium()&&App.noMessageBox.premium[App.premium.universe]&&(A=="Welcome"||A=="SaveYourPage"||A=="ConfirmRegistered")){if(A=="Welcome"){App.welcomeMessage=new App.UI.Message.WelcomeSimple();App.report("wizard.step0",{locale:App.locale});App.showWizardCustomExtended()}return false}var B=new App.UI.Message[A];if(A=="Welcome"){App.welcomeMessage=B}B.inject("maintable","top").open()};;
App.UI.Preview=new Class({Implements:[Events],initialize:function(D,B){this.isExtended=!!B;if(typeof D=="string"){D=JSON.decode(D)}if(typeof D=="object"){if(D.from){this.from=D.from}if(D.preconfig){this.ajax=new Request.JSON({secure:false,method:"get",url:NV_API_PATH+"/widget/preconfig/"+D.preconfig,onComplete:this.onLoadComplete.bind(this)})}else{if(D.archive){this.ajax=new Request.JSON({secure:false,method:"get",url:NV_API_PATH+"/widget/archive/"+D.archive,onComplete:this.onLoadComplete.bind(this)});this.archiveId=D.archive;this.timelineId=D.timelineId}else{var A=$unlink(D);A.moduleName=D.moduleName||D.name;if(D.campaignActive){var C={ecoId:(A.ecoId||A.widgetId),campaignId:A.campaignId};if(A.fromQuery){C.query=A.fromQuery}if(A.campaignId){C.campaignId=A.campaignId}if(!A.campaignId||A.campaignId==A.ecoId||A.campaignId==A.widgetId){App.report("adc.spon.preview",C)}else{App.report("camp.preview",C)}}this.previewModule=new Module(A,{nativise:true,preview:true})}}}else{throw new Error("App.UI.Preview: constructor needs object or serialized dataObj")}if(this.isExtended){this.ecoInfos=B}return this},open:function(){var A=function(){B.interval=setInterval(function(){B.reposition()},1000)};var B=SqueezeBox.fromElement(this.build(),{handler:"adopt",offsetTop:100,size:{x:(this.isExtended?690:400),y:null},forcePosition:App.isPremium()?$("nv-panel-closebar").getPosition():null,onOpen:A,onClose:function(){clearInterval(this.interval)}});return this},build:function(){var A=new Element("div",{"class":(this.isExtended?"nv-previewExt autoclear":"nv-preview")});var F=new Element("div",{"class":"header"}).inject(A);this.widget=new Element("div",{"class":"widgetPanel"}).inject(A);this.infosPanel=new Element("div",{"class":"infosPanel"}).inject(A);if(this.isExtended){var C=this.ecoInfos.rating||0;var E=Math.round(C*100/5);var D='<div class="autoclear"><strong>'+this.ecoInfos.title+"</strong>";D+=' <span class="rating"><span style="width: '+E+'%">'+_("rating")+" : "+C+"/5</span></span></div>";if(this.ecoInfos.totalInstalled){D+=' <div class="preview-totalInstall">'+_("Total installed")+" : "+this.ecoInfos.totalInstalled+"</div>"}new Element("div").set("html",D).inject(this.infosPanel)}if(!App.visit||App.visit.my){var B=this.archiveId?_("Restore this widget"):_("Add to my page");this.button=new Element("a",{"class":"add-button",href:"javascript:void(0)",text:B,events:{click:App.isSmartReader?$empty:this.onAddToMyPage.bindWithEvent(this)}}).inject(this.isExtended?this.infosPanel:F)}if(App.isSmartReader){this.buildTabSelection().inject(this.button)}if(this.isExtended){F.set("text",_("Widget preview"));new Element("p",{text:this.ecoInfos.description}).inject(this.infosPanel)}if(this.ajax){this.widget.wait();this.ajax.send()}else{this.displayPreview()}return A},onLoadComplete:function(B){var A=$unlink(B.widget);A.moduleName=A.name;if(this.from){A.from=this.from}this.previewModule=new Module(A,{nativise:true,preview:true});this.widget.empty();this.displayPreview();delete this.ajax;this.ajax=null},displayPreview:function(){if(!this.previewModule){throw new Error("App.UI.Preview: invalid widget instance")}this.previewModule.inject(this.widget).load()},buildTabSelection:function(){if(!App.isSmartReader){return }var C=new Element("ul",{id:"preview-tabSelector"});for(var A=0,B;B=App.SmartReader.data.sectionsOrder[A++];){var D=App.SmartReader.data.sections["section-"+B];new Element("li",{text:D.title,id:"addToTab-"+D.id}).addEvent("click",this.onAddToSection.bindWithEvent(this)).inject(C)}return C},onAddToSection:function(B){var A;if(B.target){A=B.target.id.match(/addToTab-(\d+)/)[1]}this.onAddToMyPage(B,A)},onAddToMyPage:function(C,B){C.stop();var B=B;var A=function(){if(this.previewModule.dataObj.moduleName.match("MailWizard|SocialWizard")){var D=this.previewModule.elm_module.retrieve("widget");if(D){this.previewModule=D}}if(!this.previewModule.addModuleToPage(B)){return }App.moduleList.push(this.previewModule);delete this.previewModule.dataObj.row;if(this.archiveId){App.Request.saveUserData("module.restore",{data:{id:this.archiveId,timelineId:this.timelineId,tid:B||App.selectedTab}})}else{App.Modules.store(this.previewModule,App.isSmartReader?App.SmartReader.data.addModule:$empty)}delete this.previewModule;this.previewModule=null;this.fireEvent("addToMyPage")}.bind(this);if(App.pageCustom.enableFx=="1"){SqueezeBox.addEvent("onClose",function(E){var D=E.getParent();new Fx.Morph(D,{duration:"normal",transition:Fx.Transitions.Sine.easeOut}).start({opacity:0,top:document.getSize().y/2}).addEvent("onComplete",function(F){D.setStyles({display:"none",opacity:0.99999});A()})});SqueezeBox.setOptions({hideOnClose:false})}else{A()}SqueezeBox.close(C)}});;
App.UI.ConfirmDialog=new Class({Implements:[Events,Options],options:{titleText:"",message:"",confirm:{text:_("Yes"),requestText:"",successText:""},discard:{text:_("No"),requestText:"",successText:""},cancelText:_("Cancel"),className:"modal confirmDialog",fx:(App.pageCustom.enableFx==1),autoFadeDelay:1500,width:500},initialize:function(A){this.setOptions(A)},show:function(){SqueezeBox.fromElement(this.build(),{handler:"adopt",classWindow:this.options.className,closeWithOverlay:false,fxOverlayDuration:0,fxResizeDuration:0,onOpen:function(){this.fireEvent("onOpen");try{this.confirmButton.focus()}catch(A){}}.bind(this),onClose:function(){this.fireEvent("onClose")}.bind(this),size:{x:this.options.width,y:"auto"}});return this},onConfirm:function(A){if(this.ajax&&this.ajax.running){return }this.confirmButton.addClass("action");if(this.discardButton){this.discardButton.addClass("disabled").set("disabled","disabled")}if(this.cancelButton){this.cancelButton.addClass("disabled").set("disabled","disabled")}if(this.options.confirm.requestText!=""){this.confirmButton.value=this.options.confirm.requestText;this.options.discard.successText="";this.ajax=App.Request.newRequest({method:"post",onComplete:this.onDialogComplete.bind(this)});this.fireEvent("onConfirmRequest")}else{this.fireEvent("onConfirm");SqueezeBox.close()}A.stop()},onDiscard:function(A){this.discardButton.addClass("action");this.confirmButton.addClass("disabled").set("disabled","disabled");if(this.cancelButton){this.cancelButton.addClass("disabled").set("disabled","disabled")}if(this.options.discard.requestText!=""){this.discardButton.value=this.options.discard.requestText;this.options.confirm.successText="";if(this.ajax&&this.ajax.running){this.ajax.cancel();return }this.ajax=App.Request.newRequest({method:"post",onComplete:this.onDialogComplete.bind(this)});this.fireEvent("onDiscardRequest")}else{this.fireEvent("onDiscard");SqueezeBox.close()}A.stop()},onDialogComplete:function(){var A="";A+='<p style="margin-bottom: 1em;">'+(this.options.confirm.successText||this.options.discard.successText)+"</p>";this.body.setHTML(A);if(this.cancelButton){this.cancelButton.addClass("nv-primary-button").setProperty("disabled",false).value=_("Close")}if(this.confirmButton){this.confirmButton.destroy()}if(this.discardButton){this.discardButton.destroy()}if(!this.options.autoFadeDelay){return }(function(){if(this.options.fx){var B=new Fx.Tween(SqueezeBox.win,"opacity",{duration:1000,onComplete:function(){SqueezeBox.close();SqueezeBox.win.set("opacity",1)}}).start(0)}else{SqueezeBox.close()}}).delay(this.options.autoFadeDelay,this)},build:function(){var B=new Element("div",{"class":"frame"});var A=new Element("h2",{"class":"title",text:this.options.titleText}).inject(B);this.body=new Element("div",{"class":"body",html:this.options.message}).inject(B);var C=new Element("div",{"class":"footer"}).inject(B);this.confirmButton=new Element("input",{type:"button","class":"nv-button nv-primary-button yes",value:this.options.confirm.text,events:{click:this.onConfirm.bindWithEvent(this)}}).inject(C);if(this.options.discard&&this.options.discard.text){this.discardButton=new Element("input",{type:"button","class":"nv-button no",value:this.options.discard.text,events:{click:this.onDiscard.bindWithEvent(this)}}).inject(C)}if(this.options.cancelText){this.cancelButton=new Element("input",{type:"button","class":"nv-button cancel",value:this.options.cancelText,events:{click:function(){SqueezeBox.close()}}}).inject(C)}return B}});App.UI.ConfirmDialog.DeleteWidget=new Class({Extends:App.UI.ConfirmDialog,options:{confirm:{text:_("Delete forever"),requestText:_("Deleting..."),successText:_("The widget has been deleted.")},discard:{text:_("Archive this widget"),requestText:_("Archiving..."),successText:""},width:600},initialize:function(B,A){this.options.titleText=B.dataObj.title;this.options.discard.successText=_("The widget has been archived in your private activity.");this.addEvents({onOpen:function(){B.elm_module.addClass("kbdFocus")},onClose:function(){B.elm_module.removeClass("kbdFocus")},onConfirmRequest:this.onConfirmRequest.bind(this),onDiscardRequest:this.onDiscardRequest.bind(this)});this.module=B;var C="";C+="<p>"+_("Are you sure you want to delete this widget?")+"</p>";C+='<p style="margin-top: 1em;">'+_("You can also archive this widget in your private activity and restore it later.")+"</p>";A.message=C;this.parent(A)},onConfirmRequest:function(){if(this.ajax.running){return }this.ajax=App.Request.saveUserData("module.close",{data:{id:this.module.dataObj.id,name:this.module.dataObj.moduleName},onComplete:function(A){this.onDialogComplete(A);this.module.fireEvent("remove",{id:this.module.dataObj.id})}.bind(this)})},onDiscardRequest:function(){if(this.ajax.running){return }this.ajax=App.Request.saveUserData("module.archive",{data:{id:this.module.dataObj.id,name:this.module.dataObj.moduleName},onComplete:this.onDialogComplete.bind(this)})}});;
App.UI.FriendsViewer=new Class({Implements:[Events,Options],options:{user:"my",display:"list",path:NV_API_PATH+"/account",type:"subscriptions",params:""},initialize:function(A){this.setOptions(A);this.container=new Element("div",{id:"nv-subscriptions"});this.container.adopt(new Element("ul",{"class":"subscriptions"}));if(this.options.type=="search"||this.options.type=="find"){this.options.params="?"+Hash.toQueryString(this.options.params)}else{this.options.path+="/"+(this.options.user||"my")}},inject:function(B){$(B).empty().adopt(this.container);if(this.options.type=="find"){var D=this.container.getElement("p.loading");if(D){D.wait(null,{left:"60%"})}}var A={requestUrl:this.options.path+"/"+this.options.type+this.options.params,responseParams:{},onPageChange:this.onPageChange.bind(this),layout:{container:this.container,itemWidth:156,numRows:2}};var C={subscriptions:{items:"friends",total:"numFriends"},followers:{items:"followers",total:"pagerTotal"},blockedFollowers:{items:"followers",total:"pagerTotal"},search:{items:"results",total:"numResults"},find:{items:"results",total:"numResults"}};A.responseParams=C[this.options.type];this.multiPage=new Netvibes.UI.MultiPage.JSON(A).hide().inject(this.container);this.container.wait(this.multiPage.ajax,{notEmpty:true});return this},onPageChange:function(E){if(typeof E.error!="undefined"){new Element("p",{"class":"empty"}).set("text",E.error).injectBefore(this.container.getElement("ul"));return }var B=E.page.total;var H=E.items;var G={};if(this.options.path.test("my")){G.followers=_("A follower is someone who read your public activity updates.");G.followers+=" "+_("You have no followers yet.");G.subscriptions=_("You did not add anyone to your contacts yet.");G.subscriptions+='<a id="gotoSearchForFriends" href="javascript:void(0)"> '+_("Click here to search for friends who use Netvibes.")+"</a>";G.blockedFollowers=_("You have no blocked followers yet.")}else{G.followers=_("No followers yet");G.subscriptions=_("No friends yet");G.blockedFollowers=_("No blocked followers yet")}if(B>0){var J=this.container.getElement("p.empty");if(J){J.destroy()}var A=(H.length>this.multiPage.options.perRequest)?this.multiPage.options.perRequest:H.length;var F=$(this.container.getElementsByTagName("ul")[0]).empty();for(var D=0,C=A;D<C;D++){F.adopt(this.buildItem(H[D]))}this.multiPage.show()}else{new Element("p",{"class":"empty"}).setHTML(G[this.options.type]||_("No results.")).injectBefore(this.container.getElement("ul"));var I=$("gotoSearchForFriends");if(I){I.onclick=function(){App.Panel.Friends.tabs.selectTab("addFriends");return false}}}},buildItem:function(D){var I=new Element("li",{"class":"subscription"}).store("friendId",D.id);var G=new Element("a",{"class":"friend",rel:"friend"}).inject(I);if(D.id){G.href="http://"+NV_HOST+"/"+D.username}var E=D.id?"http://"+NV_AVATARS+"/"+D.id+"/48":App.getStaticUrl("/img/avatar-default-48.png");var B=new Element("img",{src:App.getStaticUrl("/img/s.gif"),"class":"photo",styles:{"background-image":"url("+E+")","background-repeat":"no-repeat"}}).inject(G);var H=new Element("span",{"class":"nickname",title:D.displayName}).set("text",D.id?D.displayName.truncate(20):D.displayName).inject(G);I.store("data",D);if(D.id&&D.id!=User.id){var C=new Element("a",{href:"javascript:void(0)","class":"nv-button"}).inject(I);if(this.options.type=="blockedFollowers"){C.set("text",_("Unblock"));C.set("title",_("Unblock follower"));C.onclick=this.onFollowerUnblocking.bindWithEvent(this)}else{if(D.isFriend){I.addClass("following");C.addClass("remove");C.set("text",_("Remove"));C.set("title",_("Remove friend"));C.onclick=this.onFriendRemoving.bindWithEvent(this)}else{C.set("text",_("Add"));C.set("title",_("Add friend"));if(D.isBlocked==true){C.style.color="#AAA";C.onclick=function(K){var J=new Event(K);J.stop();alert("You can't add this user because you have blocked him.")}}else{if(D.amIBlocked==true){C.style.color="#AAA";C.onclick=function(K){var J=new Event(K);J.stop();alert("You can't add this user because he has blocked you.")}}else{C.onclick=this.onFriendAdding.bindWithEvent(this)}}}if(D.isFollower){var F=new Element("a",{href:"javascript:void(0)","class":"nv-button block-button",title:_("Block Follower"),styles:{display:"none"},events:{click:this.onFollowerBlocking.bindWithEvent(this)}}).inject(I);I.onmouseover=function(){var J=this.getElementsByClassName("block-button");if(J.length){J[0].style.display="block"}};I.onmouseout=function(){var J=this.getElementsByClassName("block-button");if(J.length){J[0].style.display="none"}}}}I.title=D.displayName;I.username=D.username;I.onclick=this.onItemClick.bindWithEvent(this);var A={moduleName:"FriendActivities",title:String.format(_("Netvibes - {0}"),D.displayName),data:{userId:D.id,fixedUserId:"true"}};App.Panel.draggableItem(I,A)}return I},onItemClick:function(B){var A=Event.findElement(B,"LI");this.fireEvent("onItemClick",A);return false},onFriendRemoving:function(C){var B=new Event(C);B.stop();this.removeButton=$(B.target);if(this.removeButton.hasClass("removing")){return false}this.friendId=this.removeButton.getParent().retrieve("friendId");if(window.confirm(_("Remove friend from contacts?"))){this.removeButton.addClass("removing");var A=new Request.JSON({secure:false,onComplete:this.onFriendRemoved.bind(this)}).post(NV_API_PATH+"/account/subscription/delete/"+this.friendId)}},onFriendRemoved:function(B){var A=new Element("span",{"class":B.success?"ajaxSuccess":"ajaxError"}).set("text",B.success?_("Removed"):_("Error")).injectAfter(this.removeButton);this.removeButton.remove();if(B.success&&User.numFriends){User.numFriends=B.numFriends}this.fireEvent("onRemove",this.friendId)},onFriendAdding:function(C){var B=new Event(C);B.stop();this.addButton=B.target;if(this.addButton.hasClass("adding")){return false}this.friendId=this.addButton.getParent().retrieve("friendId");this.addButton.addClass("adding");var A=new Request.JSON({secure:false,onComplete:this.onFriendAdded.bind(this)}).post(NV_API_PATH+"/account/subscription/add/"+this.friendId)},onFriendAdded:function(B){var A=new Element("span",{"class":B.success?"ajaxSuccess":"ajaxError"}).set("text",B.success?_("Added"):_("Error")).injectAfter(this.addButton);this.addButton.remove();if(B.success&&User.numFriends){User.numFriends=B.numFriends}this.fireEvent("onAdd",this.friendId)},onFollowerBlocking:function(C){var B=new Event(C);B.stop();this.blockButton=B.target;if(this.blockButton.hasClass("blocking")){return false}this.friendId=this.blockButton.getParent().retrieve("friendId");this.blockButton.addClass("blocking");var A=new Request.JSON({secure:false,onComplete:this.onFollowerBlocked.bind(this)}).post(NV_API_PATH+"/account/subscription/block/"+this.friendId)},onFollowerBlocked:function(B){if(this.options.user=="my"){this.blockButton.getParent().hide()}else{var A=this.blockButton.getParent().getElementsByClassName("nv-button")[0];if(A.hasClass("add")){A.style.color="#AAA";A.onclick=function(D){var C=new Event(D);C.stop();alert("You can't add this user since you have blocked him.")}}else{A.onclick=function(D){var C=new Event(D);C.stop();alert("You can't add this user since you have blocked him.")}}this.blockButton.remove()}if(B.success){User.numFriends=B.numFriends;User.numFollowers=B.numFollowers;User.numBlockedFollowers=B.numBlockedFollowers}this.fireEvent("onBlock",this.friendId)},onFollowerUnblocking:function(C){var B=new Event(C);B.stop();this.unblockButton=B.target;if(this.unblockButton.hasClass("unblocking")){return false}this.friendId=this.unblockButton.getParent().retrieve("friendId");this.unblockButton.addClass("unblocking");var A=new Request.JSON({secure:false,onComplete:this.onFollowerUnblocked.bind(this)}).post(NV_API_PATH+"/account/subscription/unblock/"+this.friendId)},onFollowerUnblocked:function(A){this.unblockButton.getParent().hide();if(A.success){User.numFollowers=A.numFollowers;User.numBlockedFollowers=A.numBlockedFollowers}this.fireEvent("onUnblock",this.friendId)}});;
App.UI.EditStatus=new Class({initialize:function(A,B,C){this.displayName=A||"";this.statusText=B||"";this.statusDate=String.parseRelativeTime(C,1)||"";this.container=new Element("div",{"class":"status"});this.buildQuote()},buildQuote:function(){this.container.empty();new Element("p").adopt(new Element("cite").setHTML(this.displayName+"...")).inject(this.container);this.blockquote=new Element("blockquote").adopt(new Element("p").set("text",(this.statusText=="")?_("Type your status here"):this.statusText)).inject(this.container);this.blockquote.onmouseover=function(){this.addClass("hover");return false};this.blockquote.onmouseout=function(){this.removeClass("hover");return false};var A=new Element("div",{"class":"bottom"}).inject(this.container);if(this.statusText!=""){var C=new Element("span",{"class":"date"}).set("text",this.statusDate).inject(A)}else{this.blockquote.addClass("empty");this.blockquote.addEvent("click",this.buildEdit.bind(this))}var B=new Element("input",{type:"button","class":"nv-button nv-primary-button",styles:{display:"inline"},value:_("Update your status")}).inject(A);B.addEvent("click",this.buildEdit.bind(this));if(this.statusText!=""){var D=new Element("input",{type:"button","class":"nv-button",styles:{display:"inline"},value:_("Reset")}).inject(A);D.addEvent("click",this.onResetting.bind(this))}},buildEdit:function(){this.container.empty();new Element("p").adopt(new Element("cite").setHTML(this.displayName+"...")).inject(this.container);var A=new Element("textarea",{col:70,rows:3}).set("text",this.statusText).inject(this.container);new Countable(A,150);var B=new Element("div",{"class":"bottom"}).inject(this.container);var C=new Element("input",{type:"button","class":"nv-button nv-primary-button",styles:{display:"inline"},value:_("Save")}).inject(B);var D=new Element("input",{type:"button","class":"nv-button",styles:{display:"inline"},value:_("Cancel")}).inject(B);C.addEvent("click",this.onUpdating.bind(this));D.addEvent("click",this.buildQuote.bind(this));A.addEvent("keydown",this.onUpdating.bind(this))},onResetting:function(C){C.target.disabled=true;var A=new Request.JSON({secure:false,onComplete:this.onResetted.bind(this)}).post(NV_API_PATH+"/timeline/create",{type:1,reset:1});var B=$("userProfile").getParent("li");B.store("tip:text",_("Your personal information and status")).store("tip:title","")},onResetted:function(){this.statusText="";this.buildQuote()},onUpdating:function(D){if(D.type=="keydown"&&D.code!=Event.Keys.enter){return true}D.target.disabled=true;var A=$(this.container.getElementsByTagName("textarea")[0]).get("value");if(A.trim()==""||A.trim()==this.statusText.trim()){return false}this.statusText=A.stripTags();var B=new Request.JSON({secure:false,onComplete:this.onUpdated.bind(this)}).post(NV_API_PATH+"/timeline/create",{type:1,data:A});var C=$("userProfile").getParent("li");C.store("tip:text",A).store("tip:title","");return false},onUpdated:function(A){this.statusDate=String.parseRelativeTime(A.date,1)||"";this.buildQuote()},inject:function(A){$(A).adopt(this.container);return this}});;
App.UI.Profile=new Class({Implements:[Events,Options],options:{enableBack:true,redirectUniverse:false},initialize:function(B,A){this.setOptions(A);this.container=B;this.options.redirectUniverse=(App.visit&&App.visit.id&&!App.visit.my)},show:function(A,B){this.profileId=A;if(this.profileId=="my"||this.options.redirectUniverse){this.options.enableBack=false}App.Panel.element.hide();this.container.show();this.profile=new Element("div",{"class":"profile"}).inject(this.container).wait();App.UI.Profile.request=new Request({onComplete:function(C){if(typeof B=="function"){B()}this.build(C)}.bind(this)}).get(NV_API_PATH+"/account/"+A+"/profile",{format:"json"})},build:function(D){delete App.UI.Profile.request;App.UI.Profile.request=null;var O=JSON.decode(D);if(!O||!O.success){this.container.innerHTML="<p>This profile can not be displayed. Please try again later.<p>";return false}var K="";var E="http://"+NV_AVATARS+"/"+O.id+"/64";K+='<div class="vcard">';if(this.options.enableBack){K+='<a class="profileBack" rel="back" href="javascript:void(0)"><span>'+_("Back")+"</span></a>"}K+='<p><img src="'+E+'" width="64" height="64" alt="" class="photo" /></p>';var M=O.profile.displayName||O.username;K+='<h2 class="fn nickname">'+M+"</h2>";var Q=(O.profile.status&&O.profile.status.text)||"";if(Q.length&&this.profileId!="my"){K+='<p class="status"><em title="'+String.parseRelativeTime(O.profile.status.date,1)+'">'+Q+"</em></p>"}var A="http://"+NV_HOST+"/";K+='<table class="profile" cellspacing="0" cellpadding="0">';if(O.username){A="http://"+NV_HOST+"/"+O.username;K+="<tr><th>"+_("Universe:")+'</th><td><a href="'+A+'" rel="universe" class="fn url" title="netvibes.com/'+O.username+'">netvibes.com/'+O.username+"</a></td>"}if(!O.brand){if(O.profile.birthday){K+="<tr><th>"+_("Birthday:")+'</th><td class="bday">'+O.profile.birthday+"</td></tr>"}if(O.profile.gender){K+="<tr><th>"+_("Sex:")+"</th><td>"+((O.profile.gender=="female")?_("Female"):_("Male"))+"</td></tr>"}if(O.profile.location){K+="<tr><th>"+_("Location:")+'</th><td><span class="locality">'+O.profile.location+"</span></td></tr>"}}K+="</table>";if(O.activated){K+="<p>";if(O.myProfile){K+='<a href="/account/profile" class="nv-button">'+_("Edit my profile")+"</a>"}else{if(O.isBlocked){K+='&nbsp;<a href="javascript:void(0)" class="unblockFollowerButton nv-button">'+_("Unblock follower")+"</a>"}else{if(O.isFriend){K+='<a href="javascript:void(0)" class="removeFriendButton nv-button">'+_("Remove friend")+"</a>"}else{K+='<a href="javascript:void(0)" class="addFriendButton nv-button">'+_("Add friend")+"</a>"}if(O.isFollower){K+='&nbsp;<a href="javascript:void(0)" class="blockFollowerButton nv-button">'+_("Block follower")+"</a>"}}}var G=NV_API_PATH+"/account/"+O.profile.username+"/timeline?format=atom";K+='<span id="profileFeed" class="widget feed"><img class="icon" src="/img/feed.png"><a class="title" href="'+G+'">'+_("Feed")+"</a></span>";K+="</p>"}K+="</div>";this.profile.setHTML(K).inject(this.container);this.profileViewer=new Element("div",{"class":"profileViewer"}).inject(this.profile);if(this.profileId!="my"){new Element("h2").set({html:_("About ")+M}).inject(this.profileViewer)}if(O.activated){$("profileFeed").store("dataObj",{moduleName:"RssReader",title:O.profile.displayName,data:{feedUrl:G}}).store("richIcon","http://eco.netvibes.com/img/thumbnail/ginger/nopreview-64-48.png.feed.png");App.Panel.AddContent.attachWidgetEvents()}this.fireEvent("onShow");if(this.profileId!="my"){this.tabView=new Netvibes.UI.TabView({classTabList:"categoryList",classTabContent:"categoryContent"});$(this.tabView.addTab("activities",{text:_("Activities")})).addClass("category");$(this.tabView.addTab("friends",{text:""})).addClass("category").getFirst().setHTML(_("Friends")+" <em>"+O.numFriends+"</em>");if(this.profileId!="netvibes"&&this.profileId!="38015702"){$(this.tabView.addTab("followers",{text:""})).addClass("category").getFirst().setHTML(_("Followers")+" <em>"+O.numFollowers+"</em>")}this.tabView.observe("activeTabChange",this.onActiveTabChanged.bind(this));this.tabView.appendTo(this.profileViewer);this.onActiveTabChanged("activities")}else{var B=new Element("div",{"class":"tabContent"}).inject(this.profile);var R=new Element("h2").set("text",_("Update your status")).inject(B);var J=new App.UI.EditStatus(M,Q,(O.profile.status&&O.profile.status.date)||null).inject(B)}var C=this.profile.getElementsByClassName("photo")[0];if(C){var L={moduleName:"FriendActivities",title:String.format(_("Netvibes - {0}"),O.profile.displayName),data:{userId:O.profile.id,fixedUserId:"true",selfMode:this.profileId!="my"?false:true,activeTab:"UserFriendTimeline"}};App.Panel.draggableItem(C,L)}var N=this.profile.getElementsByClassName("profileBack")[0];if(N){N.addEvent("click",function(){this.fireEvent("onBack")}.bind(this))}var H=this.profile.getElementsByClassName("addFriendButton")[0];if(H){if(O.amIBlocked){H.style.color="#AAA";H.onclick=function(T){var S=new Event(T);S.stop();alert("You can't add this user because he has blocked you.")}}else{H.onclick=this.onFriendAdding.bindWithEvent(this)}}var P=this.profile.getElementsByClassName("removeFriendButton")[0];if(P){P.onclick=this.onFriendRemoving.bindWithEvent(this)}var I=this.profile.getElementsByClassName("unblockFollowerButton")[0];if(I){I.onclick=this.onFollowerUnblocking.bindWithEvent(this)}var F=this.profile.getElementsByClassName("blockFollowerButton")[0];if(F){F.onclick=this.onFollowerBlocking.bindWithEvent(this)}},onActiveTabChanged:function(C,E){var B=$(this.tabView.getTabContent(C));if(B.retrieve("loaded")){return }var A=this;B.empty();switch(C){case"friends":var F=new App.UI.FriendsViewer({user:this.profileId,type:"subscriptions"}).inject(B);F.addEvent("onItemClick",function(G){if(A.options.redirectUniverse){window.location.href="http://"+NV_HOST+"/"+G.username}else{if(G.hasClass("loading")){return false}var H=G.addClass("loading").retrieve("friendId");App.Panel.showProfile(H);return false}});break;case"followers":var F=new App.UI.FriendsViewer({user:this.profileId,type:"followers"}).inject(B);F.addEvent("onItemClick",function(G){if(A.options.redirectUniverse){window.location.href="http://"+NV_HOST+"/"+G.username}else{if(G.hasClass("loading")){return false}var H=G.addClass("loading").retrieve("friendId");App.Panel.showProfile(H);return false}});break;case"activities":default:var D=new Netvibes.UI.Timeline({id:"profileTimeline",search:"user:"+this.profileId,showFilters:true});D.getElement().inject(B);break}if(!Browser.isIE){B.store("loaded",true)}},onFriendRemoving:function(C){var B=new Event(C);this.removeButton=B.target;if(this.removeButton.hasClass("removing")){return false}if(window.confirm(_("Remove friend from contacts?"))){this.removeButton.addClass("removing");var A=new Request.JSON({secure:false,onComplete:this.onFriendRemoved.bind(this)}).post(NV_API_PATH+"/account/subscription/delete/"+this.profileId)}},onFriendRemoved:function(B){var A=new Element("span",{"class":B.success?"ajaxSuccess":"ajaxError"}).set("text",B.success?_("Removed"):_("Error")).injectAfter(this.removeButton);this.removeButton.remove();if(B.success&&User.numFriends){User.numFriends=B.numFriends}this.fireEvent("onRemove",this.profileId)},onFriendAdding:function(C){var B=new Event(C);this.addButton=B.target;if(this.addButton.hasClass("removing")){return false}this.addButton.addClass("removing");var A=new Request.JSON({secure:false,onComplete:this.onFriendAdded.bind(this)}).post(NV_API_PATH+"/account/subscription/add/"+this.profileId)},onFriendAdded:function(B){var A=new Element("span",{"class":B.success?"ajaxSuccess":"ajaxError"}).set("text",B.success?_("Added"):_("Error")).injectAfter(this.addButton);this.addButton.remove();if(B.success&&User.numFriends){User.numFriends=B.numFriends}this.fireEvent("onAdd",this.profileId)},onFollowerBlocking:function(C){var B=new Event(C);B.stop();this.blockButton=B.target;if(this.blockButton.hasClass("blocking")){return false}this.blockButton.addClass("blocking");var A=new Request.JSON({secure:false,onComplete:this.onFollowerBlocked.bind(this)}).post(NV_API_PATH+"/account/subscription/block/"+this.profileId)},onFollowerBlocked:function(B){var A=new Element("span",{"class":B.success?"ajaxSuccess":"ajaxError"}).set("text",B.success?_("Blocked"):_("Error")).injectAfter(this.blockButton);this.blockButton.remove();if(B.success){User.numFollowers=B.numFollowers;User.numBlockedFollowers=B.numBlockedFollowers}this.fireEvent("onBlock",this.friendId)},onFollowerUnblocking:function(C){var B=new Event(C);B.stop();this.unblockButton=B.target;if(this.unblockButton.hasClass("unblocking")){return false}this.unblockButton.addClass("unblocking");var A=new Request.JSON({secure:false,headers:{"X-Requested-Method":"delete"},onComplete:this.onFollowerUnblocked.bind(this)}).post(NV_API_PATH+"/account/subscription/unblock/"+this.profileId)},onFollowerUnblocked:function(B){var A=new Element("span",{"class":B.success?"ajaxSuccess":"ajaxError"}).set("text",B.success?_("Unblocked"):_("Error")).injectAfter(this.unblockButton);this.unblockButton.remove();if(B.success){User.numFollowers=B.numFollowers;User.numBlockedFollowers=B.numBlockedFollowers}this.fireEvent("onUnblock",this.friendId)}});;
App.Panel={closeButton:null,element:null,current:"",profileViewer:null,initialize:function(){for(var B=0,A=$("top").getElements("a"),C;C=A[B];B++){if(C.hasClass("disabled")){continue}if(!C.rel.length){continue}$(C).addEvent("click",function(D){App.Panel.toggle(this.rel);App.Panel.setActiveTopBar(this);D.stop();return false})}this.panel=new Element("div",{id:"nv-panel","class":"autoclear"}).hide().injectAfter("top");this.element=new Element("div",{id:"nv-panel-content"}).inject(this.panel);this.profiles=new App.Panel.ProfilesStack().inject(this.panel);this.closeBar=new Element("a",{id:"nv-panel-closebar","class":"nv-panel-closebar",rel:"close",title:_("Close")}).hide().injectAfter(this.panel);new Element("img",{src:App.getStaticUrl("/img/s.gif")}).injectInside(this.closeBar);this.closeBar.addEvent("click",this.close.bind(this))},toggle:function(A){if(this.current!=A&&this._open){this.open(A)}else{this[this._open===true?"close":"open"](A)}},open:function(A){switch(A){case"AddContent":App.report("click.adc",{locale:App.locale});break;case"Timeline":App.report("click.adc.activities",{locale:App.locale});break;case"Friends":App.report("click.adc.contacts",{locale:App.locale});break;case"Profile":App.report("click.adc.profile",{locale:App.locale});break}this.profiles.reset().hide();this.panel.show();this.element.show();this.closeBar.show();if(A=="SignIn"||(this.element.loaded===false)||(this.current!=A&&typeof this[A]!=undefined)){this.current=A;this[A].onShow();this.element.loaded=true}this.addCloseButton();this._open=true;if(App.ColManager){App.ColManager.updateLayout()}if(App.isSmartReader){$(document.body).setStyle("overflow","auto");var B=$("footer");if(B){B.setStyle("position","relative")}}},showProfile:function(A,C,B){if(!this._open){this.open("Friends")}this.profiles.addProfile(A,C,B)},close:function(){this.removeCloseButton();this.setActiveTopBar(false);this.panel.hide();this.closeBar.hide();this._open=false;if(App.isSmartReader){App.SmartReader.resizeApp();$(document.body).setStyle("overflow","hidden");var A=$("footer");if(A){A.setStyle("position","absolute")}}},addCloseButton:function(){if(this.closeButton){return }this.closeButton=new Element("img",{id:"panelCloseButton",src:App.getStaticUrl("/img/s.gif"),title:_("Close")}).inject(this.element);this.closeButton.onclick=App.Panel.close.bind(this)},removeCloseButton:function(){if(this.closeButton&&this.closeButton.parentNode){Element.remove(this.closeButton);this.closeButton=null}}};App.Panel.setActiveTopBar=function(A){$("top").getElements(".active").removeClass("active");if(A&&A.rel!="MyUniverse"&&App.Panel._open){$(A.parentNode).addClass("active")}};App.Panel.wait=function(A){if(typeof A=="undefined"){A=this.element}A.innerHTML='<div class="loading">'+_("Loading...")+"</div>"};App.Panel.askForSignIn=function(){var A='<div class="registernotice">';A+="<h2>"+_("You must first register to netvibes in order access this feature")+"</h2>";A+='<p><input id="signupNow" type="button" class="nv-button" value="'+_("Sign up")+'" /></p>';A+="</div>";App.Panel.element.innerHTML=A;$("signupNow").onclick=function(){window.location.href="/signup";return false}};App.Panel.SignIn={};App.Panel.SignIn.onShow=function(){App.Panel.element.empty().adopt($("nv-signin"));App.Login.attachSignInEvents()};App.Panel.buildSearchForm=function(A,D){var D=$merge({value:null},D);var F=new Element("form",{style:"position:relative"});F.onsubmit=function(){return false};var E=function(I){if(I&&I.type=="keydown"&&I.key!="enter"){return true}if(G.value.trim()==""||G.value==D.value){return }arguments.callee.queue=arguments.callee.queue||0;if(arguments.callee.queue>0){return }++arguments.callee.queue;setTimeout(function(){this.queue=0}.bind(arguments.callee),1000);H.style.display="inline";A.onExecuteSearch(G.value)};var G=new Element("input",{type:"text","class":"text"}).addEvent("keydown",E).inject(F);if(D.value){function C(){if(this.value.trim()==""){this.addClass("defaultText");this.value=D.value}}C.bind(G)();G.addEvent("blur",C);G.addEvent("focus",function(I){if(this.value==D.value){this.value="";this.removeClass("defaultText")}})}var H=new Element("img",{src:App.getStaticUrl("/img/clear.gif"),title:_("Clear"),styles:{cursor:"pointer",position:"absolute",top:"7px",display:"none"}}).setStyle(App.dirRTL?"margin-right":"margin-left","-25px").addEvent("click",function(I){I.target.hide();G.value="";if(A.onResetSearch){A.onResetSearch()}if(D.value){C.bind(G)()}}).inject(F);var B=new Element("input",{type:"image",src:App.getStaticUrl("/img/s.gif"),"class":"image",height:16,width:16}).addEvent("click",E).inject(F);return F};App.Panel.draggableItem=function(B,A){App.getDragItemFactory().addItem(B,A)};App.Panel.ProfilesStack=new Class({Implements:[Events,Options],initialize:function(A){this.container=new Element("div",{id:"profileWrapper",styles:{display:"none"}})},inject:function(A){$(A).adopt(this.container);return this},reset:function(){if(this.container.childNodes.length){$$(this.container.childNodes).destroy()}return this},hide:function(){this.container.hide();return this},addProfile:function(A,D,C){$A(this.container.childNodes).each(function(E){E.style.display="none"});var B=new App.UI.Profile(this.container,{enableBack:true});B.addEvent("onBack",this.onButtonBackClicked.bind(this));B.addEvent("onRemove",this.onFriendRemoved.bind(this));B.addEvent("onAdd",this.onFriendAdded.bind(this));if(typeof C=="function"){B.addEvent("onBack",C.bind(this))}B.show(A,D)},onButtonBackClicked:function(B){var A=this.container.lastChild;if(A){A.destroy()}A=this.container.lastChild;if(A){A.show();A.getElementsByClassName("loading").each(function(C){C.removeClass("loading")})}else{App.Panel.open(App.Panel.current)}if(B){B.stop()}},onFriendRemoved:function(A){this.synchroniseMyFriends(A,true)},onFriendAdded:function(A){this.synchroniseMyFriends(A,false)},synchroniseMyFriends:function(B,A){var F=null;var E=null;$("nv-panel").getElements("li.subscription").each(function(H){if(H.retrieve("friendId")==B){if(A){H.removeClass("following")}else{H.addClass("following")}if(!F&&H.retrieve("data")){F=H.retrieve("data")}}});var C=App.Panel.element.getElement("li.subscriptions");if(!C||!F){return }C.getFirst().setHTML(_("Friends")+" <em>"+User.numFriends+"</em>");var D=App.Panel.Friends.tabs.getTabContent("subscriptions");if(D){var G=D.retrieve("viewer");if(A){G.multiPage.items.remove(F);G.multiPage.total--;D.getElements("li").each(function(H){if(H.retrieve("friendId")==B){H.destroy()}})}else{F.isFriend=true;G.multiPage.items.push(F);G.multiPage.total++}}}});;
if(!App.Panel.AddContent){App.Panel.AddContent={}}App.Panel.AddContent.Eco={categories:[{id:1,label:_("News"),seo:"news",description:_("Regional and national press, news blogs")},{id:2,label:_("Business"),seo:"businessfinance",description:_("Economical and financial news, employment, company life, personal finance management, stock exchange news")},{id:3,label:_("Sport"),seo:"sport",description:_("Sports news, latest scores, international and national sports events")},{id:4,label:_("TV, movies & music"),seo:"tvmoviesmusic",description:_("News about tv series and shows, movie trailers and reviews, music news : blogs and artists websites")},{id:6,label:_("Tools & technology"),seo:"toolstechnology",description:_("Organization tools : calendars, clocks, agendas, calculators, photos, maps and Information about electronics (mp3 hi-fi, audio/visual) and the web")},{id:7,label:_("Fun & games"),seo:"fungames",description:_("Online games, humor and video games")},{id:8,label:_("Lifestyle"),seo:"lifestyle",description:_("Daily life, gardening, cooking, do-it-yourself, well-being, hobbies, spare time")},{id:10,label:_("Shopping"),seo:"shopping",description:_("Shopping and product information widgets")},{id:13,label:_("Travel"),seo:"travel",description:_("Reservation widgets, information and travel blogs")}]};App.Panel.AddContent.EcoUniverses=$merge(App.Panel.AddContent.Eco);App.Panel.AddContent.EcoUniverses.categories.push({id:15,label:_("Personal"),seo:"personal",description:_("Personal informations")});App.Panel.AddContent.showPopup=function(A,B){new App.UI.Preview(A,B).open()};App.Panel.AddContent.onShow=function(){App.Panel.AddContent.onLoading()};App.Panel.AddContent.Filters={initialized:false,config:{search:{sort:"score",region:"any",type:"widget"},browse:{sort:"score",region:null,type:"widget"}},elements:{search:null,browse:null},init:function(){this.config.browse.region=App.locale;this.originalConfig=$merge(this.config);this.countries=Netvibes.Settings.locales.sort(function(B,A){if(B.code==App.locale){return -1}if(A.code==App.locale){return 1}var C=B.name.replace(/é|è|ê|ë|ê/gi,"e").replace(/à|â|ä/gi,"a").replace(/î|ï/gi,"i").replace(/ù|ü|û/gi,"u").replace(/ô|ö/gi,"o").toLowerCase();var D=A.name.replace(/è|é|ê|ë|ê/gi,"e").replace(/à|â|ä/gi,"a").replace(/î|ï/gi,"i").replace(/ù|ü|û/gi,"u").replace(/ô|ö/gi,"o").toLowerCase();if(C<D){return -1}if(C>D){return 1}return 0});this.countries.unshift({code:"any",name:_("All regions")});App.Panel.AddContent.Filters.initialized=true},build:function(H){if(!App.Panel.AddContent.Filters.initialized){App.Panel.AddContent.Filters.init()}if(App.Panel.AddContent.Filters.elements[H]&&App.Panel.AddContent.Filters.elements[H].firstChild){return App.Panel.AddContent.Filters.elements[H]}App.Panel.AddContent.Filters.elements[H]=new Element("fieldset",{id:"contentFilters-"+H,styles:{visibility:"hidden"}});var C=new Element("select");var J="";for(var E=0,F;F=this.countries[E++];){if(J==F.code){continue}var A=new Element("option",{value:F.code,text:F.name}).inject(C);if(E==2){A.addClass("country-separator")}if(F.code==App.Panel.AddContent.Filters.config[H].region){A.setAttribute("selected","selected")}J=F.code}C.addEvent("change",function(){App.Panel.AddContent.Filters.config[H].region=this.value;App.Panel.AddContent.Filters.onChanged(H)});C.inject(App.Panel.AddContent.Filters.elements[H]);var D=new Element("select");var B=[{label:_("Relevant first"),value:"score"},{label:_("Recently added first"),value:"recent"},{label:_("Recently popular first"),value:"popular"},{label:_("All time most popular first"),value:"alltimepopular"}];for(var E=0,H;order=B[E++];){var A=new Element("option",{value:order.value,text:order.label}).inject(D);if(order.value==App.Panel.AddContent.Filters.config[H].sort){A.setAttribute("selected","selected")}}D.addEvent("change",function(){App.Panel.AddContent.Filters.config[H].sort=this.value;App.Panel.AddContent.Filters.onChanged(H)});D.inject(App.Panel.AddContent.Filters.elements[H]);var I=new Element("select");var G=[{label:_("All types"),value:"widget"},{label:_("Applications"),value:"application"},{label:_("Feeds"),value:"feed"},{label:_("Multiple-feeds"),value:"multifeed"},{label:_("Podcasts"),value:"podcast"},{label:_("Events"),value:"event"}];for(var E=0,K;K=G[E++];){var A=new Element("option",{value:K.value,text:K.label}).inject(I);if(K.value==App.Panel.AddContent.Filters.config[H].type){A.setAttribute("selected","selected")}}I.addEvent("change",function(){App.Panel.AddContent.Filters.config[H].type=this.value;App.Panel.AddContent.Filters.onChanged(H)});I.inject(App.Panel.AddContent.Filters.elements[H]);return App.Panel.AddContent.Filters.elements[H]},inject:function(B,A){App.Panel.AddContent.Filters.build(A).inject(B)},onChanged:function(A){switch(A){case"search":App.Panel.AddContent.searchForm.getElement(".image").fireEvent("click");break;case"browse":var B=$$(".categoryList .selected")[0];B.getElement("a").fireEvent("click");break}}};App.Panel.AddContent.onExecuteSearch=function(A){App.Panel.AddContent.searchResults=App.Panel.AddContent.tabs.getTabContent("Search");App.Panel.AddContent.tabs.selectTab("Search");App.Panel.AddContent.renderSearchQuery({query:A})};App.Panel.AddContent.onLoading=function(D){if(!App.Panel.AddContent.Eco){function C(){new Request.JSON({secure:false,onComplete:function(F){App.Panel.AddContent.Eco=F},onFailure:function(){C.delay(5000)}}).get("/proxy/ajaxProxy.php",{url:"http://"+NV_ECO_API+"/categories?format=json&parent=0"})}C()}App.Panel.element.empty();App.Panel.AddContent.tabs=new Netvibes.UI.TabView({position:"left",classTabList:"nav",classTabContent:"tabContent",allowReload:true});var B=App.Panel.AddContent.searchForm=App.Panel.buildSearchForm(this,{value:_("Search for widgets")});App.Panel.AddContent.tabs.addTab("Search",{text:B}).onclick=null;if(User.stats){App.Panel.AddContent.tabs.addTab("talkToMe",{text:_("Recommended")})}App.Panel.AddContent.tabs.addTab("browseContent",{text:_("Browse categories")});App.Panel.AddContent.tabs.addTab("essentialWidgets",{text:_("Essential widgets")});var A=App.Panel.AddContent.tabs.addTab("addFeed",{text:_("Add a feed")});if(App.wizardCustomEnabled()){A=App.Panel.AddContent.tabs.addTab("wizardCustom",{text:_("Start wizard")});A.onclick=function(){App.showWizardCustom();return false}}B.parentNode.removeAttribute("href");App.Panel.AddContent.tabs.observe("activeTabChange",App.Panel.AddContent.onActiveTabChanged);App.Panel.AddContent.tabs.appendTo(App.Panel.element);var E=(User.stats&&!$defined(App.Panel.AddContent.willOpenOnCategoryId))?"talkToMe":(App.isSmartReader?"addFeed":"browseContent");App.Panel.AddContent.tabs.selectTab(E)};App.Panel.AddContent.onActiveTabChanged=function(Z){App.Panel.AddContent.sponsoredCache=[];var C=$(App.Panel.AddContent.tabs.getTabContent(Z));if(C.loaded&&(C.loaded==App.locale)){App.Panel.AddContent.searchResults=$(C.getElementsByClassName("searchResults")[0]);$(window).fireEvent("resize");return }C.empty();C.addClass("addContent");App.Panel.AddContent.sponsoredFlag=true;switch(Z){case"Search":break;case"addFeed":var Y=new Element("h2").set("text",_("Add a feed")).inject(C);C.style.width="auto";var U=new Element("div",{"class":"feedform"}).inject(C);var B=new Element("form",{"class":"searchForm"}).addEvent("submit",function(a){X.style.display="inline";App.Panel.AddContent.searchResults.wait(null,{top:"180px"});App.addNewFeed(W.value,App.Panel.AddContent.onFeedResponse);return false}).inject(U);var D=new Element("fieldset",{styles:{position:"relative"}}).inject(B);var E=new Element("label",{"for":"addfeedurl"}).set("text",_("Enter a feed address or website URL for autodetection")).inject(D);var W=new Element("input",{type:"text","class":"text",id:"addfeedurl"}).inject(D);var X=new Element("img",{src:App.getStaticUrl("/img/clear.gif"),title:_("Clear"),styles:{cursor:"pointer",position:"absolute",top:"18px",display:"none"}}).setStyle(App.dirRTL?"margin-right":"margin-left","-20px").inject(D).addEvent("click",function(a){App.Panel.AddContent.onActiveTabChanged("addFeed")});var P=new Element("input",{type:"submit","class":"nv-button",value:_("Add feed")}).inject(D);App.Panel.AddContent.searchResults=new Element("div",{"class":"searchResults"}).inject(C);new Element("div",{"class":"help"}).inject(App.Panel.AddContent.searchResults).set("html","<p>"+_("Locate the feed address on the website. It is usually represented with one of the following icons:")+' <img src="'+App.getStaticUrl(NV_PATH+"img/icon_rss.png")+'" alt="RSS"/> <img src="'+App.getStaticUrl(NV_PATH+"img/add/rss.png")+'" alt="RSS"/> <img src="'+App.getStaticUrl(NV_PATH+"img/add/atom.png")+'" alt="ATOM"/> <img src="'+App.getStaticUrl(NV_PATH+"img/add/xml.png")+'" alt="XML"/> <img src="'+App.getStaticUrl(NV_PATH+"img/add/rdf.png")+'" alt="RDF"/></p><p>'+_("Copy and paste this address above.")+" "+_("If you don't see the feed address, you can try to to enter the website address instead. Netvibes will try to autodiscover it.")+'</p><p><a href="http://'+NV_FAQ+'">'+_("Get more information about feeds.")+"</a></p>");if(!window._importOPMLpanel){window._importOPMLpanel=new App.Panel.AddContent.OPMLPanel("nv-import-opml")}var A=new Element("form",{id:"addFeedImportForm",target:"target_upload",action:"/uploadOPML.php",enctype:"multipart/form-data",encoding:"multipart/form-data",method:"post",style:"display: none;"}).inject(U).addEvent("submit",function(a){V.uploaded=true;window._importOPMLpanel.show()});var V=new Element("iframe",{id:"target_upload",name:"target_upload"}).inject(U);V[Browser.Engine.trident?"onreadystatechange":"onload"]=function(){if(this.readyState&&this.readyState!="complete"){return }if($defined(this.uploaded)){window._importOPMLpanel.error("Fatal error. Your OPML file may contain too many feeds.")}};var F=new Element("fieldset").inject(A);new Element("input",{type:"hidden",name:"pid",value:App.currentPage}).inject(F);new Element("input",{type:"hidden",name:"MAX_FILE_SIZE",value:"500000"}).inject(F);new Element("input",{type:"file",name:"userfile","class":"file"}).inject(F);new Element("input",{type:"submit","class":"submit",value:_("Import")}).inject(F);if(App.visit){new Element("input",{type:"hidden",name:"universe",value:1}).inject(F)}var K=new Element("p",{"class":"opml"}).inject(B).set("html",_("OPML:"));new Element("a",{text:_("Import"),"class":"opml",href:"javascript:void(0)"}).addEvent("click",function(){if("block"==A.getStyle("display")){A.setStyle("display","none")}else{A.setStyle("display","block")}}).inject(K);new Element("a",{text:_("Export"),"class":"opml",href:"/opmlExport.php?pid="+App.currentPage}).inject(K);if(Browser.isFirefox){new Element("span",{"class":"firefox"}).inject(K).interpolate(_("If you add feeds regularly, try the {firefoxextension}"),{firefoxextension:new Element("a",{text:_("Firefox extension"),href:"http://"+NV_ECO+"/tools"})})}W.focus();break;case"essentialWidgets":new Element("h2").set("text",_("Essential widgets")).inject(C);var M=new Element("div",{"class":"searchResults"}).inject(C);var R=new Element("ul",{"class":"searchResults"}).inject(M);var H=new Request.JSON().addEvent("complete",function(b){if(b.error){this.fireEvent("onFailure")}var a=new Netvibes.UI.MultiPage({items:b.items,displayTotal:true,layout:{container:R,itemWidth:92,numRows:2},onPageChange:function(c){R.empty();c.items.each(function(d){if(d.typeString){var e=App.Panel.AddContent.renderWidget({eco:d});if(e){e.inject(R)}}else{App.Panel.AddContent.renderWidget({dataObj:d}).inject(R)}});App.Panel.AddContent.attachWidgetEvents()}}).inject(M);C.loaded=App.locale}).addEvent("failure",function(){R.empty();R.innerHTML="<p>"+_("Unable to retrieve data. Please try again later.")+"</p>"}).get("/proxy/cache/eco/add-content-essentials-"+(App.visit?"public":"private")+"-"+App.locale+".json");break;case"browseContent":var Y=new Element("h2",{id:"browseContentTitle"}).adopt(new Element("span",{text:_("Browse categories")})).inject(C);App.Panel.AddContent.Filters.inject(Y,"browse");var T=new Element("div",{"class":"categoryScroll"}).inject(C);var L=new Element("ul",{"class":"categoryList"}).inject(T);App.Panel.AddContent.searchResults=new Element("div",{"class":"searchResults"}).wait(null,{"margin-left":"0",top:"130px","margin-right":"-1em"}).inject(C);if(!App.Panel.AddContent.featuredItems){App.Panel.AddContent.featuredItems=[]}var S=new Element("li",{"class":"category",id:"featuredCateg"}).inject(L);var G=new Element("a",{text:App.visit?_("Universe widgets"):_("Featured widgets")}).addEvent("click",function(c){if(c){c.stop()}App.Panel.AddContent.sponsoredCache=[];$("contentFilters-browse").style.visibility="hidden";$$("#nv-panel li.category").removeClass("selected");this.getParent().addClass("selected");App.Panel.AddContent.searchResults.empty();var b=new Element("ul",{"class":"searchResults"}).inject(App.Panel.AddContent.searchResults);var a=new Netvibes.UI.MultiPage({items:App.Panel.AddContent.featuredItems,displayTotal:true,layout:{container:b,itemWidth:92,numRows:2},onPageChange:function(d){b.empty();App.Panel.AddContent.sponsoredNb=0;App.Panel.AddContent.sponsoredFlag=this.currentPage==1;d.items.each(function(e){if(e.typeString){var f=App.Panel.AddContent.renderWidget({eco:e});if(f){f.inject(b)}}else{App.Panel.AddContent.renderWidget({dataObj:e}).inject(b)}});App.Panel.AddContent.defineSponsoredContainer(b,this.currentPage);App.Panel.AddContent.attachWidgetEvents()}}).inject(App.Panel.AddContent.searchResults)}).inject(S);if(App.Panel.AddContent.featuredItems.length==0||C.loaded!=App.locale){if(App.isPremium()){var J={thumbtype:"ginger",thumbwidth:64,thumbheight:48,type:"widget",region:App.locale,limit:50,format:"json",brand:App.brand};var I="http://"+NV_ECO_API+"/featured";if(App.visit){I="http://"+NV_ECO_API+"/search";J.flag=256;J.customsort="sponsored,type_native,pick,featured,popular"}I="/proxy/ajaxProxy.php?url="+encodeURIComponent(I+"?"+Hash.toQueryString(J))}else{var I="/proxy/cache/eco/add-content-featured-"+(App.visit?"universe":"private")+"-"+App.locale+".json"}var H=new Request.JSON().addEvent("complete",function(a){App.Panel.AddContent.featuredItems=a.items;if(a.error){this.fireEvent("onFailure")}else{if(!$defined(App.Panel.AddContent.willOpenOnCategoryId)){setTimeout(function(){G.fireEvent("click",[null,G.get("text")])},1)}}}).addEvent("failure",function(){App.Panel.AddContent.searchResults.innerHTML="<p>"+_("The service is temporary unavailable. We apologize for the inconvenience. Please try again later.")+"</p>"}).get(I)}App.Panel.AddContent.partnerItems={cdevtest:{id:46747,displayName:"test"},skidmoreowingsandmerrill:{id:47611,displayName:"SOM"},florent:{id:423,displayname:"florent"}};if(App.Panel.AddContent.partnerItems[App.brand]){var O=App.Panel.AddContent.partnerItems[App.brand].id}if(App.isPremium()&&O){var Q=new Element("li",{"class":"category"}).inject(L);new Element("a",{href:"http://"+NV_ECO+"/users/"+O}).addEvent("click",function(a){if(a){a.stop()}$$("#nv-panel li.category").removeClass("selected");this.getParent().addClass("selected");App.Panel.AddContent.renderSearchQuery({category:0,handler:"normal",campaigns:0,rawquery:"userId:"+O})}).set("text",App.Panel.AddContent.partnerItems[App.brand].displayName+" "+_("widgets")).inject(Q)}function N(){if(!App.Panel.AddContent.Eco){N.delay(200)}else{App.Panel.AddContent.Eco.categories.each(function(b){var a=new Element("li",{"class":"category"}).inject(L);var c=new Element("a",{href:"http://"+NV_ECO+"/wc"+b.id+"/"+b.seo+"-widgets/popular"}).addEvent("click",function(d){if(d){d.stop()}App.Panel.AddContent.sponsoredCache=[];$("contentFilters-browse").style.visibility="visible";$$("#nv-panel li.category").removeClass("selected");this.getParent().addClass("selected");App.Panel.AddContent.renderSearchQuery({category:b.id,region:App.Panel.AddContent.Filters.config.browse.region})}).set("text",b.label).inject(a);if($defined(App.Panel.AddContent.willOpenOnCategoryId)&&App.Panel.AddContent.willOpenOnCategoryId==b.id){c.fireEvent("click")}})}}N();C.loaded=App.locale;break;case"talkToMe":new Element("h2").set("text",_("Recommended widgets")).inject(C);new Element("span",{"class":"comment"}).set("text",_("These recommendations are based on the widgets already installed on your pages.")).inject(C);var M=new Element("div",{"class":"searchResults"}).inject(C);var R=new Element("ul",{"class":"searchResults"}).inject(M);R.wait(null,{top:"90px"});var H=new Request.JSON().addEvent("complete",function(b){if(b.error){this.fireEvent("onFailure")}var c=$("notif-discover-new-widgets");if(c){c.hide()}var a=new Netvibes.UI.MultiPage({items:b.items,displayTotal:true,layout:{container:R,itemWidth:92,numRows:2},onPageChange:function(d){R.empty();App.Panel.AddContent.sponsoredNb=0;App.Panel.AddContent.sponsoredFlag=this.currentPage==1;d.items.each(function(e){if(e.typeString){var f=App.Panel.AddContent.renderWidget({eco:e},true);if(f){f.inject(R)}}else{App.Panel.AddContent.renderWidget({dataObj:e},true).inject(R)}});App.Panel.AddContent.defineSponsoredContainer(R,this.currentPage);App.Panel.AddContent.attachWidgetEvents()}}).inject(M)}).addEvent("failure",function(){R.empty();R.innerHTML="<p>"+_("Unable to retrieve data. Please try again later.")+"</p>"}).get("/ajax/user/talkToMe.php");break}};App.Panel.AddContent.sponsoredCache=[];App.Panel.AddContent.defineSponsoredContainer=function(B,D){var C=B.className.indexOf(" sp-");if(C!=-1){B.className=B.className.substring(0,C);$$("#nv-panel .sp-info").destroy()}if(D==1&&App.Panel.AddContent.sponsoredNb&&App.Panel.AddContent.sponsoredNb>0){B.addClass("sp-"+App.Panel.AddContent.sponsoredNb);var A=new Element("A",{text:_("Sponsored (info)"),href:"http://"+NV_BUSINESS,"class":"sp-info",target:"_blank"});A.inject(B)}};App.Panel.AddContent.attachWidgetEvents=function(){$$("#nv-panel .widget").each(function(C){if(C.eventsAttached){return }C.eventsAttached=true;var B;if(B=C.retrieve("dataObj")){var A=C.getElement(".directAdd");if(A){A.addEvents({click:function(G){G.stop()},mouseover:function(G){G.stop()}});var F=A.getElement("a");if(F){F.addEvent("click",function(H){H.stop();var G=new Module($extend($unlink(B),{admin:false}),{nativise:true});if(G.addModuleToPage()){App.moduleList.push(G);App.Modules.store(G,App.isSmartReader?App.SmartReader.data.addModule:$empty)}A.set("html",'<span class="justAdded">'+_("added")+"</span>");setTimeout(function(){if(C){A.empty().grab(F)}},5000)})}}var E=C.getElement(".block");if(E){E.addEvents({click:function(G){G.stop()},mouseover:function(G){G.stop()}});var D=E.getElement("a");if(D){D.addEvent("click",function(H){H.stop();var G=new App.UI.ConfirmDialog({titleText:B.title,message:_("No thanks, dismiss it?"),confirm:{text:_("Yes"),requestText:_("Dismissing..."),successText:_("The widget has been dismissed.")},discard:{text:""},onConfirmRequest:function(){if(this.ajax.running){return }this.ajax.setOptions({url:"http://"+NV_HOST+"/ajax/user/addToBlacklist.php",data:{widgetId:B.widgetId},onComplete:function(I){switch(I){case"success":C.dispose();App.Panel.AddContent.removeFromFeaturedItems(B.widgetId);break}}});this.ajax.post()}}).show()})}}C.addEvent("click",function(G){G.stop();App.Panel.AddContent.showPopup(B,C.retrieve("ecoInfos"))});App.Panel.draggableItem(C,B)}})};App.Panel.AddContent.onFeedResponse=function(E,H,C){switch(C){case"auth":H=H.replace("feed://","http://");App.Panel.AddContent.searchResults.empty();var B=new Element("div",{"class":"info"}).inject(App.Panel.AddContent.searchResults);var D=new Element("form",{"class":"feedAuth"}).inject(B);new Element("p",{"class":"warning"}).set("text",_("This feed is protected by a password:")).inject(D);if(H.match(/(https?:\/\/)([^@]+@)(.+)/)){new Element("p",{"class":"error"}).set("text",_("Wrong login/password")).inject(D)}var K=new Element("label").set("text",_("Username:")).inject(D);var G=new Element("input",{type:"text","class":"text",size:"25"}).inject(K);var F=new Element("label").set("text",_("Password:")).inject(D);var J=new Element("input",{type:"password","class":"password",size:"25"}).inject(F);new Element("input",{type:"submit","class":"nv-button nv-primary-button",value:_("ok")}).inject(D);D.addEvent("submit",function(M){M.stop();H=H.replace(/(https?:\/\/)([^@]+@)(.+)/,"$1$3");var L=encodeURIComponent(G.value)+":"+encodeURIComponent(J.value)+"@";H=H.replace(/(https?:\/\/)(.+)/,"$1"+L+"$2");App.addNewFeed(H,App.Panel.AddContent.onFeedResponse);return"false"});break;case"site":new Request().addEvent("complete",function(M){M=JSON.decode(M).feeds;App.Panel.AddContent.searchResults.empty();var L=new Element("ul",{"class":"discovery"}).inject(App.Panel.AddContent.searchResults);if(typeof M!="object"||M.length==0){App.Panel.AddContent.searchResults.empty();new Element("div",{"class":"info"}).set("text",_("sorry, no feeds found at this url")).inject(App.Panel.AddContent.searchResults)}else{if(M.length==1){App.Panel.wait(App.Panel.AddContent.searchResults);App.addNewFeed(M[0].url,App.Panel.AddContent.onFeedResponse)}else{var N="";M.each(function(P,O){N+="url["+O+"]="+encodeURIComponent(P.url)+"&title["+O+"]="+encodeURIComponent(P.title)+"&"});new Request().addEvent("complete",function(P){P=JSON.decode(P);M.each(function(Q){Q.id=P.feeds[Q.url]});var O=new Netvibes.UI.MultiPage({items:M,displayTotal:true,layout:{container:L,itemWidth:92,numRows:1},onPageChange:function(Q){L.empty();Q.items.each(function(R){App.Panel.AddContent.renderWidget({feed:R}).inject(L)});App.Panel.AddContent.attachWidgetEvents()}}).inject(App.Panel.AddContent.searchResults)}).post(NV_API_PATH+"/feed/add?format=json",N)}}}).addEvent("request",function(){App.Panel.AddContent.searchResults.wait(null,{top:"180px"})}).get(NV_API_PATH+"/feed/discover?format=json",{url:H});break;case"webcal":App.Panel.AddContent.searchResults.empty();var I=new Feed(E);var A=new Element("ul",{"class":"discovery"}).inject(App.Panel.AddContent.searchResults);App.Panel.AddContent.renderWidget({feed:{id:"webcal",url:H}}).inject(A);App.Panel.AddContent.attachWidgetEvents();break;case"feed":case"rss":default:App.Panel.AddContent.searchResults.empty();if(typeof C=="undefined"){new Element("div",{"class":"info"}).set("text",_("looks like this feed is not valid or currently not responding")).inject(App.Panel.AddContent.searchResults)}else{var I=new Feed(E);if(App.use_feedbackend){I=I.feeds[0]}var A=new Element("ul",{"class":"discovery"}).inject(App.Panel.AddContent.searchResults);App.Panel.AddContent.renderWidget({feed:{title:I.title,url:H,type:I.type,id:C}}).inject(A);App.Panel.AddContent.attachWidgetEvents()}}};App.Panel.AddContent.fullNameLocale=function(B){arguments.callee.cache=arguments.callee.cache||{};if(typeof arguments.callee.cache[B]=="undefined"){for(var A=0,C;C=Netvibes.Settings.locales[A++];){if(C.code.toLowerCase()==B.toLowerCase()){arguments.callee.cache[B]=C.name;break}}}return arguments.callee.cache[B]};App.Panel.AddContent.renderSearchQuery=function(E){if(!E){var E={}}var D=$merge({query:"",category:0,format:"json",thumbheight:48,thumbwidth:64,thumbtype:"ginger",additionalInfos:"rating",brand:App.isPremium()?App.brand:null},E);var C=D.category!=0?App.Panel.AddContent.Filters.config.browse:App.Panel.AddContent.Filters.config.search;D=$merge(D,C);App.Panel.AddContent.searchResults.empty();if(D.query!=""){var A=new Element("h2").set("text",_("Search widgets")).inject(App.Panel.AddContent.searchResults);App.Panel.AddContent.Filters.inject(A,"search");$("contentFilters-search").style.visibility="visible"}var B=new Element("ul",{"class":"searchResults"}).inject(App.Panel.AddContent.searchResults).wait(null,{"margin-left":"-7em",top:"50px"});if(!App.isPremium()&&D.query==""&&D.category!=0&&D.type==App.Panel.AddContent.Filters.originalConfig.browse.type&&D.sort==App.Panel.AddContent.Filters.originalConfig.browse.sort){new Request.JSON({url:"/proxy/cache/eco/add-content-category-"+D.category+"-"+D.region+".json",onComplete:function(F){App.Panel.AddContent.renderSearchCallback(B,D,F)},onFailure:function(){}}).get()}else{App.Panel.AddContent.renderSearchCallback(B,D)}};App.Panel.AddContent.renderSearchCallback=function(B,D,A){if(typeof A=="undefined"){A={total:0,item:[]}}var C=new Netvibes.UI.MultiPage.JSON({requestUrl:"/proxy/ajaxProxy.php",displayTotal:true,total:A.total,items:A.items,layout:{container:B,itemWidth:92,numRows:2},responseParams:{items:"items",total:"total"},onRequesting:function(F){var E="http://"+NV_ECO_API+"/search/?";var G={limit:F.perPage,page:(F.offset/F.perPage)+1};F.request.setOptions({data:{url:E+Hash.toQueryString($merge(G,this))}});B.wait(null,{"margin-top":"-50px"})}.bind(D),onPageChange:function(E){B.empty();App.Panel.AddContent.sponsoredNb=0;App.Panel.AddContent.sponsoredFlag=this.currentPage==1;if(E.items){if(E.items.length==0){new Element("li",{"class":"noResultMessage",html:_("Sorry, your search {0} does not match any widgets.").format(D.query)+"<br />"+_("Suggestions : Please ensure your words are spelt correctly or try different keywords.")}).inject(B);App.Panel.AddContent.attachWidgetEvents();return }E.items.each(function(F){F.fromQuery=D.query;App.Panel.AddContent.renderWidget({eco:F}).inject(B)})}App.Panel.AddContent.defineSponsoredContainer(B,this.currentPage);App.Panel.AddContent.attachWidgetEvents()},onFailure:function(){B.empty();B.innerHTML="<p>"+_("Unable to retrieve data. Please try again later.")+"</p>"}}).inject(App.Panel.AddContent.searchResults)};App.Panel.AddContent.renderWidget=function(B,G){if(B.dataObj){var H=$merge(App.Modules[B.dataObj.moduleName+"Infos"],A);var A=$merge(H.defaultObj,B.dataObj);var J=A.title||H.title;var I=A.richIcon||H.richIcon}else{if(B.feed){switch(B.feed.id){case"webcal":var A={moduleName:"Ical",data:{icalUrl:B.feed.url}};break;case"feed":case"rss":default:var A={moduleName:"RssReader",feedUrl:B.feed.url,title:B.feed.title,data:{feedId:B.feed.id}};break}var H=App.Modules[A.moduleName+"Infos"];var I=H.richIcon;var J=B.feed.title}else{if(B.eco){var N=B.eco;var M=null;if(N.descriptions){if(N.descriptions[App.shortLang]){var M=N.descriptions[App.shortLang]}else{if(N.descriptions.en){var M=N.descriptions.en}else{if(N.descriptions[0]){var M=N.descriptions[0]}}}}if(!M&&N.description){M=N.description}N.description=M;var J=null;if(N.titles){if(N.titles[App.shortLang]){var J=N.titles[App.shortLang]}else{if(N.titles.en){var J=N.titles.en}else{if(N.titles[0]){var J=N.titles[0]}}}}if(!J&&N.title){J=N.title}N.title=_(J);switch(N.typeString){case"feed":case"podcast":var A={widgetId:N.id,moduleName:"RssReader",title:N.title,data:{feedUrl:N.link}};break;case"flash":case"uwa":case"multifeed":var A={widgetId:N.id,moduleName:"UWA",title:N.title,data:{moduleUrl:N.link}};break;case"native":var H=$merge(App.Modules[N.link+"Infos"]);var A=$merge({widgetId:N.id,moduleName:N.link,title:N.title,data:(N.data?JSON.decode(N.data):{})},H.defaultObj);if(N.link!="Vibes"&&N.title!="HTML"){var I=H.richIcon}break;case"miniapi":var A={widgetId:N.id,moduleName:"Api",title:N.title,data:{moduleUrl:N.link}};break;case"event":var A={widgetId:N.id,moduleName:"Ical",title:N.title,data:{icalUrl:N.link}};break;case"universe":return }var J=J||N.title;var I=I||N.thumbnail;if(App.Panel.AddContent.sponsoredFlag&&N.campaignActive&&App.Panel.AddContent.sponsoredNb<3){A.campaignId=N.campaignId;A.campaignActive=true;A.fromQuery=N.fromQuery;if(!App.Panel.AddContent.sponsoredCache.contains(A.campaignId)){if($defined(A.fromQuery)&&A.fromQuery!=""){App.report("adc.spon.view.search",{ecoId:(A.ecoId||A.widgetId),query:A.fromQuery,campaignId:A.campaignId})}else{if(!A.campaignId||A.campaignId==A.ecoId||A.campaignId==A.widgetId){App.report("adc.spon.view.browse",{ecoId:(A.ecoId||A.widgetId),campaignId:A.campaignId})}else{App.report("camp.browse",{ecoId:(A.ecoId||A.widgetId),campaignId:A.campaignId})}}App.Panel.AddContent.sponsoredCache.push(A.campaignId)}App.Panel.AddContent.sponsoredNb++}else{App.Panel.AddContent.sponsoredFlag=false}}}}var O="";var L=new Element("li",{"class":"widget"}).addEvent("mouseover",function(P){new App.toolTip(L,O,B.eco?300:150)});if(B.eco){L.store("ecoInfos",B.eco);O='<div class="extentedTooltip">';O+='<div class="autoclear">';O+="<strong>"+J+"</strong>";var E=B.eco.rating||0;var K=Math.round(E*100/5);O+='    <span class="rating"><span style="width: '+K+'%">'+_("rating")+" : "+E+"/5</span></span></div>";if(B.eco.totalInstalled){O+=' <div class="preview-totalInstall">'+_("Total installed")+" : "+B.eco.totalInstalled+"</div>"}if(B.eco.description){O+="<p>"+(B.eco.description.length>500?(B.eco.description.substring(0,500)+" ..."):B.eco.description)+"</p>"}O+="</div>"}else{O=_("Click here to preview {0}").format("<strong>"+J+"</strong>")}if(A.campaignActive){O+=' <div class="sp-label">sponsored</div>';L.addClass("sp")}var F=new Element("img",{"class":"icon"}).inject(L);F.src=I;new Element("a",{"class":"title",href:"javascript:void(0)",html:J}).inject(L);L.store("dataObj",A);var D=new Element("div",{"class":"directAdd"}).adopt(new Element("a",{href:(B.eco&&B.eco.publicUrl)?B.eco.publicUrl:"javascript:void(0)"}).adopt(new Element("span",{text:_("add")}))).inject(L);if(G){if(D){D.addClass("left")}if(!A.campaignActive){var C=new Element("div",{"class":"block right"}).adopt(new Element("a",{href:"javascript:void(0)"}).adopt(new Element("span",{text:_("block")}))).addEvent("mouseover",function(P){new App.toolTip(C,_("No thanks"),150)}).inject(L)}}return L};App.Panel.AddContent.removeFromFeaturedItems=function(B){var A=[];App.Panel.AddContent.featuredItems.each(function(C){if(C.id!=B){A.push(C)}});App.Panel.AddContent.featuredItems=A};App.Panel.AddContent.OPMLPanel=new Class({Extends:ModalDialog,errors:[],progressBarInitialized:false,initialize:function(B){if($(B)){B.empty()}this.parent(B,{showCloseButton:false,draggable:true,overlayClassName:"overlay_import-opml",fadeEffect:(App.pageCustom.enableFx=="1")});this.heading.innerHTML=_("OPML: Import");this._container=new Element("div",{id:"opml-modal-content"}).inject(this.innerFrame);this._progresscontainer=new Element("div",{id:"opml-modal-loading",html:_("Loading...")}).inject(this._container);this._opmlprogresscontainer=new Element("div",{id:"opmlprogresscontainer"}).inject(this._progresscontainer).hide();this._opmlprogress=new Element("div",{id:"opmlprogress"}).inject(this._opmlprogresscontainer);this._errorsMessage=new Element("div",{"class":"error",styles:{display:"none"}}).inject(this._container);this._errorsList=new Element("ul",{styles:{display:"none"}}).inject(this._container);var A=new Element("div",{id:"opml-modal-button"}).inject(this._container);this._doneButton=new Element("input",{type:"submit",value:_("Done"),styles:{display:"none"}}).inject(A);this._doneButton.addEvent("click",function(){window.location.reload()});this._listStyleOdd=false;this.ended=false},setProgress:function(A){this._opmlprogresscontainer.show();this._opmlprogress.setStyle("width",A+"%")},addError:function(C,B){this.errors.push(B);var A=new Element("li",{html:'<a href="'+B+'" target="_blank" title="'+B+'">'+C+"</a>"}).inject(this._errorsList);if(this._listStyleOdd){A.addClass("odd-li")}this._listStyleOdd=!this._listStyleOdd;if(this.errors.length==1){this._errorsMessage.set("html",_("A feed containing errors has not been imported:"))}else{this._errorsMessage.set("html",_("{0} feeds containing errors have not been imported:").format(this.errors.length))}if(this._errorsMessage.getStyle("display")=="none"){this._errorsMessage.show();this._errorsList.show()}},end:function(A){if(this.ended){return }else{this.ended=true}var B=A-this.errors.length;if(B==1){this._progresscontainer.set("html",_("One feed has been successfully imported"))}else{this._progresscontainer.set("html",_("{0} feeds have been successfully imported").format(B))}this._progresscontainer.setStyle("color","#FF9900");this._doneButton.show()},error:function(A){if(this.ended){return }else{this.ended=true}this._progresscontainer.set("html",_("An error occured"));this._errorsMessage.set("html",A);this._errorsMessage.show();this._errorsList.hide();this._doneButton.show()}});;
App.Panel.Friends={};App.Panel.Friends.tabs=null;App.Panel.Friends.onShow=function(){App.Panel.element.empty();App.Panel.Friends.onLoading()};App.Panel.Friends.onExecuteSearch=function(B){var A=this.tabs.getTabContent("Search");this.tabs.selectTab("Search");var D=new App.UI.FriendsViewer({path:NV_API_PATH+"/subscriptions",type:"search",params:{q:B}}).inject(A);var C=new Element("h2",{text:_("Results for {0}").format('"'+B+'"')}).inject(D.container.firstChild,"before");D.addEvent("onItemClick",function(E){if(App.UI.Profile.request&&App.UI.Profile.request.running){return false}if(E.hasClass("loading")){return false}var F=E.addClass("loading").retrieve("friendId");App.Panel.showProfile(F,function(){E.removeClass("loading")},function(){App.Panel.Friends.updateNumFriends()})});D.addEvent("onAdd",function(){App.Panel.Friends.updateNumFriends()});D.addEvent("onRemove",function(){App.Panel.Friends.updateNumFriends()});D.addEvent("onBlock",function(){App.Panel.Friends.updateNumFriends()})};App.Panel.Friends.onResetSearch=function(){this.tabs.getTabContent("Search").empty();if(this.tabs.selectedTab.getAttribute("name")=="Search"){this.tabs.selectTab("subscriptions")}};App.Panel.Friends.onLoading=function(F){this.tabs=new Netvibes.UI.TabView({classTabList:"nav",classTabContent:"tabContent"});var D=App.Panel.buildSearchForm(this,{value:_("Search for contacts")});this.tabs.addTab("Search",{text:D}).onclick=null;D.parentNode.removeAttribute("href");$(this.tabs.addTab("subscriptions",{text:""})).getFirst().setHTML(_("Friends")+" <em>"+(User.numFriends>0?User.numFriends:"")+"</em>");var A=$(this.tabs.addTab("followers",{text:_("Followers")}));var E=$(this.tabs.addTab("addFriends",{text:_("Find friends")}));var C=$(this.tabs.addTab("inviteFriends",{text:_("Invite friends")}));if(!User.registered){A.addClass("fakeDisabled");E.addClass("fakeDisabled");C.addClass("fakeDisabled")}else{A.getFirst().setHTML(_("Followers")+" <em>"+(User.numFollowers>0?User.numFollowers:"")+"</em>");var B=$(this.tabs.addTab("blockedFollowers",{text:_("Blocked Followers")}));B.getFirst().setHTML(_("Blocked Followers")+" <em>"+(User.numBlockedFollowers>0?User.numBlockedFollowers:"")+"</em>")}this.tabs.observe("activeTabChange",App.Panel.Friends.onActiveTabChanged);this.tabs.appendTo(App.Panel.element);this.tabs.selectTab("subscriptions",true)};App.Panel.Friends.onActiveTabChanged=function(C){var L=App.Panel.Friends.tabs;var P=$(L.getTabContent(C));switch(C){case"subscriptions":if(!P.loaded){var G=new App.UI.FriendsViewer({user:"my",type:"subscriptions"}).inject(P);P.store("viewer",G);var N=new Element("h2",{text:_("My friends")}).inject(G.container.firstChild,"before");G.addEvent("onItemClick",function(Q){if(App.UI.Profile.request&&App.UI.Profile.request.running){return false}if(Q.hasClass("loading")){return false}var R=Q.addClass("loading").retrieve("friendId");App.Panel.showProfile(R,function(){Q.removeClass("loading")},function(){App.Panel.Friends.updateNumFriends();App.Panel.Friends.onActiveTabChanged("subscriptions")})});G.addEvent("onAdd",function(){App.Panel.Friends.updateNumFriends()});G.addEvent("onRemove",function(){App.Panel.Friends.updateNumFriends()});G.addEvent("onBlock",function(){App.Panel.Friends.updateNumFriends()});P.loaded=true}break;case"followers":if(!P.loaded){if(User.registered){var G=new App.UI.FriendsViewer({user:"my",type:"followers"}).inject(P);var N=new Element("h2",{text:_("My followers")}).inject(G.container.firstChild,"before");G.addEvent("onItemClick",function(Q){if(App.UI.Profile.request&&App.UI.Profile.request.running){return false}if(Q.hasClass("loading")){return false}var R=Q.addClass("loading").retrieve("friendId");App.Panel.showProfile(R,function(){Q.removeClass("loading")},function(){App.Panel.Friends.updateNumFriends();App.Panel.Friends.onActiveTabChanged("followers")})});G.addEvent("onAdd",function(){App.Panel.Friends.updateNumFriends()});G.addEvent("onRemove",function(){App.Panel.Friends.updateNumFriends()});G.addEvent("onBlock",function(){App.Panel.Friends.updateNumFriends()})}else{P.empty();new Element("h2",{text:_("Create your profile")}).inject(P);var D=new Element("p",{"class":"upgradeProfile",html:_("Your followers are people who subscribe to your activities.<br/>You can share with them your favorites articles, widgets or status.<br/><br/>To let people subscribe to your updates, you need to sign up.")+"<br/><br/>"}).inject(P);new Element("input",{type:"button","class":"nv-button",value:_("Sign up")}).addEvent("click",function(Q){Q.stop();App.showSignup()}).inject(D)}P.loaded=true}break;case"blockedFollowers":if(!P.loaded){if(User.registered){var G=new App.UI.FriendsViewer({user:"my",type:"blockedFollowers"}).inject(P);var N=new Element("h2",{text:_("Blocked followers")}).inject(G.container.firstChild,"before");G.addEvent("onItemClick",function(Q){if(App.UI.Profile.request&&App.UI.Profile.request.running){return false}if(Q.hasClass("loading")){return false}var R=Q.addClass("loading").retrieve("friendId");App.Panel.showProfile(R,function(){Q.removeClass("loading")},function(){App.Panel.Friends.updateNumFriends();App.Panel.Friends.onActiveTabChanged("blockedFollowers")})});G.addEvent("onUnblock",function(){App.Panel.Friends.updateNumFriends()})}else{P.empty();new Element("h2",{text:_("Create your profile")}).inject(P);var D=new Element("p",{"class":"upgradeProfile",html:_("Your followers are people who subscribe to your activities.<br/>You can share with them your favorites articles, widgets or status.<br/><br/>To let people subscribe to your updates, you need to sign up.")+"<br/><br/>"}).inject(P);new Element("input",{type:"button","class":"nv-button",value:_("Sign up")}).addEvent("click",function(Q){Q.stop();App.showSignup()}).inject(D)}P.loaded=true}break;case"addFriends":if(User.registered){if(User.numFriends>=4){App.Panel.Friends.Find.providers[0].disabled=false;App.Panel.Friends.Find.providers[5].disabled=false;App.Panel.Friends.Find.providers[6].disabled=false;App.Panel.Friends.Find.providers[7].disabled=false}else{App.Panel.Friends.Find.providers[0].disabled=true;App.Panel.Friends.Find.providers[5].disabled=true;App.Panel.Friends.Find.providers[6].disabled=true;App.Panel.Friends.Find.providers[7].disabled=true}P=$(P);P.empty();P.addClass("addContent");P.addClass(C);var N=new Element("h2",{text:_("Find Friends")}).inject(P);var H=new Element("div",{"class":"categoryScroll"}).inject(P);var O=new Element("ul",{"class":"categoryList"}).inject(H);var J=new Element("div",{"class":"categoryContent"}).inject(P);var I="";I+='<div class="friends-finder">';I+="    <h3>"+_("Tell us where to find your friends:")+"</h3>";I+='    <div class="content welcome"></div>';I+='    <p class="notice">'+_("We won't store your login info or contact anyone without your permission.")+"</p>";I+="</div>";J.innerHTML=I;var B=$$("#nv-panel .friends-finder .welcome")[0];for(var F=0,E=App.Panel.Friends.Find.providers.length;F<E;F++){var M=App.Panel.Friends.Find.providers[F];if(M.disabled){var K=new Element("a").set("text",M.title).inject(new Element("li",{"class":"category disabled",style:"display: none"}).inject(O))}else{var K=new Element("a").set("text",M.title).inject(new Element("li",{"class":"category"}).inject(O)).setProperty("index",F).addEvent("click",function(Q){J.empty();$$("#nv-panel li.category").removeClass("selected");this.getParent().addClass("selected");App.Panel.Friends.Find.buildIntro(this.getProperty("index"),J)});new Element("img",{"class":"service",src:M.wellcomeIcon,title:M.title}).setProperty("index",F).inject(B).addEvent("click",function(R){J.empty();var Q=$$("#nv-panel li.category");Q.removeClass("selected");Q[this.getProperty("index")].addClass("selected");App.Panel.Friends.Find.buildIntro(this.getProperty("index"),J)})}}}else{P.empty();new Element("h2",{text:_("Find Friends")}).inject(P);var D=new Element("p",{"class":"upgradeProfile",html:_("To find and invite your friends on netvibes and share content to your community, you need to sign up.<br/><br/>To start finding your friends, you need to sign up.")+"<br/><br/>"}).inject(P);new Element("input",{type:"button","class":"nv-button",value:_("Sign up")}).addEvent("click",function(Q){Q.stop();App.showSignup()}).inject(D)}break;case"inviteFriends":if(User.registered){P=$(P);P.empty();P.addClass("addContent");P.addClass(C);var N=new Element("h2",{text:_("Invite Friends")}).inject(P);var A=new Element("div",{"class":"inviteContent"}).inject(P);App.Panel.Friends.Invite.build(A)}else{P.empty();new Element("h2",{text:_("Invite Friends")}).inject(P);var D=new Element("p",{"class":"upgradeProfile",html:_("To find and invite your friends on netvibes and share content to your community, you need to sign up.<br/><br/>To invite your friends, you need to sign up.")+"<br/><br/>"}).inject(P);new Element("input",{type:"button","class":"nv-button",value:_("Sign up")}).addEvent("click",function(Q){Q.stop();App.showSignup()}).inject(D)}break;default:break}};App.Panel.Friends.updateNumFriends=function(A){if(A&&A.success==true){User.numFriends=A.numFriends;User.numFollowers=A.numFollowers;User.numBlockedFollowers=A.numBlockedFollowers}App.Panel.Friends.tabs.getTab("subscriptions").getFirst().setHTML(_("Friends")+(User.numFriends>0?" <em>"+User.numFriends+"</em>":""));App.Panel.Friends.tabs.getTab("followers").getFirst().setHTML(_("Followers")+(User.numFollowers>0?" <em>"+User.numFollowers+"</em>":""));App.Panel.Friends.tabs.getTabContent("subscriptions").loaded=false;App.Panel.Friends.tabs.getTabContent("followers").loaded=false;if(typeof App.Panel.Friends.tabs.getTab("blockedFollowers")=="object"){App.Panel.Friends.tabs.getTab("blockedFollowers").getFirst().setHTML(_("Blocked Followers")+(User.numBlockedFollowers>0?" <em>"+User.numBlockedFollowers+"</em>":""));App.Panel.Friends.tabs.getTabContent("blockedFollowers").loaded=false}};App.Panel.Friends.Invite={};App.Panel.Friends.Invite.build=function(A){this.container=A;var C="";C+='<div class="friends-finder">';C+='    <h3 class="no-icon">'+_("Type your friends e-mail addresses you would like to invite")+"</h3>";C+='<div class="content">';C+='<label for="emails" class="emails">'+_("Emails (comma separated):")+'</label><input id="emails" class="emails" type="text" />';C+="<textarea class=\"message default\" onfocus=\"if (this.hasClass('default')) { this.removeClass('default'); this.value = '' }\">"+_("Type a personal message here...")+"</textarea>";C+='<label for="emailLang" class="email-lang">'+_("Email language:")+'</label><select id="emailLang" class="email-lang">';var D=new Hash({en_US:_("English"),fr_FR:_("French"),de_DE:_("German"),nl_NL:_("Dutch"),es_es:_("Spanish (Spain)"),it_IT:_("Italian")});D.each(function(F,E){C+='<option value="'+E+'" '+((App.lang==E)?"selected":"")+">"+F+"</option>"});C+="</select>";C+='</div><a class="nv-button"><span>'+_("Send invites")+"</span></a>";C+='<div class="clear"></div></div>';this.container.innerHTML=C;this.emailLang=$$("#nv-panel .friends-finder .email-lang")[1];this.emails=$$("#nv-panel .friends-finder .emails")[1];this.message=$$("#nv-panel .friends-finder .message")[0];var B=$$("#nv-panel .friends-finder .nv-button")[0];B.onclick=App.Panel.Friends.Invite.send.bind(this)};App.Panel.Friends.Invite.onComplete=function(C){var B="";B+='<div class="friends-finder">';B+='    <h3 class="no-icon">'+_("Congratulation!")+"</h3>";B+='    <div class="content">';B+="        <p>"+(this.numEmails>1?_("You have invited {0} contacts.").format(this.numEmails):_("You have invited 1 contact."))+"</p>";B+="    </div>";B+='    <a class="nv-button"><span>'+_("Invite more friends")+'</span></a><div class="clear">';B+="</div>";this.container.innerHTML=B;var A=$$("#nv-panel .friends-finder .nv-button")[0];A.onclick=function(){App.Panel.Friends.tabs.selectTab("inviteFriends",true)}};App.Panel.Friends.Invite.onFailuere=function(){};App.Panel.Friends.Invite.send=function(){if(this.emails.value.length==0){alert(_("You must enter at least 1 e-mail."));this.emails.focus();return }var D=this.emails.value.split(",");this.numEmails=D.length;for(var A=0;A<this.numEmails;A++){D[A]=D[A].trim();if(!D[A].test(/^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/)){alert(_("Invalid email"));return }}var C="";if(!this.message.hasClass("default")){C=this.message.value}var B=new Request.JSON({secure:false,onComplete:this.onComplete.bind(this),onFailure:this.onFailuere.bind(this)}).post(NV_API_PATH+"/friends/invite",{emails:D,message:C,lang:this.emailLang.value});this.container.wait();return false};App.Panel.Friends.Find={};App.Panel.Friends.Find.buildIntro=function(A,B){this.content=B;this.provider=this.providers[A];var B="";B+='<div class="friends-finder">';B+='    <form id="formAddFriend" name="formAddFriend" method="post">';B+='        <h3 style="background-image: url('+this.provider.icon+')">'+(this.provider.label||_("Find in your {0} contacts who is already on Netvibes").format(this.provider.title))+"</h3>";B+='        <div class="content">';B+='            <input id="providerAddFriend" name="provider" type="hidden" value="'+this.provider.id+'" />';if(this.provider.display&&"function"==typeof this.provider.display){B+='<div id="findFriendsAddonContainer"></div>'}B+="</div>";B+='<p class="notice">'+(this.provider.noticeLabel||_("If you are using a public computer don't forget to logout from {0} after you found your friends.").format(this.provider.title))+"</p>";B+="</form>";B+="</div>";this.content.innerHTML=B;if(this.provider.display&&"function"==typeof this.provider.display){this.provider.display($("findFriendsAddonContainer"))}};App.Panel.Friends.Find.onSearchComplete=function(D){this.results=D.results;var C=0;if(this.provider.disableInvite!=true){for(var E=0,B=D.results.length;E<B;E++){C++}}else{for(var E=0,B=D.results.length;E<B;E++){if(typeof D.results[E].id!="undefined"){C++}}}var H="";H+='<div class="friends-finder">';H+='    <h3 class="title no-icon">'+(this.provider.resultLabel||(C>1?_("{0} contacts are not your friends on netvibes yet!").format(C):_("1 contact is not your friend on netvibes yet!")))+"</h3>";H+='    <p class="tools" style="float: right; margin: 2px 0;"> '+_("Select: ")+'<a href="#" class="select">'+_("All")+'</a> / <a href="#" class="select">'+_("None")+'</a> / <a href="#" class="select">'+_("Only netvibes users")+'</a></p><div class="clear"></div>';H+='<div class="content-list"><ul class="list">';for(var E=0,A=0,M=0,B=D.results.length;E<B;E++){if(typeof D.results[E].id!="undefined"){A++;M++;H+='<li class="friend '+(E%2?"odd":"even")+'"><input id="nv-friend-'+E+'" type="checkbox" style="float: right; margin-right: 25px" /><label for="nv-friend-'+E+'"><img style="margin-left: 4px; margin-right: 4px; margin-bottom: -4px;" src="http://'+NV_AVATARS+"/"+D.results[E].id+'/16" /><img style="margin-left: 4px; margin-right: 4px;" src="/img/panel/contacts/nv.png" /><a class="nv" href="http://'+NV_HOST+"/"+D.results[E].username+'" onclick="$(\'nv-friend-'+E+'\').checked = true; return false;" style="margin: 4px;">'+D.results[E].displayName+"</a></label></li>"}else{if(this.provider.disableInvite!=true){A++;H+='<li class="friend '+(E%2?"odd":"even")+'"><input id="friend-'+E+'" type="checkbox" style="float: right; margin-right: 25px" /><label for="friend-'+E+'"><img style="margin-left: 4px; margin-right: 4px; margin-bottom: -4px;" src="http://'+NV_AVATARS+'/1/16" /><a class="nv" style="margin-left: 4px; margin-right: 4px;">'+D.results[E].displayName+"</a></label></li>"}}}if(A==0){H+="<p>"+_("No results.")+"</p>"}H+='</ul></div><a class="nv-button"><span>'+(A>0?_("Let's invite them!"):_("Invite more friends"))+"</span></a>";if(A>0){H+='<a href="#" class="skip">'+(this.provider.skipLabel||_("Skip"))+"</a>"}H+='<div class="clear"></div></div>';this.content.innerHTML=H;if(A>0){var I=$$("#nv-panel .friends-finder a");I[0].onclick=App.Panel.Friends.Find.selectAll.bind(this);I[1].onclick=App.Panel.Friends.Find.selectNone.bind(this);if(M>0&&A-M>0){I[2].onclick=App.Panel.Friends.Find.selectNv.bind(this)}else{I[2].hide();I[2].previousSibling.nodeValue=""}}else{var G=$$("#nv-panel .friends-finder .tools");G[0].hide();var J=$$("#nv-panel .friends-finder .title");J[0].set("text",this.provider.noResult||_("Unfortunately, none of your contacts are on Netvibes."))}var F=$$("#nv-panel .friends-finder .nv-button")[0];if(A>0){if(M==A){F.set("title",_("Once selected, Netvibes users will be added as friends."))}else{F.set("title",_("Once selected, Netvibes users will be added as friends.<br />You will be able to invite others by e-mail in the next step"))}var K=new Tips(F);F.onclick=function(N){N.hide();App.Panel.Friends.Find.subscribe()}.bind(this,K)}else{F.onclick=function(){App.Panel.Friends.tabs.selectTab("addFriends",true)}}if(A>0){var L=$$("#nv-panel .friends-finder .skip")[0];L.onclick=function(){App.Panel.Friends.tabs.selectTab("addFriends",true)}.bind(this)}};App.Panel.Friends.Find.onSearchFailure=function(){App.Panel.Friends.Find.error()};App.Panel.Friends.Find.search=function(B){if(typeof B=="undefined"){var B={}}B.format="json";B.provider=this.provider.id;var A=new Request.JSON({url:NV_API_PATH+"/friends/search",secure:false,onComplete:this.onSearchComplete.bind(this),onFailure:this.onSearchFailure.bind(this)});this.content.wait();A.get(B);return false};App.Panel.Friends.Find.onSubscribeComplete=function(A){App.Panel.Friends.updateNumFriends(A);if(this.provider.disableInvite==true||this.toInvite.length<=0){App.Panel.Friends.Find.congrats()}else{App.Panel.Friends.Find.buildInvite()}};App.Panel.Friends.Find.subscribe=function(){this.toSubscribe=[];this.toInvite=[];for(var B=0,A=this.results.length;B<A;B++){if(typeof this.results[B].id!="undefined"){if($("nv-friend-"+B).checked==true){this.toSubscribe.push(this.results[B].id)}}else{if(this.provider.disableInvite!=true){if($("friend-"+B).checked==true){this.toInvite.push(this.results[B].displayName)}}}}if(this.toSubscribe.length+this.toInvite.length==0){alert(_("Please, select at least 1 contact."));return }if(this.toSubscribe.length>0){this.content.wait();var C=new Request.JSON({secure:false,onComplete:this.onSubscribeComplete.bind(this)}).post(NV_API_PATH+"/account/subscription/add/0",{ids:this.toSubscribe})}else{App.Panel.Friends.Find.buildInvite()}};App.Panel.Friends.Find.buildInvite=function(){var C="";C+='<div class="friends-finder">';if(this.toSubscribe.length>0){C+='    <h3 class="no-icon">'+(this.toSubscribe.length>1?_("Congratulation! You have added {0} contacts as friend").format(this.toSubscribe.length):_("Congratulation! You have added 1 contact as friend"))+"</h3>"}else{C+='    <h3 class="no-icon">'+_("Invite your friends which are not on netvibes")+"</h3>"}C+='<div class="content">';C+=(this.toInvite.length>1?_("We will send a message to the {0} contacts which are not on netvibes:").format(this.toInvite.length):_("We will send a message to the contact which is not on netvibes:"));C+="<textarea class=\"message default\" onfocus=\"this.removeClass('default'); this.value = ''\">"+_("Type a personal message here...")+"</textarea>";C+='<label for="emailLang" class="email-lang">'+_("Email language:")+'</label><select id="emailLang" class="email-lang">';var D=new Hash({en_US:_("English"),fr_FR:_("French"),de_DE:_("German"),nl_NL:_("Dutch"),es_es:_("Spanish (Spain)"),it_IT:_("Italian")});D.each(function(F,E){C+='<option value="'+E+'" '+((App.lang==E)?"selected":"")+">"+F+"</option>"});C+="</select>";C+='</div><a class="nv-button"><span>'+_("Send invites")+'</span></a><a href="#" class="skip">'+_("Skip")+'</a><div class="clear"></div></div>';this.content.innerHTML=C;this.emailLang=$$("#nv-panel .friends-finder .email-lang")[1];this.message=$$("#nv-panel .friends-finder .message")[0];var A=$$("#nv-panel .friends-finder .nv-button")[0];A.onclick=App.Panel.Friends.Find.invite.bind(this);var B=$$("#nv-panel .friends-finder .skip")[0];B.onclick=function(){this.toInvite=[];App.Panel.Friends.Find.congrats()}.bind(this)};App.Panel.Friends.Find.inviteComplete=function(A){this.congrats()};App.Panel.Friends.Find.inviteFailure=function(){this.error()};App.Panel.Friends.Find.invite=function(){var B="";if(!this.message.hasClass("default")){B=this.message.value}var A=new Request.JSON({secure:false,onComplete:this.inviteComplete.bind(this),onFailure:this.inviteFailure.bind(this)}).post(NV_API_PATH+"/friends/invite",{emails:this.toInvite,message:B,lang:this.emailLang.value});this.content.wait();return false};App.Panel.Friends.Find.selectAll=function(){for(var B=0,A=this.results.length;B<A;B++){if(typeof this.results[B].id!="undefined"){$("nv-friend-"+B).checked=true}else{if(this.provider.disableInvite!=true){$("friend-"+B).checked=true}}}};App.Panel.Friends.Find.selectNone=function(){for(var B=0,A=this.results.length;B<A;B++){if(typeof this.results[B].id!="undefined"){$("nv-friend-"+B).checked=false}else{if(this.provider.disableInvite!=true){$("friend-"+B).checked=false}}}};App.Panel.Friends.Find.selectNv=function(){for(var B=0,A=this.results.length;B<A;B++){if(typeof this.results[B].id!="undefined"){$("nv-friend-"+B).checked=true}else{if(this.provider.disableInvite!=true){$("friend-"+B).checked=false}}}};App.Panel.Friends.Find.congrats=function(){var B="";B+='<div class="friends-finder">';B+='    <h3 class="no-icon">'+_("Congratulation!")+"</h3>";B+='    <div class="content">';if(this.toSubscribe.length>0){B+="        <p>"+(this.toSubscribe.length>1?_("You have added {0} contacts as friend.").format(this.toSubscribe.length):_("You have added 1 contact as friend."))+"</p>"}if(this.toInvite.length>0){B+="        <p>"+(this.toInvite.length>1?_("You have invited {0} contacts.").format(this.toInvite.length):_("You have invited 1 contact."))+"</p>"}if(this.toSubscribe.length==0&&this.toInvite.length==0){B+="        <p>"+_("You have not invited any friend.").format(this.toInvite.length)+"</p>"}B+="    </div>";B+='    <a class="nv-button"><span>'+_("Invite more friends")+'</span></a><div class="clear">';B+="</div>";this.content.innerHTML=B;var A=$$("#nv-panel .friends-finder .nv-button")[0];A.onclick=function(){App.Panel.Friends.tabs.selectTab("addFriends",true)}};App.Panel.Friends.Find.error=function(C){var B="";B+='<div class="friends-finder">';B+='    <h3 class="no-icon">'+(C||_("An error occured, please retry later."))+"</h3>";B+='    <a class="nv-button"><span>'+_("Invite more friends")+'</span></a><div class="clear">';B+="</div>";this.content.innerHTML=B;var A=$$("#nv-panel .friends-finder .nv-button")[0];A.onclick=function(){App.Panel.Friends.tabs.selectTab("addFriends",true)}};App.Panel.Friends.Find.providers=[{id:"netvibes",title:_("You may know..."),disabled:true,resultLabel:_("You have the most mutual friends with these people"),noResult:_("Your friends have no mutual friends"),skipLabel:_("I don't know them"),disableInvite:true,icon:App.getStaticUrl("/img/panel/import/netvibes.png"),wellcomeIcon:App.getStaticUrl("/img/panel/contacts/wc-netvibes.png"),display:function(A){App.Panel.Friends.Find.search()}},{id:"gmail",title:_("Gmail"),disabled:false,icon:App.getStaticUrl("/img/panel/import/gmail.png"),wellcomeIcon:App.getStaticUrl("/img/panel/contacts/wc-gmail.png"),display:function(C){var F;var E;function D(){F=window.open("https://www.google.com/accounts/AuthSubRequest?scope=http%3A%2F%2Fwww.google.com%2Fm8%2Ffeeds%2F&session=1&secure=0&next="+encodeURIComponent("http://"+NV_HOST+"/ajax/friends/gmail.php"),"Gmail","menubar=no,toolbar=no,status=no,width=646,height=436");if(F){E=setInterval(B,500)}}function B(){if(F.closed){clearInterval(E);A()}}function G(){C.innerHTML="";var I=document.createElement("p");I.innerHTML=_("Please click below to log in to your Gmail account and start finding friends.");var J=document.createElement("a");J.className="nv-button";J.href="#";J.onclick=D;J.innerHTML="<span>"+_("Start")+"</span>";var H=document.createElement("div");H.className="clear";C.appendChild(I);C.appendChild(J);C.appendChild(H)}function A(){var H=Cookie.get("gmail-token");if(typeof H!="undefined"&&H){App.Panel.Friends.Find.search()}else{G()}}G()}},{id:"yahoo",title:_("Yahoo! Mail"),icon:App.getStaticUrl("/img/panel/import/yahoo.png"),wellcomeIcon:App.getStaticUrl("/img/panel/contacts/wc-yahoo.png"),display:function(C){var F;var E;function D(){F=window.open("/ajax/friends/yahoo.php?action=login","Yahoo","scrollbars=yes,resizable=yes,menubar=no,toolbar=no,status=no,width=800,height=600");if(F){E=setInterval(B,500)}}function B(){if(F.closed){clearInterval(E);A()}}function G(){C.innerHTML="";var I=document.createElement("p");I.innerHTML=_("Please click below to log in to your Yahoo! account and start finding friends.");var J=document.createElement("a");J.className="nv-button";J.href="#";J.onclick=D;J.innerHTML="<span>"+_("Start")+"</span>";var H=document.createElement("div");H.className="clear";C.appendChild(I);C.appendChild(J);C.appendChild(H)}function A(){var H=Cookie.get("yahoo-wssid");if(typeof H!="undefined"&&H){App.Panel.Friends.Find.search()}else{G()}}G()}},{id:"live",title:_("Hotmail / MSN"),icon:App.getStaticUrl("/img/panel/import/hotmail.png"),wellcomeIcon:App.getStaticUrl("/img/panel/contacts/wc-live.png"),display:function(C){var F;var E;function D(){F=window.open("/ajax/friends/live.php?action=login","Live","scrollbars=yes,resizable=yes,menubar=no,toolbar=no,status=no,width=800,height=600");if(F){E=setInterval(B,500)}}function B(){if(F.closed){clearInterval(E);A()}}function G(){C.innerHTML="";var I=document.createElement("p");I.innerHTML=_("Please click below to log in to your Windows Live account and start finding friends.");var J=document.createElement("a");J.className="nv-button";J.href="#";J.onclick=D;J.innerHTML="<span>"+_("Start")+"</span>";var H=document.createElement("div");H.className="clear";C.appendChild(I);C.appendChild(J);C.appendChild(H)}function A(){var H=Cookie.get("live-delauthtoken");if(typeof H!="undefined"&&H){App.Panel.Friends.Find.search()}else{G()}}G()}},{id:"facebook",title:_("Facebook"),disableInvite:true,icon:App.getStaticUrl("/img/panel/import/facebook.png"),wellcomeIcon:App.getStaticUrl("/img/panel/contacts/wc-facebook.png"),display:function(C){var F;var E;function D(){F=window.open("/ajax/friends/facebook.php?action=login","Facebook","menubar=no,toolbar=no,status=no,width=646,height=436");if(F){E=setInterval(B,500)}}function B(){if(F.closed){clearInterval(E);A()}}function G(){C.innerHTML="";var I=document.createElement("p");I.innerHTML=_("Please click below to log in to your Facebook account and start finding friends.");var J=document.createElement("a");J.className="nv-button";J.href="#";J.onclick=D;J.innerHTML="<span>"+_("Start")+"</span>";var H=document.createElement("div");H.className="clear";C.appendChild(I);C.appendChild(J);C.appendChild(H)}function A(){var H=Cookie.get("fb-uid");var I=Cookie.get("fb-session_key");if(typeof H!="undefined"&&H&&typeof I!="undefined"&&I){App.Panel.Friends.Find.search()}else{G()}}A()}},{id:"aol",title:_("AIM"),disabled:true,disableInvite:true,icon:App.getStaticUrl("/img/panel/import/aim.png"),wellcomeIcon:App.getStaticUrl("/img/panel/contacts/wc-aol.png"),display:function(C){var F;var E;function D(){F=window.open("/ajax/friends/aol.php?action=login","Aol","scrollbars=yes,resizable=yes,menubar=no,toolbar=no,status=no,width=525,height=325");if(F){E=setInterval(B,500)}}function B(){if(F.closed){clearInterval(E);A()}}function G(){C.innerHTML="";var I=document.createElement("p");I.innerHTML=_("Please click below to log in to your Aol account and start finding friends.");var J=document.createElement("a");J.className="nv-button";J.href="#";J.onclick=D;J.innerHTML="<span>"+_("Start")+"</span>";var H=document.createElement("div");H.className="clear";C.appendChild(I);C.appendChild(J);C.appendChild(H)}function A(){var H=Cookie.get("aol-token");if(typeof H!="undefined"&&H){App.Panel.Friends.Find.search()}else{G()}}G()}},{id:"twitter",title:_("Twitter"),disabled:true,disableInvite:true,icon:App.getStaticUrl("/img/panel/import/twitter.png"),wellcomeIcon:App.getStaticUrl("/img/panel/contacts/wc-twitter.png"),display:function(A){A.innerHTML="";var D=new Element("p",{"class":"field"}).inject(A);new Element("label",{"for":"loginAddFriend"}).setText(_("Twitter login:")).inject(D);var B=new Element("input",{id:"loginAddFriend",name:"login",type:"text","class":"text email",maxlength:"200"}).inject(D);var C=new Element("a",{"class":"nv-button"}).inject(D);new Element("span").setText(_("Start")).inject(C);new Element("div",{"class":"clear"}).inject(D);C.onclick=function(){if(B.value.length>0){App.Panel.Friends.Find.search({login:B.value})}else{alert(_("Enter a Twitter login."))}}}},{id:"flickr",title:_("Flickr"),disabled:true,disableInvite:true,icon:App.getStaticUrl("/img/panel/import/flickr.png"),wellcomeIcon:App.getStaticUrl("/img/panel/contacts/wc-flickr.png"),display:function(A){A.innerHTML="";var D=new Element("p",{"class":"field"}).inject(A);new Element("label",{"for":"loginAddFriend"}).set("text",_("Flickr email:")).inject(D);var B=new Element("input",{id:"loginAddFriend",name:"login",type:"text","class":"text email",maxlength:"200"}).inject(D);var C=new Element("a",{"class":"nv-button"}).inject(D);new Element("span").set("text",_("Start")).inject(C);new Element("div",{"class":"clear"}).inject(D);C.onclick=function(){if(B.value.length>0){App.Panel.Friends.Find.search({login:B.value})}else{alert(_("Enter a Flickr email."))}}}},{id:"csv",title:_("Outlook / Mail"),disabled:false,icon:App.getStaticUrl("/img/panel/import/csv.png"),wellcomeIcon:App.getStaticUrl("/img/panel/contacts/wc-vcard.png"),label:_("Select your local address book file."),noticeLabel:" ",display:function(A){var B;var F;function E(){if(B.contentDocument.location=="http://"+NV_HOST+"/uploadContacts.php"){var J=JSON.decode(B.contentDocument.body.innerHTML);clearInterval(F);if(!J||typeof J.numResults=="undefined"||typeof J.error!="undefined"){App.Panel.Friends.Find.error(_("Couldn't read your file. Is it well formated file?"))}else{App.Panel.Friends.Find.onSearchComplete(J)}}}var G=new Element("p",{"class":"field"}).inject(A);new Element("label",{"for":"loginAddFriend"}).set("text",_("For best results, please use a valid CSV file or vCard file. (Generated by Outlook, Thunderbird, Entourage, Apple Mail or Gmail...)")).inject(G);var I=new Element("p",{"class":"field"}).inject(A);var H=new Element("form",{target:"target_upload",action:"/uploadContacts.php",enctype:"multipart/form-data",encoding:"multipart/form-data",method:"post"}).inject(I);B=new Element("iframe",{id:"target_upload",name:"target_upload",src:"about:blank",width:"0",height:"0",frameborder:"0"}).inject(I);var C=new Element("fieldset").inject(H);new Element("input",{type:"hidden",name:"MAX_FILE_SIZE",value:"500000"}).inject(C);new Element("input",{type:"file",name:"userfile","class":"file"}).inject(C);var D=new Element("a",{"class":"nv-button"}).inject(A);new Element("span").setText(_("Start")).inject(D);new Element("div",{"class":"clear"}).inject(A);D.onclick=function(){H.submit();F=setInterval(E,500)}}}];;
App.Panel.Timeline={};App.Panel.Timeline.onShow=function(){App.Panel.Timeline.onLoading()};App.Panel.Timeline.onLoading=function(C){App.Panel.element.empty();App.Panel.Timeline.tabs=new Netvibes.UI.TabView({position:"left",classTabList:"nav",classTabContent:"tabContent",allowReload:true});App.Panel.Timeline.searchForm=App.Panel.buildSearchForm(this,{value:_("Search for activities")});App.Panel.Timeline.tabs.addTab("Search",{text:App.Panel.Timeline.searchForm}).onclick=null;App.Panel.Timeline.tabs.addTab("privateTimeline",{text:_("My private activity")});var A=$(App.Panel.Timeline.tabs.addTab("publicTimeline",{text:_("My public activity")}));if(!User.registered){A.addClass("fakeDisabled")}var B=App.Panel.Timeline.tabs.addTab("friendsTimeline",{text:_("Friends activity")});App.Panel.Timeline.tabs.observe("activeTabChange",App.Panel.Timeline.onActiveTabChanged);App.Panel.Timeline.tabs.selectTab("friendsTimeline");App.Panel.Timeline.tabs.appendTo(App.Panel.element);var D=new Element("a",{href:"http://"+NV_HOST+"/activities","class":"nv-button",id:"goToActivities"}).inject(B.getParent().getParent());new Element("span",{text:_("Browse all activities")}).inject(D)};App.Panel.Timeline.onExecuteSearch=function(A){App.Panel.Timeline.tabs.selectTab("Search")};App.Panel.Timeline.onActiveTabChanged=function(A){var D=$(App.Panel.Timeline.tabs.getTabContent(A));if(!D.loaded){D.empty();D.addClass(A);if(typeof App.Panel.Timeline.current!="undefined"){delete (App.Panel.Timeline.current)}var H=App.Panel.Timeline.tabs.getTab(A).getFirst().get("text");var F=new Element("h2",{text:H}).inject(D);switch(A){case"Search":var G=App.Panel.Timeline.searchForm.firstChild.value;F.set("text",_("Search for")+" "+G);var E={format:"atom",query:G};var B=NV_API_PATH+"timeline/search?"+Hash.toQueryString(E);var I=new Element("span",{"class":"widget feed",href:B}).store("richIcon","http://eco.netvibes.com/img/thumbnail/ginger/nopreview-64-48.png.feed.png").store("dataObj",{moduleName:"RssReader",title:"",data:{feedUrl:B}}).injectInside(F);new Element("img",{"class":"icon",src:"/img/feed.png"}).inject(I);new Element("a",{"class":"title",text:_("Keep track of this search"),href:"javascript:void(0)"}).inject(I);App.Panel.AddContent.attachWidgetEvents();App.Panel.Timeline.current=new Netvibes.UI.Timeline({id:"searchTimeline",search:G});break;case"friendsTimeline":App.Panel.Timeline.current=new Netvibes.UI.Timeline({id:"friendsTimeline",showFilters:true,search:Netvibes.UI.Timeline.Query.friends}).addEvent("complete",function(){if(User.custom.lastReadActivity&&!App.Panel.Timeline.unread){return }var K=null;var M=$("friendsTimeline").getElementsByTagName("li");for(var N=0,L=M.length;N<L;N++){if(N==0){K=M[N].retrieve("id")}if((N+1)==App.Panel.Timeline.unread&&M[N].nextSibling){var J=new Element("li",{"class":"separator",text:_("Older items")}).inject(M[N],"after")}}App.Panel.Timeline.resetUnreadCount(K)});break;case"privateTimeline":App.Panel.Timeline.current=new Netvibes.UI.Timeline({id:"privateTimeline",search:Netvibes.UI.Timeline.Query["private"]});break;case"publicTimeline":if(User.registered){App.Panel.Timeline.current=new Netvibes.UI.Timeline({id:"publicTimeline",search:Netvibes.UI.Timeline.Query["public"],showFilters:true})}else{App.Panel.Timeline.current=false}break}if(App.Panel.Timeline.current){D.appendChild(App.Panel.Timeline.current.getElement())}else{F.set("text",_("Create your profile"));var C=new Element("p",{"class":"upgradeProfile",html:_("Your public activity is a stream your followers can subscribe to.<br/>By making them public, you can share your favorites articles, widgets or status.<br/><br/>To activate your public activity, you need to sign up.")+"<br/><br/>"}).inject(D);new Element("input",{type:"button","class":"nv-button",value:_("Sign up")}).addEvent("click",function(J){J.stop();App.showSignup()}).inject(C)}}};App.Panel.Timeline.unreadInterval=null;App.Panel.Timeline.unread=0;App.Panel.Timeline.getUnreadCount=function(){App.Request.newRequest({url:NV_API_PATH+"/timeline/unread-count",headers:{Accept:"application/json"},onComplete:function(B){var A=JSON.decode(B);if(A){App.Panel.Timeline.setUnreadCount(A.unread)}}}).GET()};App.Panel.Timeline.setUnreadCount=function(B){var A=$("activities-unread-count");if(!A){return }B=parseInt(B,10);if(B){A.set("text",B>=99?"99+":B).setStyle("display","");if(App.Panel.current=="Timeline"){App.Panel.current=""}}else{A.set("text","").setStyle("display","none")}App.Panel.Timeline.unread=B};App.Panel.Timeline.resetUnreadCount=function(A){if(!A){return }App.Panel.Timeline.setUnreadCount(0);App.Request.newRequest({url:NV_API_PATH+"/timeline/unread-count/reset",onComplete:function(B){$("activities-unread-count").set("text","")}}).POST({eventId:A})};;
App.Panel.Profile={};App.Panel.Profile.onShow=function(){App.Panel.element.empty();if(!User.username&&!App.visit){App.Panel.MyUniverse.buildTeaser();return }App.Panel.Profile.show((App.visit&&App.visit.id&&!App.visit.my)?App.visit.userId:"my")};App.Panel.Profile.show=function(A){App.Panel.element.empty();var B=new App.UI.Profile(App.Panel.element).show(A)};;
;
if(typeof Netvibes=="undefined"||!Netvibes){var Netvibes={}}var NEW='<img src="'+NV_STATIC+'/img/icons/new.gif" style="border: 0; margin-top: -5px;margin-left:2px" />';Netvibes.Settings={};Netvibes.Settings.navSettings=[];Netvibes.Settings.navSettings.push({name:"general",title:_("General"),type:"Netvibes.Settings.General"});Netvibes.Settings.navSettings.push({name:"country",title:_("Local Content"),type:"Netvibes.Settings.LocalContent"});Netvibes.Settings.navSettings.push({name:"language",title:_("Languages"),type:"Netvibes.Settings.Language"});Netvibes.Settings.navThemes=[];Netvibes.Settings.navThemes.push({name:"theme",title:_("Gallery")+NEW,type:"Netvibes.Settings.Theme"});Netvibes.Settings.navThemes.push({name:"wallpaper",title:_("Customize"),type:"Netvibes.Settings.Wallpaper"});Netvibes.Settings.navThemes.push({name:"create",title:_("Create")+NEW,type:"Netvibes.Settings.CreateTheme"});Netvibes.SettingsPanel=new Class({Extends:ModalDialog,initialize:function(E,C){if($(E)){E.empty()}this.parent(E,C);this.pages=[];this.selectedPage="";this.listElement=null;this.paneElement=null;this.heading.innerHTML=_("Settings");this.listElement=new Element("dl",{"class":"settings"});this.listElement.adopt(new Element("dt",{text:_("Settings")}));for(var D=0,F;F=Netvibes.Settings.navSettings[D];D++){this._buildNavItem(F)}this.listElement.adopt(new Element("dt",{text:_("Themes"),"class":"themes"}));for(var D=0,F;F=Netvibes.Settings.navThemes[D];D++){this._buildNavItem(F)}this.innerFrame.appendChild(this.listElement);this.paneElement=new Element("div");this.paneElement.className="page";this.innerFrame.appendChild(this.paneElement);var A=document.createElement("div");A.className="bottom";this.innerFrame.appendChild(A);var G=document.createElement("a");G.href="javascript:void(0)";G.className="discard";G.innerHTML=_("Discard changes");G.onclick=this.onDiscardChanges.bindAsEventListener(this);A.appendChild(G);var B=document.createElement("input");B.type="button";B.className="done";B.value=_("Done");B.onclick=this.hide.bindAsEventListener(this);A.appendChild(B)},setCurrentPage:function(pageName){var page={};var links=this.listElement.getElements("a");var currentLink=null;if(typeof pageName=="string"){for(var i=0,l=links.length;i<l;i++){currentLink=links[i];page=currentLink.retrieve("setting");if(page.name==pageName){break}}}switch(pageName){case"general":App.report("click.pref.general");break;case"country":App.report("click.pref.locale");break;case"language":App.report("click.pref.lang");break;case"theme":App.report("click.pref.theme");break;case"wallpaper":App.report("click.pref.wall");break;case"create":App.report("click.pref.create");break}this.selectedPage=pageName;if(pageName=="theme"||pageName=="wallpaper"){setTimeout(this.overlay.setClear.bind(this.overlay),500)}else{this.overlay.setDark()}links.removeClass("selected");currentLink.addClass("selected");for(var i=0,link;link=links[i];i++){var page=link.retrieve("setting");if(page.name==pageName){if(!page.manager){page.manager=eval("new "+page.type)}if(page.contentNode==null){page.contentNode=page.manager.load();Element.hide(page.contentNode);this.paneElement.appendChild(page.contentNode);if(typeof (page.manager.loaded)=="function"){page.manager.loaded()}}this.paneElement.className="page "+page.name;Element.show(page.contentNode);if(typeof (page.manager.activate)=="function"){try{page.manager.activate()}catch(e){}}}else{if(page.contentNode){Element.hide(page.contentNode)}}}},onSelectionChanged:function(A){this.setCurrentPage(A.retrieve("setting").name)},onDiscardChanges:function(D){this.discarding=true;App.pageCustom=$unlink(this.previousCustom);var B=this.listElement.getElements("a");for(var C=0,A=B.length;C<A;C++){currentLink=B[C];page=currentLink.retrieve("setting");if(page.manager&&page.name=="general"){page.manager.reset(App.pageCustom)}}App.Theme.refresh(true);App.savePageCustom();this.hide(D)},onShow:function(){this.previousCustom=$unlink(App.pageCustom);this.discarding=false;App.keyboardFocus="settings"},onClose:function(){App.keyboardFocus="module";if(this.discarding){this.previousCustom={};return }else{if(this.previousCustom.themeUrl!=App.pageCustom.themeUrl){App.report("theme.new",{ecoId:Netvibes.Settings.Theme.selectedTheme})}this.previousCustom={}}var B=Netvibes.Settings.General.iconType;if(B&&B!=App.pageCustom.iconType){window.location.reload()}var D=Netvibes.Settings.Language.selectedLang;var A=Netvibes.Settings.LocalContent.selectedLocale;var E=(/^[a-z]{2}(_[A-Z]{2,5}){0,2}$/.test(D)&&D!=App.lang);if(E){var C=NV_PATH+"?lang="+D+(A?"&locale="+A:"");if(App.visit&&App.visit.username.length>0){C+="&visit="+App.visit.username}window.location.href=C;return }if(A){if(App.startWizard){App.startWizard.setLocale(code)}App.Request.saveUserData("user.locale",{data:{locale:A},onSuccess:function(G){var F=JSON.decode(G);if(F&&F.success){App.locale=User.locale=A;if(App.Panel.AddContent.Filters){App.Panel.AddContent.Filters.initialized=false}if(App.Panel.current=="AddContent"){App.Panel.element.loaded=false;App.Panel.open("AddContent")}}}})}},_buildNavItem:function(A){var C=new Element("dd",{"class":A.name});var B=new Element("a",{href:"javascript:void(0)",hidefocus:"hidefocus",html:A.title});B.addEvent("click",this.onSelectionChanged.bind(this,B));B.store("setting",A).inject(C);this.listElement.adopt(C)}});Netvibes.Settings.getSubmitThemeUrl=function(){var A="http://"+NV_ECO+"/themes/create/editor/get?";var C=App.pageCustom.themeUrl.match(/screen\.css\.php\?url=(.*)/);if(C){A+="theme="+C[1]}else{A+="native=1"}if(App.pageCustom.headerTextColor){A+="&header-text-color="+encodeURIComponent(App.pageCustom.headerTextColor)}if(App.pageCustom.headerColor){A+="&header-background-color="+encodeURIComponent(App.pageCustom.headerColor)}if(App.pageCustom.headerBackground){var B=App.pageCustom.headerBackground;if(B.substr(0,7)!="http://"){B=App.getStaticUrl(B)}A+=App.pageCustom.headerCenter?"&header-center-image-url=":"&header-tile-image-url=";A+=encodeURIComponent(B)}if(App.pageCustom.bodyColor){A+="&gadget-area-background-color="+encodeURIComponent(App.pageCustom.bodyColor)}if(App.pageCustom.bodyBackground){var B=App.pageCustom.bodyBackground;if(B.substr(0,7)!="http://"){B=App.getStaticUrl(B)}A+="&gadget-area-tile-image-url="+encodeURIComponent(B)}return A.replace("?&","?").replace(/\.(jpg|png|gif|xml)/g,"%2E$1")};window._settingsPanel=null;var SettingsPanel={};SettingsPanel.open=function(A){App.report("click.pref");if(window._settingsPanel==null){window._settingsPanel=new Netvibes.SettingsPanel("nv-settings",{overlayClassName:"overlay_settings",draggable:true})}window._settingsPanel.setOptions({onClosed:Function.empty,fadeEffect:(App.pageCustom.enableFx=="1")});window._settingsPanel.show();if(typeof A=="undefined"){A=window._settingsPanel.selectedPage||"theme"}window._settingsPanel.setCurrentPage(A)};SettingsPanel.close=function(){if(window._settingsPanel){window._settingsPanel.hide(true)}};SettingsPanel.isOpen=function(){return window._settingsPanel&&window._settingsPanel.isVisible()};Netvibes.SetAsStartPage=new Class({Extends:ModalDialog,initialize:function(B,A){this.parent(B,A);this.setTitle(_("Set Netvibes as your startpage"));this.getContent()},getContent:function(){this.content=document.createElement("div");Element.addClassName(this.content,"page");var C="";if(Browser.isFirefox){C+="<p>Open Firefox options, go to 'Main' and click on 'Use current page'.</p>";C+="<p style='text-align:center'><img src='img/help/startpage/win-ffx-01.png' /> <img src='img/help/startpage/win-ffx-02.png' /></p>"}else{if(Browser.isChrome){C+="<p>Open Chrome options, go to 'Basics' and select 'Open this page:'.</p>";C+="<p style='text-align:center'><img src='img/help/startpage/win-chrome-01.png' /> <img src='img/help/startpage/win-chrome-02.png' /></p>"}else{if(Browser.isSafari){C+="<p>Open Safari preferences, go to 'General' and click on 'Set to current page'.</p>";C+="<p style='text-align:center'><img src='img/help/startpage/safari1.png' /> <img src='img/help/startpage/safari2.png' /></p>"}else{if(Browser.isOpera){C+="<p>Open Opera preferences, go to 'General' and click on 'Use current'.</p>";C+="<p style='text-align:center'><img src='img/help/startpage/win-op-01.png' /> <img src='img/help/startpage/win-op-02.png' /></p>"}else{C+="<p>Please refer to your browser manuel to know how to set Netvibes as your start page.</p>"}}}}this.content.innerHTML=C;this.innerFrame.appendChild(this.content);var A=document.createElement("div");A.className="bottom";A.style.position="absolute";A.style.bottom="10px";A.style[App.dirRTL?"left":"right"]="10px";this.innerFrame.appendChild(A);var B=document.createElement("input");B.type="button";B.className="done";Element.addClassName(B,"button");B.value=_("Done");B.onclick=this.hide.bindAsEventListener(this);B.style.position="relative";B.style.width="10em";A.appendChild(B);return this.content}});window._SetAsStartPage=null;App.showSetAsStartPage=function(){if(window._SetAsStartPage==null){window._SetAsStartPage=new Netvibes.SetAsStartPage("nv-startpage",{width:580,fadeEffect:(App.pageCustom.enableFx=="1")})}window._SetAsStartPage.show()};window._loginPanel=null;App.showLoginPanel=function(){App.showSignUpPanel()};;
Netvibes.UI.StartTips=new Class({Implements:[Events,Options],initialize:function(A){this.tips=[{text:_("Click here to start personalizing this page"),element:"#addContentLink"}];this.nextIndex=0;this.tip=new Element("div",{"class":"tip balloon",styles:{position:"absolute",top:0,left:0}})},start:function(){this.tip.inject(document.body);var A='<div class="content"><p class="text"></p>';if(this.tips.length>1){A+='<p class="bottom"><span class="steps">'+this.nextIndex+1+"/"+this.tips.length+'</span> | <a rel="next" href="javascript:void(0)">'+_("next tip")+"</a></p>"}A+='<p><img id="tipClose" class="close" alt="" src="/img/closeMod.gif"/></p></div>';this.tip.setHTML(A);if(this.tips.length>1){$$('.tip a[rel="next"]')[0].onclick=this.onClick.bindWithEvent(this)}$$(".tip img#tipClose")[0].onclick=this.end.bindWithEvent(this);this.dimensions=this.tip.getSize();this.showNext();this.onDocumentClickRef=this.onDocumentClick.bindWithEvent(this);document.addEvent("click",this.onDocumentClickRef)},showNext:function(){var C=$$(this.tips[this.nextIndex].element)[0].getPosition();var B=$$(this.tips[this.nextIndex].element)[0].getSize();var A=this.dimensions.x;if(A+C.x+5>document.getSize().x){this.tip.addClass("balloonRight");this.tip.morph({top:C.y+B.y,left:C.x-A+B.x-5})}else{this.tip.morph({top:C.y+B.y,left:C.x+5})}if(this.tips.length>1){$$(".tip span.steps")[0].setHTML(this.nextIndex+1+"/"+this.tips.length)}$$(".tip p.text")[0].setHTML(this.tips[this.nextIndex].text);this.nextIndex++},end:function(){this.tip.destroy();this.tip=null;document.removeEvent("click",this.onDocumentClickRef);delete Netvibes.UI.StartTips},onClick:function(A){if(this.nextIndex<this.tips.length){this.showNext()}else{this.end()}},onDocumentClick:function(A){if(!this.tip){return }if(Position.within(this.tip,A.page.x,A.page.y)){A.stop();return false}this.end()}});;
Netvibes.Settings.General=Class.create();Netvibes.Settings.General.prototype={initialize:function(){Netvibes.Settings.General.iconType=App.pageCustom.iconType},load:function(){this.contentNode=document.createElement("div");var A="";A+="<h2>"+_("General settings")+"</h2>";A+="<fieldset>";A+="<legend>"+_("Interface")+"</legend>";A+='<p class="option">';A+='<input id="optionShowPageTitle" type="checkbox" /> ';A+='<label for="optionShowPageTitle">'+_("Display page title")+"</label> - ";A+='<em class="help">'+_("Uncheck to save space.")+"</em>";A+="</p>";if(!App.visit){A+='<p class="option">';A+='<input id="optionEnableSearch" type="checkbox" /> ';A+='<label for="optionEnableSearch">'+_("Display find area")+"</label> - ";A+='<em class="help">'+_("Uncheck if you don't want to use it.")+"</em>";A+="</p>"}else{A+='<p class="option">';A+='<input id="optionHidePublicTabs" type="checkbox" /> ';A+='<label for="optionHidePublicTabs">'+_("Hide public page tabs ")+"</label> - ";A+='<em class="help">'+_("Hide tabs for everyone except you.")+"</em>";A+="</p>"}A+='<p class="option">';A+='<input id="optionEnableShortcuts" type="checkbox" /> ';A+='<label for="optionEnableShortcuts">'+_("Enable keyboard navigation")+"</label> - ";A+='<em class="help">'+_("Enables shortcuts")+" ("+_('<a href="{0}">what\'s this?</a>').format("http://faq.netvibes.com/keyboard_shortcuts")+").</em>";A+="</p>";A+='<p class="option">';A+='<label for="optionIconType">'+_("Show actions as")+"</label> ";A+='<select id="optionIconType">';A+='<option value="text">'+_("text")+"</option>";A+='<option value="img">'+_("icon")+"</option>";A+="</select> ";A+=' - <em class="help">('+_("The page will reload automatically")+")</em>";A+="</p>";A+="</fieldset>";A+="<fieldset>";A+="<legend>"+_("Search")+"</legend>";A+='<p class="option">';A+='<input id="optionSearchTabShow" type="checkbox" /> ';A+='<label for="optionSearchTabShow">'+_("Display search")+"</label> - ";A+='<em class="help">'+_("Uncheck if you don't want to use it.")+"</em>";A+="</p>";A+='<p class="option">';A+='<label for="optionSearchTabPosition">'+_("Search position")+"</label> ";A+='<select id="optionSearchTabPosition">';A+='<option value="1">'+_("above title")+"</option>";A+='<option value="2">'+_("below title")+"</option>";A+="</select>";A+="</p>";A+='<p class="option">';A+='<label for="optionSearchTabNew">'+_("Show search results in")+"</label> ";A+='<select id="optionSearchTabNew">';A+='<option value="1">'+_("a new tab")+"</option>";A+='<option value="0">'+_("same tab")+"</option>";A+="</select>";A+="</p>";A+="</fieldset>";A+="<fieldset>";A+="<legend>"+_("Modules")+"</legend>";A+='<p class="option first">';A+='<input id="optionDisplayFavicons" type="checkbox" /> ';A+='<label for="optionDisplayFavicons">'+_("Display favicons")+"</label> - ";A+='<em class="help">'+_("Displays favicons of modules.")+"</em>";A+="</p>";A+='<p class="option">';A+='<input id="optionGiveRssMoreSpace" type="checkbox" /> ';A+='<label for="optionGiveRssMoreSpace">'+_("Give feed items more space")+"</label> - ";A+='<em class="help">'+_("Improves readability.")+"</em>";A+="</p>";A+='<p class="option">';A+='<input id="optionShowRssNavigation" type="checkbox" /> ';A+='<label for="optionShowRssNavigation">'+_("Enable feed pagination")+"</label> - ";A+='<em class="help">'+_("Display next/previous arrows.")+"</em>";A+="</p>";A+='<p class="option">';A+='<label for="optionUnreadPosition">'+_("Display unread count on the")+"</label> ";A+='<select id="optionUnreadPosition">';A+='<option value="left">'+_("left")+"</option>";A+='<option value="right">'+_("right")+"</option>";A+="</select>";A+="</p>";A+="</fieldset>";A+="<fieldset>";A+="<legend>"+_("Performance")+"</legend>";A+='<p class="option">';A+='<input id="optionDontPreload" type="checkbox" /> ';A+='<label for="optionDontPreload">'+_("Only load modules for current tab")+"</label> - ";A+='<em class="help">'+_("Reduces load for slow connections.")+"</em>";A+="</p>";A+='<p class="option last">';A+='<input id="optionEnableFx" type="checkbox" /> ';A+='<label for="optionEnableFx">'+_("Enable visual effects")+"</label>";A+="</p>";A+="</fieldset>";A+='<p style="text-align:right"><a id="restoreGeneralSettings" href="#">'+_("Restore defaults")+"</a></p>";this.contentNode.innerHTML=A;return this.contentNode},loaded:function(){this.attachEvents()},attachEvents:function(A){this.optionShowPageTitle=$("optionShowPageTitle");this.optionShowPageTitle.checked=(App.pageCustom.showTitle=="1");this.optionShowPageTitle.onclick=this.onShowPageTitle.bindAsEventListener(this);this.optionGiveRssMoreSpace=$("optionGiveRssMoreSpace");this.optionGiveRssMoreSpace.checked=(App.pageCustom.rssSpace=="1");this.optionGiveRssMoreSpace.onclick=this.onGiveRssMoreSpace.bindAsEventListener(this);this.optionShowRssNavigation=$("optionShowRssNavigation");this.optionShowRssNavigation.checked=(App.pageCustom.showFeedNav=="1");this.optionShowRssNavigation.onclick=this.onShowRssNavigation.bindAsEventListener(this);this.optionDisplayFavicons=$("optionDisplayFavicons");this.optionDisplayFavicons.checked=(App.pageCustom.hideFavIcons!="1");this.optionDisplayFavicons.onclick=this.onDisplayFavicons.bindAsEventListener(this);this.optionDontPreload=$("optionDontPreload");this.optionDontPreload.checked=(App.pageCustom.dontPreload=="1");this.optionDontPreload.onclick=this.onDontPreload.bindAsEventListener(this);this.optionEnableShortcuts=$("optionEnableShortcuts");this.optionEnableShortcuts.checked=(App.pageCustom.keyboardNav=="1");this.optionEnableShortcuts.onclick=this.onEnableShortcuts.bindAsEventListener(this);this.optionIconType=$("optionIconType");this.optionIconType.value=App.pageCustom.iconType;this.optionIconType.onchange=this.onChangeIconType.bindAsEventListener(this);if(!App.visit){this.optionEnableSearch=$("optionEnableSearch");this.optionEnableSearch.checked=(App.pageCustom.hideSearch!="1");this.optionEnableSearch.onclick=this.onEnableSearch.bindAsEventListener(this)}else{this.optionHidePublicTabs=$("optionHidePublicTabs");this.optionHidePublicTabs.checked=(App.pageCustom.hidePublicTabs=="1");this.optionHidePublicTabs.onclick=this.onHidePublicTabs.bindAsEventListener(this)}this.optionSearchTabShow=$("optionSearchTabShow");this.optionSearchTabShow.checked=(App.pageCustom.searchTabShow=="1");this.optionSearchTabShow.onclick=this.onSearchTabShow.bindAsEventListener(this);this.optionSearchTabPosition=$("optionSearchTabPosition");if(App.pageCustom.searchTabAtTop=="1"){this.optionSearchTabPosition.value=1}else{this.optionSearchTabPosition.value=2}this.optionSearchTabPosition.onchange=this.onSearchTabPosition.bindAsEventListener(this);this.optionSearchTabNew=$("optionSearchTabNew");this.optionSearchTabNew.value=parseInt(App.pageCustom.searchTabInNewTab,10);this.optionSearchTabNew.onchange=this.onOpenNewTab.bindAsEventListener(this);this.optionUnreadPosition=$("optionUnreadPosition");this.optionUnreadPosition.value=App.pageCustom.unreadPosition;this.optionUnreadPosition.onchange=this.onChangeUnreadPosition.bindAsEventListener(this);this.optionEnableFx=$("optionEnableFx");this.optionEnableFx.checked=(App.pageCustom.enableFx=="1");this.optionEnableFx.onchange=this.onChangeEnableFx.bindAsEventListener(this);$("restoreGeneralSettings").onclick=this.reset.bind(this)},reset:function(A){A=A||App.defaultSettings;this.optionShowPageTitle.checked=!!parseInt(A.showTitle,10);this.onShowPageTitle();this.optionGiveRssMoreSpace.checked=!!parseInt(A.rssSpace,10);this.onGiveRssMoreSpace();this.optionShowRssNavigation.checked=!!parseInt(A.showFeedNav,10);this.onShowRssNavigation();this.optionUnreadPosition.value=A.unreadPosition;this.onChangeUnreadPosition();this.optionDisplayFavicons.checked=!parseInt(A.hideFavIcons,10);this.onDisplayFavicons();this.optionDontPreload.checked=!!parseInt(A.dontPreload,10);this.onDontPreload();this.optionEnableShortcuts.checked=!!parseInt(A.keyboardNav,10);this.onEnableShortcuts();this.optionIconType.value=A.iconType;this.onChangeIconType();if(!App.visit){this.optionEnableSearch.checked=!parseInt(A.hideSearch,10);this.onEnableSearch()}else{this.optionHidePublicTabs.checked=!!parseInt(A.hidePublicTabs,10);this.onHidePublicTabs()}if(!!parseInt(A.searchTabAtTop,10)){this.optionSearchTabPosition.value=1}else{this.optionSearchTabPosition.value=2}this.onSearchTabPosition();this.optionSearchTabShow.checked=parseInt(A.searchTabShow,10);this.onSearchTabShow();this.optionSearchTabNew.value=parseInt(A.searchTabInNewTab,10);this.onOpenNewTab();this.optionEnableFx.checked=!!parseInt(A.enableFx,10);this.onChangeEnableFx();this.save();return false},onChangeIconType:function(A){App.pageCustom.iconType=this.optionIconType.value;if(A){this.save()}},onOpenNewTab:function(A){App.pageCustom.searchTabInNewTab=this.optionSearchTabNew.value;if(A){this.save()}},onSearchTabShow:function(A){var B=$("tabSearchForm");if(this.optionSearchTabShow.checked){B.show();App.pageCustom.searchTabShow=1}else{B.hide();App.pageCustom.searchTabShow=0}if(A){this.save()}},onSearchTabPosition:function(A){var B=$("tabSearchForm");if(this.optionSearchTabPosition.value==1){App.pageCustom.searchTabAtTop=1;B.removeClass("atBottom");B.addClass("atTop");B.inject($("header"),"top");App.SearchTab.positionForm()}else{App.pageCustom.searchTabAtTop=0;B.removeClass("atTop");B.addClass("atBottom");B.inject($("pageTitle"),"after");B.style.marginLeft="auto";App.SearchTab.positionForm()}if(A){this.save()}},onShowPageTitle:function(A){App.pageCustom.showTitle=this.optionShowPageTitle.checked?1:0;$("pageTitle").style.display=(App.pageCustom.showTitle)?"block":"none";App.FeedReader.resize();if(A){this.save()}},onGiveRssMoreSpace:function(D){var C=this.optionGiveRssMoreSpace.checked;var B=null;for(var A=0;(B=document.getElementsByTagName("link")[A]);A++){if(B.getAttribute("rel").indexOf("style")!=-1&&B.getAttribute("href").indexOf("rssspace")!=-1){break}}if(C){if(!B){B=App.insertCssFile(NV_PATH+"themes/base/rssspace.css")}B.disabled=false}else{if(B){B.disabled=true}}App.pageCustom.rssSpace=C?1:0;if(D){this.save()}},onShowRssNavigation:function(C){var B=this.optionShowRssNavigation.checked;App.pageCustom.showFeedNav=B?1:0;var A=App.moduleList.length;for(var D=0;D<A;D++){if(typeof App.moduleList[D].widget=="undefined"){continue}if(typeof App.moduleList[D].widget.toggleNavigation=="function"){App.moduleList[D].widget.toggleNavigation(B)}}if(C){this.save()}},onChangeUnreadPosition:function(C){var A=this.optionUnreadPosition.value;if(C){this.save()}if(A=="left"||A=="right"){App.pageCustom.unreadPosition=A;var B=App.moduleList.length;for(var D=0;D<B;D++){if(typeof App.moduleList[D].widget!="undefined"&&typeof App.moduleList[D].widget.setFeedTitle=="function"){App.moduleList[D].widget.setFeedTitle()}if(!App.moduleList[D].content){continue}if(App.moduleList[D].content.setFeedTitle){try{App.moduleList[D].content.setFeedTitle()}catch(C){}}}}},onDisplayFavicons:function(E){var D=this.optionDisplayFavicons.checked;App.pageCustom.hideFavIcons=(D)?0:1;var A=document.getElementsByTagName("img");for(var C=0,B;(B=A[C]);C++){if(B.className.match(/hicon/)){B.style.visibility=D?"visible":"hidden"}}if(E){this.save()}},onDontPreload:function(A){App.pageCustom.dontPreload=this.optionDontPreload.checked?1:0;if(A){this.save()}},onEnableShortcuts:function(A){App.pageCustom.keyboardNav=(this.optionEnableShortcuts.checked)?1:0;if(A){this.save()}},onChangeEnableFx:function(A){App.pageCustom.enableFx=(this.optionEnableFx.checked)?1:0;if(A){this.save()}},onEnableSearch:function(A){App.pageCustom.hideSearch=(this.optionEnableSearch.checked)?0:1;if(App.pageCustom.hideSearch){App.searchBox.style.visibility="hidden";if(App.isOnSearch){App.searchInNetvibes("")}}else{App.searchBox.style.visibility="visible"}if(A){this.save()}},onHidePublicTabs:function(A){App.pageCustom.hidePublicTabs=(this.optionHidePublicTabs.checked)?1:0;if(!App.visit.my){if(App.pageCustom.hidePublicTabs){$("divTabs").style.visibility="hidden";$("divTabsOuter").style.visibility="hidden"}else{$("divTabs").style.visibility="visible";$("divTabsOuter").style.visibility="visible"}}if(A){this.save()}},onEnableFeedProxy:function(A){App.pageCustom.feedProxy=(this.optionEnableFeedProxy.checked)?1:0;if(A){this.save()}},save:function(){App.savePageCustom()}};;
Netvibes.Settings.Language=Class.create();Netvibes.Settings.Language.prototype={initialize:function(){},load:function(){this.contentNode=new Element("div",{html:_("Loading ...")});var A=new Request({url:"/get/paneSetting.php",method:"post",data:"pane=language",onSuccess:this.attachEvents.bind(this)}).send();return this.contentNode},activate:function(){Netvibes.Settings.Language.selectedLang=null;this.displayDefaultProgress();var B=$(this.contentNode).getElements(".lang");for(var C=0,A=B.length;C<A;C++){if(B[C].getAttribute("lang")==App.lang){B[C].addClass("selected")}else{B[C].removeClass("selected")}}},attachEvents:function(E){this.contentNode.innerHTML=E;var B=this.contentNode.getElementsByClassName("lang");for(var C=0,A=B.length;C<A;C++){var D=B[C];D.onclick=this.eventClicked.bindAsEventListener(this);D.onmouseover=function(){var F=this.getAttribute("progress");$("translateProgressDone").style.width=F+"%";$("translateProgressLabel").innerHTML=_("Progress for {0}:").format(this.getAttribute("langTitle"))+" "+F+"%"};D.onmouseout=function(){this.displayDefaultProgress()}.bind(this)}this.displayDefaultProgress()},eventClicked:function(B){var A=Event.element(B);this.contentNode.getElements(".selected").removeClass("selected");Element.addClassName(A,"selected");var C=A.getAttribute("lang");if(C!=App.lang){Netvibes.Settings.Language.selectedLang=C}Event.stop(B);return false},displayDefaultProgress:function(){var B=$(this.contentNode).getElementsByClassName("selected");for(var C=0,A=B.length;C<A;C++){var D=B[C].getAttribute("progress");$("translateProgressDone").style.width=D+"%";$("translateProgressLabel").innerHTML=_("{0}:").format(B[C].getAttribute("langTitle"))+" "+D+"%"}}};;
Netvibes.Settings.LocalContent=Class.create();Netvibes.Settings.locales=[{code:"al",continent:"eu",name:_("Albania")},{code:"at",continent:"eu",name:_("Austria")},{code:"pv",continent:"eu",name:_("Basque Country")},{code:"bef",continent:"eu",name:_("Belgium (French)")},{code:"be",continent:"eu",name:_("Belgium (Dutch)")},{code:"ba",continent:"eu",name:_("Bosnia and Herzegovina")},{code:"bg",continent:"eu",name:_("Bulgaria")},{code:"by",continent:"eu",name:_("Belarus")},{code:"ct",continent:"eu",name:_("Catalonia")},{code:"hr",continent:"eu",name:_("Croatia")},{code:"cy",continent:"eu",name:_("Cyprus")},{code:"cz",continent:"eu",name:_("Czech Republic")},{code:"ee",continent:"eu",name:_("Estonia")},{code:"fr",continent:"eu",name:_("France")},{code:"frA5",continent:"eu",name:_("France (Corse)")},{code:"fi",continent:"eu",name:_("Finland")},{code:"nlf",continent:"eu",name:_("Friesland")},{code:"de",continent:"eu",name:_("Germany")},{code:"dk",continent:"eu",name:_("Denmark")},{code:"ga",continent:"eu",name:_("Galicia")},{code:"gr",continent:"eu",name:_("Greece")},{code:"gra",continent:"eu",name:_("Greece (Attica)")},{code:"hu",continent:"eu",name:_("Hungary")},{code:"it",continent:"eu",name:_("Italy")},{code:"ie",continent:"eu",name:_("Ireland")},{code:"is",continent:"eu",name:_("Iceland")},{code:"ko",continent:"eu",name:_("Kosovo")},{code:"lv",continent:"eu",name:_("Latvia")},{code:"lt",continent:"eu",name:_("Lithuania")},{code:"lu",continent:"eu",name:_("Luxembourg")},{code:"mt",continent:"eu",name:_("Malta")},{code:"nl",continent:"eu",name:_("Netherlands")},{code:"no",continent:"eu",name:_("Norway")},{code:"pl",continent:"eu",name:_("Poland")},{code:"pt",continent:"eu",name:_("Portugal")},{code:"ro",continent:"eu",name:_("Romania")},{code:"rs",continent:"eu",name:_("Serbia")},{code:"sk",continent:"eu",name:_("Slovakia")},{code:"si",continent:"eu",name:_("Slovenia")},{code:"es",continent:"eu",name:_("Spain")},{code:"se",continent:"eu",name:_("Sweden")},{code:"ch",continent:"eu",name:_("Switzerland")},{code:"chf",continent:"eu",name:_("Switzerland (French)")},{code:"tr",continent:"eu",name:_("Turkey")},{code:"ua",continent:"eu",name:_("Ukraine")},{code:"gb",continent:"eu",name:_("United Kingdom")},{code:"mk",continent:"eu",name:_("Macedonia")},{code:"fo",continent:"eu",name:_("Faroe Islands")},{code:"bz",continent:"na",name:_("Belize")},{code:"ca",continent:"na",name:_("Canada")},{code:"qc",continent:"na",name:_("Canada (Quebec)")},{code:"cr",continent:"na",name:_("Costa Rica")},{code:"cu",continent:"na",name:_("Cuba")},{code:"sv",continent:"na",name:_("El Salvador")},{code:"gt",continent:"na",name:_("Guatemala")},{code:"gy",continent:"na",name:_("Guyana")},{code:"hn",continent:"na",name:_("Honduras")},{code:"mx",continent:"na",name:_("Mexico")},{code:"ni",continent:"na",name:_("Nicaragua")},{code:"pa",continent:"na",name:_("Panama")},{code:"us",continent:"na",name:_("United States")},{code:"use",continent:"na",name:_("United States (Spanish)")},{code:"ar",continent:"sa",name:_("Argentina")},{code:"bo",continent:"sa",name:_("Bolivia")},{code:"br",continent:"sa",name:_("Brazil")},{code:"cl",continent:"sa",name:_("Chile")},{code:"co",continent:"sa",name:_("Colombia")},{code:"do",continent:"sa",name:_("Dominican Republic")},{code:"ec",continent:"sa",name:_("Ecuador")},{code:"fk",continent:"sa",name:_("Falkland Islands")},{code:"mv",continent:"sa",name:_("Maldives")},{code:"py",continent:"sa",name:_("Paraguay")},{code:"pe",continent:"sa",name:_("Peru")},{code:"sr",continent:"sa",name:_("Suriname")},{code:"uy",continent:"sa",name:_("Uruguay")},{code:"ve",continent:"sa",name:_("Venezuela")},{code:"dz",continent:"af",name:_("Algeria")},{code:"cm",continent:"af",name:_("Cameroon")},{code:"eg",continent:"af",name:_("Egypt")},{code:"et",continent:"af",name:_("Ethiopia")},{code:"ci",continent:"af",name:_("Cote d'Ivoire")},{code:"ke",continent:"af",name:_("Kenya")},{code:"ly",continent:"af",name:_("Libya")},{code:"mr",continent:"af",name:_("Mauritania")},{code:"ma",continent:"af",name:_("Morroco")},{code:"ng",continent:"af",name:_("Nigeria")},{code:"sn",continent:"af",name:_("Senegal")},{code:"so",continent:"af",name:_("Somalia")},{code:"za",continent:"af",name:_("South Africa")},{code:"tn",continent:"af",name:_("Tunisia")},{code:"ao",continent:"af",name:_("Angola")},{code:"bj",continent:"af",name:_("Benin")},{code:"bw",continent:"af",name:_("Botswana")},{code:"bf",continent:"af",name:_("Burkina faso")},{code:"bi",continent:"af",name:_("Burundi")},{code:"cv",continent:"af",name:_("Cape Verde")},{code:"cf",continent:"af",name:_("Central African Republic")},{code:"td",continent:"af",name:_("Chad")},{code:"km",continent:"af",name:_("Comoros")},{code:"cg",continent:"af",name:_("Congo-Brazzaville")},{code:"cd",continent:"af",name:_("Congo-Kinshasa")},{code:"dj",continent:"af",name:_("Djibouti")},{code:"gq",continent:"af",name:_("Equatorial Guinea")},{code:"er",continent:"af",name:_("Eritrea")},{code:"ga",continent:"af",name:_("Gabon")},{code:"gm",continent:"af",name:_("Gambia")},{code:"gh",continent:"af",name:_("Ghana")},{code:"gn",continent:"af",name:_("Guinea")},{code:"gw",continent:"af",name:_("Guinea-Bissau")},{code:"ls",continent:"af",name:_("Lesotho")},{code:"lr",continent:"af",name:_("Liberia")},{code:"mg",continent:"af",name:_("Madagascar")},{code:"mw",continent:"af",name:_("Malawi")},{code:"ml",continent:"af",name:_("Mali")},{code:"mu",continent:"af",name:_("Mauritius")},{code:"mz",continent:"af",name:_("Mozambique")},{code:"na",continent:"af",name:_("Namibia")},{code:"rw",continent:"af",name:_("Rwanda")},{code:"sl",continent:"af",name:_("Sierra Leone")},{code:"sd",continent:"af",name:_("Sudan")},{code:"sz",continent:"af",name:_("Swaziland")},{code:"tz",continent:"af",name:_("Tanzania")},{code:"tg",continent:"af",name:_("Togo")},{code:"ug",continent:"af",name:_("Uganda")},{code:"zm",continent:"af",name:_("Zambia")},{code:"zw",continent:"af",name:_("Zimbabwe")},{code:"re",continent:"af",name:_("Reunion Island")},{code:"au",continent:"oc",name:_("Australia")},{code:"nz",continent:"oc",name:_("New Zealand")},{code:"pf",continent:"oc",name:_("French Polynesia")},{code:"bh",continent:"as",name:_("Bahrain")},{code:"bd",continent:"as",name:_("Bangladesh")},{code:"cn",continent:"as",name:_("China")},{code:"hk",continent:"as",name:_("Hong Kong")},{code:"in",continent:"as",name:_("India")},{code:"id",continent:"as",name:_("Indonesia")},{code:"ir",continent:"as",name:_("Iran")},{code:"iq",continent:"as",name:_("Iraq")},{code:"il",continent:"as",name:_("Israel")},{code:"jp",continent:"as",name:_("Japan")},{code:"jo",continent:"as",name:_("Jordan")},{code:"kp",continent:"as",name:_("Korea (North)")},{code:"kr",continent:"as",name:_("Korea (South)")},{code:"kw",continent:"as",name:_("Kuwait")},{code:"lb",continent:"as",name:_("Lebanon")},{code:"om",continent:"as",name:_("Oman")},{code:"my",continent:"as",name:_("Malaysia")},{code:"mn",continent:"as",name:_("Mongolia")},{code:"pk",continent:"as",name:_("Pakistan")},{code:"ps",continent:"as",name:_("Palestine")},{code:"ph",continent:"as",name:_("Philippines")},{code:"qa",continent:"as",name:_("Qatar")},{code:"ru",continent:"as",name:_("Russia")},{code:"sa",continent:"as",name:_("Saudi Arabia")},{code:"sg",continent:"as",name:_("Singapore")},{code:"sy",continent:"as",name:_("Syria")},{code:"tw",continent:"as",name:_("Taiwan")},{code:"th",continent:"as",name:_("Thailand")},{code:"tr",continent:"as",name:_("Turkey")},{code:"ae",continent:"as",name:_("United Arab Emirates")},{code:"vn",continent:"as",name:_("Vietnam")},{code:"ye",continent:"as",name:_("Yemen")}];Netvibes.Settings.LocalContent.prototype={initialize:function(){this.continents=[{code:"eu",imageUrl:NV_PATH+"img/worldmap-eu.gif",name:_("Europe")},{code:"na",imageUrl:NV_PATH+"img/worldmap-na.gif",name:_("North America")},{code:"sa",imageUrl:NV_PATH+"img/worldmap-sa.gif",name:_("South America")},{code:"oc",imageUrl:NV_PATH+"img/worldmap-oc.gif",name:_("Oceania")},{code:"as",imageUrl:NV_PATH+"img/worldmap-as.gif",name:_("Asia")},{code:"af",imageUrl:NV_PATH+"img/worldmap-af.gif",name:_("Africa")}];this.preload=[];for(var A=0,B;B=this.continents[A];A++){this.preload[B.code]=new Image();this.preload[B.code].src=B.imageUrl}},load:function(){this.contentNode=document.createElement("div");var A=this.getRegion(User.locale)||this.getRegion(App.locale)||this.getRegion("us");this.continent=this.getContinent(A.continent);var B="";B+="<h2>"+_("Local content")+"</h2>";B+="<p>";B+='<img src="'+this.continent.imageUrl+'" width="460" height="212" usemap="#localContentMap" alt="" />';B+="</p>";B+='<map id="localContentMap" name="localContentMap">';B+='<area shape="poly" href="javascript:void(0)" continent="oc" alt="'+_("Oceania")+'" title="'+_("Oceania")+'" coords="372,132, 383,86, 460,107, 453,149, 432,178, 400,197, 343,175, 347,143" />';B+='<area shape="poly" href="javascript:void(0)" continent="as" alt="'+_("Asia")+'" title="'+_("Asia")+'" coords="348,141, 371,132, 381,86, 405,19, 278,0, 269,11, 261,62, 238,54, 233,59, 260,99, 278,93, 295,115, 315,115, 320,106" />';B+='<area shape="poly" href="javascript:void(0)" continent="af" alt="'+_("Africa")+'" title="'+_("Africa")+'" coords="259,100, 272,96, 283,139, 278,156, 254,161, 238,174, 219,170, 205,114, 180,114, 163,93, 186,67, 195,67, 215,62, 226,68, 238,68" />';B+='<area shape="poly" href="javascript:void(0)" continent="sa" alt="'+_("South America")+'" title="'+_("South America")+'" coords="108,93, 160,126, 135,205, 113,203, 78,115" />';B+='<area shape="poly" href="javascript:void(0)" continent="na" alt="'+_("North America")+'" title="'+_("North America")+'" coords="128,104, 131,93, 109,75, 148,54, 146,36, 178,24, 200,5, 201,0, 109,0, 46,11, 16,32, 24,47, 43,37, 41,70, 61,100, 88,106, 109,91" />';B+='<area shape="poly" href="javascript:void(0)" continent="eu" alt="'+_("Europe")+'" title="'+_("Europe")+'" coords="176,26, 189,33, 186,64, 195,65, 214,60, 226,67, 235,67, 233,58, 238,53, 260,60, 269,7, 207,2, 184,19" />';B+="</map>";B+='<fieldset class="autoclear">';B+="<legend>"+this.continent.name+"</legend>";B+='<div id="localContentRegions"></div>';B+="</fieldset>";B+='<p style="clear:both; padding:.5em;">'+_('Help us build the Netvibes personal start page for your country/region. If you want to create or improve your local selection, please <a href="{0}">contact us</a>').format("http://translators.netvibes.com/")+".</p>";this.contentNode.innerHTML=B;return this.contentNode},loaded:function(){var A=this.contentNode.getElementsByTagName("area");for(var B=0,C;C=A[B];B++){C.onclick=this.eventMapClicked.bindAsEventListener(this)}if(this.continent){this.loadRegions(this.continent.code)}},activate:function(){Netvibes.Settings.LocalContent.selectedLocale=null;var A=this.getRegion(User.locale)||this.getRegion(App.locale)||this.getRegion("us");this.loadRegions(this.getContinent(A.continent).code)},getRegion:function(A){return Netvibes.Settings.locales.detect(function(B){return B.code==A})},getContinent:function(A){return this.continents.detect(function(B){return B.code==A})},eventMapClicked:function(B){var A=Event.element(B);this.loadRegions(A.getAttribute("continent"));Event.stop(B)},loadRegions:function(F){this.continent=this.getContinent(F);if(!this.continent){return false}var D=this.contentNode.getElementsByTagName("img").item(0);var I=this.continent.imageUrl;setTimeout(function(){D.src=I},20);this.contentNode.getElementsByTagName("legend")[0].innerHTML=this.continent.name;var G="";var K=[];Netvibes.Settings.locales.each(function(N){if(N.continent==F){K.push(N.name)}});K.sort();var E=Math.max(4,Math.ceil(K.length/2));for(var C=0;C<K.length;C++){var L=K[C];var M=Netvibes.Settings.locales.detect(function(N){return N.name==L}).code;var H=C%E;if(H==0){G+='<div class="column two"><ul class="regions">'}var B=(M==User.locale)||(M==App.locale);G+='<li><a class="country'+(B?" selected":"")+'" href="javascript:void(0)" country="'+M+'">'+L+"</a></li>";if((H+1)==E||(C+1)==K.length){G+="</ul></div>"}}$("localContentRegions").innerHTML=G;var J=$(this.contentNode).getElementsByClassName("country");for(var C=0,A=J.length;C<A;C++){J[C].onclick=this.eventRegionClicked.bindAsEventListener(this)}},eventRegionClicked:function(C){var A=Event.element(C);$(this.contentNode).getElements(".selected").removeClass("selected");Element.addClassName(A,"selected");var B=A.getAttribute("country");if(B!=App.locale){Netvibes.Settings.LocalContent.selectedLocale=B}Event.stop(C)}};;
Netvibes.Settings.Theme=Class.create();Netvibes.Settings.Theme.paginator=null;Netvibes.Settings.Theme.CACHE_TIME=3600;Netvibes.Settings.Theme.REQUEST_URL="/proxy/ajaxProxy.php?url="+encodeURIComponent("http://"+NV_ECO_API+"/themes?format=json&limit=9&page=1&category=0&color=")+"&cache="+Netvibes.Settings.Theme.CACHE_TIME;Netvibes.Settings.Theme.prototype={initialize:function(){},load:function(){var I=this;this.color="";this.category=0;this.categoryText=_("All themes");this.contentNode=new Element("div",{"class":"gallery"});var E="<h2>"+_("Themes")+'</h2>         <form id="search-themes-form"><input class="search" type="text" value="" /><img src="'+App.getStaticUrl("/img/clear.gif")+'" title="Clear" class="clear" style="display:none" /><input type="submit" class="nv-button" value="'+_("Search")+'" /></form>         <div class="gallery-top autoclear">           <div style="position:relative; float:left">             <a class="select-categories" href="javascript:void(0)">'+this.categoryText+'</a>             <div id="popup-themes-categories" class="popup" style="display:none"><div class="innerFrame">';E+='<ul class="column">';var F=[{id:1,title:_("Animals")},{id:2,title:_("Art")},{id:3,title:_("Cars")},{id:4,title:_("Film")},{id:5,title:_("Computer")},{id:6,title:_("Places")},{id:7,title:_("Food")},{id:8,title:_("Landscape")},{id:9,title:_("Literature")},{id:10,title:_("Music")},{id:11,title:_("Plants")},{id:12,title:_("Sports")},{id:13,title:_("Textures")},{id:14,title:_("Transport")},{id:15,title:_("Universe")},{id:16,title:_("Video game")}];F.sort(this._sortCategories);F.unshift({id:17,title:_("Official")});F.unshift({id:0,title:_("All themes")});var D=0,G;F.each(function(J){if(J.id==0){G="all-themes"}else{if(J.id==17){G="official-themes"}else{G=""}}E+='<li><a href="javascript:void(0)" -data-category="'+J.id+'" class="'+G+'">'+J.title+"</a></li>";if(++D==9){E+='</ul><ul class="column">'}});E+="</ul></div></div></div>";E+='<div style="float:right" class="colors">             <span>'+_("Colors:")+'</span>             <div class="color color-all selected" -data-color="" title="'+_("All")+'"><div></div></div>             <div class="color color-light" -data-color="light" title="'+_("Light/White")+'"><div></div></div>             <div class="color color-dark" -data-color="dark" title="'+_("Dark/Black")+'"><div></div></div>             <div class="color color-red" -data-color="red" title="'+_("Red")+'"><div></div></div>             <div class="color color-orange" -data-color="orange" title="'+_("Orange")+'"><div></div></div>             <div class="color color-yellow" -data-color="yellow" title="'+_("Yellow")+'"><div></div></div>             <div class="color color-green" -data-color="green" title="'+_("Green")+'"><div></div></div>             <div class="color color-blue" -data-color="blue" title="'+_("Blue")+'"><div></div></div>             <div class="color color-pink" -data-color="pink" title="'+_("Pink")+'"><div></div></div>             <div class="color color-purple" -data-color="purple" title="'+_("Purple")+'"><div></div></div>             <div class="color color-gray" -data-color="gray" title="'+_("Gray")+'"><div></div></div>           </div>         </div>         <div class="wrapper"></div><div class="gallery-pager" style="clear:left"></div>';this.contentNode.innerHTML=E;this._requestEcoApi();var B=this.contentNode.getElements(".color");for(var D=0,C=B.length;D<C;D++){B[D].addEvent("click",this.onFilterColor.bind(this,B[D]))}var H=this.contentNode.getElement(".select-categories");H.addEvent("click",this.onShowCategories.bind(this));var F=this.contentNode.getElements(".popup a");for(var D=0,C=F.length;D<C;D++){F[D].addEvent("click",this.onCategoryChange.bind(this,F[D]))}var A=this.contentNode.getElement("form");A.onsubmit=this.onSearchTheme.bind(this);this.contentNode.addEvent("click",function(K){if(K.target.className=="select-categories"){return }var J=$("popup-themes-categories");if(Element.visible(J)){J.hide()}});return this.contentNode},resetColorFilter:function(){this.color="";var C=this.contentNode.getElements(".color");for(var A=0,B;B=C[A];A++){B[A==0?"addClass":"removeClass"]("selected")}},onSearchTheme:function(){var C=$("search-themes-form");this.query=C.getElement(".search").value;var B="/proxy/ajaxProxy.php?url="+encodeURIComponent("http://"+NV_ECO_API+"/themes?format=json&limit=9&page=1&query="+this.query);this._requestEcoApi(B);this.contentNode.getElement(".gallery-top").hide();var A=C.getElement(".clear").show();A.onclick=this.resetSearch.bind(this);return false},resetSearch:function(){$("search-themes-form").getElement(".search").value="";this.query=null;this.contentNode.getElement(".gallery-top").show();this.contentNode.getElement(".clear").hide();this._requestEcoApi()},onShowCategories:function(E){var B=$("popup-themes-categories");if(Browser.Engine.presto||Browser.Engine.trident){B.addClass("box-shadow")}var C=this.contentNode.getElements(".popup a");C.removeClass("selected");for(var D=0,A=C.length;D<A;D++){if(C[D].get("-data-category")==this.category){C[D].addClass("selected");break}}if(B.style.display=="none"){B.show()}else{B.hide()}},onFilterColor:function(B){B.getParent().getElements(".selected").removeClass("selected");B.addClass("selected");this.color=B.get("-data-color")||"";var A=Netvibes.Settings.Theme.REQUEST_URL.replace(/color%3D[a-z]*/,encodeURIComponent("color="+this.color));A=A.replace(/category%3D\d+/,encodeURIComponent("category="+this.category));this._requestEcoApi(A)},onCategoryChange:function(C){this.resetColorFilter();this.category=C.get("-data-category");this.categoryText=C.get("text");var A=this.contentNode.getElement(".select-categories");A.set("text",this.categoryText);var B=Netvibes.Settings.Theme.REQUEST_URL.replace(/category%3D\d+/,encodeURIComponent("category="+this.category));this._requestEcoApi(B);$("popup-themes-categories").hide()},onPageRequesting:function(A){A.request.options.url=A.request.options.url.replace(/page%3D\d+/,encodeURIComponent("page="+A.page))},onPageChanged:function(I){var J=this.contentNode.getElement(".wrapper").empty();var D=I.page.offset+I.page.size;if(D>I.page.total){D=I.page.total}var G=this.query?_("Search"):_("Categories");G+='<span class="separator">/</span><span class="category-name">'+(this.query||this.categoryText);if(I.page.total){G+=" ("+(++I.page.offset)+"-"+D+"/"+I.page.total+")"}G+="</span>";var F=new Element("div",{"class":"category-info",html:G});F.inject(J);if(I.page.total==0){F.adopt(new Element("p",{text:_("No results."),"class":"no-results"}),"after");return }for(var E=0,C=I.items.length;E<C;E++){var K=I.items[E];var B=new Element("li",{"class":"theme"});var A=new Element("img",{src:K.thumbnail,width:"107",height:"84",title:K.description}).inject(B);var H=new Element("span",{text:K.title.truncate(18),"class":"title",title:K.title}).inject(B);if(K.flags.contains("dynamic")){B.adopt(new Element("img",{src:App.getStaticUrl("/img/icons/dynamic.png"),"class":"dynamic",title:_("Animated theme")}))}if(App.pageCustom.themeTitle==K.title){B.addClass("selected")}if(K.link=="chroma"){B.addEvent("click",this.onChromaTheme.bind(this,B))}else{B.addEvent("click",this.onThemeChanged.bind(this,B))}B.store("url",K.link);B.store("type",K.type);B.store("title",K.title);B.store("ecoId",K.id);B.inject(J)}},onChromaTheme:function(B){var A=null;if(App.pageCustom.themeTitle.substr(0,8)=="My Plain"){A=App.pageCustom.themeTitle.substr(9,16)}Netvibes.UI.showColorPicker(B,{color:A,onSelectionChange:function(C){App.pageCustom.themeUrl="/themes/my-plain/screen.css.php?color="+C;App.pageCustom.themeTitle="My Plain #"+C;App.savePageCustom();App.Theme.refresh(true)}})},onThemeChanged:function(B){B.getParent().getElements(".selected").removeClass("selected");B.addClass("selected");var D=B.retrieve("url");var A=B.retrieve("title");var C=B.retrieve("type")==13;if(C){D="/themes/"+D+"/screen.css"}else{D="/themes/custom/screen.css.php?url="+encodeURIComponent(D)}App.pageCustom.themeUrl=D;App.pageCustom.themeTitle=A;Netvibes.Settings.Theme.selectedTheme=B.retrieve("ecoId");App.Theme.refresh(true);App.savePageCustom()},onRestoreDefaults:function(A){},_requestEcoApi:function(A){this.contentNode.getElement(".wrapper").set("html",_("Loading..."));if(Netvibes.Settings.Theme.paginator){Netvibes.Settings.Theme.paginator.destroy()}Netvibes.Settings.Theme.paginator=new Netvibes.UI.MultiPage.JSON({requestUrl:A||Netvibes.Settings.Theme.REQUEST_URL,perPage:9,className:"pagination",windowResize:false,responseParams:{items:"items",total:"total"},onRequesting:this.onPageRequesting.bind(this),onPageChange:this.onPageChanged.bind(this)}).inject(this.contentNode.getElement(".gallery-pager").empty())},_sortCategories:function(B,A){if(B.title<A.title){return -1}else{if(B.title>A.title){return 1}}return 0}};Netvibes.Settings.CreateTheme=Class.create();Netvibes.Settings.CreateTheme.prototype={initialize:function(){},load:function(){this.contentNode=document.createElement("div");var A="<h2>"+_("Create your own theme")+"</h2>";A+='<p><img src="'+App.getStaticUrl("/img/settings/create-theme.jpg")+'" width="420" height="190" /></p>';A+="<p>"+_("With the Netvibes theme designer you can now create your own theme.")+"</p>";A+='<p style="text-align:center"><a class="nv-button" href="http://'+NV_ECO+'/themes/create" target="_blank"><span>'+_("Create a new theme")+'</span></a><a id="create-from-theme" class="nv-button" href="'+Netvibes.Settings.getSubmitThemeUrl()+'" target="_blank"><span>'+_("Edit current theme")+"</span></a></p>";this.contentNode.innerHTML=A;return this.contentNode},activate:function(){var A=$("create-from-theme");if(A){A.href=Netvibes.Settings.getSubmitThemeUrl()}}};Netvibes.Settings.Theme.Gallery=Class.create();Netvibes.Settings.Theme.Gallery.defaultThemeTitle="Primavera";Netvibes.Settings.Theme.Gallery.prototype={initialize:function(A){this.contentNode=A;this.contentNode.innerHTML=_("Loading ...");var B=new Request({onSuccess:this.attachEvents.bind(this)}).post("/get/paneSetting.php",{pane:"theme",currentPage:App.currentPage})},attachEvents:function(G){this.contentNode.innerHTML=G;if(typeof App.pageCustom.themeUrl=="undefined"){App.pageCustom.themeTitle=Netvibes.Settings.Theme.Gallery.defaultThemeTitle}var D=$(this.contentNode).getElementsByClassName("switcher");var C=this;for(var E=0,B=D.length;E<B;E++){var F=D[E];if(App.pageCustom.themeTitle==F.title){Element.addClassName(F,"selected")}F.onclick=function(I){var H=$(C.contentNode).getElementsByClassName("switcher");$A(H).each(function(J){Element.removeClassName(J,"selected")});Element.addClassName(this,"selected");App.pageCustom.themeUrl=this.getAttribute("themeUrl");App.pageCustom.themeTitle=this.title;App.Theme.refresh(true);App.savePageCustom();return false}}var A=$(this.contentNode).getElements(".pagination a");for(var E=0,B=A.length;E<B;E++){A[E].addEvent("click",this.onPaginationClick.bind(this))}},onPaginationClick:function(A){App.Request.newRequest({url:"/get/paneSetting.php",onComplete:this.attachEvents.bind(this)}).POST({pane:"theme",offset:A.target.getAttribute("offset")})}};Netvibes.Settings.Theme.Gallery.switchTo=function(A,C,B){if(App.pageCustom.bodyBackground||App.pageCustom.bodyColor||App.pageCustom.headerColor||App.pageCustom.headerTextColor||App.pageCustom.headerBackground||App.pageCustom.headerHeight){if(B&&!window.confirm(_("Do you want to keep your wallpapers settings?"))){delete App.pageCustom.bodyBackground;delete App.pageCustom.bodyColor;delete App.pageCustom.bodyFixed;delete App.pageCustom.headerColor;delete App.pageCustom.headerTextColor;delete App.pageCustom.headerBackground;delete App.pageCustom.headerHeight;if($("optionBackgroundNoColor")){$("optionBackgroundNoColor").checked="checked"}if($("optionBodyFixed")){$("optionBodyFixed").checked=""}if($("optionHeaderBackgroundNoColor")){$("optionHeaderBackgroundNoColor").checked="checked"}if($("optionHeaderTextNoColor")){$("optionHeaderTextNoColor").checked="checked"}if($("optionHeaderCursor")){$("optionHeaderCursor").style.left="0px"}}}if(App.useMergedCss){if(A.indexOf(".m.css")<0){A=A.replace(/.css/,".css.m.css")}}App.Theme.changeTheme(A,C);setTimeout(function(){App.notifyModuleThemeUpdated(A)},100)};;
Netvibes.Settings.Wallpaper=Class.create();Netvibes.Settings.Wallpaper.prototype={initialize:function(){this.instances=[]},load:function(){this.contentNode=document.createElement("div");this.contentNode.innerHTML="<h2>"+_("Wallpapers")+"</h2>";this.tabs=new Netvibes.UI.TabView();this.tabs.addTab("header",{text:_("Top wallpaper")});this.tabs.addTab("body",{text:_("Bottom wallpaper")});this.tabs.observe("activeTabChange",this.onActiveTabChanged.bind(this));this.tabs.appendTo(this.contentNode);Element.addClassName(this.tabs.tabSet,"nv-tabSettings");var A=new Element("p",{"class":"submit-theme"});A.set("html","<span>"+_("Want to show your beautiful theme?")+' <a id="submit-theme-link" href="'+Netvibes.Settings.getSubmitThemeUrl()+'" target="_blank">'+_("Submit it to the directory")+"</a></span>").inject(this.contentNode);return this.contentNode},loaded:function(){this.onActiveTabChanged("header")},activate:function(){Netvibes.Settings.Wallpaper.updateSubmitThemeLink()},onActiveTabChanged:function(A,C){var B=this.tabs.getTabContent(A);if(B.loaded){return }switch(A){case"header":this.instances[A]=new Netvibes.Settings.Wallpaper.Header(B);break;case"body":this.instances[A]=new Netvibes.Settings.Wallpaper.Body(B);break;default:break}B.loaded=true},onRestoreDefaults:function(A){}};Netvibes.Settings.Wallpaper.updateSubmitThemeLink=function(){var A=$("submit-theme-link");if(A){A.href=Netvibes.Settings.getSubmitThemeUrl()}};Netvibes.Settings.Wallpaper.Body=Class.create();Netvibes.Settings.Wallpaper.Body.prototype={initialize:function(A){this.contentNode=A;this.contentNode.innerHTML="";var B=new Request({onSuccess:this.displayFlickr.bind(this)}).get("/data/flickr/index.php",{q:"wallpaper"});this.build()},build:function(){var L=this;this.contentNode.innerHTML=_("Select an image from")+" <select id='settingsWallpaperBodySelect'><option value='0' name='netvibes'>"+_("netvibes selection")+"</option><option value='1' name='url'>"+_("link (url)")+"</option><option value='2' name='flickr'>flickr</option><option value='3' name='myspace'>myspace</option><option value='4' name='twitter'>twitter</option></select>";var I=document.createElement("div");for(var D=0;D<=4;D++){var A=document.createElement("div");A.style.display="none";I.appendChild(A)}this.contentNode.appendChild(I);$("settingsWallpaperBodySelect").onchange=function(){L.onTabChange(this.value,this.childNodes[this.value].getAttribute("name"))};this.onTabChange(2,"flickr");this.onTabChange(1,"url");this.onTabChange(0,"netvibes");var A=document.createElement("div");A.innerHTML='<hr style="clear:both;height:1px;margin:0px;margin-bottom:14px" /><div style="margin-bottom:6px">'+_("Or background color:")+' <input type="radio" id="optionBackgroundColorRadio" name="optionBackgroundColorRadio" value="#AAAAAA" /> <img id="optionBodyColorZone"  width="30" height="15" src="img/s.gif" style="border: 1px solid grey;background-color: #AAAAAA;vertical-align: middle; margin-bottom: 3px"/><input id="optionBodyInputColor" type="text" value="#AAAAAA" style="margin-left:2px;width:65px" /><input id="optionBackgroundNoColor" type="radio" name="optionBackgroundColorRadio" style="margin-left:50px"/> <label for="optionBackgroundNoColor">'+_("Default")+'</label></div><div id="advanceBodyOptions" style="display:none;"><fieldset style=\'margin-top:10px\'><legend>'+_("Advanced options")+"</legend>"+_("Display mode:")+' <select id="optionBodyDisplayMode"><option value="center">'+_("center")+'</option><option value="tile">'+_("tile")+'</option></select><input id="optionBodyFixed" type="checkbox" style="margin-left:50px"/> <label for="optionBodyFixed">'+_("Fixed wallpaper")+"</label></fieldset></div>";A.innerHTML+='<table width="100%"><tr><td><a id="optionBodydAdvancedLink" href="javascript:void(0)" class="advanced">'+_("Show advanced options")+'</a></td><td align="right"><a id="optionBodyRestoreLink" href="#">'+_("Restore defaults")+"</a></td></tr></table>";this.contentNode.appendChild(A);var C=$("optionBodyDisplayMode");var K=$("optionBodyFixed");var H=$("optionBodyColorZone");var G=$("optionBackgroundColorRadio");var J=$("optionBodyInputColor");var E=$("optionBackgroundNoColor");var B=$("optionBodyRestoreLink");var F=$("optionBodydAdvancedLink");if(App.pageCustom.bodyCenter){C.value="center"}else{C.value="tile"}if(App.pageCustom.bodyFixed){K.checked="checked"}if(App.pageCustom.bodyColor){G.value=App.pageCustom.bodyColor;J.value=App.pageCustom.bodyColor;G.checked="checked";H.style.backgroundColor=App.pageCustom.bodyColor}else{E.checked="checked"}C.onchange=function(){if(this.value=="center"){App.pageCustom.bodyCenter=1}else{delete App.pageCustom.bodyCenter}App.savePageCustom();Netvibes.Settings.Wallpaper.Body.update()};K.onclick=function(){if(this.checked){App.pageCustom.bodyFixed=1}else{delete App.pageCustom.bodyFixed}App.savePageCustom();Netvibes.Settings.Wallpaper.Body.update()};H.style.cursor="pointer";H.onclick=function(M){Netvibes.UI.showColorPicker(this.parentNode,{color:App.pageCustom.bodyColor,onSelectionChange:function(N){J.value="#"+N;G.value="#"+N;H.style.backgroundColor="#"+N;G.click()}})};J.onblur=function(){if(App.pageCustom.bodyColor==this.value){return false}H.style.backgroundColor=this.value;G.value=this.value;G.click()};G.onclick=function(){App.pageCustom.bodyColor=this.value;delete App.pageCustom.bodyBackground;App.savePageCustom();Netvibes.Settings.Wallpaper.Body.update()};E.onclick=function(){delete App.pageCustom.bodyColor;App.savePageCustom();Netvibes.Settings.Wallpaper.Body.update()};B.onclick=function(M){E.checked="checked";delete App.pageCustom.bodyColor;K.checked="";delete App.pageCustom.bodyFixed;C.value="tile";delete App.pageCustom.bodyCenter;$("optionBodyUrl").value="";$("optionBodyUrlApply").click();return false};F.onclick=function(){var O=$(L.contentNode).getElementsByClassName("listThemes");if($("advanceBodyOptions").style.display=="block"){var M=53;this.innerHTML=_("Show advanced options");$("advanceBodyOptions").style.display="none"}else{var M=-53;this.innerHTML=_("Hide advanced options");$("advanceBodyOptions").style.display="block"}var P=O.length;for(var N=0;N<P;N++){O[N].style.height=(parseInt(O[N].style.height)+M)+"px"}return false}},onTabChange:function(J,A){var K=this.contentNode.getElementsByTagName("div")[0].childNodes;var I=K.length;for(var F=0;F<I;F++){K[F].style.display="none"}var C=K[J];C.style.display="block";if(Browser.isIE){C.style.padding="0px 5px 0px 5px"}else{C.style.padding="0px 5px 10px 5px"}var L=this;switch(A){case"flickr":if(!C.loaded){C.innerHTML='<form><img src="/img/flickr.png" style="vertical-align:top;margin-right:2px" /><input value="wallpaper" type="text" style="width:200px;"/><input class="submit" type="submit" value="'+_("search")+'" /><div class="listThemes" style="margin-top:5px;margin-left:-5px;width:439px;height:237px;">'+_("Loading...")+"</div></form>";var H=C.getElementsByTagName("input");var B=C.firstChild;B.onsubmit=function(){var N=new Request({onSuccess:L.displayFlickr.bind(L)}).get("/data/flickr/index.php",{q:H[0].value.replace(/\s/g,","),random:Math.random()});var M=$(C).getElementsByClassName("listThemes")[0];M.innerHTML=_("Loading...");return false};C.loaded=true}break;case"url":if(!C.loaded){C.innerHTML="<br/><form onsubmit='return false;'>"+_("Address (URL):")+' <input id="optionBodyUrl" type="text" style="width:220px" /><input id="optionBodyUrlApply" type="button" value="'+_("Apply")+'"/></form><div style="margin-top:15px"></div>';var G=$("optionBodyUrl");var D=$("optionBodyUrlApply");if(typeof App.pageCustom.bodyBackground!="undefined"){G.value=App.pageCustom.bodyBackground}D.onclick=function(){var M=this.parentNode.nextSibling;if(G.value==""){delete App.pageCustom.bodyBackground;M.innerHTML=""}else{App.pageCustom.bodyBackground=G.value;M.innerHTML="<p align='center'><img width='150' height='150' src='"+G.value+"' /></p>"}App.savePageCustom();Netvibes.Settings.Wallpaper.Body.update();return false}}C.loaded=true;break;case"netvibes":if(!C.loaded){C.innerHTML='<div class="listThemes" style="margin-top:5px;margin-left:-5px;width:439px;height:297px;">'+_("Loading...")+"</div>";var E=[{src:"/img/wallpapers/thumbs/_blank.gif",src_o:"/img/wallpapers/_blank.gif"},{src:"/img/wallpapers/thumbs/flowers01.png",src_o:"/img/wallpapers/flowers01.png"},{src:"/img/wallpapers/thumbs/flowers02.jpg",src_o:"/img/wallpapers/flowers02.jpg"},{src:"/img/wallpapers/thumbs/flowers03.jpg",src_o:"/img/wallpapers/flowers03.jpg"},{src:"/img/wallpapers/thumbs/cupcake.jpg",src_o:"/img/wallpapers/cupcake.gif"},{src:"/img/wallpapers/thumbs/candy.jpg",src_o:"/img/wallpapers/candy.jpg"},{src:"/img/wallpapers/thumbs/daisy.png",src_o:"/img/wallpapers/daisy.jpg"},{src:"/img/wallpapers/thumbs/drop.jpg",src_o:"/img/wallpapers/drop.png"},{src:"/img/wallpapers/thumbs/flower.jpg",src_o:"/img/wallpapers/flower.png"},{src:"/img/wallpapers/thumbs/polka-green.jpg",src_o:"/img/wallpapers/polka-green.png"},{src:"/img/wallpapers/thumbs/polka-purple.jpg",src_o:"/img/wallpapers/polka-purple.png"},{src:"/img/wallpapers/thumbs/stripes-black.jpg",src_o:"/img/wallpapers/stripes-black.jpg"},{src:"/img/wallpapers/thumbs/stripes-gray.jpg",src_o:"/img/wallpapers/stripes-gray.png"},{src:"/img/wallpapers/thumbs/stripes-orange.jpg",src_o:"/img/wallpapers/stripes-orange.png"},{src:"/img/wallpapers/thumbs/pieddepoule-blue.jpg",src_o:"/img/wallpapers/pieddepoule-blue.png"},{src:"/img/wallpapers/thumbs/pieddepoule-gray.jpg",src_o:"/img/wallpapers/pieddepoule-gray.png"},{src:"/img/wallpapers/thumbs/psychedelik.jpg",src_o:"/img/wallpapers/psychedelik.png"},{src:"/img/wallpapers/thumbs/japanese-gray.jpg",src_o:"/img/wallpapers/japanese-gray.png"},{src:"/img/wallpapers/thumbs/japanese-red.png",src_o:"/img/wallpapers/japanese-red.jpg"},{src:"/img/wallpapers/thumbs/star.jpg",src_o:"/img/wallpapers/star.gif"},{src:"/img/wallpapers/thumbs/tartan-kaki.jpg",src_o:"/img/wallpapers/tartan-kaki.png"},{src:"/img/wallpapers/thumbs/water.jpg",src_o:"/img/wallpapers/water.jpg"},{src:"/img/wallpapers/thumbs/zebra.jpg",src_o:"/img/wallpapers/zebra.jpg"},{src:"/img/wallpapers/thumbs/leopard.jpg",src_o:"/img/wallpapers/leopard.jpg"},{src:"/img/wallpapers/thumbs/apples.png",src_o:"/img/wallpapers/apples.png"},{src:"/img/wallpapers/thumbs/bluestripes.png",src_o:"/img/wallpapers/bluestripes.png"},{src:"/img/wallpapers/thumbs/brushedmetal.png",src_o:"/img/wallpapers/brushedmetal.png"},{src:"/img/wallpapers/thumbs/camo.png",src_o:"/img/wallpapers/camo.png"},{src:"/img/wallpapers/thumbs/carbon.png",src_o:"/img/wallpapers/carbon.png"},{src:"/img/wallpapers/thumbs/dots.png",src_o:"/img/wallpapers/dots.png"},{src:"/img/wallpapers/thumbs/lines.png",src_o:"/img/wallpapers/lines.png"},{src:"/img/wallpapers/thumbs/love.png",src_o:"/img/wallpapers/love.png"},{src:"/img/wallpapers/thumbs/spots.png",src_o:"/img/wallpapers/spots.png"},{src:"/img/wallpapers/thumbs/squares.jpg",src_o:"/img/wallpapers/squares.jpg"},{src:"/img/wallpapers/thumbs/stars.png",src_o:"/img/wallpapers/stars.png"}];this.displayNetvibes(E);C.loaded=true}break;case"myspace":if(!C.loaded){C.innerHTML='<br/><form><img src="/modules/myspace/icon-myspace.gif" style="vertical-align:top;margin-right:2px" /> http://www.myspace.com/<input value="" type="text" style="width:100px"/><input class="submit" type="submit" value="'+_("Import")+'" /></form><div style="margin-top:15px"></div>';var H=C.getElementsByTagName("input");H[1].onclick=function(){this.parentNode.nextSibling.innerHTML=_("Loading...");var M=new Request({onSuccess:L.displayMyspace.bind(L)}).get("/ajax/settings/get/myspace.php",{q:H[0].value});return false};C.loaded=true}break;case"twitter":if(!C.loaded){C.innerHTML='<br/><form><img src="/img/sendModule/twitter.gif" style="vertical-align:top;margin-right:2px" /> http://www.twitter.com/<input value="" type="text" style="width:100px"/><input class="submit" type="submit" value="'+_("Import")+'" /></form><div style="margin-top:15px"></div>';var H=C.getElementsByTagName("input");H[1].onclick=function(){this.parentNode.nextSibling.innerHTML=_("Loading...");var M=new Request({onSuccess:L.displayTwitter.bind(L)}).get("/ajax/settings/get/twitter.php",{q:H[0].value});return false};C.loaded=true}break}},displayNetvibes:function(responseText){if(typeof responseText==="object"){var json=responseText}else{try{var json=eval("("+responseText+")")}catch(e){var json=[]}}var tabContent=this.contentNode.getElementsByTagName("div")[0].childNodes[0];var container=tabContent.getElementsByTagName("div")[0];var newContainer=document.createElement("ul");container.innerHTML="";container.appendChild(newContainer);var ln=json.length;var self=this;for(var i=0;i<ln;i++){var div=document.createElement("li");div.className="theme";div.style.margin="3px";div.innerHTML='<a href="javascript:void(0)" class="switcher"><img width="75" height="75" indexI="'+i+'" src="'+json[i].src+'"  /></a>';if(App.pageCustom.bodyBackground&&App.pageCustom.bodyBackground==json[i].src_o){Element.addClassName(div,"selected")}div.getElementsByTagName("a")[0].onclick=function(e){$(self.contentNode).getElements("li").removeClass("selected");Element.addClassName(this.parentNode,"selected");var i=this.firstChild.getAttribute("indexI");var scroll=container.scrollTop;var url=json[i].src_o;$("optionBodyDisplayMode").value="tile";delete App.pageCustom.bodyCenter;if(url=="/img/wallpapers/_blank.gif"){self.switchBackground()}else{self.switchBackground(url)}container.scrollTop=scroll;return false};newContainer.appendChild(div)}var hr=document.createElement("hr");hr.style.clear="both";hr.style.visibility="hidden";newContainer.appendChild(hr)},displayFlickr:function(responseText){try{var json=eval("("+responseText+")")}catch(e){var json=[]}var tabContent=this.contentNode.getElementsByTagName("div")[0].childNodes[2];var container=tabContent.getElementsByTagName("div")[0];container.innerHTML="";var newContainer=document.createElement("ul");container.appendChild(newContainer);var ln=json.length;if(ln==0){container.innerHTML=_("No result for this search.")}var self=this;for(var i=0;i<ln;i++){var div=document.createElement("li");div.className="theme";div.style.margin="3px";div.innerHTML='<a href="javascript:void(0)" class="switcher"><img indexI="'+i+'" src="'+json[i].src+'"  /></a>';div.getElementsByTagName("a")[0].onclick=function(e){$(self.contentNode).getElements("li").removeClass("selected");Element.addClassName(this.parentNode,"selected");var i=this.firstChild.getAttribute("indexI");var scroll=container.scrollTop;var url=json[i].src_o;self.switchBackground(url);container.scrollTop=scroll;return false};div.getElementsByTagName("a")[0].href=json[i].href;div.getElementsByTagName("a")[0].name=_("Author:")+" "+json[i].authorName+" ("+json[i].src_o_w+"*"+json[i].src_o_h+")";div.getElementsByTagName("a")[0].title=_("Author:")+" "+json[i].authorName+" ("+json[i].src_o_w+"*"+json[i].src_o_h+")";newContainer.appendChild(div)}var hr=document.createElement("hr");hr.style.clear="both";hr.style.visibility="hidden";newContainer.appendChild(hr)},displayMyspace:function(C){var A=C;var B=this.contentNode.getElementsByTagName("div")[0].childNodes[3];var D=B.getElementsByTagName("div")[0];D.className="";if(A=="error"){D.className="error";D.innerHTML=_("Error! Please Check if this myspace has a background image")}else{D.innerHTML=_("Background image has been imported");D.innerHTML+="<br/><p align='center'><img width='150' height='150' src='"+A+"' /></p>";this.switchBackground(A)}},displayTwitter:function(C){var A=C;var B=this.contentNode.getElementsByTagName("div")[0].childNodes[4];var D=B.getElementsByTagName("div")[0];D.className="";if(A=="error"){D.className="error";D.innerHTML=_("Error")}else{D.innerHTML=_("Background image has been imported");D.innerHTML+="<br/><p align='center'><img width='150' height='150' src='"+A+"' /></p>";this.switchBackground(A)}},switchBackground:function(A){if(typeof A=="undefined"){$("optionBodyUrl").value="";delete App.pageCustom.bodyBackground}else{$("optionBodyUrl").value=A;App.pageCustom.bodyBackground=A}App.savePageCustom();Netvibes.Settings.Wallpaper.Body.update()}};Netvibes.Settings.Wallpaper.Body.update=function(){document.body.setAttribute("style","");var B;for(var A=0;l=document.getElementsByTagName("link")[A];A++){if(l.getAttribute("rel").indexOf("style")!=-1&&l.getAttribute("href").indexOf("noborder")!=-1){B=l;break}}if(App.pageCustom.bodyBackground){document.body.style.backgroundImage="url("+App.pageCustom.bodyBackground+")";if(App.pageCustom.bodyCenter){document.body.style.backgroundPosition="center center";document.body.style.backgroundRepeat="no-repeat"}else{document.body.style.backgroundPosition="top left";document.body.style.backgroundRepeat="repeat"}if(App.pageCustom.bodyFixed){document.body.style.backgroundAttachment="fixed"}else{document.body.style.backgroundAttachment=""}if(B){B.disabled=false}else{setTimeout(function(){App.insertCssFile(NV_PATH+"themes/base/noborder.css")},10)}}else{document.body.style.backgroundImage="";document.body.style.backgroundRepeat="";document.body.style.backgroundAttachment="";document.body.style.backgroundPosition="";if(B){B.disabled=true}}if(App.pageCustom.bodyColor){document.body.style.backgroundColor=App.pageCustom.bodyColor;if(!App.pageCustom.bodyBackground){document.body.style.backgroundImage="url(img/s.gif)"}if(B){B.disabled=false}else{setTimeout(function(){App.insertCssFile(NV_PATH+"themes/base/noborder.css")},10)}}else{document.body.style.backgroundColor=""}Netvibes.Settings.Wallpaper.updateSubmitThemeLink()};Netvibes.Settings.Wallpaper.Header=Class.create();Netvibes.Settings.Wallpaper.Header.prototype={initialize:function(A){this.contentNode=A;this.contentNode.innerHTML="";this.build()},build:function(){var L=this;this.contentNode.innerHTML=_("Select an image from")+" <select id='settingsWallpaperHeaderSelect'><option value='0' name='netvibes'>"+_("netvibes selection")+"</option><option value='1' name='url'>"+_("link (url)")+"</option><option value='2' name='flickr'>flickr</option><option value='3' name='myspace'>myspace</option><option value='4' name='twitter'>twitter</option></select>";var D=document.createElement("div");for(var T=0;T<=4;T++){var J=document.createElement("div");J.style.display="none";D.appendChild(J)}this.contentNode.appendChild(D);$("settingsWallpaperHeaderSelect").onchange=function(){L.onTabChange(this.value,this.childNodes[this.value].getAttribute("name"))};this.onTabChange(2,"flickr");this.onTabChange(1,"url");this.onTabChange(0,"netvibes");var J=document.createElement("div");var E=425;if(Browser.isIE&&Browser.version<7){E=410}var G='<hr style="clear:both;height:1px;margin:0px;margin-bottom:14px" /><div style="margin-bottom:6px">'+_("Or background color:")+' <input type="radio" id="optionHeaderBackgroundColorRadio" name="optionHeaderBackgroundColorRadio" value="#AAAAAA" /> <img id="optionHeaderColorZone" width="30" height="15" src="img/s.gif" style="border: 1px solid grey;background-color: #AAAAAA;vertical-align: middle; margin-bottom: 3px" /><input id="optionHeaderInputColor" type="text" value="#AAAAAA" style="margin-left:2px;width:65px" /><input id="optionHeaderBackgroundNoColor" type="radio" name="optionHeaderBackgroundColorRadio" style="margin-left: 5px"/> <label for="optionHeaderBackgroundNoColor">'+_("Default")+'</label><input id="optionHeaderBackgroundTransparent" type="radio" name="optionHeaderBackgroundColorRadio" style="margin-left:5px"/> <label for="optionHeaderBackgroundTransparent">'+_("Transparent")+'</label></div><fieldset class="autoclear"><legend>'+_("Text color")+'</legend><input id="optionHeaderTextColor" name="headerTextColor" value="#AAAAAA" type="radio" style="margin-right:5px" /><img id="optionHeaderColorZoneText" width="30" height="15" src="img/s.gif" style="border: 1px solid grey;background-color: #AAAAAA;vertical-align: middle; margin-bottom: 3px"/><input id="optionHeaderTextColorHexa" type="text" value="#AAAAAA" style="margin-left: 2px; width:65px" /><input id="optionHeaderTextNoColor" name="headerTextColor" value="none" type="radio" style="margin:0 5px" /><label for="optionHeaderTextNoColor">'+_("Default")+'</label></fieldset><fieldset class="autoclear"><legend>'+_("Header height")+'</legend><div id="optionHeaderSlider" class="slider" style="width:'+E+'px;margin-top:10px;margin-bottom:10px;height:5px;position:relative;"><div id="optionHeaderCursor" class="cursor" style="position:absolute;left:0px;top:-6px;"></div></div></fieldset><div id="advanceHeaderOptions" style="display:none;"><fieldset style=\'margin-top:10px\'><legend>'+_("Advanced options")+"</legend>"+_("Display mode:")+' <select id="optionHeaderDisplayMode" style="margin-right:20px"><option value="center">'+_("center")+'</option><option value="tile">'+_("tile")+"</option></select>"+_("Alignment:")+' <select id="optionHeaderAlignment"><option value="top">'+_("top")+'</option><option value="middle">'+_("middle")+'</option><option value="bottom">'+_("bottom")+"</option></select> </fieldset></div>";G+='<table width="100%"><tr><td><a id="optionHeaderdAdvancedLink" class="advanced" href="#">'+_("Show advanced options")+'</a></td><td align="right"><a id="optionHeaderRestoreLink" href="#">'+_("Restore defaults")+"</a></td></tr></table>";J.innerHTML=G;this.contentNode.appendChild(J);var U=$("optionHeaderUrl");var V=$("optionHeaderUrlApply");var Q=$("optionHeaderDisplayMode");var O=$("optionHeaderColorZone");var K=$("optionHeaderBackgroundColorRadio");var W=$("optionHeaderInputColor");var I=$("optionHeaderBackgroundNoColor");var H=$("optionHeaderBackgroundTransparent");var M=$("optionHeaderTextColor");var P=$("optionHeaderTextColorHexa");var R=$("optionHeaderTextNoColor");var N=$("optionHeaderDisplayMode");var A=$("optionHeaderAlignment");var O=$("optionHeaderColorZone");O.style.cursor="pointer";var F=$("optionHeaderColorZoneText");F.style.cursor="pointer";var B=$("optionHeaderdAdvancedLink");var C=$("optionHeaderRestoreLink");if(App.pageCustom.headerCenter){Q.value="center"}else{Q.value="tile"}if(App.pageCustom.headerAlignment){A.value=App.pageCustom.headerAlignment}else{A.value="middle"}if(App.pageCustom.headerColor){if(App.pageCustom.headerColor=="transparent"){H.checked="checked"}else{K.value=App.pageCustom.headerColor;W.value=App.pageCustom.headerColor;K.checked="checked";O.style.backgroundColor=App.pageCustom.headerColor}}else{I.checked="checked"}if(App.pageCustom.headerTextColor){M.checked="checked";M.value=App.pageCustom.headerTextColor;F.style.backgroundColor=App.pageCustom.headerTextColor;P.value=App.pageCustom.headerTextColor}else{R.checked="checked";F.style.backgroundColor="#AAAAAA"}Q.onchange=function(){if(this.value=="center"){App.pageCustom.headerCenter=1}else{delete App.pageCustom.headerCenter}App.savePageCustom();Netvibes.Settings.Wallpaper.Header.update()};A.onchange=function(){if(this.value!="middle"){App.pageCustom.headerAlignment=this.value}else{delete App.pageCustom.headerAlignment}App.savePageCustom();Netvibes.Settings.Wallpaper.Header.update()};O.onclick=function(X){Netvibes.UI.showColorPicker(this.parentNode,{color:App.pageCustom.headerColor,onSelectionChange:function(Y){W.value="#"+Y;K.value="#"+Y;O.style.backgroundColor="#"+Y;K.click()}})};W.onblur=function(){if(App.pageCustom.headerColor==this.value){return false}O.style.backgroundColor=this.value;K.value=this.value;K.click()};K.onclick=function(){App.pageCustom.headerColor=this.value;App.pageCustom.headerBackground="";App.savePageCustom();Netvibes.Settings.Wallpaper.Header.update()};I.onclick=function(){delete App.pageCustom.headerColor;App.pageCustom.headerBackground="";App.savePageCustom();Netvibes.Settings.Wallpaper.Header.update()};H.onclick=function(){App.pageCustom.headerColor="transparent";App.pageCustom.headerBackground="";App.savePageCustom();Netvibes.Settings.Wallpaper.Header.update()};C.onclick=function(X){I.checked="checked";delete App.pageCustom.headerColor;Q.value="tile";delete App.pageCustom.headerCenter;$("optionHeaderUrl").value="";delete App.pageCustom.headerHeight;S.style.left="0px";delete App.pageCustom.headerTextColor;R.checked="checked";$("optionHeaderUrl").value="";$("optionHeaderUrlApply").click();return false};B.onclick=function(){var Z=$(L.contentNode).getElementsByClassName("listThemes");if($("advanceHeaderOptions").style.display=="block"){var X=53;this.innerHTML=_("Show advanced options");$("advanceHeaderOptions").style.display="none"}else{var X=-53;this.innerHTML=_("Hide advanced options");$("advanceHeaderOptions").style.display="block"}var a=Z.length;for(var Y=0;Y<a;Y++){Z[Y].style.height=(parseInt(Z[Y].style.height)+X)+"px"}return false};F.onclick=function(X){Netvibes.UI.showColorPicker(this.parentNode,{color:App.pageCustom.headerTextColor,onSelectionChange:function(Y){P.value="#"+Y;M.value="#"+Y;F.style.backgroundColor="#"+Y;M.click()}})};M.onclick=function(){App.pageCustom.headerTextColor=this.value;App.savePageCustom();Netvibes.Settings.Wallpaper.Header.update()};P.onblur=function(){F.style.backgroundColor=this.value;M.value=this.value;M.click()};R.onclick=function(){delete App.pageCustom.headerTextColor;App.savePageCustom();Netvibes.Settings.Wallpaper.Header.update()};var S=$("optionHeaderCursor");S.style.cursor="pointer";var E=425;if(Browser.isIE&&Browser.version<7){E=410;S.style.background="#CCCCCC"}if(App.pageCustom.headerHeight){S.style.left=Math.floor(E*parseInt(App.pageCustom.headerHeight)/150)+"px"}S.onmousedown=function(Y){if(!Y){Y=window.event}this.drag=true;var X=this;var Z=(Y.clientX-parseInt(this.style.left));Event.stop(Y);document.onmousemove=function(b){if(!b){b=window.event}if(!X.drag){return }if((b.clientX-Z)<0){var a=0}else{if((b.clientX-Z)>E){var a=E}else{var a=(b.clientX-Z)}}X.style.left=a+"px";var a=Math.floor((a/E*150)/2);$("topLinks").style.marginBottom=a+"px";$("divTabs").style.marginTop=a+"px";Event.stop(b)};document.onmouseup=function(){if(!X.drag){return }X.drag=false;var a=parseInt(X.style.left);var a=Math.floor(a/E*150);if(a==0){delete App.pageCustom.headerHeight}else{App.pageCustom.headerHeight=a}a=Math.ceil(a/2);$("topLinks").style.marginBottom=a+"px";$("divTabs").style.marginTop=a+"px";App.savePageCustom()}}},onTabChange:function(J,A){var K=this.contentNode.getElementsByTagName("div")[0].childNodes;var I=K.length;for(var F=0;F<I;F++){K[F].style.display="none"}var C=K[J];C.style.display="block";if(Browser.isIE){C.style.padding="0px 5px 0px 5px"}else{C.style.padding="0px 5px 10px 5px"}var L=this;switch(A){case"flickr":if(!C.loaded){C.innerHTML='<form><img src="/img/flickr.png" style="vertical-align:top;margin-right:2px" /><input value="background" type="text" style="width:200px;"/><input class="submit" type="submit" value="'+_("search")+'" /><div class="listThemes" style="margin-top:5px;margin-left:-5px;width:439px;height:184px;">'+_("Loading...")+"</div></form>";var H=C.getElementsByTagName("input");var B=C.firstChild;B.onsubmit=function(){var N=new Request({onSuccess:L.displayFlickr.bind(L)}).get("/data/flickr/index.php",{q:H[0].value.replace(/\s/g,","),random:Math.random()});var M=$(C).getElementsByClassName("listThemes")[0];M.innerHTML=_("Loading...");return false};var E=new Request({onSuccess:L.displayFlickr.bind(L)}).get("/data/flickr/index.php",{q:"background",random:Math.random()});C.loaded=true}break;case"url":if(!C.loaded){C.innerHTML="<br/><form onsubmit='return false;'>"+_("Address (URL):")+' <input id="optionHeaderUrl" type="text" style="width:220px" /><input id="optionHeaderUrlApply" type="button" value="'+_("Apply")+'"/></form><div style="margin-top:15px"></div>';var G=$("optionHeaderUrl");var D=$("optionHeaderUrlApply");if(typeof App.pageCustom.headerBackground!="undefined"){G.value=App.pageCustom.headerBackground}D.onclick=function(){var M=this.parentNode.nextSibling;if(G.value==""){App.pageCustom.headerBackground="";M.innerHTML=""}else{App.pageCustom.headerBackground=G.value;M.innerHTML="<p align='center'><img width='50' height='50' src='"+G.value+"' /></p>"}if($("optionHeaderBackgroundTransparent")&&$("optionHeaderBackgroundNoColor")&&$("optionHeaderBackgroundTransparent").checked){$("optionHeaderBackgroundNoColor").checked="checked";delete App.pageCustom.headerColor}App.savePageCustom();Netvibes.Settings.Wallpaper.Header.update();return false}}C.loaded=true;break;case"netvibes":if(!C.loaded){C.innerHTML='<div class="listThemes" style="margin-top:5px;margin-left:-5px;width:439px;height:190px;">'+_("Loading...")+"</div>";window.setTimeout(function(){var M=[{src:"/img/headers/thumbs/_blank.gif",src_o:"/img/headers/_blank.gif"},{src:"/img/headers/thumbs/exposition-blueberry.png",src_o:"/img/headers/exposition-blueberry.png"},{src:"/img/headers/thumbs/exposition-cocoa.png",src_o:"/img/headers/exposition-cocoa.png"},{src:"/img/headers/thumbs/exposition-grapes.png",src_o:"/img/headers/exposition-grapes.png"},{src:"/img/headers/thumbs/exposition-olive.png",src_o:"/img/headers/exposition-olive.png"},{src:"/img/headers/thumbs/exposition-pepper.png",src_o:"/img/headers/exposition-pepper.png"},{src:"/img/headers/thumbs/exposition-raspberry.png",src_o:"/img/headers/exposition-raspberry.png"},{src:"/img/headers/thumbs/candy02.jpg",src_o:"/img/headers/candy02.jpg"},{src:"/img/headers/thumbs/4seasons.jpg",src_o:"/img/headers/4seasons.jpg"},{src:"/img/headers/thumbs/love.jpg",src_o:"/img/headers/love.jpg"},{src:"/img/headers/thumbs/sea.png",src_o:"/img/headers/sea.png"},{src:"/img/headers/thumbs/cupcake.png",src_o:"/img/headers/cupcake.png"},{src:"/img/headers/thumbs/palm.jpg",src_o:"/img/headers/palm.jpg"},{src:"/img/headers/thumbs/candy.jpg",src_o:"/img/headers/candy.jpg"},{src:"/img/headers/thumbs/paris.jpg",src_o:"/img/headers/paris.jpg"},{src:"/img/headers/thumbs/drops.jpg",src_o:"/img/headers/drops.png"},{src:"/img/headers/thumbs/flower.jpg",src_o:"/img/headers/flower.png"},{src:"/img/headers/thumbs/red.jpg",src_o:"/img/headers/red.jpg"},{src:"/img/headers/thumbs/black-stripes.png",src_o:"/img/headers/black-stripes.png"},{src:"/img/headers/thumbs/tartan-prune.png",src_o:"/img/headers/tartan-prune.png"},{src:"/img/headers/thumbs/clouds.png",src_o:"/img/headers/clouds.png"},{src:"/img/headers/thumbs/grass.png",src_o:"/img/headers/grass.png"},{src:"/img/headers/thumbs/grunge01.png",src_o:"/img/headers/grunge01.png"},{src:"/img/headers/thumbs/halloween.jpg",src_o:"/img/headers/halloween.jpg"},{src:"/img/headers/thumbs/ornament.png",src_o:"/img/headers/ornament.png"},{src:"/img/headers/thumbs/stars01.jpg",src_o:"/img/headers/stars01.jpg"},{src:"/img/headers/thumbs/sweet.png",src_o:"/img/headers/sweet.png"}];L.displayNetvibes(M)},10)}C.loaded=true;break;case"myspace":if(!C.loaded){C.innerHTML='<br/><form><img src="/modules/myspace/icon-myspace.gif" style="vertical-align:top;margin-right:2px" /> http://www.myspace.com/<input value="" type="text" style="width:100px"/><input class="submit" type="submit" value="'+_("Import")+'" /></form><div style="margin-top:15px"></div>';var H=C.getElementsByTagName("input");H[1].onclick=function(){this.parentNode.nextSibling.innerHTML=_("Loading...");var M=new Request({onSuccess:L.displayMyspace.bind(L)}).get("/ajax/settings/get/myspace.php",{q:H[0].value});return false};C.loaded=true}break;case"twitter":if(!C.loaded){C.innerHTML='<br/><form><img src="/img/sendModule/twitter.gif" style="vertical-align:top;margin-right:2px" /> http://www.twitter.com/<input value="" type="text" style="width:100px"/><input class="submit" type="submit" value="'+_("Import")+'" /></form><div style="margin-top:15px"></div>';var H=C.getElementsByTagName("input");H[1].onclick=function(){this.parentNode.nextSibling.innerHTML=_("Loading...");var M=new Request({onSuccess:L.displayTwitter.bind(L)}).get("/ajax/settings/get/twitter.php",{q:H[0].value});return false};C.loaded=true}break}},displayNetvibes:function(responseText){if(typeof responseText==="object"){var json=responseText}else{try{var json=eval("("+responseText+")")}catch(e){var json=[]}}var tabContent=this.contentNode.getElementsByTagName("div")[0].childNodes[0];var container=tabContent.getElementsByTagName("div")[0];var newContainer=document.createElement("ul");container.innerHTML="";container.appendChild(newContainer);var ln=json.length;var self=this;for(var i=0;i<ln;i++){var div=document.createElement("li");div.className="theme";div.style.margin="3px";div.innerHTML='<a href="javascript:void(0)" class="switcher"><img width="75" height="75" indexI="'+i+'" src="'+App.getStaticUrl(json[i].src)+'"  /></a>';if(App.pageCustom.headerBackground&&App.pageCustom.headerBackground==json[i].src_o){Element.addClassName(div,"selected")}div.getElementsByTagName("a")[0].onclick=function(e){$(self.contentNode).getElements("li").removeClass("selected");Element.addClassName(this.parentNode,"selected");var i=this.firstChild.getAttribute("indexI");var scroll=container.scrollTop;var url=json[i].src_o;$("optionHeaderDisplayMode").value="tile";delete App.pageCustom.headerCenter;if(url=="/img/headers/_blank.gif"){self.switchBackground()}else{self.switchBackground(url)}container.scrollTop=scroll;return false};newContainer.appendChild(div)}var hr=document.createElement("hr");hr.style.clear="both";hr.style.visibility="hidden";newContainer.appendChild(hr)},displayFlickr:function(responseText){try{var json=eval("("+responseText+")")}catch(e){var json=[]}var tabContent=this.contentNode.getElementsByTagName("div")[0].childNodes[2];var container=tabContent.getElementsByTagName("div")[0];container.innerHTML="";var newContainer=document.createElement("ul");container.appendChild(newContainer);var ln=json.length;if(ln==0){container.innerHTML=_("No result for this search.")}var self=this;for(var i=0;i<ln;i++){var div=document.createElement("li");div.className="theme";div.style.margin="3px";div.innerHTML='<a href="javascript:void(0)" class="switcher"><img indexI="'+i+'" src="'+json[i].src+'"  /></a>';div.getElementsByTagName("a")[0].onclick=function(e){$(self.contentNode).getElements("li").removeClass("selected");Element.addClassName(this.parentNode,"selected");var i=this.firstChild.getAttribute("indexI");var scroll=container.scrollTop;var url=json[i].src_o;self.switchBackground(url);container.scrollTop=scroll;return false};div.getElementsByTagName("a")[0].href=json[i].href;div.getElementsByTagName("a")[0].name=_("Author:")+" "+json[i].authorName+" ("+json[i].src_o_w+"*"+json[i].src_o_h+")";div.getElementsByTagName("a")[0].title=_("Author:")+" "+json[i].authorName+" ("+json[i].src_o_w+"*"+json[i].src_o_h+")";newContainer.appendChild(div)}var hr=document.createElement("hr");hr.style.clear="both";hr.style.visibility="hidden";newContainer.appendChild(hr)},displayMyspace:function(C){var A=C;var B=this.contentNode.getElementsByTagName("div")[0].childNodes[3];var D=B.getElementsByTagName("div")[0];D.className="";if(A=="error"){D.className="error";D.innerHTML=_("Error! Please Check if this myspace has a background image")}else{D.innerHTML=_("Background image has been imported");D.innerHTML+="<br/><p align='center'><img width='50' height='50' src='"+A+"' /></p>";this.switchBackground(A)}},displayTwitter:function(C){var A=C;var B=this.contentNode.getElementsByTagName("div")[0].childNodes[4];var D=B.getElementsByTagName("div")[0];D.className="";if(A=="error"){D.className="error";D.innerHTML=_("Error")}else{D.innerHTML=_("Background image has been imported");D.innerHTML+="<br/><p align='center'><img width='50' height='50' src='"+A+"' /></p>";this.switchBackground(A)}},switchBackground:function(A){if(typeof A=="undefined"){$("optionHeaderUrl").value="";App.pageCustom.headerBackground=""}else{$("optionHeaderUrl").value=A;App.pageCustom.headerBackground=A}if($("optionHeaderBackgroundTransparent")&&$("optionHeaderBackgroundNoColor")&&$("optionHeaderBackgroundTransparent").checked){$("optionHeaderBackgroundNoColor").checked="checked";delete App.pageCustom.headerColor}App.savePageCustom();Netvibes.Settings.Wallpaper.Header.update()}};Netvibes.Settings.Wallpaper.Header.update=function(){var G=$("header");var D=$("header").getElement(".overlay");var A=$("header").style.paddingLeft;$("header").setAttribute("style","");$("header").style.paddingLeft=A;if(App.pageCustom.headerBackground){G.style.backgroundImage="url("+App.pageCustom.headerBackground+")";D.style.backgroundImage="none";if(App.pageCustom.headerCenter){$("header").style.backgroundRepeat="no-repeat"}else{$("header").style.backgroundRepeat="repeat"}if(App.pageCustom.headerAlignment){$("header").style.backgroundPosition=App.pageCustom.headerAlignment+" center"}else{$("header").style.backgroundPosition="center center"}}else{$("header").style.backgroundRepeat="";G.style.backgroundImage="none";D.style.backgroundImage="none";G.style.backgroundImage="";D.style.backgroundImage=""}if(App.pageCustom.headerColor){$("header").style.backgroundColor=App.pageCustom.headerColor;if(!App.pageCustom.headerBackground){$("header").style.backgroundImage="url(img/s.gif)"}}else{$("header").style.backgroundColor=""}if(App.pageCustom.headerHeight){$("topLinks").style.marginBottom=Math.ceil(App.pageCustom.headerHeight/2)+"px";$("divTabs").style.marginTop=Math.ceil(App.pageCustom.headerHeight/2)+"px"}else{$("topLinks").style.marginBottom="";$("divTabs").style.marginTop=""}if(App.pageCustom.headerTextColor){var C=App.pageCustom.headerTextColor}else{var C=""}$("topLinks").style.color=C;$("pageTitle").style.color=C;if($("aNewTab")){$("aNewTab").style.color=C}var B=$("topLinks").getElementsByTagName("a");var F=B.length;for(var E=0;E<F;E++){B[E].style.color=C}Netvibes.Settings.Wallpaper.updateSubmitThemeLink()};;
if(typeof Netvibes=="undefined"||!Netvibes){var Netvibes={}}Netvibes.Vibes=[];Netvibes.Vibes.push({name:"web",title:_("Web Search"),icon:App.getStaticUrl(NV_PATH+"img/search.gif"),type:"Netvibes.Vibes.Engine",enabled:true});Netvibes.Vibes.push({name:"blog",title:_("Blog Search"),icon:App.getStaticUrl(NV_PATH+"img/blogsearch.png"),type:"Netvibes.Vibes.Engine",enabled:true});Netvibes.Vibes.push({name:"image",title:_("Images Search"),icon:NV_PATH+"modules/imagesSearch/favicon.png",type:"Netvibes.Vibes.Engine",enabled:true});Netvibes.Vibes.push({name:"video",title:_("Video Search"),icon:App.getStaticUrl(NV_PATH+"img/video-player.gif"),type:"Netvibes.Vibes.Engine",enabled:true});Netvibes.Vibes.push({name:"podcast",title:_("Podcast Search"),icon:NV_PATH+"img/speaker.gif",type:"Netvibes.Vibes.Engine",enabled:true});Netvibes.Vibes.push({name:"shopping",title:_("Shopping Search"),icon:App.getStaticUrl(NV_PATH+"img/cart.gif"),type:"Netvibes.Vibes.Engine",enabled:true});Netvibes.checkVibes=function(B){var A={ImagesSearch:"image",BlogSearch:"blog",WebSearch:"web",PodcastSearch:"podcast",Video:"video",ShoppingSearch:"shopping"};if(typeof A[B]!="undefined"){return{type:A[B],name:"Vibes"}}return false};Netvibes.VibesPanel=new Class({Extends:ModalDialog,initialize:function(element,options){this.parent(element,options);this.pages=[];this.selectedIndex=0;this.listElement=null;this.paneElement=null;this.heading.innerHTML=_("Manage Search Engines");for(var i=0,module;module=App.moduleList[i];i++){if(module.dataObj.tab==App.selectedTab&&module.widget&&module.widget.pub&&module.widget.pub.fixId==this.options.fixModuleId){this.module=module.widget.pub}}this.listElement=document.createElement("ol");this.listElement.className="settings";for(var i=0,setting;setting=Netvibes.Vibes[i];i++){var item=document.createElement("li");var icon=document.createElement("img");icon.src=setting.icon;var link=document.createElement("a");link.href="javascript:void(0)";link.innerHTML='<img style="margin-bottom: -4px; margin-right: 4px" src="'+setting.icon+'" />'+setting.title;link.setAttribute("hidefocus","hidefocus");link.setAttribute("selectedIndex",i);item.appendChild(link);this.listElement.appendChild(item);if(setting.enabled){link.onclick=this.onSelectionChanged.bindAsEventListener(this);this.pages.push({name:setting.name,index:i,manager:eval("new "+setting.type+"(setting.name, this.options.fixModuleId)"),contentNode:null})}else{link.className="disabled"}}this.container.appendChild(this.listElement);this.paneElement=document.createElement("div");this.paneElement.className="page";this.container.appendChild(this.paneElement);var bottomDiv=document.createElement("div");bottomDiv.className="bottom";this.container.appendChild(bottomDiv);var inputDone=document.createElement("input");inputDone.style.cssFloat=inputDone.style.styleFloat=App.rtl?"left":"right";inputDone.type="button";inputDone.className="done";Element.addClassName(inputDone,"button");inputDone.value=_("Done");inputDone.onclick=this.hide.bindAsEventListener(this);bottomDiv.appendChild(inputDone)},localeOptionChecked:function(){for(var A=0,B;B=this.pages[A];A++){if(B.index==this.selectedIndex){B.manager.module.toggleShowLocalEngines();B.manager.activate();break}}},getContent:function(){},getPageIndex:function(A){if(typeof A=="string"){return Netvibes.Vibes.detect(function(B){return B.name==A})}return A},setCurrentPage:function(B){if(typeof (B)=="string"&&B.length>3){var C=this.pages.detect(function(F){return F.name==B});B=C?C.index:0}this.selectedIndex=B;$A(this.listElement.getElementsByTagName("a")).each(function(G,F){if(G.getAttribute("selectedIndex")==B){Element.addClassName(G,"selected")}else{Element.removeClassName(G,"selected")}});for(var A=0,D;D=this.pages[A];A++){if(D.index==B){D.manager.setFixModuleId(this.options.fixModuleId);if(D.contentNode==null||D.manager.forceLoad){D.contentNode=D.manager.load();this.paneElement.appendChild(D.contentNode);if(typeof (D.manager.loaded)=="function"){D.manager.loaded()}}Element.show(D.contentNode);if(typeof (D.manager.activate)=="function"){try{D.manager.activate()}catch(E){}}}else{if(D.contentNode){Element.hide(D.contentNode)}}}},onSelectionChanged:function(C){var B=Event.element(C);var A=B.getAttribute("selectedIndex");this.setCurrentPage(A)},onShow:function(){App.keyboardFocus="settings"},onClose:function(){App.keyboardFocus="module";for(var A=0,B;B=this.pages[A];A++){if(B.index==this.selectedIndex){B.manager.module.updateVibes();break}}}});Netvibes.Vibes.Engine=Class.create();Netvibes.Vibes.Engine.prototype={initialize:function(A,B){this.name=A;this.setFixModuleId(B)},setFixModuleId:function(C){for(var B=0,A;A=App.moduleList[B];B++){if(A.dataObj.tab==App.selectedTab&&A.widget&&A.widget.pub&&A.widget.pub.fixId==C){this.module=A.widget.pub}}},load:function(){this.contentNode=document.createElement("div");this.contentNode.innerHTML=_("Loading ...");var A=new Ajax.Request(NV_PATH+"get/paneVibes.php",{method:"post",postBody:"pane="+this.name,onSuccess:this.attachEvents.bind(this)});return this.contentNode},activate:function(){if(typeof this.contentNode.getElementsByTagName("li")[0]!="undefined"){var F=this.contentNode.getElementsByTagName("li");this.lastEngine="";for(var D=0;F[D];D++){var A=F[D].getElementsByTagName("a")[0];var B=F[D].getAttribute("vibesid");var G=F[D].getAttribute("vibesname");var C=F[D].getAttribute("vibeslocale");var E=F[D].getElementsByTagName("a")[0];Element.removeClassName(E,"selected");if(this.module.containVibes(B)){Element.addClassName(E,"selected");F[D].setAttribute("title",_("click to unselect"))}else{F[D].setAttribute("title",_("click to select"))}F[D].style.display="block"}}},attachEvents:function(B){this.contentNode.innerHTML=B.responseText;var D=this.contentNode.getElementsByTagName("ul")[0];var G=this.contentNode.getElementsByTagName("li");this.lastEngine="";for(var C=0;G[C];C++){if(User.locale=="cn"||App.locale=="cn"){var F=G[C].getAttribute("vibesname");if(typeof F!="undefined"&&/^(flickr|imtv|dailymotion|wikipedia|youtube)$/.test(F)){D.removeChild(G[C]);continue}}var A=G[C].getAttribute("vibesid");if(this.module.containVibes(A)){var E=G[C].getElementsByTagName("a")[0];Element.addClassName(E,"selected");G[C].setAttribute("title",_("click to unselect"))}else{G[C].setAttribute("title",_("click to select"))}G[C].onclick=this.toggleVibes.bindAsEventListener(this);G[C].style.display="block"}},toggleVibes:function(D){var B=Event.findElement(D,"LI");var A;if((A=this.module.toggleVibes(B.getAttribute("vibesid")))==true){var C=B.getElementsByTagName("a")[0];if(Element.hasClassName(C,"selected")){Element.removeClassName(C,"selected");B.setAttribute("title",_("click to select"))}else{Element.addClassName(C,"selected");B.setAttribute("title",_("click to unselect"))}}else{alert(A)}},displayLocalEngines:function(B){var C=B.getAttribute("vibesname");var A=B.getAttribute("vibeslocale");if((A==User.locale||A==App.locale||A=="")&&this.lastEngine!=C){B.style.display="block";this.lastEngine=C}else{B.style.display="none"}}};window._vibesPanel=null;var VibesPanel={};VibesPanel.open=function(B,A){if(App.inSubscribePreview==true){return alert(_("Not avaible in preview mode."))}if(window._vibesPanel==null){window._vibesPanel=new Netvibes.VibesPanel("nv-vibes",{overlayClassName:"overlay_settings",fixModuleId:B})}window._vibesPanel.options.fixModuleId=B;window._vibesPanel.show();if(typeof A=="undefined"){A=window._vibesPanel.selectedIndex||0}window._vibesPanel.setCurrentPage(A)};VibesPanel.close=function(){if(window._vibesPanel){window._vibesPanel.hide()}};VibesPanel.isOpen=function(){return(window._vibesPanel&&window._vibesPanel.isVisible())};;
App.UI.TopNotification=new Class({Implements:[Events,Options],options:{overlay:true,target:null,autoClose:5000,position:null,text:""},initialize:function(B){this.setOptions(B);if(this.options.overlay){this.overlay=new Element("div",{id:"notification-overlay"}).inject(document.body);this.overlay.addEvent("click",this.close.bind(this))}this.element=new Element("div",{id:"notification-box",html:'<div class="notification-top"></div><div class="notification-content">'+this.options.text+"</div>"});if(this.options.target){var A=this.options.target.getPosition();if(App.htmlDir!="rtl"){this.element.setStyles({top:A.y+15,left:A.x-20})}else{this.element.setStyles({top:A.y+15,right:A.x-20})}}if(this.options.position){if(App.htmlDir!="rtl"){this.element.setStyles({top:this.options.position.y,left:this.options.position.x})}else{this.element.setStyles({top:this.options.position.y,right:this.options.position.x})}}this.element.addEvent("click",this.onClick.bind(this)).inject(document.body);this.element.get("tween",{property:"opacity",duration:"long"}).set(0).start(0.7);if(this.options.autoClose){this.close.delay(this.options.autoClose,this)}},onClick:function(){this.close();this.fireEvent("click")},close:function(){if(this.overlay){this.overlay.dispose()}var A=this.element.get("tween");A.addEvent("complete",function(){this.element.dispose()}.bind(this));A.start(0);this.fireEvent("close")}});window.addEvent("domready",function(){if(App.discoverNewWidgets){new App.UI.TopNotification({overlay:false,autoClose:5000,position:{x:0,y:20},text:_("Discover new personalized recommendations!"),onClick:function(){App.Panel.toggle("AddContent");$("notif-discover-new-widgets").hide()}});$("notif-discover-new-widgets").show()}var D=$("join-now");var A=$("userProfile");var B=function(){App.pageCustom.enableFx==1?D.fade("out"):D.fade(0)};if(D){D.addEvent("click",B);A.addEvent("click",B)}var E=$("edit-universe");var C=function(){App.pageCustom.enableFx==1?E.fade("out"):E.fade(0)};if(E){E.addEvent("mouseover",function(F){F.stop()});E.addEvent("click",C)}});;
App.Share={idContainer:"shareDialog",shareMode:"",item:null,tabView:null,elements:{},preconfCache:{},_opened:false,socialNetworksList:new Hash({netvibes:new Hash({ico:NV_STATIC+"/img/favicon.png",title:"Netvibes"}),facebook:new Hash({ico:NV_STATIC+"/img/facebook.gif",title:"Facebook"}),twitter:new Hash({ico:NV_STATIC+"/img/twitter.png",title:"Twitter"})}),tabsConfig:{widget:{title:_("Share widget"),tabs:["SocialNetworks","ByEmail","InstallOutside","ToPage"]},article:{title:_("Share article"),tabs:["SocialNetworks","ByEmail","ReadLater"]},tab:{title:_("Share tab"),tabs:["SocialNetworks","ByEmail","ToPage"]}},panelObj:{},initialize:function(){this.currentTabs=App.pageCustom.shareCurrentTab;if($type(this.currentTabs)!="object"){App.pageCustom.shareCurrentTab={widget:"SocialNetworks",tab:"SocialNetworks",article:"SocialNetworks"};this.currentTabs=App.pageCustom.shareCurrentTab}this.container=$(this.idContainer);if(!this.container){this.container=new Element("div",{id:this.idContainer,styles:{display:"none"}}).inject(document.body)}var C=new Element("div",{"class":"header"}).inject(this.container);this.elements.pannelTitle=new Element("h2","title").inject(C);var B=new Element("div",{"class":"content"}).inject(this.container);this.elements.header=new Element("div",{"class":"shareHeader"});this.elements.headerPicture=new Element("img").inject(this.elements.header);this.elements.headerTitle=new Element("h2").inject(this.elements.header);this.elements.headerBaseLine=new Element("h3").inject(this.elements.header);this.elements.header.inject(B);this.elements.errors=new Element("div",{"class":"error"}).hide().inject(B);this.tabView=new Netvibes.UI.TabView({orientation:top,autohideDropdowns:true});this.tabView.addTab("SocialNetworks",{text:_("Social Networks")});this.tabView.addTab("ByEmail",{text:_("Send by e-mail")});this.tabView.addTab("InstallOutside",{text:_("Install outside Netvibes")});var A=(this.item.type=="widget")?_("Copy to your page"):_("Publish on your page");$(this.tabView.addTab("ToPage",{text:A}));$(this.tabView.addTab("ReadLater",{text:_("Read later")}));this.tabView.appendTo(B);this.tabView.observe("activeTabChange",this.onActiveTabChanged.bind(this));B.inject(this.container);this._initialized=true},disableAllTabs:function(){var B=this.tabView;var A=new Hash(B.dataItems);A.each(function(C,D){B.enableTab(D,false)})},setTitle:function(A){this.elements.pannelTitle.setHTML(A)},tabClickReport:function(A){switch(A){case"SocialNetworks":App.report("click.share.network");break;case"ByEmail":App.report("click.share.email");break;case"ReadLater":App.report("click.share.later");break;case"InstallOutside":App.report("click.share.others");break;case"ToPage":App.report("click.share.topage");break}},onActiveTabChanged:function(A){var B=this.currentTabs[this.item.type];this.currentTabs[this.item.type]=A;App.pageCustom.shareCurrentTab=this.currentTabs;if(B!=this.currentTabs[this.item.type]){this.buildTabContent();var C=this.panelObj[this.currentTabs[this.item.type]];C.fireEvent("onDisplay")}this.elements.errors.hide()},isExportable:function(){var B=(this.itemModuleObj.dataObj.moduleName=="RssReader"||this.itemModuleObj.dataObj.moduleName=="MultipleFeeds");var A=(typeof this.itemModuleObj.dataObj.feedUrl!="undefined"&&/https?:\/\/(.+)@([a-zA-Z\-0-9]{3,63}\.[a-zA-Z]{2,4})(.+)/.test(this.itemModuleObj.dataObj.feedUrl));return B&&!A},activateAuthorizedTabs:function(A){this.disableAllTabs();A.tabs.forEach(function(D){var B;var C=false;if(D=="InstallOutside"&&(this.itemInfos.widgetType=="JS"||!this.isExportable())){if(this.currentTabs[this.item.type]=="InstallOutside"){B="SocialNetworks"}C=true}else{if((D=="SocialNetworks"||D=="ToPage")&&!User.id){B="ByEmail";C=true}else{if((D=="ToPage")&&(!App.visit)&&((App.pageList&&App.pageList.length==1)&&!User.universe)){B="SocialNetworks";C=true}}}if(C){if(B){this.currentTabs[this.item.type]=B}return }this.tabView.enableTab(D,true)}.bind(this))},update:function(A){if(!A||A=="error"){this.displayErrorMsg()}else{var B=this.getPreconfKey();this.setPreconfCache(B,A)}if(this.item.type=="tab"){A=JSON.decode(A)[1]}this.preconfUrl=(A!="error")?A:"";this.itemInfos=this.getItemInfos();var C=this.tabsConfig[this.item.type]||null;if(C){var D=C.title;this.setTitle(D);if(!C.tabs.contains(this.currentTabs[this.item.type])){this.currentTabs[this.item.type]=this.tabsConfig[this.item.type].tabs[0]}this.activateAuthorizedTabs(C);this.tabView.show();this.elements.errors.hide();this.updateHeader();this.buildTabContent();this.display();this.container.className="";this.container.addClass("item-"+this.item.type)}},displayErrorMsg:function(B,A){if(!B){B=_("An error occured.")}if(A){this.tabView.hide()}this.elements.errors.set("html","<p>"+B+"</p>").show()},getItemInfos:function(){var B=$merge(this.item);switch(this.item.type){case"tab":B.preconfUrl=this.preconfUrl;break;case"widget":var A=this.itemModuleObj.dataObj.moduleName;B.preconfUrl=this.preconfUrl;if(A=="UWA"){B.widgetType="UWA"}else{B.widgetType=(App.Modules[A+"Infos"].uwaSrcPath)?"UWA":"JS"}break;case"article":B.baseLine=this.item.url;B.preconfUrl=this.preconfUrl;if(this.item.date){this.item.date=this.formatDate(this.item.date)}if(this.item.summary){this.item.summary=this.item.summary.truncate(150)}if(!this.item.widgetId){B.picture=(this.item.srcType=="uwa")?App.Modules.UWAInfos.richIcon:App.Modules.RssReaderInfos.richIcon}break}if(this.item.widgetId){this.getWidgetInfosFromEco(this.item.widgetId)}return B},formatDate:function(C){var B=new Date(C);var F=new Array(_("Sun"),_("Mon"),_("Tue"),_("Wed"),_("Thu"),_("Fri"),_("Sat"))[B.getUTCDay()];var D=new Array(_("January"),_("February"),_("March"),_("April"),_("May"),_("June"),_("July"),_("August"),_("September"),_("October"),_("November"),_("December"))[B.getUTCMonth()];var A=(B.getUTCHours()<10)?"0"+B.getUTCHours():B.getUTCHours();var E=(B.getUTCMinutes()<10)?"0"+B.getUTCMinutes():B.getUTCMinutes();return(F+" "+B.getUTCDate())+" "+D+" "+B.getUTCFullYear()+" "+A+":"+E},getWidgetInfosFromEco:function(A){new Request.JSON({onComplete:this.onInfosFromEcoLoaded.bind(this)}).get("/proxy/ajaxProxy.php",{url:"http://"+NV_ECO_API+"/item/"+A+"?format=json&thumbheight=48&thumbwidth=64"})},onInfosFromEcoLoaded:function(A){var B=this.currentTabs[this.item.type];this.item.picture=A.thumbnail;switch(this.item.type){case"widget":if(this.item.title==""){this.item.title=A.title}this.itemInfos.baseLine=A.description;break}this.itemInfos=$merge(this.itemInfos,this.item);this.updateHeader();this.panelObj[B].update(this.itemInfos)},updateHeader:function(){var B=this.itemInfos;var A=B.preconfUrl||B.url;this.elements.headerTitle.set("html",'<a href="'+A+'" target="_blank">'+B.title.truncate(145)+"</a>");if(B.baseLine){if(this.item.type=="article"){this.elements.headerBaseLine.set("html",'<a href="'+B.baseLine+'" target="_parent">'+B.baseLine.truncate(80))}else{this.elements.headerBaseLine.set("text",B.baseLine.truncate(165))}this.elements.headerBaseLine.show()}else{this.elements.headerBaseLine.hide()}if(B.picture){this.elements.headerPicture.set("src",B.picture);this.elements.headerPicture.show()}else{this.elements.headerPicture.hide()}},buildTabContent:function(){var B=this.currentTabs[this.item.type];if(App.Share[B]){if(!this.panelObj[B]){var A=this.tabView.getTabContent(B);$(A).empty();this.panelObj[B]=new App.Share[B]({preconfUrl:this.preconfUrl});this.panelObj[B].addEvent("onCancel",this.hide.bind(this));this.panelObj[B].addEvent("onSuccess",this.showConfirmDialog.bind(this));this.panelObj[B].addEvent("onFailure",this.onFailure.bind(this));this.panelObj[B].inject(A)}if(this.itemInfos){this.tabView.selectTab(this.currentTabs[this.item.type]);this.panelObj[B].update(this.itemInfos)}this.tabClickReport(B)}else{if(console&&console.debug){console.debug("-->"+this.currentTab)}}},showConfirmDialog:function(){SqueezeBox.close();switch(this.currentTabs[this.item.type]){case"ToPage":var C={widget:_("You successfully send this widget to your page"),tab:_("You successfully send this tab to your page"),article:_("You successfully send this article to your page")};break;case"ReadLater":var C={article:_("This article was saved to your private timeline")};break;default:var C={widget:_("You shared this widget successfully"),tab:_("You shared this tab successfully"),article:_("You shared this article successfully")};break}var A=C[this.item.type]||"";var B={titleText:this.tabsConfig[this.item.type].title,confirm:{text:_("Share"),successText:A},discard:{text:""},onOpen:function(){this.onDialogComplete()}};var D=new App.UI.ConfirmDialog(B).show()},hide:function(){SqueezeBox.close()},display:function(){var A=this.currentTabs[this.item.type];var B=this.panelObj[A];SqueezeBox.fromElement(this.container,{handler:"adopt",offsetTop:100,classWindow:"modalDialog",size:{x:700,y:null},onOpen:function(C){C.getElement("div").setStyle("display","block");B.fireEvent("onDisplay");this.reposition()},onClose:function(D){this._opened=false;if(this._startingTab!=App.pageCustom.shareCurrentTab[this.item.type]){App.savePageCustom()}$$("ul.autocompleter-choices").hide();var C=D.getElement("div");C.hide();C.inject(document.body)}.bind(this)})},_sanitizeItem:function(A){A.title=A.title.stripTags();if(A.srcTitle){A.srcTitle.stripTags()}return A},show:function(C){if(this._opened){return false}App.report("click.share");if(C.type&&C.type=="tab"){App.report("click.share.tab")}this.item=this._sanitizeItem(C);if(!this.item.type){this.item.type="article"}if(this.item.moduleId){this.item.id=this.item.moduleId}if(!this._initialized){initResult=this.initialize()}if(this.item.type=="article"||this.item.type=="widget"){this.itemModuleObj=App.Modules.getById(this.item.id)}else{if(this.item.type=="tab"){this.itemTabObj=App.Tabs.getById(this.item.id)}}this._opened=true;this._startingTab=this.currentTabs[this.item.type];if(this.item.id){var B=this.getPreconfKey();var D=this.getPreconfCache(B);if(D){this.update(D)}else{var A="preconfigure_"+((this.item.type!="tab")?"module":"tab")+"="+this.item.id;if(App.visit){A+="&visit="+App.visit.username}getPreconfUrl=new Request({url:"http://"+NV_HOST+"/ajax/sendModule/store.php",data:A,onComplete:this.update.bind(this)}).send()}}else{this.update()}},getPreconfKey:function(){return((this.item.type=="tab")?"tab":"module")+"_"+this.item.id},getPreconfControlHash:function(){var A="";switch(this.item.type){case"widget":case"article":A=JSON.encode(this.itemModuleObj.dataObj.data);break;case"tab":A=JSON.encode(this.itemTabObj.dataObj);break}return A},setPreconfCache:function(B,C){var A=this.getPreconfControlHash();if(!(this.preconfCache[B]&&this.preconfCache[B].control==A)){this.preconfCache[B]={control:A,value:C}}return this.preconfCache[B]},getPreconfCache:function(C){var B=false;if(this.preconfCache[C]){var A=this.getPreconfControlHash();if(this.preconfCache[C].control==A){B=this.preconfCache[C].value}}return B},onFailure:function(A){var B="";switch(A){case"no_valid_recipients":B=_("Invalid email(s).");break;case"too_many_preconfiguration":B=_("Sent mail per hour limit reached.");break;case"email_fields_empty":B=_("Please fill the fields.");break;default:B=_("Unknown error, please try later.");break}this.displayErrorMsg(B,false)}};App.Share.TabContent=new Class({Implements:[Events,Options],_sending:false,_name:null,_type:null,initialize:function(A){this.setOptions(A);this.build()},inject:function(A){A.adopt(this.container)},attachEvents:function(){var B=this.container.getElement("form");var A=this.container.getElement(".cancel");if(A){A.addEvent("click",function(){this.fireEvent("onCancel")}.bind(this))}if(B){B.addEvent("submit",this.onSubmit.bindWithEvent(this,B))}this.loadingButton=this.container.getElement("div.buttons input");if(this.loadingButton){this.addEvent("onRequest",this.onRequest.bind(this));this.addEvent("onSuccess",this.onSuccess.bind(this));this.addEvent("onFailure",this.onFailure.bind(this))}this.addEvent("onDisplay",this.onDisplay.bind(this))},onRequest:function(){this._sending=true;this.oldButtonLabel=this.loadingButton.get("value");this.loadingButton.set("value",_("Loading"))},update:function(A){this._type=A.type},onSuccess:function(A){this.loadingButton.set("value",this.oldButtonLabel);if(this._name=="SocialNetworks"){App.report("click.shared");if(A.twitter){App.report("click.shared.twitter")}}if(this._type){App.report("click.shared."+this._type)}this._sending=false},onFailure:function(){if(this.oldButtonLabel){this.loadingButton.set("value",this.oldButtonLabel)}this._sending=false},onDisplay:$empty,_addHiddenFieldsFromItem:function(B,A){B.each(function(E,C){if(C=="media"){if(E&&E.type.indexOf("image")>=0){E=E.url}else{return }}var D=new Element("input",{type:"hidden"}).set("value",E).set("name","item["+C+"]").inject(A)})},_updateMessage:function(D){var C=this.container.getElement("textarea");if(C){var B=C.get("itemType");if(C.get("value")==""||(B!=D)){var A="";switch(D){case"widget":A=_("Hi, check out this cool widget!");break;case"tab":A=_("Hi, check out this cool selection of widgets!");break;default:case"article":A=_("Hi, check out this cool article!");break}C.set("value",A)}C.set("itemType",D)}},_getItemSrcInstallUrl:function(A){return this.options.preconfUrl}});;
App.Share.SocialNetworks=new Class({Extends:App.Share.TabContent,_name:"SocialNetworks",buttons:{},enableNetworks:function(){var A=App.Share.socialNetworksList;var B=this.container.getElement("div.networks");A.each(function(G,E){if(App.visit&&E=="twitter"&&!App.visit.my){return }if(E=="facebook"&&!App.FacebookConnect.isEnabled()){return }var F=B.getElement("div."+E);var C=E.capitalize();if(App.Share.SocialNetworks.Button[C]&&!this.buttons[E]){var D=(E=="netvibes")?{alwaysChecked:true}:{};this.buttons[E]=new App.Share.SocialNetworks.Button[C](D);this.buttons[E].inject(B)}else{if(this.buttons[E]){this.buttons[E].update()}}}.bind(this))},build:function(){this.container=new Element("div",{"class":"SocialNetworks"});var A="";A+='<form name="sendToSocialNetwork" method="post" action="http://'+NV_HOST+'/ajax/share/sendToSocialNetwork.php">';A+='    <div class="networks">';A+="    </div>";A+='    <div class="comment">';A+="        <label>"+_("Comment: (optional)")+"</label>";A+='        <textarea col="70" rows="3" name="item[comment]"></textarea>';A+="    </div>";A+='    <div class="hiddenFields">';A+="    </div>";A+='    <div class="buttons">';A+='        <input type="submit" class="nv-button nv-primary-button share" value="'+_("Share")+'"/> ';A+="        "+_("or")+' <span class="cancel"><a href="javascript:;">'+_("Cancel")+"</a></span>";A+="    </div>";A+="</form>";this.container.setHTML(A);this.attachEvents()},update:function(A){this.parent(A);this.enableNetworks();this._item=new Hash(A);var B=this.container.getElement("div.hiddenFields").empty();this._addHiddenFieldsFromItem(this._item,B)},facebookSend:function(D){var E={};var C=App.FacebookConnect.getTemplates()[this._item.type];var A=this._item.subscribeUrl||this._getItemSrcInstallUrl(this._item);var B=this._item.picture;if(B&&B.charAt(0)=="/"){B="http://"+NV_HOST+B}switch(this._item.type){case"tab":B=this._item.picture;E=$merge(E,{nbWidgetsString:this._item.baseLine});case"widget":E=$merge(E,{itemLink:this._item.preconfUrl,itemName:this._item.title.htmlentities(),comments:D["item[comment]"].value.htmlentities()});break;case"article":E={itemLink:this._item.url,itemName:this._item.title.htmlentities(),srcLink:A,srcName:this._item.srcTitle.htmlentities(),comments:D["item[comment]"].value.htmlentities()};break}if(E.comments!=""){E.comments='"'+E.comments+'"<br/>'}if(B){E.images=[{src:B,href:"http://"+NV_HOST}]}App.FacebookConnect.showFeedDialog(C,E)},onSubmit:function(B,A){B.stop();if(!this._sending){this.fireEvent("onRequest");A.set("send",{onComplete:function(C){C=JSON.decode(C);this.fireEvent("onSuccess",C);if(this.buttons.facebook&&this.buttons.facebook.isSelected()){this.facebookSend(A)}}.bind(this)});A.send()}}});App.Share.SocialNetworks.Button=new Class({Implements:[Events,Options],_auth:null,_elements:{},_activated:false,_selected:false,_profile:null,_addInstallButton:$empty,_onReady:$empty,_updateProfile:$empty,_getAuth:$empty,options:{avatarSize:24},initialize:function(B,A){this._name=B;this.network=App.Share.socialNetworksList[B];this.setOptions(A);this.build();this._auth=this._getAuth();this.activate((this._auth)?true:false,this._auth)},inject:function(A){return A.adopt(this.container)},activate:function(B,A){this._activated=B;if(!this.options.hidden){this._elements.activated[B?"show":"hide"]();this._elements.desactivated[B?"hide":"show"]()}this._auth=A;if(this._auth){this._updateProfile()}},isActivated:function(){return this._activated},_onReady:function(A){this.activate(true,A);this.setSelected(true);this._toggleInstallForm(false)},_addInstallButton:function(){var A=new Element("span");var B=new Element("a",{href:"javascript:;",text:this._name.capitalize()}).inject(A);A.addEvent("click",this._toggleInstallForm.bind(this,[]));A.inject(this._elements.desactivated)},_toggleInstallForm:function(A){if(!this._elements.installForm){return false}if(typeof A=="undefined"){A=(this._elements.installForm.getStyle("display")=="none")?true:false}if(A){this._elements.installForm.show()}else{this._elements.installForm.hide()}},build:function(){if(!this.options.hidden){this.container=new Element("div",{"class":"item "+this._name});this._elements.activated=new Element("div",{"class":"activated"}).inject(this.container);this._elements.desactivated=new Element("div",{"class":"desactivated"}).inject(this.container);var A="";if(!this.options.alwaysChecked){A+='    <input type="checkbox" id="share_'+this._name+'" name="network['+this._name+'][selected]" value="true"/> '}else{A+='    <input type="hidden" id="share_'+this._name+'" name="network['+this._name+'][selected]" value="true"/><input type="checkbox" disabled="disabled" checked="checked"/> '}A+='    <img align="bottom" src="'+this.network.ico+'" /> '+this.network.title;A+='    <input class="auth" type="hidden" name="network['+this._name+'][auth]" value="" />';this._elements.activated.set("html",A);this.profile=new Element("div",{"class":"profile"}).inject(this._elements.activated);this._elements.picture=new Element("span",{"class":"picture",styles:{width:this.options.avatarSize+"px",height:this.options.avatarSize+"px"}}).inject(this.profile);this._elements.name=new Element("span",{"class":"name"}).inject(this.profile);var A="";A+='<span class="connect">'+_("Share with:")+"</span>";this._elements.desactivated.set("html",A);this._addInstallButton();if(!this.options.alwaysChecked){this._elements.checkbox=this.container.getElement(".activated input");this._elements.checkbox.addEvent("change",this._onChange.bind(this,this._elements.checkbox));if(this._elements.checkbox.get("checked")){this.setSelected(true)}}}else{this.container=new Element("span",{"class":this._name});this.container.set("html",'<input type="hidden" name="network['+this._name+'][selected]" value="true" /><input class="auth" type="hidden" name="network['+this._name+'][auth]" value="" />')}this._elements.auth=this.container.getElement("input.auth")},_onChange:function(B){var A=B.get("checked");this.setSelected(A)},setSelected:function(A){this._selected=A;if(this._selected){this.container.addClass("selected");if(this._elements.checkbox){this._elements.checkbox.set("checked","checked")}}else{this.container.removeClass("selected");if(this._elements.checkbox){this._elements.checkbox.set("checked","")}}},isSelected:function(){return this._selected},isActivated:function(){return this._activated},update:function(){this._auth=this._getAuth();if(this._auth){this.activate(true,this._auth)}else{this.activate(false,false)}},_updateProfile:function(){if(!this.options.hidden){this._elements.name.empty();this._elements.picture.empty()}}});App.Share.SocialNetworks.Button.Netvibes=new Class({Extends:App.Share.SocialNetworks.Button,initialize:function(A){this.parent("netvibes",A)},_getAuth:function(){var A={displayName:User.displayName,username:User.username,id:User.id};this._elements.auth.set("value",JSON.encode(A));return A},_updateProfile:function(){this._profile=User;this._elements.picture.set("html",'<img src="http://'+NV_AVATARS+"/"+this._profile.id+'/32" />');this._elements.name.set("text",this._profile.displayName)}});App.Share.SocialNetworks.Button.Facebook=new Class({Extends:App.Share.SocialNetworks.Button,initialize:function(A){this.parent("facebook",A)},_addInstallButton:function(){if(!App.FacebookConnect.isLoaded()){App.FacebookConnect.init({apiKey:App.apiKeys.facebook_connect.key,onLoaded:this._addInstallButton.bind(this)});new Element("span",{"class":"tmpButton"}).set("html",'<img src="'+NV_STATIC+'/img/connect_light_medium_short.png"/>').inject(this._elements.desactivated)}else{this._elements.desactivated.getElement(".tmpButton").remove();new App.FacebookConnect.Element("LoginButton",{size:"medium"}).inject(this._elements.desactivated);App.FacebookConnect.setOptions({onConnected:this._onReady.bind(this)})}},_getAuth:function(){return App.FacebookConnect.getUserInfos()},_updateProfile:function(){if(this._profile){return }this.parent();new App.FacebookConnect.Element("ProfilePic",{uid:this._auth.uid,linked:"false"}).inject(this._elements.picture);new App.FacebookConnect.Element("Name",{target:"_blank",uid:this._auth.uid,useyou:"false",linked:"false"}).inject(this._elements.name);new Element("a",{text:_("Logout"),href:"javascript:;","class":"logout",events:{click:this._facebookLogout.bind(this)}}).inject(this._elements.activated);this._profile=true},_facebookLogout:function(){App.FacebookConnect.logOut(this.activate.bind(this,false))}});App.Share.SocialNetworks.Button.Twitter=new Class({Extends:App.Share.SocialNetworks.Button,initialize:function(A){this.parent("twitter",A)},build:function(){this.parent();this._elements.installForm=new Element("div",{"class":"installForm"}).hide();var A="";A+='<span class="error"></span>';A+='<span class="explanation">'+_("Please enter your information to install Twitter Widget on your page:")+"</span>";A+='<span><label for="twitterUsername">'+_("Username")+'</label><input id="twitterUsername" type="text" name="username" /></span>';A+='<span><label for="twitterPass">'+_("Password")+'</label><input  id="twitterPass" type="password" name="pass" /></span>';this._elements.installForm.set("html",A).inject(this.container);this._elements.error=this._elements.installForm.getElement("span.error").hide();var B="";B+='<button class="nv-button">'+_("Install")+"</button>&nbsp;";B+=_("or")+'&nbsp;<a href="javascript:;">'+_("Cancel")+"</a>";var D=new Element("div",{"class":"bottom"}).set("html",B).inject(this._elements.installForm);var E=this._elements.installForm.getElement("button");E.addEvent("click",this._checkCredentials.bindWithEvent(this));var C=this._elements.installForm.getElement("div.bottom a");C.addEvent("click",function(){this._elements.installForm.hide()}.bind(this))},_showError:function(A){this._elements.error.set("text",A);this._elements.error.show()},_addInstallButton:function(){var A=new Element("span");var B=new Element("a",{href:"javascript:;",title:_("Activate Twitter")}).inject(A);var C=new Element("img",{src:"http://"+NV_HOST+NV_PATH+"img/sendModule/twitter-connect.png"}).inject(B);A.addEvent("click",this._toggleInstallForm.bind(this,[]));A.inject(this._elements.desactivated)},_checkCredentials:function(C){C.stop();var D=this._elements.installForm.getElement("input[name=username]").value;var B=this._elements.installForm.getElement("input[name=pass]").value;if(D.test("@")){this._showError(_("Please use your Twitter username, not your email"));return false}this._elements.error.hide();if(D&&B){var A=new Request.JSON({url:"http://"+NV_HOST+"/proxy/ajaxProxy.php",onComplete:function(E){if(!E.error){this._installWidget(D,B)}else{this._showError(_("Could not authenticate you."))}}.bind(this)}).get({auth:"http_basic",username:D,password:B,url:"http://twitter.com/account/verify_credentials.json"})}},_installWidget:function(C,B){if(C&&B){var A=new Module($extend($unlink(App.Modules.TwitterInfos.defaultObj),{data:{username:C,pass:B},container:1,admin:false,tab:App.selectedTab}),{nativise:true}).inject(App.ColManager.col1,"top").load();App.moduleList.push(A);App.Modules.store(A);this._perdiodial=this._waitForWidgetInstall.periodical(150,this,A)}},_waitForWidgetInstall:function(A){if(A.dataObj.id){$clear(this._perdiodial);var B={moduleId:A.dataObj.id,username:A.dataObj.data.username};this._elements.auth.set("value",JSON.encode(B));this._onReady(B)}},_getAuth:function(){var B=App.Modules.getByNames("Twitter");var A=null;if(B.Twitter){B.Twitter.each(function(D){if(A){return }if(D.data.username&&D.id&&(!D.data._type||D.data._type!="user")){A=D}});if(A){var C={moduleId:A.id,username:A.data.username};this._elements.auth.set("value",JSON.encode(C));return C}}this._elements.auth.set("value","");return false},_updateProfile:function(){if(this._profile){return }this.parent();var A=new Request.JSON({url:"http://"+NV_HOST+"/proxy/ajaxProxy.php",onComplete:function(B){this._profile=B;this._elements.picture.set("html",'<img src="'+B.profile_image_url+'" />');this._elements.name.set("text",B.screen_name)}.bind(this)}).get({auth:"http_basic",moduleId:this._auth.id,type:"text",url:"http://twitter.com/users/show/"+this._auth.username+".json"})}});;
App.Share.ToPage=new Class({Extends:App.Share.TabContent,_name:"ToPage",build:function(){this.container=new Element("div",{"class":"toPage"});var A="";A+='<form name="toPage" method="post" action="http://'+NV_HOST+'/ajax/addToMyPage/add.php">';A+='<span class="itemCopyText"></span>&nbsp;&nbsp;';A+=this._getPageSelector();if(App.visit){A+='<input type="hidden" name="visit" value="'+App.visit.username+'" />'}A+='    <div class="hiddenFields">';A+="    </div>";A+='    <div class="buttons">';A+='        <input type="submit" class="nv-button nv-primary-button share" value="'+_("Copy")+'"/> ';A+="        "+_("or")+' <span class="cancel"><a href="javascript:;">'+_("Cancel")+"</a></span>";A+="    </div>";A+="</form>";this.container.setHTML(A);this.itemCopyText=this.container.getElement(".itemCopyText");this.attachEvents()},_getPageSelector:function(){var C=[];var B="";if((((typeof App.visit!="undefined")&&(!App.visit.my))||((typeof App.visit=="undefined")))&&User.universe){C.push({pid:"public",value:("http://"+NV_HOST+"/"+User.username)+" ("+_("public")+")"})}App.pageList.each(function(D){if(D.pid!=App.currentPage){C.push({pid:D.pid,value:D.title+" ("+_("private")+")"})}});if(C.length>1){var A=((typeof App.visit!="undefined")&&(App.visit.my))?"hidden":"top";B+=App.UI.getPagesDropDownList(A)}else{B+="<strong>"+C[0].value+'</strong><input type="hidden" name="pid" value="'+C[0].pid+'" />'}return B},_getCopyText:function(B){var A="";switch(B){case"widget":A=_("Copy the widget to this page:");break;case"tab":A=_("Copy the tab to this page:");break}return A},update:function(A){this.parent(A);var C=this.container.getElement("div.hiddenFields");if(C){C.empty();var A=new Hash(A);var B="";if(A.type=="tab"){B+='<input type="hidden" name="tab" value="'+A.id+'" />';B+='<input type="hidden" name="mode" value="tab" />'}else{B+='<input type="hidden" name="id" value="'+A.id+'" />';B+='<input type="hidden" name="mode" value="module.add2page" />'}C.set("html",B)}this.itemCopyText.set("text",this._getCopyText(A.type))},onSubmit:function(B,A){B.stop();if(!this._sending){this.fireEvent("onRequest");A.set("send",{onComplete:function(C){this.fireEvent("onSuccess")}.bind(this)});A.send()}}});;
App.Share.InstallOutside=new Class({Extends:App.Share.TabContent,_name:"InstallOutside",build:function(){this.container=new Element("div",{"class":"installOutside"});var A="";A+='<div class="desktop">';A+="    <h4>"+_("Download for your desktop")+"</h4>";A+='    <div class="inside"> ';A+='        <span><a target="_blank" href="javascript:;" rel="vista" class="nv-button bt-vista"><img src="'+NV_STATIC+NV_PATH+'img/sendModule/vista.png" alt="Windows Vista" width="50" height="50" /></a><label>Windows Vista</label></span>';A+='        <span><a target="_blank" href="javascript:;" rel="dashboard" class="nv-button bt-mac"><img src="'+NV_STATIC+NV_PATH+'img/sendModule/mac.png" alt="Apple Mac" width="50" height="50" /></a><label>Apple Mac</label></span>';A+='        <span><a target="_blank" href="javascript:;" rel="opera" class="nv-button bt-opera"><img src="'+NV_STATIC+NV_PATH+'img/sendModule/opera.png" alt="Opera" width="50" height="50" /></a><label>Opera</label></span>';A+="    </div>";A+="</div>";A+='<div class="web">';A+="    <h4>"+_("Install on other pages")+"</h4>";A+='    <div class="inside"> ';A+='        <span><a target="_blank" href="javascript:;" rel="igoogle" class="nv-button bt-igoogle"><img src="'+NV_STATIC+NV_PATH+'img/sendModule/google.png" alt="iGoogle" width="50" height="50" /></a><label>iGoogle</label></span>';A+='        <span><a target="_blank" href="javascript:;" rel="blog" class="nv-button bt-blog"><img src="'+NV_STATIC+NV_PATH+'img/sendModule/blog.png" alt="Blog" width="50" height="50" /></a><label>Blog</label></span>';A+="    </div>";A+="</div>";A+='    <div class="buttons">';A+='        <input type="button" class="nv-button cancel" value="'+_("Done")+'"/> ';A+="    </div>";this.container.setHTML(A);this.attachEvents()},isWidgetInEco:function(B){var A=B.dataObj.moduleName;if(B.dataObj.widgetId&&["RssReader","MultipleFeeds","Flash","UWA"].contains(A)){return true}return false},getWidgetUrl:function(D,G){var C=D.dataObj.moduleName;var A=App.Modules[C+"Infos"];var E=(A)?A.uwaSrcPath:"";var B="";var F=E.replace(/\.html?(\?v=n[0-9]+)?/,".php");switch(C){case"UWA":B=D.dataObj.data.moduleUrl;break;case"MultipleFeeds":B=F+"?provider="+encodeURIComponent(D.dataObj.data.provider);if(D.dataObj.data.provider=="custom"&&D.dataObj.data.url){B+="&url="+encodeURIComponent(D.dataObj.data.url)}break;case"RssReader":B=F+"?feedUrl="+encodeURIComponent(D.dataObj.feedUrl)+"&feedTitle="+encodeURIComponent(D.dataObj.title).replace(/'/g,"%27");break;case"Flash":B=F+"?"+$H(D.dataObj.data).toQueryString();break;default:if(E){B=E}break}return B},updateButtonLinks:function(A){var B=this.container.getElements("a.nv-button");B.forEach(function(D){var C=D.get("rel");if(A[C]){D.set("href",A[C])}})},update:function(A){this.parent(A);var D={};var C=App.Modules.getById(A.id);var B=this.getWidgetUrl(C,A);if(B!=""){D.vista="http://"+NV_HOST+"/api/uwa/compile/system.php?moduleUrl="+encodeURIComponent(B)+"&system=vista";D.igoogle="http://www.google.com/ig/add?moduleurl="+encodeURIComponent("http://nvmodules.netvibes.com/widget/gspec?uwaUrl="+encodeURIComponent(B));D.dashboard="http://"+NV_MODULES+"/widget/dashboard?uwaUrl="+encodeURIComponent(B);D.opera="http://"+NV_MODULES+"/widget/opera?uwaUrl="+encodeURIComponent(B);D.live="http://www.live.com/?add="+encodeURIComponent("http://nvmodules.netvibes.com/widget/live?"+encodeURIComponent(B));if(C.dataObj.widgetId!=null){D.blog="http://"+NV_ECO+"/export/blog/"+C.dataObj.widgetId+"/"}else{if(C.dataObj.moduleName=="RssReader"){D.blog="http://"+NV_ECO+"/share/?url="+encodeURIComponent(encodeURIComponent(B)).replace(new RegExp(/\./g),"%2e")}else{D.blog="http://"+NV_ECO+"/share/?url="+encodeURIComponent(B).replace(new RegExp(/\./g),"%2e")}}}else{if(typeof console!="undefined"&&console.log){console.log("undefined url",A)}}this.updateButtonLinks(D)}});;
App.Share.ByEmail=new Class({Extends:App.Share.TabContent,_name:"ByEmail",build:function(){this._modeSimple=!((User.username||User.universe));this.container=new Element("div",{"class":"ByEmail",styles:{position:"relative"}});var A="";A+='<form name="sendToSocialNetwork" method="post" action="http://'+NV_HOST+'/ajax/share/sendMail.php">';A+='    <div class="comment '+((this._modeSimple)?"simpleMode":"")+'">';if(this._modeSimple){A+='<input type="hidden" value="true" name="modeSimple" />';A+='        <div class="from">';A+="            <label>"+_("Your name:")+"</label>";A+='            <input name="myName" class="emails text" title="'+_("Enter your name")+'" />';A+="        </div>"}A+='        <div class="to">';A+="            <label>"+_("To:")+"</label>";A+='            <input name="friendEmail" class="emails text" title="'+_("Separate multiple e-mail addresses with comas")+'" />';A+='            <span class="friendLoader" style="display:none">'+_("Loading...")+"</span>";A+="        </div>";A+='        <label class="message">'+_("Message:")+"</label>";A+='        <textarea col="70" rows="3" name="mailText"></textarea>';A+="    </div>";A+='    <div class="hiddenFields">';A+="    </div>";A+='    <div class="buttons">';A+='        <input type="submit" class="nv-button nv-primary-button share" value="'+_("Share")+'"/> ';A+="        "+_("or")+' <span class="cancel"><a href="javascript:;">'+_("Cancel")+"</a></span>";A+="    </div>";A+="</form>";this.container.setHTML(A);this.attachEvents()},_injectChoice:function(C){var B=C.displayName+" ("+C.username+")";var A=new Element("li",{html:'<img align="absmiddle" src="http://'+NV_AVATARS+"/"+C.id+'/16"/>&nbsp;'+this.markQueryValue(B)});A.inputValue=B;this.addChoiceEvents(A).inject(this.choices)},_initAutocompleter:function(){var A=this.container.getElement("input.emails");var B={indicator:this.container.getElement(".friendLoader"),multiple:true,zIndex:70000,selectFirst:true,minLength:3,relative:true,injectChoice:this._injectChoice};if(Browser.isIE){B.onShow=function(C,D){D.setStyle("left",0)}}new Autocompleter.Request.JSON(A,"http://"+NV_HOST+"/ajax/share/getFriends.php",B)},update:function(A){this.parent(A);var B=this.container.getElement("div.hiddenFields").empty();var A=new Hash(A);this._addHiddenFieldsFromItem(A,B);this._updateMessage(A.type)},validate:function(B){var A=true;if(B.friendEmail.value==""){A=false}if(B.myName&&B.myName.value==""){A=false}return A},onDisplay:function(){if(!this._modeSimple&&!this._autocompleterInited){this._initAutocompleter();this._autocompleterInited=true}},onSubmit:function(B,A){B.stop();var C=this.validate(A);if(C&&!this._sending){this.fireEvent("onRequest");A.set("send",{onComplete:function(E){var F=JSON.decode(E);if(F.error){this.fireEvent("onFailure",F.error)}else{if(F&&F.textTemplate){var D="mailto:";D+=A.friendEmail.value;D+="?subject="+F.subject;D+="&body="+F.textTemplate;window.location.replace(D)}this.fireEvent("onSuccess",E)}}.bind(this)});A.send()}else{if(!C){this.fireEvent("onFailure","email_fields_empty")}}}});;
App.Share.ReadLater=new Class({Extends:App.Share.TabContent,_name:"ReadLater",build:function(){this.container=new Element("div",{"class":"ReadLater"});var A="";A+='<form name="readLater" method="post" action="'+NV_API_PATH+'/timeline/create?format=json">';A+='    <div class="comment">';A+="        <label>"+_("Note: (optional)")+"</label>";A+='        <textarea col="70" rows="3" name="comment"></textarea>';A+="    </div>";A+='    <div class="hiddenFields">';A+="    </div>";A+='    <div class="buttons">';A+='        <input type="submit" class="nv-button nv-primary-button share" value="'+_("Share")+'"/> ';A+="        "+_("or")+' <span class="cancel"><a href="javascript:;">'+_("Cancel")+"</a></span>";A+="    </div>";A+="</form>";this.container.setHTML(A);this.attachEvents()},update:function(A){var B=this.container.getElement("div.hiddenFields").empty();html="";html+='<input type="hidden" name="data[srcTitle]" value="'+A.srcTitle.stripTags()+'" />';html+='<input type="hidden" name="data[srcUrl]" value="'+A.srcUrl+'" />';html+='<input type="hidden" name="data[title]" value="'+A.title.stripTags()+'" />';html+='<input type="hidden" name="data[url]" value="'+A.url+'" />';html+='<input type="hidden" name="data[srcType]" value="'+A.srcType+'" />';html+='<input type="hidden" name="type" value="6" />';B.set("html",html)},onSubmit:function(B,A){B.stop();if(!this._sending){this.fireEvent("onRequest");A.set("send",{onComplete:function(C){this.fireEvent("onSuccess")}.bind(this)});A.send()}}});;
App.FacebookConnect={_templates:App.facebookTemplates,_xd_receiver:"/external/facebookConnect/xd_receiver.htm",_isLoaded:false,_isConnected:false,_userSession:null,_customCallBack:null,_timerIsReady:null,_timerTimeout:null,_timeoutCounter:0,_options:{onConnected:$empty,onLoaded:$empty,onTimeout:$empty,apiKey:null,debug:false,loadTimeout:{checkInterval:500,duration:6000}},init:function(A){this.setOptions(A);if(typeof FB=="undefined"){if(!$("FB_HiddenContainer")){new Element("div",{id:"FB_HiddenContainer"}).setStyles({position:"absolute",top:"-10000px",left:"-10000px",width:"0",height:"0"}).inject(document.body)}this.log("injecting script");new Element("script",{src:"http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php",type:"text/javascript"}).inject(document.body,"top");this._timerTimeout=this._checkTimeOut.periodical(this._options.loadTimeout.checkInterval,this)}this._timerIsReady=this._checkIfLoaded.periodical(150,this)},log:function(A){if(this._options.debug&&typeof console!="undefined"&&console.log){console.log(A)}},setOptions:function(A){this._options=$merge(this._options,A)},isEnabled:function(){return(typeof this.getTemplates()!="undefined")},_checkTimeOut:function(){this._timeoutCounter+=this._options.loadTimeout.checkInterval;if(this._timeoutCounter>this._options.loadTimeout.duration){this._onTimeout()}},_checkIfLoaded:function(){if(typeof FB_RequireFeatures!="undefined"){$clear(this._timerIsReady);$clear(this._timerTimeout);this.log("script injected");FB_RequireFeatures(["XFBML"],function(){FB.Facebook.init(this._options.apiKey,this._xd_receiver);this._isLoaded=true;this._options.onLoaded();FB.XFBML.Host.autoParseDomTree=false;this.log("waiting connexion to facebook...");FB.Facebook.get_sessionState().waitUntilReady(this._onConnected.bind(this))}.bind(this))}},_onTimeout:function(){$clear(this._timerTimeout);this._options.onTimeout()},_onConnected:function(A){if(this.isConnected()){return false}this.log("connected to facebook "+A.uid);this._userSession=A;this._isConnected=true;this._options.onConnected(A)},isConnected:function(){return this._isConnected},isLoaded:function(){return this._isLoaded},getUserInfos:function(){return this._userSession},getTemplates:function(){return this._templates},logOut:function(A){if(typeof A!="function"){A=$empty}FB.Connect.logout(function(){FB.Facebook.get_sessionState().waitUntilReady(this._onConnected.bind(this));this._userSession=null;this._isConnected=false;A()}.bind(this))},showFeedDialog:function(A,B){FB.Connect.showFeedDialog(A,B)}};App.FacebookConnect.Element=new Class({_XFBMLelement:null,_elementContainer:null,initialize:function(A,B){this._elementContainer=new Element("span");if(typeof B=="object"){this._elementContainer.setProperties(B)}this._XFBMLelement=new FB.XFBML[A](this._elementContainer)},remove:function(){this._elementContainer.dispose()},inject:function(A){FB.XFBML.Host.addElement(this._XFBMLelement);return A.adopt(this._elementContainer)}});;
App.Keyboard={};App.moduleFocus=null;App.keyboardFocus=null;App.addKeyboardFocus=function(A,B){if(typeof B=="undefined"){B="#aaa"}if(typeof A=="number"){A=App.moduleList[A].elm_module}if(!A){return false}Element.addClassName(A,"kbdFocus");App.appScroll(A)};App.removeKeyboardFocus=function(A){if(typeof A=="number"){if(!App.moduleList[A]){return false}A=App.moduleList[A].elm_module}if(!A){return false}Element.removeClassName(A,"kbdFocus")};var helpDiv=null;var oldHelpMsg="";App.keyboardBuffer="";App.keyboardHandler=function(S){S=new Event(S);if(S.control){return true}if(S.meta){return true}if(S.key=="f5"){return true}var H=(S.target&&S.target.tagName)?S.target.tagName.toLowerCase():"";if(H=="input"||H=="textarea"){if(S.key!="esc"){return true}if(App.isOnSearch){App.searchInNetvibes("")}S.target.blur();return Q(S)}if(S.key>="a"&&S.key<="z"){App.keyboardBuffer+=S.key}if(App.keyboardBuffer.substr(App.keyboardBuffer.length-2)=="kb"){if(typeof App.pageCustom.keyboardNav=="undefined"||App.pageCustom.keyboardNav=="0"){App.pageCustom.keyboardNav="1";window.status="Keyboard navigation turned on."}else{App.pageCustom.keyboardNav="0";window.status="Keyboard navigation turned off.";var I=O();if(I){I.switchTo()}}if($("optionEnableShortcuts")){$("optionEnableShortcuts").checked=(App.pageCustom.keyboardNav==1)}App.keyboardBuffer="";App.savePageCustom();return false}if(typeof App.pageCustom.keyboardNav=="undefined"||App.pageCustom.keyboardNav=="0"||App.staticUniverse){if(S.key!="esc"){return true}}function F(){if(helpDiv){helpDiv.style.display="none"}}App.shortcutsHelp=function(U,V){N(U,V)};function N(U,W){if(!helpDiv){helpDiv=document.createElement("div");helpDiv.id="help";helpDiv.close=function(){helpDiv.style.display="none"};helpDiv.onclick=function(){helpDiv.close()};var X=document.createElement("div");X.className="innerHelp";helpDiv.appendChild(X);document.body.appendChild(helpDiv)}W="\n"+W;W=W.replace(/\n/g,"<br />\n");W=W.replace(/\n(.+)\t+/g,"\n<b>$1</b> - ");W="<p class='inputPageTitle'>"+_("Netvibes keyboard shortcuts")+"</p><p style='margin:10px 0 0 0'>"+_("Keyboard shortcut in this context")+" ("+U+"):</p><div>"+W+"</div>";if(oldHelpMsg==W){helpDiv.style.display=(helpDiv.style.display=="none")?"block":"none";return false}oldHelpMsg=W;helpDiv.firstChild.innerHTML=W;helpDiv.style.display="block";var V=Netvibes.UI.createIcon("actions-window-close",_("Close"),13,15);Element.addClassName(V,"close");V.onclick=function(){helpDiv.close()};helpDiv.appendChild(V)}function M(U){App.addKeyboardFocus(U)}function K(U){App.removeKeyboardFocus(U)}function Q(U){if(U.preventDefault&&typeof U.preventDefault=="function"){U.preventDefault()}if(U.returnValue){U.returnValue=false}window.status="Keyboard focus is on: "+App.keyboardFocus;Event.stop(U);return false}function E(U){var V=App.tabList.length;if(U>=V){return }I=App.tabList[U];if(App.moduleFocus){K(App.moduleFocus)}App.moduleFocus=null;I.switchTo()}function R(Y){var X=App.tabList.length;var V=null,U=App.tabList[0],W=App.tabList[X-1];for(var Z=0;Z<X;Z++){if(App.tabList[Z].dataObj.id==App.selectedTab){V=App.tabList[Z];continue}if(V==null){W=App.tabList[Z]}if(V!=null){U=App.tabList[Z];break}}if(App.moduleFocus){K(App.moduleFocus)}App.moduleFocus=null;switch(Y){case -1:W.switchTo();break;case 1:U.switchTo();break}}function C(){return R(1)}function O(){return R(-1)}function T(p){var a=[];var Z={};var b={};for(var X=0;X<App.moduleList.length;X++){Z[App.moduleList[X].dataObj.id]=X}var q=false;for(var X=1;X<=4;X++){var W=App.ColManager["col"+X];var Y=W.childNodes.length;var r=[];for(var l=0;l<Y;l++){var d=W.childNodes[l].dataObj;if(!d||!d.id){continue}var n=Z[d.id];var k=App.moduleList[n];if(k.dataObj.tab!=App.selectedTab){continue}b[n]={col:a.length,mod:r.length};if(App.moduleFocus!=null&&App.moduleFocus==n){q=true}if(k.dataObj.moduleName=="WebSearch"){if(k.content&&typeof k.content.removeFocus=="function"){k.content.removeFocus()}}r.push(n)}if(r.length==0){continue}a.push(r)}if(p.alt||p.meta){return false}if(!p.shift){var g;switch(p.key){case"f":App.keyboardFocus="searchInNetvibes";App.searchBoxInput.focus();return Q(p);case"a":App.keyboardFocus="addcontent";App.Sidebar.openCloseSelection();return Q(p);case"s":App.keyboardFocus="settings";SettingsPanel.open();return Q(p);case"j":g=O();return Q(p);case"k":g=C();return Q(p);case"t":App.keyboardFocus="tab";return Q(p);case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":E(Number(p.key)-1);return Q(p);case"h":case"f1":N(_("Module"),'<table><tr><td><img src="'+NV_PATH+'img/keys/left.png" alt="'+_("Left")+'" title="'+_("Left")+'"/>, <img src="'+NV_PATH+'img/keys/right.png" alt="'+_("Right")+'" title="'+_("Right")+'"/>, <img src="'+NV_PATH+'img/keys/up.png" alt="'+_("Up")+'" title="'+_("Up")+'"/>, <img src="'+NV_PATH+'img/keys/down.png" alt="'+_("Down")+'" title="'+_("Down")+'"/></td><td>'+_("Navigate through modules")+'</td></tr><tr><td><img src="'+NV_PATH+'img/keys/enter.png" alt="Enter" title="Enter"/></td><td>'+_("Do action on module (feed and webnote)")+'</td></tr><tr><td><img src="'+NV_PATH+'img/keys/e.png" alt="E" title="E"/></td><td>'+_("Edit module")+'</td></tr><tr><td><img src="'+NV_PATH+'img/keys/r.png" alt="R" title="R"/></td><td>'+_("Refresh module")+'</td></tr><tr><td><img src="'+NV_PATH+'img/keys/d.png" alt="D" title="D"/></td><td>'+_("Delete module")+'</td></tr><tr><td><img src="'+NV_PATH+'img/keys/1.png" alt="1" title="1"/>,<img src="'+NV_PATH+'img/keys/2.png" alt="2" title="2"/>,...,<img src="'+NV_PATH+'img/keys/0.png" alt="0" title="0"/></td><td>'+_("Switch to tab 1 to 10")+'</td></tr><tr><td><img src="'+NV_PATH+'img/keys/j.png" alt="J" title="J"/>, <img src="'+NV_PATH+'img/keys/k.png" alt="K" title="K"/></td><td>'+_("Navigate through tabs")+'</td></tr><tr><td><img src="'+NV_PATH+'img/keys/f.png" alt="F" title="F"/></td><td>'+_("Search in my page")+'</td></tr><tr><td><img src="'+NV_PATH+'img/keys/s.png" alt="S" title="S"/></td><td>'+_("Settings")+'</td></tr><tr><td><img src="'+NV_PATH+'img/keys/t.png" alt="T" title="T"/> '+_("then")+' <img src="'+NV_PATH+'img/keys/h.png" alt="H" title="H"/></td><td>'+_("Tab help")+'</td></tr><tr><td><img src="'+NV_PATH+'img/keys/a.png" alt="A" title="A"/></td><td>'+_("Add content")+"</td></tr></table>");return Q(p);case"left":case"right":case"up":case"down":case"enter":case"p":case"r":case"n":case"u":case"e":case"d":case"m":break;case"esc":F();if($("shareModuleBalloon")){Element.remove($("shareModuleBalloon"))}if(App.isOnSearch){try{App.searchInNetvibes("")}catch(p){}}if(App.moduleFocus){K(App.moduleFocus)}return Q(p);default:return true;return Q(p)}if(App.moduleFocus==null||!q){if(App.moduleFocus){K(App.moduleFocus)}if(typeof a!="undefined"&&typeof a[0]!="undefined"&&typeof a[0][0]!="undefined"){App.moduleFocus=a[0][0];M(App.moduleFocus)}return Q(p)}function V(e){if(oldFocus==e){return true}if(!App.moduleList[e]){return false}App.moduleFocus=e;K(oldFocus);M(e)}function j(){window.scrollTo(0,0)}function o(e){return(e<=0)?e=a.length-1:e-1}function U(e){return(e+1>=a.length)?0:e+1}oldFocus=App.moduleFocus;c=b[oldFocus];switch(p.key){case"left":case"right":var f=findPosY(App.moduleList[oldFocus].elm_module);if(p.key=="right"){c.col=U(c.col)}else{c.col=o(c.col)}var h=0;for(var X=0;X<a[c.col].length;X++){k=App.moduleList[a[c.col][X]].elm_module;y=findPosY(k);if(h<=f&&f<=y+k.offsetHeight){c.mod=X;break}h=y}if(c.mod>=a[c.col].length){c.mod=a[c.col].length-1}V(a[c.col][c.mod]);return Q(p);case"up":if(c.mod-1<0){c.col=o(c.col);c.mod=a[c.col].length-1}else{c.mod-=1}V(a[c.col][c.mod]);return Q(p);case"n":case"down":if(c.mod+1>=a[c.col].length){c.col=U(c.col);c.mod=0}else{c.mod+=1}V(a[c.col][c.mod]);return Q(p);case"enter":k=App.moduleList[App.moduleFocus];if(k.content.onKeyboardEnter){App.keyboardFocus="module.action";k.content.onKeyboardEnter();F()}return Q(p);case"p":k=App.moduleList[App.moduleFocus];k.share();return Q(p);case"r":k=App.moduleList[App.moduleFocus];if(k.refreshMode){k.refresh(p)}return Q(p);case"u":k=App.moduleList[App.moduleFocus];if(typeof k.content.setAllAsReadOnMouseDown=="function"){k.content.setAllAsReadOnMouseDown()}return Q(p);case"e":App.keyboardFocus="module.edit";k=App.moduleList[App.moduleFocus];k.showEdit();k.elm_editContent.getElementsByTagName("input")[0].focus();App.keyboardFocus="module.edit";return Q(p);case"d":k=App.moduleList[App.moduleFocus];if(k.onClosing()){App.moduleFocus=null}return Q(p);case"s":k=App.moduleList[App.moduleFocus];var Y=App.tabList.length;var g=App.selectedTabObj;if(g.dataObj.access!="shared"&&g.dataObj.access!="public"){return Q(p)}return Q(p);default:}return true}else{if(App.moduleFocus==null){return false}k=App.moduleList[App.moduleFocus];switch(p.key){case"a":if(k.dataObj.moduleName=="RssReader"){k.content.setAllAsReadOnMouseDown()}return Q(p);case"u":if(k.dataObj.moduleName=="RssReader"){k.content.setAllAsUnRead()}return Q(p);case"left":App.LayoutManager.movePositionLeft(k);App.appScroll(k.elm_module);return Q(p);case"right":App.LayoutManager.movePositionRight(k);App.appScroll(k.elm_module);return Q(p);case"up":App.LayoutManager.movePositionUp(k);App.appScroll(k.elm_module);return Q(p);case"down":App.LayoutManager.movePositionDown(k);App.appScroll(k.elm_module);return Q(p);case"b":App.LayoutManager.movePositionBottom(k);App.appScroll(k.elm_module);return Q(p);case"c":k.collpaseExpand();return Q(p);case"d":App.Modules.cloneModule(k);return Q(p);case"t":App.LayoutManager.movePositionTop(k);App.appScroll(k.elm_module);return Q(p);case"m":case"esc":F();App.keyboardFocus="module";App.retainKeyboardFocus();return Q(p)}return true}}function A(U){switch(U.key){case"h":case"f1":N(_("Add content"),'<table><tr><td><img src="'+NV_PATH+'img/keys/esc.png" alt="Escape" title="Escape"/></td><td>'+_("Close window")+'</td></tr><tr><td><img src="'+NV_PATH+'img/keys/e.png" alt="E" title="E"/></td><td>'+_("Go to the netvibes ecosystem")+'</td></tr><tr><td><img src="'+NV_PATH+'img/keys/a.png" alt="A" title="A"/></td><td>'+_("Add a feed")+"</td></tr></table>");return Q(U);case"a":App.Sidebar.openAddNewFeed();return Q(U);case"esc":F();App.keyboardFocus="module";App.Sidebar.close();App.retainKeyboardFocus();return Q(U)}return true}function J(Y){var X=App.tabList.length;var W=App.selectedTabObj;var V=0;switch(Y.key){case"h":case"f1":if(App.keyboardFocus=="tab.edit"){return Q(Y)}N(_("Tab"),'<table><tr><td><img src="'+NV_PATH+'img/keys/t.png" alt="T" title="T"/> '+_("then")+' <img src="'+NV_PATH+'img/keys/n.png" alt="N" title="N"/></td><td>'+_("New tab")+'</td></tr><tr><td><img src="'+NV_PATH+'img/keys/t.png" alt="T" title="T"/> '+_("then")+' <img src="'+NV_PATH+'img/keys/d.png" alt="D" title="D"/></td><td>'+_("Delete tab")+'</td></tr><tr><td><img src="'+NV_PATH+'img/keys/t.png" alt="T" title="T"/> '+_("then")+' <img src="'+NV_PATH+'img/keys/r.png" alt="R" title="R"/></td><td>'+_("Rename tab")+'</td></tr><tr><td><img src="'+NV_PATH+'img/keys/t.png" alt="T" title="T"/> '+_("then")+' <img src="'+NV_PATH+'img/keys/o.png" alt="O" title="O"/></td><td>'+_("Tab options")+"</td></tr></table>");return Q(Y);case"n":if(Y.alt||Y.control||Y.meta){break}if(App.keyboardFocus=="tab"){NewPageTab()}return Q(Y);case"r":if(Y.alt||Y.control||Y.meta){break}if(App.keyboardFocus=="tab"){W.rename()}return Q(Y);case"o":if(App.keyboardFocus=="tab"){W.showTabOptions()}return Q(Y);case"d":if(App.keyboardFocus=="tab.edit"){break}W.remove(Y);App.keyboardFocus="module";return Q(Y);case"t":if(Y.alt||Y.control||Y.meta){break}return Q(Y);case"left":case"right":default:if(App.keyboardFocus=="tab.edit"){return Q(Y)}case"esc":if(App.keyboardFocus=="tab.edit"){if(App.tabEditing!=-1){var U=$(App.tabEditing);if(U&&U.firstChild&&U.firstChild.onblur){U.firstChild.onblur(U.firstChild)}}}case"enter":if(tabOptions&&tabOptions.style.visibility!="hidden"){tabOptions.style.visibility="hidden"}App.retainKeyboardFocus();App.keyboardFocus="module";return Q(Y)}return true}function L(U){switch(U.key){case"esc":App.keyboardFocus="module";SettingsPanel.close();App.retainKeyboardFocus();return Q(U)}return true}function D(U){switch(U.key){case"esc":App.keyboardFocus="addcontent";App.Sidebar.removeModuleBox();App.retainKeyboardFocus();return Q(U)}return true}function P(a){var V=0;switch(a.key){case"a":var W=$("FeedreaderReadAll");if(W){W.onclick()}return Q(a);case"h":case"f1":N("Feedreader",'<table><tr><td><img src="'+NV_PATH+'img/keys/esc.png" alt="Esc" title="Esc"/></td><td>'+_("Close open Netvibes windows")+'</td></tr><tr><td><img src="'+NV_PATH+'img/keys/p.png" alt="P" title="P"/></td><td>'+_("Previous message")+'</td></tr><tr><td><img src="'+NV_PATH+'img/keys/n.png" alt="N" title="N"/></td><td>'+_("Next message")+'</td></tr><tr><td><img src="'+NV_PATH+'img/keys/up.png" alt="'+_("Up")+'" title="'+_("Up")+'"/></td><td>'+_("Previous message")+" "+_("(with scroll in content)")+'</td></tr><tr><td><img src="'+NV_PATH+'img/keys/down.png" alt="'+_("Down")+'" title="'+_("Down")+'"/></td><td>'+_("Next message")+" "+_("(with scroll in content)")+'</td></tr><tr><td><img src="'+NV_PATH+'img/keys/space.png" alt="'+_("Space")+'" title="'+_("Space")+'"/></td><td>'+_("Next unread message")+" "+_("(with scroll)")+'</td></tr><tr><td><img src="'+NV_PATH+'img/keys/u.png" alt="U" title="U"/></td><td>'+_("Mark item as read/unread")+'</td></tr><td><img src="'+NV_PATH+'img/keys/a.png" alt="A" title="A"/></td><td>'+_("Read All")+'</td></tr><tr><td><img src="'+NV_PATH+'img/keys/shift.png" alt="SHIFT" title="SHIFT"/> + <img src="'+NV_PATH+'img/keys/u.png" alt="U" title="U"/></td><td>'+_("Unread All")+"</td></tr></table>");return Q(a);case"i":$("btShowPage").onclick();return Q(a);case"u":if(a.shift){var W=$("FeedreaderUnReadAll");if(W){W.onclick()}return Q(a)}case"p":case"up":if(V==0&&(a.key=="p"||a.key=="up")){V=-1}case"space":if(V==0&&a.key=="space"){V=2;var Z=$("feedReaderContentFrame").parentNode;var Y=(Z.firstChild.scrollTop+Element.getDimensions(Z.firstChild).height)>=Z.firstChild.scrollHeight;if(!Y){var U=Z.firstChild.scrollTop+Math.floor(Element.getDimensions(Z.firstChild).height*0.8);App.smoothScroll(Z.firstChild,U);return Q(a)}}case"n":case"down":if(V==0&&(a.key=="n"||a.key=="down")){V=1}if(a.key=="up"){var Z=$("feedReaderContentFrame").parentNode;var b=(Z.firstChild.scrollTop==0);if(!b){var U=Z.firstChild.scrollTop-Math.floor(Element.getDimensions(Z.firstChild).height*0.8);if(U<0){U=0}App.smoothScroll(Z.firstChild,U);return Q(a)}}if(a.key=="down"){var Z=$("feedReaderContentFrame").parentNode;var Y=(Z.firstChild.scrollTop+Element.getDimensions(Z.firstChild).height)>=Z.firstChild.scrollHeight;if(!Y){var U=Z.firstChild.scrollTop+Math.floor(Element.getDimensions(Z.firstChild).height*0.8);App.smoothScroll(Z.firstChild,U);return Q(a)}}this.onBottom=function(){return(Z.childNodes[1].scrollTop+Element.getDimensions(Z.childNodes[1]).height)>=Z.childNodes[1].scrollHeight};var X=$("feedReaderHeadlinesFrame").firstChild;do{if(X.getAttribute("isSelected")&&X.getAttribute("isSelected")==1){break}}while(X=X.nextSibling);if(!X){X=$("feedReaderHeadlinesFrame").firstChild}else{switch(V){case -1:X=X.previousSibling;break;case 1:X=X.nextSibling;break;case 2:X=X.nextSibling;do{if(X&&Element.hasClassName(X,"unread")){break}if(!X||!X.nextSibling){X=null;break}}while(X=X.nextSibling);break}}if(X){if(V==0){X.onclick(X,true)}else{X.onclick(X)}}return Q(a);case"esc":App.FeedReader.close();App.keyboardFocus="module";App.retainKeyboardFocus();F();return Q(a)}return true}function G(U){switch(U.key){case"esc":App.keyboardFocus="module";if(App.moduleFocus!=null){App.moduleList[App.moduleFocus].endEditMode()}App.retainKeyboardFocus();return Q(U)}return true}function B(U){m=App.moduleList[App.moduleFocus];if(m&&typeof m.content.onKeyboardAction=="function"){return m.content.onKeyboardAction(U.key)}return true}if(App.keyboardFocus&&App.keyboardFocus.indexOf("edit")==-1&&App.keyboardFocus!="module.action"){if(SettingsPanel.isOpen()){App.keyboardFocus="settings"}else{if(App.FeedReader.isOpen&&(!App.keyboardFocus||App.keyboardFocus.substr(0,10)!="feedreader")){App.keyboardFocus="feedreader"}}}if(helpDiv&&helpDiv.style.display=="block"){F();if(App.keyboardFocus=="tab.edit"){App.keyboardFocus="module"}if(S.key=="esc"||S.key=="h"||S.key=="f1"){return Q(S)}}window.status="Keyboard focus is on: "+App.keyboardFocus;switch(App.keyboardFocus){case"addcontent":if(!A(S)){return false}break;case"addcontent.edit":case"addcontent.feed":if(!D(S)){return false}break;case"feedreader":if(!P(S)){return false}break;case"tab.edit":case"tab":if(!J(S)){return false}break;case"settings":if(!L(S)){return false}break;case"module.edit":if(!G(S)){return false}break;case"module.action":if(!B(S)){return false}break;case"edit":break;case"module":case"searchInNetvibes":default:if(!T(S)){return false}break}switch(S.key){case"esc":App.keyboardFocus="module";App.FeedReader.close();App.Sidebar.close();if($("shareModuleBalloon")){Element.remove($("shareModuleBalloon"))}if(tabOptions){tabOptions.style.visibility="hidden"}F();if(App.moduleFocus){K(App.moduleFocus);App.moduleFocus=null}App.retainKeyboardFocus();return Q(S)}};App.retainKeyboardFocus=function(){if(document.focus){document.focus()}else{if(document.body.focus){document.body.focus()}else{if(window.focus){window.focus()}}}};var smoothScrollToTimeout;App.smoothScroll=function(C,A){if(C=="all"){if(Browser.isSafari){var C=document.body}else{var C=document.documentElement}}window.clearTimeout(smoothScrollToTimeout);var E;var D=C.scrollTop;var B=0;scrollToValue=function(){B=B+1;if(B>15){window.clearTimeout(smoothScrollToTimeout)}else{var F=B/15;y=Math.floor((A-D)*(Math.cos((F-1)*3.1416)+1)/2);C.scrollTop=D+y;smoothScrollToTimeout=window.setTimeout(scrollToValue,40)}};smoothScrollToTimeout=window.setTimeout(scrollToValue,40)};App.appScroll=function(A){if(Browser.isSafari){var D=document.body}else{var D=document.documentElement}var C=D.scrollTop;var E=findPosY(A);var B=Element.getDimensions(A).height;var F;if(self.innerHeight){F=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){F=D.clientHeight}else{if(document.body){F=document.body.clientHeight}}}if(E-C+B>F-25){App.smoothScroll("all",E+B-F+60)}else{if(E-C<25){App.smoothScroll("all",E-60)}}};;
App.FeedReader={};App.FeedReader.isOpen=false;App.FeedReader.headlinesTD=220;App.FeedReader.contentViewPortHeight=false;App.FeedReader.resize=function(){if($("feedReaderContentFrame")==null||!App.FeedReader.isOpen){return false}var C=document.body.clientWidth-10-9;App.FeedReader.elm.style.width=C+"px";App.FeedReader.elm.style[App.FeedReader.dirRTL==true?"right":"left"]="9px";var G=C-App.FeedReader.headlinesTD-28;var E=$("feedReaderContentFrame");var D=window.getSize().y;var B=$("top")?$("top").getPosition().y:0;var F=D-100-B;if(App.pageCustom.feedreaderMaximized=="0"){var A=$("header").getSize().y;F-=A;if(App.FeedReader.elm.getStyle("marginBottom")=="0px"){App.FeedReader.elm.setStyle("marginTop",A+10)}}else{App.FeedReader.elm.setStyle("marginTop",10)}F=(F>300?F:260)+"px";var H=F;E.style.height=F;E.style.width=G+"px";$("feedReaderHeadlinesFrame").style.height=H;$("tooltip").style.display="none";if(E.getElementsByTagName("iframe")[0]){E.getElementsByTagName("iframe")[0].style.width=G+"px";E.getElementsByTagName("iframe")[0].style.height=F}};App.FeedReader.onShareArticle=function(A){var B=App.FeedReader.data.moduleLocalData.feed.items[A];App.FeedReader.data.moduleObj.addStar({title:B.title,url:B.link});App.report("click.share.freader");App.Share.show(item)};App.FeedReader.close=function(){var A=App.FeedReader.elm;A.innerHTML="";A.style.display="none";App.FeedReader.isOpen=false;App.keyboardFocus="module";App.retainKeyboardFocus();if(Browser.isIE){$("columns").setStyles({display:"block"})}else{$("columns").setStyle("position","static")}if($("footer")){$("footer").setStyle("display","block")}document.body.scrollTop=App.FeedReader.oldScroll;document.documentElement.scrollTop=App.FeedReader.oldScroll;if(typeof App.searchBoxInput!="undefined"){App.searchBoxInput.disabled=""}App.FeedReader.data.contentObj.setAutoRefreshState(true);if(Browser.isFirefox){setTimeout(App.Modules.notifyResize,1000)}};App.FeedReader.updateReadCount=function(){var A=App.Rss.getHistoryNbNew(App.FeedReader.data.moduleLocalData.feed,App.FeedReader.data.moduleLocalData.feed.items.length);if(!App.isOnSearch){App.FeedReader.countStatus.innerHTML=(A==0)?"":'&nbsp;&nbsp;<span class="unread">('+A+")</span>"}else{App.FeedReader.countStatus.innerHTML=""}};App.FeedReader.display=function(i){if(!App.FeedReader.elm){var W=new Element("div",{id:"feedReader"}).inject($("application"),"top");App.FeedReader.elm=$("feedReader")}App.FeedReader.data=i;App.FeedReader.data.contentObj.setAutoRefreshState(false);App.FeedReader.dirRTL=(i.moduleLocalData.feed.dir&&i.moduleLocalData.feed.dir=="rtl")?true:false;if(typeof App.Panel!="undefined"){App.Panel.close()}if(document.body.scrollTop){App.FeedReader.oldScroll=document.body.scrollTop}else{App.FeedReader.oldScroll=document.documentElement.scrollTop}if(typeof App.searchBoxInput!="undefined"){App.searchBoxInput.disabled="disabled"}scrollTo(0,0);if(Browser.isIE){$("columns").setStyles({display:"none"})}else{$("columns").setStyles({position:"absolute",left:"-99999px",top:"-99999px"})}if($("footer")){$("footer").setStyle("display","none")}var P=i.moduleLocalData.feed.htmlUrl||"";var G;var U=P.lastIndexOf("/");if(U!=6){P=P.substring(0,U)}var D=P.substring(0,P.indexOf("/",7));if(!D){D=P}var g=App.FeedReader.elm;if(App.FeedReader.dirRTL==true){Element.addClassName(g,"rtl");Element.removeClassName(g,"ltr");g.dir="rtl"}else{Element.addClassName(g,"ltr");Element.removeClassName(g,"rtl");g.dir="ltr"}var Z=document.createElement("div");Z.id="feedReaderFrame";g.style.marginTop="10px";g.style.display="block";var A=document.createElement("div");A.className="frame";var B=document.createElement("div");B.className="header";if(App.FeedReader.dirRTL==true){B.innerHTML=Netvibes.UI.createIcon("actions-window-close",_("Close"),16,16,true)+'<div class="readAll rtl"><div><div id="FeedreaderReadAll" >'+_("Read All").replace(/(a)/i,"<u>$1</u>")+'</div></div></div><div class="readAll rtl"><div><div id="FeedreaderUnReadAll" >'+_("Unread All").replace(/(u)/i,"<u>$1</u>")+'</div></div></div><div id="feedReaderCountStatus" style="float:right">(undefined)</div><h2><a href="'+i.moduleLocalData.feed.htmlUrl+'" target="_blank">'+i.title.escapeHTML()+'</a></h2><img class="icon '+(App.pageCustom.feedreaderMaximized=="0"?"actions-window-maximize":"actions-window-normal")+'" width="16" height="16" src="'+App.getStaticUrl("/img/s.gif")+'" alt="'+(App.pageCustom.feedreaderMaximized=="0"?_("Maximize"):_("Normal"))+'" title="'+(App.pageCustom.feedreaderMaximized=="0"?_("Maximize"):_("Normal"))+'"/><div class="readAll" style="float: left;margin-top:-20px;position:relative;left:60px;clear:left"><div><div id="btShowPage" dir="ltr"></div></div></div>'}else{B.innerHTML=Netvibes.UI.createIcon("actions-window-close",_("Close"),16,16,true)+'<div class="readAll ltr"><div><div id="FeedreaderReadAll">'+_("Read All").replace(/(a)/i,"<u>$1</u>")+'</div></div></div><div class="readAll ltr"><div><div id="FeedreaderUnReadAll">'+_("Unread All").replace(/(u)/i,"<u>$1</u>")+'</div></div></div><div id="feedReaderCountStatus" style="float:left; cursor: pointer">(undefined)</div><h2><a href="'+i.moduleLocalData.feed.htmlUrl+'" target="_blank">'+i.title.escapeHTML()+'</a></h2><img class="icon '+(App.pageCustom.feedreaderMaximized=="0"?"actions-window-maximize":"actions-window-normal")+'" width="16" height="16" src="'+App.getStaticUrl("/img/s.gif")+'" alt="'+(App.pageCustom.feedreaderMaximized=="0"?_("Maximize"):_("Normal"))+'" title="'+(App.pageCustom.feedreaderMaximized=="0"?_("Maximize"):_("Normal"))+'"/><div class="readAll" style="float: right;margin-top:-20px;margin-right:60px"><div><div id="btShowPage"></div></div></div>'}App.FeedReader.readAll=function(){c(true)};var M=B.firstChild.nextSibling.firstChild.firstChild;M.onclick=App.FeedReader.readAll;var I=B.childNodes[3];I.onclick=App.FeedReader.readAll;var Q=B.childNodes[2].firstChild.firstChild;Q.onclick=function(){c(false)};var E=B.childNodes[6].firstChild.firstChild;var R=$(B.childNodes[5]);if(!i.contentObj.getShowPage()||i.contentObj.getShowPage()==0){E.innerHTML=_("Show website");var F=false}else{E.innerHTML=_("Go back to the feed view");var F=true}R.set("title",App.pageCustom.feedreaderMaximized=="0"?_("Maximize"):_("Normal")).addEvent("click",function(l){l.stop();if(App.pageCustom.feedreaderMaximized=="0"){App.pageCustom.feedreaderMaximized="1";R.set("title",_("Normal")).set("alt",_("Normal")).removeClass("actions-window-maximize").addClass("actions-window-normal")}else{App.pageCustom.feedreaderMaximized="0";R.set("title",_("Maximize")).set("alt",_("Maximize")).addClass("actions-window-maximize").removeClass("actions-window-normal")}App.FeedReader.resize();App.savePageCustom()});E.onclick=function(){if(this.innerHTML==_("Show website")){this.innerHTML=_("Go back to the feed view");V();i.contentObj.setShowPage(1)}else{this.innerHTML=_("Show website");var l=K.firstChild;l.removeChild(L);l.firstChild.style.display="";l.scrollTop=C;C=-1;i.contentObj.setShowPage(0)}i.moduleObj.save()};E.style.cursor="pointer";B.firstChild.style.cursor="pointer";if(Browser.isIE){if(App.FeedReader.dirRTL==true){B.firstChild.style.styleFloat="left"}else{B.firstChild.style.styleFloat="right"}}else{if(App.FeedReader.dirRTL==true){B.firstChild.style.cssFloat="left"}else{B.firstChild.style.cssFloat="right"}}B.firstChild.onclick=function(){App.FeedReader.close()};var f=document.createElement("div");f.id="feedReaderFrame2";f.innerHTML='<table id="readerTable" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td></td><td></td><td></td></tr></tbody></table>';var j=f.firstChild.firstChild.firstChild;var O=j.childNodes[0];O.className="tdHeadlines";O.style.width=App.FeedReader.headlinesTD+"px";var a=j.childNodes[1];a.className="tdSeparator";var K=j.childNodes[2];K.className="tdContent";K.innerHTML='<div id="feedReaderContentFrame"><div class="contentInsideFrame"></div></div>';function J(o,n,m){var p=o.firstChild.firstChild.firstChild.firstChild;var l=o.lastChild.firstChild.firstChild.firstChild;p.onmouseover=l.onmouseover=function(){this.style.color="#F60"};p.onmouseout=l.onmouseout=function(){this.style.color="#333"};p.onclick=function(){App.launchPlayer(n,m)}}function S(p,v,m){function r(AE,AD,AF){if(typeof AF=="undefined"){AF=false}var z=AE.getAttribute(AD);if(z==null){return }if(Browser.isIE&&(z.indexOf("http://"+NV_HOST)==0)){AE.setAttribute(AD,z.replace("http://"+NV_HOST,D))}if(z.indexOf("http://")==0){return }if(z.indexOf("https://")==0){return }if(AF&&z.indexOf("mailto:")==0){return }if(z.substring(0,1)=="/"){AE.setAttribute(AD,D+z);return }if(P.substring(0,1)=="/"){AE.setAttribute(AD,P+z);return }AE.setAttribute(AD,P+"/"+z)}var u=p.getElementsByTagName("img");var y=u.length;for(var AA=0;AA<y;AA++){u[AA].onload=function(){if(!this.currentStyle){return }if(this.currentStyle.width){this.style.width=this.currentStyle.width}if(this.currentStyle.height){this.style.height=this.currentStyle.height}};r(u[AA],"src")}var q=p.getElementsByTagName("script");var y=q.length;for(var AA=y-1;AA>0;AA--){if(!q[AA]){break}if(typeof q[AA].removeNode=="function"){q[AA].removeNode(true)}else{try{Element.remove(q[AA])}catch(x){}}}var AC=p.getElementsByTagName("style");var y=AC.length;for(var AA=0;AA<y;AA++){Element.remove(AC[AA])}if(App.isOnSearch){p.innerHTML=String.highlight(p.innerHTML,App.query)}var AB=p.getElementsByTagName("a");var y=AB.length;for(var AA=0;AA<y;AA++){var t=AB[AA].firstChild;if(t){if(t.nodeType==1){if(t.nodeName=="IMG"||t.nodeName=="img"){AB[AA].className="noBottomLine"}}}r(AB[AA],"href",true);AB[AA].setAttribute("target","_blank")}if(m.enclosures){var y=m.enclosures.length;for(var AA=0;AA<y;AA++){if(m.enclosures[AA].type.substr(0,10)=="audio/mpeg"||m.enclosures[AA].type=="audio/mp3"){var o=m.enclosures[AA].url;var l=document.createElement("div");l.className="podcast";l.innerHTML='<table cellpadding="0" cellspacing="0"><tr><td><div class="listen"><div><div>'+_("LISTEN")+'</div></div></div></td><td>&nbsp;</td><td><a href="'+o+'"><div class="download"><div><div>'+_("DOWNLOAD")+"</div></div></div></a></td></tr></table>";J(l,o,v.firstChild.firstChild.nextSibling.innerHTML);if(p.firstChild){p.insertBefore(l,p.firstChild)}else{p.appendChild(l)}}else{if(m.enclosures[AA].type=="image/jpeg"||m.enclosures[AA].type=="image/gif"||m.enclosures[AA].type=="image/png"){var o=m.enclosures[AA].url;if(p.innerHTML.toLowerCase().indexOf(o.toLowerCase())<0){var l=document.createElement("div");l.className="photofeed";l.innerHTML='<img src="'+o+'" />';if(p.firstChild){p.insertBefore(l,p.firstChild)}else{p.appendChild(l)}}}else{if(m.enclosures[AA].type.indexOf("video/"===0)||m.enclosures[AA].type=="video/quicktime"){var o=m.enclosures[AA].url;var l=document.createElement("div");l.className="videopodcast";var s=document.createElement("obj");s.setAttribute("classid","clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B");s.setAttribute("codebase","http://www.apple.com/qtactivex/qtplugin.cab");s.width=320;s.height=270;s.style.width=s.width+"px";s.style.height=s.height+"px";var n=document.createElement("param");n.name="src";n.value=o;s.appendChild(n);n=document.createElement("param");n.name="controller";n.value="true";s.appendChild(n);n=document.createElement("param");n.name="autoplay";n.value="false";s.appendChild(n);var w=document.createElement("embed");w.width=320;w.height=270;w.style.width=w.width+"px";w.style.height=w.height+"px";w.setAttribute("pluginspage","http://www.apple.com/quicktime/download/");w.setAttribute("src",o);w.setAttribute("controller","true");w.setAttribute("scale","TOFIT");w.setAttribute("autoplay","false");w.setAttribute("type","video/quicktime");s.appendChild(w);l.appendChild(s);if(p.firstChild){p.insertBefore(l,p.firstChild)}else{p.appendChild(l)}}}}}}}var L;var C=-1;function V(){if(C>=0){if(L.src!=G){L.src=G}}else{var l=K.firstChild;l.style.position="relative";L=document.createElement("iframe");L.style.border="none";L.src=G;L.style.position="absolute";L.style.top="0px";L.style.left="0px";L.style.background="white";var m=Element.getDimensions(l);L.style.width=m.width+"px";L.style.height=m.height+"px";C=l.scrollTop;l.firstChild.style.display="none";l.appendChild(L)}}function b(u,p){if(typeof p=="undefined"){p=false}if(!p){App.rssItemOnDisplay=u}var o=i.moduleLocalData.feed.items[u];var q=document.createElement("div");q.className="title";var t=o.link;if(t.indexOf("://")==-1){if(o.enclosures){var w=o.enclosures.length;for(var x=0;x<w;x++){if(o.enclosures[x].type.substr(0,6)=="audio/"||o.enclosures[x].type.substr(0,6)=="video/"||o.enclosures[x].type.substr(0,6)=="image/"){t=o.enclosures[x].url;break}}}}if(!p){G=t}var AA=new Element("h2");var y=new Element("a",{"class":"external",href:t,target:"_blank",html:_("link")+"&raquo;"}).inject(AA);var n=new Element("a",{rel:"external",href:t,target:"_blank"}).inject(AA);if(App.isOnSearch){n.set("html",String.highlight(o.title.stripTags(),App.query))}else{n.set("html",o.title.stripTags())}if("function"===typeof i.contentObj.openLink){var s=function(){return i.contentObj.openLink(u)};y.addEvent("click",s);n.addEvent("click",s)}var AB=new Element("p");if(o.author){new Element("span",{"class":"author",text:o.author}).inject(AB)}if(o.date){new Element("span",{"class":"date",text:o.date}).inject(AB)}var v=new Element("span",{"class":"share"}).inject(AB);var m=new Element("a",{href:"javascript:;",text:" "+_("Share"),events:{click:App.FeedReader.onShareArticle.bind(this,u)}}).inject(v);AA.inject(q);AB.inject(q);var r=document.createElement("div");r.className="feedContent";if(typeof o.shortItem!="undefined"&&o.shortItem!=null&&o.shortItem!=""){r.innerHTML=o.content+"<br /><br />("+_("Loading ...")+")"}else{r.innerHTML=o.content}S(r,q,o);K.firstChild.firstChild.appendChild(q);K.firstChild.firstChild.appendChild(r);if(typeof o.shortItem!="undefined"&&o.shortItem!=null&&o.shortItem!=""){App.Request.sendGET(i.proxy+"&item="+o.shortItem,function(l){if((typeof l.getResponseHeader=="function"||typeof l.getResponseHeader=="unknown")&&l.getResponseHeader("Content-type").substr(0,9)!="text/html"){return false}if(l.responseText.substr(0,1)=="{"){return false}o.shortItem=null;o.content=l.responseText;if(!p&&App.rssItemOnDisplay!=u){return false}r.style.visibility="hidden";r.innerHTML=o.content;S(r,q,o);r.style.visibility="visible"})}}function d(){var l=K.firstChild;l.firstChild.innerHTML="";if(C<0&&K.getElementsByTagName("iframe")&&K.getElementsByTagName("iframe")[0]){l.removeChild(L);l.firstChild.style.display=""}else{if(C>=0){l.firstChild.style.display="none"}}App.FeedReader.resize();return }function Y(){var m=document.createElement("a");m.className="toto";K.firstChild.firstChild.insertBefore(m,K.firstChild.firstChild.firstChild);try{K.firstChild.firstChild.firstChild.focus()}catch(l){}}function e(p,u,l){var w=K.firstChild.firstChild;var v=N.scrollTop;var m=N.childNodes[p].offsetTop;var n=Element.getDimensions(N.childNodes[p]).height;var t=Element.getDimensions(N).height;if(m-v+n>t-25){App.smoothScroll(N,m+n-t+60)}else{if(m-v<25){App.smoothScroll(N,m-60)}}if(typeof l=="undefined"){l=true}l=(l)?1:0;if("function"===typeof App.FeedReader.data.contentObj.itemClicked&&1===l){App.FeedReader.data.contentObj.itemClicked(p)}var q=N.childNodes.length;for(var r=0;r<q;r++){N.childNodes[r].setAttribute("isSelected",0);if(Element.hasClassName(N.childNodes[r],"selected")){Element.removeClassName(N.childNodes[r],"selected")}}d();N.childNodes[p].setAttribute("isSelected",1);if(!Element.hasClassName(N.childNodes[p],"selected")){Element.addClassName(N.childNodes[p],"selected")}b(p);K.firstChild.scrollTop=0;Y();if(u){if(UWA.Services.FeedHistory.isRead(i.moduleLocalData.feed,p)!=l){if(l==true){UWA.Services.FeedHistory.setRead(i.moduleLocalData.feed,p)}else{UWA.Services.FeedHistory.setUnRead(i.moduleLocalData.feed,p)}if(l){Element.removeClassName(N.childNodes[p],"unread");Element.addClassName(N.childNodes[p],"read");i.contentObj.setRead(p)}else{Element.removeClassName(N.childNodes[p],"read");Element.addClassName(N.childNodes[p],"unread");i.contentObj.setUnRead(p)}i.contentObj.setHistory(App.Rss.getHistoryString(i.moduleLocalData.feed));i.moduleObj.saveHistory();i.contentObj.setFeedTitle();App.FeedReader.updateReadCount()}}if(C>=0){C=0;V()}}function c(p){d();var m=K.firstChild.firstChild;var n=N.childNodes.length;for(var o=0;o<n;o++){if(p){N.childNodes[o].setAttribute("isSelected",1);Element.addClassName(N.childNodes[o],"selected");Element.removeClassName(N.childNodes[o],"unread");Element.addClassName(N.childNodes[o],"read");UWA.Services.FeedHistory.setRead(i.moduleLocalData.feed,o);b(o,true);var l=document.createElement("div");l.className="postSeparator";m.appendChild(l)}else{N.childNodes[o].setAttribute("isSelected",0);Element.removeClassName(N.childNodes[o],"selected");Element.removeClassName(N.childNodes[o],"read");Element.addClassName(N.childNodes[o],"unread");UWA.Services.FeedHistory.setUnRead(i.moduleLocalData.feed,o)}}K.firstChild.scrollTop=0;Y();i.contentObj.setHistory(App.Rss.getHistoryString(i.moduleLocalData.feed));i.moduleObj.saveHistory();i.contentObj.setAllAsRead();App.FeedReader.updateReadCount();G=i.moduleLocalData.feed.htmlUrl;if(C>=0){C=0;V()}}var N=document.createElement("div");N.id="feedReaderHeadlinesFrame";var T=i.moduleLocalData.feed.items.length;for(var X=0;X<T;X++){var H=i.moduleLocalData.feed.items[X];var k=document.createElement("div");k.setAttribute("itemId",H.id);k.setAttribute("itemIndex",X);k.className="headline";k.onmouseover=function(){};k.onmouseout=function(){};k.onclick=function(m){var l=UWA.Services.FeedHistory.isRead(i.moduleLocalData.feed,this.getAttribute("itemIndex"));l=!(this.getAttribute("isSelected")==1&&l);e(this.getAttribute("itemIndex"),true,l);if(UWA.Services.FeedHistory.isRead(i.moduleLocalData.feed,this.getAttribute("itemIndex"))){Element.addClassName(this,"read")}else{Element.addClassName(this,"unread")}};if(!App.isOnSearch){k.innerHTML='<a href="'+H.link+'" onclick="return false;">'+H.title.stripTags()+"</a>"}else{k.innerHTML='<a href="'+H.link+'" onclick="return false;">'+String.highlight(H.title.stripTags(),App.query)+"</a>"}if(typeof i.moduleObj.addStar=="function"){var h=document.createElement("img");h.className="star";h.src="/img/s.gif";h.height=16;h.width=16;h.style.display="none";h.onclick=function(l){if(!l){var l=window.event}App.report("click.share.freader");i.moduleObj.addStar({title:this.feedItem.title,url:this.feedItem.link});Event.stop(l)}.bindAsEventListener({feedItem:H});k.insertBefore(h,k.firstChild);k.onmouseover=function(){this.style.display="block"}.bindAsEventListener(h);k.onmouseout=function(){this.style.display="none"}.bindAsEventListener(h)}if(UWA.Services.FeedHistory.isRead(i.moduleLocalData.feed,X)){Element.addClassName(k,"read")}else{Element.addClassName(k,"unread")}if(App.isOnSearch&&H.isResult!="1"){Element.addClassName(k,"transparent")}N.appendChild(k)}O.appendChild(N);A.appendChild(B);A.appendChild(f);Z.appendChild(A);g.innerHTML="";g.appendChild(Z);Y();if(App.staticUniverse){$("feedReaderCountStatus").style.display="none"}App.FeedReader.isOpen=true;App.FeedReader.countStatus=B.childNodes[3];App.FeedReader.updateReadCount();App.FeedReader.resize();if(F){K.firstChild.firstChild.style.display="none"}e(i.selectedItemIndex,false);if(F){V()}setTimeout(App.FeedReader.resize,100)};;
if(typeof window.NV_HOST=="undefined"){NV_HOST="www.netvibes.com"}if(typeof window.NV_MODULES=="undefined"){NV_MODULES="nvmodules.netvibes.com"}if(typeof window.NV_AVATARS=="undefined"){NV_AVATARS="avatars.netvibes.com"}if(typeof window.NV_STATIC=="undefined"){NV_STATIC="http://"+NV_HOST}if(typeof window.NV_PATH=="undefined"){NV_PATH="http://"+NV_HOST+"/"}if(typeof window.NV_API_PATH=="undefined"){NV_API_PATH="http://"+NV_HOST+"/rest"}if(typeof UWA=="undefined"){var UWA={}}if(typeof UWA.Widgets=="undefined"){UWA.Widgets={}}if(typeof UWA.Scripts=="undefined"){UWA.Scripts={}}if(typeof UWA.Controls=="undefined"){UWA.Controls={}}if(typeof UWA.Services=="undefined"){UWA.Services={}}if(typeof UWA.Templates=="undefined"){UWA.Templates={}}UWA.version="1.2";if(typeof Netvibes=="undefined"){var Netvibes={}}if(typeof Netvibes.UI=="undefined"){Netvibes.UI={}}Netvibes.UI._idIncrement=0;UWA.Controls=Netvibes.UI;if(Netvibes.DLA){UWA.Controls.SearchForm=Netvibes.DLA.SearchForm}if(typeof _=="undefined"){_=function(A){return A}}UWA.extend=function(C,A){for(var B in (A||{})){C[B]=A[B]}return C};UWA.merge=function(){for(var A in arguments[1]){if(typeof arguments[0][A]=="undefined"){arguments[0][A]=arguments[1][A]}}return arguments[0]};UWA.log=function(A){if(window.console&&typeof (console.log)=="function"){console.log(A)}else{if(window.opera&&typeof (opera.postError)=="function"){opera.postError(A)}}};;
UWA.Class=Class;UWA.Form={getElements:function(A){return $(A).getElements("input, textarea, select")}};UWA.Ajax={getRequest:function(B,A){A.url=B;if(A.postBody){A.data=A.postBody;A.urlEncoded=false;delete A.postBody}else{if(A.parameters){A.data=A.parameters;delete A.parameters}}if(A.method){A.method=A.method.toLowerCase()}if(A.requestHeaders){A.headers=A.requestHeaders;delete A.requestHeaders}if(A.headers){A.headers["X-Requested-With"]="XMLHttpRequest"}return new Request(A)},Request:function(B,A){var C=this.getRequest(B,A);return C.send()},onCompleteXML:function(A,C,B){if(typeof C=="function"){C(A[1])}},onCompleteText:function(A,C,B){if(typeof C=="function"){C(A[0])}},onCompleteFeed:function(arg,callback,context){var response={responseText:arg[0],responseXML:arg[1]};if(typeof UWA.Utils.parseFeed=="function"){response=UWA.Utils.parseFeed(response)}else{eval("response = "+response.responseText)}if(typeof callback=="function"){callback(response)}},onCompleteJson:function(arg,callback,context){try{eval("var j = "+arg[0]);if(typeof callback=="function"){callback(j,context)}}catch(e){UWA.log(e)}}};UWA.createElement=function(B,A){return UWA.$element(new Element(B,A))};UWA.extendElement=function(A){if(A){A=$(A);if(!A.isUwaExtended){UWA.merge(A,UWA.Element);A.isUwaExtended=true}return A}};UWA.$element=UWA.extendElement;if(typeof UWA.Element=="undefined"){UWA.Element={}}UWA.extend(UWA.Element,{setAttributes:function(A){return this.setProperties(A)}});if(typeof UWA.Json=="undefined"){UWA.Json={}}UWA.Json.encode=JSON.encode;UWA.Json.decode=function(A){return JSON.decode(A,true)};UWA.merge(Object,{extend:UWA.extend});UWA.Class=UWA.extend(Class,{create:function(){return function(){this.initialize.apply(this,arguments)}}});UWA.merge(Element,{hasClassName:function(B,A){return $(B).hasClassName(A)},addClassName:function(B,A){return $(B).addClassName(A)},removeClassName:function(B,A){return $(B).removeClassName(A)},getDimensions:function(A){return $(A).getDimensions()},hide:function(A){return $(A).hide()},show:function(A){return $(A).show()}});UWA.merge(Event,{element:function(A){return A.target},findElement:function(C,B){var A=C.target||new Event(C).target;while(A.parentNode&&(!A.tagName||(A.tagName.toUpperCase()!=B.toUpperCase()))){A=A.parentNode}return A}});Function.implement({bindAsEventListener:function(B,A){return this.create({bind:B,event:true,"arguments":A})}});;
UWA.merge(String.prototype,{stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"")},truncate:function(B,A){B=B||30;A=A===undefined?"...":A;return this.length>B?this.slice(0,B-A.length)+A:String(this)},escapeRegExp:function(){return this.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},trim:function(){return this.replace(/^\s+|\s+$/g,"")},isEmail:function(){var A=/^([a-zA-Z0-9_.\-+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;return A.test(this)},s:function(){var F=this;if(arguments.length<1){return F}var C=/([^%]*)%s(.*)/;var A=[],B=-1;while(A=C.exec(F)){var D=A[1],E=A[2];if(++B>=arguments.length){break}F=D+arguments[B]+E}return F},format:function(){var A=arguments;return this.replace(/\{(\d+)\}/g,function(B,C){return A[C]})},parseRelativeTime:function(B,E){if(typeof E!="number"){E=0}var D=(B&&B.match(/^(\d\d\d\d)\-(\d\d)\-(\d\d) (\d\d):(\d\d):(\d\d)$/));if(!D){return false}var A=new Date(D[1],D[2]-1,D[3],D[4],D[5],D[6]);var C=new Date();var F=parseInt((C.getTime()-A.getTime())/1000);F=F+(C.getTimezoneOffset()*60+3600*E);if(F<60){return _("less than a minute ago")}else{if(F<120){return _("about a minute ago")}else{if(F<(45*60)){return _("{0} minutes ago").format(Math.round(F/60))}else{if(F<(90*60)){return _("about an hour ago")}else{if(F<(24*60*60)){return _("about {0} hours ago").format(Math.round(F/3600))}else{if(F<(48*60*60)){return _("yesterday")}else{return _("{0} days ago").format(Math.round(F/86400))}}}}}}},contains:function(A,B){return(B)?(B+this+B).indexOf(B+A+B)>-1:this.indexOf(A)>-1},camelCase:function(){return this.replace(/-\D/g,function(A){return A.charAt(1).toUpperCase()})},makeClickable:function(){var A=this;A=A.replace(/((\w+:\/\/(\w+(:\w+)?@)?)|www\.)[^\s<$]+/g,function(B,F){var C=B;var E=B;var D=C.match(/^(.*)([:\);,\.\]])$/);if(D){if(D[1].indexOf("(")>-1&&D[1].charAt(D[1].length-1)!=")"){D=null}else{C=D[1];E=D[1]}}if(C.test(/^www./)){C="http://"+C}return'<a href="'+C+'" target="_blank">'+E+"</a>"+((D&&D[2])?D[2]:"")});A=A.replace(/([\/:\w\+\_-]+(\.[\w\+\_-]+)*@[\w\.-]+\.[\w]+)/g,function(B,D){var C=B;if(!B.test(/^[\w]+:\/\//)){C='<a href="mailto:'+B+'">'+B+"</a>"}return C});return A},unescapeHTML:function(){var A=document.createElement("div");A.innerHTML=this.stripTags();return A.childNodes[0]?A.childNodes[0].nodeValue:""},test:function(A,B){return((typeof A=="string")?new RegExp(A,B):A).test(this)}});String.parseRelativeTime=String.prototype.parseRelativeTime;if(typeof String.highlight=="undefined"){String.highlight=function(A){return A}};;
UWA.merge(Array.prototype,{forEach:function(C,D){for(var B=0,A=this.length;B<A;B++){C.call(D,this[B],B,this)}},filter:function(D,E){var C=[];for(var B=0,A=this.length;B<A;B++){if(D.call(E,this[B],B,this)){C.push(this[B])}}return C},map:function(D,E){var C=[];for(var B=0,A=this.length;B<A;B++){C[B]=D.call(E,this[B],B,this)}return C},every:function(C,D){for(var B=0,A=this.length;B<A;B++){if(!C.call(D,this[B],B,this)){return false}}return true},some:function(C,D){for(var B=0,A=this.length;B<A;B++){if(C.call(D,this[B],B,this)){return true}}return false},indexOf:function(C,D){var A=this.length;for(var B=(D<0)?Math.max(0,A+D):D||0;B<A;B++){if(this[B]===C){return B}}return -1}});UWA.merge(Array.prototype,{normalize:function(D){var A=0;var C=D/this.inject(0,function(E,F){return E+F});for(var B=0;B<this.length-1;B++){A+=(this[B]*=C)}this[this.length-1]=D-A},equals:function(C){if(!C){return false}var A=this.length;if(A!=C.length){return false}for(var B=0;B<A;B++){if(this[B]!=C[B]){return false}}return true},detect:function(B){var A;this.each(function(D,C){if(B(D,C)){A=D;return A}});return A}});if(typeof Array.prototype.each!="function"){Array.prototype.each=Array.prototype.forEach};;
if(typeof UWA.Element=="undefined"){UWA.Element={}}UWA.merge(UWA.Element,{addContent:function(B){if(typeof B=="string"){var A=document.createElement("div");A.innerHTML=B;return this.appendChild(A)}return this.appendChild(B)},setText:function(A){this[(typeof this.innerText!="undefined")?"innerText":"textContent"]=A;return this},appendText:function(B){var A=document.createTextNode(B);return this.appendChild(A)},setHTML:function(A){this.innerHTML=A;return this},setContent:function(A){if(typeof A=="string"){this.setHTML(A)}else{if(typeof A=="object"){this.innerHTML="";this.appendChild(A)}}return this},hasClassName:function(A){return this.className.contains(A," ")},addClassName:function(A){if(!this.hasClassName(A)){this.className=(this.className+" "+A)}return this},removeClassName:function(A){this.className=this.className.replace(new RegExp("(^|\\s)"+A+"(?:\\s|$)"),"$1");return this},getParent:function(){return UWA.$element(this.parentNode)},getChildren:function(){return this.childNodes},empty:function(){this.innerHTML="";return this},hide:function(){return this.setStyle("display","none")},show:function(){return this.setStyle("display","")},toggle:function(){this.style.display=="none"?this.setStyle("display",""):this.setStyle("display","none");return this},remove:function(){return this.parentNode.removeChild(this)},getDimensions:function(){return{width:this.offsetWidth,height:this.offsetHeight}},setStyle:function(A){if(typeof A=="string"){A=A.camelCase();if(A=="float"){A=(UWA.Client.Engine.ie)?"styleFloat":"cssFloat"}this.style[A]=arguments[1]}else{if(typeof A=="object"){return this.setStyles(A)}}return this},setStyles:function(A){var C=this.style;for(var B in A){if(B=="opacity"){this.setOpacity(A[B])}else{C[(B=="float"||B=="cssFloat")?(C.styleFloat===undefined?"cssFloat":"styleFloat"):B]=A[B]}}return this},setOpacity:function(A){this.style.opacity=(A==1||A==="")?"":(A<0.00001)?0:A;return this},inject:function(C,A){var A=A||"bottom";if(A!="top"&&A!="bottom"&&A!="after"){UWA.log('warning: el.inject. Only "bottom", "top" or "after" are supported. '+A);A="bottom"}if(A=="bottom"){return C.appendChild(this)}else{if(A=="top"){return insertBefore(this,C.firstChild)}else{if(A=="after"){var B=C.parentNode;if(B.lastchild==C){return B.appendChild(this)}else{return B.insertBefore(C,C.nextSibling)}}}}},addListener:function(B,A){if(this.addEventListener){this.addEventListener(B,A,false)}else{this.attachEvent("on"+B,A)}return this},removeListener:function(B,A){if(this.removeEventListener){this.removeEventListener(B,A,false)}else{this.detachEvent("on"+B,A)}return this}});if(window.HTMLElement){UWA.merge(window.HTMLElement.prototype,UWA.Element)};;
if(typeof UWA.proxies=="undefined"){UWA.proxies={api:NV_PATH+"proxy/api2Proxy.php",rss:NV_PATH+"proxy/xmlProxy.php",ajax:NV_PATH+"proxy/ajaxProxy.php",feed:NV_PATH+"proxy/feedProxy.php",xml:NV_PATH+"data/xml/"}}if(typeof UWA.Json=="undefined"){UWA.Json={}}UWA.Json.request=function(url,request){var varname="json";if(request.context&&request.context[0]){varname+=request.context[0]}else{varname+=Math.round(1000*1000*Math.random())}eval(varname+"= false");url+="&object="+varname;var script=document.createElement("script");script.setAttribute("type","text/javascript");script.src=url;var head=document.getElementsByTagName("head")[0];var insert=head.appendChild(script);if(typeof request.onComplete=="undefined"){UWA.log("no callback set")}var callback=request.onComplete;var myCallback=function(c){return function(j){callback(j,c)}}(request.context);var interval=setInterval((function(){eval("var json = "+varname);if(json){try{myCallback(json)}catch(e){UWA.log(e)}insert.parentNode.removeChild(insert);clearInterval(interval)}}).bind(this),100)};UWA.Data={useJsonRequest:false,getFeed:function(A,B){if(UWA.Feeds&&UWA.Feeds[A]){B(UWA.Feeds[A]);setTimeout(function(){UWA.Feeds[A]=null},15000);return }if(typeof UWA.feedCallbackType=="undefined"){UWA.feedCallbackType="json"}return this.request(A,{method:"GET",proxy:"feed",type:UWA.feedCallbackType,onComplete:B})},getXml:function(A,B){return this.request(A,{method:"GET",type:"xml",onComplete:B})},getText:function(A,B){return this.request(A,{method:"GET",type:"text",onComplete:B})},getJson:function(A,B){return this.request(A,{method:"GET",type:"json",onComplete:B})},getModule:function(A,C,B){return this.request(A,{method:"GET",type:"xml",proxy:"api",onComplete:C})},request:function(A,E){if(typeof E=="undefined"){E={}}if(typeof E.method=="undefined"){E.method="GET"}if(typeof E.headers=="undefined"){E.headers={}}E.headers["X-Requested-Method"]=E.method;if(E.method=="DELETE"||E.method=="PUT"){E.method="POST"}if(typeof E.proxy=="undefined"){if(typeof E.authentication=="object"||location.hostname==""||(A.substr(0,4)=="http"&&A.indexOf("http://"+location.hostname)==-1)){E.proxy="ajax"}}if(typeof E.type=="undefined"){E.type="text"}if(UWA.proxies[E.proxy]){A=UWA.proxies[E.proxy]+"?url="+encodeURIComponent(A);if(E.proxy=="feed"&&E.shortFeed!=false){A+="&rss=1"}}else{if(E.proxy){UWA.log("no proxy URL set for "+E.proxy)}}var D=E.authentication;if(typeof D=="object"){if(D.type){A+="&auth="+D.type}if(D.gp){A+="&gp="+D.gp}if(D.moduleId){A+="&moduleId="+D.moduleId}if(D.username){A+="&username="+encodeURIComponent(D.username)}if(D.password){A+="&password="+encodeURIComponent(D.password)}}if(E.type&&E.proxy){A+="&type="+E.type}if(typeof E.cache!="undefined"){A+="&cache="+E.cache}if(typeof E.forceUpdate!="undefined"){A+="&forceUpdate="+E.forceUpdate}if(UWA.Client.Engine.ie){A+=((A.indexOf("?")>-1)?"&":"?")+"rnd="+Math.random()}var C={xml:"onCompleteXML",feed:"onCompleteFeed",json:"onCompleteJson",text:"onCompleteText",html:"onCompleteText"};switch(E.type){case"xml":var F=E.onComplete;E.onComplete=function(){UWA.Ajax.onCompleteXML(arguments,F)};return UWA.Ajax.Request(A,E);default:if(typeof E.proxy=="undefined"||E.proxy==null){this.useJsonRequest=false}if(this.useJsonRequest&&typeof E.authentication=="undefined"){return UWA.Json.request(A,E)}else{var F=E.onComplete;var B=E.context;if(typeof UWA.Ajax[C[E.type]]=="undefined"){E.type="text"}E.onComplete=function(){UWA.Ajax[C[E.type]](arguments,F,B)};return UWA.Ajax.Request(A,E)}}}};;
UWA.Environment=function(){this.module=null;this.widget=this.module;this.html={};this.loaded=false;this.registered=false;this.callbacks={};this.query="";this.data={};this.debugMode=false;this.periodicals={};this.delays={};this.height=200;if(this.initialize){this.initialize()}this.setPeriodical("init",this.init,100,true)};UWA.Environment.prototype={init:function(){if(document.body){this.callback("onInit");this.clearPeriodical("init");this.log("Environnement loaded");this.loaded=true;return true}return false},getModule:function(){if(this.module){var A=this.module}else{var A=new UWA.Module();this.registerModule(A);if(typeof UWA.Widgets.instances=="undefined"){UWA.Widgets.instances=[]}UWA.Widgets.instances.push(A)}return A},registerModule:function(A){this.module=A;this.widget=this.module;A.environment=this;this.setPeriodical("register",function(){if(this.loaded){this.callback("onRegisterModule");this.registered=true;this.log("Module registered");this.clearPeriodical("register")}},100,true)},launchModule:function(){this.setPeriodical("launch",function(){if(this.loaded&&this.module&&this.registered){this.log("Launching module");this.clearPeriodical("launch");this.module.launch();if(typeof this.module.onLoadComplete!="function"){this.callback("onLoadComplete")}}},100,true)},setCallback:function(A,B){this.callbacks[A]=B},callback:function(B,A,D){if(typeof D=="undefined"){D=this}try{if(this[B]){return this[B].apply(D,[A])}if(this.callbacks[B]){return this.callbacks[B].apply(D,[A])}}catch(C){this.log(C)}return false},setPeriodical:function(B,C,A,D){this.clearPeriodical(B);C=C.bind(this);this.periodicals[B]=setInterval(C,A);if(D){C()}},clearPeriodical:function(A){if(this.periodicals[A]){clearInterval(this.periodicals[A])}},setDelayed:function(B,C,A,D){this.clearDelayed(B);if(typeof D=="undefined"||D===true){C=C.bind(this)}this.delays[B]=setTimeout(C,A)},clearDelayed:function(A){if(this.delays[A]){clearTimeout(this.delays[A])}},log:function(A){if(this.debugMode){UWA.log(A)}}};;
UWA.Widget=function(){this.id="";this.environment=null;this.title="";this.body=null;this.data={};this.callbacks={};this.preferences=[];this.metas={};this.debugMode=false;this.periodicals={};this.searchResultCount=0;this.unreadCount=0;this.prefsForm=null;this.elements={};this.inline=false;this.apiVersion="1.2";this.lang="en_US";this.locale="us";this.dir="ltr";this.isNew=false;this.readOnly=false;this.theme=null;this.userId=null;if(this.initialize){this.initialize()}};UWA.Widget.prototype={setTitle:function(B,A){this.title=B;if(this.elements.title){if(A){A=" "+A+""}else{A=""}this.elements.title.setHTML(B+A)}if(this.environment&&this.environment.setTitle){this.environment.setTitle(B)}},getTitle:function(){if(this.environment&&this.environment.getTitle){return this.environment.getTitle()}return this.title.stripTags()},setBody:function(A){this.body.setContent(A);this.callback("onUpdateBody")},addBody:function(A){this.body.addContent(A);this.callback("onUpdateBody")},setIcon:function(A,B){if(this.environment.setIcon){this.environment.setIcon(A,B)}else{if(this.elements.icon){A="http://"+NV_HOST+"/proxy/favIcon.php?url="+encodeURIComponent(A);this.elements.icon.setHTML('<img width="16" height="16" src="'+A+'" />')}}},setElementId:function(A,B){UWA.log("widget.setElementId is deprecated");this.$(A).setAttribute("id","m_"+this.id+"_"+B)},createElement:function(B,A){if(typeof A=="string"){UWA.log("widget.createElement : elName as 2nd argument is deprecated");A={}}return UWA.createElement(B,A)},$:function(A){UWA.log("widget.$ is deprecated");if(typeof A=="string"&&this.elements[A]){A=this.elements[A]}return UWA.$element(A)},initPreferences:function(){for(var B=0;B<this.preferences.length;B++){var A=this.preferences[B];if(typeof A.name=="undefined"){continue}if(A.defaultvalue){A.defaultValue=A.defaultvalue}this.data[A.name]=this.getValue(A.name);if(this.data[A.name]==null&&A.defaultValue){this.data[A.name]=A.defaultValue}}},getPreference:function(A){for(var B=0;B<this.preferences.length;B++){if(this.preferences[B].name==A){return this.preferences[B]}}return null},setPreferences:function(E){if(typeof E=="object"){this.preferences=E;for(var D=0,B=this.preferences.length;D<B;D++){var C=this.preferences[D].name;var A=this.preferences[D].defaultValue;if(A&&!this.getValue(C)){this.setValue(C,A)}}}this.callback("onUpdatePreferences")},mergePreferences:function(A){for(var B=0;B<A.length;B++){if(this.getPreference(A[B].name)==null){this.addPreference(A[B])}}},addPreference:function(A){this.preferences.push(A)},setPreferencesXML:function(D){this.preferences=[];for(var F=0;F<D.length;F++){var E={};for(var C=0;C<D[F].attributes.length;C++){var B=D[F].attributes[C]["nodeName"];var H=D[F].attributes[C]["nodeValue"];E[B]=H}if(E.type=="list"){var A=D[F].getElementsByTagName("option");E.options=[];for(var C=0;C<A.length;C++){var G={};if(A[C].attributes[0]["value"]){G[A[C].attributes[0]["name"]]=A[C].attributes[0]["value"]}if(A[C].attributes[1]["value"]){G[A[C].attributes[1]["name"]]=A[C].attributes[1]["value"]}E.options.push(G)}}this.addPreference(E)}this.callback("onUpdatePreferences")},onEdit:function(){if(this.prefsForm){var B=this.prefsForm}else{var A=new UWA.Controls.PrefsForm({module:this});var B=A.getContent()}this.elements.edit.setContent(B);var C=this.getInfos();if(C){this.elements.edit.addContent(C)}this.callback("onShowEdit",this.elements.edit);this.elements.edit.show();if(this.elements.editLink){this.elements.editLink.setHTML(_("Close Edit"))}},onCloseEdit:function(){this.callback("onHideEdit")},getInfos:function(){var A="";if(this.metas.author){if(this.metas.website){var A='Widget by <strong><a href="'+this.metas.website+'" rel="author">'+this.metas.author+"</a></strong>"}else{var A="Widget by <strong>"+this.metas.author+"</strong>"}if(this.metas.version){A+=" - version <strong>"+this.metas.version+"</strong>"}}A+=((A!="")?"<br/> ":"")+"<small>Powered by Netvibes</small>";return this.createElement("p").setStyles({padding:"10px",textAlign:"right"}).setHTML(A)},endEdit:function(){this.elements.body.show();this.elements.edit.hide();if(this.elements.editLink){this.elements.editLink.show().setHTML(_("Edit"))}if(this.onRefresh){this.onRefresh()}else{if(this.onLoad){this.onLoad()}}this.callback("onHideEdit")},getValue:function(A){if(typeof this.data[A]!="undefined"){return this.data[A]}if(this.environment&&this.environment.getData){var B=this.environment.getData(A);if(B=="null"){B=null}this.data[A]=B;return B}return null},getInt:function(A){var B=this.getValue(A);if(B=="true"||B==true){B=1}B=parseInt(B,10);return isNaN(B)?0:B},getBool:function(A){return this.getInt(A)?true:false},setValue:function(B,C){if(this.data[B]==C){return C}this.data[B]=C;var A=this.getPreference(B);if(this.environment&&this.environment.setData){this.environment.setData(B,C)}return C},deleteValue:function(A){delete this.data[A];if(this.environment&&this.environment.deleteData){return this.environment.deleteData(A)}},saveValues:function(A){if(this.environment&&this.environment.saveDatas&&this.readOnly==false){this.environment.saveDatas(A)}else{A()}},log:function(A){if(this.debugMode===true){UWA.log(A)}},setPeriodical:function(B,C,A,D){this.clearPeriodical(B);this.periodicals[B]=setInterval(C.bind(this),A);if(D){C()}},clearPeriodical:function(A){if(this.periodicals[A]){clearInterval(this.periodicals[A])}},callback:function(B,A,D){if(typeof D=="undefined"){D=this}try{if(this[B]){this[B].apply(D,[A])}if(this.callbacks[B]){this.callbacks[B].apply(D,[A])}}catch(C){UWA.log(C)}if(this.environment&&this.environment.callback){this.environment.callback(B)}},setCallback:function(A,B){this.callbacks[A]=B},setMetas:function(A){this.metas=A;if(this.metas.debugMode){this.setDebugMode(this.metas.debugMode)}if(this.metas.autoRefresh){this.setAutoRefresh(this.metas.autoRefresh)}},setDebugMode:function(A){if(A===true||A=="true"){this.debugMode=true}else{this.debugMode=false}},setInline:function(A){UWA.log("widget.setInline is deprecated");if(A){this.inline=true}else{this.inline=false}},setAutoRefresh:function(B){var A=Math.round(10*1000*Math.random());B=parseInt(B);if(this.onRefresh&&B&&B>0){B=B*1000*60;this.setPeriodical("autoRefresh",this.onRefresh,B+A)}},setMetasXML:function(D){var E=[];for(var B=0;B<D.length;B++){if(D[B].name){var A=D[B].name}else{var A=D[B].attributes[0]["nodeValue"]}if(D[B].content){var C=D[B].content}else{var C=D[B].attributes[1]["nodeValue"]}if(C=="false"){C=false}else{if(C=="true"){C=true}}E[A]=C}this.setMetas(E)},setStyle:function(A){if(typeof A=="string"){UWA.Utils.setCss(this.id,A)}},setCSS:function(A){UWA.log("widget.setCSS is deprecated. Use widget.setStyle instead.");UWA.Utils.setCss(this.id,A)},setTemplate:function(C){UWA.log("setTemplate:"+C.name);var B=C.name;var A=new UWA.Templates[B](this);A.createFromJSON(C)},setFeeds:function(A){if(typeof UWA.Feeds=="undefined"){UWA.Feeds={}}for(key in A){UWA.Feeds[key]=A[key]}},setSearchResultCount:function(A){this.searchResultCount=A;if(this.environment.setSearchResultCount){this.environment.setSearchResultCount(A)}},setUnreadCount:function(A){this.unreadCount=A;if(this.environment&&this.environment.setUnreadCount){this.environment.setUnreadCount(A)}},openURL:function(A){if(this.environment&&this.environment.openURL){this.environment.openURL(A)}else{window.open(A)}},getHistory:function(){if(this.environment&&this.environment.getHistory){return this.environment.getHistory()}else{return this.getValue("history")}},setHistory:function(A){if(this.environment&&this.environment.setHistory){this.environment.setHistory(A)}else{this.setValue("history",A)}},saveHistory:function(){if(this.environment&&this.environment.saveHistory){this.environment.saveHistory()}},addStar:function(A){if(this.environment&&this.environment.addStar){this.environment.addStar(A)}},launch:function(){this.initPreferences();this.callback("onLoad")}};UWA.Module=UWA.Widget;;
UWA.Feed=Class.create();UWA.Feed.prototype={defaultOptions:{bufferItemMaxLen:20},setOptions:function(A){if(!this.options){this.options=UWA.extend({},this.defaultOptions)}this.options=UWA.extend(this.options,A)},initialize:function(A){this.setOptions(A);this.id=A.feedId;this.data={};if(A.data){this.id=A.data.feeds[0].id;this.checkResponse(A.data)}},feedApiRequest:function(C,D){var B="http://"+NV_HOST+NV_API_PATH+"/feed"+C;var A=(C.indexOf("?")!=-1)?"&":"?";B+=A+"format=json";if(window.location.hostname.test(".local")){UWA.Data.getJson(B,D)}else{B=B.split("?");UWA.Data.request(B[0],{method:"POST",type:"json",onComplete:D,parameters:B[1]})}},load:function(B){var B=B||{};var C=true;var A="/"+this.id;if(this.options.secure){A="/module/"+this.options.moduleId}if(B.checkOnly){A+="/info"}if(B.last_update){A+="?updatedAfter="+B.last_update;C=false}else{if(B.published_before){A+="?publishedBefore="+B.published_before;C=false}}var D=(A.indexOf("?")>0)?"&":"?";A+=D+"limit="+this.options.bufferItemMaxLen;if(C&&UWA.Feeds&&UWA.Feeds[this.id]){this.checkResponse(UWA.Feeds[this.id],B);var E=this.id;window.setTimeout(function(){UWA.Feeds[E]=null},15000)}else{this.feedApiRequest(A,this.checkResponse.bindAsEventListener(this,B))}},getUpdates:function(D,C,B){if(!B){var A={callback:D,last_update:this.getInfo().last_update,checkOnly:C};this.load(A)}else{this.checkResponse(B.result,{callback:D,last_update:B.last_update,checkOnly:C})}},getNextChunk:function(B){var A={callback:B,published_before:this.getLastItemId()};this.load(A)},checkResponse:function(C,B){if(!B){B={}}var A={};if(typeof C!="undefined"&&C.feeds&&C.feeds[0].error){if(B.callback){this.error=C.feeds[0];B.callback(C.feeds[0])}return }if(B.last_update){if(!B.checkOnly){this.addItems(C.items,"before");this.data.feeds[0].next_update=C.feeds[0].next_update;this.data.feeds[0].item_count=C.feeds[0].item_count}A.update={amount:(C.items)?C.items.length:C.feeds[0].new_item_count,checkOnly:B.checkOnly}}else{if(B.published_before){this.addItems(C.items,"after");A.addedItem=C.items.length}else{this.data=UWA.extend(this.data,C);this.ownerURL=this.getLink()||"";if(this.ownerURL.charAt(this.ownerURL.length-1)==="/"){this.ownerURL=this.ownerURL.substr(0,this.ownerURL.length-1)}this.feedSiteURLDomain=this.ownerURL.substring(0,this.ownerURL.indexOf("/",7));if(!this.feedSiteURLDomain){this.feedSiteURLDomain=this.ownerURL}}}this.error=null;this.getItemsEnclosures();A.data=this.data;if(B.callback){B.callback(A)}},addItems:function(C,D){if(!C||C.length==0){return }var A=this.getItems();if(D=="before"){UWA.log("(FEEDID: "+this.id+") adding "+C.length+" items at the begining of the list (update)");for(var E=C.length-1;E>=0;E--){var F=this.retrieveItemEnclosures(C[E]);A.unshift(F)}}else{if(D=="after"){UWA.log("(FEEDID: "+this.id+") adding "+C.length+" items at the end of the list");for(var E=0,B=C.length;E<B;E++){var F=this.retrieveItemEnclosures(C[E]);A.push(F)}}}this.getInfo().last_update=F.updated_at;this.itemsSetIndexes()},isSecure:function(){return(this.getInfo().secure===1)},getItem:function(A){var B=this.getItems()[A];return B},getItemByGuid:function(C){var B=this.getItems();for(var D=0,A=B.length;D<A;D++){var E=B[D];if(E.guid==C){return E}}return null},getUnread:function(){var C=this.getInfo().flags;var B=(C&&C.read)?C.read:0;var A=this.getInfo().item_count-B;return(A>=0)?A:0},setUnread:function(A){var B=this.getInfo();if(!B.flags){B.flags={}}B.flags.read=A},isItemRead:function(A){var B=this.getItem(A);return(B.flags&&B.flags.read)?true:false},setItemFlag:function(A){var C=(typeof A.save!="undefined")?A.save:true;var B=this.getItem(A.index);if(!B.flags){B.flags={}}if(A.value&&A.value!==false){B.flags[A.flag]=A.value}else{delete B.flags[A.flag]}if(C){var D=(A.value&&A.value!==false)?"flag":"unflag";this.feedApiRequest("/"+this.id+"/item/"+B.id+"/"+D+"/"+A.flag)}if(this.shouldMigrate&&this.options.moduleId){this.feedApiRequest("/module/"+this.options.moduleId+"/migrate/");this.shouldMigrate=false}},setItemRead:function(A,B){if(this.isItemRead(A)){return }this.setItemFlag({index:A,flag:"read",value:Math.ceil(new Date().getTime()/1000),save:B});var C=this.getInfo();if(!C.flags){C.flags={read:0}}C.flags.read++},setItemUnread:function(A,B){if(!this.isItemRead(A)){return }this.setItemFlag({index:A,flag:"read",value:false,save:B});var C=this.getInfo();if(!C.flags){C.flags={read:0}}C.flags.read--},setAllItemsReadState:function(F,E){if(typeof E==="undefined"){E=true}var B=this.getItems();for(var D=0,A=B.length;D<A;D++){this[(F)?"setItemRead":"setItemUnread"](D,false)}this.setUnread((F)?this.getInfo().item_count:0);var C="/"+this.id+"/"+((F)?"flag":"unflag")+"/read";if(F){C+="?updatedBefore="+parseInt(this.getItem(0).date,10)+1}if(E){this.feedApiRequest(C)}},setAllItemsRead:function(A){this.setAllItemsReadState(true,A)},setAllItemsUnread:function(A){this.setAllItemsReadState(false,A)},getInfo:function(){this.data.feeds[0].dir||"ltr";return this.data.feeds[0]},getTitle:function(){return this.getInfo().title},getUrl:function(){return this.getInfo().url},getLink:function(){return this.getInfo().link},getItemsLength:function(){return this.getItems().length},getItems:function(){if(!this.data.items[0].__index){this.itemsSetIndexes()}return this.data.items},itemsSetIndexes:function(){var B=this.data.items.length;if(B>0){for(var A=0;A<B;A++){this.data.items[A].__index=A}}},getLastItemId:function(){return this.getItem(this.getItemsLength()-1).id},getItemsEnclosures:function(){for(var B=0,A=this.getItemsLength();B<A;B++){var C=this.getItem(B);this.retrieveItemEnclosures(C)}},getError:function(){if(this.error){var A=this.error;A.message=_("Looks like this feed is not valid or currently not responding.");A.type="error";return A}else{return false}},shouldIgnoreEnclosures:function(){if(this._ignoreEnclosures){return this._ignoreEnclosures}var B=this.getUrl();var E=[".flickr.[a-zA-Z]+/"];for(var C=0,A=E.length;C<A;C++){var D=new RegExp(E[C],"i");if(D.test(B)){this._ignoreEnclosures=true;return true}}this._ignoreEnclosures=false;return false},retrieveItemEnclosures:function(B){if(B.__parsedEnclosures){return B}if(typeof B.enclosures==="object"){B.enclosures.each(function(G){if(G.url!==""){if(/^image\/(jpeg|gif|jpg|bmp|png)$/.test(G.type)){B.thumbnail=G.url}else{B.podcast=true;B.mediaUrl=G.url}if(/^audio\/mpeg$/.test(G.type)||/\.mp3$/.test(G.url)){B.playable=true}}})}if(!B.thumbnail||this.shouldIgnoreEnclosures()){var F=B.content;F=F.replace(/src="http:\/\/[^"]+\/(~[rfa]{1,2}|ads)\/[^"]+/mg,"");F=F.replace(/src=('|")?http:\/\/feedads\.[^\/]+\/[^'" ]+/mg,"");var C=/<img[^>]*src=('|")?\s*(.*?)\s*('|"|\s*?\/?>|>| )[^>]*/i.exec(F);if(C){var A=/width=('|")?\s*(\d+)/i.exec(C[0]);var E=/height=('|")?\s*(\d+)/i.exec(C[0]);if(!((A&&A[2]<10)||(E&&E[2]<10))){B.thumbnail=C[2].replace(/<\/?[^>]+>/gi," ")}}if(this.options.removeImagePattern&&B.thumbnail){if(B.thumbnail.match(new RegExp(this.options.removeImagePattern))){B.thumbnail=""}}}if(B.thumbnail){B.thumbnail=B.thumbnail.trim();if(B.thumbnail.substring(0,4)!=="http"&&this.options.feedSiteUrlDomain!==""){var D=B.thumbnail.substring(0,1)=="/"?"":"/";B.thumbnail=this.options.feedSiteUrlDomain+D+B.thumbnail}}if(this.options.allowVideoPlayButton&&B.video){B.watchable=true}else{B.watchable=false}B.__parsedEnclosures=true;return B}};UWA.Feed.Utils={};UWA.Feed.Utils.getRelativeDate=function(B){var C=parseInt(B,10);var A=C*1000;var E=new Date().getTime()-A;if(E<0){return _("right now")}E/=1000;var D={};D.sec=Math.floor(E);D.min=Math.floor(E/60);D.hour=Math.floor(E/3600);D.day=Math.floor(E/86400);D.week=Math.floor(D.day/7);D.month=Math.floor(D.day/30);D.year=Math.floor(D.day/365);var F;if(D.year==1){F=_("{0} year ago").format(D.year)}else{if(D.year>1){F=_("{0} years ago").format(D.year)}else{if(D.month==1){F=_("{0} month ago").format(D.month)}else{if(D.month>1){F=_("{0} months ago").format(D.month)}else{if(D.week==1){F=_("{0} week ago").format(D.week)}else{if(D.week>1){F=_("{0} weeks ago").format(D.week)}else{if(D.day==1){F=_("yesterday")}else{if(D.day>1){F=_("{0} days ago").format(D.day)}else{if(D.hour==1){F=_("{0} hour ago").format(D.hour)}else{if(D.hour>1){F=_("{0} hours ago").format(D.hour)}else{if(D.min==1){F=_("{0} minute ago").format(D.min)}else{if(D.min>1){F=_("{0} minutes ago").format(D.min)}else{if(D.sec==1){F=_("{0} second ago").format(D.sec)}else{if(D.sec>1){F=_("{0} seconds ago").format(D.sec)}}}}}}}}}}}}}}return F};UWA.Feed.Utils.subscribe=function(B,A){UWA.Feed.Utils.request("/subscribe?url="+encodeURIComponent(B),A)};UWA.Feed.Utils.setTabFeedsReadState=function(A,B,C){UWA.Feed.Utils.request("s/tab/"+A+"/"+((B)?"flag":"unflag")+"/read")};UWA.Feed.Utils.multiGet=function(B){var A="s/?merged="+((B.merged)?"true":"false")+"&feedIds="+B.feedIds.join(",");if(B.moduleIds.length>0){A+="&moduleIds="+B.moduleIds.join(",")}if(B.updatedAfter){A+="&updatedAfter="+B.updatedAfter}UWA.Feed.Utils.request(A,B.callback)};UWA.Feed.Utils.request=function(A,B){UWA.Feed.prototype.feedApiRequest(A,function(C){if(B){B(C)}})};UWA.Feed.Utils.cleanContentElement=function(I,A){var C=function(L,M,N){if(typeof N==="undefined"){N=false}var K=L.getAttribute(M);if(K===null||K.indexOf("http://")===0||K.indexOf("https://")===0||(N&&K.indexOf("mailto:")===0)){return }if(Browser.isIE&&(K.indexOf("http://"+NV_HOST)===0)){L.setAttribute(M,K.replace("http://"+NV_HOST,I.feedSiteURLDomain))}if(K.substring(0,1)==="/"){L.setAttribute(M,I.feedSiteURLDomain+K);return }if(App.FeedReader.ownerURL.substring(0,1)==="/"){L.setAttribute(M,I.ownerURL+K);return }L.setAttribute(M,I.ownerURL+"/"+K)};var E=A.getElementsByTagName("img");for(var G=0,F=E.length;G<F;G++){E[G].onload=function(){if(this.currentStyle){if(this.currentStyle.width){this.style.width=this.currentStyle.width}if(this.currentStyle.height){this.style.height=this.currentStyle.height}}};C(E[G],"src")}var B=A.getElementsByTagName("script");var F=B.length;for(var G=0,F=B.length;G<F;G++){B[G].parentNode.removeChild(B[G])}var J=A.getElementsByTagName("style");var F=J.length;for(var G=0,F=J.length;G<F;G++){J[G].parentNode.removeChild(J[G])}var H=A.getElementsByTagName("a");for(var G=0,F=H.length;G<F;G++){var D=H[G].firstChild;if(D){if(D.nodeType==1){if(D.nodeName=="IMG"||D.nodeName=="img"){H[G].className="noBottomLine"}}}C(H[G],"href",true);H[G].setAttribute("target","_blank")}return A};UWA.Feed.Utils.addMediaButtons=function(J,H,K){var D={acceptedMedia:["image","audio","video"],allowDownload:true};if(!K){K=D}if(J.enclosures){for(var I=0,G=J.enclosures.length;I<G;I++){var F=J.enclosures[I];var C=F.url;if(F.type.indexOf("image/")===0&&K.acceptedMedia.contains("image")){if(H.innerHTML.toLowerCase().indexOf(C.toLowerCase())<0){var A=new Element("div",{"class":"photofeed autoclear",html:'<img src="'+C+'" />'})}}else{if(F.type.indexOf("audio/")===0&&K.acceptedMedia.contains("audio")){var A=new Element("div",{"class":"podcast autoclear"});var E="";E+="<ul>";E+='   <li class="listen">';E+='       <a href="'+C+'" target="_blank"><span>'+_("LISTEN")+"</span></a>";E+="   </li>";if(K.allowDownload){E+='   <li class="download">';E+='       <a href="'+C+'" target="_blank"><span>'+_("DOWNLOAD")+"</span></a>";E+="   </li>"}E+="</ul>";A.set("html",E)}else{if(F.type.indexOf("video/"===0)&&K.acceptedMedia.contains("video")){var A=new Element("div",{"class":"videopodcast autoclear"});var B={width:320,height:270};var E="";E+='<obj classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" style="width: '+B.width+"px; height: "+B.height+'px;">';E+='   <param name="src" value="'+C+'" />';E+='   <param name="controller" value="true" />';E+='   <param name="autoplay" value="false" />';E+='   <embed width="'+B.width+'" height="'+B.height+'" style="width: '+B.width+"px; height: "+B.height+'px;" pluginspage="http://www.apple.com/quicktime/download/" src="'+C+'" controller="true" scale="TOFIT" autoplay="false" type="video/quicktime" />';E+="</obj>";A.set("html",E)}}}if(A){A.inject(H,"top")}}}};;
UWA.Utils={buildUrl:function(A,G){var C=A.split("://");var B=C[0];var E=C[1];var H=E.split("/");var D=H[0];var F="";for(i=1;i<H.length-1;i++){F+="/"+H[i]}if(G.split("://").length>1){return false}else{if(G.substring(0,1)=="/"){return B+"://"+D+G}else{return B+"://"+D+F+"/"+G}}},setTooltip:function(A,C,B){if(window.App&&App.toolTip){new App.toolTip(A,C,B,"left")}return false},setCss:function(F,D,C){if(typeof C=="undefined"){var C=(F&&F!=""?"#m_"+F:"")}var E="css_"+F;if(!$(E)){var B=document.createElement("style");B.setAttribute("id",E);B.setAttribute("type","text/css");var A=document.getElementsByTagName("head").item(0);A.appendChild(B)}D="\n"+D+"\n";D=D.replace(/,/g,",\n");D=D.replace(/#moduleContent/g,"");D=D.replace(/#container/g,"");D=D.replace(/\n\s*([a-zA-z0-9\.\-, :#]*)\s*([{|,])/g,"\n"+C+" $1$2");if($(E).styleSheet){$(E).styleSheet.cssText=D}else{$(E).appendChild(document.createTextNode(D))}},isArray:function(A){return !(A.constructor.toString().indexOf("Array")==-1)},splat:function(A){if(!A){return[]}return UWA.Utils.isArray(A)?A:[A]}};;
UWA.Client={Engine:{name:"unknown",version:""},Platform:{},features:{}};UWA.Client.features.xhr=!!(window.XMLHttpRequest);UWA.Client.features.xpath=!!(document.evaluate);if(window.opera){UWA.Client.Engine.name="opera"}else{if(window.ActiveXObject){UWA.Client.Engine={name:"ie",version:(UWA.Client.features.xhr)?7:6}}else{if(!navigator.taintEnabled){UWA.Client.Engine={name:"webkit",version:(UWA.Client.features.xpath)?420:419}}else{if(document.getBoxObjectFor!=null){UWA.Client.Engine.name="gecko"}}}}UWA.Client.Engine[UWA.Client.Engine.name]=UWA.Client.Engine[UWA.Client.Engine.name+UWA.Client.Engine.version]=true;var platform=navigator.platform.match(/(mac)|(win)|(linux)|(nix)/i)||["Other"];UWA.Client.Platform.name=platform[0].toLowerCase();UWA.Client.Platform[UWA.Client.Platform.name]=true;if(typeof Browser=="undefined"){var Browser={}}if(UWA.Client.Engine.ie){Browser.isIE=true}else{Browser.isIE=false}if(UWA.Client.Engine.opera){Browser.isOpera=true}else{Browser.isOpera=false};;
UWA.merge(UWA.Utils,{parseFeed:function(feed){var is_xml=false,is_json=false;if(typeof feed.getResponseHeader=="function"||typeof feed.getResponseHeader=="unknown"){if(feed.getResponseHeader("Content-type").substr(0,8)=="text/xml"){is_xml=true}}else{if(typeof feed.responseJson=="object"&&(feed.responseJson.nvFeed==1||feed.responseJson.error==1)){is_json=true}else{if(typeof feed.responseText!="undefined"&&feed.responseText.substr(0,1)=="<"){is_xml=true}}}if(is_xml){newFeed=UWA.Utils.parseXmlFeed(feed)}else{if(is_json){newFeed=feed.responseJson}else{if(feed.responseText!=""){try{eval("newFeed = "+feed.responseText)}catch(e){UWA.log(e);return false}}else{return false}}}delete feed;feed=null;var result={};for(var i in newFeed){if(typeof newFeed.hasOwnProperty!="string"&&!newFeed.hasOwnProperty(i)){continue}result[i]=newFeed[i]}delete newFeed;newFeed=null;return result},crc32:function(F,E){if(typeof E=="undefined"){E=0}var D="00000000 77073096 EE0E612C 990951BA 076DC419 706AF48F E963A535 9E6495A3 0EDB8832 79DCB8A4 E0D5E91E 97D2D988 09B64C2B 7EB17CBD E7B82D07 90BF1D91 1DB71064 6AB020F2 F3B97148 84BE41DE 1ADAD47D 6DDDE4EB F4D4B551 83D385C7 136C9856 646BA8C0 FD62F97A 8A65C9EC 14015C4F 63066CD9 FA0F3D63 8D080DF5 3B6E20C8 4C69105E D56041E4 A2677172 3C03E4D1 4B04D447 D20D85FD A50AB56B 35B5A8FA 42B2986C DBBBC9D6 ACBCF940 32D86CE3 45DF5C75 DCD60DCF ABD13D59 26D930AC 51DE003A C8D75180 BFD06116 21B4F4B5 56B3C423 CFBA9599 B8BDA50F 2802B89E 5F058808 C60CD9B2 B10BE924 2F6F7C87 58684C11 C1611DAB B6662D3D 76DC4190 01DB7106 98D220BC EFD5102A 71B18589 06B6B51F 9FBFE4A5 E8B8D433 7807C9A2 0F00F934 9609A88E E10E9818 7F6A0DBB 086D3D2D 91646C97 E6635C01 6B6B51F4 1C6C6162 856530D8 F262004E 6C0695ED 1B01A57B 8208F4C1 F50FC457 65B0D9C6 12B7E950 8BBEB8EA FCB9887C 62DD1DDF 15DA2D49 8CD37CF3 FBD44C65 4DB26158 3AB551CE A3BC0074 D4BB30E2 4ADFA541 3DD895D7 A4D1C46D D3D6F4FB 4369E96A 346ED9FC AD678846 DA60B8D0 44042D73 33031DE5 AA0A4C5F DD0D7CC9 5005713C 270241AA BE0B1010 C90C2086 5768B525 206F85B3 B966D409 CE61E49F 5EDEF90E 29D9C998 B0D09822 C7D7A8B4 59B33D17 2EB40D81 B7BD5C3B C0BA6CAD EDB88320 9ABFB3B6 03B6E20C 74B1D29A EAD54739 9DD277AF 04DB2615 73DC1683 E3630B12 94643B84 0D6D6A3E 7A6A5AA8 E40ECF0B 9309FF9D 0A00AE27 7D079EB1 F00F9344 8708A3D2 1E01F268 6906C2FE F762575D 806567CB 196C3671 6E6B06E7 FED41B76 89D32BE0 10DA7A5A 67DD4ACC F9B9DF6F 8EBEEFF9 17B7BE43 60B08ED5 D6D6A3E8 A1D1937E 38D8C2C4 4FDFF252 D1BB67F1 A6BC5767 3FB506DD 48B2364B D80D2BDA AF0A1B4C 36034AF6 41047A60 DF60EFC3 A867DF55 316E8EEF 4669BE79 CB61B38C BC66831A 256FD2A0 5268E236 CC0C7795 BB0B4703 220216B9 5505262F C5BA3BBE B2BD0B28 2BB45A92 5CB36A04 C2D7FFA7 B5D0CF31 2CD99E8B 5BDEAE1D 9B64C2B0 EC63F226 756AA39C 026D930A 9C0906A9 EB0E363F 72076785 05005713 95BF4A82 E2B87A14 7BB12BAE 0CB61B38 92D28E9B E5D5BE0D 7CDCEFB7 0BDBDF21 86D3D2D4 F1D4E242 68DDB3F8 1FDA836E 81BE16CD F6B9265B 6FB077E1 18B74777 88085AE6 FF0F6A70 66063BCA 11010B5C 8F659EFF F862AE69 616BFFD3 166CCF45 A00AE278 D70DD2EE 4E048354 3903B3C2 A7672661 D06016F7 4969474D 3E6E77DB AED16A4A D9D65ADC 40DF0B66 37D83BF0 A9BCAE53 DEBB9EC5 47B2CF7F 30B5FFE9 BDBDF21C CABAC28A 53B39330 24B4A3A6 BAD03605 CDD70693 54DE5729 23D967BF B3667A2E C4614AB8 5D681B02 2A6F2B94 B40BBE37 C30C8EA1 5A05DF1B 2D02EF8D";var G=0;var A=0;E=E^(-1);for(var C=0,B=F.length;C<B;C++){G=(E^F.charCodeAt(C))&255;A="0x"+D.substr(G*9,8);E=(E>>>8)^A}return E^(-1)},baseConvert:function(G,H,F){var A=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];var I=G.toString().toLowerCase();var C=1;var E=0;for(i=I.length-1;i>=0;i--){b=I.charCodeAt(i);if(b>=48&&b<=57){b-=48}else{if(b>=97&&b<=122){b-=97-10}}E+=b*C;C*=H}var D="";var B=0;while(E>0){B=E%F;E=Math.floor(E/F);D=A[B]+""+D}return D},parseXmlFeed:function(C){var H={};if(C.responseText==""||C.responseXML.documentElement==null||C.responseXML.documentElement.nodeName=="parsererror"){H.error=true;return H}var E=C.responseXML.documentElement;H.type=(E.nodeName=="feed")?1:0;var N=(H.type==1)?E:E.getElementsByTagName("channel")[0];var X=N.getAttribute("xml:lang");if(typeof X!="undefined"&&X){H.lang=X}var D=UWA.Utils.getChildrenByTagName(N,"link");if(H.type==1){for(var R=0;R<D.length;R++){if(D[R].getAttribute("type")=="text/html"||D.length==1){H.htmlUrl=D[R].getAttribute("href")}}}else{H.htmlUrl=(D&&D[0]&&D[0].firstChild)?D[0].firstChild.nodeValue:""}var W=UWA.Utils.getChildrenByTagName(N,"title")[0];H.title=(W&&W.firstChild)?W.firstChild.nodeValue:H.htmlUrl;var T=(H.type==1)?E.getElementsByTagName("tagline"):E.getElementsByTagName("description");H.description=(T&&T.length>0)?((T[0].firstChild)?T[0].firstChild.nodeValue:""):"";if(typeof H.lang=="undefined"||!H.lang){var X=E.getElementsByTagName("language");X=(X&&X.length>0)?((X[0].firstChild)?X[0].firstChild.nodeValue:""):"";if(typeof X!="undefined"&&X.length>0){H.lang=X}}if(typeof H.lang!="undefined"){if(/^(ar|he|fa|ur|ps|dv|yi|iw)\-?[a-z]{0,2}$/i.test(H.lang)){H.dir="rtl"}}H.items=[];var K=(H.type==1)?E.getElementsByTagName("entry"):E.getElementsByTagName("item");var G=K.length;for(var R=0;R<G;R++){var I={};obj_enclosures=[];var O=K[R].getElementsByTagName("enclosure");for(var Q=0;Q<O.length;Q++){var J=O[Q].getAttribute("type");if(/audio/.test(J)){}else{if(/video/.test(J)){}else{if(/image/.test(J)){}else{if(/x-shockwave-flash/.test(J)){}else{if(/x-flv/.test(J)){}else{continue}}}}}var B=O[Q].getAttribute("url");if(J==""){if(strpos(B,".mp3")!==false){J="audio/mpeg"}}if(J==""){continue}obj_enclosures.push({type:J,url:B})}if(obj_enclosures.length>0){I.enclosures=obj_enclosures}var W=UWA.Utils.getChildrenByTagName(K[R],"title")[0];if(W&&W.firstChild){if(W.firstChild.nextSibling){I.title=W.firstChild.nextSibling.nodeValue}else{I.title=W.firstChild.nodeValue}}else{var U=K[R].getElementsByTagName("description");if(U[0]&&U[0].firstChild){var V=document.createElement("div");V.innerHTML=U[0].firstChild.nodeValue;I.title=((V.innerText)?V.innerText.substring(0,50).stripTags():"")+"..."}else{I.title="[...]"}}var F=UWA.Utils.getElementsByTagNameNS(K[R],"*","date")[0];if(K[R].getElementsByTagName("pubDate")[0]){I.date=(K[R].getElementsByTagName("pubDate")[0].firstChild)?K[R].getElementsByTagName("pubDate")[0].firstChild.nodeValue:""}else{if(F){I.date=F.firstChild.nodeValue}else{if(K[R].getElementsByTagName("issued")[0]){I.date=K[R].getElementsByTagName("issued")[0].firstChild.nodeValue}}}var S=UWA.Utils.getElementsByTagNameNS(K[R],"*","thumbnail")[0];if(S){I.thumbnail=S.getAttribute("url")}var D=UWA.Utils.getChildrenByTagName(K[R],"link");if(D.length>0){if(H.type==1){for(var Q=0;Q<D.length;Q++){if(D[Q].getAttribute("type")=="text/html"||D.length==1){I.link=D[Q].getAttribute("href")}}}else{if(D[0]||D[0].firstChild){I.link=(D[0].firstChild)?D[0].firstChild.nodeValue:""}}}else{if(H.type==0){if(K[R].getElementsByTagName("guid").length>0&&K[R].getElementsByTagName("guid")[0].firstChild){I.link=K[R].getElementsByTagName("guid")[0].firstChild.nodeValue}}}if(!I.link){I.link=H.htmlUrl}if(I.link!=""&&I.link!=H.htmlUrl){I.id_old=I.link}else{I.id_old=I.title+I.date+I.link}I.id_old=I.id_old.replace(/([^0-9a-zA-Z])/g,"");I.id_old=this.baseConvert(this.crc32(I.id_old),16,36);var A=K[R].getElementsByTagName("guid");if(A.length>0&&A[0].firstChild){I.id=A[0].firstChild.nodeValue;I.id_old=I.id.replace(/([^0-9a-zA-Z])/g,"")}if(!I.id){var L=K[R].getElementsByTagName("id");if(L.length>0&&L[0].firstChild){I.id=L[0].firstChild.nodeValue}}if(!I.id){I.id=I.title+I.date}I.id=this.baseConvert(this.crc32(I.id),16,36);if(H.type==1){var P=K[R].getElementsByTagName("content")[0];var T=K[R].getElementsByTagName("summary")[0]}else{var P=UWA.Utils.getElementsByTagNameNS(K[R],"*","encoded")[0];var T=K[R].getElementsByTagName("description")[0]}contentValue="";if(P&&P.hasChildNodes()){for(var M=P.firstChild;M!=null;M=M.nextSibling){if(M.innerHTML){contentValue+=M.innerHTML}else{if(M.nodeValue){contentValue+=M.nodeValue}}}}else{if(T&&T.hasChildNodes()){for(var M=T.firstChild;M!=null;M=M.nextSibling){if(M.innerHTML){contentValue+=M.innerHTML}else{if(M.nodeValue){contentValue+=M.nodeValue}}}}}I.content=contentValue;H.items.push(I)}return H},getChildrenByTagName:function(D,B){var C=(D&&D.childNodes)?D.childNodes.length:0;var A=[];for(var E=0;E<C;E++){if(D.childNodes[E].nodeName==B){A.push(D.childNodes[E])}}return A},getElementsByTagNameNS:function(F,E,A){var G=[];if(F.getElementsByTagNameNS){G=F.getElementsByTagNameNS(E,A)}else{var D=F.getElementsByTagName("*");var C,H;for(var B=0;B<D.length;++B){C=D[B];H=(C.prefix)?(C.prefix+":"+A):A;if((A=="*")||(H==C.nodeName)){if((E=="*")||(E==C.namespaceURI)){G.push(C)}}}}return G}});var Feed=function(B,A){return UWA.Utils.parseFeed(B)};if(typeof Utils=="undefined"){Utils={}}Utils.getChildrenByTagName=UWA.Utils.getChildrenByTagName;Utils.getElementsByTagNameNS=UWA.Utils.getElementsByTagNameNS;;
if(typeof deconcept=="undefined"){var deconcept={}}if(typeof deconcept.util=="undefined"){deconcept.util={}}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil={}}deconcept.SWFObject=function(E,C,K,F,H,J,L,G,A,D){if(!document.getElementById){return }this.DETECT_KEY=D?D:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params={};this.variables={};this.attributes=[];if(E){this.setAttribute("swf",E)}if(C){this.setAttribute("id",C)}if(K){this.setAttribute("width",K)}if(F){this.setAttribute("height",F)}if(H){this.setAttribute("version",new deconcept.PlayerVersion(H.toString().split(".")))}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs)};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true}}if(J){this.addParam("bgcolor",J)}var B=L?L:"high";this.addParam("quality",B);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var I=(G)?G:window.location;this.setAttribute("xiRedirectUrl",I);this.setAttribute("redirectUrl","");if(A){this.setAttribute("redirectUrl",A)}};deconcept.SWFObject.prototype={useExpressInstall:function(A){this.xiSWFPath=!A?"expressinstall.swf":A;this.setAttribute("useExpressInstall",true)},setAttribute:function(A,B){this.attributes[A]=B},getAttribute:function(A){return this.attributes[A]||""},addParam:function(A,B){this.params[A]=B},getParams:function(){return this.params},addVariable:function(A,B){this.variables[A]=B},getVariable:function(A){return this.variables[A]||""},getVariables:function(){return this.variables},getVariablePairs:function(){var A=[];var B;var C=this.getVariables();for(B in C){A[A.length]=B+"="+C[B]}return A},getSWFHTML:function(){var D="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath)}D='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+(this.getAttribute("style")||"")+'"';D+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var C=this.getParams();for(var A in C){D+=[A]+'="'+C[A]+'" '}var B=this.getVariablePairs().join("&");if(B.length>0){D+='flashvars="'+B+'"'}D+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath)}D='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+(this.getAttribute("style")||"")+'">';D+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var C=this.getParams();for(var A in C){D+='<param name="'+A+'" value="'+C[A]+'" />'}var B=this.getVariablePairs().join("&");if(B.length>0){D+='<param name="flashvars" value="'+B+'" />'}D+="</object>"}return D},write:function(A){if(this.getAttribute("useExpressInstall")){var B=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(B)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title)}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var C=(typeof A=="string")?document.getElementById(A):A;C.innerHTML=this.getSWFHTML();return true}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}return false}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var C=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var A=navigator.plugins["Shockwave Flash"];if(A&&A.description){C=new deconcept.PlayerVersion(A.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var D=1;var B=3;while(D){try{B++;D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+B);C=new deconcept.PlayerVersion([B,0,0])}catch(E){D=null}}}else{try{var D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(E){try{var D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");C=new deconcept.PlayerVersion([6,0,21]);D.AllowScriptAccess="always"}catch(E){if(C.major==6){return C}}try{D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(E){}}if(D!=null){C=new deconcept.PlayerVersion(D.GetVariable("$version").split(" ")[1].split(","))}}}return C};deconcept.PlayerVersion=function(A){this.major=A[0]!=null?parseInt(A[0]):0;this.minor=A[1]!=null?parseInt(A[1]):0;this.rev=A[2]!=null?parseInt(A[2]):0};deconcept.PlayerVersion.prototype.versionIsValid=function(A){if(this.major<A.major){return false}if(this.major>A.major){return true}if(this.minor<A.minor){return false}if(this.minor>A.minor){return true}if(this.rev<A.rev){return false}return true};deconcept.util={getRequestParameter:function(D){var C=document.location.search||document.location.hash;if(D==null){return C}if(C){var B=C.substring(1).split("&");for(var A=0;A<B.length;A++){if(B[A].substring(0,B[A].indexOf("="))==D){return B[A].substring((B[A].indexOf("=")+1))}}}return""}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var C=document.getElementsByTagName("OBJECT");for(var B=C.length-1;B>=0;B--){C[B].style.display="none";for(var A in C[B]){if(typeof C[B][A]=="function"){C[B][A]=function(){}}}}};if(!document.getElementById&&document.all){document.getElementById=function(A){return document.all[A]}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;;
UWA.Controls.PrefsForm=function(A){this.widget=A.module;this.displayButton=A.displayButton};UWA.Controls.PrefsForm.prototype.controls={};UWA.Controls.PrefsForm.prototype.controls["default"]=function(A){var B=this.widget.createElement("input",{id:"m_"+this.widget.id+"_"+A.name,type:"text",name:A.name,value:this.widget.getValue(A.name)||""});return B};UWA.Controls.PrefsForm.prototype.controls["boolean"]=function(A){var B=this.widget.createElement("input",{id:"m_"+this.widget.id+"_"+A.name,type:"checkbox",name:A.name});if(this.widget.getBool(A.name)===true){B.setAttribute("checked","checked");B.defaultChecked=true}if(A.onchange){B.onclick=(function(D){var C=(D.target||D.srcElement);if(C.checked==true){this.widget.setValue(A.name,"true")}else{this.widget.setValue(A.name,"false")}this.widget.callback(A.onchange)}).bindAsEventListener(this)}return B};UWA.Controls.PrefsForm.prototype.controls.password=function(A){var B=this.widget.createElement("input",{id:"m_"+this.widget.id+"_pass",type:"password",name:"pass",value:""});return B};UWA.Controls.PrefsForm.prototype.controls.textarea=function(A){var B=this.widget.createElement("textarea",{id:"m_"+this.widget.id+"_"+A.name,name:A.name}).setText(this.widget.getValue(A.name)||"");return B};UWA.Controls.PrefsForm.prototype.controls.range=function(B){var A=this.widget.createElement("select",{id:"m_"+this.widget.id+"_"+B.name,name:B.name});if(parseInt(B.step)>0){for(var C=parseInt(B.min);C<=parseInt(B.max);C+=parseInt(B.step)){var D=this.widget.createElement("option",{value:C}).setText(""+C);if(this.widget.getValue(B.name)==C){D.setAttribute("selected","selected")}A.appendChild(D)}}if(B.onchange){A.onchange=(function(F){var E=(F.target||F.srcElement);this.widget.setValue(B.name,E.value);this.widget.callback(B.onchange)}).bindAsEventListener(this)}return A};UWA.Controls.PrefsForm.prototype.controls.list=function(B){var A=this.widget.createElement("select",{id:"m_"+this.widget.id+"_"+B.name,name:B.name});for(var D=0;D<B.options.length;D++){var E=B.options[D];E.label=E.label||E.value;var C=this.widget.createElement("option").setText(E.label).inject(A);C.value=E.value;if(this.widget.getValue(B.name)==E.value){C.setAttribute("selected","selected")}}if(B.onchange){A.onchange=(function(G){var F=(G.target||G.srcElement);this.widget.setValue(B.name,F.value);this.widget.callback(B.onchange)}).bindAsEventListener(this)}return A};UWA.Controls.PrefsForm.prototype.build=function(){var F=this.widget;var A=this.form=F.createElement("form");var J=F.createElement("table").addClassName("formTable").setStyle("width","100%").inject(A);var E=F.createElement("tbody").inject(J);for(var D=0;D<F.preferences.length;D++){var K=F.preferences[D];if(K.type=="hidden"){continue}var G=F.createElement("tr").inject(E);var I=_((K.label||K.name)+":");var H=F.createElement("td").inject(G);var I=F.createElement("label",{"for":F.id+"_"+K.name}).setText(I).inject(H);if(typeof this.controls[K.type]=="undefined"){K.type="default"}var C=this.controls[K.type].bind(this)(K);F.createElement("td").setContent(C).inject(G)}if(typeof this.displayButton=="undefined"||this.displayButton===true){var G=F.createElement("tr").inject(E);var B=F.createElement("td",{colSpan:2}).inject(G);F.createElement("input",{type:"submit",value:_("Ok")}).addClassName("buttonClean").inject(B)}A.onsubmit=(function(){var L=(function(){this.callback("endEdit")}).bind(this.widget);this.saveValues();this.widget.saveValues(L);return false}).bindAsEventListener(this);return A};UWA.Controls.PrefsForm.prototype.getContent=UWA.Controls.PrefsForm.prototype.build;UWA.Controls.PrefsForm.prototype.saveValues=function(D){var F=this.widget;var E=D||this.form;var B=UWA.Form.getElements(E);for(var A=0;A<B.length;A++){var C=B[A];switch(C.type){case"submit":break;case"password":if(C.value!=""){F.setValue(C.name,C.value)}break;case"checkbox":if(C.checked){F.setValue(C.name,"true")}else{F.setValue(C.name,"false")}break;case"radio":if(C.checked){F.setValue(C.name,C.value)}break;default:F.setValue(C.name,C.value);break}}};;
if(typeof Netvibes=="undefined"||!Netvibes){var Netvibes={}}if(typeof Netvibes.DLA=="undefined"||!Netvibes.DLA){Netvibes.DLA={}}Netvibes.DLA.SearchForm=function(A){this.options={showCheckbox:false,allowEmpty:false,searchHistory:false};Object.extend(this.options,A||{});this._createForm()};Netvibes.DLA.SearchForm.prototype={setFavicon:function(A,B){this.favicon.src=A;if(typeof (B)!="undefined"){this.favicon.alt=this.favicon.title=B}},setSearchText:function(A){this.inputSearch.value=A;this.resetButton.style.visibility=this.inputSearch.value.length?"visible":"hidden";this.inputSearch.onblur()},setInitialState:function(A,C,B){this.setFavicon(A);this.inputSearch.value=C;this.resetButton.style.visibility=this.inputSearch.value.length?"visible":"hidden";if(typeof B!="undefined"&&this.checkbox){this.checkbox.checked=B}this.inputSearch.onblur()},hide:function(){Element.hide(this.form)},show:function(){Element.show(this.form)},observe:function(B,A){if(!this.observers){this.observers=[]}this.observers.push([B,A])},_notify:function(B){if(!this.observers){return }var A=this.inputSearch.value;this.observers.each(function(C){if(C[0]==B&&typeof (C[1])=="function"){C[1](A.stripTags(),this.checkbox?this.checkbox.checked:null)}})},eventReset:function(){this._notify("reset");this.inputSearch.value="";this.resetButton.style.visibility="hidden";this.inputSearch.onblur();return false},eventSubmit:function(){var A=this.inputSearch.value;if(A==""&&!this.options.allowEmpty){return this.eventReset()}this._notify("submit");this._addHistory(A);this.resetButton.style.visibility="visible";return false},eventToggle:function(){this._notify("toggle")},eventFocus:function(){this.submitButton.disabled="";this._notify("focus")},eventBlur:function(){if(this.options.searchHistory){setTimeout(this._hideHistory.bindAsEventListener(this),1000)}this._notify("blur")},eventClick:function(){if(this.options.searchHistory){this._toggleHistory()}},eventKeyPress:function(){if(this.options.searchHistory){this._hideHistory()}},_createForm:function(){this.container=document.createElement("div");this.container.className="search";this.form=document.createElement("form");this.form.style.display="block";if(!Browser.isIE){this.form.style.position="relative"}this.form.onsubmit=this.eventSubmit.bindAsEventListener(this);this.favicon=document.createElement("img");this.favicon.className="favicon";if(typeof this.options.faviconUrl!="undefined"){this.favicon.src=this.options.faviconUrl}this.inputSearch=document.createElement("input");this.inputSearch.className="search";this.inputSearch.type="text";this.inputSearch.value="";this.inputSearch.style.paddingRight="18px";this.inputSearch.onfocus=this.eventFocus.bindAsEventListener(this);this.inputSearch.onblur=this.eventBlur.bindAsEventListener(this);if(this.options.searchHistory){this.inputSearch.onclick=this.eventClick.bindAsEventListener(this);this.inputSearch.onkeypress=this.eventKeyPress.bindAsEventListener(this)}this.resetButton=document.createElement("img");this.resetButton.title=this.resetButton.alt=_("Clear");this.resetButton.src="http://"+NV_HOST+"/img/clear.gif";this.resetButton.className="clear";this.resetButton.style.marginTop=(Browser.isIE)?"-6px":(Browser.isOpera)?"-2px":(Browser.isSafari)?"-4px":"-3px";this.resetButton.onclick=this.eventReset.bindAsEventListener(this);this.submitButton=document.createElement("input");UWA.$element(this.submitButton);this.submitButton.addClassName("submit");this.submitButton.type="submit";this.submitButton.value=_("Search");this.submitButton.style.marginLeft="5px";this.container.appendChild(this.form);this.form.appendChild(this.favicon);this.form.appendChild(this.inputSearch);this.form.appendChild(this.resetButton);this.form.appendChild(this.submitButton);if(this.options.showCheckbox){this.checkbox=document.createElement("input");this.checkbox.type="checkbox";this.checkbox.title=this.options.checkboxTitle;if(Browser.isIE){this.checkbox.style.marginLeft="5px"}else{this.checkbox.style.position="absolute";this.checkbox.style.top="5px";if((typeof App!="undefined"&&App.dirRTL)||(typeof widget!="undefined"&&widget.dir=="rtl")){this.checkbox.style.left="5px"}else{this.checkbox.style.right="5px"}}this.checkbox.value="";this.checkbox.onclick=this.eventToggle.bindAsEventListener(this);this.form.appendChild(this.checkbox)}},setHistoryString:function(E){if(this.options.searchHistory==false){return }if(typeof this.historyBox=="undefined"){this.historyBox=document.createElement("ul");this.historyBox.className="popupMenu";this.historyBox.style.textAlign="left";this.historyBox.style.display="none";this.historyBox.style.position="absolute";this.showSearchHistory=false;var D=this;if(typeof E!="undefined"&&E){this.showSearchHistory=true;E=E.split(":");for(var C=0;C<E.length;C++){var A=document.createElement("li");var B=document.createElement("a");B.onclick=function(){this.self.inputSearch.value=this.elem.innerHTML;this.self._hideHistory();this.self.eventSubmit();return false}.bind({self:this,elem:B});B.href="javascript:void(0)";B.innerHTML=E[C];A.setAttribute("query",E[C]);A.appendChild(B);this.historyBox.appendChild(A)}}var A=document.createElement("li");var B=document.createElement("a");B.style.borderBottom="";B.onclick=function(){this.self._clearHistory();return false}.bind({self:this,elem:B});B.href="javascript:void(0)";B.className="action";B.innerHTML=_("Clear recent searches");A.appendChild(B);this.historyBox.appendChild(A);if(typeof UWA.Client.Engine.ie6!="undefined"){this.iframe=document.createElement("iframe");this.iframe.setAttribute("frameBorder","0");this.iframe.setAttribute("src","about:blank");this.iframe.setAttribute("scrolling","no");this.iframe.style.display="block";this.iframe.style.position="absolute";this.iframe.style.top="0";this.iframe.style.left="0";this.iframe.style.zIndex="-1";this.historyBox.appendChild(this.iframe)}document.getElementsByTagName("body").item(0).appendChild(this.historyBox)}},getHistoryString:function(){var B="";var C=this.historyBox.getElementsByTagName("li");for(var A=0;A<C.length-1;A++){if(A!=0){B+=":"}B+=C[A].getAttribute("query")}return B},_addHistory:function(D){if(this.options.searchHistory){if(this.historyBox.firstChild.getAttribute("query")==D){return }var C=this.historyBox.getElementsByTagName("li");if(C.length>10){this.historyBox.removeChild(C[C.length-2]);delete C[C.length-2]}var A=document.createElement("li");var B=document.createElement("a");B.onclick=function(){this.self.inputSearch.value=this.elem.innerHTML;this.self._hideHistory();this.self.eventSubmit();return false}.bind({self:this,elem:B});B.href="javascript:void(0)";B.innerHTML=D;A.setAttribute("query",D);A.appendChild(B);this.historyBox.insertBefore(A,this.historyBox.firstChild);this.showSearchHistory=true;this._notify("updateHistory")}},_clearHistory:function(A){if(this.options.searchHistory){this.historyBox.parentNode.removeChild(this.historyBox);delete this.historyBox;this.setHistoryString();this.showSearchHistory=false;this._notify("updateHistory");this.eventReset()}},_hideHistory:function(){this.historyBox.style.display="none"},_showHistory:function(){if(this.showSearchHistory!=true){return }var A=Element.getDimensions(this.inputSearch);var C=Element.getPosition(this.inputSearch);this.historyBox.style.width=A.width+"px";this.historyBox.style.left=C.x+"px";this.historyBox.style.top=C.y+A.height+"px";this.historyBox.style.display="block";if(typeof UWA.Client.Engine.ie6!="undefined"){this.iframe.style.width=(A.width+8)+"px";var B=Element.getDimensions(this.historyBox);this.iframe.style.height=(B.height-2)+"px"}},_toggleHistory:function(){if(this.historyBox.style.display=="none"){this._showHistory()}else{this._hideHistory()}},appendTo:function(A){A.appendChild(this.container)}};if(typeof UWA=="undefined"){UWA={}}if(typeof UWA.Controls=="undefined"){UWA.Controls={}}UWA.Controls.SearchForm=Netvibes.DLA.SearchForm;;
if(typeof Netvibes=="undefined"||!Netvibes){var Netvibes={}}if(typeof Netvibes.UI=="undefined"||!Netvibes.UI){Netvibes.UI={}}Netvibes.UI.Pager=function(A){this.module=A.module;this.limit=parseInt(A.limit,10);this.offset=parseInt(A.offset,10);this.callback=A.callback;this.dataArray=A.dataArray;this.max=A.max;this.text=A.text||{prev:_("prev"),next:_("next")};this.dataLength=(this.dataArray)?this.dataArray.length:A.dataLength;this.loadingData=false};Netvibes.UI.Pager.prototype={getContent:function(){var C=UWA.extendElement(document.createElement("div"));C.addClassName("nv-pager");var B=UWA.extendElement(document.createElement("div"));B.inject(C);if(this.offset>0){var E=UWA.extendElement(document.createElement("a"));E.addClassName("prev");E.href="javascript:;";E.setHTML(this.text.prev);E.onclick=function(){if(this.loadingData){return false}this.onChange(this.offset-this.limit);return false}.bind(this);E.inject(B)}if((this.offset<this.dataLength-this.limit)||(typeof this.max!="undefined"&&this.dataLength<this.max)){var D=UWA.extendElement(document.createElement("a"));D.addClassName("next");D.href="javascript:;";D.setHTML(this.text.next);D.onclick=function(){if(this.loadingData){return false}var F=this.offset+this.limit;if((this.dataLength-F<=this.limit)&&typeof this.max!="undefined"&&this.dataLength<this.max){if(this.onNeedMoreData){this.onNeedMoreData(this.dataLength);B.addClassName("loading");D.addClassName("loading-next");this.loadingData=true;return false}}this.onChange(F);return false}.bind(this);D.inject(B)}var A=UWA.extendElement(document.createElement("div"));A.setHTML('<p style="padding:0;margin:0;line-height:0;height:0;clear:both"></p>');A.inject(C);return C},inject:function(A){A.appendChild(this.getContent())},getDom:function(){this.getContent()}};;
Netvibes.UI.ToolTip=UWA.Class.create();Netvibes.UI.ToolTip.prototype={initialize:function(B,C,A){this.tooltippedEle=$(B);this.root=null;this.options={module:null,width:200,offsetX:16,offsetY:16,"class":"tool-tip",dir:"ltr"};this.setOptions(A);this.widget=this.options.module;if(this.options.dir=="rtl"){this.options.offsetX=-this.options.offsetX}this.htmlText=C||"";this.isStandalone=(this.widget.environment.standalone)?true:false;this.isInline=(this.widget.environment.netvibes&&this.widget.environment.netvibes.inline)?true:false;if(this.widget){this.build()}},setOptions:function(A){UWA.extend(this.options,A||{})},build:function(){this.tooltip=$("nv-tooltip");if(!this.tooltip){this.tooltip=this.widget.createElement("div",{id:"nv-tooltip","class":this.options["class"],styles:{width:this.options.width,position:"absolute",display:"none"}}).inject(document.body)}if(this.htmlText.length>0){this.tooltippedEle.onmouseover=this.onShowTooltip.bindWithEvent(this);this.tooltippedEle.onmouseout=this.onHideTooltip.bindWithEvent(this);this.tooltippedEle.onmousemove=this._locate.bindWithEvent(this)}},onShowTooltip:function(A){if(!this.root){this.root=this._getRootNode(this.tooltippedEle)}this.tooltip.setHTML(this.htmlText);this.tooltip.show();this.tooltipSize=this.tooltip.getDimensions();this._locate(A)},onHideTooltip:function(A){this.tooltip.hide()},_getRootNode:function(B){if(this.isInline||this.isStandalone){return document.getElementsByTagName("body")[0]}var A=B;do{A=A.getParent()}while(!A.hasClassName("moduleContent"));return $(A)},_getViewport:function(){var A;if(typeof window.innerWidth!="undefined"){A={width:window.innerWidth+window.pageXOffset,height:window.innerHeight+window.pageYOffset}}else{A={width:document.documentElement.clientWidth+document.body.scrollLeft,height:document.documentElement.clientHeight+document.body.scrollTop}}return A},_locate:function(E){var C={};var G=0;var F=0;var D=(!this.isInline)?Element.getDimensions(this.root):this._getViewport();if(this.isInline||this.isStandalone){C={x:Event.pointerX(E),y:Event.pointerY(E)}}else{var A=this._getRelativeCoordinates(E,this.root);C={x:A.x,y:A.y}}var B={};B.x=C.x;B.y=C.y;if(this.tooltipSize){if(this.options.dir=="rtl"){B.x-=this.tooltipSize.width}B.x=B.x+this.options.offsetX;B.y=B.y+this.options.offsetY;if(B.x+this.tooltipSize.width>D.width){G=B.x+this.tooltipSize.width-D.width}if(B.x<0){G=B.x}if(B.y+this.tooltipSize.height>D.height){F+=this.tooltipSize.height+this.options.offsetY+(this.options.offsetY/2)}}B.x=B.x-G;B.y=B.y-F;this.tooltip.setStyles({top:B.y+"px",left:B.x+"px"})},_getRelativeCoordinates:function(D,B){var A,H;D=D||window.event;var C=D.target||D.srcElement;if(!window.opera&&typeof D.offsetX!="undefined"){var G={x:D.offsetX,y:D.offsetY};var E=C;while(E){E.mouseX=G.x;E.mouseY=G.y;G.x+=E.offsetLeft;G.y+=E.offsetTop;E=E.offsetParent}var E=B;var F={x:0,y:0};while(E){if(typeof E.mouseX!="undefined"){A=E.mouseX-F.x;H=E.mouseY-F.y;break}F.x+=E.offsetLeft;F.y+=E.offsetTop;E=E.offsetParent}E=C;while(E){E.mouseX=undefined;E.mouseY=undefined;E=E.offsetParent}}else{var G=this._getAbsolutePosition(B);A=D.pageX-G.x;H=D.pageY-G.y}return{x:A,y:H}},_getAbsolutePosition:function(B){var C={x:B.offsetLeft,y:B.offsetTop};if(B.offsetParent){var A=this._getAbsolutePosition(B.offsetParent);C.x+=A.x;C.y+=A.y}return C}};;
Netvibes.UI.CompactToolTip=Class.create();Netvibes.UI.CompactToolTip.prototype={overred:false,setOptions:function(A){this.options={controlClassName:"nv-compactToolTip",overDelay:1000,overLongDelay:700};Object.extend(this.options,A||{})},initialize:function(A){this.elements={};this.setOptions(A);this.elements.elementToClone=UWA.extendElement(this.options.element);this.elements.elementToClone.setStyle("position","relative");this.elements.elementToCloneParent=UWA.extendElement(this.elements.elementToClone.getParent());this.build();this.attachEvents()},build:function(){this.elements.elementToCloneParent.addClassName(this.options.controlClassName);var C=this.elements.elementToClone.clone();C.inject(this.options.container);var B=C.getDimensions();C.remove();C.setStyles({width:B.width+"px",height:B.height+"px"});var A="";A+='<span class="label">';A+="    <span>"+this.options.text+"</span>";A+="</span>";this.elements.label=UWA.extendElement(document.createElement("span"));this.elements.label.addClassName(this.options.controlClassName+"-inner");this.elements.label.setHTML(A).inject(this.elements.elementToClone);if(UWA.Client.Engine.gecko){this.elements.label.setStyle("bottom","-5px")}C.inject(this.elements.label)},attachEvents:function(){this.elements.elementToCloneParent[(UWA.Client.Engine.ie)?"onmouseenter":"onmouseover"]=this.onMouseOver.bind(this)},onMouseOver:function(){var F=(UWA.Client.Engine.ie)?"onmouseenter":"onmouseover";var A=(UWA.Client.Engine.ie)?"onmouseleave":"onmouseout";var E,C;var B=this;var D=this.elements;E=setTimeout(function(){B.overred=true;D.elementToCloneParent.addClassName(B.options.controlClassName+"-over");C=setTimeout(function(){D.elementToCloneParent.addClassName(B.options.controlClassName+"-long-over")},B.options.overLongDelay)},B.options.overDelay);this.elements.label[A]=B.onDragEnd.bind(B,[E,C]);D.elementToCloneParent[A]=function(){if(!B.overred){B.onDragEnd(E,C)}}},onDragEnd:function(B,A){clearTimeout(B);clearTimeout(A);this.elements.elementToCloneParent.removeClassName(this.options.controlClassName+"-over");this.elements.elementToCloneParent.removeClassName(this.options.controlClassName+"-long-over");this.overred=false}};;
if(typeof Netvibes=="undefined"||!Netvibes){var Netvibes={}}if(typeof Netvibes.UI=="undefined"||!Netvibes.UI){Netvibes.UI={}}Netvibes.UI.Feed=Class.create();Netvibes.UI.Feed.prototype={setOptions:function(A){UWA.log("Feed.setOptions()");this.options={details:false,openOutside:false,showDate:true,lookForHtmlThumbnail:false,allowVideoPlayButton:false,updateIcon:true,updateTitle:true,search:"",dir:"ltr",nbTitles:7};Object.extend(this.options,A||{})},initialize:function(B,A){UWA.log("Feed.initialize()");this.widget=B;this.setOptions(A)},display:function(B,A){UWA.log("Feed.display()");delete this.feed;this.url=B;this.content=A;this._displayContent()},setVideoContainer:function(A){UWA.log("Feed.setVideoContainer()");this.videoContainer=A},_displayContent:function(){UWA.log("Feed._displayContent()");var C=this.content;C.innerHTML="";this.feedDiv=document.createElement("div");if(this.options.searchUrl){this.searchDiv=document.createElement("div");C.appendChild(this.searchDiv);var D=decodeURIComponent(this.widget.getValue("lastSearch"));if(D=="__undefined__"){if(this.options.searchValue){D=decodeURIComponent(this.options.searchValue)}else{D=""}}this.searchForm=new UWA.Controls.SearchForm();this.searchForm.setInitialState("/img/s.gif",D,false);this.searchForm.observe("submit",function(G,F){this._doSearch(this.options.searchUrl,G,this.options.proxy)}.bind(this));this.searchForm.observe("reset",function(G,F){this._doSearch(this.options.searchUrl,"",this.options.proxy)}.bind(this));this.searchForm.appendTo(this.searchDiv);this.highlight=D;this._doSearch(this.options.searchUrl,D,this.options.proxy)}if(this.options.hasVideoPlayer==true){this.playerDiv=this.videoContainer;var E=Element.getDimensions(this.playerDiv);var B=this.options.videoAspectRatio||1;var A={width:E.width,height:E.width/B,wmode:this.options.flashNotOpaque?"":"opaque",autoResize:true,showFullScreenLink:false};if(this._isInNativeMode()){this.widget.environment.obj.dataObj.fixId=Math.random()*100000;A.fixModuleId=this.widget.environment.obj.dataObj.fixId}this.flashPlayer=new UWA.Controls.FlashPlayer(this.playerDiv,A)}if(this.options.hasAudioPlayer==true&&AudioPlayer&&AudioPlayer.init){this.audioPlayerDiv=document.createElement("div");this.audioPlayerDiv.id="playermp3Container";this.content.appendChild(this.audioPlayerDiv);AudioPlayer.init()}C.appendChild(this.feedDiv);if(this.url){if(typeof this.feed=="undefined"){this._getFeed(this.url,this.options.proxy)}else{this._displayFeed()}}},_displayFeed:function(K){if(this.lastRequest&&this.lastRequest.cancel){this.lastRequest.cancel()}if(typeof K!="undefined"){this.feed=K;if(typeof K.dir!="undefined"&&K.dir=="rtl"){this.widget.dir="rtl";this.content.dir="rtl";if(typeof this.content.parentNode!="undefined"){Element.addClassName(this.content.parentNode,"rtl")}}else{this.widget.dir="ltr";this.content.dir="ltr"}}else{K=this.feed}if(this.options.updateIcon){this.widget.setIcon(K.htmlUrl)}var I=K.title;var A=this.widget.getValue("category");if(this.widget.readOnly==true&&typeof this.options.category!="undefined"){A=this.options.category}if(this.options.useCategoriesAsTitle==true){I=this.options.categoryLabels[A]}if(this.options.updateTitle){this.widget.setTitle('<a href="'+K.htmlUrl+'" target="_blank">'+I+"</a>")}if(!K||K.error){this._error(_("Error"),_("Looks like this feed is not valid or currently not responding."));return }else{if(K.status==401){this._error(_("Unauthorized"),_("You don't have the required authorization to access this feed."));return }else{if(!K.items){this._error(_("Error"),_("Looks like this feed is not valid or currently not responding."));return }else{if(K.items.length==0){this._error(K.title,_("No items in feed."));return }else{if(K.items.length==1&&K.items[0].title=="The item has been deleted"){this._error(_("Error"),_("No blog post to show for this user."));return }}}}}var H=this.feedDiv;var G=typeof K.htmlUrl=="undefined"?"":K.htmlUrl;if(G){var D=G.substring(0,G.indexOf("/",7));if(D){G=D}}this.history=this.widget.getHistory();UWA.Services.FeedHistory.build(this.widget.readOnly?"":this.history,K);this.feedView=new UWA.Controls.FeedView({details:this.options.details,showDate:this.options.showDate,lookForHtmlThumbnail:this.options.lookForHtmlThumbnail,removeImagePattern:this.options.removeImagePattern,feedSiteUrlDomain:G,search:this.options.search,dir:this.widget.dir,allowVideoPlayButton:this.options.hasVideoPlayer});this.feedView.observe("onclick",this._onClick.bind(this));this.feedView.observe("onmiddleclick",this._onMiddleClick.bind(this));this.feedView.observe("onpodcastplay",this._onPodcastPlay.bind(this));this.feedView.observe("onvideoplay",this._onVideoPlay.bind(this));this.feedView.observe("ondownload",this._onDownload.bind(this));if(this._isInNativeMode()&&this.widget.readOnly!=true){this.feedView.observe("onaddstar",this._onAddStar.bind(this))}if(typeof this.offset=="undefined"){this.offset=0}if(this.options.search!=""){C=K.items.length}else{this.limit=this.options.nbTitles;var C=K.items.length-this.offset;C=C>this.limit?this.limit:C}for(var E=0;E<C;E++){var F=this.offset+E;var N=K.items[F];if(typeof N.enclosures=="object"&&typeof N.video=="undefined"){N.enclosures.each(function(O){if(O.type=="application/x-shockwave-flash"){N.video=O.url}})}if(N.video&&this.options.hasVideoPlayer==true&&this.options.videoAutoPlay==true&&this.widget.getBool("videoAutoPlay")){this.flashPlayer.show(N.video,N.flashvars+this.options.sharingLink,{mediaLinkUrl:N.link,mediaLinkText:_("See on {0}").format(this.options.config.providerName)});if(typeof this.options.headerTextColor!="undefined"){var M=this.playerDiv.getElementsByTagName("a");for(var J=0;J<M.length;J++){M[J].style.color=this.options.headerTextColor}}this.options.videoAutoPlay=false}this.feedView.addItem(F,N,UWA.Services.FeedHistory.isRead(K,F))}H.innerHTML="";H.appendChild(this.feedView.getContent());if(this.options.hideUnreadCount!=true&&this.widget.readOnly!=true){var L=UWA.Services.FeedHistory.getNbNew(K,K.items.length);this.widget.setUnreadCount(L)}if(this.options.search!=""){this.widget.setSearchResultCount(this.feedView.getNumberOfDisplayedItems())}else{var B=new UWA.Controls.Pager({module:this,limit:this.limit,offset:this.offset,dataArray:K.items});B.onChange=function(O){this.module.offset=O;this.module._displayFeed()};this.pagerContent=B.getContent();H.appendChild(this.pagerContent);if(!this._isInNativeMode()||App.pageCustom.showFeedNav=="1"){this.pagerContent.style.display="block"}this.pagerContent.style.display="block"}this.widget.callback("onUpdateBody")},_getFeed:function(A,B){UWA.log("Feed._getFeed()");if(typeof A=="undefined"){A=this.url}if(typeof A=="undefined"){return }if(typeof B=="undefined"){B=this.options.proxy||"feed"}if(this.lastRequest&&this.lastRequest.cancel){this.lastRequest.cancel()}this.url=A;if(!B){B=this.options.proxy||"feed"}this.feedDiv.innerHTML=_("Loading...");var C={method:"GET",proxy:B,shortFeed:false,type:"feed",onComplete:this._displayFeed.bind(this),onFailure:this._displayFeed.bind(this)};if(B=="ajax"&&!this._isInNativeMode()){A="http://"+NV_HOST+A}this.lastRequest=UWA.Data.request(A,C)},_doSearch:function(A,C,B){C=encodeURIComponent(C);this.widget.setValue("lastSearch",C);if(C==""){this._error(this.options.title,_("No search entry yet"))}else{this.widget.setHistory("");this._getFeed(A.replace(/%s/,C),B)}},_onClick:function(E){this._setRead(E.index);if(this.options.openOutside==true){return false}if(this.options.forcePlayVideo==true){return this._onVideoPlay(E)}if(App.inSubscribePreview){return false}var B=this.feed;if(typeof App.FeedReader!="undefined"){if(this.flashPlayer&&typeof this.flashPlayer!="undefined"){this.flashPlayer.hide();this.widget.callback("onUpdateBody")}var D=new Netvibes.UI.Feed.FeedReaderCom(this);var C=B.title;var A=this.widget.getValue("category");if(this.widget.readOnly==true&&typeof this.options.category!="undefined"){A=this.options.category}if(this.options.useCategoriesAsTitle==true){C=this.options.categoryLabels[A]}App.FeedReader.display({title:C,moduleLocalData:D,selectedItemIndex:E.index,moduleObj:D,contentObj:D,proxy:"proxy/feedProxy.php?url="+encodeURIComponent(this.url)})}else{if(typeof Netvibes.UI.EmbedFeedReader!="undefined"){new Netvibes.UI.EmbedFeedReader(B,E.index)}else{if(this.widget&&this.widget.openURL){this.widget.openURL(B.items[E.index].link)}}}return true},_onVideoPlay:function(D){this._setRead(D.index);var C=this.feed;if(C.items[D.index].video&&this.options.hasVideoPlayer==true){this.flashPlayer.show(C.items[D.index].video,C.items[D.index].flashvars+this.options.sharingLink,{mediaLinkUrl:C.items[D.index].link,mediaLinkText:_("See on {0}").format(this.options.providerName)});if(typeof this.options.headerTextColor!="undefined"){var B=this.playerDiv.getElementsByTagName("a");for(var A=0;A<B.length;A++){B[A].style.color=this.options.headerTextColor}}this.widget.callback("onUpdateBody")}return true},_onMiddleClick:function(A){this._setRead(A.index);if(this.flashPlayer){this.flashPlayer.hide();this.widget.callback("onUpdateBody")}},_onPodcastPlay:function(A){if(this._isInNativeMode()){if(App.inSubscribePreview){alert(_("Sorry, this feature is not available in preview mode."));return false}this._setRead(A.index);if(AudioPlayer&&AudioPlayer.play){AudioPlayer.play(A.fileLink,A.podName)}return false}else{this._setRead(A.index);if(AudioPlayer&&AudioPlayer.play){AudioPlayer.play(A.fileLink,A.podName)}return true}},_setRead:function(A){UWA.log("Feed._setRead()");var C=this.feed;if(UWA.Services.FeedHistory.isRead(C,A)==false){UWA.Services.FeedHistory.setRead(C,A);this.feedView.setRead(A);this.widget.setHistory(UWA.Services.FeedHistory.getString(C));if(this.options.hideUnreadCount!=true&&this.widget.readOnly!=true){var B=UWA.Services.FeedHistory.getNbNew(C,C.items.length);this.widget.setUnreadCount(B)}}},_onDownload:function(A){this._setRead(A.index);this.widget.openURL(A.mediaUrl);return true},_onAddStar:function(C){var B=this.feed;var A=B.items[C.index];this.widget.addStar({title:A.title,url:A.link,date:A.date,summary:A.content.stripTags()});return true},_error:function(B,A){this.feedDiv.innerHTML="<p>"+A+"</p>";return false},_isInNativeMode:function(){return(typeof this.widget.environment.netvibes!="undefined"&&this.widget.environment.netvibes.inline)}};Netvibes.UI.Feed.FeedReaderCom=Class.create();Netvibes.UI.Feed.FeedReaderCom.prototype={initialize:function(A){this.feedCtrl=A;this.feed=this.feedCtrl.feed},save:function(){UWA.log("FeedReaderCom.save()")},setHistory:function(A){UWA.log("FeedReaderCom.setHistory();");this.feedCtrl.widget.setHistory(A)},saveHistory:function(){UWA.log("FeedReaderCom.saveHistory()");this.feedCtrl.widget.saveHistory()},getItemNode:function(A){UWA.log("FeedReaderCom.getItemNode()");return this.feedCtrl.feedView.getItem(A)},setFeedTitle:function(){UWA.log("FeedReaderCom.setFeedTitle()");if(this.feedCtrl.options.hideUnreadCount!=true&&this.feedCtrl.widget.readOnly!=true){var B=this.feedCtrl.feed;var A=UWA.Services.FeedHistory.getNbNew(B,B.items.length);this.feedCtrl.widget.setUnreadCount(A)}},setAllAsRead:function(){UWA.log("FeedReaderCom.setAllAsRead()");if(this.feedCtrl.widget.readOnly==true){return }var D=this.feedCtrl.feed;var B=D.items.length;var A=this.feedCtrl.feedView.getNumberOfDisplayedItems();for(var C=0;C<B;C++){if(C>=this.feedCtrl.offset&&C<(A+this.feedCtrl.offset)){if(UWA.Services.FeedHistory.isRead(D,C)){this.feedCtrl.feedView.setRead(C)}else{this.feedCtrl.feedView.setUnRead(C)}}}this.setFeedTitle()},getShowPage:function(){UWA.log("FeedReaderCom.getShowPage()");return parseInt(this.feedCtrl.widget.getValue("showPage"))},setShowPage:function(A){UWA.log("FeedReaderCom.setShowPage()");return parseInt(this.feedCtrl.widget.setValue("showPage",A))},addStar:function(A){UWA.log("FeedReaderCom.addStar()");this.feedCtrl.widget.addStar(A)}};;
if(typeof Netvibes=="undefined"||!Netvibes){var Netvibes={}}if(typeof Netvibes.UI=="undefined"||!Netvibes.UI){Netvibes.UI={}}Netvibes.UI.FeedView=Class.create();Netvibes.UI.FeedView.prototype={needPager:true,setOptions:function(A){this.options={details:false,openOutside:true,showDate:true,feedSiteUrlDomain:"",lookForHtmlThumbnail:true,forceHtmlThumbnail:false,removeImagePattern:false,allowVideoPlayButton:false,showStarring:false,search:"",dir:"ltr"};Object.extend(this.options,A||{})},initialize:function(A){this._elements=[];this.setOptions(A);this._createList()},setSearch:function(A){this.options.search=A},resetSearch:function(){this.options.search=""},addItem:function(F,V,P){var I=document.createElement("li");var X=document.createElement("a");var B=this._truncate(this._escapeHTML(V.content.stripTags()),100);if(this.options.search!==""){B=String.highlight(B,this.options.search)}X.href=V.link;X.target="_blank";var O=this._escapeHTML(V.title.stripTags());if(this.options.search!==""){O=String.highlight(O,this.options.search)}X.innerHTML=O;var Q=this._getDiffDate(V.date);if(Q){var G=document.createElement("small");G.index=F;G.className="age";if(typeof App!="undefined"&&App.dirRTL!=true&&this.options.dir=="rtl"){G.dir=App.dirRTL?"rtl":"ltr";G.innerHTML=Q+" - "}else{G.innerHTML=" - "+Q}X.appendChild(G)}if(this.options.details===false){X.desc=B;X.onmouseover=function(){if(typeof UWA!="undefined"){UWA.Utils.setTooltip(this,this.desc,250)}}}X.index=F;X.onmouseup=this._onItemMouseDown.bindAsEventListener(this);X.onclick=this._onItemClicked.bindAsEventListener(this);V=this._getEnclosures(V);if(typeof V.podcast!="undefined"&&V.watchable===false){X.style[this.options.dir=="rtl"?"marginLeft":"marginRight"]="20px";var R=document.createElement("img");R.className="podcastPlayButton";R.title=_("Play");R.style.border="0px";R.style.cssFloat=this.options.dir=="rtl"?"left":"right";R.style.styleFloat=this.options.dir=="rtl"?"left":"right";if(typeof App!="undefined"&&typeof V.playable!="undefined"){R.style.cursor="pointer";R.fileLink=V.mediaUrl;R.podName=O;R.index=F;R.src="http://"+NV_HOST+"/img/speaker.gif";R.onclick=this._onPodcastPlay.bindAsEventListener(this)}else{R.src="http://"+NV_HOST+"/img/speaker-disabled.png"}var D=document.createElement("a");D.href=V.mediaUrl;D.className="download";var L=document.createElement("img");L.title=_("Download");L.src="http://"+NV_HOST+"/img/ipod.png";L.index=F;L.mediaUrl=V.mediaUrl;L.style[this.options.dir=="rtl"?"marginRight":"marginLeft"]="2px";L.style.border="0px";D.style.border="0px";D.style.cursor="pointer";D.mediaUrl=V.mediaUrl;D.index=F;D.onclick=this._onDownload.bindAsEventListener(this);D.style.cssFloat=this.options.dir=="rtl"?"left":"right";D.style.styleFloat=this.options.dir=="rtl"?"left":"right";D.appendChild(L);if(this.options.dir=="rtl"){I.appendChild(R);I.appendChild(D)}else{I.appendChild(D);I.appendChild(R)}}if(this.options.details===false){if(this.options.showStarring===true){var W=document.createElement("img");W.className="share";W.title=_("Share as favorite");W.index=F;W.src=NV_STATIC+"/img/sendModule/share-hover.png";W.style.visibility="hidden";I.onmouseover=function(){W.style.visibility="visible"};I.onmouseout=function(){W.style.visibility="hidden"};W.onclick=this._onAddStar.bindAsEventListener(this);I.appendChild(W)}I.appendChild(X)}else{var A="0px";var T=document.createElement("h3");var M=document.createElement("p");var E=false;M.innerHTML=B;if(typeof V.thumbnail!="undefined"&&V.thumbnail!==""){E=true;V.thumbnail=V.thumbnail.trim();if(V.thumbnail.substring(0,4)!=="http"&&this.options.feedSiteUrlDomain!==""){var C=V.thumbnail.substring(0,1)=="/"?"":"/";V.thumbnail=this.options.feedSiteUrlDomain+C+V.thumbnail}var H=document.createElement("a");H.style.border="0px";H.href=V.link;H.target="_blank";H.index=F;H.style.outline="none";H.onmouseup=this._onItemMouseDown.bindAsEventListener(this);H.onclick=this._onItemClicked.bindAsEventListener(this);var Y=document.createElement("img");Y.index=F;Y.className="thumb";Y.src=V.thumbnail;if(Browser.isIE&&Browser.version===8){Y.removeAttribute("height");Y.removeAttribute("width")}var K=document.createElement("div");K.appendChild(H);K.className="feedThumbnail";I.appendChild(K);if(V.watchable===true){var J=document.createElement("div");J.style.width="80px";J.style.textAlign="center";J.style.cssFloat=J.style.styleFloat="left";var U=document.createElement("img");U.src="http://"+NV_HOST+"/img/play.png";U.index=F;U.onclick=this._onVideoPlay.bindAsEventListener(this);U.style.marginLeft="-80px";U.style.cssFloat=U.style.styleFloat="left";U.style.width="80px";U.style.height="60px";if(UWA.Client.Engine.ie&&UWA.Client.Engine.version==6){U.src="http://"+NV_HOST+"/img/s.gif";U.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true',src='http://"+NV_HOST+"/img/play.png');"}J.appendChild(Y);H.appendChild(J);H.appendChild(U)}else{H.appendChild(Y)}}M.className="description";T.appendChild(X);I.appendChild(T);var S=F%2?"even":"odd";I.className="item "+S+(E?" has-thumbnail":"");I.appendChild(M);if(this.options.showStarring===true){var N=document.createElement("a");N.innerHTML=_("Share");N.title=_("Share as favorite");N.className="share";N.index=F;N.onclick=this._onAddStar.bindAsEventListener(this);M.insertBefore(N,M.firstChild);I.onmouseover=function(){$(N).addClass("share-hover")};I.onmouseout=function(){$(N).removeClass("share-hover")}}}if(P===true){I.className+=" read"}else{I.className+=" unread"}this._elements[F]=I;if(!(this.options.search!==""&&this._searchInString(this.options.search,V.title)===false&&this._searchInString(this.options.search,V.content)===false)){this._feedList.appendChild(I);this._numberDisplayedItems++}},getContent:function(){return this._feedList},getItem:function(A){return this._elements[A]},getNumberOfDisplayedItems:function(){return this._numberDisplayedItems},setRead:function(A){if(!this._elements){return }var B=this._elements[A];if(!!this.history){this.history[A]=true}if(!!B){Element.addClassName(B,"read");Element.removeClassName(B,"unread")}},setUnRead:function(A){if(!this._elements){return }var B=this._elements[A];if(!!this.history){this.history[A]=false}if(!!B){Element.addClassName(B,"unread");Element.removeClassName(B,"read")}},observe:function(B,A,C){if(B=="onaddstar"){this.options.showStarring=true}if(!this.observers){this.observers=[]}this.observers.push([B,A,C])},_appendPodcastButtons:function(E,A,D){if(D.podcast===true&&D.watchable!==true){var C=document.createElement("img");C.className="podcastPlayButton";C.title=_("Play");C.style.border="0px";C.style.cssFloat=this.options.dir=="rtl"?"left":"right";C.style.styleFloat=this.options.dir=="rtl"?"left":"right";if(typeof App!="undefined"&&typeof D.playable!="undefined"){C.style.cursor="pointer";C.fileLink=D.mediaUrl;C.podName=D.title.stripTags();C.index=A;C.src="http://"+NV_HOST+"/img/speaker.gif";C.onclick=this._onPodcastPlay.bindAsEventListener(this)}else{C.src="http://"+NV_HOST+"/img/speaker-disabled.png"}var B=document.createElement("a");B.href=D.mediaUrl;B.className="download";var F=document.createElement("img");F.title=_("Download");F.src="http://"+NV_HOST+"/img/ipod.png";F.style[this.options.dir=="rtl"?"marginRight":"marginLeft"]="2px";F.style.border="0px";F.mediaUrl=D.mediaUrl;F.index=A;B.style.border="0px";B.style.cursor="pointer";B.mediaUrl=D.mediaUrl;B.index=A;B.onclick=this._onDownload.bindAsEventListener(this);B.style.cssFloat=this.options.dir=="rtl"?"left":"right";B.style.styleFloat=this.options.dir=="rtl"?"left":"right";B.appendChild(F);if(this.options.dir=="rtl"){E.appendChild(C);E.appendChild(B)}else{E.appendChild(B);E.appendChild(C)}}},_notify:function(B,C){if(!this.observers){return false}var A=false;this.observers.each(function(D){if(D[0]==B&&typeof (D[1])=="function"){if(typeof D[2]=="undefined"){A=D[1](C)}else{A=D[1].call(D[2],C)}}});return A},_createList:function(){this._numberDisplayedItems=0;this._feedList=document.createElement("ul");if(this.options.details==true){this._feedList.className="nv-thumbnailedList";this._feedList.style.listStyleType="none"}else{this._feedList.className="nv-feedList"}if(this.options.dir=="rtl"){Element.addClassName(this._feedList,"rtl")}},_searchInString:function(A,B){var C=B.toLowerCase().indexOf(A.toLowerCase());if(C!=-1){return true}return false},_onItemMouseDown:function(B){if(typeof B=="undefined"){B=event}var A=(B.target||B.srcElement);if((typeof B.which=="undefined"&&B.button==2)||(B.which==3&&B.button==2)||((B.ctrlKey==true||B.metaKey==true)&&B.which==1&&B.button==0)){this._notify("onrightclick",{index:A.index});B.returnValue=true;return true}if((typeof B.which=="undefined"&&B.button==4)||(B.which==2&&B.button==1)||(B.which==2&&B.button==4)||(B.which==2&&B.button==2)||(B.which==3&&B.button==3)||(B.ctrlKey==true&&!UWA.Client.Platform.mac)||B.shiftKey==true){this._notify("onmiddleclick",{index:A.index});B.returnValue=true;return true}if(B.preventDefault){B.preventDefault()}else{B.returnValue=false}return false},_onItemClicked:function(B){if(typeof B=="undefined"&&typeof event!="undefined"){B=event}var A=(B.target||B.srcElement);if(typeof B!="undefined"&&(((B.ctrlKey==true&&!UWA.Client.Platform.mac)||B.shiftKey==true)||(B.metaKey==true&&B.which==1&&B.button==0&&UWA.Client.Platform.mac))){return true}return !this._notify("onclick",{index:A.index})},_onPodcastPlay:function(B){if(typeof B=="undefined"){B=event}var A=(B.target||B.srcElement);this._notify("onpodcastplay",{index:A.index,fileLink:A.fileLink,podName:A.podName})},_onVideoPlay:function(B){if(typeof B=="undefined"){B=event}var A=(B.target||B.srcElement);this._notify("onvideoplay",{index:A.index})},_onDownload:function(B){if(typeof B=="undefined"){B=event}var A=(B.target||B.srcElement);return !this._notify("ondownload",{index:A.index,mediaUrl:A.mediaUrl})},_onAddStar:function(B){if(typeof B=="undefined"){B=event}var A=(B.target||B.srcElement);this._notify("onaddstar",{index:A.index});return false},_getDiffDate:function(B){if(typeof B=="undefined"||!this.options.showDate){return""}var A=Date.parse(B);if(isNaN(A)){if(typeof Date.setISO8601=="undefined"){Date.prototype.setISO8601=function(G){var H="([0-9]{4})(-([0-9]{2})(-([0-9]{2})(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(.([0-9]+))?)?(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?";var J=G.match(new RegExp(H));var I=0;var F=new Date(J[1],0,1);if(J[3]){F.setMonth(J[3]-1)}if(J[5]){F.setDate(J[5])}if(J[7]){F.setHours(J[7])}if(J[8]){F.setMinutes(J[8])}if(J[10]){F.setSeconds(J[10])}if(J[12]){F.setMilliseconds(Number("0."+J[12])*1000)}if(J[14]){I=(Number(J[16])*60)+Number(J[17]);I*=((J[15]=="-")?1:-1)}I-=F.getTimezoneOffset();C=(Number(F)+(I*60*1000));this.setTime(Number(C))}}A=new Date();A.setISO8601(B);if(!A){return""}}var D=new Date().getTime()-A;if(D<=0){return""}D/=1000;var C={};C.sec=Math.floor(D);C.min=Math.floor(D/60);C.hour=Math.floor(D/3600);C.day=Math.floor(D/86400);C.week=Math.floor(C.day/7);C.month=Math.floor(C.day/30);C.year=Math.floor(C.day/365);var E;if(C.year==1){E=_("{0} year ago").format(C.year)}else{if(C.year>1){E=_("{0} years ago").format(C.year)}else{if(C.month==1){E=_("{0} month ago").format(C.month)}else{if(C.month>1){E=_("{0} months ago").format(C.month)}else{if(C.week==1){E=_("{0} week ago").format(C.week)}else{if(C.week>1){E=_("{0} weeks ago").format(C.week)}else{if(C.day==1){E=_("yesterday")}else{if(C.day>1){E=_("{0} days ago").format(C.day)}else{if(C.hour==1){E=_("{0} hour ago").format(C.hour)}else{if(C.hour>1){E=_("{0} hours ago").format(C.hour)}else{if(C.min==1){E=_("{0} minute ago").format(C.min)}else{if(C.min>1){E=_("{0} minutes ago").format(C.min)}else{if(C.sec==1){E=_("{0} second ago").format(C.sec)}else{if(C.sec>1){E=_("{0} seconds ago").format(C.sec)}}}}}}}}}}}}}}return E},_truncate:function(C,B){if(!B){B=30}if(C.length<=B){return C}var D=".,;!? ";p=-1;for(var A=0;A<B;A++){if(D.indexOf(C.charAt(A))!=-1){p=A}}if(p==-1){p=B-1}return""+C.substr(0,p)+"..."},_getEnclosures:function(B){if(typeof B.enclosures=="object"){B.enclosures.each(function(G){if(G.url!==""){if(/^image\/(jpeg|gif|jpg|bmp|png)$/.test(G.type)){B.thumbnail=G.url}else{B.podcast=true;B.mediaUrl=G.url}if(/^audio\/mpeg$/.test(G.type)||/\.mp3$/.test(G.url)){B.playable=true}}})}if((!B.thumbnail&&this.options.lookForHtmlThumbnail)||this.options.forceHtmlThumbnail){var F=B.content;F=F.replace(/src="http:\/\/[^"]+\/(~[rfa]|ads)\/[^"]+/mg,"");F=F.replace(/src=('|")?http:\/\/feedads\.googleadservices\.com\/[^'" ]+/mg,"");var C=/<img[^>]*src=('|")?\s*(.*?)\s*('|"|\s*?\/?>|>| )[^>]*/i.exec(F);if(C){var A=/width=('|")?\s*(\d+)/i.exec(C[0]);var E=/height=('|")?\s*(\d+)/i.exec(C[0]);if(!((A&&A[2]<10)||(E&&E[2]<10))){B.thumbnail=C[2].replace(/<\/?[^>]+>/gi," ")}}if(this.options.removeImagePattern&&B.thumbnail){if(B.thumbnail.match(new RegExp(this.options.removeImagePattern))){B.thumbnail=""}}}if(B.thumbnail){B.thumbnail=B.thumbnail.trim();if(B.thumbnail.substring(0,4)!=="http"&&this.options.feedSiteUrlDomain!==""){var D=B.thumbnail.substring(0,1)=="/"?"":"/";B.thumbnail=this.options.feedSiteUrlDomain+D+B.thumbnail}}if(this.options.allowVideoPlayButton&&B.video){B.watchable=true}else{B.watchable=false}return B},_escapeHTML:function(A){return A.replace(/<\/?[^>]+/gi,"")}};;
Netvibes.UI.FeedView_Carousel=Class.create();Netvibes.UI.FeedView_Carousel.prototype=UWA.extend(new Netvibes.UI.FeedView(),{needPager:false,needResize:true,fullSize:true,currentIndex:0,currentPosition:0,defaultThumbnail:NV_STATIC+"/img/feedreader/default.png",initialize:function(A){this._elements=[];this.setOptions(A);this.options.lookForHtmlThumbnail=true;this._container=UWA.$element(document.createElement("div"));this._container.className="carouselView";this._build();this.items=new Array()},_build:function(){this._container.setHTML('<div class="main">                 <div class="crop"><div class="image"></div></div>                 <div class="content">                     <div class="title"><a href="javascript:;"></a></div>                     <div class="description"></div>                 </div>             </div>             <div class="pager">                 <div class="arrow prev"></div>                 <div class="thumbnail-list"></div>                 <div class="arrow next" style="float: right"></div>             </div>             <div style="clear: both" />');this.totalThumbnails=parseInt((this.options.dimensions.width-30)/60);var A=this._container.getElementsByClassName("arrow");A[0].onclick=this._onPrevClick.bindAsEventListener(this);A[1].onclick=this._onNextClick.bindAsEventListener(this)},_buildBigOne:function(G){this._numberDisplayedItems=0;if(G>this.items.length-1){G=0}else{if(G<0){G=this.items.length-1}}var N=this.items[G];N=this._getEnclosures(N);if(!N.thumbnail){N.thumbnail=this.defaultThumbnail}var C=this._container.getElementsByClassName("image")[0];C.empty();var J=this._container.getElementsByClassName("title")[0].getChildren()[0];J.empty();var K=this._container.getElementsByClassName("description")[0];if(this.options.showStarring===true){K.setHTML('<a class="share" href="javascript:;">'+_("Share")+"</a>");var M=this._container.getElementsByClassName("share")[0];M.index=G;M.onclick=this._onAddStar.bindAsEventListener(this)}var F=document.createElement("img");F.src=N.thumbnail;F.index=G;F.style.cursor="pointer";if(typeof N.video!="undefined"&&this.options.allowVideoPlayButton!=true){var E=document.createElement("img");E.src=NV_STATIC+"/img/play_large.png";E.index=G;E.style.cursor="pointer";E.style.width="200px";E.style.height="200px";E.style.position="absolute";E.style.left="0";E.onclick=this._onItemOverlayClicked.bindAsEventListener(this);if(UWA.Client.Engine.ie&&UWA.Client.Engine.version==6){E.src="http://"+NV_HOST+"/img/s.gif";E.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true',src='http://"+NV_HOST+"/img/play_large.png');"}}else{F.onclick=this._onItemClicked.bindAsEventListener(this)}F.onerror=function(){this.src=NV_STATIC+"/img/feedreader/default.png"};C.appendChild(F);if(typeof E!="undefined"){C.appendChild(E)}var L=UWA.$element(document.createElement("span"));var H=this._escapeHTML(N.title.stripTags());if(this.options.search!==""){H=String.highlight(H,this.options.search)}L.setHTML(H);L.index=G;J.index=G;J.href=N.link;J.onclick=this._onItemClicked.bindAsEventListener(this);J.appendChild(L);var I=UWA.$element(document.createElement("small"));I.className="age";I.setHTML(this._getDiffDate(N.date));K.appendChild(I);var A=UWA.$element(document.createElement("p"));var B=this._escapeHTML(N.content.stripTags());if(this.descSize>0){B=this._truncate(B,this.descSize)}if(this.options.search!==""){B=String.highlight(B,this.options.search)}A.setHTML(B);K.appendChild(A);this._appendPodcastButtons(K,G,N);if(this.options.showStarring===true){var D=this._container.getElementsByClassName("main")[0];D.onmouseover=function(){$(M).addClass("share-hover")};D.onmouseout=function(){$(M).removeClass("share-hover")}}if(!(this.options.search!==""&&this._searchInString(this.options.search,N.title)===false&&this._searchInString(this.options.search,N.content)===false)){this._numberDisplayedItems++}},addItem:function(A,B){this.items[A]=B},_buildContent:function(){if(this.options.dimensions.width<450){this.descSize=this.options.dimensions.width/3}else{this.descSize=0}var A=this.currentPosition+this.currentIndex;if(A>this.items.length-1){A-=this.items.length}this._buildBigOne(A);this._buildThumbnailList()},getContent:function(){this._buildContent();return this._container},_buildThumbnailList:function(){var D=this._container.getElementsByClassName("thumbnail-list")[0];D.empty();for(var C=this.currentPosition,E=0;E<this.totalThumbnails;E++,C++){if(C>this.items.length-1){C=0}else{if(C<0){C=this.items.length-1}}var F=this.items[C];F=this._getEnclosures(F);if(!F.thumbnail){F.thumbnail=this.defaultThumbnail}var G=UWA.$element(document.createElement("div"));G.className="thumbnail";if(this.currentIndex==E){G.addClassName("selected")}var A=UWA.$element(document.createElement("a"));A.href="#";A.index=E;A.onclick=this._onThumbnailClicked.bindAsEventListener(this);var B=UWA.$element(document.createElement("img"));B.index=E;B.src=F.thumbnail;B.onerror=function(){this.src=NV_STATIC+"/img/feedreader/default.png"};A.appendChild(B);G.appendChild(A);D.appendChild(G)}},_selectItem:function(C){this.currentIndex=C;var B=this._container.getElementsByClassName("thumbnail-list")[0].childNodes;for(var D=0,A=B.length;D<A;D++){if(D==this.currentIndex){B[D].addClassName("selected")}else{B[D].removeClassName("selected")}}var C=this.currentPosition+this.currentIndex;if(C>this.items.length-1){C-=this.items.length}this._buildBigOne(C)},_onPrevClick:function(){if(this.currentIndex>0){this.currentIndex--;this._selectItem(this.currentIndex)}else{if(this.currentPosition==0){this.currentPosition=this.items.length-1}else{this.currentPosition--}this._buildContent()}return false},_onNextClick:function(){if(this.currentIndex<this.totalThumbnails-1){this.currentIndex++;this._selectItem(this.currentIndex)}else{if(this.currentPosition==this.items.length-1){this.currentPosition=0}else{this.currentPosition++}this._buildContent()}return false},_onThumbnailClicked:function(B){if(typeof B=="undefined"&&typeof event!="undefined"){B=event}var A=(B.target||B.srcElement);this._selectItem(A.index);return false},_onItemOverlayClicked:function(B){if(typeof B=="undefined"&&typeof event!="undefined"){B=event}var A=(B.target||B.srcElement);this._embedPlayer(A.index);return false},_embedPlayer:function(A){var C=this.items[A];var B='<object type="application/x-shockwave-flash" data="'+C.video+'" width="200" height="200">                             <param name="movie" value="'+C.video+'" />                             <param name="wmode" value="opaque" />                             <param name="quality" value="high" />                             <param value="true" name="allowfullscreen"/>                             <param name="FlashVars" value="'+C.flashvars||'" />                             <param name="AllowScriptAccess" value="never" />                           </object>';var D=this._container.getElementsByClassName("image")[0];D.innerHTML=B},setRead:function(){},setUnRead:function(){},colorize:function(A){if(typeof A=="undefined"){A="blank"}this._container.removeClassName(this.color+"Carousel");this.color=A;this._container.addClassName(this.color+"Carousel")},resize:function(A){this.options.dimensions=A;this.totalThumbnails=parseInt((this.options.dimensions.width-30)/60);this._buildContent();return true}});;
Netvibes.UI.FeedView_Magazine=Class.create();Netvibes.UI.FeedView_Magazine.prototype=UWA.extend(new Netvibes.UI.FeedView(),{needPager:false,needResize:true,fullSize:true,currentPosition:0,defaultThumbnail:NV_STATIC+"/img/feedreader/default.png",initialize:function(A){this._elements=[];this.setOptions(A);this.options.lookForHtmlThumbnail=true;this._container=UWA.$element(document.createElement("div"));this._container.className="magazineView";this._build();this.items=new Array()},_build:function(){this.nbRows=parseInt((this.options.dimensions.width/500)+1);if(this.nbRows<1){this.nbRows=1}html='<div class="main">             <div class="left">                 <div class="crop"><div class="image"></div></div>                 <div class="article">                     <h3></h3>                     <small></small>                     <p></p>                 </div>             </div>';for(i=0;i<this.nbRows;i++){width=parseInt((this.options.dimensions.width-200)/this.nbRows)-10;style='style="width: '+width+'px"';itemStyle='style="width: '+(width-5)+'px"';html+='<div class="right" '+style+">";html+='<div class="item first" '+itemStyle+'><div class="thumbnail"></div><div class="title"><h3></h3><small></small></div><div class="description"><p></p></div></div>';html+='<div class="item" '+itemStyle+'><div class="thumbnail"></div><div class="title"><h3></h3><small></small></div><div class="description"><p></p></div></div>';html+='<div class="item last" '+itemStyle+'><div class="thumbnail"></div><div class="title"><h3></h3><small></small></div><div class="description"><p></p></div></div>';html+="</div>"}html+='</div>                 <div class="nv-pager" style="display: block">                     <a class="prev" href="javascript:void(0)" target="_blank" style="color: white">'+_("prev")+'</a>                     <a class="next" href="javascript:void(0)" target="_blank" style="color: white">'+_("next")+'</a>                     <div>                         <p style="margin: 0pt; padding: 0pt; line-height: 0pt; height: 0pt; clear: both;" />                     </div>                 </div>';this._container.setHTML(html);var B=this._container.getElementsByClassName("prev")[0];var A=this._container.getElementsByClassName("next")[0];B.onclick=this._onPrevClick.bindAsEventListener(this);A.onclick=this._onNextClick.bindAsEventListener(this)},addItem:function(A,B){this.items[A]=B},_buildBigOne:function(I){this._numberDisplayedItems=0;if(I>this.items.length-1){I=0}else{if(I<0){I=this.items.length-1}}var M=this.items[I];M=this._getEnclosures(M);if(!M.thumbnail){M.thumbnail=this.defaultThumbnail}var C=this._container.getElementsByClassName("image")[0];C.empty();var K=this._container.getElementsByClassName("article")[0].getChildren();var E=K[0];var G=K[1];var H=K[2];var F=document.createElement("img");F.src=M.thumbnail;F.index=I;F.style.cursor="pointer";if(typeof M.video!="undefined"&&this.options.allowVideoPlayButton!=true){var D=document.createElement("img");D.src=NV_STATIC+"/img/play_large.png";D.index=I;D.style.cursor="pointer";D.style.width="200px";D.style.height="200px";D.style.position="absolute";D.style.left="0";D.onclick=this._onItemOverlayClicked.bindAsEventListener(this);if(UWA.Client.Engine.ie&&UWA.Client.Engine.version==6){D.src="http://"+NV_HOST+"/img/s.gif";D.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true',src='http://"+NV_HOST+"/img/play_large.png');"}}else{F.onclick=this._onItemClicked.bindAsEventListener(this)}F.onerror=function(N){this.src=N}.bind(F,this.defaultThumbnail);C.appendChild(F);if(typeof D!="undefined"){C.appendChild(D)}var J=this._escapeHTML(M.title.stripTags());if(this.options.search!==""){J=String.highlight(J,this.options.search)}E.setHTML(J);E.index=I;E.style.cursor="pointer";E.onmouseup=this._onItemMouseDown.bindAsEventListener(this);E.onclick=this._onItemClicked.bindAsEventListener(this);G.setHTML(this._getDiffDate(M.date));var B=this._truncate(this._escapeHTML(M.content.stripTags()),100);if(this.options.search!==""){B=String.highlight(B,this.options.search)}if(this.options.showStarring===true){H.setHTML('<a href="javascript:;" class="share">'+_("Share")+"</a>"+B);var L=this._container.getElementsByClassName("share")[0];L.index=I;L.onclick=this._onAddStar.bindAsEventListener(this);var A=this._container.getElementsByClassName("left")[0];A.onmouseover=function(){$(L).addClass("share-hover")};A.onmouseout=function(){$(L).removeClass("share-hover")}}else{H.setHTML(B)}this._appendPodcastButtons(H,I,M);if(!(this.options.search!==""&&this._searchInString(this.options.search,M.title)===false&&this._searchInString(this.options.search,M.content)===false)){this._numberDisplayedItems++}},_buildThumbnailList:function(){var H=this._container.getElementsByClassName("item");var E=this.currentPosition;for(var D=0;D<3*this.nbRows;D++){E++;if(E>this.items.length-1){E=0}else{if(E<0){E=this.items.length-1}}var L=this.items[E];L=this._getEnclosures(L);if(!L.thumbnail){L.thumbnail=this.defaultThumbnail}var G=H[D].getChildren();var A=G[0];var I=G[1].getChildren();var J=G[2].getChildren();var C=UWA.$element(document.createElement("img"));C.setAttribute("height",50);C.src=L.thumbnail;C.index=E;C.style.cursor="pointer";C.onclick=this._onItemClicked.bindAsEventListener(this);C.onerror=function(M){this.src=M}.bind(C,this.defaultThumbnail);A.empty();A.appendChild(C);var F=this._truncate(this._escapeHTML(L.title.stripTags()),this.titleSize);if(this.options.search!==""){F=String.highlight(F,this.options.search)}I[0].setHTML(F);I[0].index=E;I[0].style.cursor="pointer";I[0].onclick=this._onItemClicked.bindAsEventListener(this);I[1].setHTML(this._getDiffDate(L.date));var B=this._truncate(this._escapeHTML(L.content.stripTags()),this.descSize);if(this.options.search!==""){B=String.highlight(B,this.options.search)}if(this.options.showStarring===true){J[0].setHTML('<a href="javascript:;" class="share">'+_("Share")+"</a>"+B);var K=J[0].getElementsByClassName("share")[0];K.index=E;K.onclick=this._onAddStar.bindAsEventListener(this);H[D].onmouseover=function(){var M=this.getElementsByClassName("share")[0];$(M).addClass("share-hover")};H[D].onmouseout=function(){var M=this.getElementsByClassName("share")[0];$(M).removeClass("share-hover")}}else{J[0].setHTML(B)}if(!(this.options.search!==""&&this._searchInString(this.options.search,L.title)===false&&this._searchInString(this.options.search,L.content)===false)){this._numberDisplayedItems++}}},_buildContent:function(){this._build();this.titleSize=this.options.dimensions.width/this.nbRows/11;this.descSize=this.options.dimensions.width/this.nbRows/6;this._buildBigOne(this.currentPosition);this._buildThumbnailList()},_onPrevClick:function(){if(this.currentPosition==0){this.currentPosition=this.items.length-1}else{this.currentPosition--}this._buildContent();return false},_onNextClick:function(){if(this.currentPosition==this.items.length-1){this.currentPosition=0}else{this.currentPosition++}this._buildContent();return false},_onItemOverlayClicked:function(B){if(typeof B=="undefined"&&typeof event!="undefined"){B=event}var A=(B.target||B.srcElement);this._embedPlayer(A.index);return false},_embedPlayer:function(A){var C=this.items[A];var B='<object type="application/x-shockwave-flash" data="'+C.video+'" width="200" height="200">                             <param name="movie" value="'+C.video+'" />                             <param name="wmode" value="opaque" />                             <param name="quality" value="high" />                             <param value="true" name="allowfullscreen"/>                             <param name="FlashVars" value="'+C.flashvars||'" />                             <param name="AllowScriptAccess" value="never" />                           </object>';var D=this._container.getElementsByClassName("image")[0];D.innerHTML=B},toElement:function(){this._buildContent();return this._container},getContent:function(){return this.toElement()},setRead:function(){},setUnRead:function(){},colorize:function(A){if(typeof A=="undefined"){A="blank"}this._container.removeClassName(this.color+"Magazine");this.color=A;this._container.addClassName(this.color+"Magazine")},resize:function(A){this.options.dimensions=A;this._buildContent();return true}});;
Netvibes.UI.FeedView_Ticker=Class.create();Netvibes.UI.FeedView_Ticker.prototype=UWA.extend(new Netvibes.UI.FeedView(),{needPager:false,needResize:true,fullSize:true,currentPosition:0,color:"undefined",colors:{blue:["014446","6eb8bd","1fd3e3","6EB8BD"],green:["232908","787F57","B6D800","787F57"],red:["5B0000","D5827C","E9440B","D5827C"],orange:["440121","C57C9A","FE4792","C57C9A"],white:["343434","8E8D8D","FFFFFF","8E8D8D"],yellow:["502200","BF934E","FCBC13","BF934E"],blank:["transparent","8E8D8D","333333","333333"],borderless:["transparent","8E8D8D","333333","333333"]},initialize:function(A){this.setOptions(A);this._container=UWA.$element(document.createElement("div"));this._container.className="tickerView";this.items=new Array()},_build:function(){if(UWA.Widgets.instances.length==1||typeof this.options.id=="undefined"){instanceIndex=0}else{for(var A in UWA.Widgets.instances){if(UWA.Widgets.instances[A].id==this.options.id){instanceIndex=A;break}}}this._id=Math.round(Math.random()*100000);this._container.setHTML('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"                     id="flashticker-'+this._id+'" width="'+this.options.dimensions.width+'" height="80"                     codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">                 <param name="movie" value="/swf/ticker.swf" />                 <param name="quality" value="high" />                 <param name="wmode" value="transparent" />                 <param name="allowScriptAccess" value="sameDomain" />                 <param name="FlashVars" value="instanceIndex='+instanceIndex+"&background="+this.colors[this.color][0]+"&arrow="+this.colors[this.color][1]+"&text="+this.colors[this.color][2]+"&subtext="+this.colors[this.color][3]+"&shareLabel="+_("Share")+"&direction="+this.options.dir+"&share="+(this.options.displayShare?"1":"0")+'" />                 <embed src="/swf/ticker.swf" quality="high"                     width="'+this.options.dimensions.width+'" height="80" align="middle"                     play="true" loop="false" quality="high" allowScriptAccess="sameDomain" wmode="transparent"                     flashVars="instanceIndex='+instanceIndex+"&background="+this.colors[this.color][0]+"&arrow="+this.colors[this.color][1]+"&text="+this.colors[this.color][2]+"&subtext="+this.colors[this.color][3]+"&shareLabel="+_("Share")+"&direction="+this.options.dir+"&share="+(this.options.displayShare?"1":"0")+'"                     type="application/x-shockwave-flash"                     pluginspage="http://www.macromedia.com/go/getflashplayer">                 </embed>             </object>');if(UWA.Client.Engine.ie){this._object=this._container.getElementsByTagName("object")[0]}else{this._object=this._container.getElementsByTagName("embed")[0]}},_playAsSoonAsPossible:function(){if(typeof this._object.addItem=="function"){clearInterval(this._interval);delete this._interval;if(typeof this._object.isStarted=="function"&&this._object.isStarted()==true){}else{for(var B=0,A=this.items.length;B<A;B++){this._object.addItem(B,this.items[B].title.stripTags(),this._getDiffDate(this.items[B].date))}this._object.start()}}},setContainer:function(A){A.empty();A.appendChild(this._container);this._build()},finalize:function(){if(typeof this._interval=="undefined"){this._interval=setInterval(this._playAsSoonAsPossible.bind(this),500)}},addItem:function(A,B){this.items[A]=B},setRead:function(){},setUnRead:function(){},colorize:function(A){if(typeof A=="undefined"){A="blank"}this._container.removeClassName(this.color+"Ticker");this.color=A;this._container.addClassName(this.color+"Ticker");if(typeof this._object!="undefined"&&typeof this._object.setArrowColor=="function"){this._object.setBackgroundColor(this.colors[this.color][0]);this._object.setArrowColor(this.colors[this.color][1]);this._object.setTextColor(this.colors[this.color][2]);this._object.setSubtextColor(this.colors[this.color][3])}},resize:function(A){this.options.dimensions=A;if(typeof this._object=="undefined"){return false}this._object.style.width=A.width+"px";this.finalize();return true}});;
Netvibes.UI.FeedView_Scoop=Class.create();Netvibes.UI.FeedView_Scoop.prototype=UWA.extend(new Netvibes.UI.FeedView(),{needPager:false,needResize:true,fullSize:true,currentIndex:0,currentPosition:0,defaultThumbnail:NV_STATIC+"/img/feedreader/default.png",initialize:function(A){this._elements=[];this.setOptions(A);this.options.lookForHtmlThumbnail=true;this._container=UWA.$element(document.createElement("div"));this._container.className="scoopView";this._build();this.items=new Array();this.history=new Array();this.options.showDate=true},_build:function(){this._container.setHTML('<div class="top">                 <div class="crop"><div class="image"></div></div>                 <div class="title"><a href="javascript:;"></a></div>              </div>              <div class="middle odd">                 <div class="description"></div>              </div>              <div class="bottom">                 <ul class="nv-thumbnailedList" style="list-style-type: none;">                     <li class="item even">                         <div class="feedThumbnail"><a href="javascript:;"></a></div>                         <h3 class="title"><a href="javascript:;"></a></h3>                         <p class="description"></p>                     </li>                     <li class="item odd">                         <div class="feedThumbnail"><a href="javascript:;"></a></div>                         <h3 class="title"><a href="javascript:;"></a></h3>                     <p class="description" style="margin-left: 88px; margin-right: 0px;"></p>                     </li>                 </ul>              </div>              <div class="nv-pager" style="display: block">                  <a class="prev" href="javascript:void(0)" target="_blank">'+_("prev")+'</a>                  <a class="next" href="javascript:void(0)" target="_blank">'+_("next")+'</a>                  <div>                      <p style="margin: 0pt; padding: 0pt; line-height: 0pt; height: 0pt; clear: both;" />                  </div>              </div>');var B=this._container.getElementsByClassName("prev")[0];var A=this._container.getElementsByClassName("next")[0];B.onclick=this._onPrevClick.bindAsEventListener(this);A.onclick=this._onNextClick.bindAsEventListener(this)},addItem:function(A,B,C){this.items[A]=B;this.history[A]=C},_buildBigOne:function(F){this._numberDisplayedItems=0;if(F>this.items.length-1){F=0}else{if(F<0){F=this.items.length-1}}var N=this.items[F];N=this._getEnclosures(N);if(!N.thumbnail){N.thumbnail=this.defaultThumbnail}var H=this._container.getElementsByClassName("top")[0];var B=this._container.getElementsByClassName("image")[0];B.empty();var I=this._container.getElementsByClassName("title")[0].getChildren()[0];I.empty();var K=this._container.getElementsByClassName("description")[0];var E=document.createElement("img");E.src=N.thumbnail;E.index=F;E.style.cursor="pointer";B.appendChild(E);if(typeof N.video!="undefined"&&this.options.allowVideoPlayButton!=true){var C=document.createElement("div");C.style.position="absolute";C.style.width="100%";C.style.left="0px";C.style.top="0px";C.index=F;var D=document.createElement("img");D.src=NV_STATIC+"/img/play_large.png";D.index=F;D.style.cursor="pointer";D.onclick=this._onItemOverlayClicked.bindAsEventListener(this);if(UWA.Client.Engine.ie&&UWA.Client.Engine.version==6){D.src="http://"+NV_HOST+"/img/s.gif";D.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true',src='http://"+NV_HOST+"/img/play_large.png');"}C.appendChild(D)}else{E.onclick=this._onItemClicked.bindAsEventListener(this)}E.onerror=function(P){this.src=P}.bind(E,this.defaultThumbnail);if(typeof C!="undefined"){B.appendChild(C)}var M=UWA.$element(document.createElement("span"));var G=this._escapeHTML(N.title.stripTags());if(this.options.search!==""){G=String.highlight(G,this.options.search)}M.setHTML(G);M.index=F;I.index=F;I.href=N.link;I.onclick=this._onItemClicked.bindAsEventListener(this);I.appendChild(M);date=this._getDiffDate(N.date);if(date){var J=UWA.$element(document.createElement("small"));J.setHTML(date);J.index=F;I.appendChild(document.createElement("br"));I.appendChild(J)}var A=this._truncate(this._escapeHTML(N.content.stripTags()),250);if(this.options.search!==""){A=String.highlight(A,this.options.search)}K.setHTML(A);if(this.options.showStarring===true){var L=UWA.$element(document.createElement("a"));L.href="javascript:;";L.className="share";L.appendChild(document.createTextNode(_("Share")));L.index=F;L.onclick=this._onAddStar.bindAsEventListener(this);K.insertBefore(L,K.firstChild);var L=this._container.getElementsByClassName("share")[0];L.index=F;L.onclick=this._onAddStar.bindAsEventListener(this);var O=this._container.getElementsByClassName("middle")[0];O.onmouseover=function(){$(L).addClass("share-hover")};O.onmouseout=function(){$(L).removeClass("share-hover")}}this._appendPodcastButtons(K,F,N);H.index=F;H.style.cursor="pointer";H.onclick=this._onItemClicked.bindAsEventListener(this);if(!(this.options.search!==""&&this._searchInString(this.options.search,N.title)===false&&this._searchInString(this.options.search,N.content)===false)){this._numberDisplayedItems++}},_buildThumbnailList:function(){var G=this._container.getElementsByClassName("item");this._elements=[];var E=this.currentPosition;for(var C=0;C<2;C++){E++;if(E>this.items.length-1){E=0}else{if(E<0){E=this.items.length-1}}this._elements[E]=G[C];var L=this.items[E];L=this._getEnclosures(L);if(!L.thumbnail){L.thumbnail=this.defaultThumbnail}if(this.history[E]){$(G[C]).addClass("read");$(G[C]).removeClass("unread")}else{$(G[C]).addClass("unread");$(G[C]).removeClass("read")}var A=G[C].getElementsByClassName("feedThumbnail")[0].getChildren()[0];var H=G[C].getElementsByClassName("title")[0].getChildren()[0];var J=G[C].getElementsByClassName("description")[0];var D=UWA.$element(document.createElement("img"));D.className="thumb";D.src=L.thumbnail;D.index=E;D.style.cursor="pointer";D.onclick=this._onItemClicked.bindAsEventListener(this);D.onerror=function(M){this.src=M}.bind(D,this.defaultThumbnail);A.empty();A.href=L.link;A.appendChild(D);var F=this._escapeHTML(L.title.stripTags());if(this.options.search!==""){F=String.highlight(F,this.options.search)}H.setHTML(F);date=this._getDiffDate(L.date);if(date){var I=UWA.$element(document.createElement("small"));I.setHTML(" - "+date);I.index=E;H.appendChild(I)}H.index=E;H.href=L.link;H.onclick=this._onItemClicked.bindAsEventListener(this);var B=this._truncate(this._escapeHTML(L.content.stripTags()),100);if(this.options.search!==""){B=String.highlight(B,this.options.search)}if(this.options.showStarring===true){J.setHTML('<a href="javascript:;" class="share">'+_("Share")+"</a>"+B);var K=J.getElementsByClassName("share")[0];K.index=E;K.onclick=this._onAddStar.bindAsEventListener(this);G[C].onmouseover=function(){var M=this.getElementsByClassName("share")[0];$(M).addClass("share-hover")};G[C].onmouseout=function(){var M=this.getElementsByClassName("share")[0];$(M).removeClass("share-hover")}}else{J.setHTML(B)}this._appendPodcastButtons(J,E,L);if(!(this.options.search!==""&&this._searchInString(this.options.search,L.title)===false&&this._searchInString(this.options.search,L.content)===false)){this._numberDisplayedItems++}}},_buildContent:function(){this._build();this._buildBigOne(this.currentPosition);this._buildThumbnailList()},_onPrevClick:function(){if(this.currentPosition==0){this.currentPosition=this.items.length-1}else{this.currentPosition--}this._buildContent();return false},_onNextClick:function(){if(this.currentPosition==this.items.length-1){this.currentPosition=0}else{this.currentPosition++}this._buildContent();return false},_onItemOverlayClicked:function(B){if(typeof B=="undefined"&&typeof event!="undefined"){B=event}var A=(B.target||B.srcElement);this._embedPlayer(A.index);return false},_embedPlayer:function(A){var C=this.items[A];var B='<object type="application/x-shockwave-flash" data="'+C.video+'" width="200" height="200">                             <param name="movie" value="'+C.video+'" />                             <param name="wmode" value="opaque" />                             <param name="quality" value="high" />                             <param value="true" name="allowfullscreen"/>                             <param name="FlashVars" value="'+C.flashvars||'" />                             <param name="AllowScriptAccess" value="never" />                           </object>';var D=this._container.getElementsByClassName("image")[0];D.innerHTML=B},toElement:function(){this._buildContent();return this._container},getContent:function(){return this.toElement()},colorize:function(A){if(typeof A=="undefined"){A="blank"}this._container.removeClassName(this.color+"Scoop");this.color=A;this._container.addClassName(this.color+"Scoop")},resize:function(A){this.options.dimensions=A;this._buildContent();return true}});;
Netvibes.UI.FeedView_Headline=Class.create();Netvibes.UI.FeedView_Headline.prototype=UWA.extend(new Netvibes.UI.FeedView(),{needPager:false,needResize:true,fullSize:true,currentIndex:0,currentPosition:0,defaultThumbnail:NV_STATIC+"/img/feedreader/default.png",initialize:function(A){this._elements=[];this.setOptions(A);this._container=UWA.$element(document.createElement("div"));this._container.className="headlineView";this._build();this.items=new Array();this.history=new Array();this.options.showDate=true},_build:function(){this._container.setHTML('<div class="top even">                 <div class="title"><a href="javascript:;"></a></div>                 <small class="age"></small>                 <div class="description"></div>              </div>              <div class="bottom">                 <ul class="nv-thumbnailedList" style="list-style-type: none;">                     <li class="item odd">                         <h3 class="title"><a href="javascript:;"></a></h3>                     </li>                     <li class="item odd">                         <h3 class="title"><a href="javascript:;"></a></h3>                     </li>                 </ul>              </div>              <div class="nv-pager" style="display: block">                  <a class="prev" href="javascript:void(0)" target="_blank">'+_("prev")+'</a>                  <a class="next" href="javascript:void(0)" target="_blank">'+_("next")+'</a>                  <div>                      <p style="margin: 0pt; padding: 0pt; line-height: 0pt; height: 0pt; clear: both;" />                  </div>              </div>');var B=this._container.getElementsByClassName("prev")[0];var A=this._container.getElementsByClassName("next")[0];B.onclick=this._onPrevClick.bindAsEventListener(this);A.onclick=this._onNextClick.bindAsEventListener(this)},addItem:function(A,B,C){this.items[A]=B;this.history[A]=C},_buildBigOne:function(C){this._numberDisplayedItems=0;if(C>this.items.length-1){C=0}else{if(C<0){C=this.items.length-1}}var J=this.items[C];J=this._getEnclosures(J);var F=this._container.getElementsByClassName("title")[0].getChildren()[0];F.empty();var B=this._container.getElementsByClassName("age")[0];B.empty();var G=this._container.getElementsByClassName("description")[0];G.empty();var I=UWA.$element(document.createElement("span"));var D=this._escapeHTML(J.title.stripTags());if(this.options.search!==""){D=String.highlight(D,this.options.search)}I.setHTML(D);I.index=C;F.index=C;F.href=J.link;F.onclick=this._onItemClicked.bindAsEventListener(this);F.appendChild(I);B.setHTML(this._getDiffDate(J.date));var A=this._truncate(this._escapeHTML(J.content.stripTags()),250);if(this.options.search!==""){A=String.highlight(A,this.options.search)}if(this.options.showStarring===true){G.setHTML('<a href="javascript:;" class="share">'+_("Share")+"</a>"+A);var H=this._container.getElementsByClassName("share")[0];H.index=C;H.onclick=this._onAddStar.bindAsEventListener(this);var E=this._container.getElementsByClassName("top")[0];E.onmouseover=function(){$(H).addClass("share-hover")};E.onmouseout=function(){$(H).removeClass("share-hover")}}else{G.setHTML(A)}this._appendPodcastButtons(G,C,J);if(!(this.options.search!==""&&this._searchInString(this.options.search,J.title)===false&&this._searchInString(this.options.search,J.content)===false)){this._numberDisplayedItems++}},_buildThumbnailList:function(){var D=this._container.getElementsByClassName("item");this._elements=[];var B=this.currentPosition;for(var A=0;A<2;A++){B++;if(B>this.items.length-1){B=0}else{if(B<0){B=this.items.length-1}}this._elements[B]=D[A];var I=this.items[B];I=this._getEnclosures(I);if(this.history[B]){$(D[A]).addClass("read");$(D[A]).removeClass("unread")}else{$(D[A]).addClass("unread");$(D[A]).removeClass("read")}var E=D[A].getElementsByClassName("title")[0].getChildren()[0];D[A].index=B;this._appendPodcastButtons(D[A],B,I);var C=this._escapeHTML(I.title.stripTags());if(this.options.search!==""){C=String.highlight(C,this.options.search)}if(this.options.showStarring===true){var H=UWA.$element(document.createElement("a"));H.href="javascript:;";H.className="share";H.appendChild(document.createTextNode(_("Share")));H.index=B;H.onclick=this._onAddStar.bindAsEventListener(this);E.appendChild(H)}var G=UWA.$element(document.createElement("span"));G.setHTML(C);G.index=B;E.appendChild(G);date=this._getDiffDate(I.date);if(date){var F=UWA.$element(document.createElement("small"));F.className="age";F.setHTML(" - "+date);F.index=B;E.appendChild(F)}E.index=B;E.href=I.link;E.onclick=this._onItemClicked.bindAsEventListener(this);if(this.options.showStarring===true){D[A].onmouseover=function(){var J=this.getElementsByClassName("share")[0];$(J).addClass("share-hover")};D[A].onmouseout=function(){var J=this.getElementsByClassName("share")[0];$(J).removeClass("share-hover")}}if(!(this.options.search!==""&&this._searchInString(this.options.search,I.title)===false&&this._searchInString(this.options.search,I.content)===false)){this._numberDisplayedItems++}}},_buildContent:function(){this._build();this._buildBigOne(this.currentPosition);this._buildThumbnailList()},_onPrevClick:function(){if(this.currentPosition==0){this.currentPosition=this.items.length-1}else{this.currentPosition--}this._buildContent();return false},_onNextClick:function(){if(this.currentPosition==this.items.length-1){this.currentPosition=0}else{this.currentPosition++}this._buildContent();return false},_onItemOverlayClicked:function(B){if(typeof B=="undefined"&&typeof event!="undefined"){B=event}var A=(B.target||B.srcElement);this._embedPlayer(A.index);return false},_embedPlayer:function(A){var C=this.items[A];var B='<object type="application/x-shockwave-flash" data="'+C.video+'" width="200" height="200">                             <param name="movie" value="'+C.video+'" />                             <param name="wmode" value="opaque" />                             <param name="quality" value="high" />                             <param value="true" name="allowfullscreen"/>                             <param name="FlashVars" value="'+C.flashvars||'" />                             <param name="AllowScriptAccess" value="never" />                           </object>';var D=this._container.getElementsByClassName("image")[0];D.innerHTML=B},toElement:function(){this._buildContent();return this._container},getContent:function(){return this.toElement()},colorize:function(A){if(typeof A=="undefined"){A="blank"}this._container.removeClassName(this.color+"Headline");this.color=A;this._container.addClassName(this.color+"Headline")},resize:function(A){this.options.dimensions=A;this._buildContent();return true}});;
Netvibes.UI.FeedView_Gallery=Class.create();Netvibes.UI.FeedView_Gallery.prototype=UWA.extend(new Netvibes.UI.FeedView(),{needPager:false,needResize:true,fullSize:true,currentIndex:0,currentPosition:0,defaultThumbnail:NV_STATIC+"/img/feedreader/default.png",initialize:function(A){this._elements=[];this.setOptions(A);this.options.lookForHtmlThumbnail=true;this._container=UWA.$element(document.createElement("div"));this._container.className="galleryView";this._build();this.items=new Array();this.history=new Array()},_build:function(){this._container.setHTML('<div class="content">                 <div class="top">                     <div class="crop"><div class="image"></div></div>                     <div class="title"><a href="javascript:;"></a></div>                 </div>                 <div class="pager">                     <div class="thumbnail-list"></div>                 </div>                 <div style="clear: both"></div>              </div>              <div class="nv-pager" style="display: block">                  <a class="prev" href="javascript:void(0)" target="_blank">'+_("prev")+'</a>                  <a class="next" href="javascript:void(0)" target="_blank">'+_("next")+'</a>                  <div>                      <p style="margin: 0pt; padding: 0pt; line-height: 0pt; height: 0pt; clear: both;" />                  </div>              </div>');this.totalThumbnails=5;var B=this._container.getElementsByClassName("prev")[0];var A=this._container.getElementsByClassName("next")[0];B.onclick=this._onPrevClick.bindAsEventListener(this);A.onclick=this._onNextClick.bindAsEventListener(this)},addItem:function(A,B,C){this.items[A]=B;this.history[A]=C},_buildBigOne:function(E){this._numberDisplayedItems=0;if(E>this.items.length-1){E=0}else{if(E<0){E=this.items.length-1}}var J=this.items[E];J=this._getEnclosures(J);if(!J.thumbnail){J.thumbnail=this.defaultThumbnail}var A=this._container.getElementsByClassName("image")[0];A.empty();var G=this._container.getElementsByClassName("title")[0].getChildren()[0];G.empty();var D=document.createElement("img");D.src=J.thumbnail;D.index=E;D.style.cursor="pointer";if(typeof J.video!="undefined"&&this.options.allowVideoPlayButton!=true){var B=document.createElement("div");B.style.position="absolute";B.style.width="100%";B.style.left="0px";B.style.top="0px";B.index=E;var C=document.createElement("img");C.src=NV_STATIC+"/img/play_large.png";C.index=E;C.style.cursor="pointer";C.onclick=this._onItemOverlayClicked.bindAsEventListener(this);if(UWA.Client.Engine.ie&&UWA.Client.Engine.version==6){C.src="http://"+NV_HOST+"/img/s.gif";C.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true',src='http://"+NV_HOST+"/img/play_large.png');"}B.appendChild(C)}else{D.onclick=this._onItemClicked.bindAsEventListener(this)}D.onerror=function(){this.src=NV_STATIC+"/img/feedreader/default.png"};A.appendChild(D);if(typeof C!="undefined"){A.appendChild(C)}var I=UWA.$element(document.createElement("span"));var F=this._escapeHTML(J.title.stripTags());if(this.options.search!==""){F=String.highlight(F,this.options.search)}I.setHTML(F);date=this._getDiffDate(J.date);if(date){var H=UWA.$element(document.createElement("small"));H.className="age";H.setHTML(" - "+date);H.index=E;I.appendChild(H)}I.index=E;G.index=E;G.href=J.link;G.onclick=this._onItemClicked.bindAsEventListener(this);G.appendChild(I);if(!(this.options.search!==""&&this._searchInString(this.options.search,J.title)===false&&this._searchInString(this.options.search,J.content)===false)){this._numberDisplayedItems++}},_buildThumbnailList:function(){var D=this._container.getElementsByClassName("thumbnail-list")[0];D.empty();for(var C=this.currentPosition,E=0;E<this.totalThumbnails;E++,C++){if(C>this.items.length-1){C=0}else{if(C<0){C=this.items.length-1}}var F=this.items[C];F=this._getEnclosures(F);if(!F.thumbnail){F.thumbnail=this.defaultThumbnail}thumbnailSize=this.thumbnailSize;if(this.currentIndex==E){thumbnailSize-=10}var G=UWA.$element(document.createElement("div"));G.className="thumbnail";G.style.height=thumbnailSize+"px";G.style.width=thumbnailSize+"px";G.style.lineHeight=thumbnailSize+"px";if(this.currentIndex==E){G.addClassName("selected")}var A=UWA.$element(document.createElement("a"));A.href="#";A.index=E;A.style.marginLeft=parseInt(thumbnailSize/2)-500+"px";A.onclick=this._onThumbnailClicked.bindAsEventListener(this);var B=UWA.$element(document.createElement("img"));B.index=E;B.src=F.thumbnail;B.style.height=this.thumbnailSize+"px";B.onerror=function(){this.src=NV_STATIC+"/img/feedreader/default.png"};A.appendChild(B);G.appendChild(A);D.appendChild(G)}},_selectItem:function(C){this.currentIndex=C;var B=this._container.getElementsByClassName("thumbnail-list")[0].childNodes;for(var D=0,A=B.length;D<A;D++){if(D==this.currentIndex){B[D].addClassName("selected");B[D].style.height=this.thumbnailSize-10+"px";B[D].style.width=this.thumbnailSize-10+"px";B[D].style.lineHeight=this.thumbnailSize-10+"px";B[D].getChildren()[0].style.marginLeft=parseInt((this.thumbnailSize-10)/2)-500+"px"}else{B[D].removeClassName("selected");B[D].style.height=this.thumbnailSize+"px";B[D].style.width=this.thumbnailSize+"px";B[D].style.lineHeight=this.thumbnailSize+"px";B[D].getChildren()[0].style.marginLeft=parseInt((this.thumbnailSize)/2)-500+"px"}}var C=this.currentPosition+this.currentIndex;if(C>this.items.length-1){C-=this.items.length}this._buildBigOne(C)},_onPrevClick:function(){if(this.currentIndex>0){this.currentIndex--;this._selectItem(this.currentIndex)}else{if(this.currentPosition==0){this.currentPosition=this.items.length-1}else{this.currentPosition--}this._buildContent()}return false},_onNextClick:function(){if(this.currentIndex<this.totalThumbnails-1){this.currentIndex++;this._selectItem(this.currentIndex)}else{if(this.currentPosition==this.items.length-1){this.currentPosition=0}else{this.currentPosition++}this._buildContent()}return false},_onThumbnailClicked:function(B){if(typeof B=="undefined"&&typeof event!="undefined"){B=event}var A=(B.target||B.srcElement);this._selectItem(A.index);return false},_buildContent:function(){var A=this.currentPosition+this.currentIndex;if(A>this.items.length-1){A-=this.items.length}this.thumbnailSize=(this.options.dimensions.width-21)/this.totalThumbnails;this._buildBigOne(A);this._buildThumbnailList()},_onItemOverlayClicked:function(B){if(typeof B=="undefined"&&typeof event!="undefined"){B=event}var A=(B.target||B.srcElement);this._embedPlayer(A.index);return false},_embedPlayer:function(A){var C=this.items[A];var B='<object type="application/x-shockwave-flash" data="'+C.video+'" width="200" height="200">                             <param name="movie" value="'+C.video+'" />                             <param name="wmode" value="opaque" />                             <param name="quality" value="high" />                             <param value="true" name="allowfullscreen"/>                             <param name="FlashVars" value="'+C.flashvars||'" />                             <param name="AllowScriptAccess" value="never" />                           </object>';var D=this._container.getElementsByClassName("image")[0];D.innerHTML=B},toElement:function(){this._buildContent();return this._container},getContent:function(){return this.toElement()},setRead:function(){},setUnRead:function(){},colorize:function(A){if(typeof A=="undefined"){A="blank"}this._container.removeClassName(this.color+"Gallery");this.color=A;this._container.addClassName(this.color+"Gallery")},resize:function(A){this.options.dimensions=A;this._buildContent();return true}});;
Netvibes.UI.FeedView_GalleryTwo=Class.create();Netvibes.UI.FeedView_GalleryTwo.prototype=UWA.extend(new Netvibes.UI.FeedView(),{needPager:false,needResize:true,fullSize:true,currentIndex:0,currentPosition:0,defaultThumbnail:NV_STATIC+"/img/feedreader/default.png",initialize:function(A){this._elements=[];this.setOptions(A);this.options.lookForHtmlThumbnail=true;this._container=UWA.$element(document.createElement("div"));this._container.className="galleryView galleryTwoView";this._build();this.items=new Array();this.history=new Array()},_build:function(){this._container.setHTML('<div class="content">                 <div class="top">                     <div class="crop"><div class="image"></div></div>                 </div>                 <div class="middle">                     <div class="share-container"></div>                     <div class="title"><a href="javascript:;"></a></div>                 </div>                 <div class="pager">                     <div class="arrow prev"></div>                     <div class="thumbnail-list"></div>                     <div class="arrow next" style="float: right"></div>                 </div>              <div style="clear: both"></div>              </div>');this.totalThumbnails=5;var A=this._container.getElementsByClassName("arrow");A[0].onclick=this._onPrevClick.bindAsEventListener(this);A[1].onclick=this._onNextClick.bindAsEventListener(this)},addItem:function(A,B,C){this.items[A]=B;this.history[A]=C},_buildBigOne:function(E){this._numberDisplayedItems=0;if(E>this.items.length-1){E=0}else{if(E<0){E=this.items.length-1}}var L=this.items[E];L=this._getEnclosures(L);if(!L.thumbnail){L.thumbnail=this.defaultThumbnail}var A=this._container.getElementsByClassName("image")[0];A.empty();var G=this._container.getElementsByClassName("title")[0].getChildren()[0];G.empty();if(this.options.showStarring===true){var H=this._container.getElementsByClassName("share-container")[0];H.setHTML('<a href="javascript:;" class="share">'+_("Share")+"</a>");var K=this._container.getElementsByClassName("share")[0];K.index=E;K.onclick=this._onAddStar.bindAsEventListener(this)}var D=document.createElement("img");D.src=L.thumbnail;D.index=E;D.style.cursor="pointer";if(typeof L.video!="undefined"&&this.options.allowVideoPlayButton!=true){var B=document.createElement("div");B.style.position="absolute";B.style.width="100%";B.style.left="0px";B.style.top="0px";B.index=E;var C=document.createElement("img");C.src=NV_STATIC+"/img/play_large.png";C.index=E;C.style.cursor="pointer";C.onclick=this._onItemOverlayClicked.bindAsEventListener(this);if(UWA.Client.Engine.ie&&UWA.Client.Engine.version==6){C.src="http://"+NV_HOST+"/img/s.gif";C.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true',src='http://"+NV_HOST+"/img/play_large.png');"}B.appendChild(C)}else{D.onclick=this._onItemClicked.bindAsEventListener(this)}D.onerror=function(){this.src=NV_STATIC+"/img/feedreader/default.png"};A.appendChild(D);if(typeof C!="undefined"){A.appendChild(C)}var J=UWA.$element(document.createElement("span"));var F=this._escapeHTML(L.title.stripTags());if(this.options.search!==""){F=String.highlight(F,this.options.search)}J.setHTML(F+"<br />");date=this._getDiffDate(L.date);if(date){var I=UWA.$element(document.createElement("small"));I.className="age";I.setHTML(date);I.index=E;J.appendChild(I)}J.index=E;G.index=E;G.href=L.link;G.onclick=this._onItemClicked.bindAsEventListener(this);G.appendChild(J);if(!(this.options.search!==""&&this._searchInString(this.options.search,L.title)===false&&this._searchInString(this.options.search,L.content)===false)){this._numberDisplayedItems++}},_buildThumbnailList:function(){var D=this._container.getElementsByClassName("thumbnail-list")[0];D.empty();for(var C=this.currentPosition,E=0;E<this.totalThumbnails;E++,C++){if(C>this.items.length-1){C=0}else{if(C<0){C=this.items.length-1}}var F=this.items[C];F=this._getEnclosures(F);if(!F.thumbnail){F.thumbnail=this.defaultThumbnail}thumbnailSize=this.thumbnailSize;if(this.currentIndex==E){thumbnailSize-=10}var G=UWA.$element(document.createElement("div"));G.className="thumbnail";G.style.height=thumbnailSize+"px";G.style.width=thumbnailSize+"px";G.style.lineHeight=thumbnailSize+"px";if(this.currentIndex==E){G.addClassName("selected")}var A=UWA.$element(document.createElement("a"));A.href="#";A.index=E;A.style.marginLeft=parseInt(thumbnailSize/2)-500+"px";A.onclick=this._onThumbnailClicked.bindAsEventListener(this);var B=UWA.$element(document.createElement("img"));B.index=E;B.src=F.thumbnail;B.style.height=this.thumbnailSize+"px";B.onerror=function(){this.src=NV_STATIC+"/img/feedreader/default.png"};A.appendChild(B);G.appendChild(A);D.appendChild(G)}},_selectItem:function(C){this.currentIndex=C;var B=this._container.getElementsByClassName("thumbnail-list")[0].childNodes;for(var D=0,A=B.length;D<A;D++){if(D==this.currentIndex){B[D].addClassName("selected");B[D].style.height=this.thumbnailSize-10+"px";B[D].style.width=this.thumbnailSize-10+"px";B[D].style.lineHeight=this.thumbnailSize-10+"px";B[D].getChildren()[0].style.marginLeft=parseInt((this.thumbnailSize-10)/2)-500+"px"}else{B[D].removeClassName("selected");B[D].style.height=this.thumbnailSize+"px";B[D].style.width=this.thumbnailSize+"px";B[D].style.lineHeight=this.thumbnailSize+"px";B[D].getChildren()[0].style.marginLeft=parseInt((this.thumbnailSize)/2)-500+"px"}}var C=this.currentPosition+this.currentIndex;if(C>this.items.length-1){C-=this.items.length}this._buildBigOne(C)},_onPrevClick:function(){if(this.currentIndex>0){this.currentIndex--;this._selectItem(this.currentIndex)}else{if(this.currentPosition==0){this.currentPosition=this.items.length-1}else{this.currentPosition--}this._buildContent()}return false},_onNextClick:function(){if(this.currentIndex<this.totalThumbnails-1){this.currentIndex++;this._selectItem(this.currentIndex)}else{if(this.currentPosition==this.items.length-1){this.currentPosition=0}else{this.currentPosition++}this._buildContent()}return false},_onThumbnailClicked:function(B){if(typeof B=="undefined"&&typeof event!="undefined"){B=event}var A=(B.target||B.srcElement);this._selectItem(A.index);return false},_buildContent:function(){var A=this.currentPosition+this.currentIndex;if(A>this.items.length-1){A-=this.items.length}this.thumbnailSize=parseInt((this.options.dimensions.width-60-34)/this.totalThumbnails);this._buildBigOne(A);this._buildThumbnailList()},_onItemOverlayClicked:function(B){if(typeof B=="undefined"&&typeof event!="undefined"){B=event}var A=(B.target||B.srcElement);this._embedPlayer(A.index);return false},_embedPlayer:function(A){var C=this.items[A];var B='<object type="application/x-shockwave-flash" data="'+C.video+'" width="200" height="200">                             <param name="movie" value="'+C.video+'" />                             <param name="wmode" value="opaque" />                             <param name="quality" value="high" />                             <param value="true" name="allowfullscreen"/>                             <param name="FlashVars" value="'+C.flashvars||'" />                             <param name="AllowScriptAccess" value="never" />                           </object>';var D=this._container.getElementsByClassName("image")[0];D.innerHTML=B},toElement:function(){this._buildContent();return this._container},getContent:function(){return this.toElement()},setRead:function(){},setUnRead:function(){},colorize:function(A){if(typeof A=="undefined"){A="blank"}this._container.removeClassName(this.color+"GalleryTwo");this.color=A;this._container.addClassName(this.color+"GalleryTwo")},resize:function(A){this.options.dimensions=A;this._buildContent();return true}});;
if(typeof UWA=="undefined"){var UWA={}}if(typeof UWA.Services=="undefined"){UWA.Services={}}if(typeof UWA.Services.Mail=="undefined"){UWA.Services.Mail={}}if(typeof UWA.mailproxies=="undefined"){UWA.mailproxies={pop:NV_PATH+"proxy/securePopProxy.php?post=1",gmail:NV_PATH+"proxy/securePassProxy.php?post=1",hotmail:NV_PATH+"modules/hotmail/hotmail.php?post=1"}}UWA.Services.Mail.getFromProvider=function(B,A){switch(B){case"pop":case"gmail":case"hotmail":return UWA.Data.request(UWA.mailproxies[B],{method:"POST",type:"json",parameters:A.parameters,onComplete:A.onComplete});default:UWA.log("invalid request type");break}};;
if(typeof UWA=="undefined"){var UWA={}}if(typeof UWA.Services=="undefined"){UWA.Services={}}if(typeof UWA.Services.Search=="undefined"){UWA.Services.Search={}}UWA.Services.Search.getFromProvider=function(D,C){var B="";if(typeof C.lang!="undefined"){B+="&lang="+C.lang}if(typeof C.locale!="undefined"){B+="&locale="+C.locale}if(typeof C.mode!="undefined"){B+="&mode="+C.mode}if(typeof C.category!="undefined"){B+="&category="+C.category}if(typeof C.shop!="undefined"){B+="&shop="+C.shop}switch(C.type){case"websearch":var A="http://"+NV_HOST+"/data/websearch/?q="+encodeURIComponent(C.query)+"&engine="+encodeURIComponent(D)+B;return UWA.Data.request(A,{method:"GET",type:"json",onComplete:C.onComplete,context:C.context});case"blogsearch":var A="http://"+NV_HOST+"/data/blogsearch/?q="+encodeURIComponent(C.query)+"&engine="+encodeURIComponent(D)+B;return UWA.Data.request(A,{method:"GET",type:"json",onComplete:C.onComplete,context:C.context});case"imagesearch":var A="http://"+NV_HOST+"/data/imagesearch/?q="+encodeURIComponent(C.query)+"&engine="+encodeURIComponent(D)+B;return UWA.Data.request(A,{method:"GET",type:"json",onComplete:C.onComplete,context:C.context});case"videosearch":var A="http://"+NV_HOST+"/data/videosearch/?q="+encodeURIComponent(C.query)+"&engine="+encodeURIComponent(D)+B;return UWA.Data.request(A,{method:"GET",type:"json",onComplete:C.onComplete,context:C.context});case"podcastsearch":var A="http://"+NV_HOST+"/data/podcastsearch/?q="+encodeURIComponent(C.query)+"&engine="+encodeURIComponent(D)+B;return UWA.Data.request(A,{method:"GET",type:"json",onComplete:C.onComplete,context:C.context});case"shoppingsearch":var A="http://"+NV_HOST+"/data/shoppingsearch/?q="+encodeURIComponent(C.query)+"&engine="+encodeURIComponent(D)+B;return UWA.Data.request(A,{method:"GET",type:"json",onComplete:C.onComplete,context:C.context});case"opensearch":var A="http://"+NV_HOST+"/data/opensearch/?q="+encodeURIComponent(C.query)+"&url="+encodeURIComponent(C.url)+B;return UWA.Data.request(A,{method:"GET",type:"json",onComplete:C.onComplete,context:C.context});default:UWA.log("invalid request type");break}};UWA.Data.getFromProvider=UWA.Services.Search.getFromProvider;;
if(typeof UWA=="undefined"){UWA={}}if(typeof UWA.Services=="undefined"){UWA.Services={}}UWA.Services.FeedHistory={};UWA.Services.FeedHistory.build=function(E,B){if(B.history){if(B.history.lastPostId){UWA.Services.FeedHistory.upgrade(B)}}else{B.history={};if(E&&E!=""){if(E.test(/,/)){var A=E.split(",")}else{var A=E.split(":");if(A[A.length-1]==1||A[A.length-1]==0){A=[]}}for(var D=0,C=A.length;D<C;D++){B.history[A[D]]=true}}}UWA.Services.FeedHistory.cleanup(B)};UWA.Services.FeedHistory.cleanup=function(B){var A={};var C=B.items.length;for(var D=0;D<C;D++){if(B.history[B.items[D].id]){A[B.items[D].id]=B.history[B.items[D].id];continue}if(B.history[B.items[D].id_old]){A[B.items[D].id]=B.history[B.items[D].id_old];continue}}B.history=A};UWA.Services.FeedHistory.getString=function(C){if(!C.history){return""}var D="";var B="";for(var A in C.history){if(!C.history[A]){continue}D+=B+A;B=","}return D};UWA.Services.FeedHistory.getNbNew=function(B,A){if(!B||!B.history){return 0}var C=B.items.length;var E=0;A=C<A?C:A;for(var D=0;D<A;D++){if(!B.history[B.items[D].id]){E+=1}}return E};UWA.Services.FeedHistory.setRead=function(B,A){if(typeof B.history=="undefined"){return }B.history[B.items[A].id]=true};UWA.Services.FeedHistory.setUnRead=function(B,A){if(typeof B.history=="undefined"){return }delete B.history[B.items[A].id]};UWA.Services.FeedHistory.isRead=function(B,A){if(B.history[B.items[A].id]){return true}return false};if(typeof App=="undefined"){App={}}if(typeof App.Rss=="undefined"){App.Rss={}}App.Rss.buildHistory=UWA.Services.FeedHistory.build;App.Rss.getHistoryString=UWA.Services.FeedHistory.getString;App.Rss.getHistoryNbNew=UWA.Services.FeedHistory.getNbNew;;
UWA.Templates.multifeeds=function(A){this.widget=(A?A:widget);this.tabSet=null;this.miniTabs=null;this.currentId=0;this.firstLaunch=true;this.selectedTab=0};UWA.Templates.multifeeds.prototype={createFromXML:function(A){var B={};B.header=this.getHeader(A);B.tabSet=this.getTabset(A);B.provider=UWA.XMLTemplate.getElement("feeds",A).getAttribute("provider");B.container=this.widget.createElement("div").injectBefore(A);A.remove();return this.createFromJSON(B)},createFromJSON:function(A){this.tabSet=A.tabSet;this.header=A.header;this.widget.setValue("provider",A.provider);this.container=(typeof A.container=="string"?this.widget.body.getElement(A.container):A.container);this.init()},getTabset:function(B){var C={tabList:[],tabContent:{},container:null};var A=UWA.XMLTemplate.getElements("feed",B);A.forEach(function(E,D){C.tabList.push({"for":D,text:E.getAttribute("text")});C.tabContent[D]={src:E.getAttribute("url")}});return C},getHeader:function(C){var D={background:null,img:[{src:null}],container:null};var B=UWA.XMLTemplate.getElement("header",C);if(B){D.background=B.getAttribute("background");var A=UWA.XMLTemplate.getElements("img",C);D.img=[];A.forEach(function(E,G){var F={};F.src=A[G].getAttribute("src");F.position=A[G].getAttribute("position");D.img.push(F)})}return D},init:function(){var A=this;var B=this.widget;B.onLoad=function(){B.body.setStyle("padding",0);A.load()};B.onRefresh=this.displayTab.bindWithEvent(this);B.updateDisplay=this.displayTab.bindWithEvent(this);B.mergePreferences([{name:"category",type:"hidden",label:"Category",onchange:"onChangeCategory"},{name:"nbTitles",type:"range",label:"Number of items to display",defaultValue:"3",step:"1",min:"1",max:"25",onchange:"updateDisplay"},{name:"details",type:"boolean",label:"Show more details",defaultValue:"true",onchange:"updateDisplay"},{name:"showDate",type:"boolean",label:"Show post date",defaultValue:"true",onchange:"updateDisplay"},{name:"openOutside",type:"boolean",label:"Open directly on the site",defaultValue:"false",onchange:"updateDisplay"},{name:"videoAutoPlay",type:"hidden",label:"Show the video at startup",defaultValue:"false"},{name:"numberTabs",type:"hidden",defaultValue:"4"},{name:"selectedTab",type:"hidden",defaultValue:"0"},{name:"title",type:"hidden",defaultValue:"MultipleFeeds"},{name:"lookForHtmlThumbnail",type:"hidden",defaultValue:"true"},{name:"provider",type:"hidden",defaultValue:"google"},{name:"numberTabs",type:"hidden",defaultValue:"4"},{name:"listOrder_"+B.getValue("provider"),type:"hidden",defaultValue:""}])},load:function(){var E=this.widget;this.container.empty();this.createHeader();var F=(this.tabSet.tabList.length>E.getInt("numberTabs"))?E.getInt("numberTabs"):this.tabSet.tabList.length;this.listOrder=this.getListOrder(F);this.miniTabs=new UWA.Controls.TabView({dataKey:"for",autohideDropdowns:true,softPadding:true});for(var D=0;D<F;D++){var C=this.listOrder[D];var A=this.tabSet.tabList.slice(0);A.splice(C,1);A.unshift(this.tabSet.tabList[C]);this.miniTabs.addTab(D,A)}this.setListOrder(this.listOrder);this.miniTabs.observe("activeTabChange",this.onActiveTabChanged.bind(this));this.tabSet.container=this.widget.createElement("div",{styles:{clear:"both"}}).addClassName("tabSet").inject(this.container);this.miniTabs.appendTo(this.tabSet.container);var B=this.widget.getValue("selectedTab");if(B>F){this.widget.setValue("selectedTab",0)}this.miniTabs.selectTab(B);this.displayTab()},createHeader:function(){if(this.header){this.header.container=this.widget.createElement("div").addClassName("header").setStyle("textAlign","center").inject(this.container);this.widget.body.style.background=this.header.background;for(o=0;o<this.header.img.length;o++){i=this.header.img[o];var A=this.widget.createElement("img",{src:i.src});if(i.position!="middle"){A.setStyle("float",i.position)}A.inject(this.header.container)}}},setListOrder:function(A){this.widget.setValue("listOrder_"+this.widget.getValue("provider"),A.join(","))},getListOrder:function(C){var E=this.widget;var D=E.getValue("listOrder_"+E.getValue("provider"));if(typeof D=="undefined"||D==""||D==0||D==null||this.tabSet.tabList.length<D.split(",").length){D=[];for(var B=0;B<C;B++){D.push(B)}return D}if(this.tabSet.tabList.length==D.split(",").length+1){D+=(","+(C-1))}if(typeof D!="string"){E.setValue("listOrder_"+E.getValue("provider"),"");return this.getListOrder(C)}var A=D.split(",");return A},onActiveTabChanged:function(A,D){var C=this.widget;if(A==C.getValue("selectedTab")&&this.firstLaunch==false){for(var B=0;B<this.listOrder.length;B++){if(D["for"]==this.listOrder[B]){this.miniTabs.selectKey(B,this.listOrder[A],false);this.listOrder[B]=this.listOrder[A];break}}}this.firstLaunch=false;this.currentId=D["for"];this.listOrder[parseInt(A)]=this.currentId;this.setListOrder(this.listOrder);C.setValue("selectedTab",A);this.displayTab()},displayTab:function(){var A=this.tabSet.tabContent[this.currentId];if(A.src){var B=new UWA.Controls.Feed(this.widget);B.setOptions(this.getOptions());B.display(A.src,this.miniTabs.contentArray[this.widget.getInt("selectedTab")])}else{if(A.html){this.miniTabs.contentArray[this.currentId].setHTML(A.html)}}},getOptions:function(){var B=this.widget;var A={};["nbTitles"].forEach(function(C){A[C]=B.getValue(C)});["showDate","details","openOutside","lookForHtmlThumbnail"].forEach(function(C){A[C]=B.getBool(C)});return A}};;
UWA.extend(UWA.Environment.prototype,{initialize:function(){this.netvibes={inline:true,iframed:false}},map:function(A,B){this.events=A;this.obj=B},onRegisterModule:function(){var C=this.module;this.obj.widget=C;if(typeof this.obj.dataObj.id!="undefined"){C.id=this.obj.dataObj.id}else{C.id=Math.round(Math.random()*100000)}for(var B in this.obj.dataObj.data){if(typeof this.obj.dataObj.data[B]=="string"){C.data[B]=this.obj.dataObj.data[B]}}UWA.extend(this.events,{refresh:function(){C.callback("onRefresh")},edit:function(){C.callback("onEdit")},doSearch:function(D){if(D!=""){C.callback("onSearch",D)}else{C.setSearchResultCount(false);C.callback("onResetSearch")}},print:function(){if(C.onPrint){return C.onPrint()}},resize:function(D){C.callback("onResize")},colorize:function(){C.data.color=C.environment.obj.dataObj.data.color;C.callback("onColorize")},setAllAsReadOnMouseDown:function(){C.setUnreadCount(0);C.callback("onResetUnreadCount")},onKeyboardEnter:function(){App.keyboardFocus="module.action";C.callback("onKeyboardEnter")},onKeyboardAction:function(D){if(D=="esc"){App.keyboardFocus="module";return }C.callback("onKeyboardAction",D)},onCloseEdit:function(){C.callback("onCloseEdit")},updateTheme:function(D){C.callback("onUpdateTheme",D)},unload:function(){delete C.autoRefreshInterval},remove:function(){C.callback("onRemove")}});this.html.title=this.obj.elm_title;this.html.edit=this.obj.elm_editContent;this.html.body=this.obj.elm_moduleContent;this.html.icon=this.obj.elm_ico;this.html.header=this.obj.elm_moduleHeader;this.html.module=this.obj.elm_module;for(var A in this.html){C.elements[A]=UWA.$element(this.html[A])}C.body=C.elements.body;C.body.setAttribute("id","m_"+C.id);C.title=C.elements.title.innerHTML;if(window.App&&App.lang){C.lang=App.lang}if(window.User&&User.locale){C.locale=User.locale}else{if(window.App&&App.locale){C.locale=App.locale}}if(window.App&&App.dirRTL){C.dir="rtl"}C.isNew=this.obj.isNew();C.readOnly=(this.obj.readOnly?this.obj.readOnly:false);C.userId=User.id;this.obj.dataObj.extendSearch=0;this.obj.refreshMode=true;this.setDelayed("launchModule",this.launchModule,1)},endEdit:function(){this.obj.endEditMode()},showEdit:function(){this.obj.showEdit()},getData:function(A){if(A=="feedUrl"&&this.obj.dataObj.feedUrl){return this.obj.dataObj.feedUrl}if(A=="_feedreaderTitle"&&this.obj.dataObj.title){return this.obj.dataObj.title}return this.obj.dataObj.data[A]},setData:function(A,B){if(A=="feedUrl"||A=="_feedreaderTitle"){if(A=="_feedreaderTitle"){A="title"}if(this.obj.dataObj[A]!=B){this.widget.log("setDataSpecial:"+A+":"+B);this.obj.dataObj[A]=B;if(typeof this.obj.dataObj.data[A]!="undefined"){delete this.obj.dataObj.data[A]}this.setDelayed("saveDatas",this.saveDatas,1000)}}else{if(this.obj.dataObj.data[A]!=B){this.widget.log("setData:"+A+":"+B);this.obj.dataObj.data[A]=B;this.setDelayed("saveDatas",this.saveDatas,1000)}}if(this.widget.sendToFrame){this.widget.sendToFrame("setValue",A,B)}},deleteData:function(A){this.widget.log("deleteData:"+A);delete this.obj.dataObj.data[A];this.setDelayed("saveDatas",this.saveDatas,1000);if(this.widget.sendToFrame){this.widget.sendToFrame("deleteValue",A)}return true},saveDatas:function(A){this.obj.save();if(typeof A=="function"){this.setDelayed("saveCallback",A,1000,false)}},setTabUnread:function(A){App.setTabUnread(this.obj.dataObj.id,this.obj.dataObj.tab,A)},setSearchResultCount:function(A){if(A===0){this.obj.collapse("nosave");this.obj.elm_module.addClass("transparent")}else{if(A!=false){if(this.obj.dataObj.tab==App.selectedTab){this.obj.show()}this.obj.expand("nosave");this.obj.elm_module.removeClass("transparent")}}this.setTabUnread(A);if(A>0){this.widget.setTitle(this.widget.title,'<span class="result">('+A+")</span>")}else{if(A===0){this.widget.setTitle(this.widget.title,'<span class="result">('+_("no results")+")</span>")}else{this.widget.setTitle(this.widget.title,"")}}},setUnreadCount:function(C){var A=this.widget.elements.title.getElementsByClassName("unread")[0];if(typeof A=="undefined"){var A=this.widget.createElement("a");A.title=_("Read All");A.addClassName("unread");var B=this.widget.createElement("span");B.addClassName("unread");A.appendChild(B);if("right"==App.pageCustom.unreadPosition){this.widget.elements.title.appendChild(A);A.style.marginLeft="0.5ex"}else{this.widget.elements.title.insertBefore(document.createTextNode(" "),this.widget.elements.title.firstChild);this.widget.elements.title.insertBefore(A,this.widget.elements.title.firstChild);A.style.marginRight="0.5ex"}Event.observe(A,"mousedown",this.resetUnreadCount.bind(this),false);Event.observe(A,"mousedown",function(D){D.stop()},false)}if(C==0){A.hide()}else{A.firstChild.setHTML("("+C+")");A.show()}this.setTabUnread(C);this.obj.fireEvent("unreadWasSetted",C)},resetUnreadCount:function(){this.widget.setUnreadCount(0);this.widget.callback("onResetUnreadCount")},setTitle:function(A){A=A.stripTags();if(A!=this.obj.dataObj.title){this.obj.dataObj.title=A;this.obj.save();this.obj.fireEvent("titleWasChanged")}this.handleLinksInTitle()},handleLinksInTitle:function(E){var D=this.html.title.getElementsByTagName("a");for(var B=0,C=D.length;B<C;B++){var A=D[B];A.target="_blank";Event.observe(A,"mousedown",function(F){F.stop()},false)}},getTitle:function(){return this.obj.dataObj.title},handleLinks:function(){var A=this.module.body.getElementsByTagName("a");for(var B=0,C;C=A[B];B++){C.target="_blank"}},onUpdateBody:function(){this.setDelayed("handleLinks",this.handleLinks,100)},onUpdatePreferences:function(){this.obj.options.editable=this.widget.preferences.some(function(A){return A.type!="hidden"})},setIcon:function(A){this.obj.updateFavicon(A)},getHistory:function(){return this.obj.dataObj.history},setHistory:function(A){this.obj.dataObj.history=A},saveHistory:function(){this.obj.saveHistory()},addStar:function(A){switch(this.obj.dataObj.moduleName){case"RssReader":A.srcType="feed";A.srcTitle=this.obj.dataObj.title;A.srcUrl=this.obj.dataObj.feedUrl;break;case"UWA":A.srcType="uwa";A.srcTitle=this.obj.dataObj.title;A.srcUrl=this.obj.dataObj.data.moduleUrl;break;case"MultipleFeeds":if(this.obj.dataObj.data.url){A.srcType="uwa";A.srcTitle=this.obj.dataObj.title;A.srcUrl="http://"+NV_HOST+"/modules/multipleFeeds/multipleFeeds.php?provider=custom&url="+encodeURIComponent(this.obj.dataObj.data.url)}else{A.srcType="multiplefeeds";A.srcTitle=this.obj.dataObj.title;A.srcUrl=this.obj.dataObj.data.provider}break;default:A.srcType="uwa";A.srcModule=this.obj.dataObj.moduleName;A.srcTitle=this.obj.dataObj.title;break}A.moduleId=this.obj.dataObj.id;if(this.obj.dataObj.widgetId){A.widgetId=this.obj.dataObj.widgetId}App.Share.show(A)},onLoadComplete:function(){this.obj.onLoadModule()}});UWA.Native=UWA.Environment;UWA.proxies={api:"/proxy/api2Proxy.php",rss:"/proxy/xmlProxy.php",ajax:"/proxy/ajaxProxy.php",feed:"/proxy/feedProxy.php",xml:"/data/xml/"};UWA.feedCallbackType="feed";;
App.Start=function(){if(!App.visit&&App.use_feedbackend){var H=new Element("ul",{id:"view-switcher",html:'<li id="view-switcher-hide"><a href="javascript:void(0)">'+_("view")+'</a></li><li id="view-switcher-widgets"><a href="javascript:void(0)">'+_("widgets")+'</a></li><li id="view-switcher-smart"><a href="javascript:void(0)">'+_("smart reader")+"</a></li>"});H.inject($("topLinks"),"before");if(App.viewType=="1"){$("view-switcher-widgets").addClass("selected")}else{$("view-switcher-smart").addClass("selected")}var D=true;$("view-switcher-hide").addEvent("click",function(){if(D){$("view-switcher-widgets").setStyle("display","none");$("view-switcher-smart").setStyle("display","none");D=false}else{$("view-switcher-widgets").setStyle("display","inline");$("view-switcher-smart").setStyle("display","inline");D=true}return false});$("view-switcher-widgets").addEvent("click",function(){App.Request.saveUserData("page.viewType",{data:{type:1},onSuccess:function(){document.location.href=document.location.href.substring(0,document.location.href.indexOf("#"))}});App.report("click.rder.widget");return false});var M=function(){if(!User.custom.closeNewSmartReaderTooltip||User.custom.closeNewSmartReaderTooltip=="0"){User.custom.closeNewSmartReaderTooltip=1;App.saveUserCustom()}App.Request.saveUserData("page.viewType",{data:{type:2},onSuccess:function(){document.location.href=document.location.href.substring(0,document.location.href.indexOf("#"))}});App.report("click.rder");return false};$("view-switcher-smart").addEvent("click",M);var N=$("tooltip-new-smartreader");if(N){N.setStyle("display","block");N.getElement(".close").addEvent("click",function(){App.pageCustom.enableFx==1?N.fade("out"):N.fade(0);User.custom.closeNewSmartReaderTooltip=1;App.saveUserCustom();return false});$("btn-tooltip-new-smartreader").addEvent("click",M)}}if(!App.Start.checkCookies()||!App.Start.checkBrowser()){return false}App.dirRTL=(document.documentElement&&document.documentElement.dir=="rtl");App.Panel.initialize();App.addIframes();if(document.location.hash=="#signup"&&!App.registeredUser){App.showSignup()}else{if(document.location.hash=="#activeUniverse"&&App.registeredUser&&!User.universe){App.showCreateUniverseWizard()}}if(App.isPremium()){Element.addClassName(document.body,"premium")}else{if(window.top.location==window.location){App.checkSmallDisplay();App.setBackButton()}else{App.Request.newRequest({url:"/partner/iframe.php",onComplete:function(Q){if(Q!="allowed"){if(!window.location.hostname.match(/\.(local|nvdev)/)){var O=window.location.protocol+"//"+window.location.hostname+window.location.pathname;var P="utm_source="+encodeURIComponent(document.referrer)+"&utm_medium=web&utm_campaign=framebusting";if(!window.location.search||window.location.search==""){O+="?"+P}else{O+=window.location.search+"&"+P}if(window.location.hash&&window.location.hash!=""){O+=window.location.hash}window.top.location.href=O}}}}).POST({referrer:document.referrer})}}var I=new Tips($$("#top li[title]"));var K=$("collapseExpand");if(K){K.onclick=App.collapseExpand.bindAsEventListener(K)}if($("join-now")&&!App.registeredUser&&!App.isPremium()){$("join-now").setStyle("display","block")}if(App.enableStats){var A=function(O){O.stop();Cookie.set(O.target.id,true);self.location.href=O.target.href};if($("userGoToUniverse")){$("userGoToUniverse").addEvent("click",A)}if($("userGoToPrivatePage")){$("userGoToPrivatePage").addEvent("click",A)}if(Cookie.get("userGoToUniverse")){Cookie.remove("userGoToUniverse");App.report("click.adc.gopubpage",{locale:App.locale})}if(Cookie.get("userGoToPrivatePage")){Cookie.remove("userGoToPrivatePage");App.report("click.adc.goprivpage",{locale:App.locale})}}var B=$("footer-toggle");if(B){B.setStyle("display","block");$$("#footer-toggle a").addEvent("click",function(){var O=$("footer");if(O.hasClass("footer-expanded")){O.removeClass("footer-expanded");this.set("text",_("Expand"));App.pageCustom.footerExpanded=0}else{O.addClass("footer-expanded");this.set("text",_("Collapse"));App.pageCustom.footerExpanded=1}App.savePageCustom()})}var J=$("footerLink_home");if(J){J.innerHTML=_("Set Netvibes as your startpage");J.onclick=function(){if(Browser.isIE){this.style.behavior="url(#default#homepage)";this.setHomePage("http://www.netvibes.com")}else{App.showSetAsStartPage()}return false}}if(typeof pageTracker!="undefined"){$$("#footer a").addEvent("click",function(O){if(this.id=="footerLink_home"){return }O.stop();pageTracker._link(this.href)})}var G=$("userSettings");if(G){G.onclick=function(){SettingsPanel.open();return false}}App.pageTitle=document.title;App.Start.setProfileLink();if(User.id){setTimeout('App.Request.saveUserData("lastAccess")',4000)}App.attachTitleEvents();App.Search.attachEvents();if(App.isPremium()){App.defaultSettings.searchTabShow=0}App.pageCustom=$merge(App.defaultSettings,App.userData.custom);if(App.pageCustom.numCol){delete App.pageCustom.numCol}var F=Cookie.get("undoTheme");if(F){Cookie.remove("undoTheme");if(F=JSON.decode(F)){App.Theme.undoTheme.data=F;App.Theme.undoTheme()}}App.Start.initNotificationMessages();if(App.queryStart!=""){App.pageCustom.hideSearch=0}if(App.searchBox){App.searchBox.style.visibility=((App.pageCustom.hideSearch&&App.pageCustom.hideSearch==1)||App.staticUniverse)?"hidden":"visible"}if(App.pageCustom.bodyBackground){App.insertCssFile("/themes/base/noborder.css")}if(/^(zh|ko|ja)$/.test(App.shortLang)){window.addEvent("load",App.SearchTab.positionForm);App.insertCssFile("/themes/base/loc-"+App.shortLang+".css")}Event.observe(document,"keydown",App.keyboardHandler);User.email=App.userData.userEmail;if(App.userData.emailConfirmed){User.emailConfirmed=true}User.feedsId=App.userData.userFeeds;if(document.location.hash=="#invite-friends"){App.Panel.toggle("Friends");App.Panel.setActiveTopBar($("userFriends"));App.Panel.Friends.tabs.selectTab("inviteFriends")}if(document.location.hash=="#view-profile"){App.Panel.toggle("Profile");App.Panel.setActiveTopBar($("userProfile"))}if(document.location.hash=="#settings"&&!App.visit){SettingsPanel.open()}if(document.location.hash=="#widgets"&&!App.visit){App.Panel.AddContent.willOpenOnCategoryId=1;App.Panel.open("AddContent")}var C=Cookie.get("registered");if(C==1){if(!User.universe){App.showMessageBox("ConfirmRegistered")}Cookie.remove("registered")}else{if(C==2){App.showMessageBox("FindFriends");Cookie.remove("registered")}}if(!$defined(App.pageCustom.welcomeMessage)){App.pageCustom.welcomeMessage="1";if(User.custom.announcement.contains(100)){App.pageCustom.welcomeMessage="0";User.custom.announcement.remove(100);App.saveUserCustom()}}if(!App.visit&&!C){if(!App.registeredUser&&(!App.pageCustom.welcomeMessage.toInt()||!App.wizardCustomEnabled())){if(!User.username){App.showMessageBox("SaveYourPage")}}else{if(App.pageCustom.welcomeMessage.toInt()&&App.wizardCustomEnabled()){if(!App.subscribeOnLoad&&(!App.isPremium()&&App.wizardCustomByDefault.contains(App.locale)||App.isPremium()&&App.PUWithWizardCustomByDefault.contains(App.brand))){App.showWizardCustomExtended()}else{App.showMessageBox("Welcome")}}}}if(!App.visit){App.Panel.Timeline.setUnreadCount(App.userData.unreadActivities||0);if(User.numFriends>1){App.Panel.Timeline.unreadInterval=App.Panel.Timeline.getUnreadCount.periodical(User.numFriends>5?600000:900000)}}if(User.custom.askSetStartPage!="false"&&User.custom.askSetStartPage!="true"){User.custom.askSetStartPage="true"}if(!App.subscribeOnLoad&&!App.staticUniverse&&!App.visit&&!App.isPremium()&&User.custom.askSetStartPage=="true"){App.Start.showSetNetvibesAsHomepage()}if(App.isPremium()){$(document.body).addEvent("mousemove",function(O){App.premium.mouse=O.page})}App.Start.initSelectPages();var E=App.getGmtOffset();if(Cookie.get("tz")!=E){Cookie.set("tz",E,{path:"/",duration:60})}if(App.customTheme){App.updateDynamicTheme.periodical(1800000)}if(App.updates&&!App.subscribe&&!App.discoverNewWidgets){if(App.updates.auto){new App.UI.TopNotification({overlay:false,target:$("userPages"),text:_("{0} page update(s) have been applied").format(App.updates.count)})}else{new App.UI.TopNotification({overlay:false,target:$("userPages"),text:_("{0} update(s) available for this page").format(App.updates.count),onClick:function(){App.Request.saveUserData("page.dismiss-update-notification",{onComplete:function(){window.location=App.updates.url}})},onClose:function(){App.Request.saveUserData("page.dismiss-update-notification")}})}}if(App.subscribeOnLoad&&!App.staticUniverse){App.Subscribe.doSubscribe()}else{if(!App.isSmartReader){var L=$("pageLoading");if(L){L.destroy()}App.Start.initTabSearch(App.SearchTab.attachEvents);App.ColManager=new App.Columns($("modulesArea"),{enableResize:(!App.staticUniverse)});App.ColManager.updateLayout(true);App.Start.createTabs();App.Start.loadModules()}else{App.Start.initTabSearch(App.SmartReader.Search.attachEvents);App.SmartReader.initialize()}}};App.Start.initTabSearch=function(F){var E=new Element("form",{id:"tabSearchForm","class":"autoclear",styles:{display:App.pageCustom.searchTabShow=="1"?"block":"none"}}).addEvent("submit",F);var A='<div><fieldset><ul id="engineSelector"><li><label for="tabSearchInput" class="google">Google</label></li></ul><input type="text" class="text search defaultText" id="tabSearchInput" name="q" /></fieldset><input type="submit" value="'+_("Google Search")+'" class="nv-button" id="tabSearchSubmit" /></div>';E.set("html",A);if(App.pageCustom.searchTabAtTop==1){E.inject($("header"),"top").addClass("atTop")}else{E.inject($("pageTitle"),"after").addClass("atBottom")}var B=$("tabSearchSubmit");var C=$("tabSearchInput");var D=new Element("img",{src:App.getStaticUrl("/img/clear.gif"),title:_("Clear"),id:"tabSearchClear"});D.setStyle(App.dirRTL?"left":"right","3px");D.inject(E.getElementsByTagName("FIELDSET")[0],"bottom");D.hide();D.addEvent("click",function(G){C.value="";this.hide();if(E.style.display!="none"&&$("application").getComputedStyle("display")!="none"){C.focus()}});C.addEvent("keyup",function(G){this.value==""?D.hide():D.show()});App.SearchTab.positionForm();if(E.style.display!="none"&&$("application").getComputedStyle("display")!="none"){C.focus()}};App.Start.initNotificationMessages=function(){if($type(User.custom.announcement)!="array"){User.custom.announcement=JSON.decode(User.custom.announcement);if($type(User.custom.announcement)!="array"){User.custom.announcement=[]}}if(!App.newUser&&!App.visit&&!App.isPremium()){if(App.shortLang=="fr"){App.lastMessage(16,"Créez et partagez vos propres thèmes : {0}En savoir plus{1}".format('<a target="_blank" href="http://blog.netvibes.com/fr/creez-et-partagez-vos-propres-themes/">',"</a>"),true)}else{App.lastMessage(16,_("Design and share your own themes : {0}Learn more{1}").format('<a target="_blank" href="http://blog.netvibes.com/design-and-share-your-own-themes/">',"</a>"),true)}if(App.locale=="us"){App.lastMessage(17,"Want Netvibes for your business? {0}Learn more here{1}.".format('<a href="http://business.netvibes.com/?utm_source=startpage&utm_medium=web&utm_content=200907&utm_campaign=yellowbar">',"</a>"),true);var A=App.lastMessage(18,"{0}Try the new StubHub widget{1} to find tickets for your favorite sports teams".format('<a href="http://www.netvibes.com/subscribe.php?module=UWA&moduleUrl=http%3A%2F%2Fnvmodules.typhon.net%2Fofficial%2FstubHub%2FstubHub.html&ecoId=306255&campaignId=262">',"</a>"),true);if(A){A.getElement("a").addEvent("click",function(D){D.stop();var B={widgetId:306255,moduleName:"UWA",title:"StubHub! - All sports",data:{moduleUrl:"http://nvmodules.typhon.net/official/stubHub/stubHub.html"},campaignActive:true,campaignId:262};var C=new Module($extend($unlink(B),{admin:false}),{nativise:true});if(C.addModuleToPage()){App.moduleList.push(C);App.Modules.store(C)}})}}if(App.locale=="fr"){var A=App.lastMessage(19,"Retrouvez tous vos bons plans recettes avec le {0}widget Croquons la vie !{1}".format('<a href="http://www.netvibes.com/subscribe.php?module=UWA&moduleUrl=http%3A%2F%2Fwww.croquonslavie.fr%2FWidget%2FCLVWidget.html&ecoId=297692&campaignId=380">',"</a>"),true);if(A){A.getElement("a").addEvent("click",function(D){D.stop();var B={widgetId:297692,moduleName:"UWA",title:"Croquons la vie avec Nestlé",data:{moduleUrl:"http://www.croquonslavie.fr/Widget/CLVWidget.html"},campaignActive:true,campaignId:380};var C=new Module($extend($unlink(B),{admin:false}),{nativise:true});if(C.addModuleToPage()){App.moduleList.push(C);App.Modules.store(C)}})}}}if(App.isPremium()&&App.brand=="numericable"){if(!User.custom.announcement.contains(101)&&(App.newUser||!App.registeredUser)){User.custom.announcement.push(101);App.saveUserCustom()}if(App.shortLang!="fr"){App.messageWithID(101,_("Click on {0}Settings{1} to customize the search feature.").format('<a href="javascript:void(0)" onclick="SettingsPanel.open(\'general\')">',"</a>")+"<br />"+_("(You can for instance have results always in the same tab)"))}else{App.messageWithID(101,'Cliquez sur <a href="javascript:void(0)" onclick="SettingsPanel.open(\'general\')">Options</a> pour personnaliser la fonction de recherche.<br /> (Vous pouvez, par exemple, avoir les résultats toujours dans le même onglet)')}}};App.Start.initSelectPages=function(){var C=$("userPages");if(C){C.addEvents({mouseenter:function(){this.addClass("hover")},mouseleave:function(){this.removeClass("hover")}});if(User.registered&&!User.universe){C.getElement(".public-page a").addEvent("click",function(F){F.stop();App.showCreateUniverseWizard()})}for(var B=0,E;E=App.pageList[B];B++){if(E.urlType!="iframe"){continue}var A=C.getElements("."+E.brand).length;if(A>1){var D=C.getElement("#page-"+E.pid+" a");D.addEvent("click",function(G){G.stop();var F=this.getParent("li").get("id").substr(5);App.Request.saveUserData("openPage",{data:{pid:F},onComplete:function(I){var H=JSON.decode(I);if(H.success){var J=App.getPageById(F);window.top.location.href=J.url}}})})}}}};App.Start.showSetNetvibesAsHomepage=function(){if(App.newUser){return }setTimeout(function(){$("alertBar").show();if(App.isSmartReader){App.SmartReader.resizeApp()}},2000);$("alertBar").innerHTML="";var E=new Element("div",{"class":"content"}).inject($("alertBar"));var B=new Element("div",{"class":"actions"}).inject(E);var C=new Element("a",{href:"javascript:void(0)",text:_("Remind me later"),events:{click:(function(){$("alertBar").hide()})}}).inject(B);new Element("span",{text:" | "}).inject(B);var F=new Element("a",{href:"javascript:void(0)",text:_("Don't show this again"),events:{click:(function(){User.custom.askSetStartPage="false";App.saveUserCustom();$("alertBar").hide()})}}).inject(B);var I=new Element("a",{href:"javascript:void(0)",events:{click:(function(){$("alertBar").hide();if(App.isSmartReader){App.SmartReader.resizeApp()}})}}).adopt(new Element("img",{src:"/img/alert-bar-close.png"})).inject(B);if(Browser.isFirefox){E.style.margin="0px auto";B.style.margin="18px 24px";var G=new Element("div",{"class":"description"}).inject(E);var H=new Element("div",{"class":"text"}).adopt(new Element("h1",{text:_("Set netvibes as my default homepage")})).adopt(new Element("div",{text:_("Drag and drop the netvibes icon onto the home button")})).inject(G);var A=new Element("div",{"class":"image"}).adopt(new Element("a",{href:"http://"+NV_HOST,events:{click:(function(){return false})}}).adopt(new Element("img",{src:"/img/startpage-firefox.png"}))).inject(G)}else{var D=new Element("a",{href:"javascript:void(0)","class":"button",events:{click:(function(){if(Browser.isIE){this.style.behavior="url(#default#homepage)";this.setHomePage("http://"+NV_HOST)}else{App.showSetAsStartPage()}return false})}}).adopt(new Element("span",{text:"Set netvibes as my default homepage"})).inject(E)}};App.Start.checkCookies=function(){if(!Browser.Features.cookie){var D=_("It seems cookies are either disabled or not configured correctly on your browser right now. To use your personalized startpage, <a>change your cookies options in your browser</a>, then try again.");var A="http://faq.netvibes.com/troubleshooting/most_common_problems?s=cookie";if(App.shortLang=="fr"){A="http://faq.netvibes.com/fr/problemes_et_anomalies/problemes_courants";D=("Il semble que les cookies soient désactivés ou mal configurés actuellement sur votre navigateur. Pour utiliser votre page personnalisée, <a>veuillez activer les cookies dans les options de votre navigateur</a>, puis essayez à nouveau.")}var B=window.top.location!=window.location;if(B){D=D.replace("<a>","").replace("</a>","")}else{D=D.replace("<a>",'<a href="'+A+'">')}if(Browser.isFirefox||Browser.isSafari){var E=String.format("/img/cookies-{0}-{1}.png",Browser.Engine.name,App.shortLang=="fr"?"fr":"en");D+='<img src="'+App.getStaticUrl(E)+'" class="screenshot" alt="" />'}var C=$("pageLoading")||new Element("div").inject("modulesArea","top");C.set({id:"pageError",html:"<p>"+D+"</p>"});return false}return true};App.Start.checkBrowser=function(){if((Browser.Engine.webkit&&Browser.Engine.webkit419&&!Browser.isKonqueror&&!Browser.isChrome)||(App.isSmartReader&&Browser.isIE&&Browser.version<=7)){var B=_("Sorry, your browser is not compatible: <a>check out our list of supported browsers</a>.");B=B.replace("<a>",'<a href="http://faq.netvibes.com/netvibes_everywhere#what_browsers_are_supported">');var A=$("pageLoading")||new Element("div").inject("modulesArea","top");A.set({id:"pageError",html:B});return false}return true};App.Start.setProfileLink=function(){var A=$("signInLink");var B=$("signUpLink");if(A){if(App.registeredUser){A.onclick=function(){arguments.callee.queue=arguments.callee.queue||0;if(arguments.callee.queue>0){return false}++arguments.callee.queue;setTimeout(function(){this.queue=0}.bind(arguments.callee),500)}}else{A.onclick=function(){$("tooltip").style.display="none";App.Login.show();return false}}}if(B){B.addEvent("click",function(C){C.stop();$("tooltip").style.display="none";App.showSignup()})}};App.attachTitleEvents=function(){if(App.staticUniverse){return false}var A=$("pageTitle");var B=A.getFirst();B.onmouseover=function(){this.style.backgroundColor="#FAFAFA";this.foregroundColor=this.style.color;this.style.color="#333";this.style.border="1px solid #EEE"};B.onmouseout=function(){this.style.backgroundColor="transparent";this.style.color=this.foregroundColor;this.style.border="none"};B.onclick=function(){App.keyboardFocus="edit";this.onclick=null;this.onmouseout();this.onmouseover=null;var C=this.get("text");var F=this.offsetWidth;var E=document.createElement("input");E.type="text";E.className="inputPageTitle";E.maxLength=80;E.value=C;E.style.width=F+"px";this.innerHTML="";this.appendChild(E);E.focus();E.select();Event.observe(E,"keydown",D,false);function D(G){if(!Browser.isSafari){if(G.key=="enter"){E.onblur()}}}E.onkeyup=function(){this.style.width=(this.value.length*8)+20+"px"};E.onblur=function(){var H=this.value.trim()=="";var I=H?_("Type your page title here"):this.value;var G=this.parentNode;G.innerHTML="";G.appendChild(document.createTextNode(I));if(I!=C){App.Request.saveUserData("page.title",{data:{title:H?"notitle":I}});I=H?_("No title"):I;document.title=I;App.pageList.each(function(J){if(J.pid==App.currentPage){J.title=I}});$$("#pageList li.selected span").set("text",I)}App.attachTitleEvents();App.keyboardFocus="modules";App.retainKeyboardFocus()}}};App.Start.existingTabs={};App.Start.createModules=function(){var B=0;for(var F=0,A=App.userData.modules.length;F<A;F++){var D=App.userData.modules[F];var G=D.tab||-1;if(!App.Start.existingTabs[G]){G=-1;B++}var C={id:D.id,widgetId:D.widgetId,tempId:D.tempId,container:D.col||D.column,row:D.row,tab:G,moduleName:D.name,title:D.title||"",status:D.status,share:D.share,history:(D.data&&D.data.history)||"",data:D.data};if(D.data&&D.data.feedUrl){C.feedUrl=D.data.feedUrl}if(D.campaignId){C.campaignId=D.campaignId}var E=new Module($unlink(C));App.moduleList.push(E);if(E.tab!=App.selectedTab){E.hide()}}if(B>0){App.Tabs.createLostTab(B)}};App.Start.createTabs=function(){var H=App.userData.tabs.length;var C=App.selectedTab;if(document.location.hash.length>1){C=decodeURIComponent(document.location.hash.substr(1))}for(var E=0;E<H;E++){var F=App.userData.tabs[E];App.Start.existingTabs[F.id]=true;var G=F.title||"";if(G&&String.toAnchor(G)==C){App.selectedTab=F.id}var I=F.columnSizes||[];var A={id:F.id,title:G,sort:E,unread:F.unread,icon:F.icon||"",cols:F.cols,columnSizes:I,layout:F.layout,access:F.access};if(F.type){A.type=F.type;A.keyword=F.keyword;A.engine=F.engine}var D=new PageTab($unlink(A));D._savedColumnSizes=$A(I);App.tabList.push(D)}if(H==0){$("divTabs").style.visibility="hidden";$("divTabsOuter").style.visibility="hidden"}else{if(App.pageCustom.hidePublicTabs&&!App.visit.my){$("divTabs").style.visibility="hidden";$("divTabsOuter").style.visibility="hidden"}}if(App.staticUniverse){var B=$("aNewTab");if(B){B.destroy()}}App.selectedTabObj=App.Tabs.getById(App.selectedTab)||App.tabList[0]};App.Start.initUserCustom=function(){};App.preloadModules=function(){for(var B=0,A=App.tabList.length;B<A;B++){var C=App.tabList[B];if(C.dataObj.id==App.selectedTabObj.dataObj.id){continue}C.loadModules()}};App.Start.loadModules=function(){App.Start.createModules();if($("startMsg")){$("startMsg").style.display="none"}if($("application")){$("application").style.display="block"}if($("footer")){$("footer").style.display="block"}App.keyboardFocus="module";App.selectedTabObj.switchTo(true);if(App.pageCustom.dontPreload!="1"){App.preloadModules.delay(1000)}(function(){delete App.Start}).delay(5000);delete App.userData;App.userData=null};;
App.Subscribe={};App.Subscribe.subscribeOnFeed=function(F,E,C,X){if(App.use_feedbackend&&E=="feed"&&isNaN(C)){App.addNewFeed(F,function(a,Y,b){var Z=a.responseText.parseJSON().feeds[0];App.Subscribe.subscribeOnFeed(Z.url,"feed",Z.id,Z.title)});return }App.keyboardFocus="edit";var J=-1;var W=$("startMsg");if(E=="preconfig"){W.innerHTML=_("Loading Module Preconfiguration")+"...";var H="";App.Request.sendPOST("/ajax/sendModule/get.php?id="+F,H,function(Y){var Z=Y.responseText.parseJSON();App.subscribe.data=Z.data;if(Z.name=="tab"){App.subscribe.columns=Z.columns;App.subscribe.moduleCount=Z.modulecount;E="tab"}else{E="module"}return App.Subscribe.subscribeOnFeed(Z.name,E,"preconfig",Z.title)});J=F;App.subscribePreconfig=F;return false}var T=E;var R;if(C=="preconfig"){var M=F;switch(M){case"RssReader":M="feed";R=App.subscribe.data.feedUrl;break;case"Ical":M="calendar";R=App.subscribe.data.icalUrl;break;case"Api":M="api module";R=App.subscribe.data.moduleUrl;break;case"tab":M="tab";R=X+" ("+App.subscribe.moduleCount+" "+_("Modules")+")";if(App.subscribe.data.icon&&App.subscribe.data.icon!=""){R="<img src='"+App.subscribe.data.icon+"' width=16 height=16 /> "+R}break}T=_("preconfigured {0}").format(M)}if(T=="webcal"){T="Ical"}W.innerHTML="";var V=new Element("div").inject(W);var S="";if(User.universe||App.pageList.length>1){S+="<div>";S+="<label>"+_("Add to page:")+" "+App.UI.getPagesDropDownList()+"</label> ";S+='<input type="button" value="'+_("Add")+'" class="subscribeButton button" />';S+="</div>"}else{S+='<div><input type="button" value="'+_("Add to my netvibes")+'" class="subscribeButton button" />&nbsp;&nbsp;&nbsp;&nbsp;<input style="display:none" type="button" value="'+_("Cancel")+'" class="subscribeButton button" /></div>'}if(E=="tab"){S+='<div id="subscribePreviewTab"></div>'}else{S+='<div id="subscribePreviewModule"></div>'}S+='<div class="subscribeWarning">'+_("Netvibes cannot be held responsible for content, functionality, availability or performance of this module. If you have any concerns or queries, please send a report to its Developer and our <a href='http://www.netvibes.com/static.php?show=feedback'>support team</a>")+"</div>";V.innerHTML=S;var A=new Element("div").inject(W);A.setStyle("clear","both");A.setStyle("height",30);var D=W.getElementsByTagName("input");var N,U,O;App.inSubscribePreview=true;N="";var L={},K={};switch(E){case"module":N=F;K=App.subscribe.data||{};if(F=="RssReader"&&typeof App.subscribe.data.feedUrl!="undefined"){F=App.subscribe.data.feedUrl;L={feedUrl:F};K.feedUrl=F}break;case"api":N="Api";K.moduleUrl=F;break;case"webcal":case"ical":N="Ical";K.icalUrl=F;break;case"tab":var B=new App.Columns($("subscribePreviewTab"),{enableResize:false,standalone:true});if(App.subscribe.data.cols>0){B.numCols=App.subscribe.data.cols}else{for(var I=1;I<=4;I++){if(!App.subscribe.columns[I]){continue}B.numCols=I}}if(App.subscribe.data.columnSizes){B.columnSizes=App.subscribe.data.columnSizes}B.updateLayout();var G;for(var I=1;I<=4;I++){if(!App.subscribe.columns[I]){continue}G=App.subscribe.columns[I].length;col=I;for(var P=0;P<G;P++){N=App.subscribe.columns[I][P];if(N.name=="MailWizard"){continue}defaultDataObj=App.Modules[N.name+"Infos"].defaultObj;O={};for(var Q in defaultDataObj){if(typeof defaultDataObj[Q]=="function"){continue}O[Q]=defaultDataObj[Q]}O.data={};for(var Q in defaultDataObj.data){if(typeof defaultDataObj.data[Q]=="function"){continue}O.data[Q]=defaultDataObj.data[Q]}O.container=B["col"+col];O.tab=App.selectedTab;if(N.name=="RssReader"){O.feedUrl=N.data.feedUrl}for(var Q in N){if(typeof N[Q]=="function"){continue}O[Q]=N[Q]}for(var Q in N.data){if(typeof N.data[Q]=="function"){continue}O.data[Q]=N.data[Q]}App.subscribe.columns[I][P]=U=new Module(O,{preview:true}).load(true);U.name=N.name;delete N;delete U}}break;default:N="RssReader";K=App.subscribe.data||{};L.feedUrl=Utils.getSafeUrl(F);if(!isNaN(C)){K.feedId=C}}if(E=="tab"){}else{O=$unlink(App.Modules[N+"Infos"].defaultObj);O=$merge(O,L);O.data=$merge(O.data||{},K);O.tab=App.selectedTab;O.widgetId=App.subscribe.ecoId||(App.subscribe.data&&App.subscribe.data.widgetId)||"";if(typeof X=="string"){O.title=X}if(App.subscribePreconfig){O.preconfigId=App.subscribePreconfig}U=new Module(O,{nativise:true,preview:true}).inject("subscribePreviewModule").load()}D[0].onclick=function(){App.Subscribe.onSubscribeClicked(U,E,J,X);return false}};App.Subscribe.onSubscribeClicked=function(G,F,E,H){var A="/";var I=$("pageSelector");if(I){if(I.value!=App.currentPage){if(User.universeId==I.value){A="/"+User.username}else{A="/privatepage/"+App.pageList[I.selectedIndex].name}}}if(F=="tab"){App.Request.saveUserData("tab.subscribe",{data:{preconfigId:App.subscribePreconfig,pid:I?I.value:null},onSuccess:function(J){window.location.href=A}});return }else{if(DefaultColForLayout&&App.selectedTabObj&&App.selectedTabObj.dataObj.layout){G.dataObj.container=DefaultColForLayout[App.selectedTabObj.dataObj.layout][App.dirRTL?"rtl":"ltr"]}else{G.dataObj.container=App.dirRTL?App.selectedTabObj.dataObj.cols:1}G.previewMode=false;G.dataObj.subscription=true;if(App.subscribe.data&&App.subscribe.data.campaignActive&&App.subscribe.data.campaignActive==1&&App.subscribe.data.ecoId){G.dataObj.campaignActive=true;G.dataObj.ecoId=G.dataObj.widgetId=App.subscribe.data.ecoId}if($defined(G.dataObj.feedUrl)){if(typeof G.widget.addNewFeed=="function"){G.widget.addNewFeed()}else{if(typeof G.content.addNewFeed=="function"){G.content.addNewFeed()}}}G.dataObj.subscribeType=F;if(App.subscribe.from){G.dataObj.from=App.subscribe.from}if(App.subscribe.ecoId){G.dataObj.from="eco"}if(App.subscribe.campaignId){G.dataObj.campaignId=App.subscribe.campaignId;if(App.subscribe.data&&App.subscribe.data.ecoId||App.subscribe.ecoId){App.report("camp.install",{ecoId:App.subscribe.data.ecoId||App.subscribe.ecoId,campaignId:App.subscribe.campaignId})}}if(App.selectedTabObj&&App.selectedTabObj.dataObj.type=="search"){for(var D=App.tabList.length-1,B;B=App.tabList[D];D--){if(B.dataObj.type!="search"){App.selectedTab=B.dataObj.id;App.selectedTabObj=B;break}}}}if(E!=-1){var C="";if(App.visit&&App.visit.id){C="&visit="+App.visit.id}App.Request.sendPOST(NV_PATH+"ajax/sendModule/report.php?preconf="+E,C,function(){})}if(G.content.resize){G.content.resize()}if(I){G.dataObj.pageId=I.value}App.Modules.store(G,function(){(function(){window.location.href=A}).delay(500)})};App.Subscribe.backToMyPage=function(){App.inSubscribePreview=false;delete App.subscribe.query;$("startMsg").empty().hide();$("top").getElement("span").remove();$("application").style.display="block";$(document.body).removeClass("subscribe");App.keyboardFocus="module";var A=$("topbarUser");A.hide();A.show.delay(100,A);if($("nv-overlay")){$("nv-overlay").show()}App.SearchTab.positionForm()};App.Subscribe.addFeedResponse=function(D,F,B){var I=$("startMsg");if(D.status==401||D.statusText.toLowerCase()=="unauthorized"){B="auth";F=Utils.getSafeUrl(F,true,true)}if(B=="site"){var A=function(K){var J=K.responseText.parseJSON().feeds;if(J.length==1){var M=J[0];App.Subscribe.subscribeOnFeed(M.url,"feed")}else{if(J.length>1){var O='<div class="subscribeHeader">'+_("Please choose the feed you want to add to your page:")+"</div>";O+='<div class="subscribeAutoDiscovery">';for(var N=0;N<J.length;N++){if(J[N].title!=""&&J[N].title!=null){O+='<div class="feedboxselection feedboxselection-'+J[N].type+'"><div>'+J[N].title+'</div><div class="url">'+J[N].url+"</div></div>"}else{O+='<div class="feedboxselection feedboxselection-'+J[N].type+'"><div>'+J[N].url+"</div></div>"}}O+="</div>";I.innerHTML=O;var L=$(I).getElementsByClassName("feedboxselection");for(var N=0;N<L.length;N++){L[N].setAttribute("index",N);L[N].onmouseover=function(){this.style.backgroundColor="#FFFFB0"};L[N].onmouseout=function(){this.style.backgroundColor="#FFFFE6"};L[N].onclick=function(){I.innerHTML=_("Loading ...");var P=J[this.getAttribute("index")];App.Subscribe.subscribeOnFeed(P.url,"feed")}}}else{I.innerHTML=_("No valid feeds were found to add to your page")}}};App.Request.sendGET(NV_API_PATH+"/feed/discover?format=json&url="+encodeURIComponent(App.subscribe.to),A)}else{if(B=="api"){App.Subscribe.subscribeOnFeed(F,"api","api")}else{if(B=="webcal"){App.Subscribe.subscribeOnFeed(F,"webcal")}else{if(!isNaN(B)){App.Subscribe.subscribeOnFeed(F,"feed",B)}else{if(B=="rss"||B=="feed"||(typeof D.getResponseHeader=="function"&&D.getResponseHeader("Content-type").substr(0,16)=="application/json")){App.Subscribe.subscribeOnFeed(F,"feed")}else{if(B=="auth"){var G='<form id="authForm"><label>'+_("Username:")+' <input type="text" size="8" value="" /></label>&nbsp;&nbsp;&nbsp;<label>'+_("Password:")+' <input type="password" size="8" value="" /></label></form>';var H='<div id="subscribeAuth"><div class="subscribeHeader">'+_("The feed you want to subscribe to requires authorization:")+"</div>";H+='<div class="subscribeFeed" style="margin-bottom: 10px">'+F+" <br /><br />"+G+"</div>";H+='<div id="previewConfirm"><input type="button" value="'+_("OK")+'" class="subscribeButton button" id="authSubmit" />&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="'+_("Cancel")+'" class="subscribeButton button" id="authCancel" /></div></div>';I.innerHTML=H;var C=function(){var K=F.trim();var J=I.getElementsByTagName("input");var L;if(K.substr(0,7)=="http://"){L=7}else{if(K.substr(0,8)=="https://"){L=8}else{L=7;K="http://"+K}}K=K.substr(0,L)+encodeURIComponent(J[0].value)+":"+encodeURIComponent(J[1].value)+"@"+K.substr(L);I.innerHTML=_("Loading ...");App.addNewFeed(K,App.Subscribe.addFeedResponse);return false};var E=I.getElementsByTagName("input");E[0].focus();$("authSubmit").onclick=C;$("authForm").onsubmit=C;$("authCancel").onclick=App.Subscribe.cancelSubscribe}else{if(D.responseText==""||!D.responseXML||D.responseXML.documentElement==null||D.responseXML.documentElement.nodeName=="parsererror"){I.innerHTML=_("The feed you are about to add to your page is not valid")}else{App.Subscribe.subscribeOnFeed(F,"feed")}}}}}}}};App.Subscribe.doSubscribe=function(){App.subscribeOnLoad=false;App.keyboardFocus="edit";if($("nv-overlay")){$("nv-overlay").hide()}var A=new Element("span",{"class":"back"}).injectBefore($("topbarContent"));A.innerHTML='<a class="back" href="'+App.location+'">'+_("Back to my page")+"</a>";var B=$("startMsg");B.set("style","display:block");App.subscribe.to=App.subscribe.to.unescapeHTML();switch(App.subscribe.type){case"module":if(App.subscribe.to!="aolMail"){App.subscribe.to=App.subscribe.to.substr(0,1).toUpperCase()+App.subscribe.to.substr(1)}if(!App.Modules[App.subscribe.to+"Infos"]){App.Start.loadModules();break}case"preconfig":case"webcal":case"api":case"feed":case"rss":App.Subscribe.subscribeOnFeed(App.subscribe.to,App.subscribe.type,App.subscribe.type);break;default:App.addNewFeed(App.subscribe.to,App.Subscribe.addFeedResponse,App.subscribe.type)}};;
App.Modules.feedreader=function(D){var B=new UWA.Native();B.map(this,D);var C=B.getModule();C.setPreferences([{name:"_feedreaderTitle",type:"text",label:"Title"},{name:"feedUrl",type:"text",label:"Feed",defaultValue:""},{name:"view",type:"list",label:"View",defaultValue:"",options:[{value:"",label:"Normal"},{value:"Magazine",label:"Magazine"},{value:"Carousel",label:"Slideshow"},{value:"Ticker",label:"Ticker"},{value:"GalleryTwo",label:"Classy Slideshow"},{value:"Gallery",label:"Classy Slideshow (Black)"},{value:"Scoop",label:"Headline"},{value:"Headline",label:"Quick Details"}]},{name:"nbTitles",type:"range",label:"Number of items to display",defaultValue:"7",step:"1",min:"1",max:"25",onchange:"updateDisplay"},{name:"openOutside",type:"boolean",label:"Open directly on the site",defaultValue:"false",onchange:"updateDisplay"},{name:"details",type:"boolean",label:"Show more details",defaultValue:"false",onchange:"updateDisplay"},{name:"showDate",type:"boolean",label:"Show post date",defaultValue:"true",onchange:"updateDisplay"}]);C.body.addClassName("feedreader");var A={};A.feed=false;A.elements=[];A.offset=0;A.search="";A.correctlyDisplayed=false;A.autoRefreshState=true;A.mustUseHtmlThumb=function(){var G=C.getValue("feedUrl");var J=[".flickr.[a-zA-Z]+/"];for(var H=0,F=J.length;H<F;H++){var I=new RegExp(J[H],"i");if(I.test(G)){return true}}return false};A.detectType=function(){C.log("FeedReader.detectType()");var F=A.feed.items;for(var G=0;G<F.length;G++){if(F[G].thumbnail||(F[G].enclosures&&F[G].enclosures[0]&&/^image\/(jpeg|gif|jpg|bmp|png)$/.test(F[G].enclosures[0].type))||(C.getBool("lookForHtmlThumbnail")==true&&/<img.*?src=('|")?(.*?)('|"| ).*?>/i.test(F[G].content))){C.setValue("details","true");break}}if(C.getBool("details")){C.setValue("nbTitles",3)}};A.checkResponse=function(F){C.log("FeedReader.checkResponse()");if(!F||F.error){A.showError(_("Error"),_("Looks like this feed is not valid or currently not responding."));return }if(F.status==401){A.showError(_("Unauthorized"),_("You don't have the required authorization to access this feed."));return }if(!F.items){A.showError(_("Error"),_("Looks like this feed is not valid or currently not responding."));return }A.display(F)};A.addFeedResponse=function(F,H,G){C.log("FeedReader.addFeedResponse()");if(G=="site"){A.showError(_("Error"),_("You need to enter the URL of an RSS or ATOM feed. For adding this site, please use the Add content menu."))}else{C.setValue("feedId",G);if(typeof UWA.Utils.parseFeed=="function"){F=UWA.Utils.parseFeed(F)}A.checkResponse(F)}};A.display=function(L){C.log("FeedReader.display()");if(typeof L!="undefined"){A.feed=L;if(C.getValue("feedUrl").match(/https?:\/\/([^\/]*?)@/)&&C.elements.icon){C.elements.icon.setHTML('<img width="16" height="16" alt="Http Authenticated" title="Http Authenticated" src="'+NV_STATIC+'/img/lock.gif" />')}else{C.setIcon(L.htmlUrl)}UWA.Services.FeedHistory.build(C.readOnly?"":C.getHistory(),A.feed);if(C.isNew==true){A.detectType();C.setValue("_feedreaderTitle",L.title);if(typeof C.getHistory()!="undefined"){C.saveHistory()}C.isNew=false}else{if(!C.getValue("_feedreaderTitle")||C.getValue("_feedreaderTitle")==""){C.setValue("_feedreaderTitle",L.title)}}C.writeTitle('<a href="'+L.htmlUrl+'" target="_blank">'+C.getValue("_feedreaderTitle")+"</a>");if(typeof L.dir!="undefined"&&L.dir=="rtl"){C.dir="rtl";C.body.dir="rtl";C.body.removeClassName("ltr").addClassName("rtl");if(C.elements.title){C.elements.title.removeClassName("ltr").addClassName("rtl")}}else{C.dir="ltr";C.body.dir="ltr";C.body.removeClassName("rtl").addClassName("ltr");if(C.elements.title){C.elements.title.removeClassName("rtl").addClassName("ltr")}}}if(A.feed.items.length==0){A.showError(_("Error"),_("No items in feed."));return }var G="FeedView";var K=C.getValue("view");if(K&&A._forceDefaultView!=true){G+="_"+K;C.preferences[5].type="hidden";C.preferences[6].type="hidden"}else{C.preferences[5].type="boolean";C.preferences[6].type="boolean"}A.FeedView=new UWA.Controls[G]({details:C.getBool("details"),showDate:C.getBool("showDate"),forceHtmlThumbnail:A.mustUseHtmlThumb(),search:A.search,dir:C.dir,dimensions:C.body.getDimensions(),id:C.id,displayShare:C.isInNativeMode()&&C.readOnly!=true});if(A.FeedView.fullSize==true){C.body.addClassName("fullsize-module")}else{C.body.removeClassName("fullsize-module")}if(typeof A.FeedView.colorize=="function"){A.FeedView.colorize(C.getValue("color"))}if(typeof A.FeedView.setContainer=="function"){A.FeedView.setContainer(C.body)}if(A.FeedView.needPager==false){A.limit=A.feed.items.length;A.offset=0;C.preferences[3].type="hidden"}else{A.limit=C.getInt("nbTitles");C.preferences[3].max=A.feed.items.length;C.preferences[3].type="range"}A.FeedView.observe("onclick",A.onClick);A.FeedView.observe("onmiddleclick",A.onMiddleOrRightClick);A.FeedView.observe("onrightclick",A.onMiddleOrRightClick);A.FeedView.observe("onpodcastplay",A.onPodcastPlay);A.FeedView.observe("ondownload",A.onDownload);if(C.isInNativeMode()&&C.readOnly!=true){A.FeedView.observe("onaddstar",A.onAddStar)}var H=A.feed.items.length-A.offset;H=H>A.limit?A.limit:H;for(var I=0;I<H;I++){var J=A.offset+I;var N=A.feed.items[J];A.FeedView.addItem(J,N,UWA.Services.FeedHistory.isRead(A.feed,J))}if(typeof A.FeedView.setContainer=="function"&&typeof A.FeedView.finalize=="function"){A.FeedView.finalize()}else{C.setBody(A.FeedView.getContent())}if(A.search!=""){C.setSearchResultCount(A.FeedView.getNumberOfDisplayedItems())}var M=UWA.Services.FeedHistory.getNbNew(A.feed,A.feed.items.length);if(A.FeedView.needPager!=false){var F=new UWA.Controls.Pager({module:A,limit:A.limit,offset:A.offset,dataArray:A.feed.items});F.onChange=function(O){this.module.offset=O;this.module.display()};A.pagerContent=F.getContent();A.pagerContent.style.display="none";C.addBody(A.pagerContent)}A.correctlyDisplayed=true;if((!C.isInNativeMode()||App.pageCustom.showFeedNav=="1")&&typeof A.pagerContent!="undefined"){A.pagerContent.style.display="block";if(C.readOnly!=true&&A.search==""){C.setUnreadCount(M)}}else{if(C.readOnly!=true&&A.search==""){C.setUnreadCount(UWA.Services.FeedHistory.getNbNew(L,A.limit))}}C.onLoadComplete()};A.onClick=function(G){if(typeof D!="undefined"&&D.previewMode){return true}A.setRead(G.index);var F=A.feed;if(C.getBool("openOutside")==true||App.inSubscribePreview){C.openURL(F.items[G.index].link);return true}if(typeof App.FeedReader!="undefined"){App.FeedReader.display({title:A.feed.title,moduleLocalData:A,selectedItemIndex:G.index,moduleObj:A.pub,contentObj:A.pub,proxy:"proxy/feedProxy.php?url="+encodeURIComponent(C.getValue("feedUrl"))+"&g"})}else{if(typeof Netvibes.UI.EmbedFeedReader!="undefined"){new Netvibes.UI.EmbedFeedReader(A.feed,G.index)}else{if(typeof C!="undefined"&&C.openURL){C.openURL(F.items[G.index].link)}}}return true};A.onMiddleOrRightClick=function(F){A.setRead(F.index)};A.onPodcastPlay=function(F){if(C.isInNativeMode()){if(App.inSubscribePreview){alert(_("Sorry, this feature is not available in preview mode."));return false}A.setRead(F.index);App.launchPlayer(F.fileLink,F.podName);return false}else{A.setRead(F.index);return true}};A.onDownload=function(F){A.setRead(F.index);C.openURL(F.mediaUrl);return true};A.onAddStar=function(G){var F=A.feed.items[G.index];C.addStar({title:F.title,url:F.link,date:F.date,summary:F.content.stripTags()});return true};A.setRead=function(F){C.log("FeedReader.setRead()");var H=A.feed;if(UWA.Services.FeedHistory.isRead(H,F)==false){UWA.Services.FeedHistory.setRead(H,F);A.FeedView.setRead(F);UWA.Services.FeedHistory.setRead(H,F);C.setHistory(UWA.Services.FeedHistory.getString(H));C.saveHistory();var G=UWA.Services.FeedHistory.getNbNew(H,H.items.length);if(C.isInNativeMode()){if(App.pageCustom.showFeedNav=="1"||A.FeedView.needPager=="false"){if(C.readOnly!=true){C.setUnreadCount(G)}}else{if(C.readOnly!=true){C.setUnreadCount(UWA.Services.FeedHistory.getNbNew(A.feed,C.getValue("nbTitles")))}}}else{C.setUnreadCount(G)}}};A.showError=function(G,F){if(A.correctlyDisplayed===true){var G=C.getValue("_feedreaderTitle");if(G){C.writeTitle(G)}return }C.setBody(F);C.onLoadComplete()};A.pub={};A.pub.save=function(){C.log("FeedReader.pub.save()")};A.pub.setHistory=function(F){C.log("FeedReader.pub.setHistory();");C.setHistory(F)};A.pub.saveHistory=function(){C.log("FeedReader.pub.saveHistory()");C.saveHistory()};A.pub.setRead=function(F){C.log("FeedReader.pub.setRead()");return A.FeedView.setRead(F)};A.pub.setUnRead=function(F){C.log("FeedReader.pub.setUnRead()");return A.FeedView.setUnRead(F)};A.pub.setFeedTitle=function(){C.log("FeedReader.pub.setFeedTitle()");C.setFeedTitle(false);C.setHistory(UWA.Services.FeedHistory.getString(A.feed))};A.pub.setAllAsRead=function(){C.log("FeedReader.pub.setAllAsRead()");for(var F=0;F<A.FeedView.getNumberOfDisplayedItems();F++){if(UWA.Services.FeedHistory.isRead(A.feed,F)==true){A.FeedView.setRead(F)}else{A.FeedView.setUnRead(F)}}A.pub.setFeedTitle()};A.pub.getShowPage=function(){C.log("FeedReader.pub.getShowPage()");return parseInt(C.getValue("showPage"))};A.pub.setShowPage=function(F){C.log("FeedReader.pub.setShowPage()");return parseInt(C.setValue("showPage",F))};A.pub.setAutoRefreshState=function(F){A.autoRefreshState=F};if(C.readOnly!=true){A.pub.addStar=function(F){C.log("FeedReader.pub.addStar()");C.addStar(F)}}C.isInNativeMode=function(){if(typeof this.environment.netvibes!="undefined"&&this.environment.netvibes.inline){return true}return false};C.onLoad=function(){C.log("widget.onLoad()");if(!C.isInNativeMode()){C.preferences[2].type="hidden";A._forceDefaultView=true}if(!C.isInNativeMode()){C.preferences[3].type="hidden"}C.getFeed()};C.onLoadComplete=function(){return C.environment.callback("onLoadComplete")};C.onRefresh=function(){C.log("widget.onRefresh()");if(A.autoRefreshState!=true){return }C.writeTitle(_("Updating..."));if(A.url!=C.getValue("feedUrl")){A.url=C.getValue("feedUrl");C.isNew=true;C.setIcon("");if(C.isInNativeMode()){App.addNewFeed(A.url,A.addFeedResponse);return }}C.getFeed()};C.getFeed=function(){C.log("widget.getFeed()");A.url=C.getValue("feedUrl");if(C.isInNativeMode()&&C.isNew==true){App.addNewFeed(A.url,A.addFeedResponse)}else{if(UWA.Feeds&&UWA.Feeds[A.url]){var F=UWA.Feeds[A.url];A.checkResponse(F);setTimeout(function(){UWA.Feeds[A.url]=null},15000);return }var G={method:"GET",proxy:"feed",type:"feed",shortFeed:false,onComplete:A.checkResponse,onFailure:A.checkResponse};if(/https?:\/\/([^\/]*?)@/.test(A.url)){G.authentication={gp:C.getValue("feedId"),moduleId:C.id};if(C.isInNativeMode()){G.authentication.pid=App.currentPage}}UWA.Data.request(A.url,G)}};C.onSearch=function(F){C.log("widget.onSearch()");A.search=F;if(A.feed){A.display()}else{if(A.search!=""){C.setSearchResultCount(0)}}};C.onResetSearch=function(){C.log("widget.onResetSearch()");A.search="";if(A.feed){A.display()}};C.updateDisplay=function(G){C.log("widget.updateDisplay()");if(A.limit!=C.getValue("nbTitles")&&A.FeedView.needPager!="false"){var F=A.offset/A.limit;var H=F*C.getValue("nbTitles");while(H>=A.feed.items.length){H-=C.getValue("nbTitles")}A.offset=H}A.display()};C.onKeyboardEnter=function(){C.log("widget.onKeyboardEnter()");if(C.isInNativeMode()){App.keyboardFocus="feedreader";A.onClick({index:0})}};C.onResetUnreadCount=function(){if(!A.feed||!A.feed.history){return }var I=A.feed;var G=I.items.length;var F=A.FeedView.getNumberOfDisplayedItems();for(var H=0;H<G;H++){UWA.Services.FeedHistory.setRead(I,H);if(H>=A.offset&&H<(F+A.offset)){A.FeedView.setRead(H)}}C.setUnreadCount(0);C.setHistory(UWA.Services.FeedHistory.getString(A.feed));C.saveHistory()};C.setFeedTitle=function(H){if(!A.feed||!A.feed.history){return }if(H!=false&&C.elements.title){var F=C.elements.title.getElementsByClassName("unread")[0];C.elements.title.removeChild(F)}var G=UWA.Services.FeedHistory.getNbNew(A.feed,A.feed.items.length);if(C.isInNativeMode()){if(App.pageCustom.showFeedNav=="1"||A.FeedView.needPager=="false"){if(C.readOnly!=true){C.setUnreadCount(G)}}else{if(C.readOnly!=true){C.setUnreadCount(UWA.Services.FeedHistory.getNbNew(A.feed,C.getValue("nbTitles")))}}}else{C.setUnreadCount(G)}};C.toggleNavigation=function(F){if(typeof A.pagerContent!="undefined"){if(F){A.pagerContent.style.display="block";if(C.readOnly!=true&&A.search==""){C.setUnreadCount(UWA.Services.FeedHistory.getNbNew(A.feed,A.feed.items.length))}}else{A.pagerContent.style.display="none";if(C.readOnly!=true&&A.search==""){C.setUnreadCount(UWA.Services.FeedHistory.getNbNew(A.feed,A.limit))}}}};C.writeTitle=function(F){C.log("widget.writeTitle()");if(C.elements.title){C.elements.title.setHTML(F);C.environment.callback("handleLinksInTitle")}};C.onResize=function(){if(typeof A.FeedView!="undefined"&&typeof A.FeedView.resize=="function"){var F=C.body.getParent();var G={width:F.clientWidth,height:F.clientHeight};if(!A.FeedView.resize(G)){A.display()}}};C.onColorize=function(){if(typeof A.FeedView!="undefined"&&typeof A.FeedView.colorize=="function"){A.FeedView.colorize(C.getValue("color"))}};C.clickItem=function(F){A.onClick({index:F})};C.shareItem=function(F){A.onAddStar({index:F})};C.addNewFeed=function(){};var E=true;C.setAutoRefresh(40)};App.Modules.rssreader=App.Modules.feedreader;;
App.Modules.UWA=function(obj){if(obj.dataObj.moduleName=="externalWidget"){obj.dataObj.data._type="external"}var Environment=new UWA.Native();Environment.map(this,obj);var M=Environment.getModule();var widget=M;M.isInline=function(){var inline=true;var url=this.getValue("moduleUrl").parseUrl();if(url.host!=NV_HOST&&url.host!="www.netvibes.com"&&url.host!="eco.netvibes.com"&&url.host!="www.elle.fr"){if(App.visit||this.getBool("inline")===false){inline=false}}return inline};M.fetchModule=function(){var url=this.data.moduleUrl;if(url&&url!=""){this.log("Fetching module");var request={method:"GET",proxy:"api"};if(this.isInline()){request.onComplete=this.parseHTML.bind(this);request.type="xml"}else{request.onComplete=this.parseJSON.bind(this);request.type="json"}if(this.getBool("nocache")===true){request.cache=0}if(UWA.Skeletons&&UWA.Skeletons[url]&&request.cache!==0&&request.type=="json"){request.onComplete(UWA.Skeletons[url]);setTimeout(function(){UWA.Skeletons[url]=null},15000);return }UWA.Data.request(url,request)}};M.parseJSON=function(skeleton){this.log("Parsing JSON");var schema={icon:"string",metas:"object",preferences:"object"};if(skeleton.inline){UWA.merge(schema,{style:"string",body:"string",template:"object",feeds:"object"})}if(this.environment.obj.dataObj.title=="UWA Module"||this.environment.obj.dataObj.title==""){UWA.merge(schema,{title:"string"})}if(skeleton.inline){widget.onLoad=null;widget.preferences=[]}for(var key in schema){if(typeof skeleton[key]==schema[key]){var fnName="set"+key.capitalize();if(this[fnName]){this[fnName](skeleton[key])}}}if(skeleton.inline){this.environment.launchModule()}else{this.displayModuleIframe()}};M.parseHTML=function(html){var head=html.getElementsByTagName("head")[0];var scripts=html.getElementsByTagName("script");var links=html.getElementsByTagName("link");this.log("Parsing Metas");var xmlMetas=html.getElementsByTagName("meta");if(xmlMetas&&xmlMetas.length){this.setMetasXML(xmlMetas)}this.log("Parsing Preferences");var xmlPrefs=html.getElementsByTagName("preference");if(xmlPrefs&&xmlPrefs.length){this.setPreferencesXML(xmlPrefs)}var title=html.getElementsByTagName("title")[0];if(this.environment.obj.dataObj.title=="UWA Module"||this.environment.obj.dataObj.title==""){this.setTitle(title.firstChild.nodeValue)}if(this.isInline()){this.log("Content handling");var body=html.getElementsByTagName("body")[0];if(body.xml){var content=body.xml}else{var serializer=new XMLSerializer();var content=serializer.serializeToString(body)}this.body.setStyle("padding","7px");this.body.setContent(content);this.log("CSS handling");this.body.setAttribute("id","m_"+this.id);var style=html.getElementsByTagName("style");var cssContent="";for(var i=0;i<style.length;i++){for(var j=0;j<style[i].childNodes.length;j++){cssContent+=style[i].childNodes[j].nodeValue}}if(cssContent.length>0){this.setStyle(cssContent)}}this.log("Favicon handling");var links=html.getElementsByTagName("link");for(var i=0;i<links.length;i++){if(links[i].getAttribute("rel")=="icon"){var favicon=links[i].getAttribute("href")}}if(favicon){var buildHref=UWA.Utils.buildUrl(this.getValue("moduleUrl"),favicon);if(buildHref){favicon=buildHref}this.setIcon(favicon)}if(this.isInline()){this.log("Parsing Javascript");widget.onLoad=null;for(var i=0;i<scripts.length;i++){if(!scripts[i].getAttribute("src")){try{eval(scripts[i].firstChild.nodeValue)}catch(e){UWA.log(e)}}}if(window.onload){widget.onLoad=window.onload}Environment.launchModule();if(typeof Widgets!="undefined"&&Widgets[this.id]){delete Widgets[this.id]}if(widget.sendToFrame){delete widget.sendToFrame}this.isIframed=false}else{this.displayModuleIframe()}};M.endEdit=function(){this.elements.edit.hide();if(this.preferences[0].name=="moduleUrl"){this.fetchModule()}else{if(this.onRefresh){this.onRefresh()}else{if(this.onLoad){this.onLoad()}}}this.callback("onHideEdit")};M.displayModuleIframe=function(){this.isIframed=true;this.onResize=function(){this.sendToFrame("onResize")};this.onResetUnreadCount=function(){this.sendToFrame("onResetUnreadCount")};this.onSearch=function(query){this.sendToFrame("onSearch",null,query)};this.onResetSearch=function(){this.sendToFrame("onResetSearch")};this.onKeyboardAction=function(key){this.sendToFrame("onKeyboardAction",null,key)};this.onUpdateTheme=function(theme){this.sendToFrame("onUpdateTheme",null,theme)};if(typeof this.id=="undefined"){this.id=Math.round(Math.random()*255)}if(NV_HOST=="www.netvibes.com"||NV_HOST=="www2.netvibes.com"){var widgetDomain=this.id+"."+NV_MODULES}else{var widgetDomain=NV_MODULES}var communicationType="TUAcallback";if(Browser.isSafari){communicationType="TUApolling"}if(Browser.isOpera){communicationType="TMUpolling"}var subspaceDomain=NV_HOST;subspaceDomain=subspaceDomain.split(".");subspaceDomain.shift();subspaceDomain=subspaceDomain.join(".");var iframeParameters={id:this.id,NVdir:this.dir,NVlang:this.lang,NVuserId:this.userId,NVlocale:this.locale,NVreadOnly:this.readOnly,NVwidgetDomain:widgetDomain,NVsubspaceDomain:subspaceDomain,NVcommType:communicationType,NVthemeUrl:App.pageCustom.themeUrl};if(M.getValue("_type")=="external"){var iframeUrl="http://"+widgetDomain+"/frames/external_widget.php";iframeParameters.code=this.getExternalWidgetCode()}else{var iframeUrl="http://"+widgetDomain+"/frames/uwa_netvibes.php";iframeParameters.moduleUrl=this.getValue("moduleUrl");this.initPreferences();for(var key in this.data){if(key!="moduleUrl"&&key!="inline"&&key!="lastUpdate"){if(typeof this.data[key]=="string"||typeof this.data[key]=="number"||typeof this.data[key]=="boolean"){iframeParameters[key]=this.data[key]}}}}if(this.environment.obj.previewMode){iframeParameters.preview="true"}this.widgetUrl=iframeUrl+"?"+new Hash(iframeParameters).toQueryString();if(typeof Widgets=="undefined"){Widgets={}}Widgets[this.id]={id:this.id,communicationType:communicationType,domain:NV_HOST,subspaceDomain:subspaceDomain,widgetUrl:this.widgetUrl};Widgets[this.id].publicInterface=function(action,name,value){var frame=Widgets[this.id].widgetFrame;switch(action){case"resizeHeight":if(value>100||value>frame.getAttribute("height")){var delay=0}else{var delay=1500}widget.environment.setDelayed("resizeFrameHeight",function(){frame.setAttribute("height",value)},delay,false);break;case"setValue":if(name=="moduleUrl"||name=="inline"){return }widget.setValue(name,value);break;case"deleteValue":if(name=="moduleUrl"||name=="inline"){return }widget.deleteValue(name);break;case"audioPlayer":if(name=="play"){AudioPlayer.play(value,"Audio Player")}else{if(name=="pause"){AudioPlayer.pause()}else{if(name=="stop"){AudioPlayer.stop()}}}break;case"addStar":widget.addStar(UWA.Json.decode(value));break;case"setIcon":case"setTitle":case"setUnreadCount":case"setSearchResultCount":if(widget[action]){widget[action](value)}break}};Widgets[this.id].widgetIsReady=function(){widget.sendToFrame("launchModule");if(widget.getValue("_type")!="external"){widget.onRefresh=function(){this.sendToFrame("onRefresh")}}};if(communicationType=="TUAcallback"){widget.sendToFrame=function(action,name,value){if(Widgets[this.id].widget){return Widgets[this.id].widget.publicInterface(action,name,value)}this.log(arguments);this.log(action+" : widget.widget was not ready - #"+this.id)}}if(communicationType=="TUApolling"||communicationType=="TUAcallback"){Widgets[this.id].mediatorIsReady=(function(){if(typeof Widgets[this.id].widgetFrame=="undefined"){Widgets[this.id].widgetFrame=this.createElement("iframe").setAttributes({id:"rendering_"+this.id,src:this.widgetUrl,width:"100%",height:this.getValue("height"),scrolling:"no",frameborder:"0"}).setStyle("display","block");this.body.setStyle("padding",0).setContent(Widgets[this.id].widgetFrame)}}).bind(this);if($("mediator_"+widget.id)){$("mediator_"+widget.id).dispose()}var mediatorFrame=widget.createElement("iframe").setAttributes({id:"mediator_"+widget.id,src:"/frames/mediator_tua.html#"+widget.id}).setStyles({position:"absolute",left:"-200%",width:"100px"});$("iframes").appendChild(mediatorFrame)}if(communicationType=="TUApolling"||communicationType=="TMUpolling"){widget.sendToFrame=function(action,name,value){Widgets[this.id].widget.poll.push(UWA.Json.encode({action:action,name:name,value:value}))};Widgets[this.id].poll=new Array();Widgets[this.id].onPoll=function(){var nextAction=Widgets[this.id].poll[0];var nextActionObject=UWA.Json.decode(nextAction);if(nextAction){switch(nextActionObject.action){case"mediatorIsReady":case"widgetIsReady":Widgets[this.id][nextActionObject.action]();break;default:Widgets[this.id].publicInterface(nextActionObject.action,nextActionObject.name,nextActionObject.value)}Widgets[this.id].poll.shift()}};this.setPeriodical("pollInterval",Widgets[this.id].onPoll,250)}if(communicationType=="TMUpolling"){var mediatorUrl="/frames/mediator_tmu.html";Widgets[this.id].widgetFrame=this.createElement("iframe").setAttributes({id:"mediator_"+this.id,src:mediatorUrl+"#"+this.id,width:"100%",height:this.getValue("height"),scrolling:"no",frameborder:"0"});this.body.setStyle("padding",0).setContent(Widgets[this.id].widgetFrame)}};if(M.getValue("_type")=="external"){M.setPreferences([{name:"title",type:"text",label:"Title",defaultValue:_("HTML")},{name:"code",type:"textarea",label:"Source",defaultValue:""},{name:"type",type:"hidden",defaultValue:"external"}]);M.getExternalWidgetCode=function(){var code=M.getValue("code");if(code.match(/^http:\/\/.*\.(jpg|png|gif)$/)){code='&nbsp;<img src="'+code+'" />'}if(code.indexOf("iframe")>0){var div=document.createElement("div");div.innerHTML=code;var iframes=div.getElementsByTagName("iframe");for(var o=0;o<iframes.length;o++){var iframe=iframes[o];if(iframe.src.substr(0,4)!="http"){iframe.src="about:blank"}}code=div.innerHTML}return code};M.setExternalFavicon=function(){var code=M.getValue("code");var link=code.match("http[s]*://[^'\"/]+");if(link){M.setIcon(link[0])}};M.processExternalWidget=function(){M.setTitle(M.getValue("title"));M.setExternalFavicon();var isSafe=false;if(isSafe){var div=widget.createElement("div");div.align="center";div.innerHTML=code;M.setBody(div)}else{M.displayModuleIframe();M.onResize=function(){this.sendToFrame("onResize")}}};M.onShowEdit=function(){var textarea=this.elements.edit.getElementsByTagName("textarea")[0];textarea.style.width="90%";textarea.style.overflow="auto";textarea.style.fontSize="1em";textarea.rows="5";textarea.onfocus=function(){this.select()}};if(M.getValue("code")&&M.getValue("code")!=""){M.onLoad=M.processExternalWidget;M.onRefresh=M.onLoad}else{M.onLoad=function(){this.setBody('<div style="padding:5px;border:1px solid #E0E0E0;background-color:#F8F8F8">This module will display any picture or HTML-code (f.e. widget). Click Edit and then<br /><br /><ul><li>for a picture, paste its URL like http://www....jpg</li><li>for a widget, paste its HTML-code </li></ul><br />Hint: You often get the HTML-code of a widget from the site of the widget\'s author.</div>')};M.onRefresh=M.processExternalWidget}}else{M.setPreferences([{name:"moduleUrl",label:_("Widget URL"),type:"string",default_value:""},{name:"inline",label:_("Inline this widget"),type:"boolean",default_value:"false"},{name:"nocache",label:_("Disable cache"),type:"boolean",default_value:"false"},{name:"height",type:"hidden",default_value:"200"}]);if(M.getValue("moduleUrl")){M.onLoad=M.fetchModule;M.onRefresh=M.onLoad}else{M.onLoad=function(){this.setBody(_("<p>Configure this module by editing and filling the URL of a third party module created with the UWA 1.0.")+"<br /><br />"+_("Netvibes can not be held responsible for content, functionality, availability or performance of this module.")+"</p>")};M.onRefresh=M.fetchModule}}};App.Modules.externalWidget=App.Modules.UWA;document.addListener("message",(function(B){var A=UWA.Json.decode(B.data);if(Widgets[A.id]){if(A.action=="widgetIsReady"){Widgets[A.id][A.action]()}else{Widgets[A.id].publicInterface(A.action,A.name,A.value)}}}));;
