function XmlHttpRequest(){this.UNINITIALIZED=0;this.LOADING=1;this.LOADED=2;this.INTERACTIVE=3;this.COMPLETE=4;this.ENCTYPE_GENERAL="application/x-www-form-urlencoded";this.ENCTYPE_MULTIPART="multipart/form-data";this.oncomplete=null;var request,state=0,handlers={},enctype=this.ENCTYPE_GENERAL,excludeParams=[];this.excludeParam=function(paramName){excludeParams[paramName]=paramName};this.resetExcludeParams=function(){excludeParams=[]};this.doRequest=function(url,params,method){method=method||"POST";request=request||this.getHttpRequest();if(request.readyState!=this.LOADING){state=this.LOADING;var obj=this;request.open(method,url,true);request.onreadystatechange=function(){obj.onReadyState()};request.setRequestHeader("content-type",enctype);request.send(params)}};this.getHttpRequest=function(){return window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP")};this.onReadyState=function(){if(request){state=request.readyState}if(state==this.COMPLETE&&request.status==200&&this.oncomplete){this.oncomplete(this)}else{this.runHandlers(state)}};this.runHandlers=function(state){if(handlers[state]){for(var key in handlers[state]){eval(handlers[state][key]+"()")}}};this.addHandler=function(name,state){if(!state){state=this.COMPLETE}if(!handlers[state]){handlers[state]={}}if(!handlers[state][name]){handlers[state][name]=name}};this.hasHandler=function(name){return handlers[name]||null};this.resetHandlers=function(){handlers={}};this.doPost=function(url,form){try{var formParams,url=(url instanceof AjaxAction)?url.getUrl():url,tokens=url.split("?");formParams=tokens[1]?tokens[1].replace(/&$/g,""):"";this.doRequest(tokens[0],[formParams,this.formToParams(form)].join("&").replace(/^&|&$/g,""),"POST")}catch(e){}};this.doGet=function(url,form){try{var url=(url instanceof AjaxAction)?url.getUrl():url;this.doRequest([url.replace(/&$/g,""),this.formToParams(form)].join("&"),null,"GET")}catch(e){}};this.getText=function(){return request.responseText};this.getXml=function(){return request.responseXML};this.formToParams=function(form){if(!form){return }var fld,type,params=[],els=form.elements,encode=encodeURIComponent;for(var i=0;i<els.length;i++){if(els[i].name&&!excludeParams[els[i].name]){fld=els[i];type=fld.type;if(/^checkbox|radio$/i.test(type)){if(fld.checked){params.push(fld.name+"="+encode(fld.value))}else{if(type=="checkbox"){params.push(fld.name+"=0")}}}else{if(type=="select-one"){params.push(fld.name+"="+encode(fld.value||fld.options[fld.selectedIndex].text))}else{if(type=="select-multiple"){var opts=fld.options;for(var j=0;j<opts.length;j++){if(opts[j].selected){params.push(fld.name+"="+encode((opts[j].getAttribute("value")||opts[j].text)))}}}else{if(!/^button|reset|file|undefined$/i.test(type)){params.push(fld.name+"="+encode(fld.value))}}}}}}return params.join("&")}}var XmlHttpResponse=function(){var faders=[],faderTarget=null;this.process=function(xml){try{if(xml&&xml.firstChild.tagName=="response"){xml=xml.firstChild;var i,element;for(i=0;i<xml.childNodes.length;i++){element=xml.childNodes[i];if(element.nodeType==1){if(element.tagName=="elements"){this.processElements(element)}else{if(element.tagName=="data"){cleanUpFaders();this.processData(element)}else{if(element.tagName=="forms"){this.processForms(element)}else{if(element.tagName=="scripts"){this.processScripts(element)}}}}}}Ajax.initializeElements()}element=null;xml=null}catch(e){}};this.processScripts=function(scripts){var script=[],args=[],scriptList=scripts.getElementsByTagName("script");for(var i=0;i<scriptList.length;i++){script.push(scriptList[i].getAttribute("name"));script.push("(");var argList=scriptList[i].getElementsByTagName("arg");if(argList){for(var j=0;j<argList.length;j++){args.push(argList[j].firstChild.nodeValue)}}if(args.length>0){script.push(args.join(","))}script.push(")");eval(script.join(""));script=args=[]}};this.processElements=function(elements){var element=null,id,attributeValue,callBack;var elementList=elements.getElementsByTagName("element");if(elementList){for(var i=0;i<elementList.length;i++){element=elementList[i];id=element.getAttribute("id");var obj=$(id).get(0);if(obj){var callBack=element.getAttribute("callBack");if(callBack){eval(callBack)}var attributeList=element.getElementsByTagName("attributes").item(0);if(attributeList){var attributes=attributeList.getElementsByTagName("attribute");if(attributes){for(var j=0;j<attributes.length;j++){eval("obj."+attributes[j].getAttribute("attributeName")+"=attributes[j].firstChild.nodeValue")}}}}}}};this.processData=function(data){$("item",data).each(function(el){var container,callBack,fadeTo=el.getAttribute("fadeTo"),fadingColor=el.getAttribute("fadingColor");if((container=$(el.getAttribute("container")).get(0))){if((callBack=el.getAttribute("callBack"))){eval(callBack+"(el)")}else{if(el.getAttribute("mode")=="remove"){fadeTo?fadeElement(fadeTo,container,fadingColor):container.parentNode.removeChild(container)}else{if(container.tagName.toLowerCase()!="tbody"){container.style.display="block"}$(container).html(el.firstChild.nodeValue,el.getAttribute("mode"));fadeElement(fadeTo,faderTarget||container,fadingColor)}}}})};this.processForms=function(htmlForms){htmlForms=htmlForms.getElementsByTagName("form");var htmlForm,formName,form,elementList,elements,callback;for(var i=0;i<htmlForms.length;i++){htmlForm=htmlForms[i];formName=htmlForm.getAttribute("name");if(formName){if(form=document.forms[formName]){if(elementList=htmlForm.getElementsByTagName("elements")){elements=elementList[0].getElementsByTagName("element");if(elements){this.processForm(form,elements,htmlForm.getAttribute("add"))}}callback=htmlForm.getAttribute("callback");if(callback){eval(callback+"(form)")}}}}};this.processForm=function(form,elements,add){var element,fieldName,selectValue,selectOpts,values;for(var i=0;i<elements.length;i++){element=elements[i];fieldName=element.getAttribute("name");var field=form[fieldName]||form[fieldName+"[]"];if(field&&field.type){if(field.type=="select-one"){selectOpts=field.options;var xmlOptValue=element.firstChild.nodeValue;for(var j=0;j<selectOpts.length;j++){selectValue=selectOpts[j].value||selectOpts[j].text;selectOpts[j].selected=(selectValue==xmlOptValue)}}else{if(field.type=="select-multiple"){selectOpts=field.options;var xmlOpts=element.getElementsByTagName("value");if(xmlOpts){var usedOpts=[];for(var j=0;j<xmlOpts.length;j++){var xmlOptValue=xmlOpts[j].firstChild.nodeValue;for(var k=0;k<selectOpts.length;k++){selectValue=selectOpts[k].value||selectOpts[k].text;if(selectValue==xmlOptValue&&!usedOpts[k]){usedOpts[k]=selectValue;selectOpts[k].selected=true}else{if(!usedOpts[k]){selectOpts[k].selected=false}}}}usedOpts=null}}else{if(field.length){for(var j=0;j<field.length;j++){if(field[j].type=="checkbox"||field[j].type=="radio"){field[j].checked=field[j].value==element.firstChild.nodeValue}}}else{if(element.firstChild){if(field.type=="checkbox"||field.type=="radio"){field.checked=field.value==element.firstChild.nodeValue}else{field.value=element.firstChild.nodeValue}}else{field.value=""}}}}}else{if(add=="true"){if(element.firstChild.nodeValue){var hidden=document.createElement("input");hidden.setAttribute("type","hidden");hidden.setAttribute("name",fieldName);hidden.setAttribute("value",element.firstChild.nodeValue);form.appendChild(hidden)}}}}};var fadeElement=function(fadeTo,container,fadingColor){if(fadeTo){fader=new Fader(container,fadingColor);faders.push(fader);if(fadeTo==Fader.FADEIN){fader.fadeIn()}else{if(fadeTo==Fader.FADEAWAY){fader.fadeAway()}else{if(fadeTo==Fader.FADEOUT){fader.fadeOut()}}}}};var cleanUpFaders=function(){for(var i=0;i<faders.length;i++){faders[i].opacity=10}faders=[]}};var Ajax={http:new XmlHttpRequest(),response:new XmlHttpResponse(),indicator:new Indicator(),preloaders:[],oncomplete:null,uploader:{upload:function(A){A.target=this.getIFrame().name;A.submit();A.target="";return false},getIFrame:function(){var A=document.getElementById("_file_uploader");if(A==null){if(!dom.isIe){A=document.createElement("iframe");A.id=A.name="_file_uploader"}else{A=document.createElement('<iframe id="_file_uploader" name="_file_uploader"></iframe>')}A.src="";A.target="_self";A.style.cssText="width: 0; height: 0; border: none;";document.body.appendChild(A)}return A}},doAction:function(F){if(F.cmd){if(F.cmd.oncomplete){this.oncomplete=F.cmd.oncomplete}if(F.cmd.preloader){var E,B=F.cmd.preloader.split(".");for(var C=0;C<B.length;C++){if(E=document.getElementById(B[C])){var A=new Preloader(E);this.preloaders.push(A);A.show()}}}else{this.indicator.show()}var D=new AjaxAction(F.cmd.action||(F.cmd.form?F.cmd.form.action:null));D.addParam("event",F.cmd.event);if(F.cmd.form&&F.cmd.form.enctype==this.http.ENCTYPE_MULTIPART){F.cmd.form.action=D.getUrl();Ajax.uploader.upload(F.cmd.form)}else{this.http.addHandler("Ajax.finish",this.http.COMPLETE);if(F.cmd.method=="post"){this.http.doPost(D,F.cmd.form)}else{this.http.doGet(D,F.cmd.form)}}}},finish:function(A){if(this.oncomplete){this.oncomplete(this.http);this.oncomplete=null}else{this.response.process(A||this.http.getXml())}this.indicator.hide();for(var B=0;B<this.preloaders.length;B++){this.preloaders[B].hide()}this.preloaders=[]},initializeElements:function(){$("a",document).each(function(anchor){var tmp,cmd,tokens,href=anchor.href,name=anchor.rel;if(href&&name&&/^get\.|post\.|call./.test(name)){if(!anchor.onclick){tokens=name.split(":");tmp=tokens[0].split(".");if(tmp.length>=2){anchor.cmd={action:href,method:tmp[0],event:tmp[1].toLowerCase(),form:document.forms[tmp[2]]||null,preloader:tokens[1]||null};if(tmp[0]=="call"){tmp.shift();anchor.cmd.method="post";anchor.onclick=function(){return eval(tmp.join(".")+"(this)")}}else{anchor.onclick=function(){var msg=$("span._confirm_msg",this).html();if(msg){if(confirm(msg)){Ajax.doAction(this)}}else{Ajax.doAction(this)}return false}}}}else{if(anchor.cmd!=undefined&&anchor.cmd.action&&anchor.cmd.action!=href){anchor.cmd.action=href}}}anchor=null});$("input",document).each(function(input){if(input.form&&!input.onclick&&input.getAttribute("type")=="button"){var tokens=input.name.split(":");input.name=tokens[0];input.cmd={action:input.form.action,method:input.form.method.toLowerCase(),event:input.name,form:input.form,preloader:tokens[1]||null};input.onclick=function(){var confirmMessage=this.form[this.name+"_confirm"];if(confirmMessage){if(confirm(confirmMessage.value)){Ajax.doAction(this)}}else{Ajax.doAction(this)}return false}}input=null})}};function AjaxAction(A){var B=[];B.push("nocache="+(new Date().getTime()));B.push("_is_ajax=1");this.getUrl=function(){A=A.replace(/#$/g,"");if(A.indexOf("?")==-1){A+="?"}if(!/\?$/.test(A)){A+="&"}return A+B.join("&")};this.addParam=function(C,D){B.push(C+"="+encodeURIComponent(D))}}function Indicator(){this.show=function(){var A=Math.max(document.body.scrollTop,document.documentElement.scrollTop);document.body.style.cursor="wait";$(this.getIndicator()).css({top:A+"px",display:"block"})};this.hide=function(){$(this.getIndicator()).css("display","none");document.body.style.cursor="default"};this.getIndicator=function(){return $("#_indicator").get()||$('<div id="_indicator" class="indicator">Processing...</div>').get()}}function Preloader(A){var B=$('<div class="ajax-preloader">').html('<div><img src="'+AjaxApp.path+'icons/indicator_big.gif" alt="" /><br clear="all" /></div></div>').get();this.show=function(){var C=$(A).getDim();$(B).css({top:C.top+"px",left:C.left+"px",width:C.width+"px",height:C.height+"px"}).attr("id",A.id+"_preloader");B.style.filter="alpha(opacity=30)"};this.hide=function(){document.body.removeChild(B)}}Fader.FADEIN="fadein";Fader.FADEOUT="fadeout";Fader.FADEAWAY="fadeaway";function Fader(G,C){this.opacity=75;this.onfinish=null;var B,F,D=0.1,C=C||"#ffffae",A=this,E=$(G).getDim();F=$("#_fader_"+G.id).get()||$('<div id="_fadertest" />').get();$(F).css({zIndex:1111,display:"block",position:"absolute",top:E.top+"px",left:E.left+"px",background:C,width:E.width+"px",height:E.height+"px"});this.fadeOut=function(){if(this.opacity>10){this.applyOpacity(F);B=setTimeout(function(){A.fadeOut()},D)}else{if(this.opacity<=10){this.finish()}}};this.fadeAway=function(){if(this.opacity>10){this.applyOpacity(F);this.applyOpacity(G);B=setTimeout(function(){A.fadeAway()},D)}else{if(this.opacity<=10){G.parentNode.removeChild(G);this.finish()}}};this.applyOpacity=function(H){H.style.opacity=(this.opacity/100);H.style.filter="alpha(opacity="+this.opacity+")";--this.opacity};this.finish=function(){this.opacity=10;document.body.removeChild(F);clearInterval(B);if(this.onfinish){this.onfinish()}this.onfinish=F=G=null}}var Util={forms:{checkAll:function(D,B){var C=D.form;for(var A=0;A<C.elements.length;A++){if(C.elements[A]!=D&&C.elements[A].type=="checkbox"&&C.elements[A].name.substring(0,B.length)==B){C.elements[A].checked=D.checked}}}},redirect:function(C,B){B=B||document;try{B.location.href(C)}catch(A){B.location=C}}};(function(){if(!String.prototype.toCamelCase){String.prototype.toCamelCase=function(){var string,tokens=this.split("-");if(tokens.length>1){for(var i=1;i<tokens.length;i++){tokens[i]=tokens[i].substring(0,1).toUpperCase()+tokens[i].substring(1).toLowerCase()}string=tokens.join("")}return string}}if(!String.prototype.htmlSpecialChars){String.prototype.htmlSpecialChars=function(){var div=document.createElement("div");div.appendChild(document.createTextNode(this));return div.innerHTML}}if(!String.prototype.trim){String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(arg){for(var i=0;i<this.length;i++){if(this[i]==arg){return i}}return -1}}var __css_util={setStyle:function(el,p,v){if(!el){return }el.style[p]=v;el=null},getStyle:function(el,styleName){if(!el){return }var value;if(el.currentStyle){value=el.currentStyle[styleName.toCamelCase()]||null}else{if(document.defaultView){value=document.defaultView.getComputedStyle(el,null).getPropertyValue(styleName)}}if(!value&&el.style){value=el.style[styleName]||el.style[styleName.toCamelCase()]||null}el=null;return value},getBorderDiff:function(el){var diff={x:0,y:0};var props={x:["padding-left","padding-right","border-left-width","border-right-width"],y:["padding-top","padding-bottom","border-top-width","border-bottom-width"]};for(var id in props){for(var i=0;i<props[id].length;i++){diff[id]+=(parseInt(this.getStyle(el,props[id][i]))||0)}}el=null;return diff}};var __query={query:function(query,context){var s,item,r=[],m=[],els=[];if(/^<.*>$/.test(query)){var el,o=document.createElement("div");o.innerHTML=query;while(o.firstChild){document.body.appendChild(o.firstChild)}els.push(document.body.lastChild)}else{if(/^#/.test(query)&&/\//.test(query)){return this.xpath(query)}else{var res,qt,tokens=query.split(",");for(var i=0;i<tokens.length;i++){m=tokens[i].split(" ");if(m.length&&/#/.test(m[0])){context=document.getElementById(m[0].split("#")[1])||context;m.splice(0,1)}if(m.length){context=context||document;s=m.join(" ");if(s===tokens[0]&&!/\.|>| \[|\]/.test(s)){var items=context.getElementsByTagName(s);for(var j=0;j<items.length;j++){els.push(items[j])}}else{if(!/^>/.test(s)){s=" "+s}query=s.replace(/^</,"childNodes.").replace(/(\w*)\.(.[^ ]+)/g,"$1[class=$2]").replace(/class=/g,"className=").replace(/( ?> ?)/g,"/childNodes.").replace(/ /g,"/getElementsByTagName.");res=null,qt=query.split("/");for(var j=1;j<qt.length;j++){res=__query.find(qt[j],res?res:[context]);if(!res){break}}if(res){for(j=0;j<res.length&&res[j];j++){els.push(res[j])}}}}else{if(context&&context!=document){els.push(context)}}}}}context=null;return els},find:function(what,context){var map,child,tmp,els=[],s=[],push=false,method;what=what.split(".");method=what[0];s=what[1].match(/(\w*)(\[.*\])/)||[what[1]];if(s[1]){s.splice(0,1);if(s[1]){s[1]=s[1].match(/\[(\w+)(=.[^ \]]*)?\]/ig)}}for(var i=0;i<context.length;i++){tmp=method=="childNodes"?context[i].childNodes:context[i].getElementsByTagName(s[0]);for(var j=0;j<tmp.length;j++){child=tmp[j];if(child.tagName&&child.tagName.toLowerCase()==s[0]){if(s[1]){for(var k=0;k<s[1].length;k++){if(map=s[1][k].match(/\[(\w+)=(.+)\]/)){if(child[map[1]]){if(map[1]=="className"){var p=new RegExp("(^|\\s)"+map[2]+"(\\s|$)");push=p.test(child.className)}else{push=child[map[1]]==map[2]}}}else{if(map=s[1][k].match(/\[(\w+)\]/)){if(child.hasAttribute){push=child.hasAttribute(map[1])}else{push=child.attributes[map[1]]&&child.attributes[map[1]].specified}}}if(!push){break}}if(push){els.push(child);push=false}}else{els.push(child)}}}}context=null;return els},xpath:function(query){query=query.substr(1);var tokens=query.split("/"),id=tokens.shift(),el=document.getElementById(id),els=[],pattern=/(\w+)\[(\d+)\]/;var match,child;if(el){for(var i=0;i<tokens.length;i++){if((match=tokens[i].match(pattern))!=null){for(var j=0,index=0;j<el.childNodes.length;j++){child=el.childNodes[j];if(child.tagName&&child.tagName.toLowerCase()==match[1]){if(match[2]==index){el=child;break}index++}}}else{els=el.getElementsByTagName(tokens[i])}}}if(el){els.push(el)}el=null;return els}};var shortcuts={eq:"this.eq({idx})",lt:"this.lt({idx})",gt:"this.gt({idx})",first:"this.first()",last:"this.last()",even:"this.even()",odd:"this.odd()"};function $(query,context){this.els=[];var shortcut=null;if(!query){return this}if(typeof query=="function"){this.ready(query)}else{if(typeof query=="string"){var matches=query.split(/:(eq|gt|lt)\((\d+)\)$/i);if(matches.length==4){shortcut=shortcuts[matches[1]].replace("{idx}",matches[2])}this.els=__query.query(matches[0],context)}else{if(typeof query=="object"){this.els.push(query)}}}if(shortcut){return eval(shortcut)}return this}var ua=navigator.userAgent.toLowerCase();$.browser={isOpera:ua.indexOf("opera")>-1,isIe:ua.indexOf("msie")>-1,isIe6:ua.indexOf("msie 6")>-1,isIe7:ua.indexOf("msie 7")>-1,isSafari:ua.indexOf("webkit")};$.prototype={browser:$.browser,each:function(fn){if(fn){for(var i=0;i<this.els.length;i++){fn.call(this,this.els[i],i)}}return this},length:function(){return this.els.length},extend:function(){var p,args=arguments;this.each(function(target){for(var i=0;i<args.length;i++){if((p=args[i])!=null){for(var idx in p){if(target==p){continue}else{if(p[idx]!=undefined){target[idx]=p[idx]}}}}}target=null});p=args=null;return this},ready:function(f){bindReady();if(fn.isReady){f.call(document)}else{fn.readyList.push(f)}},xpath:function(query){this.els=__query.xpath(query);return this},find:function(query){var els=[],tmp=this.els;this.els=[];for(var i=0;i<tmp.length;i++){els=__query.query(query,tmp[i]);if(els.length){for(var j=0;j<els.length;j++){this.els.push(els[j])}}}return this},attr:function(attr,value,custom){if(attr&&value!=undefined){this.each(function(el){if(custom){el[attr]=value}else{el.setAttribute(attr,value)}});return this}else{if(attr=="class"){return this.els[0].className}else{return this.els[0]?this.els[0].getAttribute(attr):null}}},css:function(){if(arguments.length==1){var type=typeof arguments[0];if(type=="object"){var props=arguments[0];this.each(function(el){for(var id in props){__css_util.setStyle(el,id,props[id])}el=null});return this}else{if(type=="string"){return __css_util.getStyle(this.els[0],arguments[0])}}}else{if(arguments.length==2){var p=arguments[0],v=arguments[1];this.each(function(el){__css_util.setStyle(el,p,v);el=null});return this}}},saveState:function(){this.each(function(el){el.oldCssText=el.style.cssText;el=null});return this},restoreState:function(){this.each(function(el){el.style.cssText=el.oldCssText||"";el=null});return this},setClass:function(name){this.each(function(el){el.className=name;el=null});return this},addClass:function(name){this.each(function(el){var names=el.className.split(" ");names.push(name);el.className=names.join(" ");el=null});return this},removeClass:function(name){this.each(function(el){var ret=[],names=el.className.split(" ");for(var i=0;i<names.length;i++){if(names[i]!=name){ret.push(names[i])}}el.className=ret.join(" ");el=null});return this},hasClass:function(name){if(this.els[0]){var p=new RegExp("(^|\\s)"+name+"(\\s|$)");return p.test(this.els[0].className||"")}return false},toggleClass:function(name){var p=new RegExp("(^|\\s)"+name+"(\\s|$)");this.each(function(el){if(p.test(el.className||"")){el.className=el.className.replace(p,"")}else{el.className+=" "+name}});return this},stretch:function(onlyHeight){this.each(function(el){var dim=window.$(el.parentNode).getDim();var diff=__css_util.getBorderDiff(el);if(!onlyHeight){el.style.width="auto"}el.style.display="block";var height=(dim.iheight-diff.y-(parseInt(__css_util.getStyle(el,"margin-top"))||0)-(parseInt(__css_util.getStyle(el,"margin-bottom"))||0));for(var o=el.previousSibling;o;o=o.previousSibling){if(o.tagName){var oFloat=__css_util.getStyle(o,"float")||__css_util.getStyle(o,"style-float");if(/^left|right$/.test(oFloat)){continue}height-=(parseInt(__css_util.getStyle(o,"margin-top"))||0);height-=(parseInt(__css_util.getStyle(o,"margin-bottom"))||0);height-=o.offsetHeight}}el.style.height=height+"px";el=null});return this},getDim:function(){var dim={top:0,y:0,left:0,x:0,width:0,height:0},obj,el=obj=this.els[0];if(!el){return }if(obj.getBoundingClientRect){var box=obj.getBoundingClientRect();dim.top=box.top+Math.max(document.documentElement.scrollTop,document.body.scrollTop)-2;dim.left=box.left+Math.max(document.documentElement.scrollLeft,document.body.scrollLeft)-2}else{while(obj){dim.top+=obj.offsetTop;dim.left+=obj.offsetLeft;if(!this.browser.isOpera){dim.top+=parseInt(__css_util.getStyle(obj.offsetParent,"border-top-width"))||0;dim.left+=parseInt(__css_util.getStyle(obj.offsetParent,"border-left-width"))||0}var pos=__css_util.getStyle(obj,"position");if(/^absolute$/i.test(pos)){break}obj=obj.offsetParent}}for(obj=el.parentNode;obj&&obj!=document.body;obj=obj.parentNode){dim.top-=obj.scrollTop;dim.left-=obj.scrollLeft}dim.width=el.offsetWidth;dim.height=el.offsetHeight;if(el.clientWidth&&el.clientHeight){dim.iwidth=el.clientWidth;dim.iheight=el.clientHeight}else{var diff=__css_util.getBorderDiff(el);dim.iwidth=dim.width-diff.x;dim.iheight=dim.height-diff.y}el=obj=null;dim.x=dim.left;dim.y=dim.top;return dim},on:function(evt,fn){this.each(function(el){if(fn){el["on"+evt]=fn}else{if(fn!==false){el["on"+evt]()}}el=null});return this},html:function(html,mode){if(!html){return this.els[0]?this.els[0].innerHTML:null}this.each(function(el){var wrapper,prepend,before,after,selectedIndex=0;if(!mode){fn(el).empty()}else{if(mode=="prepend"){prepend=el.getElementsByTagName("*")[0]}else{if(mode=="before"){before=el}else{if(mode=="after"){after=el}}}}wrapper=document.createElement("div");if(typeof html=="object"){wrapper.appendChild(html)}else{if(/^t(body|foot|head)$/i.test(el.tagName)){wrapper.innerHTML="<table>"+html+"</table>";wrapper=wrapper.getElementsByTagName("tbody")[0]}else{if(/^select$/i.test(el.tagName)){wrapper.innerHTML='<select name="tmp">'+html+"</select>";wrapper=wrapper.getElementsByTagName("select")[0];for(var i=0;i<wrapper.childNodes.length;i++){if(wrapper.childNodes[i].selected==true){selectedIndex=i;break}}}else{wrapper.innerHTML=html}}}while(wrapper.firstChild){if(prepend){el.insertBefore(wrapper.firstChild,prepend)}else{if(before){el.parentNode.insertBefore(wrapper.firstChild,before)}else{if(after){var next=fn(after).next().get();if(next){el.parentNode.insertBefore(wrapper.firstChild,next)}else{el.parentNode.appendChild(wrapper.firstChild)}}else{el.appendChild(wrapper.firstChild)}}}}if(el.selectedIndex!=undefined){el.selectedIndex=selectedIndex}el=wrapper=prepend=before=after=null});return this},append:function(html){return this.html(html,"append")},prepend:function(html){return this.html(html,"prepend")},after:function(html){return this.html(html,"after")},before:function(html){return this.html(html,"before")},parent:function(tagName){for(var p=this.els[0].parentNode;p&&p!=document.body;p=p.parentNode){if(tagName){if(p.tagName==tagName.toUpperCase()){return window.$(p)}}else{return window.$(p)}}return window.$()},get:function(index){return this.els[index||0]||null},getAll:function(){return this.els},item:function(index){return this.els[index]?window.$(this.els[index]):window.$()},first:function(){return this.item(0)},last:function(){return this.item(this.els.length-1)},next:function(tagName){for(var o=this.els[0].nextSibling;o;o=o.nextSibling){if(tagName){if(o.tagName==tagName.toUpperCase()){return window.$(o)}}else{if(o.tagName){return window.$(o)}}}return window.$()},prev:function(tagName){for(var o=this.els[0].previousSibling;o;o=o.previousSibling){if(tagName){if(o.tagName==tagName.toUpperCase()){return window.$(o)}}else{if(o.tagName){return window.$(o)}}}return window.$()},eq:function(index){return this.item(index)},gt:function(from){if((this.els.length-1)<from){this.els=[]}else{this.els=this.els.slice(from+1)}return this},lt:function(before){this.els=this.els.slice(0,before);return this},even:function(){var tmp=[];for(var i=0;i<this.els.length;i++){if(i%2){tmp.push(this.els[i])}}this.els=tmp;tmp=null;return this},odd:function(){var tmp=[];for(var i=0;i<this.els.length;i++){if(!(i%2)){tmp.push(this.els[i])}}this.els=tmp;tmp=null;return this},empty:function(){var els=[];this.each(function(el){while(el.firstChild){fn.purge(el.firstChild);el.removeChild(el.firstChild)}el=null});return this},remove:function(){this.each(function(el){fn.purge(el);el.parentNode.removeChild(el);el=null})},fadeAway:function(onfinish){this.each(function(el){var f=new Fader(el);f.onfinish=onfinish;f.fadeAway()})},fadeOut:function(){this.each(function(el){var f=new Fader(el);f.fadeOut()})}};function fn(query,context){return($ instanceof $)?$(query,context):new $(query,context)}fn.browser=$.browser;fn.serialize=function serialize(o){return fn.json.stringify(o)};fn.json=function(){function f(n){return n<10?"0"+n:n}Date.prototype.toJSON=function(){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z"};var meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},escapeable=/["\\\x00-\x1f\x7f-\x9f]/g;function quote(string){return escapeable.test(string)?'"'+string.replace(escapeable,function(a){var c=meta[a];if(typeof c==="string"){return c}c=a.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"':'"'+string+'"'}function stringify(key,holder,replacer){var i,k,v,length,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof replacer==="function"){value=replacer.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}partial=[];if(typeof value.length==="number"&&!(value.propertyIsEnumerable("length"))){length=value.length;for(i=0;i<length;i+=1){partial[i]=stringify(i,value,replacer)||"null"}return"["+partial.join(",")+"]"}if(typeof replacer==="object"){length=replacer.length;for(i=0;i<length;i+=1){k=replacer[i];if(typeof k==="string"){v=stringify(k,value,replacer);if(v){partial.push(quote(k)+":"+v)}}}}else{for(k in value){v=stringify(k,value,replacer);if(v){partial.push(quote(k)+":"+v)}}}return"{"+partial.join(",")+"}"}}return{stringify:function(value,replacer){if(typeof replacer!=="function"){if(!replacer){replacer=function(key,value){if(!Object.hasOwnProperty.call(this,key)){return undefined}return value}}else{if(typeof replacer!=="object"||typeof replacer.length!=="number"){throw new Error("JSON.stringify")}}}return stringify("",{"":value},replacer)},parse:function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}if(/^[\],:{}\s]*$/.test(text.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")},quote:quote}}();fn.purge=function(d){var a=d.attributes,i,l,n;if(a){l=a.length;for(i=0;i<l;i+=1){n=a[i].name;if(typeof d[n]==="function"){d[n]=null}}}a=d.childNodes;if(a){l=a.length;for(i=0;i<l;i+=1){fn.purge(d.childNodes[i])}}};fn.loadCSS=function(href){if(fn.stylesheets==undefined){fn.stylesheets={};var links=document.getElementsByTagName("link");for(var i=0;i<links.length;i++){if(links[i].rel&&/stylesheet/i.test(links[i].rel)&&links[i].href&&links[i].href!=null){fn.stylesheets[links[i].href]=1}}}if(!fn.stylesheets[href]){fn.stylesheets[href]=1;var link=document.createElement("link");link.rel="stylesheet";link.type="text/css";link.href=href;document.getElementsByTagName("head")[0].appendChild(link)}};fn.loadScript=function(src,callback){if(fn.loadScript.loading==undefined){fn.loadScript.loading={}}var load=function(s){if(fn.loadScript.loading[s]){for(var i=0;i<fn.loadScript.loading[s].length;i++){var _callback=fn.loadScript.loading[s][i];!_callback.length?_callback():_callback[0].call(_callback[1])}fn.scripts[s]=1;delete fn.loadScript.loading[src]}else{if(fn.scripts[s]){!callback.length?callback():callback[0].call(callback[1])}}};if(fn.scripts==undefined){fn.scripts={};var scripts=document.getElementsByTagName("script");for(var i=0;i<scripts.length;i++){if(scripts[i].src&&scripts[i].src!=null){fn.scripts[scripts[i].src]=1}}}if(!fn.scripts[src]){if(fn.loadScript.loading[src]==undefined){fn.loadScript.loading[src]=[];var script=document.createElement("script");script.type="text/javascript";script.src=src;script._src=src;script.onload=function(){load(this._src)};if(fn.browser.isIe){script.defer="defer"}script.onreadystatechange=function(){if(/^loaded|complete$/i.test(this.readyState)){load(this._src)}};document.getElementsByTagName("head")[0].appendChild(script);script=null}fn.loadScript.loading[src].push(callback)}else{load(src)}};fn.readyList=[];fn.isReady=false;fn.bound=false;fn.ready=function(){if(!fn.isReady){fn.isReady=true;for(var i=0;i<fn.readyList.length;i++){fn.readyList[i].apply(document)}fn.readyList=null}};var bindReady=function(){if(fn.bound===true){return }fn.bound=true;if(document.addEventListener&&!fn.browser.isOpera){document.addEventListener("DOMContentLoaded",fn.ready,false)}if(fn.browser.isIe){(function(){if(fn.isReady){return }try{document.documentElement.doScroll("left")}catch(e){setTimeout(arguments.callee,0);return }fn.ready()})()}if(fn.browser.isOpera){document.addEventListener("DOMContentLoaded",function(){if(fn.isReady){return }for(var i=0;i<document.styleSheets.length;i++){if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);return }}fn.ready()},false)}else{if(fn.browser.isSafari){var len;(function(){if(fn.isReady){return }if(!/^loaded|complete$/.test(document.readyState)){setTimeout(arguments.callee,0);return }if(len===undefined){len=fn("style,link[rel=stylesheet]").length()}if(document.styleSheets.length!=len){setTimeout(arguments.callee,0);return }fn.ready()})()}else{window.onload=fn.ready}}};window.$=fn})();var Drag={start:function(I,C,G,A){I=Event.get(I);if(!A){A={}}if(!A.moveOnlyY){A.moveOnlyY=false}var E=$(C).getDim(A.absolute);var J=Event.getMouseXY(I);var B={x:J.x-E.left,y:J.y-E.top};function H(){return false}Event.add(document,"mousemove",D,false);Event.add(document,"mouseup",F,false);Event.add(document,"selectstart",H);Event.add(document,"drag",H);Event.cancel(I);dragable=null;function D(N){var K=Event.getMouseXY(N);if(K.x<J.x-5||K.x>J.x+5||K.y<J.y-5||K.y>J.y+5){if(!dragable){if(A.onBeforeDrag){A.onBeforeDrag(N,C)}$(C).css({position:"absolute",opacity:"0.5",filter:"alpha(opacity=50)",cursor:"move"});dragable=C}var M=K.x-B.x;var L=K.y-B.y;if(!A.moveOnlyY){C.style.left=M+"px"}else{C.style.left=E.left+"px"}if(A.shiftUp){L+=parseInt(A.shiftUp)}C.style.top=L+"px";if(A.onmove){A.onmove(N,C,K,B)}}}function F(O){Event.remove(document,"mousemove",D,false);Event.remove(document,"mouseup",F,false);Event.remove(document,"selectstart",H);Event.remove(document,"drag",H);Event.cancel(O);if(dragable){var N=C.style.top,M=C.style.left,L=C.style.width,K=C.style.height;C.style.cssText=C.oldStyleCssText;if(!G){$(C).css({position:"absolute",top:N,left:M,width:L,height:"auto",display:"block"})}}if(A.ondrop){A.ondrop(dragable,O)}C=null,dragable=null,A={}}}};var Event={get:function(A){return window.event||A},getTarget:function(A){A=window.event||A;return A.target||A.srcElement},targetIs:function(C,A){var B=this.getTarget(C);if(B.tagName&&B.tagName.toLowerCase()==A){return B}return null},add:function(C,A,D,B){if(C.addEventListener){C.addEventListener(A,D,B);return true}else{if(C.attachEvent){return C.attachEvent("on"+A,D)}else{C["on"+A]=D}}},remove:function(C,A,D,B){if(C.removeEventListener){C.removeEventListener(A,D,B)}else{if(C.detachEvent){C.detachEvent("on"+A,D)}else{C["on"+A]=null}}},cancel:function(A){try{A=window.event||A;if(A.stopPropagation){A.stopPropagation();A.preventDefault()}else{A.cancelBubble=true;A.returnValue=false}}catch(A){}},addOnLoad:function(A){$(A)},getKeyCode:function(A){var A=this.get(A);return A.keyCode||A.which},isRightClick:function(B){var A=null;if(B.which&&B.which==3){A={};A.x=B.pageX;A.y=B.pageY}else{if(B.button&&B.button==2){A={};A.x=B.clientX;A.y=B.clientY}}return A},getMouseXY:function(B){var A,C,B=window.event||B;if(B.clientX){A=B.clientX+Math.max(document.documentElement.scrollLeft,document.body.scrollLeft);C=B.clientY+Math.max(document.documentElement.scrollTop,document.body.scrollTop)}else{if(B.pageX&&typeof (B.pageX)=="number"){A=B.pageX;C=B.pageY}}return{x:A,y:C}}};var LightBox={target:null,show:function(B,A){var C=$("#lightbox").get();if(!C){C=$('<div id="lightbox"/>').css({position:"absolute",top:0,left:0,backgroundColor:"#000000",zIndex:"999",opacity:"0.7",filter:"alpha(opacity=70)"}).get()}this.hideSelects();this.showSelects(B);this.target=B;B.style.display="block";if(A.top){B.style.top=A.top}if(A.left){B.style.left=A.left}$(C).css({display:"block",width:document.body.clientWidth+document.body.scrollLeft+"px",height:(window.innerHeight||document.documentElement.clientHeight)+"px"});PopupManager.select(B)},hide:function(){if(this.target){this.target.style.display="none";this.target=null}document.getElementById("lightbox").style.display="none";this.showSelects();PopupManager.clean()},hideSelects:function(A){$("select",A).each(function(B){B.style.visibility="hidden"})},showSelects:function(A){$("select",A).each(function(B){B.style.visibility="visible"})}};var PopupManager={windows:[],select:function(B){if(B){if(B.zi==undefined||!B.zi){B.zi=this.windows.length;B.style.zIndex=1000+this.windows.length;this.windows.push(B)}else{for(var A=0;A<this.windows.length;A++){if(this.windows[A]!=B){this.windows[A].style.zIndex=1000+1}else{B.style.zIndex=1000+this.windows.length}}}}},clean:function(){for(var A=0;A<this.windows.length;A++){this.windows[A].zi=null;this.windows[A].style.display="none";this.windows[A]=null}this.windows=[]}};var UDW={config:{path:"/widgets/",domain:"http://localhost",uri:"http://localhost/widgets"},widgets:{},registerWidget:function(A,B){this.widgets[A]=B},getInstanceOf:function(A,B){return this.widgets[A]?new this.widgets[A](B):{}},widgetExists:function(A){return this.widgets[A]!=undefined},proxy:{request:function(B){var A=new XmlHttpRequest();A.oncomplete=function(C){if(B.callback.constructor==Array){B.callback[0][B.callback[1]].call(B.callback[0],C)}else{B.callback(C)}};A.doGet("udw/proxy/?uri="+encodeURIComponent(B.uri),B.form||null)},getFeed:function(B){var A=new XmlHttpRequest();A.oncomplete=function(D){var G={},F=D.getText().replace(/^\s|\s$/,"");try{var C=F?$.json.parse(F):null;if(!C.error&&C.feed){G.feed=C.feed}else{if(C.error){G.error=C.error}}}catch(E){G.error={code:404,message:"Unable To Load Requested Feed"}}if(B.callback.constructor==Array){B.callback[1].call(B.callback[0],G)}else{B.callback(G)}};A.doGet("udw/proxy/?service=feed&uri="+encodeURIComponent(B.uri),B.form||null)},getText:function(B){var A=new XmlHttpRequest();A.oncomplete=function(C){var D=C.getText().replace(/^\s|\s$/,"");if(B.callback.constructor==Array){B.callback[1].call(B.callback[0],D)}else{B.callback(D)}};A.doGet("udw/proxy/?service=text&uri="+encodeURIComponent(B.uri),B.form||null)},getXML:function(){var A=new XmlHttpRequest();A.oncomplete=function(C){var B=C.getXml();if(params.callback.constructor==Array){params.callback[1].call(params.callback[0],B)}else{params.callback(B)}};A.doGet("udw/proxy/?service=xml&uri="+encodeURIComponent(params.uri),params.form||null)},getJSON:function(B){var A=new XmlHttpRequest();A.oncomplete=function(C){var F={},E=C.getText().replace(/^\s|\s$/,"");try{F=$.json.parse(E)}catch(D){F={code:404,message:"Unable To Load Requested Data"}}if(B.callback.constructor==Array){B.callback[1].call(B.callback[0],F)}else{B.callback(F)}};A.doGet("udw/proxy/?service=json&nocache="+(new Date().getTime())+(B.nc?"&nc=1":"")+"&uri="+encodeURIComponent(B.uri),B.form||null)},findFeeds:function(B){var A=new XmlHttpRequest();A.oncomplete=function(C){var F={},E=C.getText().replace(/^\s|\s$/,"");try{F=$.json.parse(E)}catch(D){F={code:404,message:"Unable To Find Feeds"}}if(B.callback.constructor==Array){B.callback[1].call(B.callback[0],F)}else{B.callback(F)}};A.doGet("udw/proxy/?service=findFeeds&uri="+encodeURIComponent(B.uri),B.form||null)}},Components:{Tab:function(){var B={},A={},D;function C(F,E){this.index=F;this.isActive=function(){return E.active&&E.active==true};this.getLabel=function(){return E.label};this.setLabel=function(H){E.label=H;$("a > span",this).html(H)};this.setContent=function(H){$(A[this.index]).html(H)};this.getContent=function(){return $(A[this.index]).html()};this.getParent=function(){return this.parentNode};this.hide=function(){E.active=false;$("a",this).first().removeClass("active");$("#tab-menu-popup").css("display","none")};this.show=function(){E.active=true;$("a",this).first().addClass("active")};this.onclick=function(H){Event.cancel(Event.get(H));$("#tab-menu-popup").css("display","none");$(this).parent("div").get().activate(this);if(E.callback){E.callback(this)}return false};this.showPopUp=function(){var H=$("#tab-menu-popup").get()||$('<div id="tab-menu-popup" class="tab-menu-popup"></div>').get();$(H).css("zIndex",10000);var J=$("ul",H).get();if(J&&J.op){J.op.appendChild(J);$(J).css("display","none");J.op=null}J=$("ul",this).get();J.op=this;var I=$(this).getDim();$(H).html(J).css({display:"block",top:I.top+I.height+"px",left:I.left+"px",position:"absolute"});$(J).css("display","block")};var G=function(H,J){$("img.menu-down",H).on("click",function(M){Event.cancel(M);$(this).parent("li").get().showPopUp()});var I=J.subItems.items;var L=$(H).append('<ul class="menu-sub-items"></ul>').find("ul").get();html=[];if(I.constructor==Array){for(var K=0;K<I.length;K++){html.push('<li><a href="#">'+I[K]+"</a></li>")}}else{if(I.constructor==Object){for(var K in I){html.push('<li><a href="#" rel="'+K+'">'+I[K]+"</a></li>")}}}$(L).html(html.join(""));$(L).on("click",function(N){var M;if((M=Event.targetIs(N,"a"))!=null){J.subItems.callback.call(M,N,this.op)}});L=H=data=null};this.create=function(K){var J="";if(E.active){J="active"}if(E.className){J+=" "+E.className}var I=[];I.push("<li>");I.push('<a href="#" class="'+J+'">');I.push("<span>"+E.label+"</span>");if(E.subItems){I.push('&nbsp;<img class="menu-down" src="udw/assets/styles/img/pixel.gif" border="0" alt=""/>')}I.push("</a>");I.push("</li>");var H=$(I.join("")).get();$(K).append(H);K=null;$(H).extend(this);if(E.subItems){G(H,E)}return H};this.getPage=function(J){if(J){var H='<div class="cmp-tab-content" style="display:'+(this.isActive()?"block":"none")+'"></div>';var I=$(H).html(E.content||"").get();$(J).append(I);return I}else{return A[this.index]}}}this.addTab=function(F,E){B[F]=new C(F,E)};this.addNewTab=function(F,E){var G=new C(F,E);B[F]=G.create($(">ul",this).get());A[F]=B[F].getPage(this);this.activate(B[F])};this.getActiveTab=function(){var E=$(">ul>li",this).getAll();for(var F=0;F<E.length;F++){if(E[F].index==D){return E[F]}}};this.removeActiveTab=function(){B[D].parentNode.removeChild(B[D]);A[D].parentNode.removeChild(A[D]);delete B[D];delete A[D];for(var E in B){this.activate(B[E]);break}};this.removeTab=function(){};this.activate=function(E){$(">ul>li",this).each(function(F){id=F.index;if(F.index!=E.index){F.hide();A[id].style.display="none"}else{E.show();A[id].style.display="block";D=id}F=null});E=null};this.appendTo=function(F){var H=$('<div class="cmp-tab"><ul class="cmp-tabmenu"></ul><br clear="all" /></div>').get();for(var G in B){var E=B[G].create($("ul",H).get());if(E.isActive()){D=G}A[G]=E.getPage(H);E=null}$(H).extend(this);$(F).append(H);F=null;return H};this.getItemCount=function(){return $(">ul>li",this).length()};this.getTabs=function(){return B};this.getPages=function(){return A}},Pagination:{component:function(B){B=!B?{}:B;var G,D,H,J,C,A;function I(K){K.className=K.className.replace(/-disabled/g,"");K=null}function F(K){K.className=K.className.replace(/-disabled/g,"")+"-disabled";K=null}function E(L){var K=L.parentNode.className.match(/-disabled/);L=null;return K}this.setValue=function(K,L){B[K]=L};this.getValue=function(K){return(B[K])?B[K]:null};this.onclick=function(L){var K=Event.targetIs(L,"a");if(K&&K.rel&&!E(K)){if(K.rel=="next"){B.currentPage+=1;this.process(A);I(G);I(D);if(B.currentPage==C){F(H);F(J)}}else{if(K.rel=="prev"){B.currentPage-=1;this.process(A);if(B.currentPage==1){F(D);F(G)}}else{if(K.rel=="last"){B.currentPage=C;this.process(A);F(H);F(J);I(G);I(D)}else{if(K.rel=="first"){B.currentPage=1;this.process(A);F(G);F(D);I(H);I(J)}}}}}return false};this.init=function(){G=$("div.firstpage-disabled",this).get();D=$("div.previouspage-disabled",this).get();H=$("div.nextpage-disabled",this).get();J=$("div.lastpage-disabled",this).get()};this.reset=function(){F(G);F(D);F(H);F(J)};this.process=function(L,S){try{A=L;var R=A[B.rowName];if(R){C=Math.ceil(R.length/B.rowsPerPage);if(C>1){I(H);I(J)}var K=(B.currentPage-1)*B.rowsPerPage;var N=K+B.rowsPerPage;if(N>R.length){N=R.length}var Q=[];for(var O=K;O<N;O++){Q.push(R[O])}B.callback(Q);L=Q=null}}catch(P){var M=P.message}}},getComponent:function(A){var C=document.getElementById("feedpagination");try{C=C.cloneNode(true);C.id="";$(C).extend(new this.component(A));C.init()}catch(B){alert(B.message)}return C}},Balloon:{show:function(E,F,B){var A='<div class="balloon"><div class="balloon-content"><h3>'+F+'</h3><div class="close" onclick="UDW.Components.Balloon.hide(this.parentNode.parentNode)"></div>'+B+"</div></div>";var C=$(A).get();UDW.Util.mapFormToButton(C);var D=$(E).getDim();C.style.top=D.y+E.offsetHeight+"px";C.style.left=D.x+"px";C.style.display="block"},hide:function(A){document.body.removeChild(A)}}},Dashboard:{save:function(){var B={};var A=document.forms["save-state"];A.state.value=$("#dashboard").get().serialize();var C=new XmlHttpRequest();C.oncomplete=function(){};C.doPost(A.action,A)}},Map:{select:function(B,C){var A=Event.getTarget(Event.get(B));Ajax.doAction({cmd:{action:A.href,method:"post",preloader:"countries",event:"getcountries"}});$("#world-img").attr("src","udw/assets/map/"+A.className+".gif");return false}},Theme:{select:function(B){var A=$("#theme-loader").get();A.href=A.href.split("?")[0]+"?theme="+B.rel;UDW.config.theme=B.rel;$(B).parent("fieldset").find("a").each(function(C){$(C).setClass(C==B?"current-theme":"")});$("#theme-action").attr("href","udw/actions/?page=theme&theme="+B.rel);UDW.Dashboard.save();B=null;return false}},WD:{initWidgetDirectory:function(){Ajax.initializeElements();$("#widget-directory-columns > li.widget-directory-column > ul").on("click",function(B){var A;if((A=Event.targetIs(B,"a"))){$("a",A.parentNode.parentNode).each(function(D){var C=A==D?"widget-category-current":"";$(D).setClass(C)})}});$("#widget-directory").stretch();$("#widget-directory > ul").stretch(true);$("#widget-directory > ul > li").stretch(true);$("#widget-directory > ul > li > ul").stretch(true)},addToPage:function(){var A=$("#widget-preview1 div.widget").get();A.disableHeader=false;A.disableDrag=false;UDW.Widget.append(A);UDW.WD.removePreview();A.save()},removePreview:function(){$("#widget-preview,#widget-preview1").remove()}},Util:{getEditableInput:function(B){var A=[];A.push(document.createElement("input"));A[0].type="text";A[0].onclick=function(C){Event.cancel(C)};A[0].onkeydown=function(D){var C=Event.getKeyCode(D);if(C==13){this.onblur();return false}};A[0].onblur=function(){$(this.parentNode).html(this.value);UDW.Dashboard.save()};A[0].value=B||"";return A.pop()},mapFormToButton:function(A){$("form",A).on("keypress",function(D){var C=Event.getKeyCode(D);if(C&&C==13){var B=$("input[type=button]",this).get();if(B&&B.onclick){Event.cancel(Event.get(D));B.onclick(D)}B=null}});A=null}},str:function(B){if(!UDW.locale){UDW.locale={}}if(!UDW.str.locale){UDW.str.locale={}}if(UDW.locale[B]){B=UDW.locale[B]}else{try{UDW.str.locale[B]=B}catch(A){}}return B},t_load:function(A){$.loadScript("udw/widgets/"+A+"/"+A+".js",function(){var G=$("#widget-preview").get()||$('<div id="widget-preview"></div>').get();var C=$('<div id="widget-preview1" style="display: none"><div style="width: 65%; height: 420px; margin: 5% auto 0; background-color: #EFEFEF;"><div style="background-color: #fff; padding: 12px; border: 8px solid silver; overflow-y: scroll; height: 350px;"></div><div style="text-align: right; padding: 5px 8px 0 0;"><input type="button" value="Add to Page" onclick="UDW.WD.addToPage()"/>&nbsp;<input type="button" value="Cancel" onclick="UDW.WD.removePreview()"/></div></div></div>').get();var D=UDW.Widget.get({name:A});if(D.config.css){$.loadCSS("udw/widgetstyle?widget="+A)}var F=$("#settings").getDim(true);D.setStyle("white");D.disableHeader=true;D.disableDrag=true;$(G).css({position:"absolute",display:"block",top:F.top+"px",left:F.left+"px",width:F.width+"px",height:F.height+"px",opacity:"0.5",filter:"alpha(opacity=50)",backgroundColor:"#000",zIndex:9999});$(C).css({position:"absolute",display:"block",top:F.top+"px",left:F.left+"px",width:F.width+"px",height:F.height+"px",zIndex:10000});var B=$("div > div",C).get();$(B).html(D);D.onload();if($.browser.isIe7){var F=$(B).getDim();if(B.scrollWidth>F.iwidth){var E=parseInt($(B).css("padding-right"))||0;E+=16;$(B).css({paddingRight:E+"px",overflowX:"hidden"})}}})}};UDW.Env={Widget:function(){this.isMoving=false;this.disableRefresh=false;this.disableHeader=false;this.disableDrag=false;this.save=function(){UDW.Dashboard.save()};this.ondrop=function(){this.save()};this.onclick=function(){if(this.isMoving&&Mouse){Mouse.up(this)}};this.move=function(C){var D=this.parentNode;if(C=="top"){D.addWidgetAt(0,this)}else{if(C=="up"){D.addWidgetAt(this.opts.index-1,this)}else{if(C=="down"){D.insertBefore($(this).next("div").get(),this);D.resetWidgetOrder()}else{if(C=="bottom"){D.appendChild(this);D.resetWidgetOrder()}else{if(C=="left"||C=="right"){var B=D.getIndex()+(C=="left"?-1:1);var A=$("div.column",D.parentNode).get(B);var E=D;A.addWidgetAt(0,this)}}}}}this.save();return false};this.setup=function(){this.addOption("cssText",this.style.cssText);this.addOption("className",this.className);this.addOption("dropTarget",this.parentNode);this.addOption("width",this.offsetWidth);this.addOption("height",this.offsetHeight);this.addOption("xy",$(this).getDim(true));this.setStyle(this.getStyle()||"white")};this.clone=function(){var A=this.serialize();A.id="";return UDW.Widget.createFromJson(A)};this.serialize=function(){var A={};A.id=this.id;A.name=this.getName();A.index=this.opts.index;A.title=this.getValue("title");A.style=this.getStyle();A.expanded=(this.opts.expand.className=="widget-collapse"?true:false);if(this.opts.prefs){A.preferences=UDW.Preferences.serialize(this.opts.prefs.firstChild)}A.data=this.data;return A};this.init=function(A){var B=this;this.id="wdg-"+(new Date()).getTime();this.addOption("id",this.id);this.addOption("title",$("div.widget-title",this).get());this.addOption("content",$("div.widget-content",this).get());this.addOption("footer",$("div.widget-footer",this).get());this.addOption("prefs",$("div.widget-preferences",this).get());this.addOption("style",A.style!=undefined?A.style:"white");if(A.data!=undefined){this.data=A.data}if(A){if(A.id){this.setId(A.id)}this.setTitle(A.title);if(A.content){this.setContent(A.content)}this.setName(A.name);this.addOption("expanded",A.expanded)}$("div.widget-header",this).extend({onmousedown:function(C){if(B.disableDrag==true){return }Drag.start(C,B,true,{shiftUp:0,onBeforeDrag:function(E,D){D.setup();Mouse.onBeforeDrag(D);D=null},onmove:Mouse.move,ondrop:Mouse.up});return false},onmouseover:function(C){if(this.isMoving){return }if(B.disableHeader==true){return }if(!this.className.match(new RegExp("widget-header-over"))){this.className+=" widget-header-over"}},onmouseout:function(C){if(this.isMoving){return }if(B.disableHeader==true){return }this.className=this.className.replace(new RegExp(" widget-header-over","g"),"")},ondblclick:function(C){Event.cancel(C);B.opts.expand.onclick()}});$("div.widget-header > div",this).each(function(D){var C=D.className;if(C=="widget-collapse"){B.addOption("expand",D);D.onclick=function(){this.className=="widget-expand"?B.expand():B.collapse();return false}}else{if(C=="widget-icon"){B.addOption("icon",D)}else{if(C=="widget-refresh"){B.addOption("refresh",D);D.onclick=function(){B.setPreloader();B.onload();return false}}else{if(C=="widget-close"){D.onclick=function(){var E=B.parentNode;if(confirm("Are u sure you want to close widget?")){E.removeChild(B)}if(document.onclick){document.onclick()}B.save();return false}}else{if(C=="widget-edit"){D.onclick=function(F){var E=$(B.opts.prefs).css("display");E=="block"?B.hidePreferences():B.showPreferences();return false}}else{if(C=="widget-options"){D.onclick=function(E){Event.cancel(Event.get(E));UDW.Widget.menu.get(B).show(this);return false}}}}}}}})}}};UDW.Sidebar={opened:false,show:function(){var A=$.browser.isIe6?79.5:79.7;document.getElementById("sidebar").style.display="block";document.getElementById("content").style.cssText="width: "+A+"%; float: left";document.getElementById("add-content").style.display="none";this.opened=true;return false},popupId:null,showPopup:function(C,A){this.hidePopup();$("#detected-feeds").css("display","none");var B=$(C).getDim();return $("#"+A).css({left:B.left+B.width-12+"px",top:B.top-10+"px",display:"block"}).on("click",function(D){Event.cancel(D)}).get()},hidePopup:function(A){if((A=this.popupId||A)){$("#"+A).css("display","none").find("div.popup-content").empty()}},close:function(){document.getElementById("sidebar").style.display="none";document.getElementById("content").style.cssText="";document.getElementById("add-content").style.display="";this.opened=false;return false},init:function(){$("#sidebar-inner a.sidebar-close").on("click",function(){UDW.Sidebar.close()});var list=$("div.expand-list").get();list.openMyFeeds=function(){$("a",this).first().setClass("expanded").next("ul").css("display","block").find("a").first().setClass("expanded").next("ul").css("display","block")};list.onclick=function(e){var loadFeeds=function(t){var http=new XmlHttpRequest(),action=t.href,t=t.parentNode;if(!$("span",t).get()){$(t).append("<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Loading...</span>")}http.oncomplete=function(http){var result=http.getText().replace(/^\s|\s$/,"");try{result=eval("("+result+")");$("span",t).remove();$(t).append(result.list)}catch(e){}};http.doGet(action,null)};var target=Event.getTarget(e);if(target.tagName&&/^a|em$/i.test(target.tagName)){if(/^em$/i.test(target.tagName)){target=target.parentNode}}if(target){if(/^img|span$/i.test(target.tagName)||/^no-feeds$/.test(target.className)){return }var className=target.className;if(!/^feed-url$/.test(className)&&(!target.rel||/^(get|post)/.test(target.rel))){var display,ul=target.parentNode.getElementsByTagName("ul")[0];if(className=="collapsed"){target.className="expanded";display="block"}else{if(className=="expanded"){target.className="collapsed";display="none"}}if(ul){ul.style.display=display}else{loadFeeds(target)}}else{var popup=UDW.Sidebar.showPopup(target,"widget-popup");$("div.popup-content",popup).empty().html('<div class="preloader"><div><img src="udw/assets/styles/img/preloader.gif" alt="" /></div><span>'+(UDW.str("Loading Widget")+"...")+"</span></div>");$.loadScript("udw/widget.php?widget="+target.rel,function(){var widget=UDW.Widget.get({name:target.rel});if(widget){widget.setStyle("white");widget.disableHeader=true;widget.disableDrag=true;if(target.rel=="feed"){widget.setValue("url",target.href)}if(widget.config.css!=undefined&&widget.config.css){$.loadCSS("udw/widgetstyle.php?widget="+target.rel)}var interval=window.setInterval(function(){try{$("a:eq(0)",popup).on("click",function(e){widget.disableHeader=false;widget.disableDrag=false;UDW.Util.mapFormToButton(widget);UDW.Widget.append(widget);widget.save();popup.style.display="none";this.onclick=function(e){Event.cancel(e)};return false});$("div.popup-content",popup).empty().html(widget);widget.onload()}catch(e){}window.clearInterval(interval)},500)}})}}Event.cancel(e)};list=null}};(function(){var B=function(){this.current=0;this.setTitle=function(G){$("#page-title > h1").html(G)};this.getTitle=function(){return $("#page-title > h1").html()};this.addNewTab=function(){var H={active:true,title:"New Page",columns:[{widgets:[]},{widgets:[]},{widgets:[]}]};var G=$(">div.pages > div.page",this).length();this.addPage(H,G)};this.getCurrentPage=function(){return $(">div.pages > div.page",this).get(this.current)};this.getPageAt=function(G){return $(">div.pages > div.page",this).get(G)};this.addPages=function(G){for(var I=0;I<G.length;I++){this.addPage(G[I],I)}var H=window.setInterval(function(){$("#splash-screen").css("display","none");$("#content").setClass("content-visible");window.clearInterval(H)},3000)};this.addPage=function(J,G){var I=$(">div.tabs > div.new-tab",this).first().before('<div class="tab'+(J.active?" tab-current":"")+'"><div class="tab-icon">'+(J.icon?'<img src="'+J.icon+'" alt="" />':"")+'</div><a href="#">'+J.title+'</a><div class="tab-menu-button"></div></div>').parent("div").find("div.tab").last().extend(new F("tab-"+G+"-"+(new Date().getTime()),G)).attr("index",G,true).get();if(J.active){I.select()}if(J.icon){$("div.tab-icon",I).css("display","block")}var H=$(">div.pages",this).append('<div class="page'+(J.active?" active":"")+'"></div>').find("div.page").last().extend(new D()).get();H.addColumns(J.columns);$(H).append('<div class="clear"/>')};this.removePage=function(J){var G=0,H=0,I=$(">div.tabs > div.tab",this);if(I.length()>1){I.each(function(L,K){if(L.id==J){G=K;$(L).remove()}else{L.index=H;H++}});$(">div.pages > div.page",this).get(G).remove();$(">div.tabs > div.tab",this).get().select();document.onclick()}else{alert(UDW.str("You can't delete only page on the dashboard"))}UDW.Dashboard.save()};this.serialize=function(){var H={};H.title=encodeURIComponent(this.getTitle());H.sidebar={opened:(UDW.Sidebar.opened)};H.tabs=[];$(">div.tabs > div.tab",this).each(function(I){H.tabs.push(I.serialize())});H.myFeeds=[];$("#my-feeds a.feed-url").each(function(I){H.myFeeds.push({uri:encodeURIComponent(I.href),title:encodeURIComponent(I.innerHTML)})});H.locale=UDW.config.locale||"en_US";H.theme=UDW.config.theme||"";H.nld={};for(var G in UDW.str.locale){UDW.locale[G]=UDW.str.locale[G];H.nld[G]=UDW.str.locale[G];delete UDW.str.locale[G]}return $.serialize(H)}};var D=function(){this.addColumns=function(H){for(var G=0,I=H.length;G<I;G++){H[G].width=I>1?(H[G].width||(100/I-0.5))+"%":"100%";this.addColumn(H[G],G,G+1<I)}};this.addColumn=function(I,G,J){var H=$(this).append('<div class="column"></div>'+(J?'<div class="column-resizer"></div>':"")).find("div.column").last().css("width",I.width).attr("id","col-"+G+"-"+(new Date().getTime())).extend(new A()).attr("index",G,true).get();H.addWidgets(I.widgets);Mouse.addDropTarget(H,"div");E.init(this)};this.addNewColumn=function(G){$(">div.clear",this).before('<div class="column-resizer"></div>');$(">div.clear",this).before('<div class="column" style="width:'+G.width+'"></div>');Mouse.addDropTarget($(this).find("div.column").last().get(),"div");$(">div.column",this).each(function(I,H){$(I).extend(new A());I.id="col-"+H+"-"+(new Date).getTime();I.index=H});E.init(this)};this.getColumns=function(){return $("div.column",this).getAll()};this.getColumnCount=function(){return $("div.column",this).length()};this.getColumnAt=function(G){var H=this.getColumns();return H[G]?H[G]:H[0]?H[0]:null};this.remove=function(){var H=this.getColumns();for(var G=0;G<H.length;G++){H[G].remove()}$(this).remove()}};var A=function(){this.index=0;this.pos=null;this.getId=function(){return this.id};this.setIndex=function(H){this.index=H};this.getIndex=function(){return this.index};this.setId=function(H){this.id=H};this.setWidth=function(H){this.style.width=H+"%"};this.getWidth=function(){return parseFloat(this.style.width)};this.getWidgets=function(H){return $("div.widget",this).each(H).getAll()};this.getWidgetAt=function(H){return this.getWidgets()[H]};this.addWidgetAt=function(H,J){var I=this.getWidgets();if(I.length>0&&I[H]){this.insertBefore(J,I[H])}else{this.appendChild(J)}this.resetWidgetOrder();J=null};this.resetWidgetOrder=function(){this.getWidgets(function(H,I){H.addOption("index",I)})};var G=function(J,I,H){I.tmp=[];this.load=function(){var K=UDW.Widget.createFromJson(J);if(K.config&&K.config.css!=undefined&&K.config.css){$.loadCSS("udw/widgetstyle.php?widget="+J.name)}K.addOption("index",H);I.addWidgetAt(H,K);if(K.onload){K.onload()}UDW.Util.mapFormToButton(K);I=K=null}};this.addWidgets=function(I){for(var H=0;H<I.length;H++){this.addWidget(I[H],H)}Mouse.recalculate()};this.addWidget=function(J,I){var H=new G(J,this,I);$.loadScript("udw/widget.php?widget="+J.name+"&nocache="+new Date().getTime(),function(){H.load.call(H)})};this.serialize=function(){var K={},J=[];K.id=this.id;K.width=this.getWidth();K.widgets=[];var I=this.getWidgets();for(var H=0;H<I.length;H++){K.widgets.push(I[H].serialize())}return K};this.remove=function(){Mouse.removeDropTarget(this);$(this).remove()}};var F=function(I,H){this.id=I;this.index=H;var G=function(O,N){var L=function(){return $("#"+O).get()};N.onclick=function(P){Event.cancel(P)};$("img.close-option-menu",N).on("click",function(){$("#tabmenu-option-menu").css("display","none")});$("a.tab-remove",N).on("click",function(){if(confirm(UDW.str("Are you sure you want to remove selected tab?"))){$("#dashboard").get().removePage(O)}});$("a.tab-edit",N).on("click",function(R){var P=$("a",L()).get();var Q=UDW.Util.getEditableInput(P.innerHTML);$(P).html(Q);Q.focus();Q.select();return false});$("#tab-icons").on("click",function(Q){Event.cancel(Q);var P;if((P=Event.targetIs(Q,"area"))){L().setIcon(P.href)}});$("li.expanded a",N).on("click",function(Q){var P=this.parentNode.className;$(this.parentNode).setClass(P=="expanded"?"collapsed":"expanded");return false});var M=document.forms["tabmenu-icon"];M["remove-icon"].onclick=function(){L().removeIcon()};M=document.forms["external-icon-form"];M.apply.onclick=function(){L().setIcon(this.form["external-icon"].value)};M.none.onclick=function(){L().removeIcon()};M=document.forms["tabmenu-columns"];var J=function(S,R){var Q=$("span",R).get();for(var P=0;P<R.colcount.length;P++){R.colcount[P].style.display=R.colcount[P].value==S?"none":""}$(R.colcount[S-1]).before($(Q).html(S).get());R=Q=null};var K=function(S){var T=L().dashboard().getCurrentPage();var U=T.getColumns();var P;var R=(100/S-0.5)+"%";if(S<U.length){for(var Q=0;Q<U.length;Q++){U[Q].style.width=R;if(Q>0&&(Q+1)>S){if(!P){P=U[Q-1]}U[Q].getWidgets(function(V){$(P).append(V)});$(U[Q]).prev("div").remove();$(U[Q]).remove()}}}else{if(S>U.length){for(var Q=0;Q<U.length;Q++){U[Q].style.width=R}for(var Q=0;Q<S-U.length;Q++){T.addNewColumn({width:R})}}}};$("input[name=colcount]",M).on("click",function(){J(parseInt(this.value),this.form);K(parseInt(this.value))});J(L().getPage().getColumnCount(),M);N=M=null};this.onclick=function(L){var J=Event.getTarget(L);if(J.className&&J.className=="tab-menu-button"&&$(this).hasClass("tab-current")){Event.cancel(L);var M=$("#tabmenu-option-menu").get();if(!M.initialized){G(this.id,M)}var K=$(this).getDim();$(M).css({top:K.top+K.height+"px",left:K.left+"px",display:"block"})}else{this.select()}return false};this.select=function(){var K=0,J=this;$("div.tab",this.parentNode).each(function(M,L){$(M).setClass(J==M?"tab tab-current":"tab");if(J==M){K=L}});$("#dashboard > div.pages > div.page").each(function(M,L){$(M).setClass(L==K?"page active":"page")});this.dashboard().current=K};this.dashboard=function(){return $("#dashboard").get()};this.getPage=function(){return this.dashboard().getCurrentPage()};this.getTitle=function(){return $("a:eq(0)",this).html()};this.setIcon=function(J){$("div.tab-icon:eq(0)",this).html('<img src="'+J+'" alt="" />').css("display","block")};this.removeIcon=function(){$("div.tab-icon:eq(0)",this).empty().css("display","none")};this.getIcon=function(){return $("img",this).attr("src")};this.serialize=function(){var K={};K.id=this.id;K.index=this.index;K.title=this.getTitle();K.icon=this.getIcon();K.active=$(this).hasClass("tab-current");K.columns=[];var J=this.dashboard().getPageAt(this.index);$(">div.column",J).each(function(L){K.columns.push(L.serialize());L=null});return K}};var E={handlers:[],onresize:function(G){this.handlers.push(G)},init:function(G){$("div.column-resizer").each(function(H){if($.browser.isOpera){H.style.width="6px"}H.onmousedown=function(I){E.move(I,this)};H.onmouseover=function(){if(!this.moveing){$(this).css("backgroundColor","#EFEFEF")}};H.onmouseout=function(){if(!this.moveing){$(this).css("backgroundColor","")}};H=null})},move:function(M,R){var P=$(R).prev("div").get();var G=$(R).next("div").get();M=Event.get(M);var J=$(R).getDim();var N=Event.getMouseXY(M);var H={};H.x=N.x-J.x;H.y=N.y-J.y;var Q=parseFloat(P.style.width);var O=parseFloat(G.style.width);var L=function(){return false};Event.add(document,"mousemove",I,false);Event.add(document,"mouseup",K,false);Event.add(document,"selectstart",L);Event.add(document,"drag",L);Event.cancel(M);function I(W){var V=Event.getMouseXY(W);if(V.x<N.x-2||V.x>N.x+2){if(!R.resizing){R.resizing=true;document.body.style.cursor="col-resize"}var U=Q+((V.x-N.x)/10);var T=O-((V.x-N.x)/10);if(U<5||T<5){return }P.style.width=U+"%";G.style.width=T+"%";if(E.handlers.length){for(var S in E.handlers){E.handlers[S](P,G)}}}}function K(S){Event.remove(document,"mousemove",I,false);Event.remove(document,"mouseup",K,false);Event.remove(document,"selectstart",L);Event.remove(document,"drag",L);R.resizing=false;document.body.style.cursor="default";R=null}}};var C=arguments;Event.addOnLoad(function(){$("#dashboard").extend(new B()).find("div.new-tab").on("click",function(){$("#dashboard").get().addNewTab();return false});$("#dashboard").get().setTitle(UDW.savedState.title);$("#dashboard").get().addPages(UDW.savedState.tabs);for(var H=0;H<C.length;H++){var G=C[H];if(G.constructor&&G.constructor==Function){G()}}try{for(var H=0;H<UDW.savedState.myFeeds.length;H++){UDW.MyFeed.append(UDW.savedState.myFeeds[H])}}catch(I){}})})(function(){document.onclick=function(B){var A=["ul.menu-sub-items","ul.widget-menu","#search-engines","#tabmenu-option-menu","#widget-popup","#feed-item-popup","#weather-city-list"];$(A.join(",")).css("display","none")}},function(){$("#page-title h1").on("click",function(){var A=UDW.Util.getEditableInput();A.className="page-title-edit";A.value=this.innerHTML;$(this).html(A);A.focus();A.select();A=null})},function(){$("#add-content").on("click",function(){UDW.Sidebar.show(this);return false});$("#expand-collapse-all").on("click",function(){if(this.className=="collapse-all"){$("div.widget").each(function(A){A.collapse()});this.className="expand-all"}else{if(this.className=="expand-all"){$("div.widget").each(function(A){A.expand()});this.className="collapse-all"}}return false});$("#search-engine a").on("click",function(B){Event.cancel(Event.get(B));var C=$("#search-engines").css("display")!="none";if(C){$("#search-engines").css("display","none")}else{var A=$(this).getDim();$("#search-engines").css({top:A.top+A.height+"px",left:A.left+"px",display:"block"})}return false});$("#search-engines").on("click",function(B){var A;if((A=Event.targetIs(B,"a"))){$("#search-engine form").attr("action",A.href);$("#search-engine img").setClass(A.rel+"-icon")}return false});$("#top-nav a.settings").on("click",function(){LightBox.show(document.getElementById("settings"),{top:"5%",left:"16%"});return false})},function(){$("#settings ul.dialog-list").on("click",function(B){var A;if((A=Event.targetIs(B,"a"))){$(A).parent("ul").find("a").each(function(D){var C=D==A?"md-menu-item-current":"";$(D).setClass(C);D=null})}A=null})},Ajax.initializeElements,UDW.Sidebar.init,UDW.Util.mapFormToButton);var Mouse=function(){var B=[];var C=function(){return document.getElementById("drop-placeholder")||$('<div class="drop-placeholder" id="drop-placeholder"></div>').get()};var A=function(D){$(D.opts).extend({cssText:D.style.cssText,xy:$(D).getDim(true),width:D.offsetWidth,height:D.offsetHeight})};return{addDropTarget:function(D){B.push(D)},removeDropTarget:function(F){var E=[];for(var D=0;D<B.length;D++){if(B[D]!=F){E.push(B[D])}}B=E},onBeforeDrag:function(D){Mouse.recalculate();$(C()).css({display:"block",height:D.opts.height-5+"px"});$(D).before(C()).css({width:D.opts.xy.iwidth+"px",height:D.opts.xy.iheight+"px"}).attr("isMoving",true,true)},move:function(J,F,I,E){var D;for(var G=0,H;G<B.length;G++){H=B[G].pos;if((I.x>H.x)&&(I.x<(H.x+H.width))){D=B[G];break}}if(D){for(var G=0,K,H;G<D.childNodes.length;G++){K=D.childNodes[G];if((H=K.opts?K.opts.xy:null)){if((I.x>H.x)&&(I.x<(H.x+H.width))&&(I.y>H.y)&&(I.y<(H.y+H.height))){var N=H.y+Math.ceil(parseInt(H.height)/2),L=I.y-E.y,M=null;M=L<N?K:M=K.nextSibling||null;break}}}M?M.parentNode.insertBefore(C(),M):D.appendChild(C())}},up:function(D){if(D){try{C().parentNode.replaceChild(D,C());D.parentNode.resetWidgetOrder();D.style.cssText=D.opts.cssText}catch(E){}D.isMoving=false;D.save()}},recalculate:function(){for(var F=0,E;F<B.length;F++){B[F].pos=$(B[F]).getDim(true);E=B[F].childNodes;for(var D=0;D<E.length;D++){if(E[D].className&&/widget /.test(E[D].className)){A(E[D])}}}}}}();function FeedReader(){var B,F,E,C,D,A;this.sidebarState=false;this.getFeedAt=function(G){return B.entries[G]};this.setTitle=function(G,H){$("#frame-"+A+" div.dialog-content h2.feed-title > a",this).attr("href",G).html(H)};this.setDate=function(G){$("#frame-"+A+" div.dialog-content p.feed-date > a",this).html()};this.setContent=function(G){$("#frame-"+A+" div.dialog-content div.feed-data",this).html(G)};this.init=function(H,I){var G=this;$("ul.dialog-list",this).html(this.buildFeed(H,I).join("")).on("click",function(L){var J=Event.getTarget(L);if(J.tagName&&J.tagName.toLowerCase()=="a"){if((curr=$("a.md-menu-item-current",this).get())){curr.className=""}$(J).setClass("md-menu-item-current",this);var K=G.getFeedAt(J.id.match(/(\d)$/)[0]);G.setTitle(K.link,K.title);G.setDate(K.publishedDate);G.setContent(K.content)}return false})};this.buildFeed=function(J,L){B=L;var H,K=[];for(var G=0;G<L.entries.length;G++){var I=L.entries[G];if(J&&decodeURIComponent((J.href||J.link))==decodeURIComponent(I.link)){this.setTitle(I.link,I.title);this.setDate(I.publishedDate);this.setContent(I.content);H="md-menu-item-current"}else{H=null}K.push("<li>");K.push('<a href="'+decodeURIComponent(I.link)+'" id="feed-item-'+G+'" onclick="return false;"'+(H?' class="'+H+'"':"")+">");K.push(I.title);K.push("</a></li>")}return K};this.showOutlook=function(G){A="outlook";$("li.simple-view",G.parenNode).removeClass("view-on");$(G).addClass("view-on");$("#frame-simple").css("display","none");$("#frame-outlook").css("display","block");this.resizeOutlook()};this.showSimple=function(G){A="simple";$("li.outlook-view",G.parenNode).removeClass("view-on");$(G).addClass("view-on");$("#frame-outlook").css("display","none");$("#frame-simple").css("display","block");this.resizeSimple()};this.resize=function(){try{var G=window.innerHeight||document.documentElement.clientHeight;this.style.height=G-$(this).getDim().top-12+"px";A="simple";if(A&&A=="simple"){this.showSimple;this.resizeSimple()}else{this.showOutlook;this.resizeOutlook()}}catch(H){}};this.resizeOutlook=function(){var I="#frame-outlook > div.dialog-menu > div.expand-list > ul > li";if(!$(I).find("ul").get()){var H=this;var G=$("#sidebar-inner div.expand-list > ul > li > ul").get();G=G.cloneNode(true);$(I).append(G).find("a.collapsed").setClass("expanded");$(I).find("ul").css("display","block");$("#frame-outlook > div.dialog-menu > div.expand-list").on("click",function(N){var M=Event.getTarget(N);if(M.tagName&&M.tagName.toLowerCase()=="a"){var K=M.className;if(K!="feed-url"&&!M.rel){var J=M.parentNode.getElementsByTagName("ul")[0];if(K=="collapsed"){M.className="expanded";J.style.display="block"}else{if(K=="expanded"){M.className="collapsed";J.style.display="none"}}}else{var L=new Feed(M.href);L.load(function(O){if(O.feed){var P=O.feed.entries[0];var Q=$("ul.dialog-list",H).html(H.buildFeed(P,O.feed).join("")).parent("div").get();Q.scrollTop=0;H.setTitle(P.link,P.title);H.setDate(P.publishedDate);H.setContent(P.content)}else{if(O.error){H.setContent(O.error.message)}else{H.setContent("Unable to process request")}}})}return false}})}$("#feed-reader > div.dialog-frame").stretch(true);$("#frame-outlook").stretch(true);$("#frame-outlook > div.dialog-menu").stretch(true);$("#frame-outlook > div.dialog-content").last().stretch(true)};this.resizeSimple=function(){$("#feed-reader > div.dialog-frame").stretch(true);$("#frame-simple").stretch();$("#frame-simple > div.dialog-menu").stretch(true);$("#frame-simple > div.dialog-content").last().stretch(true)}}FeedReader.show=function(B,D){if($("#widget-preview").css("display")=="block"){return }var A=document.getElementById("feed-reader");if(!A.init){$(A).extend(new FeedReader())}A.init(B,D);A.style.position="";var C=$("#dashboard").get().getCurrentPage();$(C).css("display","none");A.style.display="block";C.parentNode.appendChild(A);A.resize();if(!window.onresize){window.onresize=function(){window.setTimeout(function(){A.resize()},200)}}return false};FeedReader.hide=function(){var A=document.getElementById("feed-reader");A.style.display="none";if(A.sidebarState==true){UDW.Sidebar.show()}var B=$("#dashboard").get().getCurrentPage();$(B).css("display","")};Event.addOnLoad(function(){$("#feed-reader li.outlook-view,#feed-reader li.simple-view").each(function(A){if(/^outlook/.test(A.className)){A.onclick=function(){if(!/view-on$/.test(this.className)){$("#feed-reader").get().showOutlook(this)}return false}}else{if(/^simple/.test(A.className)){A.onclick=function(){if(!/view-on$/.test(this.className)){$("#feed-reader").get().showSimple(this)}return false}}}A=null})});UDW.Member={showSignUp:function(){var A=document.getElementById("signup-user");$("form input[type=text]",A).each(function(B){B.value=""});$("form",A).prev("div").css("display","none").empty();LightBox.show(A,{top:"5%",left:"27%"});return false},showSignIn:function(){UDW.Sidebar.show();var A=new Fader($("div.user-login").get());A.fadeOut();return false},showForgotPassword:function(B){var A='<form method="post" action="" style="margin: 16px 8px;"><label for="forgot-pass-email">Enter your email:</label><p><input class="field" type="text" name="forgot-pass-email" />&nbsp;<input type="button" name="forgotPassword" value="Send" /></p></form>';UDW.Components.Balloon.show(B,$(B).html(),A);return false},signUp:function(e,o){e=Event.get(e);Event.cancel(e);var form=o.form;var msg={show:function(message){$(form).prev("div").html(message).css("display","block")},hide:function(){$(form).prev("div").empty().css("display","none")}};var email=form.email.value.trim();var cemail=form["confirm-email"].value.trim();var pass=form.password.value.trim();var cpass=form["confirm-password"].value.trim();if(!email||!cemail||!pass||!cpass){msg.show(UDW.str("All fields are mandatory"));return }if(email!==cemail){msg.show(UDW.str("Emails do not match"));return }if(pass!==cpass){msg.show(UDW.str("Passwords do not match"));return }var pattern=/^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;if(!pattern.test(email)){msg.show(UDW.str("Specified email is invalid"));return }msg.hide();var http=new XmlHttpRequest();http.oncomplete=function(http){try{var result=eval("("+http.getText()+")");if(result.error){msg.show(result.error)}else{if(result.success){msg.show(result.success);$(form).css("display","none")}}}catch(e){msg.show("Error processing request")}};http.doPost(form.action,form)},signIn:function(e,o){e=Event.get(e);Event.cancel(e);var form=o.form;var msg={show:function(message){$(form).prev("p").html(message).css("display","block")},hide:function(){$(form).prev("p").empty().css("display","none")}};var user=form.user.value.trim();var pass=form.password.value.trim();if(!user||!pass){return }var oldValue=o.value;o.disabled=true;o.value="Loading...";var http=new XmlHttpRequest();http.oncomplete=function(http){try{var result=eval("("+http.getText()+")");if(result.error){msg.show(result.error)}else{if(result.success){document.location.reload()}}}catch(e){msg.show(UDW.str("Error processing request"))}o.value=oldValue;o.disabled=false};http.doPost(form.action,form)}};UDW.MyFeed={showAddForm:function(A){UDW.Sidebar.showPopup(A,"add-feed-popup");return false},closeAddForm:function(A){A.parentNode.style.display="none";this.message.hide()},add:function(B){this.message.show(UDW.str("Verifying feed..."));$("#detected-feeds").css("display","none");var A=this;UDW.proxy.findFeeds({uri:B.form.url.value,callback:function(C){if(C.feeds){var F,E=$("#detected-feeds").get();$("div",E).remove();for(var D=0;D<C.feeds.length;D++){F=document.createElement("div");$(F).append('<p class="detected-feed-title">'+C.feeds[D].title+"</p>");$(F).append("<p>"+C.feeds[D].url+"</p>");F.feed=C.feeds[D];F.onclick=function(){A.fetch(this.feed)};E.appendChild(F)}E.style.display="block";A.message.hide()}else{if(C.feed){A.append({uri:B.form.url.value,title:C.feed.title});A.message.hide();$("#my-feeds").fadeOut()}else{if(C.error){A.message.show(C.error.message,"msg-red")}}}}})},fetch:function(B){this.message.show(UDW.str("Fetching feed..."));var A=UDW.MyFeed;UDW.proxy.getFeed({uri:B.url,callback:function(C){if(C&&C.feed){A.append({uri:B.url,title:C.feed.title});A.message.hide();UDW.Dashboard.save()}else{if(C.error){A.message.show(C.error.message,"msg-red")}}}})},append:function(C){var A=[];A.push("<li>");A.push('<a class="feed-url" rel="feed" href="'+decodeURIComponent(C.uri)+'"><em>'+decodeURIComponent(C.title)+'</em><span><img src="udw/assets/styles/img/pixel.gif" alt="Modify Feed Item!" width="12" height="12" border="0"/></span></a>');A.push("</li>");var B=$("#my-feeds").append(A.join("")).get();this.initItem(B);$("#no-feeds").css("display","none");$("#add-feed-popup").css("display","none");$("div.expand-list").get().openMyFeeds()},message:{show:function(B,A){A=A||"msg-green";var C=document.getElementById("add-my-feed-message");C.style.display="block";C.innerHTML=B;$(C).setClass(A)},hide:function(){document.getElementById("add-my-feed-message").style.display="none"}},initItem:function(A){$("span",A).on("click",function(D){Event.cancel(D);var C=$(this).parent("a").getDim();var B=$("#feed-item-popup").get();if(!B.onclick){B.onclick=function(H){Event.cancel(H);var G;if((G=Event.targetIs(H,"a"))){var F=G.rel;if(F=="rename"){var E=UDW.Util.getEditableInput();E.value=$("em",this.current).html();$("em",this.current).html(E);E.focus();E.select();E=this.current=null;this.style.display="none"}else{if(F=="delete"){if(confirm(UDW.str("Are you sure you want to delete selected feed?"))){$(this.current.parentNode).remove();this.current=null;UDW.Dashboard.save();this.style.display="none"}}}}}}$(B).css({top:(C.top+C.height-6)+"px",left:(C.left+C.width-88)+"px",display:"block"}).attr("current",this.parentNode,true);return false})}};UDW.Preferences={types:{form:null,append:function(B){var C=document.createElement("div");for(var A=0;A<B.length;A++){if(B[A].type=="hidden"){C=B[A]}else{C.appendChild(B[A])}this.form.appendChild(C)}},input:function(C){var D;if(C.label){D=document.createElement("label");D.innerHTML=C.label+":&nbsp;"}var B;if($.browser.isIe&&!$.browser.isOpera){B=document.createElement('<input name="'+C.name+'">')}else{B=document.createElement("input")}B.type=C.type;if(B.type=="checkbox"){if(C.checked==true){B.checked=true;C.value=1}else{C.value=0}}B.name=C.name;B.value=C.value;if(C.events){for(var A in C.events){$(B).on(A,C.events[A])}}if(D){this.append([D,B])}else{this.append([B])}},text:function(A){this.input(A)},checkbox:function(A){this.input(A)},hidden:function(A){this.input(A)},textarea:function(B){var C=document.createElement("label");C.innerHTML=B.label+":&nbsp;";var A=document.createElement("textarea");A.name=B.name;A.value=B.value;this.append([C,A])},range:function(A){var D,C;if($.browser.isIe&&!$.browser.isOpera){C=document.createElement('<select name="'+A.name+'"></select>')}else{C=document.createElement("select")}C.name=A.name;if(!A.step){A.step=1}for(var B=A.start;B<=A.end;B+=A.step){D=document.createElement("option");D.setAttribute("value",B);D.innerHTML=B;if(A.value&&A.value==""+B){D.selected=true}C.appendChild(D)}this.append([this.getLabel(A.label),C])},list:function(E){var A=function(Q,O,M){var L,N,P;for(var K in O){N=K}P=O[K];var L=document.createElement("option");L.setAttribute("value",N);L.innerHTML=P;L.selected=M==N;Q.appendChild(L)};var J,I,F,D,H,G;if($.browser.isIe&&!$.browser.isOpera){J=document.createElement('<select name="'+E.name+'"></select>')}else{J=document.createElement("select")}J.name=E.name;if(E.onchange){J.onchange=E.onchange}J.onclick=function(K){Event.cancel(Event.get(K))};F=E.list;for(var C in F){if(F[C].constructor==String){D={};D[F[C]]=F[C]}else{D=F[C]}if(!D.group&&!D.options){A(J,D,E.value||null)}else{I=document.createElement("optgroup");I.label=D.group;for(var B in D.options){A(I,D.options[B],E.value||null)}J.appendChild(I);I=null}}this.append([this.getLabel(E.label),J]);J=null},password:function(A){},getLabel:function(B){var A=document.createElement("label");A.innerHTML=B+":&nbsp;";return A}},build:function(A,G){var F=function(H){this.getWidget=function(){return document.getElementById(H)}};var E=[];if($.browser.isIe&&!$.browser.isOpera){E.push(document.createElement('<form name="frm-'+G+'" enctype="multipart/form-data" action="" method="post"></form>'));document.body.appendChild(E[0])}else{E.push(document.createElement("form"));E[0].method="post";E[0].action=""}this.types.form=E[0];$(E[0]).extend(new F(G));E[0].onsubmit=function(){return this.saveWidgetState.onclick()};for(var B=0;B<A.length;B++){if(this.types[A[B]["type"]]){this.types[A[B]["type"]](A[B])}}var D=document.createElement("input");D.type="button";D.value=UDW.str("Save");D.name="saveWidgetState";D.className="save-prefs";D.onclick=function(I){var H=this.form.getWidget();if(H.onPreferencesSave){H.onPreferencesSave.call(H,I)}else{H.setPreloader();H.onload();H.save()}H=null};var C=document.createElement("input");C.type="button";C.value=UDW.str("Cancel");C.name="cancel";C.className="cancel-prefs";C.onclick=function(){var H=this.form.parentNode.parentNode.parentNode;H.hidePreferences();H=null};this.types.append([D,document.createTextNode(" "),C]);C=D=this.types.form=null;return E.pop()},serialize:function(D){var B=[];for(var C=0;C<D.elements.length;C++){if(D.elements[C].type=="button"){continue}var A={};A.name=encodeURIComponent(D.elements[C].name);A.value=encodeURIComponent(D.elements[C].value);if(D.elements[C].type=="checkbox"){A.checked=(D.elements[C].checked==true?true:false)}B.push(A)}return B}};UDW.Env={Widget:function(){this.isMoving=false;this.disableRefresh=false;this.disableHeader=false;this.disableDrag=false;this.save=function(){UDW.Dashboard.save()};this.ondrop=function(){this.save()};this.onclick=function(){if(this.isMoving&&Mouse){Mouse.up(this)}};this.move=function(C){var D=this.parentNode;if(C=="top"){D.addWidgetAt(0,this)}else{if(C=="up"){D.addWidgetAt(this.opts.index-1,this)}else{if(C=="down"){D.insertBefore($(this).next("div").get(),this);D.resetWidgetOrder()}else{if(C=="bottom"){D.appendChild(this);D.resetWidgetOrder()}else{if(C=="left"||C=="right"){var B=D.getIndex()+(C=="left"?-1:1);var A=$("div.column",D.parentNode).get(B);var E=D;A.addWidgetAt(0,this)}}}}}this.save();return false};this.setup=function(){this.addOption("cssText",this.style.cssText);this.addOption("className",this.className);this.addOption("dropTarget",this.parentNode);this.addOption("width",this.offsetWidth);this.addOption("height",this.offsetHeight);this.addOption("xy",$(this).getDim(true));this.setStyle(this.getStyle()||"white")};this.clone=function(){var A=this.serialize();A.id="";return UDW.Widget.createFromJson(A)};this.serialize=function(){var A={};A.id=this.id;A.name=this.getName();A.index=this.opts.index;A.title=this.getValue("title");A.style=this.getStyle();A.expanded=(this.opts.expand.className=="widget-collapse"?true:false);if(this.opts.prefs){A.preferences=UDW.Preferences.serialize(this.opts.prefs.firstChild)}A.data=this.data;return A};this.init=function(A){var B=this;this.id="wdg-"+(new Date()).getTime();this.addOption("id",this.id);this.addOption("title",$("div.widget-title",this).get());this.addOption("content",$("div.widget-content",this).get());this.addOption("footer",$("div.widget-footer",this).get());this.addOption("prefs",$("div.widget-preferences",this).get());this.addOption("style",A.style!=undefined?A.style:"white");if(A.data!=undefined){this.data=A.data}if(A){if(A.id){this.setId(A.id)}this.setTitle(A.title);if(A.content){this.setContent(A.content)}this.setName(A.name);this.addOption("expanded",A.expanded)}$("div.widget-header",this).extend({onmousedown:function(C){if(B.disableDrag==true){return }Drag.start(C,B,true,{shiftUp:0,onBeforeDrag:function(E,D){D.setup();Mouse.onBeforeDrag(D);D=null},onmove:Mouse.move,ondrop:Mouse.up});return false},onmouseover:function(C){if(this.isMoving){return }if(B.disableHeader==true){return }if(!this.className.match(new RegExp("widget-header-over"))){this.className+=" widget-header-over"}},onmouseout:function(C){if(this.isMoving){return }if(B.disableHeader==true){return }this.className=this.className.replace(new RegExp(" widget-header-over","g"),"")},ondblclick:function(C){Event.cancel(C);B.opts.expand.onclick()}});$("div.widget-header > div",this).each(function(D){var C=D.className;if(C=="widget-collapse"){B.addOption("expand",D);D.onclick=function(){this.className=="widget-expand"?B.expand():B.collapse();return false}}else{if(C=="widget-icon"){B.addOption("icon",D)}else{if(C=="widget-refresh"){B.addOption("refresh",D);D.onclick=function(){B.setPreloader();B.onload();return false}}else{if(C=="widget-close"){D.onclick=function(){var E=B.parentNode;if(confirm("Are u sure you want to close widget?")){E.removeChild(B)}if(document.onclick){document.onclick()}B.save();return false}}else{if(C=="widget-edit"){D.onclick=function(F){var E=$(B.opts.prefs).css("display");E=="block"?B.hidePreferences():B.showPreferences();return false}}else{if(C=="widget-options"){D.onclick=function(E){Event.cancel(Event.get(E));UDW.Widget.menu.get(B).show(this);return false}}}}}}}})}}};(function(){function A(){this.base=UDW.Env.Widget;this.base();this.data=null;this.events={};this.cache={data:{},put:function(B,C){this.data[B]=C},get:function(B){if(this.data[B]){return this.data[B]}return null},remove:function(B){if(this.data[B]){this.data[B]=null}},empty:function(){this.data={}}};this.bind=function(B,C){if(!this.events[B]){this.events[B]=[]}this.events[B].push(C)};this.trigger=function(C){if(this.events[C]){var D=null;for(var B=0;B<this.events[C].length;B++){D=this.events[C][B];if(D.constructor==Array){D[1].call(D[0],this)}else{D(this)}}}};this.onPreferencesSave=null;this.opts={};this.addOption=function(B,C){this.opts[B]=C};this.setIcon=function(B){this.opts.icon.style.background="url("+B+") no-repeat left center"};this.setName=function(B){this.opts.name=B};this.getName=function(){return this.opts.name};this.setId=function(B){this.id=this.opts.id=B};this.getId=function(){return this.opts.id};this.setTitle=function(B){this.opts.title.innerHTML=B};this.getTitle=function(){return this.opts.title.innerHTML};this.setContent=function(B){$(this.opts.content).html(B)};this.addContent=function(B){$(this.opts.content).append(B)};this.getContent=function(){return this.opts.content.innerHTML};this.setData=function(B){this.data=B};this.getData=function(){return this.data};this.getBody=function(){return this.opts.content};this.setStyle=function(B){this.opts.style=B;this.className="widget widget-"+B;$("div.widget-frame",this).setClass("widget-frame widget-frame-"+B);$("div.widget-header-wrapper",this).setClass("widget-header-wrapper widget-header-wrapper-"+B);$("div.widget-header",this).setClass("widget-header widget-header-"+B)};this.getStyle=function(){return this.opts.style};this.setValue=function(B,D){var C=$("form",this.opts.prefs).last().get();if(C.elements[B]){C.elements[B].value=decodeURIComponent(D)}};this.getValue=function(B){var D,C=$("form",this.opts.prefs).last().get();if((D=C[B])){var D=C[B];return D.type!="checkbox"?D.value:D.checked}};this.setValues=function(B){if(!this.opts.prefs){return }var D=this.opts.prefs.firstChild;for(var C=0;C<B.length;C++){if(D[B[C].name]){D[B[C].name].value=decodeURIComponent(B[C].value);if(B[C].checked){D[B[C].name].checked=B[C].checked}}}};this.getPreloader=function(B){return'<div class="preloader"><div><img src="udw/assets/styles/img/preloader.gif" alt="" /></div><span>'+(UDW.str(B)||(UDW.str("Loading Widget")+"..."))+"</span></div>"};this.setPreloader=function(){this.setContent(this.getPreloader())};this.addToFooter=function(B){$("div.widget-footer",this).append(B)};this.setToFooter=function(B){$("div.widget-footer",this).html(B)};this.collapse=function(){$("div.widget-content-wrapper,div.widget-footer",this).css("display","none");$(this.opts.expand).setClass("widget-expand")};this.expand=function(){$("div.widget-content-wrapper,div.widget-footer",this).css("display","block");$(this.opts.expand).setClass("widget-collapse")};this.showPreferences=function(){$(this.opts.prefs).css("display","block")};this.hidePreferences=function(){$(this.opts.prefs).css("display","none")}}A.prototype.setPreferences=function(){if(this.preferences){this.opts.prefs.appendChild(UDW.Preferences.build(this.preferences,this.id))}};A.prototype.configure=function(){if(this.config){this.setTitle(this.config.title);this.setName(this.config.name);if(this.config.icon){this.setIcon("udw/widgets/"+(this.config.name)+"/"+this.config.icon)}else{if(this.config.iconId!=undefined){$(this.opts.icon).addClass("wdg-icon-"+this.config.iconId)}}}};UDW.registerWidget("__base__",A)})();(function(){function A(){this.preferences=[{name:"title",type:"text",label:UDW.str("Title"),value:UDW.str("Loading feed...")},{name:"url",type:"text",label:UDW.str("URL"),value:"http://localhost/"},{name:"number-of-items",type:"text",label:UDW.str("Item #"),value:5},{name:"moredetails",type:"checkbox",label:UDW.str("More details"),value:"1",checked:false},{name:"feedstatus",type:"hidden",value:"{}"}];var B=0;this.processFeedRow=function(F,H,C){var G=[],E=H?"even":"";if(this.isRead(F.id,C)){E+=" read"}G.push('<li class="'+E+'">');G.push('<h3><a href="'+F.link+'" onclick="return false" rel="'+F.id+'">');G.push(F.title);G.push("</a></h3>");G.push("<p>");if(F.media&&F.media.thumbnail&&F.media.thumbnail.url){var D=F.media.thumbnail;G.push('<a href="'+(F.media.content.url||F.link+'" target="_blank')+'" class="video-thumbnail">');G.push('<img src="'+D.url+'" alt="" width="92" height="77" border="0"/>');G.push("</a>")}G.push(F.summary.substr(0,250));G.push('<div class="clear"></div>');G.push("</p>");if(/mp3$/.test(F.link)){G.push('<ul class="podcast"><li class="listen-podcast">');G.push('<a href="'+F.link+'" target="_blank">');G.push('<img src="udw/assets/styles/img/pixel.gif" height="16" width="16" border="0" alt=""/>');G.push('</a></li><li class="download-podcast">');G.push('<a href="'+F.link+'" target="_blank">');G.push('<img src="udw/assets/styles/img/pixel.gif" height="16" width="16" border="0" alt=""/>');G.push("</a></li></ul>")}G.push("</li>");return G.join("")};this.isRead=function(C){return(this.getData()||[]).indexOf(C)!=-1};this.markAsRead=function(C){var D=this.getData()||[];if(D.indexOf(C.rel)==-1){$(C).parent("li").addClass("read");if(B>0){B--}this.setTitle('<span class="unread">('+B+")&nbsp;</span>"+this.getValue("title"));D.unshift(C.rel);this.setData(D.slice(0,20));this.save()}};this.processResult=function(C,D){if(C.feed){var I=this.feed=C.feed;if(UDW.str("Loading feed...")==this.getTitle()){this.setValue("title",I.title);this.setTitle(I.title)}this.setContent("");var H=this.getValue("moredetails")==true?"feed-list detailed":"feed-list";var G=$('<ul class="'+H+'"></ul>').get();$(this.getBody()).append(G);var F=this;G.onclick=function(L){Event.cancel(L);var J;if((J=Event.targetIs(L,"a"))){F.markAsRead(J);FeedReader.show(J,F.feed)}else{if((J=Event.targetIs(L,"img"))){if(J.parentNode.className=="video-thumbnail"&&!J.parentNode.target){var K=$(J).parent("li").find("h3 > a").get().href;$("div.flashplayer",F.getBody()).html(F.getPlayer(J.parentNode.href,K,""))}}}};B=0;for(var E=0;E<I.entries.length;E++){if(!F.isRead(I.entries[E]["id"])){B++}}F.setTitle('<span class="unread">('+B+")&nbsp;</span>"+F.getValue("title"));D.process(I);G=null}else{if(C.error){this.setContent(C.error.message)}else{this.setContent(UDW.str("Unable to process request"))}}};this.getPlayer=function(D,C){return'<div><object width="320" height="240" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"><param value="sameDomain" name="allowScriptAccess"/><param value="'+D+'" name="movie"/><param value="high" name="quality"/><param value="opaque" name="wmode"/><param value="#ffffff" name="bgcolor"/><param name="allowfullscreen" value="true"/><param value="" name="flashVars"/><embed width="320" height="240" allowfullscreen="true" flashvars="" pluginspage="http://www.macromedia.com/go/getflashplayer"type="application/x-shockwave-flash" allowscriptaccess="sameDomain" bgcolor="#ffffff" quality="high" src="'+D+'" wmode="opaque" style="width: 320px; height: 240px;"/></object></div><p><a href="'+C+'" rel="external" target="_blank">'+UDW.str("See Original")+'</a> |<a href="#" onclick="$(this).parent(\'div\').empty()">'+UDW.str("Hide")+"</a></p>"}}UDW.registerWidget("__feedwidget__",A)})();(function(){function A(){this.base=UDW.widgets.__feedwidget__;this.base();this.uris={};this.engines={};this.preferences=[{name:"defaultQuery",type:"hidden",value:"google"},{name:"title",type:"text",label:UDW.str("Title"),value:""},{name:"number-of-items",type:"text",label:UDW.str("Item #"),value:3}];this.addEngine=function(E,D){this.engines[E]=D};this.render=function(){var J=document.createElement("div");$(J).html('<form method="post" action="" class="news-search-form">	<input class="search" type="text" name="q" value="'+this.getValue("defaultQuery")+'"/>	<input type="button" name="search" value="'+UDW.str("Search")+'"/></form><div class="flashplayer"></div>');var H,E,I=this,F=new UDW.Components.Tab();var G=function(K){E=K.index;I.search(E)};for(var D in this.engines){H=this.engines[D];H.callback=G;H.content='<div class="news-search-result-'+D+'">'+UDW.str(H.label)+": "+(H.content||UDW.str("No search entry yet"))+"</div>";H.className=H.className||D+"-tab";this.uris[D]=H.uri;if(!E){E=D}F.addTab(D,H)}F.appendTo(J);this.setContent(J);$("form > input[name=search]",this.getBody()).on("click",function(){I.search(E);I.save()});this.search(E)};var B={},C=null;this.search=function(H){var M,G,I=H+"-"+this.id,E=this;var D=$("form > input[name=q]",this.getBody()).get().value;if(D==C){M=B[H]?$("#"+B[H]).get():null;G=$("div.news-search-result-"+H+" ul.search-list",this.getBody()).length()>0}else{C=D;M=null;$("div.widget-footer",this).empty();for(var L in this.uris){if(L!=H){$("div.news-search-result-"+L,this.getBody()).empty()}}}if(!M){function K(O,Q){var P=[];P.push("<li>");P.push("<p>");if(O.media&&O.media.thumbnail){var N=O.media.thumbnail;P.push('<a href="'+(O.media.content.url||O.link+'" target="_blank')+'" class="video-thumbnail">');P.push('<img src="'+N.url+'" alt="" width="92" height="77" border="0"/>');P.push("</a>")}P.push('<a href="'+O.link+'" target="_blank">');P.push(O.title);P.push("</a><br />");P.push(O.summary.substr(0,250));P.push("</p>");P.push('<div class="clear"></div></li>');return P.join("")}M=UDW.Components.Pagination.getComponent({currentPage:1,rowsPerPage:parseInt(this.getValue("number-of-items")),rowName:"entries",callback:function(P){var O=[],Q;for(var N=0;N<P.length;N++){O.push(K(P[N],N%2))}if(O.length){$("div.news-search-result-"+H+" > ul",E.getBody()).first().html(O.join("")).find("a.video-thumbnail").on("click",function(){if(!this.target){$("div.flashplayer",E.getBody()).html(E.getPlayer(this.href,"",""));return false}})}else{$("div.news-search-result-"+H,E).html(H+": nothing found")}}});M.id=I;B[H]=I;this.addToFooter(M)}else{var F=parseInt(this.getValue("number-of-items"));if(F!=M.getValue("rowsPerPage")){M.reset();M.setValue("currentPage",1);M.setValue("rowsPerPage",F);M.process(this.cache.get(H))}}M=null;$("div.feedpagination",this).each(function(N){N.id!=I?$(N).css("display","none"):$(N).css("display","block")});this.setValue("defaultQuery",D);if(!G){var J=this.uris;$("div.news-search-result-"+H,this.getBody()).html(this.getPreloader());UDW.proxy.getFeed({uri:J[H].replace("{query}",encodeURIComponent(D)),callback:function(N){if(N.feed){E.cache.put(H,N.feed);var P=N.feed;var O=$('<ul class="search-list"></ul>').get();O.feed=P;$("div.news-search-result-"+H,E.getBody()).html(O);$("#"+B[H]).get().process(P,H)}else{if(N.error){$("div.news-search-result-"+H,E.getBody()).html(N.error.message)}else{$("div.news-search-result-"+H,E.getBody()).html(UDW.str("Unable to process request"))}}}})}};this.onPreferencesSave=function(){this.search($("div.cmp-tab",this.getBody()).get().getActiveTab().index);this.save()}}UDW.registerWidget("__searchwidget__",A)})();(function(){function A(){this.base=UDW.widgets.__feedwidget__;this.base();this.disableRefresh=true;this.preferences=[{name:"number-of-items",type:"text",label:UDW.str("Item #"),value:5},{name:"moredetails",type:"checkbox",label:UDW.str("More details"),value:"1",checked:false}];this.logo={};this.tags=null;this.feedURI=null;this.feedURIs={};this.initialTags={};this.tagMap={};this.bgColor=null;this.setBgColor=function(E){this.bgColor=E};this.setLogo=function(E,G,F){this.logo.widgetName=E;this.logo.fileName=G;this.logo.alt=F};this.setTagMap=function(E){this.tagMap=E};this.getTagMapKeys=function(){var F={};for(var E in this.tagMap){F[this.tagMap[E]]=E}return F};this.setInitialTags=function(E){this.initialTags=E};this.setFeedURI=function(E){this.feedURI=E};this.addFeedURI=function(E,F){this.feedURIs[E]=F},this.getFeedURI=function(E){if(E&&this.feedURIs[E]){return this.feedURIs[E]}return this.feedURI};this.isRead=function(G,E){var F=this.getDataItem("read")||{};if(E&&F[E]){return F[E].indexOf(G)!=-1}return false};this.markAsRead=function(F,E){var G=this.getDataItem("read")||{};if(!G[E]){G[E]=[]}if(G[E].indexOf(F.rel)==-1){$(F).parent("li").addClass("read");if(B>0){B--}this.setTitle('<span class="unread">('+B+")&nbsp;</span>"+this.feed.title);G[E].unshift(F.rel);G[E]=G[E].slice(0,20);this.putDataItem("read",G);this.save()}};var B=0;var D=function(E){return E.replace(/[^\w\d-_]/g,"")};var C=function(E){return"news-"+D(E)};this.getUnreadCount=function(F,E){var G=this.getDataItem("read")||{};if(F&&G[F]){return E-G[F].length}};this.getDataItem=function(E){return(this.getData()||{})[E]||null};this.putDataItem=function(E,F){var G=this.getData()||{};G[E]=F;this.setData(G)};this.process=function(L,M,K,E){if(M.feed){var J=this.feed=M.feed;this.cache.put(L,J);this.setTitle(J.title);this.setContent("");var I=this.getValue("moredetails")==true?"feed-list detailed":"feed-list";var H=$('<ul class="'+I+'"></ul>').get();var F=this;H.onclick=function(P){Event.cancel(P);var N;if((N=Event.targetIs(P,"a"))){F.markAsRead(N,L);FeedReader.show(N,J)}else{if((N=Event.targetIs(P,"img"))){if(N.parentNode.className=="video-thumbnail"){var O=$(N).parent("li").find("h3 > a").get().href;$("div.flashplayer",F.getBody()).html(F.getPlayer(N.parentNode.href,O,""))}}}};B=0;for(var G=0;G<J.entries.length;G++){if(!this.isRead(J.entries[G]["id"],L)){B++}}this.setTitle('<span class="unread">('+B+")&nbsp;</span>"+J.title);$(E).html(H);K.process(J);H=null}else{if(M.error){$(E).html(M.error.message)}else{$(E).html(UDW.str("Unable to process request"))}}};this.render=function(){this.cache.empty();$(this.getBody()).html('<div class="flashplayer"></div>');$(this.getBody()).append('<div class="news-widget-container" style="'+(this.bgColor?"background-color:"+this.bgColor:"")+'"><div class="news-widget-logo"><img src="udw/widgets/'+this.logo.widgetName+"/"+this.logo.fileName+'" alt="'+this.logo.alt+'" vspace="6"/></div></div>');$("div.widget-footer",this).empty();this.tags=this.getDataItem("tags")||this.initialTags;var M,F=this;var E,G={},J=null,I=false;var K=function(P){if(!P.tag){P.tag=F.tagMap[F.tags[P.index]]}var V=P.getPage(),X=P.tag,T=X.replace(/[^\w]/g,"")+"-"+F.id,O=parseInt(F.getValue("number-of-items"))||5,N=F.cache.get(X),W=C(X),R=false;if(!$("div."+W,V).get()){$("div",V).setClass(W).empty()}R=($("div > ul.feed-list > li",V).get()!=null)&&N;M=G[X]?$("#"+G[X]).get():null;if(!M){M=UDW.Components.Pagination.getComponent({currentPage:1,rowsPerPage:O,rowName:"entries",callback:function(a){var Z=[];for(var Y=0;Y<a.length;Y++){Z.push(F.processFeedRow(a[Y],Y%2,X.replace(/[^\w]/g,"")))}$("div."+C(X)+" > ul",F.getBody()).html(Z.join(""))}});G[X]=T;M.id=T;F.addToFooter(M)}else{if(P.reset||!R){var U=F.getValue("moredetails")==true?"feed-list detailed":"feed-list";$("div."+W,V).html('<ul class="'+U+'"></ul>').find("ul").on("click",function(a){Event.cancel(a);var Y;if((Y=Event.targetIs(a,"a"))){F.markAsRead(Y,X);FeedReader.show(Y,N)}else{if((Y=Event.targetIs(a,"img"))){if(Y.parentNode.className=="video-thumbnail"){var Z=$(Y).parent("li").find("h3 > a").get().href;$("div.flashplayer",F.getBody()).html(F.getPlayer(Y.parentNode.href,Z,""))}}}});M.reset();M.setValue("currentPage",1);M.setValue("rowsPerPage",O);M.process(N)}P.reset=false;R=true}M=null;$("div.feedpagination",F).each(function(Y){Y.id!=T?$(Y).css("display","none"):$(Y).css("display","block");Y=null});if(!R){F.setTitle(UDW.str("Loading feed..."));$("div",V).first().html(F.getPreloader());var Q=F.getFeedURI(X);Q=Q.replace("{tag}",X);UDW.proxy.getFeed({uri:Q,callback:function(Y){F.process(X,Y,$("#"+G[X]).get(),$("div."+C(X),V).get())}})}else{if(N){var S=N.entries.length;F.setTitle('<span class="unread">('+(F.getUnreadCount(X,S)||N.entries.length)+")&nbsp;</span>"+N.title)}}P=null};var L=new UDW.Components.Tab();for(var H=0;H<this.tags.length;H++){L.addTab(H,{label:UDW.str(this.tags[H]),content:'<div class="'+C(this.tagMap[this.tags[H]])+'"></div>',callback:K,active:H==0,subItems:{items:F.getTagMapKeys(),callback:function(T,S){var N=[],R=this.innerHTML.replace("&amp;","&"),Q=S.tag||F.tagMap[F.tags[S.index]],U=S.getLabel();S.tag=this.rel;S.setLabel(R);var P=$(">li",S.parentNode).getAll();for(var O=0;O<P.length;O++){if(P[O]!=S&&P[O].getLabel()==R){P[O].setLabel(U);P[O].tag=Q}N.push(P[O].getLabel())}S.onclick(T);F.putDataItem("tags",N);F.save()}}})}L=L.appendTo($("div.news-widget-container",this.getBody()).get());L.getActiveTab().onclick();L=null};this.onPreferencesSave=function(F){var E=$("div.cmp-tab",this.getBody()).get().getActiveTab();if(!E.tag){E.tag=context.tagMap[context.tags[E.index]]}$(">li",E.parentNode).attr("reset",true,true);E.onclick(F);this.save()}}UDW.registerWidget("__tabbedfeed__",A)})();UDW.Widget={get:function(C){var D=document.createElement("div");$("#widget-tmp").append(D);$(D).extend(UDW.getInstanceOf("__base__"));if(C.name&&C.name!="undefined"){var A=UDW.getInstanceOf(C.name,D);$(D).extend(A)}D.className="widget";var B=[];B.push('<div class="widget-header-wrapper">');B.push('<div class="widget-header">');B.push('<div class="widget-icon"></div>');B.push('<div class="widget-collapse"></div>');B.push('<div class="widget-close"></div>');if(D.preferences){B.push('<div class="widget-edit"><a href="#">'+UDW.str("Edit")+"</a></div>")}B.push('<div class="widget-options"></div>');if(!D.disableRefresh){B.push('<div class="widget-refresh"></div>')}B.push('<div class="widget-title"></div>');B.push("</div></div>");if(D.preferences){B.push('<div class="widget-preferences"></div>')}B.push('<div class="widget-content-wrapper"><div class="widget-content"></div></div>');B.push('<div class="widget-footer"></div>');B.push('<div class="clear"></div></div>');var E=$('<div class="widget-frame"></div>').get();E.innerHTML=B.join("");D.appendChild(E);E=null;D.init(C);D.setPreferences();if(C.preferences){D.setValues(C.preferences)}D.configure();D.setPreloader();return D},createFromJson:function(B){var A=B.name;var C=UDW.Widget.get(B);C.setup();if(!C.opts.expanded){C.collapse()}return C},create:function(){this.append(UDW.Widget.get({}))},append:function(B){var A=$("#dashboard").get().getCurrentPage().getColumnAt(0);var C=$(">div.widget",A,"div").get();C?A.insertBefore(B,C):A.appendChild(B);B.setup();Mouse.recalculate();A.resetWidgetOrder()},menu:{base:function(){this.extended=true;this.widget=null;this.show=function(target){var column=this.widget.parentNode,wIndex=this.widget.opts.index;$("a",this).each(function(el){var className=el.className;with(el.parentNode.style){if(/^move-(top|up)$/.test(className)){display=wIndex==0?"none":""}else{if(/^move-(down|bottom)$/.test(className)){display=column.getWidgets().length==wIndex+1?"none":""}else{if(className=="move-left"){display=!$(column).prev("div").get()?"none":""}else{if(className=="move-right"){display=$(column).next("div").attr("class")!="column-resizer"?"none":""}}}}}el=null});var dim=$(target).getDim();$(this).css({top:(dim.top+dim.height)+"px",left:(dim.left-75)+"px",display:"block"})}},init:function(){var A=document.getElementById("widget-menu");$("a",A).each(function(B){if(B.className.match(/^move-/)!=null){B.onclick=function(){return A.widget.move(this.className.match(/-([a-z]+)$/)[1])}}else{if(B.className=="duplicate"){B.onclick=function(){var C=A.widget.clone();A.widget.parentNode.insertBefore(C,A.widget);C.onload();return false}}}B=null});$("span",A).each(function(B){B.onclick=function(){A.widget.setStyle(this.className);return false};B=null});$(A).extend(new UDW.Widget.menu.base())},get:function(A){var B=document.getElementById("widget-menu");if(!B.extended){UDW.Widget.menu.init()}B.widget=A;return B}}};