if(dwr==null){var dwr={}}if(dwr.engine==null){dwr.engine={}}if(DWREngine==null){var DWREngine=dwr.engine}dwr.engine.setErrorHandler=function(a){dwr.engine._errorHandler=a};dwr.engine.setWarningHandler=function(a){dwr.engine._warningHandler=a};dwr.engine.setTextHtmlHandler=function(a){dwr.engine._textHtmlHandler=a};dwr.engine.setTimeout=function(a){dwr.engine._timeout=a};dwr.engine.setPreHook=function(a){dwr.engine._preHook=a};dwr.engine.setPostHook=function(a){dwr.engine._postHook=a};dwr.engine.setHeaders=function(a){dwr.engine._headers=a};dwr.engine.setParameters=function(a){dwr.engine._parameters=a};dwr.engine.XMLHttpRequest=1;dwr.engine.IFrame=2;dwr.engine.ScriptTag=3;dwr.engine.setRpcType=function(a){if(a!=dwr.engine.XMLHttpRequest&&a!=dwr.engine.IFrame&&a!=dwr.engine.ScriptTag){dwr.engine._handleError(null,{name:"dwr.engine.invalidRpcType",message:"RpcType must be one of dwr.engine.XMLHttpRequest or dwr.engine.IFrame or dwr.engine.ScriptTag"});return}dwr.engine._rpcType=a};dwr.engine.setHttpMethod=function(a){if(a!="GET"&&a!="POST"){dwr.engine._handleError(null,{name:"dwr.engine.invalidHttpMethod",message:"Remoting method must be one of GET or POST"});return}dwr.engine._httpMethod=a};dwr.engine.setOrdered=function(a){dwr.engine._ordered=a};dwr.engine.setAsync=function(a){dwr.engine._async=a};dwr.engine.setActiveReverseAjax=function(a){if(a){if(dwr.engine._activeReverseAjax){return}dwr.engine._activeReverseAjax=true;dwr.engine._poll()}else{if(dwr.engine._activeReverseAjax&&dwr.engine._pollReq){dwr.engine._pollReq.abort()}dwr.engine._activeReverseAjax=false}};dwr.engine.defaultErrorHandler=function(b,a){dwr.engine._debug("Error: "+a.name+", "+a.message,true);if(b==null||b==""){alert("A server error has occurred.")}else{if(b.indexOf("0x80040111")!=-1){dwr.engine._debug(b)}else{alert(b)}}};dwr.engine.defaultWarningHandler=function(b,a){dwr.engine._debug(b)};dwr.engine.beginBatch=function(){if(dwr.engine._batch){dwr.engine._handleError(null,{name:"dwr.engine.batchBegun",message:"Batch already begun"});return}dwr.engine._batch=dwr.engine._createBatch()};dwr.engine.endBatch=function(b){var a=dwr.engine._batch;if(a==null){dwr.engine._handleError(null,{name:"dwr.engine.batchNotBegun",message:"No batch in progress"});return}dwr.engine._batch=null;if(a.map.callCount==0){return}if(b){dwr.engine._mergeBatch(a,b)}if(dwr.engine._ordered&&dwr.engine._batchesLength!=0){dwr.engine._batchQueue[dwr.engine._batchQueue.length]=a}else{dwr.engine._sendData(a)}};dwr.engine.setPollMethod=function(a){dwr.engine.setPollType(a)};dwr.engine.setMethod=function(a){dwr.engine.setRpcType(a)};dwr.engine.setVerb=function(a){dwr.engine.setHttpMethod(a)};dwr.engine.setPollType=function(){dwr.engine._debug("Manually setting the Poll Type is not supported")};dwr.engine._scriptSessionId=null;dwr.engine._getScriptSessionId=function(){if(dwr.engine._scriptSessionId==null){dwr.engine._scriptSessionId=dwr.engine._origScriptSessionId+Math.floor(Math.random()*1000)}return dwr.engine._scriptSessionId};dwr.engine._errorHandler=dwr.engine.defaultErrorHandler;dwr.engine._warningHandler=dwr.engine.defaultWarningHandler;dwr.engine._preHook=null;dwr.engine._postHook=null;dwr.engine._batches={};dwr.engine._batchesLength=0;dwr.engine._batchQueue=[];dwr.engine._rpcType=dwr.engine.XMLHttpRequest;dwr.engine._httpMethod="POST";dwr.engine._ordered=false;dwr.engine._async=true;dwr.engine._batch=null;dwr.engine._timeout=0;dwr.engine._DOMDocument=["Msxml2.DOMDocument.6.0","Msxml2.DOMDocument.5.0","Msxml2.DOMDocument.4.0","Msxml2.DOMDocument.3.0","MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XMLDOM"];dwr.engine._XMLHTTP=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];dwr.engine._activeReverseAjax=false;dwr.engine._outstandingIFrames=[];dwr.engine._pollReq=null;dwr.engine._pollCometInterval=200;dwr.engine._pollRetries=0;dwr.engine._maxPollRetries=0;dwr.engine._textHtmlHandler=null;dwr.engine._headers=null;dwr.engine._parameters=null;dwr.engine._postSeperator="\n";dwr.engine._defaultInterceptor=function(a){return a};dwr.engine._urlRewriteHandler=dwr.engine._defaultInterceptor;dwr.engine._contentRewriteHandler=dwr.engine._defaultInterceptor;dwr.engine._replyRewriteHandler=dwr.engine._defaultInterceptor;dwr.engine._nextBatchId=0;dwr.engine._propnames=["rpcType","httpMethod","async","timeout","errorHandler","warningHandler","textHtmlHandler"];dwr.engine._partialResponseNo=0;dwr.engine._partialResponseYes=1;dwr.engine._partialResponseFlush=2;dwr.engine._unloading=false;dwr.engine._execute=function(l,b,j,h){var e=false;if(dwr.engine._batch==null){dwr.engine.beginBatch();e=true}var d=dwr.engine._batch;var g=[];for(var c=0;c<arguments.length-3;c++){g[c]=arguments[c+3]}if(d.path==null){d.path=l}else{if(d.path!=l){dwr.engine._handleError(d,{name:"dwr.engine.multipleServlets",message:"Can't batch requests to multiple DWR Servlets."});return}}var a;var k=g[g.length-1];if(typeof k=="function"||k==null){a={callback:g.pop()}}else{a=g.pop()}dwr.engine._mergeBatch(d,a);d.handlers[d.map.callCount]={exceptionHandler:a.exceptionHandler,callback:a.callback};var f="c"+d.map.callCount+"-";d.map[f+"scriptName"]=b;d.map[f+"methodName"]=j;d.map[f+"id"]=d.map.callCount;for(c=0;c<g.length;c++){dwr.engine._serializeAll(d,[],g[c],f+"param"+c)}d.map.callCount++;if(e){dwr.engine.endBatch()}};dwr.engine._poll=function(){if(!dwr.engine._activeReverseAjax){return}var a=dwr.engine._createBatch();a.map.id=0;a.map.callCount=1;a.isPoll=true;if(dwr.engine._pollWithXhr=="true"){a.rpcType=dwr.engine.XMLHttpRequest;a.map.partialResponse=dwr.engine._partialResponseNo}else{if(navigator.userAgent.indexOf("Gecko/")!=-1){a.rpcType=dwr.engine.XMLHttpRequest;a.map.partialResponse=dwr.engine._partialResponseYes}else{a.rpcType=dwr.engine.XMLHttpRequest;a.map.partialResponse=dwr.engine._partialResponseNo}}a.httpMethod="POST";a.async=true;a.timeout=0;a.path=dwr.engine._defaultPath;a.preHooks=[];a.postHooks=[];a.errorHandler=dwr.engine._pollErrorHandler;a.warningHandler=dwr.engine._pollErrorHandler;a.handlers[0]={callback:function(b){dwr.engine._pollRetries=0;setTimeout(dwr.engine._poll,b)}};dwr.engine._sendData(a);if(a.rpcType==dwr.engine.XMLHttpRequest&&a.map.partialResponse==dwr.engine._partialResponseYes){dwr.engine._checkCometPoll()}};dwr.engine._pollErrorHandler=function(b,a){dwr.engine._pollRetries++;dwr.engine._debug("Reverse Ajax poll failed (pollRetries="+dwr.engine._pollRetries+"): "+a.name+" : "+a.message);if(dwr.engine._pollRetries<dwr.engine._maxPollRetries){setTimeout(dwr.engine._poll,10000)}else{dwr.engine._activeReverseAjax=false;dwr.engine._debug("Giving up.")}};dwr.engine._createBatch=function(){var a={map:{callCount:0,page:window.location.pathname+window.location.search,httpSessionId:dwr.engine._getJSessionId(),scriptSessionId:dwr.engine._getScriptSessionId()},charsProcessed:0,paramCount:0,parameters:{},headers:{},isPoll:false,handlers:{},preHooks:[],postHooks:[],rpcType:dwr.engine._rpcType,httpMethod:dwr.engine._httpMethod,async:dwr.engine._async,timeout:dwr.engine._timeout,errorHandler:dwr.engine._errorHandler,warningHandler:dwr.engine._warningHandler,textHtmlHandler:dwr.engine._textHtmlHandler};if(dwr.engine._preHook){a.preHooks.push(dwr.engine._preHook)}if(dwr.engine._postHook){a.postHooks.push(dwr.engine._postHook)}var c,b;if(dwr.engine._headers){for(c in dwr.engine._headers){b=dwr.engine._headers[c];if(typeof b!="function"){a.headers[c]=b}}}if(dwr.engine._parameters){for(c in dwr.engine._parameters){b=dwr.engine._parameters[c];if(typeof b!="function"){a.parameters[c]=b}}}return a};dwr.engine._mergeBatch=function(a,d){var e,c;for(var b=0;b<dwr.engine._propnames.length;b++){e=dwr.engine._propnames[b];if(d[e]!=null){a[e]=d[e]}}if(d.preHook!=null){a.preHooks.unshift(d.preHook)}if(d.postHook!=null){a.postHooks.push(d.postHook)}if(d.headers){for(e in d.headers){c=d.headers[e];if(typeof c!="function"){a.headers[e]=c}}}if(d.parameters){for(e in d.parameters){c=d.parameters[e];if(typeof c!="function"){a.map["p-"+e]=""+c}}}};dwr.engine._getJSessionId=function(){var c=document.cookie.split(";");for(var b=0;b<c.length;b++){var a=c[b];while(a.charAt(0)==" "){a=a.substring(1,a.length)}if(a.indexOf(dwr.engine._sessionCookieName+"=")==0){return a.substring(dwr.engine._sessionCookieName.length+1,a.length)}}return""};dwr.engine._checkCometPoll=function(){for(var b=0;b<dwr.engine._outstandingIFrames.length;b++){var e="";var c=dwr.engine._outstandingIFrames[b];try{e=dwr.engine._getTextFromCometIFrame(c)}catch(a){dwr.engine._handleWarning(c.batch,a)}if(e!=""){dwr.engine._processCometResponse(e,c.batch)}}if(dwr.engine._pollReq){var d=dwr.engine._pollReq;var e=d.responseText;if(e!=null){dwr.engine._processCometResponse(e,d.batch)}}if(dwr.engine._outstandingIFrames.length>0||dwr.engine._pollReq){setTimeout(dwr.engine._checkCometPoll,dwr.engine._pollCometInterval)}};dwr.engine._getTextFromCometIFrame=function(b){var a=b.contentWindow.document.body;if(a==null){return""}var c=a.innerHTML;if(c.indexOf("<PRE>")==0||c.indexOf("<pre>")==0){c=c.substring(5,c.length-7)}return c};dwr.engine._processCometResponse=function(d,e){if(e.charsProcessed==d.length){return}if(d.length==0){e.charsProcessed=0;return}var b=d.indexOf("//#DWR-START#",e.charsProcessed);if(b==-1){e.charsProcessed=d.length;return}var a=d.lastIndexOf("//#DWR-END#");if(a==-1){return}if(d.charCodeAt(a+11)==13&&d.charCodeAt(a+12)==10){e.charsProcessed=a+13}else{e.charsProcessed=a+11}var c=d.substring(b+13,a);dwr.engine._receivedBatch=e;dwr.engine._eval(c);dwr.engine._receivedBatch=null};dwr.engine._sendData=function(e){e.map.batchId=dwr.engine._nextBatchId;dwr.engine._nextBatchId++;dwr.engine._batches[e.map.batchId]=e;dwr.engine._batchesLength++;e.completed=false;for(var d=0;d<e.preHooks.length;d++){e.preHooks[d]()}e.preHooks=null;if(e.timeout&&e.timeout!=0){e.timeoutId=setTimeout(function(){dwr.engine._abortRequest(e)},e.timeout)}if(e.rpcType==dwr.engine.XMLHttpRequest){if(window.XMLHttpRequest){e.req=new XMLHttpRequest()}else{if(window.ActiveXObject&&!(navigator.userAgent.indexOf("Mac")>=0&&navigator.userAgent.indexOf("MSIE")>=0)){e.req=dwr.engine._newActiveXObject(dwr.engine._XMLHTTP)}}}var a,c;if(e.req){if(e.async){e.req.onreadystatechange=function(){if(typeof dwr!="undefined"){dwr.engine._stateChange(e)}}}if(e.isPoll){dwr.engine._pollReq=e.req;if(!(document.all&&!window.opera)){e.req.batch=e}}var b=navigator.userAgent.indexOf("Safari/");if(b>=0){var g=navigator.userAgent.substring(b+7);if(parseInt(g,10)<400){if(dwr.engine._allowGetForSafariButMakeForgeryEasier=="true"){e.httpMethod="GET"}else{dwr.engine._handleWarning(e,{name:"dwr.engine.oldSafari",message:"Safari GET support disabled. See getahead.org/dwr/server/servlet and allowGetForSafariButMakeForgeryEasier."})}}}e.mode=e.isPoll?dwr.engine._ModePlainPoll:dwr.engine._ModePlainCall;c=dwr.engine._constructRequest(e);try{e.req.open(e.httpMethod,c.url,e.async);try{for(a in e.headers){var j=e.headers[a];if(typeof j=="string"){e.req.setRequestHeader(a,j)}}if(!e.headers["Content-Type"]){e.req.setRequestHeader("Content-Type","text/plain")}}catch(h){dwr.engine._handleWarning(e,h)}e.req.send(c.body);if(!e.async){dwr.engine._stateChange(e)}}catch(h){dwr.engine._handleError(e,h)}}else{if(e.rpcType!=dwr.engine.ScriptTag){var f=e.isPoll?"dwr-if-poll-"+e.map.batchId:"dwr-if-"+e.map.batchId;e.div=document.createElement("div");document.body.appendChild(e.div);e.div.innerHTML="<iframe src='javascript:void(0)' frameborder='0' style='width:0px;height:0px;border:0;' id='"+f+"' name='"+f+"' onload='dwr.engine._iframeLoadingComplete ("+e.map.batchId+");'></iframe>";e.document=document;e.iframe=e.document.getElementById(f);e.iframe.batch=e;e.mode=e.isPoll?dwr.engine._ModeHtmlPoll:dwr.engine._ModeHtmlCall;if(e.isPoll){dwr.engine._outstandingIFrames.push(e.iframe)}c=dwr.engine._constructRequest(e);if(e.httpMethod=="GET"){e.iframe.setAttribute("src",c.url)}else{e.form=e.document.createElement("form");e.form.setAttribute("id","dwr-form");e.form.setAttribute("action",c.url);e.form.setAttribute("style","display:none;");e.form.setAttribute("target",f);e.form.target=f;e.form.setAttribute("method",e.httpMethod);for(a in e.map){var j=e.map[a];if(typeof j!="function"){var k=e.document.createElement("input");k.setAttribute("type","hidden");k.setAttribute("name",a);k.setAttribute("value",j);e.form.appendChild(k)}}e.document.body.appendChild(e.form);e.form.submit()}}else{e.httpMethod="GET";e.mode=e.isPoll?dwr.engine._ModePlainPoll:dwr.engine._ModePlainCall;c=dwr.engine._constructRequest(e);e.script=document.createElement("script");e.script.id="dwr-st-"+e.map["c0-id"];e.script.src=c.url;document.body.appendChild(e.script)}}};dwr.engine._ModePlainCall="/call/plaincall/";dwr.engine._ModeHtmlCall="/call/htmlcall/";dwr.engine._ModePlainPoll="/call/plainpoll/";dwr.engine._ModeHtmlPoll="/call/htmlpoll/";dwr.engine._constructRequest=function(b){var c={url:b.path+b.mode,body:null};if(b.isPoll==true){c.url+="ReverseAjax.dwr"}else{if(b.map.callCount==1){c.url+=b.map["c0-scriptName"]+"."+b.map["c0-methodName"]+".dwr"}else{c.url+="Multiple."+b.map.callCount+".dwr"}}var e=location.href.match(/jsessionid=([^?]+)/);if(e!=null){c.url+=";jsessionid="+e[1]}var d;if(b.httpMethod=="GET"){b.map.callCount=""+b.map.callCount;c.url+="?";for(d in b.map){if(typeof b.map[d]!="function"){c.url+=encodeURIComponent(d)+"="+encodeURIComponent(b.map[d])+"&"}}c.url=c.url.substring(0,c.url.length-1)}else{c.body="";if(document.all&&!window.opera){var a=[];for(d in b.map){if(typeof b.map[d]!="function"){a.push(d+"="+b.map[d]+dwr.engine._postSeperator)}}c.body=a.join("")}else{for(d in b.map){if(typeof b.map[d]!="function"){c.body+=d+"="+b.map[d]+dwr.engine._postSeperator}}}c.body=dwr.engine._contentRewriteHandler(c.body)}c.url=dwr.engine._urlRewriteHandler(c.url);return c};dwr.engine._stateChange=function(c){var b;if(c.completed){dwr.engine._debug("Error: _stateChange() with batch.completed");return}var f=c.req;try{if(f.readyState!=4){return}}catch(d){dwr.engine._handleWarning(c,d);dwr.engine._clearUp(c);return}if(dwr.engine._unloading){dwr.engine._debug("Ignoring reply from server as page is unloading.");return}try{var e=f.responseText;e=dwr.engine._replyRewriteHandler(e);var a=f.status;if(e==null||e==""){dwr.engine._handleWarning(c,{name:"dwr.engine.missingData",message:"No data received from server"})}else{if(a!=200){dwr.engine._handleError(c,{name:"dwr.engine.http."+a,message:f.statusText})}else{var g=f.getResponseHeader("Content-Type");if(!g.match(/^text\/plain/)&&!g.match(/^text\/javascript/)){if(g.match(/^text\/html/)&&typeof c.textHtmlHandler=="function"){c.textHtmlHandler({status:a,responseText:e,contentType:g})}else{dwr.engine._handleWarning(c,{name:"dwr.engine.invalidMimeType",message:"Invalid content type: '"+g+"'"})}}else{if(c.isPoll&&c.map.partialResponse==dwr.engine._partialResponseYes){dwr.engine._processCometResponse(e,c)}else{if(e.search("//#DWR")==-1){dwr.engine._handleWarning(c,{name:"dwr.engine.invalidReply",message:"Invalid reply from server"})}else{b=e}}}}}}catch(d){dwr.engine._handleWarning(c,d)}dwr.engine._callPostHooks(c);dwr.engine._receivedBatch=c;if(b!=null){b=b.replace(dwr.engine._scriptTagProtection,"")}dwr.engine._eval(b);dwr.engine._receivedBatch=null;dwr.engine._validateBatch(c);if(!c.completed){dwr.engine._clearUp(c)}};dwr.engine._validateBatch=function(a){if(!a.completed){for(var b=0;b<a.map.callCount;b++){if(a.handlers[b]!=null){dwr.engine._handleWarning(a,{name:"dwr.engine.incompleteReply",message:"Incomplete reply from server"});break}}}};dwr.engine._iframeLoadingComplete=function(a){var b=dwr.engine._batches[a];if(b){dwr.engine._validateBatch(b)}};dwr.engine._remoteHandleCallback=function(a,f,e){var c=dwr.engine._batches[a];if(c==null){dwr.engine._debug("Warning: batch == null in remoteHandleCallback for batchId="+a,true);return}try{var b=c.handlers[f];c.handlers[f]=null;if(!b){dwr.engine._debug("Warning: Missing handlers. callId="+f,true)}else{if(typeof b.callback=="function"){b.callback(e)}}}catch(d){dwr.engine._handleError(c,d)}};dwr.engine._remoteHandleException=function(a,e,d){var c=dwr.engine._batches[a];if(c==null){dwr.engine._debug("Warning: null batch in remoteHandleException",true);return}var b=c.handlers[e];c.handlers[e]=null;if(b==null){dwr.engine._debug("Warning: null handlers in remoteHandleException",true);return}if(d.message==undefined){d.message=""}if(typeof b.exceptionHandler=="function"){b.exceptionHandler(d.message,d)}else{if(typeof c.errorHandler=="function"){c.errorHandler(d.message,d)}}};dwr.engine._remoteHandleBatchException=function(c,a){var b=(dwr.engine._receivedBatch==null&&a!=null);if(b){dwr.engine._receivedBatch=dwr.engine._batches[a]}if(c.message==undefined){c.message=""}dwr.engine._handleError(dwr.engine._receivedBatch,c);if(b){dwr.engine._receivedBatch=null;dwr.engine._clearUp(dwr.engine._batches[a])}};dwr.engine._remotePollCometDisabled=function(c,a){dwr.engine.setActiveReverseAjax(false);var b=(dwr.engine._receivedBatch==null&&a!=null);if(b){dwr.engine._receivedBatch=dwr.engine._batches[a]}if(c.message==undefined){c.message=""}dwr.engine._handleError(dwr.engine._receivedBatch,c);if(b){dwr.engine._receivedBatch=null;dwr.engine._clearUp(dwr.engine._batches[a])}};dwr.engine._remoteBeginIFrameResponse=function(b,a){if(b!=null){dwr.engine._receivedBatch=b.batch}dwr.engine._callPostHooks(dwr.engine._receivedBatch)};dwr.engine._remoteEndIFrameResponse=function(a){dwr.engine._clearUp(dwr.engine._receivedBatch);dwr.engine._receivedBatch=null};dwr.engine._eval=function(script){if(script==null){return null}if(script==""){dwr.engine._debug("Warning: blank script",true);return null}return eval(script)};dwr.engine._abortRequest=function(a){if(a&&!a.completed){dwr.engine._clearUp(a);if(a.req){a.req.abort()}dwr.engine._handleError(a,{name:"dwr.engine.timeout",message:"Timeout"})}};dwr.engine._callPostHooks=function(a){if(a.postHooks){for(var b=0;b<a.postHooks.length;b++){a.postHooks[b]()}a.postHooks=null}};dwr.engine._clearUp=function(b){if(!b){dwr.engine._debug("Warning: null batch in dwr.engine._clearUp()",true);return}if(b.completed){dwr.engine._debug("Warning: Double complete",true);return}if(b.div){b.div.parentNode.removeChild(b.div)}if(b.iframe){for(var c=0;c<dwr.engine._outstandingIFrames.length;c++){if(dwr.engine._outstandingIFrames[c]==b.iframe){dwr.engine._outstandingIFrames.splice(c,1)}}b.iframe.parentNode.removeChild(b.iframe)}if(b.form){b.form.parentNode.removeChild(b.form)}if(b.req){if(b.req==dwr.engine._pollReq){dwr.engine._pollReq=null}delete b.req}if(b.timeoutId){clearTimeout(b.timeoutId);delete b.timeoutId}if(b.map&&(b.map.batchId||b.map.batchId==0)){delete dwr.engine._batches[b.map.batchId];dwr.engine._batchesLength--}b.completed=true;if(dwr.engine._batchQueue.length!=0){var a=dwr.engine._batchQueue.shift();dwr.engine._sendData(a)}};dwr.engine._unloader=function(){dwr.engine._unloading=true;dwr.engine._batchQueue.length=0;for(var a in dwr.engine._batches){var b=dwr.engine._batches[a];if(b&&b.map){if(b.req){b.req.abort()}dwr.engine._clearUp(b)}}};if(window.addEventListener){window.addEventListener("unload",dwr.engine._unloader,false)}else{if(window.attachEvent){window.attachEvent("onunload",dwr.engine._unloader)}}dwr.engine._handleError=function(a,b){if(typeof b=="string"){b={name:"unknown",message:b}}if(b.message==null){b.message=""}if(b.name==null){b.name="unknown"}if(a&&typeof a.errorHandler=="function"){a.errorHandler(b.message,b)}else{if(dwr.engine._errorHandler){dwr.engine._errorHandler(b.message,b)}}if(a){dwr.engine._clearUp(a)}};dwr.engine._handleWarning=function(a,b){if(typeof b=="string"){b={name:"unknown",message:b}}if(b.message==null){b.message=""}if(b.name==null){b.name="unknown"}if(a&&typeof a.warningHandler=="function"){a.warningHandler(b.message,b)}else{if(dwr.engine._warningHandler){dwr.engine._warningHandler(b.message,b)}}if(a){dwr.engine._clearUp(a)}};dwr.engine._serializeAll=function(b,d,c,a){if(c==null){b.map[a]="null:null";return}switch(typeof c){case"boolean":b.map[a]="boolean:"+c;break;case"number":b.map[a]="number:"+c;break;case"string":b.map[a]="string:"+encodeURIComponent(c);break;case"object":if(c instanceof String){b.map[a]="String:"+encodeURIComponent(c)}else{if(c instanceof Boolean){b.map[a]="Boolean:"+c}else{if(c instanceof Number){b.map[a]="Number:"+c}else{if(c instanceof Date){b.map[a]="Date:"+c.getTime()}else{if(c&&c.join){b.map[a]=dwr.engine._serializeArray(b,d,c,a)}else{b.map[a]=dwr.engine._serializeObject(b,d,c,a)}}}}}break;case"function":break;default:dwr.engine._handleWarning(null,{name:"dwr.engine.unexpectedType",message:"Unexpected type: "+typeof c+", attempting default converter."});b.map[a]="default:"+c;break}};dwr.engine._lookup=function(e,c,a){var d;for(var b=0;b<e.length;b++){if(e[b].data==c){d=e[b];break}}if(d){return"reference:"+d.name}e.push({data:c,name:a});return null};dwr.engine._serializeObject=function(c,h,g,b){var f=dwr.engine._lookup(h,g,b);if(f){return f}if(g.nodeName&&g.nodeType){return dwr.engine._serializeXml(c,h,g,b)}var e="Object_"+dwr.engine._getObjectClassName(g)+":{";var d;for(d in g){if(typeof g[d]!="function"){c.paramCount++;var a="c"+dwr.engine._batch.map.callCount+"-e"+c.paramCount;dwr.engine._serializeAll(c,h,g[d],a);e+=encodeURIComponent(d)+":reference:"+a+", "}}if(e.substring(e.length-2)==", "){e=e.substring(0,e.length-2)}e+="}";return e};dwr.engine._errorClasses={Error:Error,EvalError:EvalError,RangeError:RangeError,ReferenceError:ReferenceError,SyntaxError:SyntaxError,TypeError:TypeError,URIError:URIError};dwr.engine._getObjectClassName=function(c){if(c&&c.constructor&&c.constructor.toString){var d=c.constructor.toString();var a=d.match(/function\s+(\w+)/);if(a&&a.length==2){return a[1]}}if(c&&c.constructor){for(var b in dwr.engine._errorClasses){if(c.constructor==dwr.engine._errorClasses[b]){return b}}}if(c){var d=Object.prototype.toString.call(c);var a=d.match(/\[object\s+(\w+)/);if(a&&a.length==2){return a[1]}}return"Object"};dwr.engine._serializeXml=function(c,f,e,b){var d=dwr.engine._lookup(f,e,b);if(d){return d}var a;if(window.XMLSerializer){a=new XMLSerializer().serializeToString(e)}else{if(e.toXml){a=e.toXml}else{a=e.innerHTML}}return"XML:"+encodeURIComponent(a)};dwr.engine._serializeArray=function(h,c,f,a){var d=dwr.engine._lookup(c,f,a);if(d){return d}if(document.all&&!window.opera){var b=["Array:["];for(var g=0;g<f.length;g++){if(g!=0){b.push(",")}h.paramCount++;var j="c"+dwr.engine._batch.map.callCount+"-e"+h.paramCount;dwr.engine._serializeAll(h,c,f[g],j);b.push("reference:");b.push(j)}b.push("]");e=b.join("")}else{var e="Array:[";for(var g=0;g<f.length;g++){if(g!=0){e+=","}h.paramCount++;var j="c"+dwr.engine._batch.map.callCount+"-e"+h.paramCount;dwr.engine._serializeAll(h,c,f[g],j);e+="reference:";e+=j}e+="]"}return e};dwr.engine._unserializeDocument=function(a){var c;if(window.DOMParser){var e=new DOMParser();c=e.parseFromString(a,"text/xml");if(!c.documentElement||c.documentElement.tagName=="parsererror"){var b=c.documentElement.firstChild.data;b+="\n"+c.documentElement.firstChild.nextSibling.firstChild.data;throw b}return c}else{if(window.ActiveXObject){c=dwr.engine._newActiveXObject(dwr.engine._DOMDocument);c.loadXML(a);return c}else{var d=document.createElement("div");d.innerHTML=a;return d}}};dwr.engine._newActiveXObject=function(a){var d;for(var c=0;c<a.length;c++){try{d=new ActiveXObject(a[c]);break}catch(b){}}return d};dwr.engine._debug=function(f,d){var a=false;try{if(window.console){if(d&&window.console.trace){window.console.trace()}window.console.log(f);a=true}else{if(window.opera&&window.opera.postError){window.opera.postError(f);a=true}}}catch(c){}if(!a){var b=document.getElementById("dwr-debug");if(b){var e=f+"<br/>"+b.innerHTML;if(e.length>2048){e=e.substring(0,2048)}b.innerHTML=e}}};
;
var soy=soy||{};(function(){var b=navigator.userAgent;var a=b.indexOf("Opera")==0;soy.IS_OPERA_=a;soy.IS_IE_=!a&&b.indexOf("MSIE")!=-1;soy.IS_WEBKIT_=!a&&b.indexOf("WebKit")!=-1})();soy.StringBuilder=function(a,b){this.buffer_=soy.IS_IE_?[]:"";if(a!=null){this.append.apply(this,arguments)}};soy.StringBuilder.prototype.bufferLength_=0;soy.StringBuilder.prototype.append=function(b,a,d){if(soy.IS_IE_){if(a==null){this.buffer_[this.bufferLength_++]=b}else{this.buffer_.push.apply(this.buffer_,arguments);this.bufferLength_=this.buffer_.length}}else{this.buffer_+=b;if(a!=null){for(var c=1;c<arguments.length;c++){this.buffer_+=arguments[c]}}}return this};soy.StringBuilder.prototype.clear=function(){if(soy.IS_IE_){this.buffer_.length=0;this.bufferLength_=0}else{this.buffer_=""}};soy.StringBuilder.prototype.toString=function(){if(soy.IS_IE_){var a=this.buffer_.join("");this.clear();if(a){this.append(a)}return a}else{return(this.buffer_)}};soy.renderElement=function(b,c,a){b.innerHTML=c(a)};soy.renderAsFragment=function(d,a){var c=document.createElement("div");c.innerHTML=d(a);if(c.childNodes.length==1){return c.firstChild}else{var b=document.createDocumentFragment();while(c.firstChild){b.appendChild(c.firstChild)}return b}};soy.$$augmentData=function(e,a){function d(){}d.prototype=e;var c=new d();for(var b in a){c[b]=a[b]}return c};soy.$$escapeHtml=function(a){a=String(a);if(!soy.$$EscapeHtmlRe_.ALL_SPECIAL_CHARS.test(a)){return a}if(a.indexOf("&")!=-1){a=a.replace(soy.$$EscapeHtmlRe_.AMP,"&amp;")}if(a.indexOf("<")!=-1){a=a.replace(soy.$$EscapeHtmlRe_.LT,"&lt;")}if(a.indexOf(">")!=-1){a=a.replace(soy.$$EscapeHtmlRe_.GT,"&gt;")}if(a.indexOf('"')!=-1){a=a.replace(soy.$$EscapeHtmlRe_.QUOT,"&quot;")}return a};soy.$$EscapeHtmlRe_={ALL_SPECIAL_CHARS:/[&<>\"]/,AMP:/&/g,LT:/</g,GT:/>/g,QUOT:/\"/g};soy.$$escapeJs=function(b){b=String(b);var c=[];for(var a=0;a<b.length;a++){c[a]=soy.$$escapeChar(b.charAt(a))}return c.join("")};soy.$$escapeChar=function(d){if(d in soy.$$escapeCharJs_){return soy.$$escapeCharJs_[d]}var b=d;var a=d.charCodeAt(0);if(a>31&&a<127){b=d}else{if(a<256){b="\\x";if(a<16||a>256){b+="0"}}else{b="\\u";if(a<4096){b+="0"}}b+=a.toString(16).toUpperCase()}return soy.$$escapeCharJs_[d]=b};soy.$$escapeCharJs_={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\x0B",'"':'\\"',"'":"\\'","\\":"\\\\"};soy.$$escapeUri=function(a){a=String(a);if(!soy.$$ENCODE_URI_REGEXP_.test(a)){return encodeURIComponent(a)}else{return a}};soy.$$ENCODE_URI_REGEXP_=/^[a-zA-Z0-9\-_.!~*'()]*$/;soy.$$insertWordBreaks=function(j,a){j=String(j);var f=[];var h=0;var b=false;var k=false;var g=0;var d=0;for(var e=0,c=j.length;e<c;++e){var l=j.charCodeAt(e);if(g>=a&&l!=soy.$$CharCode_.SPACE){f[h++]=j.substring(d,e);d=e;f[h++]=soy.WORD_BREAK_;g=0}if(b){if(l==soy.$$CharCode_.GREATER_THAN){b=false}}else{if(k){switch(l){case soy.$$CharCode_.SEMI_COLON:k=false;++g;break;case soy.$$CharCode_.LESS_THAN:k=false;b=true;break;case soy.$$CharCode_.SPACE:k=false;g=0;break}}else{switch(l){case soy.$$CharCode_.LESS_THAN:b=true;break;case soy.$$CharCode_.AMPERSAND:k=true;break;case soy.$$CharCode_.SPACE:g=0;break;default:++g;break}}}}f[h++]=j.substring(d);return f.join("")};soy.$$CharCode_={SPACE:32,AMPERSAND:38,SEMI_COLON:59,LESS_THAN:60,GREATER_THAN:62};soy.WORD_BREAK_=soy.IS_WEBKIT_?"<wbr></wbr>":soy.IS_OPERA_?"&shy;":"<wbr>";soy.$$changeNewlineToBr=function(a){a=String(a);if(!soy.$$CHANGE_NEWLINE_TO_BR_RE_.test(a)){return a}return a.replace(/(\r\n|\r|\n)/g,"<br>")};soy.$$CHANGE_NEWLINE_TO_BR_RE_=/[\r\n]/;soy.$$bidiTextDir=function(b,a){b=soy.$$bidiStripHtmlIfNecessary_(b,a);if(!b){return 0}return soy.$$bidiDetectRtlDirectionality_(b)?-1:1};soy.$$bidiDirAttr=function(c,d,a){var b=soy.$$bidiTextDir(d,a);if(b!=c){return b<0?"dir=rtl":b>0?"dir=ltr":""}return""};soy.$$bidiMarkAfter=function(c,d,a){var b=soy.$$bidiTextDir(d,a);return soy.$$bidiMarkAfterKnownDir(c,b,d,a)};soy.$$bidiMarkAfterKnownDir=function(c,b,d,a){return(c>0&&(b<0||soy.$$bidiIsRtlExitText_(d,a))?"\u200E":c<0&&(b>0||soy.$$bidiIsLtrExitText_(d,a))?"\u200F":"")};soy.$$bidiStripHtmlIfNecessary_=function(b,a){return a?b.replace(soy.$$BIDI_HTML_SKIP_RE_," "):b};soy.$$BIDI_HTML_SKIP_RE_=/<[^>]*>|&[^;]+;/g;soy.$$bidiSpanWrap=function(a,d){d=String(d);var c=soy.$$bidiTextDir(d,true);var b=soy.$$bidiMarkAfterKnownDir(a,c,d,true);if(c>0&&a<=0){d="<span dir=ltr>"+d+"</span>"}else{if(c<0&&a>=0){d="<span dir=rtl>"+d+"</span>"}}return d+b};soy.$$bidiUnicodeWrap=function(a,d){d=String(d);var c=soy.$$bidiTextDir(d,true);var b=soy.$$bidiMarkAfterKnownDir(a,c,d,true);if(c>0&&a<=0){d="\u202A"+d+"\u202C"}else{if(c<0&&a>=0){d="\u202B"+d+"\u202C"}}return d+b};soy.$$bidiLtrChars_="A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02B8\u0300-\u0590\u0800-\u1FFF\u2C00-\uFB1C\uFDFE-\uFE6F\uFEFD-\uFFFF";soy.$$bidiNeutralChars_="\u0000-\u0020!-@[-`{-\u00BF\u00D7\u00F7\u02B9-\u02FF\u2000-\u2BFF";soy.$$bidiRtlChars_="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC";soy.$$bidiRtlDirCheckRe_=new RegExp("^[^"+soy.$$bidiLtrChars_+"]*["+soy.$$bidiRtlChars_+"]");soy.$$bidiNeutralDirCheckRe_=new RegExp("^["+soy.$$bidiNeutralChars_+"]*$|^http://");soy.$$bidiIsRtlText_=function(a){return soy.$$bidiRtlDirCheckRe_.test(a)};soy.$$bidiIsNeutralText_=function(a){return soy.$$bidiNeutralDirCheckRe_.test(a)};soy.$$bidiRtlDetectionThreshold_=0.4;soy.$$bidiRtlWordRatio_=function(e){var b=0;var a=0;var d=e.split(" ");for(var c=0;c<d.length;c++){if(soy.$$bidiIsRtlText_(d[c])){b++;a++}else{if(!soy.$$bidiIsNeutralText_(d[c])){a++}}}return a==0?0:b/a};soy.$$bidiDetectRtlDirectionality_=function(a){return soy.$$bidiRtlWordRatio_(a)>soy.$$bidiRtlDetectionThreshold_};soy.$$bidiLtrExitDirCheckRe_=new RegExp("["+soy.$$bidiLtrChars_+"][^"+soy.$$bidiRtlChars_+"]*$");soy.$$bidiRtlExitDirCheckRe_=new RegExp("["+soy.$$bidiRtlChars_+"][^"+soy.$$bidiLtrChars_+"]*$");soy.$$bidiIsLtrExitText_=function(b,a){b=soy.$$bidiStripHtmlIfNecessary_(b,a);return soy.$$bidiLtrExitDirCheckRe_.test(b)};soy.$$bidiIsRtlExitText_=function(b,a){b=soy.$$bidiStripHtmlIfNecessary_(b,a);return soy.$$bidiRtlExitDirCheckRe_.test(b)};
;

// Provide a default path to dwr.engine
if (dwr == null) var dwr = {};
if (dwr.engine == null) dwr.engine = {};
if (DWREngine == null) var DWREngine = dwr.engine;

if (FriendListAction == null) var FriendListAction = {};
FriendListAction._path = '/dwr';
FriendListAction.getFriends = function(callback) {
  dwr.engine._execute(FriendListAction._path, 'FriendListAction', 'getFriends', callback);
}
FriendListAction.getFriends = function(p0, p1, callback) {
  dwr.engine._execute(FriendListAction._path, 'FriendListAction', 'getFriends', p0, p1, callback);
}
FriendListAction.createList = function(p0, p1, callback) {
  dwr.engine._execute(FriendListAction._path, 'FriendListAction', 'createList', p0, p1, callback);
}
FriendListAction.updateList = function(p0, p1, p2, callback) {
  dwr.engine._execute(FriendListAction._path, 'FriendListAction', 'updateList', p0, p1, p2, callback);
}
FriendListAction.deleteList = function(p0, callback) {
  dwr.engine._execute(FriendListAction._path, 'FriendListAction', 'deleteList', p0, callback);
}
FriendListAction.getListsForUser = function(p0, callback) {
  dwr.engine._execute(FriendListAction._path, 'FriendListAction', 'getListsForUser', p0, callback);
}
FriendListAction.addRelationshipsToList = function(p0, p1, callback) {
  dwr.engine._execute(FriendListAction._path, 'FriendListAction', 'addRelationshipsToList', p0, p1, callback);
}
FriendListAction.removeRelationshipsFromList = function(p0, p1, callback) {
  dwr.engine._execute(FriendListAction._path, 'FriendListAction', 'removeRelationshipsFromList', p0, p1, callback);
}
FriendListAction.emailFriends = function(p0, p1, p2, p3, callback) {
  dwr.engine._execute(FriendListAction._path, 'FriendListAction', 'emailFriends', p0, p1, p2, p3, callback);
}
FriendListAction.watchFriends = function(p0, p1, callback) {
  dwr.engine._execute(FriendListAction._path, 'FriendListAction', 'watchFriends', p0, p1, callback);
}
FriendListAction.removeFriend = function(p0, callback) {
  dwr.engine._execute(FriendListAction._path, 'FriendListAction', 'removeFriend', p0, callback);
}
FriendListAction.removeFriends = function(p0, callback) {
  dwr.engine._execute(FriendListAction._path, 'FriendListAction', 'removeFriends', p0, callback);
}
FriendListAction.addFriend = function(p0, p1, p2, callback) {
  dwr.engine._execute(FriendListAction._path, 'FriendListAction', 'addFriend', p0, p1, p2, callback);
}

;
function closeMyLightbox(a){$j(a).closest(".jive-modal").trigger("close")}if(!jive){var jive={}}if(!jive.gui){jive.gui={}}jive.gui.idIncrement=1;jive.gui.smallWindowPanel=function(f,d,b){var c;var e;var h=jive.gui.idIncrement++;var g={};g.action=null;this.setBackAction=function(i){g.action=i};this.goBack=function(){if(g.action!=null){g.action()}};var a=$j("<div class='jive-modal'><h2>"+f+"</h2><a class='jive-modal-close-top j-icon-close' href='#'/><div class='jive-modal-content'></div></div>");a.find(".jive-modal-content").append($j(d).show());this.show=function(){a.lightbox_me({closeSelector:".jive-modal-close-top, .jive-close",onLoad:function(){a.find(":text:first").focus()}})};this.close=function(){closeMyLightbox(a)}};jive.gui.WindowPanel=function(n,q,f){var o=jive.gui.idIncrement++;var k={};k.action=null;this.setBackAction=function(u){k.action=u};var l=document.createElement("DIV");l.style.position="absolute";l.style.top="0px";l.style.left="0px";l.style.width="100%";l.style.height=xDocHeight()+"px";l.style.opacity=".5";l.style.filter="alpha(opacity = 50)";l.style.background="black";l.style.zIndex=28;this.goBack=function(){if(k.action!=null){k.action()}};var t=document.createElement("DIV");t.setAttribute("class","settings_main_title");t.className="settings_main_title";t.appendChild(document.createTextNode(n));var j=document.createElement("DIV");j.setAttribute("class","settings_main");j.setAttribute("id","settings_main_"+o);j.className="settings_main";var g=document.createElement("DIV");g.setAttribute("class","settings_main_outer_close");g.className="settings_main_outer_close";var i=document.createElement("DIV");i.setAttribute("class","settings_main_wrap");i.setAttribute("id","settings_main_wrap_"+o);i.className="settings_main_wrap";var r=document.createElement("DIV");r.setAttribute("class","settings_main_outer_r");r.className="settings_main_outer_r";i.appendChild(r);var e=document.createElement("DIV");e.setAttribute("class","settings_main_outer_l");e.className="settings_main_outer_l";r.appendChild(e);var m=document.createElement("DIV");m.setAttribute("class","settings_main_outer_top");m.className="settings_main_outer_top";e.appendChild(m);var h=document.createElement("DIV");h.setAttribute("class","settings_main_outer_bottom");h.className="settings_main_outer_bottom";m.appendChild(h);var c=document.createElement("DIV");c.setAttribute("class","settings_main_outer_tr");c.className="settings_main_outer_tr";h.appendChild(c);var d=document.createElement("DIV");d.setAttribute("class","settings_main_outer_tl");d.className="settings_main_outer_tl";c.appendChild(d);var s=document.createElement("DIV");s.setAttribute("class","settings_main_outer_br");s.className="settings_main_outer_br";d.appendChild(s);var b=document.createElement("DIV");b.setAttribute("class","settings_main_outer_bl");b.className="settings_main_outer_bl";s.appendChild(b);var a=document.createElement("DIV");a.setAttribute("class","settings_main_content_holder");a.className="settings_main_content_holder";var p=document.createElement("DIV");p.setAttribute("class","settings_main_content");p.className="settings_main_content";a.appendChild(p);b.appendChild(a);p.appendChild(q);j.appendChild(i);i.appendChild(g);i.appendChild(t);this.getDOM=function(){return j};this.show=function(){xLeft(j,xClientWidth()/2-f.width/2);i.style.width=f.width+"px";p.style.height=f.height+"px";j.style.top=(xScrollTop()+xClientHeight()/2-f.height/2)+"px";j.style.display="block";q.style.display="block";document.body.appendChild(l);$j(g).click(this.goBack)};this.close=function(){$j(g).unbind("click",this.goBack);document.body.removeChild(this.getDOM());q.style.display="none";document.body.appendChild(q);document.body.removeChild(l);k.action=function(){}};document.body.appendChild(this.getDOM())};function xDef(a){return(typeof(a)!="undefined")}function xStr(a){return typeof(a)=="string"}function xNum(a){return typeof(a)=="number"}function xLeft(c,a){var b=xDef(c.style);if(b&&xStr(c.style.left)){if(xNum(a)){c.style.left=a+"px"}else{a=parseInt(c.style.left,10);if(isNaN(a)){a=0}}}else{if(b&&xDef(c.style.pixelLeft)){if(xNum(a)){c.style.pixelLeft=a}else{a=c.style.pixelLeft}}}return a}xClientWidth=function(){var a=0;if(document.documentElement&&document.documentElement.clientWidth){a=document.documentElement.clientWidth}else{if(document.body&&document.body.clientWidth){a=document.body.clientWidth}else{if(xDef(window.innerWidth,window.innerHeight,document.height)){a=window.innerWidth;if(document.height>window.innerHeight){a-=16}}}}return a};function xClientHeight(){var a=0;if(document.documentElement&&document.documentElement.clientHeight){a=document.documentElement.clientHeight}else{if(document.body&&document.body.clientHeight){a=document.body.clientHeight}else{if(xDef(window.innerWidth,window.innerHeight,document.width)){a=window.innerHeight;if(document.width>window.innerWidth){a-=16}}}}return a}function xScrollTop(){var a=0;if(document.documentElement&&document.documentElement.scrollTop){a=document.documentElement.scrollTop}else{if(document.body&&xDef(document.body.scrollTop)){a=document.body.scrollTop}}return a}function xDocHeight(){var c=document.body,g=document.documentElement;var d=0,h=0,f=0,a=0;if(g){d=g.scrollHeight;h=g.offsetHeight}if(c){f=c.scrollHeight;a=c.offsetHeight}return Math.max(d,h,f,a)};
;

// Provide a default path to dwr.engine
if (dwr == null) var dwr = {};
if (dwr.engine == null) dwr.engine = {};
if (DWREngine == null) var DWREngine = dwr.engine;

if (Watches == null) var Watches = {};
Watches._path = '/dwr';
Watches.isObjectWatched = function(p0, p1, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'isObjectWatched', p0, p1, callback);
}
Watches.removeObjectWatch = function(p0, p1, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'removeObjectWatch', p0, p1, callback);
}
Watches.watchObject = function(p0, p1, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'watchObject', p0, p1, callback);
}
Watches.isThreadWatched = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'isThreadWatched', p0, callback);
}
Watches.isDocumentWatched = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'isDocumentWatched', p0, callback);
}
Watches.isBlogWatched = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'isBlogWatched', p0, callback);
}
Watches.isBlogPostWatched = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'isBlogPostWatched', p0, callback);
}
Watches.isUserWatched = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'isUserWatched', p0, callback);
}
Watches.isCommunityWatched = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'isCommunityWatched', p0, callback);
}
Watches.isProjectWatched = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'isProjectWatched', p0, callback);
}
Watches.isTaskWatched = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'isTaskWatched', p0, callback);
}
Watches.isSocialGroupWatched = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'isSocialGroupWatched', p0, callback);
}
Watches.watchThread = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'watchThread', p0, callback);
}
Watches.watchDocument = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'watchDocument', p0, callback);
}
Watches.watchBlog = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'watchBlog', p0, callback);
}
Watches.watchBlogPost = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'watchBlogPost', p0, callback);
}
Watches.watchUser = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'watchUser', p0, callback);
}
Watches.watchCommunity = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'watchCommunity', p0, callback);
}
Watches.watchProject = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'watchProject', p0, callback);
}
Watches.watchTask = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'watchTask', p0, callback);
}
Watches.watchSocialGroup = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'watchSocialGroup', p0, callback);
}
Watches.watchVideo = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'watchVideo', p0, callback);
}
Watches.watchWallEntry = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'watchWallEntry', p0, callback);
}
Watches.watchPoll = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'watchPoll', p0, callback);
}
Watches.removeWallEntryWatch = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'removeWallEntryWatch', p0, callback);
}
Watches.removeThreadWatch = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'removeThreadWatch', p0, callback);
}
Watches.removeDocumentWatch = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'removeDocumentWatch', p0, callback);
}
Watches.removeBlogWatch = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'removeBlogWatch', p0, callback);
}
Watches.removeBlogPostWatch = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'removeBlogPostWatch', p0, callback);
}
Watches.removeUserWatch = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'removeUserWatch', p0, callback);
}
Watches.removeCommunityWatch = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'removeCommunityWatch', p0, callback);
}
Watches.removeProjectWatch = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'removeProjectWatch', p0, callback);
}
Watches.removeTaskWatch = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'removeTaskWatch', p0, callback);
}
Watches.removeSocialGroupWatch = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'removeSocialGroupWatch', p0, callback);
}
Watches.removeVideoWatch = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'removeVideoWatch', p0, callback);
}
Watches.removePollWatch = function(p0, callback) {
  dwr.engine._execute(Watches._path, 'Watches', 'removePollWatch', p0, callback);
}

;

// Provide a default path to dwr.engine
if (dwr == null) var dwr = {};
if (dwr.engine == null) dwr.engine = {};
if (DWREngine == null) var DWREngine = dwr.engine;

if (UserStatusAction == null) var UserStatusAction = {};
UserStatusAction._path = '/dwr';
UserStatusAction.setUserStatus = function(p0, callback) {
  dwr.engine._execute(UserStatusAction._path, 'UserStatusAction', 'setUserStatus', p0, callback);
}
UserStatusAction.setPreferredView = function(p0, p1, callback) {
  dwr.engine._execute(UserStatusAction._path, 'UserStatusAction', 'setPreferredView', p0, p1, callback);
}

;
jive.model.YourStatusUpdates=function(e,d,a,f,c){var b=this;e=jive.util.escapeHTML(e);this.editStatus=function(g){$j("#j-status-form-action-"+g).slideDown();$j("#statustext-small-"+g).keyup(b.saveStatusViaReturn)};this.saveStatusViaReturn=function(h){var g=h.which||h.keyCode;if(g===jive.Event.KEY_RETURN){if(typeof f=="undefined"){b.saveStatus(h.target.getAttribute("_prefix"),false)}else{b.saveStatus(h.target.getAttribute("_prefix"),f)}}};this.saveStatus=function(i,h){$j("#statustext-small-"+i).unbind("keyup",b.saveStatusViaReturn);var g=$j("#statustext-small-"+i).val();if(g.length==0){window.alert(c);return false}UserStatusAction.setUserStatus($j("#statustext-small-"+i).val(),{errorHandler:function(k,j){$j("#statustext-small-"+i).val($j("#statustext-value-"+i).val());b.editStatus(i);window.alert(a)},callback:function(j){$j("#statustext-small-"+i).val("");$j("#jive-success-box-"+i).show().fadeOut(4500)}})}};
;
jive.namespace("Wall.Util");jive.Wall.Util.focusHelper=function(){$j("#j-ub-new-wallentry").click();var a=window.setInterval(function(){var b=$j("#jive-quickstatuscreate-form .jive-js-statusinput");if(b.length!=0){b.last().focus();window.clearInterval(a)}},500);return false};
;
if(typeof jive=="undefined"){var jive={}}if(typeof jive.StatusInput=="undefined"){jive.StatusInput={}}if(typeof jive.StatusInput.soy=="undefined"){jive.StatusInput.soy={}}jive.StatusInput.soy.ddSearch=function(a,c){var b=c||new soy.StringBuilder();b.append('<div class="j-autocomplete j-popover j-js-autocomplete"><div class="j-top-pointer"></div>');jive.StatusInput.soy.ddOutputEntries(a,b);b.append('<p class="j-search-hint">',soy.$$escapeHtml(a.i18n.ddSearchHint),"</p></div>");if(!c){return b.toString()}};jive.StatusInput.soy.ddTags=function(a,c){var b=c||new soy.StringBuilder();b.append('<div class="j-autocomplete j-popover j-js-autocomplete"><div class="j-top-pointer"></div>');if(a.currentTagText){jive.StatusInput.soy.ddOutputEntries(soy.$$augmentData(a,{emptyEntriesHTML:(a.allowTagCreation)?'<a class="jive-js-status-input-selectable jive-js-status-input-create" href="javascript:void(0)" data-id="'+soy.$$escapeHtml(a.currentTagText)+'">'+soy.$$escapeHtml(a.i18n.ddTagsCreateTitle)+soy.$$escapeHtml(a.currentTagText)+"</a>":""}),b)}else{b.append('<p class="font-color-meta j-autocomplete-tag-prompt">',(a.allowTagCreation)?soy.$$escapeHtml(a.i18n.ddTagsTitle):soy.$$escapeHtml(a.i18n.ddTagsTitleNoCreate),"</p>")}b.append("</div>");if(!c){return b.toString()}};jive.StatusInput.soy.ddFriends=function(a,c){var b=c||new soy.StringBuilder();b.append('<div class="j-autocomplete j-popover j-js-autocomplete"><div class="j-top-pointer"></div><p class="font-color-meta">',soy.$$escapeHtml(a.i18n.ddTitle),'</p><ul class="j-autocomplete-nav clearfix"><li>',soy.$$escapeHtml(a.i18n.ddFriendsLinkText),'</li><li><a class="jive-js-status-input-selectable jive-js-history" href="javascript:void(0);">',soy.$$escapeHtml(a.i18n.ddHistoryLinkText),"</a></li></ul>");jive.StatusInput.soy.ddOutputEntries(soy.$$augmentData(a,{emptyEntriesStr:a.i18n.ddNofriendsLabel}),b);b.append("</div>");if(!c){return b.toString()}};jive.StatusInput.soy.ddHistory=function(a,c){var b=c||new soy.StringBuilder();b.append('<div class="j-autocomplete j-popover j-js-autocomplete"><div class="j-top-pointer"></div><p class="font-color-meta">',soy.$$escapeHtml(a.i18n.ddTitle),'</p><ul class="j-autocomplete-nav clearfix"><li><a class="jive-js-status-input-selectable jive-js-friends" href="javascript:void(0);">',soy.$$escapeHtml(a.i18n.ddFriendsLinkText),"</a></li><li>",soy.$$escapeHtml(a.i18n.ddHistoryLinkText),"</li></ul>");jive.StatusInput.soy.ddOutputEntries(soy.$$augmentData(a,{emptyEntriesStr:a.i18n.ddUserbarNoHistoryToView}),b);b.append("</div>");if(!c){return b.toString()}};jive.StatusInput.soy.ddOutputEntries=function(a,g){var b=g||new soy.StringBuilder();b.append('<ul class="j-autocomplete-results">');var d=a.entries;var e=d.length;if(e>0){for(var f=0;f<e;f++){var c=d[f];b.append("<li>",c.html,"</li>")}}else{b.append((a.emptyEntriesHTML)?"<li>"+a.emptyEntriesHTML+"</li>":soy.$$escapeHtml(a.emptyEntriesStr))}b.append("</ul>");if(!g){return b.toString()}};
;
if(typeof jive=="undefined"){var jive={}}if(typeof jive.StatusInput=="undefined"){jive.StatusInput={}}if(typeof jive.StatusInput.soy=="undefined"){jive.StatusInput.soy={}}jive.StatusInput.soy.renderAttachments=function(a,g){var e=g||new soy.StringBuilder();e.append('<a class="j-attachment-arrow j-attachment-arrow-left clearfix" href="javascript:void(0);"><span class="jive-icon-link-back"></span></a><ul class="j-attached-items clearfix">');var d=a.attachments;var f=d.length;for(var c=0;c<f;c++){var b=d[c];jive.StatusInput.soy.renderAttachment(soy.$$augmentData(a,{attachment:b,removable:a.removable,i18n:a.i18n}),e)}e.append((a.removable)?"<li class='j-attached-loading'></li>":"",'</ul><a class="j-attachment-arrow j-attachment-arrow-right clearfix" href="javascript:void(0);"><span class="jive-icon-link-forward"></span></a>');if(!g){return e.toString()}};jive.StatusInput.soy.renderAttachment=function(a,c){var b=c||new soy.StringBuilder();if(a.attachment.objectType==jive.Wall.Main.ATTACHMENT_TYPE_IMAGE){b.append('<li class="j-attached-image" ',(a.attachment.id)?'id="'+a.attachment.id+'"':"",'><a href="');jive.app.url({path:soy.$$escapeHtml(a.attachment.fullImageUrl)},b);b.append('" jiveOriginalURL="',soy.$$escapeHtml(a.attachment.originalURL),'" style="display: block;width: ',soy.$$escapeHtml(a.attachment.thumbnailWidth),'px;" class="j-attach-anchor"><img src="');jive.app.url({path:soy.$$escapeHtml(a.attachment.imageThumbnailUrl)},b);b.append('" width="',soy.$$escapeHtml(a.attachment.thumbnailWidth),'" height="',soy.$$escapeHtml(a.attachment.thumbnailHeight),'" style=" margin-top: ',soy.$$escapeHtml((70-a.attachment.thumbnailHeight)/2),'px;" /></a>',(a.removable)?'<a href="javascript:void(0);" class="j-remove-attachment">'+soy.$$escapeHtml(a.i18n.remove)+"</a>":"","</li>")}else{if(a.attachment.objectType==jive.Wall.Main.ATTACHMENT_TYPE_VIDEO){b.append('<li class="j-attached-video" ',(a.attachment.id)?'id="'+a.attachment.id+'"':"",'><a rel="fb" href="',soy.$$escapeHtml(a.attachment.properties.videoURL),'" style="width: ',soy.$$escapeHtml(a.attachment.properties.thumbnailWidth),"px; height: ",soy.$$escapeHtml(a.attachment.properties.thumbnailHeight),'px" class="j-attach-anchor j-attach-video"><img src="');jive.app.url({path:soy.$$escapeHtml(a.attachment.properties.thumbnailURL)},b);b.append('" width="',soy.$$escapeHtml(a.attachment.properties.thumbnailWidth),'" height="',soy.$$escapeHtml(a.attachment.properties.thumbnailHeight),'" /><span class="j-icon-play" style="display: none; position: absolute; left: ',soy.$$escapeHtml((a.attachment.properties.thumbnailWidth+12-40)/2),'px; top: 20px; "></span></a>',(a.removable)?'<a href="javascript:void(0);" class="j-remove-attachment">'+soy.$$escapeHtml(a.i18n.remove)+"</a>":"","</li>")}}jive.bindLightboxMedia(null,b);if(!c){return b.toString()}};
;
if(typeof jive=="undefined"){var jive={}}if(typeof jive.Wall=="undefined"){jive.Wall={}}if(typeof jive.Wall.soy=="undefined"){jive.Wall.soy={}}jive.Wall.soy.renderStatusSuccess=function(a,c){var b=c||new soy.StringBuilder();b.append('<div class="j-successful-post clearfix"><h3 class="font-color-okay">',soy.$$escapeHtml(a.i18n.wallentryStatusPostSuccessTitle),'</h3><a href="javascript:void(0);" class="j-success-post-dismiss">',soy.$$escapeHtml(a.i18n.wallentryStatusPostSuccessDismiss),'</a><ul class="j-status-post clearfix"><li class="jive-activity-status">');jive.Wall.soy.renderActivityStatus({entry:a.entry},b);b.append('</li><li class="jive-js-image-container j-attachment-container clearfix">');jive.StatusInput.soy.renderAttachments({attachments:a.entry.meta,i18n:a.i18n},b);b.append("</li></ul></div>");if(!c){return b.toString()}};jive.Wall.soy.renderActivityStatus=function(a,c){var b=c||new soy.StringBuilder();b.append(a.entry.message);if(!c){return b.toString()}};jive.Wall.soy.commentForm=function(a,c){var b=c||new soy.StringBuilder();b.append('<li class="comment-form clearfix">');if(a.canComment){jive.user.soy.avatar({user:a.user,size:30,useLinks:true,showHover:true},b);b.append('<div class="jive-comment-arrow"></div><div class="jive-comment-content">');jive.Wall.soy.statusInputNotificationBoxes(null,b);b.append('<form id="s-c-form-',soy.$$escapeHtml(a.statusID),'" name="',soy.$$escapeHtml(a.statusID),'">');jive.Wall.soy.statusInput({statusInputIdPostfix:a.statusID},b);b.append('<input type="hidden" name="id" value="',soy.$$escapeHtml(a.statusID),'"/><input type="hidden" name="imageURL" />');jive.Wall.soy.statusInputErrorWarnBox({i18n:a.i18n},b);b.append('<div class="j-submit-mb"><input type="button"  class="j-comment-submit" id="',soy.$$escapeHtml(a.statusID),'" value="',soy.$$escapeHtml(a.i18n.commentButtonLabel),'" /></div></form>');jive.Wall.soy.statusInputActionContainer({displayImageBtn:false,canCreateImage:a.canCreateImage,i18n:a.i18n},b);b.append("</div>")}b.append("</li>");if(!c){return b.toString()}};jive.Wall.soy.repostForm=function(a,c){var b=c||new soy.StringBuilder();b.append('<div class="j-repost-form jive-form-container clearfix">');jive.Wall.soy.statusInputNotificationBoxes(null,b);b.append('<form id="s-r-form-',soy.$$escapeHtml(a.statusID),'" name="',soy.$$escapeHtml(a.statusID),'"><div class="jive-form-label"><label>',soy.$$escapeHtml(a.i18n.commentary),soy.$$escapeHtml(a.i18n.colon),"</label></div>");jive.Wall.soy.statusInput({statusInputIdPostfix:"s-r-input-"+soy.$$escapeHtml(a.statusID)},b);b.append('<input type="hidden" name="id" value="',soy.$$escapeHtml(a.statusID),'"/><input type="hidden" name="imageURL" />');jive.Wall.soy.statusInputErrorWarnBox({i18n:a.i18n},b);b.append('<div class="j-submit-mb"><input type="button" class="j-repost-submit" statusid="',soy.$$escapeHtml(a.statusID),'" value="',soy.$$escapeHtml(a.i18n.repost),'" /></div></form>');jive.Wall.soy.statusInputActionContainer({displayImageBtn:true,canCreateImage:a.canCreateImage,i18n:a.i18n},b);b.append("</div>");if(!c){return b.toString()}};jive.Wall.soy.statusInput=function(a,c){var b=c||new soy.StringBuilder();b.append('<script type="text/javascript">jive.MicroBlogging.StatusInput.setupLiveFocusHandler(\'message-',soy.$$escapeHtml(a.statusInputIdPostfix),"')<\/script><div id=\"statusInputs-",soy.$$escapeHtml(a.statusInputIdPostfix),'"><div class="jive-statusinput-default jive-statusinput jive-form-element-text jive-js-statusinput-default">',(a.defaultTxt)?soy.$$escapeHtml(a.defaultTxt):"",'</div><div id="message-',soy.$$escapeHtml(a.statusInputIdPostfix),'" class="jive-js-statusinput jive-statusinput jive-form-element-text" contentEditable="true" style="position:relative;"></div></div>');if(!c){return b.toString()}};jive.Wall.soy.statusInputNotificationBoxes=function(a,c){var b=c||new soy.StringBuilder();jive.Wall.soy.statusInputNotificationBox({cssClass:"jive-info-box"},b);jive.Wall.soy.statusInputNotificationBox({cssClass:"jive-warn-box"},b);jive.Wall.soy.statusInputNotificationBox({cssClass:"jive-error-box"},b);if(!c){return b.toString()}};jive.Wall.soy.statusInputNotificationBox=function(a,c){var b=c||new soy.StringBuilder();b.append('<div class="',soy.$$escapeHtml(a.cssClass),'" style="display:none"></div>');if(!c){return b.toString()}};jive.Wall.soy.statusInputErrorWarnBox=function(a,c){var b=c||new soy.StringBuilder();b.append('<span class="j-wall-error" style="display:none"><strong>');if(a.i18n.characterLimitOver==1){jive.i18n.soy({string:a.i18n.characterLimitOverOne,zero:'<span class="j-number-over"></span>'},b)}else{jive.i18n.soy({string:a.i18n.characterLimitOverMany,zero:'<span class="j-number-over"></span>'},b)}b.append('</strong></span><span class="j-wall-warn" style="display:none"><strong>');jive.i18n.soy({string:a.i18n.characterLimitLeft,zero:'<span class="j-number-left"></span>'},b);b.append('</strong></span><span class="jive-js-error-general" style="display:none"><strong>',soy.$$escapeHtml(a.i18n.statusInputError),"</strong></span>");if(!c){return b.toString()}};jive.Wall.soy.statusInputActionContainer=function(a,c){var b=c||new soy.StringBuilder();b.append((a.canCreateImage&&a.displayImageBtn)?'<div class="jive-js-image-container j-attachment-container clearfix"></div>':"",'<div class="j-attach-action-container clearfix">',(a.canCreateImage&&a.displayImageBtn)?'<a href="javascript:void(0);" class="j-button j-wall-meta-image"><span class="jive-icon-med jive-icon-camera"></span></a>':"",'<a href="javascript:void(0);" class="jive-js-wall-mention-button j-wall-meta-reference j-button">@</a><span class="font-color-meta j-upload-image-help">',soy.$$escapeHtml(a.i18n.uploadImage),'</span><span class="font-color-meta j-reference-help">',soy.$$escapeHtml(a.i18n.referenceHelp),'</span><div class="j-wall-meta-image-container j-attach-tab"><form method="post" enctype="multipart/form-data"><input type="file" name="image" /><input type="hidden" name="imageURL" /></form></div><div class="j-wall-meta-video-container j-attach-tab"><form method="post"><input type="file" name="image" /><input type="hidden" name="imageURL" /></form></div></div>');if(!c){return b.toString()}};
;
if(typeof jive=="undefined"){var jive={}}if(typeof jive.Shared=="undefined"){jive.Shared={}}if(typeof jive.Shared.soy=="undefined"){jive.Shared.soy={}}jive.Shared.soy.formWaitingOverlay=function(a,c){var b=c||new soy.StringBuilder();b.append('<div class="jive-js-form-disable jive-form-waiting-disable"><div class="',soy.$$escapeHtml(a.bgCssClass),'"></div><span class="jive-js-load-indicator jive-form-waiting">',soy.$$escapeHtml(a.i18n.formSubmitPleaseWait),"</span></div>");if(!c){return b.toString()}};
;
if(!jive.Selection){jive.Selection=$Class.extend({init:function(b,a,c){this._selection=jive.Selection.getSelection();if(b!=null){if(!jQuery.browser.msie){if(this._selection.rangeCount==0){this._selection.addRange(jive.Selection.createRangeAtNode(b))}}this._range=this.getRangeAt(0);this.moveToNodeAndCollapse(b,a,c)}else{this._range=this.getRangeAt(0)}},getSelection:function(){return this._selection},getRangeAt:function(a){return jive.Selection.getRangeAt(this._selection,a)},makeRangeTheSelection:function(){if(jQuery.browser.msie){this._selection.empty();this._range.select()}else{if(this._selection.rangeCount>0){this._selection.removeAllRanges()}this._selection.addRange(this._range)}},rangeInsertNode:function(d){if(jQuery.browser.msie){var a=this.getRangeStartContainer();var c=this.getRangeStartOffset();var b=a.parentNode;if(a.nodeType==3){var g=new String(a.nodeValue);var f=document.createTextNode(g.substring(0,c));var e=document.createTextNode(g.substring(c));b.insertBefore(f,a);b.insertBefore(d,a.nextSibling);b.insertBefore(e,d.nextSibling);b.removeChild(a);this.moveToNodeAndCollapse(d,true)}else{b.insertBefore(d,a.nextSibling)}}else{this._range.insertNode(d)}},setRangeStart:function(b,a){if(jQuery.browser.msie){this._setRangeStartEndHelper(b,a,false)}else{this._range.setStart(b,a)}},setRangeEnd:function(a,b){if(jQuery.browser.msie){this._setRangeStartEndHelper(a,b,true)}else{this._range.setEnd(a,b)}},getRangeStartContainer:function(){if(jQuery.browser.msie){return this._getIERangeContainerHelper(true).container}else{return this._range.startContainer}},getRangeEndContainer:function(){if(jQuery.browser.msie){return this._getIERangeContainerHelper(false).container}else{return this._range.endContainer}},getRangeStartOffset:function(){if(jQuery.browser.msie){return this._getIERangeContainerHelper(true).offset}else{return this._range.startOffset}},getRangeEndOffset:function(){if(jQuery.browser.msie){return this._getIERangeContainerHelper(false).offset}else{return this._range.endOffset}},getWordAtRange:function(){return this._wordAtRangeCommon()},replaceWordAtRange:function(c,b,a){this._wordAtRangeCommon(c,b,a)},_wordAtRangeCommon:function(e,a,b){var q=this.getRangeStartContainer();var k=jive.Selection.replaceNbspWithWhitespace(q.nodeValue);if(this.alignRangeWithNearestTextNode(q)){q=this.getRangeStartContainer();k=q.nodeValue}if(e==null){if(this._normalizeTextNode(q,this.getRangeStartOffset())){k=q.nodeValue;this._range.collapse(true);this.makeRangeTheSelection()}}var i=this.getRangeStartOffset();var o=new String(k).substring(0,i);var g=new String(k).substring(i);var f=/\S+$/,p=/^\S+/;if(e!=null&&e.length>0){a=a||"";b=b||{tag:"txt"};var l=a+e;o=o.replace(f,"");g=g.replace(p,"");if((g==null||g.length==0)&&b.tag!="txt"){g=" "}var c;if(b.tag=="txt"){c=document.createTextNode(l)}else{c=document.createElement(b.tag);for(var n in b.attrs){c.setAttribute(n,b.attrs[n])}c.innerHTML=l}var h=q.parentNode;if(o!=null&&o.length>0){h.insertBefore(document.createTextNode(o),q)}h.insertBefore(c,q);var j=null;if(g!=null&&g.length>0){j=document.createTextNode(g);h.insertBefore(j,q)}h.removeChild(q);var d=j==null?c:j;this.moveToNodeAndCollapse(d)}else{o=o.match(f);g=g.match(p);var m=(o==null?"":o)+(g==null?"":g);return m}},_normalizeTextNode:function(d,h){h=h||0;if(d==null||!d.nodeValue||jive.Selection.replaceNbspWithWhitespace(d.nodeValue).search(/\S+/)==-1){return false}var c="";var a=d.parentNode;function g(k){var j=k?d.previousSibling:d.nextSibling;while(j!=null&&j.nodeType==3&&jive.Selection.replaceNbspWithWhitespace(j.nodeValue).search(/\S+/)>-1){if(k){c=j.nodeValue+c}else{c+=j.nodeValue}var i=k?j.previousSibling:j.nextSibling;a.removeChild(j);j=i}}g(true);var f=c.length+h;c+=d.nodeValue;g(false);if(c!=d.nodeValue){if(jQuery.browser.msie){var e=this._range.duplicate();var b=document.createTextNode(c);a.replaceChild(b,d);this._range=e.duplicate();this._range.moveStart("character",f)}else{d.nodeValue=c;this.setRangeStart(d,f)}this._range.collapse(true);this.makeRangeTheSelection();return true}return false},insertNodeAtRange:function(b,c){var a=typeof b=="string"?document.createTextNode(b):b;if(!$j.browser.msie){this._range.collapse(true)}this.rangeInsertNode(a);if(a.nodeType==3){if(!this._normalizeTextNode(a,c)){if(jQuery.browser.msie){this._range.moveStart("character",c);this._range.collapse(true)}else{this.setRangeStart(b,c)}this.makeRangeTheSelection()}}},selectNodeContents:function(a){if(jQuery.browser.msie){var d=this.getRangeStartOffset()*-1;var c=this._range.duplicate();c.moveToElementText(c.parentElement());c.setEndPoint("StartToEnd",this._range);var b=c.text.length;this._range.moveStart("character",d);this._range.moveEnd("character",b);this._range.select()}else{this.getSelection().selectAllChildren(a)}},moveToNodeAndCollapse:function(b,a,c){if(a){this.setRangeStart(b,c)}else{this.setRangeEnd(b,c)}this._range.collapse(a);this.makeRangeTheSelection()},alignRangeWithNearestTextNode:function(a){a=a||this.getRangeStartContainer();if(a.nodeType!=3){var f=$j(a).contents();if(f.length>0){var c=this.getRangeStartOffset();var e=f.get(c);if(e.nodeType==3){this.init(d,false);return true}else{return this.alignRangeWithNearestTextNode(e)}}else{f=$j(a).parent().contents();var g=f.index(a);var b=false;var d=f.filter(function(h){return h<g&&this.nodeType==3}).last();if(d.length==0){d=f.filter(function(h){return h>g&&this.nodeType==3}).first();b=true}if(d.length>0){this.init(d[0],b,b?0:d[0].length);return true}else{throw ("alignRangeWithNearestTextNode Failed to find a text node to align with.")}}}return false},_getIERangeContainerHelper:function(c){var g=c?this._getIERangeStartOffsetHelper():this._getIERangeEndOffsetHelper();var a=this._range.parentElement();var e=0;var f=a.childNodes;if(f.length==0){return a}for(var d=0;d<f.length;d++){var h=f[d];var b=$j(h).text().length;if(g<=e+b){return{container:h,offset:g-e}}else{e+=b}}throw ("Error jive.selection._getIERangeContainerHelper could not find range container")},_getIERangeStartOffsetHelper:function(){var a=this._range.duplicate();a.moveToElementText(a.parentElement());a.setEndPoint("EndToStart",this._range);return a.text.length},_getIERangeEndOffsetHelper:function(){return this._range.text.length+this._getIERangeStartOffsetHelper()},_setRangeStartEndHelper:function(h,k,g){var n=h.nodeType==3;var l=n?h.parentNode:h;var i=this._range.duplicate();i.moveToElementText(l);k=k||0;var c=$j(h).parent().contents();var p=c.index(h);var a;if(n){a=c.slice(0,p).text().length+k}else{a=c.slice(0,p+k).text().length}i.moveStart("character",a);var f;var e;if(n){f=p+1;e=jive.Selection.replaceNbspWithWhitespace($j(h).text()).substring(k)}else{f=p+k+1;e=jive.Selection.replaceNbspWithWhitespace(c.slice(p+k))}var o=new RegExp("(.*)"+e);function j(){return new String(i.text).replace(new RegExp(c.slice(f).text()+"$"),"")}var b=j();var d=0;while(b!=e){b=j();var m=b.match(o);if(m!=null&&m.length==2){i.moveStart("character",m[1].length)}else{throw ("jive.Selection _setRangeStartEndHelper failed to setRange Start or End")}d++;if(d==10){throw ("jive.Selection _setRangeStartEndHelper failed to setRange Start or End")}}if(g){this._range.setEndPoint("EndToStart",i)}else{this._range.setEndPoint("StartToStart",i)}}});jive.Selection.getSelection=function(){if(window.getSelection){return window.getSelection()}else{if(document.all){return document.selection}else{if(document.getSelection){return document.getSelection()}}}throw ("jive.Selection.getSelector Error: unable to obtain seleciton object")};jive.Selection.getRangeAt=function(b,a){if(b.getRangeAt){return b.getRangeAt(a)}else{if(document.selection){return b.createRange()}}throw ("jive.Selection.getRangeAt Error: unable to obtain seleciton object")};jive.Selection.moveCursorAfter=function(b){var c=document.createElement("span");c.setAttribute("data-jive-statusinputadd","true");c.innerHTML="&nbsp;";b.parentNode.insertBefore(c,b);b.parentNode.insertBefore(b,c);var a=new jive.Selection(c,true);b.parentNode.removeChild(c)};jive.Selection.createRangeAtNode=function(b){if(document.createRange){var a=document.createRange();a.selectNodeContents(b);return a}else{if(b.createRange){return b.createRange()}}throw ("jive.Selection.createRange Error: unable to obtain range object")};jive.Selection.replaceNbspWithWhitespace=function(a){return String(a).replace(/\xA0/g," ")}};
;
jive.action=(function(){var a=_jive_base_url+"/";return{url:function(b,c){var d="";Object.keys(c).forEach(function(e){d+=e+"="+c[e]+"&"});if(d.length>0){d="?"+d.slice(0,d.length-1)}return a+b+".jspa"+d}}})();
;
jive.namespace("shared");jive.shared.NotificationView=$Class.extend({init:function(a,c,b){this.container=a;this.selectors=$j.extend({info:".jive-info-box",warn:".jive-warn-box",error:".jive-error-box"},c||{});b=$j.extend({includeIcon:true},b);this.includeIcon=b.includeIcon},info:function(a){this._message(this.selectors.info,a,"jive-icon-info")},warn:function(a){this._message(this.selectors.warn,a,"jive-icon-warn")},error:function(a){this._message(this.selectors.error,a,"jive-icon-redalert")},_message:function(a,d,b){var c=$j(this.container).find(a);if(this.includeIcon){c.html('<div><span class="jive-icon-med '+b+'"></span>'+$j("<div/>").html(d).text().replace(/\s+/gm," ")+"</div>")}else{c.text(d)}c.slideDown().delayAnimation(3000).slideUp()},_notices:function(){var a=$j();for(var b in this.selectors){a.add(this.selectors[b])}return a}});
;
jive.namespace("shared");jive.shared.FormWaitingView=$Class.extend({init:function(a,b){this._$container=$j(a);this._i18n=b.i18n;if(b.containerPadding){this._containerPadding=b.containerPadding}else{this._containerPadding=this._$container.css("padding-left")==null?0:Number(this._$container.css("padding-left").replace("px",""))}this._buttonSelector=b.buttonSelector||"input[type=button], input[type=submit]";this._bgCssClass=b.bgCssClass||"jive-form-waiting-disable-bg"},disableForm:function(){if(this._$container.find(".jive-js-form-disable").length==0){var c={width:this._$container.innerWidth(),height:this._$container.innerHeight(),left:0,top:0};var d=$j(jive.Shared.soy.formWaitingOverlay({i18n:this._i18n,bgCssClass:this._bgCssClass}));for(var b in c){d.css(b,c[b]+"px")}d.prependTo(this._$container);var a=d.find(".jive-js-load-indicator");a.css("left",(c.width/2-a.width()/2)+"px");a.css("top",(c.height/2-a.height()/2)+"px");this._$container.find(this._buttonSelector).attr("disabled",true)}},enableForm:function(){this._$container.find(".jive-js-form-disable").remove();this._$container.find(this._buttonSelector).removeAttr("disabled")}});
;
jive.namespace("StatusInput");if(!jive.StatusInput.StatusInputs){jive.StatusInput.StatusInputs=$Class.extend({init:function(a,b){this._container=$j(a);this._i18n=b.i18n;this.statusInputs={};var c=this;$j(document).asyncReady(function(){c._docReadyInit(b);c.emit("ready")})},getSubmitVals:function(a){return this.getStatusInput(a).getSubmitVals()},resetText:function(a){this.getStatusInput(a).resetText()},_docReadyInit:function(a){var b=this;this._container.find(".jive-js-statusinput").each(function(){var c=$j(this).attr("id");b.statusInputs[c]=new jive.StatusInput.StatusInput($j(this),a);b._addInstanceToInstanceObj(c)})},_addInstanceToInstanceObj:function(a){jive.StatusInput.StatusInput.instances[a]=this.statusInputs[a]},getStatusInput:function(a){return this.statusInputs[a]}});jive.observable(jive.StatusInput.StatusInputs.prototype);jive.observable(jive.StatusInput.StatusInputs.prototype);jive.StatusInput.StatusInput=$Class.extend({init:function(a,b){this._container=$j(a);this._i18n=b.i18n;this._selection=null;this._replacedInitialText=false;this._initDD(b);this._initDataHandlers();this._initDDHandlers();this._maxCharCount=b.maxCharCount||420;this._maxCharCountBeforeWarning=b.maxCharCountBeforeWarn||this._maxCharCount*0.8;this._previousMatchReqsSpaceAfter=null;this._previousPasteVal=null;this._previousSanitizedHTML=null;var c=this;$j(document).bind("keyup mouseup",function(d){switch(d.which){case 1:case 2:case 3:case 27:c._dd.hide();return;break;default:break}});this._container.bind("keydown",function(d){if(d.which==13){c._container[0].contentEditable=false}else{if(c._container[0].contentEditable.toLowerCase()=="false"){c._container[0].contentEditable=true}}});this._container.bind("keyup mouseup",function(f){switch(f.which){case 27:c._dd.hide();return;break;case 40:c._dd.selectItem(0);return;break;default:break}if(c._container[0].contentEditable.toLowerCase()=="false"){c._container[0].contentEditable=true}f.stopPropagation();if(c._container.text().length==0){c._dd.hide();return}c._selection=new jive.Selection();c.sanitizeHTML();if(!c._replacedInitialText){c._replacedInitialText=true}c._processToken();var d=c.getCharCount();if(d>c._maxCharCountBeforeWarning){if(c.getCharCount()>c._maxCharCount){c.emit("characterLenMsg","error",{charCount:d,charOver:d-c._maxCharCount})}else{c.emit("characterLenMsg","warning",{charCount:d,charLeft:c._maxCharCount-d})}}else{c.emit("characterLenMsg","ok")}});this._container.blur(function(){if(!c._dd.isVisible()){c._processCompleteToken()}})},_initDD:function(a){this._dd=new jive.StatusInput.StatusInputDropDown(this._container,a)},_initDataHandlers:function(){var a=this;this.addListener("searchDataObtained",function(b){a._dd.renderSearchData(b)})},_initDDHandlers:function(){var a=this;this._dd.addListener("interactionFinished",function(c,e,d){if(c!=null){e=e||"";var b=$j.extend({"data-jive-statusInputAdd":"true",href:c.href,"data-jive-statusInputInteral":"true"},d);if(c.id){b.jiveID=c.id}a._selection.replaceWordAtRange(c.value,e,{tag:"a",attrs:b})}a._dd.hide();a._focus(true)})},getContainer:function(){return this._container},getSubmitVals:function(){this._truncateNodes();var a=this._container.html();a=a.replace(/<\/?br[^>]*>/gi,"");a=a.replace(/(<\/?)(\w+)([^>]*>)/gi,function(e,d,c,b){return d+c.toLowerCase()+b.replace(/((data-jive-statusInputAdd)|(data-jive-truncation-flag))=["']true["']/gi,"")});a=a.replace(/(<\/?[aA]\s+[^>]*href=")([^"]*)("[^>]*>)/gi,function(f,e,d,c){if(f.search(/<\w+[^>]*data-jive-statusinputinteral="true"[^>]*>/gi)!=-1){var b=d.replace(/https?\:\/\//,"").split("/").slice(1).join("/");return e+"/"+b+c}else{return f}});return a},_truncateNodes:function(){if(this.getCharCount()>this._maxCharCount){var g=this._container[0].childNodes;var f=0;var e=false;for(var c=0;c<g.length;c++){var b=g[c];if(e){this._container[0].removeChild(b)}else{var a=$j(b).text().length;if(f+a>this._maxCharCount){var d=this._maxCharCount-f;this._truncateNode(b,d);e=true}f+=a}}}},_truncateNode:function(c,a){if(c.nodeType==3){var d=c.nodeValue;if(d.length<a){return a-d.length}else{c.nodeValue=c.nodeValue.substr(0,a);return 0}}else{var e=c.childNodes;for(var b=0;b<e.length;b++){if(a==0){c.removeChild(e[b])}else{a=this._truncateNode(e[b],a)}}}},truncateAnchors:function(){$j(this._container).find("[data-jive-statusinputadd=true]:not([data-jive-truncation-flag=true],[data-jive-statusinputinteral=true])").each(function(){var a=$j(this);a.contents().filter(function(){return this.nodeType==3}).each(function(){var b=$j(this);b.replaceWith(document.createTextNode(jive.util.truncateStr(b.text())))});a.attr("data-jive-truncation-flag",true)})},sanitizeHTML:function(){var g=this._container.html();if(this._previousSanitizedHTML==g){return}var f=this._container[0].lastChild;if(!$j.browser.msie&&(f==null||f.nodeType==3||f.tagName.toLowerCase()!="br")){var c=document.createElement("br");c.setAttribute("_moz_dirty","");this._container[0].appendChild(c)}else{this._container.children("p").each(function(){$j(this).children().unwrap()})}this.truncateAnchors();var a="[data-jive-statusInputAdd!=true]";if(!$j.browser.msie){g=g.replace(/<\/?br[^>]*>$/mi,"");a+=":not(:last)"}var e=this;this._container.find("a[data-jive-statusinputadd=true]").filter(function(){return $j(this).text()==""}).each(function(){var h=e._selection.getRangeStartContainer();var k=$j(this);if($j(h).parents(k).length>0){var j=k.parent().contents(":not(br)");var m=j.index(k);var l;var i=0;if(m>0){l=j[m-1];i=$j(l).text().length}else{if(m<j.length-1){l=j[m+1]}}if(!l&&k.parent()[0]!==e._container[0]){l=k.parent()[0]}if(l){e._selection.moveToNodeAndCollapse(l,true,i)}}k.remove()});var b=this._container.children(a);if(b.length>0){var d;b.each(function(h){var i=document.createTextNode($j(this).text());e._container[0].replaceChild(i,this);d=i});this._selection.moveToNodeAndCollapse(d,true,d.nodeValue.length)}this._previousPasteVal=this._container.text();this._previousSanitizedHTML=this._container.html()},resetText:function(){this._setText("");this._replacedInitialText=false;this.emit("characterLenMsg","ok")},handleAtMentionButtonClick:function(){this._replacedInitialText=true;var a=this._selection==null?null:this._selection.getRangeStartContainer();if(this._selection==null||$j(a).parents("#"+this._container.attr("id")).length==0||this._container.contents().length==0){this._createNewSelectionUtil()}else{this._selection.alignRangeWithNearestTextNode(a)}},getCharCount:function(){return this._container.text().length},_setText:function(a){this._container.html(a)},_focus:function(b){if(!$j.browser.webkit){this._container.focus()}var a=this._selection==null?null:this._selection.getRangeStartContainer();if(this._selection==null||$j(a).parents("#"+this._container.attr("id")).length==0){this._createNewSelectionUtil()}else{if(b){this._selection.moveToNodeAndCollapse(a,true,1)}else{this._selection.makeRangeTheSelection()}}},_createNewSelectionUtil:function(){var a=false;if($j.browser.msie){if(this._container.contents().length==0){this._selection=null;return}}else{a=this._container[0].lastChild.tagName.toLowerCase()=="br"}this._selection=new jive.Selection(this._container[0].lastChild,a)},_getTokens:function(){return jive.StatusInput.StatusInput.Tokens},_getPatterns:function(){return jive.StatusInput.StatusInput.Patterns},_isMatch:function(b,a){return a.search(new RegExp(this._getPatterns()[b],"gi"))>-1},_matchUtil:function(b,a){return a.match(new RegExp(this._getPatterns()[b],"gi"))},_processToken:function(){var a=this._selection.getWordAtRange();if(a===""){this._processCompleteToken()}else{this._processPartialToken(a,this._selection.getRangeStartContainer())}},_processCompleteToken:function(){var a=this._tokenCallbacks||[];a.forEach(function(b){b()});if(a.length<1){this._dd.hide()}this._tokenCallbacks=[]},_processPartialToken:function(f,d){var c=[],e=this._getTokens(),a=false,b=this;Object.keys(e).forEach(function(g){var h=e[g],i=f.match(h.regExp);if(i){a=true;i.push(d);if(h.complete){c.push(function(){h.complete.apply(b,i)})}if(h.keypress){h.keypress.apply(b,i)}}});if(!a){this._dd.hide()}this._tokenCallbacks=c},_obtainData:function(b,c,a){if(jive.StatusInput.StatusInput.dataCache[b]==undefined){var d=this;$j.ajax({url:b,dataType:"json",success:function(e){jive.StatusInput.StatusInput.dataCache[b]=e;d.emit(c,e,a)},error:function(e){d.emit("dataError",e.responseText,a)}})}else{this.emit(c,jive.StatusInput.StatusInput.dataCache[b],a)}},_obtainSearchData:function(a){this._obtainData(jive.rest.url("/emention/search/")+encodeURI(a)+"*","searchDataObtained",{queryVal:a})}});jive.StatusInput.StatusInput.dataCache={};jive.StatusInput.StatusInput.instances={};$j(document).asyncReady(function(){window.setInterval(function(){jive.StatusInput.StatusInput.dataCache={}},300000);window.setInterval(jive.StatusInput.StatusInput.sanitizeHTMLInteravalHandler,500)});jive.StatusInput.StatusInput.sanitizeHTMLInteravalHandler=function(){for(var a in jive.StatusInput.StatusInput.instances){jive.StatusInput.StatusInput.instances[a].sanitizeHTML()}};jive.StatusInput.StatusInput.getRegExpsFromPatterns=function(a){var b={};Object.keys(a).forEach(function(c){var d=a[c],e;if($j.isArray(d)){e=d.map(function(f){return"("+f+")"}).join("|")}else{e=d}b[c]=new RegExp(e)});return b};jive.StatusInput.StatusInput.Patterns={mention:"@([^@ ]+)?"};jive.StatusInput.StatusInput.Tokens={mention:{regExp:new RegExp(jive.StatusInput.StatusInput.Patterns.mention,"i"),keypress:function(b,a){if(a){this._obtainSearchData(a)}else{}}}};jive.observable(jive.StatusInput.StatusInput.prototype);jive.StatusInput.renderAttachmentsWrapper=function(c,a,d,b){if(b==null){b=jive.Wall.Main.i18n}a.append(jive.StatusInput.soy.renderAttachments($j.extend(c,{removable:d,i18n:b})));if(d){a.slideDown("fast",function(){$j(this).animate({opacity:1},500)})}else{a.css("opacity","1").show()}jive.StatusInput.bindAttachment(a.find("ul.j-attached-items"),d)};jive.StatusInput.renderAttachmentWrapper=function(c,a,d,b){if(b==null){b=jive.Wall.Main.i18n}a.append(jive.StatusInput.soy.renderAttachment($j.extend(c,{removable:d,i18n:b})))};jive.StatusInput.bindAttachment=function(b,d){var a=0,c;b.find("li:visible").each(function(){a+=$j(this).outerWidth()});b.css("width",a+"px").data("innerWidth",a);c=b.width()-b.closest(".j-attachment-container").width();if(c>0&&d){b.animate({left:(c*-1-40)},300)}b.find("li a.j-attach-anchor").unbind("hover").hover(function(){$j(this).find(".j-icon-play").stop().fadeTo("fast",0.6)},function(){$j(this).find(".j-icon-play").stop().fadeOut("fast")});b.parent().find(".j-attachment-arrow").unbind().mousedown(function(){try{var g;var i=$j(this).outerWidth()*2;c=b.width()-b.closest(".j-attachment-container").width();var f=parseInt(b.css("left"));if(isNaN(f)){f=0}if($j(this).hasClass("j-attachment-arrow-right")&&c>0){g=f+(c+i);b.stop().animate({left:(-c-i)},g*5,"linear")}else{if(c>0){g=f*-1;b.stop().animate({left:0},g*5,"linear")}}}catch(h){console.log(h)}}).mouseup(function(){b.stop();return false}).click(function(){return false});if(!d){jive.StatusInput.sizeContainer(b.parent().parent())}else{jive.StatusInput.showArrows()}};$j(window).resize((function(){var a;return function(){var b=$j(window).width();if(a&&b!==a){jive.StatusInput.sizeContainer()}a=b}})());jive.StatusInput.sizeContainer=function(b){var a;b=b||$j(document);b.find(".j-attachment-container:visible:has(.j-attached-items)").hide().each(function(){var c=$j(this),d=c.closest(".jive-table-cell-activity"),f=c.closest(".j-wall-repost-content"),g=c.parent(),e;if(d.length>0){e=d.width()}else{if(f.length>0){e=f.width()}else{if(c.closest(".j-wall-form").length>0){e=0}else{e=g.width()}}}a=c.find(".j-attached-items").data("innerWidth")||Number.POSITIVE_INFINITY;if(e>0){$j(this).width(Math.min(e,a)).show()}else{c.show()}});jive.StatusInput.showArrows(b)};jive.StatusInput.showArrows=function(a){a=a||$j(document);a.find(".j-attached-items:visible").each(function(){var c=$j(this),b=c.parent();if(b.innerWidth()<c.innerWidth()){b.find(".j-attachment-arrow").css("display","block");c.css("margin","0 20px")}else{b.find(".j-attachment-arrow").hide();c.css({margin:"0",left:0})}})}};
;
jive.namespace("StatusInput");if(!jive.StatusInput.StatusInputDropDown){jive.StatusInput.StatusInputDropDown=$Class.extend({init:function(b,a){this._$statusInputContainer=$j(b);this._i18n=a.i18n;this._dd=null;this._data={search:null,friends:null,history:null};this._statusInputIdPostfix=a.statusInputIdPostfix},_getCollectionFromData:function(a){return a.mentionCollection},_getCollectionEntriesFromData:function(a){return a.mentionCollection.entries},_makeSelection:function(e,f,b){var a=this._getDataItemIndex(e),d=e.html(),c=e.attr("href");this.emit("interactionFinished",$j.extend({index:a,value:d,href:c},this._getCollectionEntriesFromData(f)[a]))},_renderData:function(d,f,m,o){o=o||{};var i=o.fnHandleRender;var j=o.renderIfDataIsNull||false;var a=o.fnHandleRenderNoData;var l=o.selectionPrefix;var c=o.extraTemplateData||{};if(typeof this._getCollectionFromData(d)=="object"||j){var k=this._data[f]=d;var g=this._getCollectionEntriesFromData(k)||{};var h=this;var e=m.call(this,$j.extend({i18n:h._i18n,entries:g},c));var n=$j(".j-js-autocomplete");if(n.length>0){n.remove()}$j(document.body).append(e);this._dd=$j(".j-js-autocomplete");var b=this._$statusInputContainer.offset();this._dd.css("top",(b.top+this._$statusInputContainer.parent().height())+"px");this._dd.css("left",b.left+"px");this._dd.bind("keyup mouseup",function(p){p.stopPropagation()});this._dd.bind("keydown",function(p){p.stopPropagation();switch(p.keyCode){case 27:h.emit("interactionFinished");break;case 38:h.selectItem(h._getSelectItemIndex()-1);p.stopImmediatePropagation();return false;break;case 40:h.selectItem(h._getSelectItemIndex()+1);p.stopImmediatePropagation();return false;break;case 13:break;default:break}});this._dd.find(".j-autocomplete-results a").click(function(){h._makeSelection($j(this),k,l);return false});if(i!=null){i()}this.show()}else{this.dataRef=null;if(a!=null){a()}else{this.hide()}}},renderSearchData:function(a){this._renderData(a,"search",jive.StatusInput.soy.ddSearch)},hide:function(){if(this._dd!=null){this._dd.hide()}},show:function(){if(this._dd!=null){this._dd.slideDown("fast")}},isVisible:function(){return this._dd!=null&&$j(".j-js-autocomplete").length>0},selectItem:function(a){if(this._dd==null){return}var b=this._getSelectItems();if(a<0||a>=b.length){return}this.deselectItem();this._selectItemHelper(b[a],true)},deselectItem:function(b){var c=this._getSelectItems();if(b!=null&&(b<0||b>=c.length)){return}var a=b==null?this._getSelectedItem():c[b];if(a.length==0){return}this._selectItemHelper(a);this._selectedIndex=-1},_getSelectItems:function(){return this._dd.find("."+jive.StatusInput.StatusInputDropDown.selectableItemClassName)},_getSelectedItem:function(){return this._dd.find("."+jive.StatusInput.StatusInputDropDown.selectedItemClassName)},_getSelectItemIndex:function(a){a=a||this._getSelectedItem()[0];return this._getSelectItems().index(a)},_getDataItemIndex:function(a){return this._dd.find(".j-autocomplete-results a").index(a)},_selectItemHelper:function(item,isSelect){if(!(item instanceof jQuery)){item=$j(item)}with(jive.StatusInput.StatusInputDropDown){if(isSelect){item.addClass(selectedItemClassName).addClass("j-selected").focus()}else{item.removeClass(selectedItemClassName).removeClass("j-selected").blur()}}}});jive.StatusInput.StatusInputDropDown.selectedItemClassName="jive-js-status-input-selected";jive.StatusInput.StatusInputDropDown.selectableItemClassName="jive-js-status-input-selectable";jive.observable(jive.StatusInput.StatusInputDropDown.prototype)};
;
jive.namespace("MicroBlogging");if(!jive.MicroBlogging.StatusInputs){jive.MicroBlogging.StatusInputs=jive.StatusInput.StatusInputs.extend({_docReadyInit:function(a){var b=this;this._container.find(".jive-js-statusinput").each(function(){var c=$j(this).attr("id");b.statusInputs[c]=new jive.MicroBlogging.StatusInput($j(this),$j.extend({maxCharCount:jive.MicroBlogging.StatusInput.maxCharCount},a));b._addInstanceToInstanceObj(c)})}});jive.MicroBlogging.StatusInput=jive.StatusInput.StatusInput.extend({init:function(a,b){this._super(a,b);this._focusOnRdy=b.focusOnRdy;this._allowTagCreation=b.allowTagCreation==undefined?true:b.allowTagCreation;var d=this;var e=0;function c(){if(e==0){e=$j(d._container).height();e=e>30?30:e}}this._container.bind("focus",function(f){c();d._container.prev(".jive-js-statusinput-default").hide();d._container.animate({minHeight:e*2.3},150);d.emit("focus")});this._container.prev().click(function(){d._container.focus()});if(jive.MicroBlogging.StatusInput.focusedIDs&&jive.MicroBlogging.StatusInput.focusedIDs[this._container.attr("id")]){window.setTimeout(function(){d._container.trigger("focus")},1)}},triggerOnFocusAnimation:function(){if(this._focusOnRdy){this._container.trigger("focus")}},_initDD:function(a){this._dd=new jive.MicroBlogging.StatusInputDropDown(this._container,a)},_initDataHandlers:function(){this._super();var a=this;this.addListener("friendsDataObtained",function(c,b){a._dd.renderFriendsData(c);if(b.selectItemOnLoad){a._dd.selectItem(0)}});this.addListener("historyDataObtained",function(c,b){a._dd.renderHistoryData(c);if(b.selectItemOnLoad){a._dd.selectItem(0)}});this.addListener("tagsDataObtained",function(c,b){a._dd.renderTagsData(c,b.queryVal)})},_initDDHandlers:function(){this._super();var a=this;this._dd.addListener("friendsLinkClicked",function(){a._obtainFriendsData(true)});this._dd.addListener("historyLinkClicked",function(){a._obtainHistoryData(true)})},_getTokens:function(){return jive.MicroBlogging.StatusInput.Tokens},_getPatterns:function(){return jive.MicroBlogging.StatusInput.Patterns},_obtainFriendsData:function(a){this._obtainData(jive.rest.url("/emention/friends"),"friendsDataObtained",{selectItemOnLoad:a})},_obtainHistoryData:function(a){this._obtainData(jive.rest.url("/emention/history"),"historyDataObtained",{selectItemOnLoad:a})},_obtainTagsData:function(a){this._obtainData(jive.rest.url("/tags/search/"+encodeURI(a)+"*"),"tagsDataObtained",{queryVal:a})},handleAtMentionButtonClick:function(){this._super();if(this._selection==null){this._container.append(document.createTextNode("@"));this._selection=new jive.Selection(this._container[0].lastChild,false,1)}else{var e=this._selection.getRangeStartContainer();var b=this._selection.getRangeStartOffset();var f=e.nodeValue;var d="";if(f!=null){if(f.substring(b-1,b).search(/\S/)>-1){d+=" "}d+="@";if(f.substring(b,b+1).search(/\S/)>-1){d+=" "}}else{d="@"}var c=document.createTextNode(d);var a=Math.min(d.length,2);if(!$j.browser.msie&&e.tagName&&e.tagName.toLowerCase()=="br"){$j(c).insertBefore(e);this._selection.moveToNodeAndCollapse(c,true,a)}else{this._selection.insertNodeAtRange(c,a)}if($j.browser.mozilla){this._container.focus()}}this._obtainFriendsData()},swapLinkFor:function(a,c){function b(g,e,f){if(g.nodeType==3){var d=null;var k=g.nodeValue;if(k.indexOf(e)<0){return}if(k.indexOf(e)==0){g.nodeValue=k.substring(e.length);g.parentNode.insertBefore($j(c)[0],g);d=g}else{if(k.indexOf(e)==(k.length-e.length)){g.nodeValue=k.substring(0,k.indexOf(e));g.parentNode.insertBefore($j(c)[0],g);g.parentNode.insertBefore(g,g.previousSibling);d=$j(c)[0]}else{var l=k.substring(0,k.indexOf(e));var m=k.substring(k.indexOf(e)+e.length);g.nodeValue=m;g.parentNode.insertBefore(document.createTextNode(l),g);g.parentNode.insertBefore($j(c)[0],g);d=g}}if(d.nodeType==3&&d.nodeValue.length>1){var j=document.createTextNode(d.nodeValue.substring(1));d.nodeValue=d.nodeValue.substring(0,1);g.parentNode.insertBefore(j,d);g.parentNode.insertBefore(d,j)}jive.Selection.moveCursorAfter(d)}if(g.nodeType==1){if(g.nodeName.toLowerCase()=="a"){return}else{for(var h=0;h<g.childNodes.length;h++){b(g.childNodes[h],e,f)}}}}b(this._container[0],a,c)}});(function(a){var b={mention:"@([^@ ]+)?",tags:"#([^# ]+)?",youtubeURL:"https?\\://(?:[\\w\\-]+\\.)?youtube\\.com/watch\\S*[&?]v=([^&\\s]+)\\S*",imageURL:"https?\\://\\S+(\\.png|\\.jpg|\\.gif|\\.jpeg)",linkURL:"https?\\://\\S+"};a.Patterns=b;a.Tokens={mention:{regExp:new RegExp(b.mention,"i"),keypress:function(d,c){if(c){this._obtainSearchData(c)}else{this._obtainFriendsData()}}},tags:{regExp:new RegExp(b.tags,"i"),keypress:function(d,c){if(c){this._obtainTagsData(c)}else{this._dd.renderTagsData()}}},youtubeURL:{regExp:new RegExp(b.youtubeURL,"i"),keypress:function(c,d){this.emit("youtubeURLMatch",c);this.emit("linkURLMatch",c);this._dd.hide()}},imageURL:{regExp:new RegExp(b.imageURL,"i"),keypress:function(d,f,e){if(!$j(e).parent().attr("data-jive-statusinputImageURL")){this.emit("imageURLMatch",d);var c={href:d};c["data-jive-statusinputadd"]=true;c["data-jive-statusinputImageURL"]=true;this._selection.replaceWordAtRange(d,null,{tag:"a",attrs:c});this._focus(true)}this._dd.hide()}},linkURL:{regExp:new RegExp(b.linkURL,"i"),complete:function(c,d){if(!$j(d).parent().attr("data-jive-statusinputImageURL")){this.emit("linkURLMatch",c)}this._dd.hide()}}}})(jive.MicroBlogging.StatusInput);jive.MicroBlogging.StatusInput.setupLiveFocusHandler=function(a){$j("#"+a).live("focus",jive.MicroBlogging.StatusInput.initialFocusHandler)};jive.MicroBlogging.StatusInput.initialFocusHandler=function(a){if(!jive.MicroBlogging.StatusInput.focusedIDs){jive.MicroBlogging.StatusInput.focusedIDs={}}jive.MicroBlogging.StatusInput.focusedIDs[$j(this).attr("id")]=true;$j("#"+$j(this).attr("id")).die("focus",jive.MicroBlogging.StatusInput.initialFocusHandler)}};
;
jive.namespace("MicroBlogging");if(!jive.MicroBlogging.StatusInputDropDown){jive.MicroBlogging.StatusInputDropDown=jive.StatusInput.StatusInputDropDown.extend({init:function(b,a){this._super(b,a);this._allowTagCreation=a.allowTagCreation==undefined?true:a.allowTagCreation},renderFriendsData:function(b){var a=this;this._renderData(b,"friends",jive.StatusInput.soy.ddFriends,{fnHandleRender:function(){a._renderFriedsDataHelper()},renderIfDataIsNull:true})},_renderFriedsDataHelper:function(){var a=this;this._dd.find(".jive-js-history").click(function(b){a.emit("historyLinkClicked");b.stopPropagation()})},renderHistoryData:function(b){var a=this;this._renderData(b,"history",jive.StatusInput.soy.ddHistory,{fnHandleRender:function(){a._renderHistoryDataHelper()},renderIfDataIsNull:true})},_renderHistoryDataHelper:function(){var a=this;this._dd.find(".jive-js-friends").click(function(b){a.emit("friendsLinkClicked");b.stopPropagation()})},renderTagsData:function(a,b){if(this._allowTagCreation||b==null||a!=null&&a.tagSearchResult.length>0){this._renderData(this._normalizeTagsData(a),"tags",jive.StatusInput.soy.ddTags,{renderIfDataIsNull:true,selectionPrefix:"#",extraTemplateData:{currentTagText:b,allowTagCreation:this._allowTagCreation}})}else{this.hide()}},_normalizeTagsData:function(c){var d={mentionCollection:""};if(c!=null&&c.tagSearchResult){for(var b=0;b<c.tagSearchResult.length;b++){var a=c.tagSearchResult[b];if(a.found){if(d.mentionCollection==""){d.mentionCollection={};d.mentionCollection.entries=new Array()}d.mentionCollection.entries.push({html:'<a  class="jive-js-status-input-selectable" href="'+_jive_base_url+"/tags?tags="+encodeURI(a.name)+'"><span class="jive-icon-med jive-icon-tag"></span>'+a.name+"</a>",id:a.name})}}}return d},_makeSelection:function(c,d,b){if(c.hasClass("jive-js-status-input-create")){var e=c.attr("data-id");var a={newtag:1};this.emit("interactionFinished",{index:-1,value:'<span class="jive-icon-med jive-icon-tag"></span>'+e,href:_jive_base_url+"/tags?tags="+e,html:c.html()},null,a)}else{this._super(c,d,b)}}})};
;
jive.namespace("Wall");if(!jive.Wall.Main){jive.Wall.Main=$Class.extend({init:function(a){var b=this;this._meta=a.meta||[];this._i18n=a.i18n;this.statusInputID="message-"+a.statusInputIdPostfix;this._statusInputIdPostfix=a.statusInputIdPostfix;this._submitBtnID=a.submitBtnID||".j-submit-mb";this._initEditorView(a);this._initStatusInput(a);this._initWallSource(a);this._wallStatusInputs.addListener("ready",function(){b._setupStatusInputObservableHandlers();b._setupEditorViewObservableHandlers();b._setupMetaBtns(a);b._wireUpAtMentionBtn(a);b._wallEntry=null;var c=[];b._meta.forEach(function(d){b.initMeta(d,c,a,b._wallEditorView.getContainer(),function(e){b._getEntry(e)})});b._wallStatusInputs.getStatusInput(b.statusInputID).triggerOnFocusAnimation()})},displayInfo:function(a){this._wallEditorView.entryPublishedInfo(a)},displayWarn:function(a){this._wallEditorView.entryPublishedWarn(a)},displayError:function(a){this._wallEditorView.entryPublishedError(a)},_initEditorView:function(a){this._wallEditorView=new jive.Wall.EditorView(a.editorContainer,$j.extend({notificationContainer:$j(a.editorContainer).parent()},a))},_setupEditorViewObservableHandlers:function(){var a=this;var c=function(d){a._wallEditorView.enableForm();if(d.status=="AWAITING_MODERATION"){a.displayWarn(a._i18n.formPostedModeration)}else{a._wallEditorView.entryPublished(d)}a._wallStatusInputs.resetText(a.statusInputID);a.emit("reset");a._wallEntry=null};var b=function(d){a._wallEditorView.enableForm();a.displayError(d)};this._wallEditorView.addListener("submit",function(){var d={message:a._wallStatusInputs.getSubmitVals(a.statusInputID)};if(a._wallEntry){$j.extend(true,a._wallEntry,d)}else{a._wallEntry=d}a._wallSource.publish(a._wallEntry,c,b)})},_initStatusInput:function(a){this._wallStatusInputs=new jive.MicroBlogging.StatusInputs("#statusInputs-"+a.statusInputIdPostfix,{idPostfix:a.statusInputIdPostfix,focusOnRdy:a.focusOnRdy,i18n:a.i18n})},_setupStatusInputObservableHandlers:function(){var c=this;this._wallStatusInputs.getStatusInput(this.statusInputID).addListener("imageURLMatch",function(d){c.emit("imageURLMatch",d)}).addListener("youtubeURLMatch",function(d){c.emit("youtubeURLMatch",d)}).addListener("linkURLMatch",function(d){c.emit("linkURLMatch",d,function(e){c._wallStatusInputs.getStatusInput(c.statusInputID).swapLinkFor(d,e)})}).addListener("characterLenMsg",function(d,e){c._wallEditorView.handleCharacterLenMsg(d,e)}).addListener("dataError",function(d){c.displayError()});var b=this._wallEditorView.getContainer().find(".j-attach-action-container");var a=this._wallEditorView.getContainer().find(this._submitBtnID);this._wallStatusInputs.getStatusInput(this.statusInputID).addListener("focus",function(){if(b.is(":hidden")){a.css({opacity:0}).show().animate({opacity:1});if(($j.browser.msie&&$j.browser.version<7)){b.show()}else{b.css({opacity:0,height:1}).show().animate({height:"24px"},200,"linear",function(){$j(this).animate({opacity:1},300,"linear");$j(this).css("height","auto")})}b.parent(".j-wall-form").next(".j-mb-last-update").addClass(".j-mb-last-update-active")}})},_setupMetaBtns:function(a){var b=$j("#"+a.domContainerId);b.find(".j-wall-meta-image").hover(function(){$j(this).parent().find(".j-upload-image-help").css("display","inline-block")},function(){$j(this).parent().find(".j-upload-image-help").hide()});b.find(".j-wall-meta-reference").hover(function(){$j(this).parent().find(".j-reference-help").css("display","inline-block")},function(){$j(this).parent().find(".j-reference-help").hide()})},_initWallSource:function(a){this._wallSource=new jive.Wall.WallSource(a)},_wireUpAtMentionBtn:function(a){var b=this;$j("#"+a.domContainerId).find(".jive-js-wall-mention-button").click(function(c){b._wallStatusInputs.getStatusInput(b.statusInputID).handleAtMentionButtonClick();c.stopPropagation()})},_getEntry:function(c){if(this._wallEntry!=null&&this._wallEntry.objectType&&this._wallEntry.objectId){c(this._wallEntry)}else{var a=this;var b=function(d){a._wallEntry=d;c(a._wallEntry)};this._wallSource.createDraft(b)}}});jive.Wall.Main.prototype.initMeta=function initMeta(h,b,k,g,d){var c=new h.view(h.id,h.container,g,k,h.viewType);var e=new h.service(k);b.push(c);var i=e instanceof jive.Wall.VideoLinkMetaSource;var a=c instanceof jive.Wall.ImageMetaView&&!i;var j=e instanceof jive.Wall.LinkMetaSource;var f=this;if(typeof this.notificationView=="undefined"){this.notificationView=new jive.shared.NotificationView(g,{info:".jive-info-box:first",warn:".jive-warn-box:first",error:".jive-error-box:first"})}if(j){this.addListener("linkURLMatch",function(m,l){e.create(h,m,l)})}else{if(a){this.addListener("imageURLMatch",function(n){var o=c.getDataForURLImage(n);var p=function(q,s,r){c.error(q,s,r)};var m=function(q){c.add(q,n)};var l=function(q){e.create(q,o,m,p,true)};c.add([]);c.formSubmitted();d(l)}).addListener("reset",function(){c.reset()})}else{if(i){this.addListener("youtubeURLMatch",function(n){var o={videoURL:n};var p=function(q,s,r){c.error(q,s,r)};var m=function(q){c.add(q,n)};var l=function(q){e.create(q,o,m,p,true)};c.formSubmitted();d(l)})}}}c.addListener("removeImage",function(l){e.remove(l);c.remove(l)});c.addListener("activated",function(){for(var l=0;l<b.length;l++){if(b[l]!==c){b[l].hide()}}c.show()}).addListener("deactivated",function(){c.hide()});c.addListener("error",function(l){f.notificationView.error(l)}).addListener("warn",function(l){f.notificationView.warn(l)}).addListener("info",function(l){f.notificationView.info(l)});if(!i){c.addListener("completed",function(o){var m=function(p,r,q){c.error(p,r,q)};var n=function(p){c.add(p)};var l=function(p){e.create(p,o,n,m)};c.formSubmitted();d(l)})}};jive.observable(jive.Wall.Main.prototype);jive.Wall.Main.ATTACHMENT_TYPE_IMAGE="111";jive.Wall.Main.ATTACHMENT_TYPE_VIDEO="801";jive.Wall.Main.COMMENT_TYPE="105";jive.Wall.Main.bindComments=function(b,a){var c=b+a.canComment+a.canCreateImage;if(!arguments.callee[c]){$j(".j-view-comments:not(.j-disabled)").live("click",function(){var d=$j(this).closest("td").find(".j-inline-comment-wrapper");var e=d.find(".jive-comment-container").attr("statusid");if(d.find(".comment-form").length<1){d.find("ul").append(jive.Wall.soy.commentForm({statusID:e,user:_jive_current_user,canComment:a.canComment,canCreateImage:a.canCreateImage,i18n:a.i18n}));jive.Wall.CommentHelper.initComment(e,{i18n:jive.Wall.Main.i18n,wallEntryTypeID:b})}if(($j.browser.msie&&$j.browser.version<7)){d.show()}else{d.slideToggle(300)}return false});arguments.callee[c]=true}};jive.Wall.Main.bindRepostAndComments=function(b,a){if(!arguments.callee[b+a]){$j(".j-comment-submit").live("click",function(){jive.Wall.CommentHelper.submitComment(this,b,a)});$j(".j-comment-delete").live("click",function(){jive.Wall.CommentHelper.destroyComment($j(this).attr("commentid"));return false});$j(".j-repost-submit").live("click",function(){jive.Wall.RepostHelper.submitRepost($j(this).attr("statusid"))});arguments.callee[b+a]=true}};jive.Wall.Main.bindRowHover=function(){if(!arguments.callee.alreadyCalled){$j(".jive-table-activity tr").live("mouseenter",function(){$j(this).find(".jive-activity-action a").removeClass("font-color-meta-light");$j(this).find(".jive-activity-action .jive-icon-comment-grey").removeClass("jive-icon-comment-grey").addClass("jive-icon-comment");$j(this).find(".jive-icon-like-grey").removeClass("jive-icon-like-grey").addClass("jive-icon-like");$j(this).find(".jive-icon-permalink").removeClass("jive-icon-permalink").addClass("jive-icon-permalink-active")}).live("mouseleave",function(){$j(this).find(".jive-activity-action a").addClass("font-color-meta-light");$j(this).find(".jive-activity-action .jive-icon-comment").removeClass("jive-icon-comment").addClass("jive-icon-comment-grey");$j(this).find(".jive-icon-like").removeClass("jive-icon-like").addClass("jive-icon-like-grey");$j(this).find(".jive-icon-permalink-active").removeClass("jive-icon-permalink-active").addClass("jive-icon-permalink")});$j(".jive-icon-permalink, .jive-icon-permalink-active").live("mouseenter",function(){$j(this).addClass("jive-icon-permalink-hover")}).live("mouseleave",function(){$j(this).removeClass("jive-icon-permalink-hover")});arguments.callee.alreadyCalled=true}}};
;
jive.namespace("Wall.Util");jive.Wall.Util.focusHelper=function(){$j("#j-ub-new-wallentry").click();var a=window.setInterval(function(){var b=$j("#jive-quickstatuscreate-form .jive-js-statusinput");if(b.length!=0){b.last().focus();window.clearInterval(a)}},500);return false};
;
jive.namespace("Wall");if(!jive.Wall.MetaView){jive.Wall.MetaView=$Class.extend({init:function(f,a,e,b,c){this._type=c||jive.Wall.MetaView.TYPE_STATUS;this._$anchor=e.find("."+f);this._$container=e.find("."+a);var d=this;this._$anchor.click(function(){var g=d.isVisible()?"deactivated":"activated";d.emit(g);return false})},show:function(){this._$container.show();this._$anchor.removeClass("j-deselected").addClass("j-selected").siblings(".j-button").removeClass("j-selected").addClass("j-deselected");if(this._$anchor.is(":first-child")){this._$container.css({"-moz-border-radius-topleft":"0","-webkit-border-top-left-radius":"0"})}else{this._$container.css({"-moz-border-radius-topleft":"4px","-webkit-border-top-left-radius":"4px"})}},hide:function(){this._$container.hide();if(this._$anchor.hasClass("j-selected")){this._$anchor.add(this._$anchor.siblings(".j-button")).removeClass("j-deselected").removeClass("j-selected")}},isVisible:function(){return this._$container.is(":visible")},error:function(){console.log("META_VIEW error")}});jive.observable(jive.Wall.MetaView.prototype);jive.Wall.MetaView.TYPE_STATUS=1;jive.Wall.MetaView.TYPE_STATUS_COMMENT=2;jive.Wall.MetaView.TYPE_STATUS_REPOST=3};
;
jive.namespace("Wall");if(!jive.Wall.EditorView){jive.Wall.EditorView=function(a,b){var e=this;var g=$j(a);var d=new jive.shared.NotificationView(b.notificationContainer,{info:".jive-info-box:first",warn:".jive-warn-box:first",error:".jive-error-box:first"});var f=new jive.shared.FormWaitingView(g,{i18n:b.i18n,containerPadding:0});this.getContainer=function(){return g};this.entryPublished=function(h){this.dismissStatusSuccess();var j=g.parent();var i=g.closest("div.jive-userbar-slidedown-status");if(i.length>0){i.find("div.j-wall-form").children().fadeOut().hide();i.find("div#jive-choose-form-links").fadeOut().hide();j=i.find("div.j-wall-form-container")}j.append(jive.Wall.soy.renderStatusSuccess({i18n:b.i18n,entry:h}));j.find(".j-success-post-dismiss").click(function(){e.dismissStatusSuccess()});j.find(".j-mb-last-update").hide();j.find(".j-successful-post").css("opacity","0").slideDown(500,function(){$j(this).animate({opacity:1},200);if(h.meta.length>0){$j(this).find(".jive-js-image-container").show().animate({opacity:1},500)}})};this.dismissStatusSuccess=function(){var h=g.parent().find(".j-successful-post");if(h.length>0){h.slideUp(null,function(){$j(this).remove()});var i=g.closest("div.jive-userbar-slidedown-status");if(i.length>0){i.slideUp()}}};this.entryPublishedRepost=function(j,i,k){this.dismissStatusSuccess();var h=j.find(".jive-modal-content");if(h.length>0){h.empty();h.append(jive.Wall.soy.renderStatusSuccess({i18n:b.i18n,entry:i}));h.find(".j-success-post-dismiss").click(function(){e.dismissStatusSuccessRepost(k)});h.find(".j-successful-post").css("opacity","0").slideDown(500,function(){$j(this).animate({opacity:1},200);if(i.meta.length>0){$j(this).find(".jive-js-image-container").show().animate({opacity:1},500)}})}};this.dismissStatusSuccessRepost=function(i){var h=g.find(".j-successful-post");if(h.length>0){h.slideUp(null,function(){$j(this).remove()})}i()};this.entryPublishedInfo=function(h){d.info(h)};this.entryPublishedWarn=function(h){d.warn(h)};this.entryPublishedError=function(h){d.error(h||b.i18n.formPostedError)};g.find("form.wall-form").find(":button").click(function(){e.emit("submit");e.disableForm()});function c(h,i){jive.Wall.EditorView.handleCharacterLenMsg(h,i,g)}this.handleCharacterLenMsg=c;this.disableForm=function(){f.disableForm()};this.enableForm=function(){f.enableForm()}};jive.observable(jive.Wall.EditorView.prototype);jive.Wall.EditorView.handleCharacterLenMsg=function(b,e,d){if(b=="error"){d.find(".j-wall-warn").hide();var c=null;if(e.charOver==1){d.find(".j-wall-error-over-many").hide();c=d.find(".j-wall-error-over-one")}else{d.find(".j-wall-error-over-one").hide();c=d.find(".j-wall-error-over-many")}c.find(".j-number-over").html(e.charOver);c.show()}else{if(b=="warning"){d.find(".j-wall-error-over-one").hide();d.find(".j-wall-error-over-many").hide();var a=d.find(".j-wall-warn");a.find(".j-number-left").html(e.charLeft);a.show()}else{if(b=="ok"){d.find(".j-wall-error-over-one").hide();d.find(".j-wall-error-over-many").hide();d.find(".j-wall-warn").hide()}}}}};
;
jive.namespace("Wall");if(!jive.Wall.ImageMetaView){jive.Wall.ImageMetaView=jive.Wall.MetaView.extend({init:function(f,a,e,b,c){this._super(f,a,e,b,c);var d=this;this._$container.find("form").submit(function(){if(d._$container.find("input[type=file]").val()==""){return false}if(d._$imageContainer.find("UL").length==0){d.add([])}d.emit("completed",$j(this));return false});this._$imageContainer=e.find(".jive-js-image-container");this._i18n=b.i18n},error:function(a,c,b){this.emit("error",c);if($j(this._$imageContainer).find("ul li").size()==1){this.reset()}this.hide();$j(this._$imageContainer).find(".j-attached-loading").hide()},add:function(e,c){c=c||"";var d=this;var a=this._$imageContainer.find(".j-attached-items");if(e.length>0){var f=e[0];$j.extend(f,{originalURL:c});a=this._$imageContainer.find(".j-attached-items");if(a.length>0){jive.StatusInput.renderAttachmentWrapper({attachment:f},a,true,jive.Wall.Main.i18n)}else{jive.StatusInput.renderAttachmentsWrapper({attachments:e},this._$imageContainer,true,jive.Wall.Main.i18n)}if(this._type==jive.Wall.MetaView.TYPE_STATUS){this._$container.hide();this._$anchor.removeClass("j-selected").siblings(".j-button").removeClass("j-deselected")}}else{if(d._$imageContainer.find("UL").length==0){jive.StatusInput.renderAttachmentsWrapper({attachments:e},this._$imageContainer,true,jive.Wall.Main.i18n)}}this._$container.hide();this._$anchor.removeClass("j-selected").siblings(".j-button").removeClass("j-deselected");this._$imageContainer.find("li:not(.j-attached-loading):last > .j-remove-attachment").click(function(){d.emit("removeImage",f.id)});if(e.length>0){var b=this._$imageContainer.find(".j-attached-loading").remove();b=$j(b.hide().get(0));this._$imageContainer.find(".j-attached-items").append(b);jive.StatusInput.bindAttachment(a,true)}},reset:function(){this._$imageContainer.html("");this._$imageContainer.hide();this._$imageContainer.find(".j-attached-loading").hide()},show:function(){var c=this._$container.find("input[type=file]");var b=$j("<input type='file'>");b.attr("name",c.attr("name"));this._$container.find("input[type=file]").before(b).remove();var a=this;this._fileInputInterval=setInterval(function(){if(b.val()){clearInterval(a._fileInputInterval);a._$container.find("form").submit()}},100);this._super()},hide:function(){clearInterval(this._fileInputInterval);this._super()},getDataForURLImage:function(a){var b=this._$container.find("form");b.find("input[name=imageURL]").val(a);return b},remove:function(a){if($j("#"+a).size()>0&&$j("#"+a).siblings().size()<=1){this.reset()}$j("#"+a).remove()},formSubmitted:function(){var a=this._$imageContainer.find(".j-attached-items");a.width(a.width()+90+"px");this._$imageContainer.find(".j-attached-loading").show();var b=a.width()-this._$imageContainer.width();if(b>0){a.animate({left:(b*-1-40)},300)}}})};
;
jive.namespace("Wall");if(!jive.Wall.LinkMetaView){jive.Wall.LinkMetaView=jive.Wall.MetaView.extend({init:function(g,a,f,b,c){this._super(g,a,f,b,c);var d=this;var e=this._$container;e.find("form").submit(function(){d.emit("completed",$j(this));return false});this._$linkContainer=f.find(".link-container")},add:function(b){var a=b.title;this._$linkContainer.append(a)}})};
;
jive.namespace("Wall");if(!jive.Wall.WallSource){jive.Wall.WallSource=function(c){var g=c.containerType,b=c.containerId,e=jive.rest.url("/wall"),d=e+"/"+g+"/"+b,f=d+"/draft",a={type:"POST",contentType:"application/json; charset=utf-8",dataType:"json"};this.createDraft=function(i){var h=$j.extend({url:f,data:"{wallentry: {}}",success:function(j){i(j.wallentry)},error:function(k){var j=JSON.parse(k.responseText)}},a);$j.ajax(h)};this.publish=function(k,l,h){var j={wallentry:k};var i=$j.extend({url:d,data:JSON.stringify(j),success:function(m){if(m.wallentry.message){m.wallentry.message=m.wallentry.message.replace(/<\/?body>/gi,"")}m.wallentry=jive.Wall.VideoLinkMetaSource.normalizeData(m.wallentry);l(m.wallentry)},error:function(n){try{var m=JSON.parse(n.responseText);h(m.error.message)}catch(o){h()}}},a);$j.ajax(i)}}};
;
jive.namespace("Wall");if(!jive.Wall.MetaSource){jive.Wall.MetaSource=$Class.extend({create:function(a,b,c){},remove:function(b){var a={type:"GET",url:this.META_ENDPOINT+"/remove/"+b,dataType:"json",contentType:"application/json; charset=utf-8",success:function(c){},error:function(c,e,d){console.log("Error jive.Wall.MetaSource fetch"+b+", "+d)}};$j.ajax(a)}})};
;
jive.namespace("Wall");if(!jive.Wall.ImageMetaSource){jive.Wall.ImageMetaSource=jive.Wall.MetaSource.extend({init:function(){this.META_ENDPOINT=jive.rest.url("/meta")},create:function(e,g,c,h,a){var i=this;var b=jive.rest.url("/meta/image/"+e.objectType+"/"+e.objectId+"/attachment");var f="";if(a){console.log("Got image url");f=encodeURIComponent(g.find("input[name=imageURL]").val());b=jive.rest.url("/meta/image/"+e.objectType+"/"+e.objectId)}var j={url:b,dataType:"xml",data:{imageURL:f},contentType:"text/xml; charset=utf-8",complete:function(l,k){if($j(l.responseXML).find("meta id").length>0){i.fetch($j(l.responseXML).find("meta id").text(),c,h)}else{var n=$j(l.responseXML).find("code").text();var m=$j(l.responseXML).find("message").text();h(l,m,n)}},error:function(m,o,n){console.log("Error jive.Wall.ImageMetaSource create"+m+", "+o+", "+n);var l=$j(m.responseXML).find("code").text();var k=$j(m.responseXML).find("message").text();h(m,k,l)}};if(a){var d=g.find("input[name=image]");if(d.length>0){d.val("")}}else{g.find("input[name=imageURL]").val("")}g.ajaxSubmit(j)},fetch:function(d,a,b){var c={type:"GET",url:this.META_ENDPOINT+"/"+d,dataType:"json",contentType:"application/json; charset=utf-8",success:function(e){if(e.meta.length>0){var f=e.meta[0];a(e.meta)}else{console.log("Error jive.Wall.ImageMetaSource fetch no meta data:"+e);b(e,null,null)}},error:function(e,g,f){console.log("Error jive.Wall.ImageMetaSource fetch"+e+", "+g+", "+f);b(e,g,f)}};$j.ajax(c)}})};
;
jive.namespace("Wall");if(!jive.Wall.VideoLinkMetaSource){jive.Wall.VideoLinkMetaSource=jive.Wall.MetaSource.extend({init:function(){this.META_ENDPOINT=jive.rest.url("/meta")},create:function(b,d,f){var e={contentObjectType:b.objectType,object:b.objectId,videoURL:d.videoURL};var c=this;var a={url:jive.action.url("video-link-meta",e),dataType:"json",success:function(g){c.fetch(g.id,f)}};$j.ajax(a)},fetch:function(c,b){var a={type:"GET",url:this.META_ENDPOINT+"/"+c,dataType:"json",contentType:"application/json; charset=utf-8",success:function(d){if(d.meta.length>0){d=jive.Wall.VideoLinkMetaSource.normalizeData(d);b(d.meta)}else{console.log("Error jive.Wall.VideoLinkMetaSource fetch no meta data:"+d)}}};$j.ajax(a)}});jive.Wall.VideoLinkMetaSource.normalizeData=function(a){if(a.meta&&a.meta.length>0){a.meta.forEach(function(c){var b=c.properties;if(b!=undefined){var f={};if(b.entry!=undefined&&b.entry.length!=0){var e=b.entry;for(var d=0;d<e.length;d++){f[e[d].key]=e[d].value}}c.properties=f}})}else{a.meta=[]}return a}};
;
jive.namespace("Wall");if(!jive.Wall.LinkMetaSource){jive.Wall.LinkMetaSource=jive.Wall.MetaSource.extend({init:function(){this.META_ENDPOINT=jive.rest.url("/meta")},create:function(c,b,d){var a={url:jive.action.url("link-meta",{url:encodeURIComponent(b)}),dataType:"html",success:function(e){console.log("SUCCESS");d(e)},error:function(e){console.log("ERROR")}};$j.ajax(a)},fetch:function(c,b){var a={type:"GET",url:this.META_ENDPOINT+"/"+c,dataType:"json",contentType:"application/json; charset=utf-8",success:function(d){if(d.meta.length>0){var e=d.meta[0];e.title=_jive_base_url+e.title;e.body=_jive_base_url+e.body;b(d.meta)}else{console.log("Error jive.Wall.LinkMetaSource fetch no meta data:"+d)}}};$j.ajax(a)}})};
;
if(typeof jive=="undefined"){var jive={}}if(typeof jive.user=="undefined"){jive.user={}}if(typeof jive.user.soy=="undefined"){jive.user.soy={}}jive.user.soy.avatar=function(a,c){var b=c||new soy.StringBuilder();if(!a.user.anonymous){b.append('<a href="');jive.app.url({path:"/people/"+soy.$$escapeHtml(a.user.username)},b);b.append('" class="jiveTT-hover-user" onmouseover="quickuserprofile.getUserProfileTooltip(',soy.$$escapeHtml(a.user.ID),');" onmouseout="quickuserprofile.cancelTooltip();">');if(!a.user.enabled){b.append('<img class="jive-avatar" src="');jive.resource.url({path:"/images/jive-avatar-disabled.png"},b);b.append('" width="',soy.$$escapeHtml(a.size),'" height="',soy.$$escapeHtml(a.size),'" border="0"/>')}else{b.append('<img class="jive-avatar" src="');jive.app.url({path:"/people/"+soy.$$escapeHtml(a.user.username)},b);b.append("/avatar/",soy.$$escapeHtml(a.size),".png?a=",soy.$$escapeHtml(a.user.avatarID),'" border="0" height="',soy.$$escapeHtml(a.size),'" width="',soy.$$escapeHtml(a.size),'" alt="',soy.$$escapeHtml(a.user.displayName),'"/>')}b.append("</a>")}else{b.append('<img class="jive-avatar" src="');jive.app.url({path:"/people/guest/avatar"},b);b.append("/",soy.$$escapeHtml(a.size),'.png" border="0" height="',soy.$$escapeHtml(a.size),'" width="',soy.$$escapeHtml(a.size),'" alt="',soy.$$escapeHtml(a.user.displayName),'" title="',soy.$$escapeHtml(a.user.displayName),'"/>')}if(!c){return b.toString()}};jive.user.soy.displayNameLink=function(a,c){var b=c||new soy.StringBuilder();if(!a.user.anonymous){b.append('<a href="');jive.app.url({path:"/people/"+soy.$$escapeHtml(a.user.username)},b);b.append('" onmouseover="quickuserprofile.getUserProfileTooltip(',soy.$$escapeHtml(a.user.ID),');" onmouseout="quickuserprofile.cancelTooltip();" class="jiveTT-hover-user ',(!a.user.enabled)?"jive-user-disabled":"",'">',soy.$$escapeHtml(a.user.displayName),"</a>")}else{b.append("<span>",soy.$$escapeHtml(a.user.displayName),"</span>")}if(!c){return b.toString()}};
;
if(typeof jive=="undefined"){var jive={}}if(typeof jive.Wall=="undefined"){jive.Wall={}}if(typeof jive.Wall.soy=="undefined"){jive.Wall.soy={}}jive.Wall.soy.renderStatusSuccess=function(a,c){var b=c||new soy.StringBuilder();b.append('<div class="j-successful-post clearfix"><h3 class="font-color-okay">',soy.$$escapeHtml(a.i18n.wallentryStatusPostSuccessTitle),'</h3><a href="javascript:void(0);" class="j-success-post-dismiss">',soy.$$escapeHtml(a.i18n.wallentryStatusPostSuccessDismiss),'</a><ul class="j-status-post clearfix"><li class="jive-activity-status">');jive.Wall.soy.renderActivityStatus({entry:a.entry},b);b.append('</li><li class="jive-js-image-container j-attachment-container clearfix">');jive.StatusInput.soy.renderAttachments({attachments:a.entry.meta,i18n:a.i18n},b);b.append("</li></ul></div>");if(!c){return b.toString()}};jive.Wall.soy.renderActivityStatus=function(a,c){var b=c||new soy.StringBuilder();b.append(a.entry.message);if(!c){return b.toString()}};jive.Wall.soy.commentForm=function(a,c){var b=c||new soy.StringBuilder();b.append('<li class="comment-form clearfix">');if(a.canComment){jive.user.soy.avatar({user:a.user,size:30,useLinks:true,showHover:true},b);b.append('<div class="jive-comment-arrow"></div><div class="jive-comment-content">');jive.Wall.soy.statusInputNotificationBoxes(null,b);b.append('<form id="s-c-form-',soy.$$escapeHtml(a.statusID),'" name="',soy.$$escapeHtml(a.statusID),'">');jive.Wall.soy.statusInput({statusInputIdPostfix:a.statusID},b);b.append('<input type="hidden" name="id" value="',soy.$$escapeHtml(a.statusID),'"/><input type="hidden" name="imageURL" />');jive.Wall.soy.statusInputErrorWarnBox({i18n:a.i18n},b);b.append('<div class="j-submit-mb"><input type="button"  class="j-comment-submit" id="',soy.$$escapeHtml(a.statusID),'" value="',soy.$$escapeHtml(a.i18n.commentButtonLabel),'" /></div></form>');jive.Wall.soy.statusInputActionContainer({displayImageBtn:false,canCreateImage:a.canCreateImage,i18n:a.i18n},b);b.append("</div>")}b.append("</li>");if(!c){return b.toString()}};jive.Wall.soy.repostForm=function(a,c){var b=c||new soy.StringBuilder();b.append('<div class="j-repost-form jive-form-container clearfix">');jive.Wall.soy.statusInputNotificationBoxes(null,b);b.append('<form id="s-r-form-',soy.$$escapeHtml(a.statusID),'" name="',soy.$$escapeHtml(a.statusID),'"><div class="jive-form-label"><label>',soy.$$escapeHtml(a.i18n.commentary),soy.$$escapeHtml(a.i18n.colon),"</label></div>");jive.Wall.soy.statusInput({statusInputIdPostfix:"s-r-input-"+soy.$$escapeHtml(a.statusID)},b);b.append('<input type="hidden" name="id" value="',soy.$$escapeHtml(a.statusID),'"/><input type="hidden" name="imageURL" />');jive.Wall.soy.statusInputErrorWarnBox({i18n:a.i18n},b);b.append('<div class="j-submit-mb"><input type="button" class="j-repost-submit" statusid="',soy.$$escapeHtml(a.statusID),'" value="',soy.$$escapeHtml(a.i18n.repost),'" /></div></form>');jive.Wall.soy.statusInputActionContainer({displayImageBtn:true,canCreateImage:a.canCreateImage,i18n:a.i18n},b);b.append("</div>");if(!c){return b.toString()}};jive.Wall.soy.statusInput=function(a,c){var b=c||new soy.StringBuilder();b.append('<script type="text/javascript">jive.MicroBlogging.StatusInput.setupLiveFocusHandler(\'message-',soy.$$escapeHtml(a.statusInputIdPostfix),"')<\/script><div id=\"statusInputs-",soy.$$escapeHtml(a.statusInputIdPostfix),'"><div class="jive-statusinput-default jive-statusinput jive-form-element-text jive-js-statusinput-default">',(a.defaultTxt)?soy.$$escapeHtml(a.defaultTxt):"",'</div><div id="message-',soy.$$escapeHtml(a.statusInputIdPostfix),'" class="jive-js-statusinput jive-statusinput jive-form-element-text" contentEditable="true" style="position:relative;"></div></div>');if(!c){return b.toString()}};jive.Wall.soy.statusInputNotificationBoxes=function(a,c){var b=c||new soy.StringBuilder();jive.Wall.soy.statusInputNotificationBox({cssClass:"jive-info-box"},b);jive.Wall.soy.statusInputNotificationBox({cssClass:"jive-warn-box"},b);jive.Wall.soy.statusInputNotificationBox({cssClass:"jive-error-box"},b);if(!c){return b.toString()}};jive.Wall.soy.statusInputNotificationBox=function(a,c){var b=c||new soy.StringBuilder();b.append('<div class="',soy.$$escapeHtml(a.cssClass),'" style="display:none"></div>');if(!c){return b.toString()}};jive.Wall.soy.statusInputErrorWarnBox=function(a,c){var b=c||new soy.StringBuilder();b.append('<span class="j-wall-error" style="display:none"><strong>');if(a.i18n.characterLimitOver==1){jive.i18n.soy({string:a.i18n.characterLimitOverOne,zero:'<span class="j-number-over"></span>'},b)}else{jive.i18n.soy({string:a.i18n.characterLimitOverMany,zero:'<span class="j-number-over"></span>'},b)}b.append('</strong></span><span class="j-wall-warn" style="display:none"><strong>');jive.i18n.soy({string:a.i18n.characterLimitLeft,zero:'<span class="j-number-left"></span>'},b);b.append('</strong></span><span class="jive-js-error-general" style="display:none"><strong>',soy.$$escapeHtml(a.i18n.statusInputError),"</strong></span>");if(!c){return b.toString()}};jive.Wall.soy.statusInputActionContainer=function(a,c){var b=c||new soy.StringBuilder();b.append((a.canCreateImage&&a.displayImageBtn)?'<div class="jive-js-image-container j-attachment-container clearfix"></div>':"",'<div class="j-attach-action-container clearfix">',(a.canCreateImage&&a.displayImageBtn)?'<a href="javascript:void(0);" class="j-button j-wall-meta-image"><span class="jive-icon-med jive-icon-camera"></span></a>':"",'<a href="javascript:void(0);" class="jive-js-wall-mention-button j-wall-meta-reference j-button">@</a><span class="font-color-meta j-upload-image-help">',soy.$$escapeHtml(a.i18n.uploadImage),'</span><span class="font-color-meta j-reference-help">',soy.$$escapeHtml(a.i18n.referenceHelp),'</span><div class="j-wall-meta-image-container j-attach-tab"><form method="post" enctype="multipart/form-data"><input type="file" name="image" /><input type="hidden" name="imageURL" /></form></div><div class="j-wall-meta-video-container j-attach-tab"><form method="post"><input type="file" name="image" /><input type="hidden" name="imageURL" /></form></div></div>');if(!c){return b.toString()}};
;
jive.namespace("Wall");jive.Wall.CommentHelper=function(k){var g=new jive.MicroBlogging.StatusInputs("#statusInputs-"+k.statusInputIdPostfix,{idPostfix:k.statusInputIdPostfix,i18n:k.i18n,allowTagCreation:false});var h="message-"+k.statusInputIdPostfix;var d=new jive.shared.NotificationView($j("#"+h).parents(".jive-comment-content:first"),{info:".jive-info-box:first",warn:".jive-warn-box:first",error:".jive-error-box:first"});var j=new jive.shared.FormWaitingView($j("#statusInputs-"+k.statusInputIdPostfix).parents(".jive-comment-content"),{i18n:k.i18n});this.getStatusInputVals=function(){return g.getSubmitVals(h)};this.resetStatusInput=function(){g.resetText(h)};var f=this;g.addListener("ready",function(){g.getStatusInput(h).addListener("characterLenMsg",function(l,m){jive.Wall.EditorView.handleCharacterLenMsg(l,m,k.container)});k.container.find(".jive-js-wall-mention-button").click(function(l){g.getStatusInput(h).handleAtMentionButtonClick(l);l.stopPropagation()})});var a={type:"POST",contentType:"application/json; charset=utf-8",dataType:"json"};this.enableForm=function(){j.enableForm()};this.disableForm=function(){j.disableForm()};this.displayModeration=function(){d.warn(k.i18n.formPostedModeration)};this.displayError=function(l){d.error(l)};var e=null;function c(m){if(e!=null){m(e)}else{var l=function(n){e=n;m(e)};jive.Wall.CommentHelper.submitCommentDraft(l,k.wallEntryTypeID,k.statusInputIdPostfix)}}this.initMeta=jive.Wall.Main.prototype.initMeta;var b=[],i=k.meta||[];i.forEach(function(l){f.initMeta(l,b,k,k.container,c)})};jive.Wall.CommentHelper.renderCommentFormTemplate=function(d,c){var a=$j.find(".j-inline-comment-wrapper");var b=$j(a).find(".jive-comment-container").attr("statusid");if($j(a).find(".comment-form").length<1){$j(a).find("ul").append(jive.Wall.soy.commentForm({statusID:b,user:_jive_current_user,canComment:c.canComment,canCreateImage:c.canCreateImage,i18n:c.i18n}));jive.Wall.CommentHelper.initComment(b,{i18n:jive.Wall.Main.i18n,wallEntryTypeID:d})}return false};jive.Wall.CommentHelper.displayModeration=function(a){jive.Wall.CommentHelper.helpers[a].displayModeration()};jive.Wall.CommentHelper.submitComment=function(d,e,b){var f=$j(d).attr("id");jive.Wall.CommentHelper.helpers[f].disableForm();var c=jive.rest.url("/comments");var a=c+"/"+e+"/"+f;$j(function(){$j.ajax({type:"POST",url:a,dataType:"json",data:JSON.stringify(jive.Wall.CommentHelper.getDataParams(f)),contentType:"application/json; charset=utf-8",success:function(g){jive.Wall.CommentHelper.helpers[f].enableForm();jive.Wall.CommentHelper.helpers[f].resetStatusInput();if(!g.comment.moderated){jive.Wall.CommentHelper.reloadComments(f,e,b)}else{jive.Wall.CommentHelper.displayModeration(f)}},error:function(g){jive.Wall.CommentHelper.helpers[f].enableForm();jive.Wall.CommentHelper.helpers[f].displayError(JSON.parse(g.responseText).error.message)}})});return false};jive.Wall.CommentHelper.submitCommentDraft=function(d,b,c){var a={url:jive.rest.url("/comments")+"/"+b+"/"+c+"/draft",data:JSON.stringify(jive.Wall.CommentHelper.getDataParams(c)),success:function(e){e.comment.objectType=jive.Wall.Main.COMMENT_TYPE;e.comment.objectId=e.comment.commentID;d(e.comment)},error:function(f){var e=JSON.parse(f.responseText)},type:"POST",contentType:"application/json; charset=utf-8",dataType:"json"};$j.ajax(a)};jive.Wall.CommentHelper.reloadComments=function(c,b,a){$j.ajax({type:"GET",url:a,dataType:"html",data:{id:c,type:b},success:function(e){var d=$j("#wall-comments-"+c).find("li.comment-form");$j("#wall-comments-"+c).replaceWith(e);$j(d).find(".jive-form-element-textarea").val("");d.appendTo($j("#wall-comments-"+c));jive.Wall.CommentHelper.initComment(c,{i18n:jive.Wall.Main.i18n,wallEntryTypeID:b})},error:function(d){console.log("Failed to reload comments.")}})};jive.Wall.CommentHelper.destroyComment=function(a){var b=jive.rest.url("/comments")+"/"+a;$j.ajax({type:"DELETE",url:b,success:function(c){console.log(c);$j("li#comment-"+a).hide()},error:function(c){jive.Wall.CommentHelper.helpers[formID].displayError(JSON.parse(c.responseText).error.message)}});return false};jive.Wall.CommentHelper.getDataParams=function(a){return{comment:{parentCommentID:-1,body:jive.Wall.CommentHelper.helpers[a].getStatusInputVals(),name:$j("#comment-author").val(),email:$j("#comment-email").val(),URL:$j("#comment-url").val(),commentMode:$j("#comment-mode").val()}}};jive.Wall.CommentHelper.helpers={};jive.Wall.CommentHelper.initComment=function(d,b){var c=[{id:"j-wall-meta-image",view:jive.Wall.ImageMetaView,container:"jive-comment-content",service:jive.Wall.ImageMetaSource,viewType:jive.Wall.MetaView.TYPE_STATUS_COMMENT},{id:"j-wall-meta-video-link",view:jive.Wall.ImageMetaView,container:"jive-comment-content",service:jive.Wall.VideoLinkMetaSource,viewType:jive.Wall.MetaView.TYPE_STATUS_COMMENT}];b.meta=c;var a=$j("#wall-comments-"+d).find("li.comment-form");jive.Wall.CommentHelper.helpers[d]=new jive.Wall.CommentHelper($j.extend({statusInputIdPostfix:d,container:a},b))};jive.observable(jive.Wall.CommentHelper.prototype);
;
jive.namespace("Wall");jive.Wall.RepostHelper=jive.Wall.Main.extend({init:function(a){this._super($j.extend({submitBtnID:".j-repost-submit",focusOnRdy:true},a));this._statusID=a.statusID;this.formWaitingView=new jive.shared.FormWaitingView($j("#jive-js-repost-modal").find(".jive-modal-content"),{i18n:a.i18n})},getStatusInputVals:function(){return this._wallStatusInputs.getSubmitVals(this.statusInputID)},resetStatusInput:function(){this._wallStatusInputs.resetText(this.statusInputID)},_initWallSource:function(a){},_getEntry:function(c){if(this._wallEntry!=null){c(this._wallEntry)}else{var a=this;var b=function(d){a._wallEntry=d;c(a._wallEntry)};jive.Wall.RepostHelper.submitRepostDraft(this._statusID,b)}},_initEditorView:function(a){this._wallEditorView=new jive.Wall.EditorView(a.editorContainer,$j.extend({notificationContainer:$j(a.editorContainer)},a))},displaySuccessMsg:function(b,a,c){this._wallEditorView.entryPublishedRepost(b,a,c)},enableForm:function(){this.formWaitingView.enableForm()},disableForm:function(){this.formWaitingView.disableForm()}});jive.Wall.RepostHelper.bindRepostAnchors=function(a){$j("a.j-repost").live("click",function(){var b=$j(this).closest("li.j-repost-item");var c=b.find(".j-repost-modal").clone(true);c.attr("id","jive-js-repost-modal");c.lightbox_me({closeSelector:".jive-modal-close-top",destroyOnClose:true,centered:true,onLoad:function(){jive.Wall.RepostHelper.initRepost(d,{i18n:jive.Wall.Main.i18n});jive.StatusInput.bindAttachment(c.find(".j-wall-repost-content .j-attachment-container").show().find(".j-attached-items"))}});var d=b.attr("statusid");if(b.find(".repost-form").length<1){c.find("div#j-repost-form-placeholder-"+d).append(jive.Wall.soy.repostForm({statusID:d,canCreateImage:a.canCreateImage,i18n:a.i18n}))}return false})};jive.Wall.RepostHelper.submitRepost=function(a){jive.Wall.RepostHelper.helpers[a].disableForm();if(jive.Wall.RepostHelper.helpers[a].wallentry){jive.Wall.RepostHelper.submitRepostCommon(a,jive.Wall.RepostHelper.SUBMIT_TYPE_REPOST_DRAFT_PUB)}else{jive.Wall.RepostHelper.submitRepostCommon(a,jive.Wall.RepostHelper.SUBMIT_TYPE_REPOST)}return false};jive.Wall.RepostHelper.submitRepostDraft=function(a,b){jive.Wall.RepostHelper.submitRepostCommon(a,jive.Wall.RepostHelper.SUBMIT_TYPE_REPOST_DRAFT,b);return false};jive.Wall.RepostHelper.submitRepostCommon=function(d,a,g){var c=jive.rest.url("/wall"),e=c+"/repost/"+d;var f=jive.Wall.RepostHelper.helpers[d].wallentry;var b;if(a==jive.Wall.RepostHelper.SUBMIT_TYPE_REPOST_DRAFT_PUB){e=c+"/"+f.containerType+"/"+f.containerID;f.message=jive.Wall.RepostHelper.getDataUtil(d);b=JSON.stringify({wallentry:f})}else{b=jive.Wall.RepostHelper.getDataUtil(d);if(a==jive.Wall.RepostHelper.SUBMIT_TYPE_REPOST_DRAFT){e+="/draft"}}$j.ajax({type:"POST",url:e,dataType:"json",data:b,contentType:"application/json; charset=utf-8",success:function(i){if(a==jive.Wall.RepostHelper.SUBMIT_TYPE_REPOST_DRAFT){jive.Wall.RepostHelper.helpers[d].wallentry=i.wallentry;g(i.wallentry)}else{jive.Wall.RepostHelper.helpers[d].enableForm();if(i.wallentry.message){i.wallentry.message=i.wallentry.message.replace(/<\/?body>/gi,"")}i.wallentry=jive.Wall.VideoLinkMetaSource.normalizeData(i.wallentry);var h=$j("#jive-js-repost-modal");jive.Wall.RepostHelper.helpers[d].displaySuccessMsg(h,i.wallentry,function(){h.trigger("close")})}},error:function(i){jive.Wall.RepostHelper.helpers[d].enableForm();try{var h=JSON.parse(i.responseText);jive.Wall.RepostHelper.helpers[d].displayError(h.error.message)}catch(j){jive.Wall.RepostHelper.helpers[d].displayError()}}})};jive.Wall.RepostHelper.getDataUtil=function(a){return jive.Wall.RepostHelper.helpers[a].getStatusInputVals()};jive.Wall.RepostHelper.helpers={};jive.Wall.RepostHelper.initRepost=function(c,a){var b=[{id:"j-wall-meta-link",view:jive.Wall.LinkMetaView,container:"j-wall-meta-link-container",service:jive.Wall.LinkMetaSource},{id:"j-wall-meta-image",view:jive.Wall.ImageMetaView,container:"j-wall-meta-image-container",service:jive.Wall.ImageMetaSource,viewType:jive.Wall.MetaView.TYPE_STATUS_COMMENT},{id:"j-wall-meta-video-link",view:jive.Wall.ImageMetaView,container:"j-wall-meta-video-container",service:jive.Wall.VideoLinkMetaSource,viewType:jive.Wall.MetaView.TYPE_STATUS_COMMENT}];a.meta=b;jive.Wall.RepostHelper.helpers[c]=new jive.Wall.RepostHelper($j.extend({editorContainer:"#jive-js-repost-modal",domContainerId:"jive-js-repost-modal",statusInputIdPostfix:jive.Wall.RepostHelper.INPUT_PREFIX+c,statusID:c},a))};jive.Wall.RepostHelper.SUBMIT_TYPE_REPOST=1;jive.Wall.RepostHelper.SUBMIT_TYPE_REPOST_DRAFT=2;jive.Wall.RepostHelper.SUBMIT_TYPE_REPOST_DRAFT_PUB=3;jive.Wall.RepostHelper.INPUT_PREFIX="s-r-input-";
;

