Webservice=function(service){var _arrUrlDefault={comments:"http://comments.wsv.terra.com",ranking:"http://ranking.wsv.terra.com",tags:"http://tags.wsv.terra.com"};var _server="http://transversais.terra.com";var _urlDefault;var _service=service;var _httpMethods=["GET","POST"];var _protocol="JSON-RPC";var _swfUri=_server+"/common/f4a.swf";var _request={};var _f4a={};var _f4aLoaded=false;var _returnData;var _self=this;var _validateMethod=function(httpMethod){for(var a=0;a<_httpMethods.length;a++){if(httpMethod.toUpperCase()==_httpMethods[a]){return true}}return false};var _checkService=function(){if(_service!=undefined){if(_arrUrlDefault[service]!=undefined){_urlDefault=_arrUrlDefault[service]}else{throw Error("You must define a valid WS SERVICE")}}};var _validateUrl=function(){if(_urlDefault!=undefined){return true}else{throw Error("You must a define a SERVICE or set a URL to connect")}};var _loadF4Ajax=function(){_f4a=new f4a_js_flash({id:"f4a_demo1",swfname:"f4a.swf",swfuri:_swfUri});if(document.getElementById("f4a_demo1flashcontent")==null){var elem=document.createElement("div");elem.id="f4a_demo1flashcontent";elem.style.width="0px";elem.style.height="0px";document.getElementsByTagName("body").item(0).appendChild(elem);_f4a.createSwfObject()}_f4aLoaded=true};var _configureF4a=function(){window.onload=function(){_loadF4Ajax()}};this.clear=function(){_urlDefault=_urlDefaulClear};this.open=function(url){_urlDefault=url};this.contentRequestHttp=function(url,httpmethod,method,parameters,fnCall){try{var xmlhttp=new XMLHttpRequest()}catch(e){var xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")}xmlhttp.open(method,url,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4&&xmlhttp.status==200){fnCall(xmlhttp.responseText)}};xmlhttp.send(null)};this.contentRequest=function(url,httpmethod,method,parameters,fnCall,contentType,convertToString){var contentType=(contentType==undefined||contentType=="")?"application/json":contentType;_loadF4Ajax();function fnCallback(data){fnCall(data)}if(!_f4aLoaded){_configureF4a()}var returnData={};if(typeof(parameters)=="object"){returnData.version="1.1";returnData.method=method;returnData.id="1";returnData.params=parameters;for(var a in returnData.params){if(typeof(parameters[a])=="string"){returnData.params[a]=parameters[a].replace(/\r|\n/g,"\\n");returnData.params[a]=parameters[a].replace(/"/g,"'")}}}if(convertToString===true||convertToString==undefined){var strReturnData=rpc.ServiceProxy.prototype.__toJSON(returnData)}else{var strReturnData=parameters}var request={url:url,meth:httpmethod,data:strReturnData,onready:fnCallback,headers:["Content-type",contentType]};_f4a.open(request)};this.send=function(httpMethod,method,parameters,callback,contentType,convertToString){if(!_validateMethod(httpMethod)){throw Error("HTTP Method not alowed")}if(method==undefined){throw Error("Method not alowed")}if(parameters==undefined){throw Error("Parameters invalid")}if(callback!=undefined&&typeof(callback)!="function"){throw Error("Callback is not a function")}function fnCallback(param){if(callback!=undefined){if(typeof(param)=="object"){callback(param)}else{param=param.replace(/\n|\r/g,"");callback(rpc.ServiceProxy.prototype.__evalJSON(param))}}else{_returnData=param}}switch(httpMethod){case"GET":_request=new rpc.ServiceProxy(_urlDefault,{asynchronous:true,protocol:_protocol,sanitize:false,methods:[method],callbackParamName:"callback"});_request.__callMethod(method,parameters,function(ret){fnCallback(ret)},function(ret){fnCallback(ret)});break;case"POST":this.contentRequest(_urlDefault,httpMethod,method,parameters,fnCallback,contentType,convertToString);break}};this.construct=function(){};this.construct()};var rpc={version:"0.8.0.2",requestCount:0};rpc.ServiceProxy=function(serviceURL,options){this.__serviceURL=serviceURL;this.__isCrossSite=false;var urlParts=this.__serviceURL.match(/^(\w+:)\/\/([^\/]+?)(?::(\d+))?(?:$|\/?)/);if(urlParts){this.__isCrossSite=(location.protocol!=urlParts[1]||document.domain!=urlParts[2]||location.port!=(urlParts[3]||""))}var providedMethodList;this.__isAsynchronous=true;this.__isResponseSanitized=true;this.__authUsername=null;this.__authPassword=null;this.__callbackParamName="JSON-response-callback";this.__protocol="JSON-RPC";this.__dateEncoding="ISO8601";this.__decodeISO8601=true;if(options instanceof Object){if(options.asynchronous!==undefined){this.__isAsynchronous=!!options.asynchronous;if(!this.__isAsynchronous&&this.__isCrossSite){throw Error("It is not possible to establish a synchronous connection to a cross-site RPC service.")}}if(options.sanitize!=undefined){this.__isResponseSanitized=!!options.sanitize}if(options.user!=undefined){this.__authUsername=options.user}if(options.password!=undefined){this.__authPassword=options.password}if(options.callbackParamName!=undefined){this.__callbackParamName=options.callbackParamName}if(String(options.protocol).toUpperCase()=="XML-RPC"){this.__protocol="XML-RPC"}if(options.dateEncoding!=undefined){this.__dateEncoding=options.dateEncoding}if(options.decodeISO8601!=undefined){this.__decodeISO8601=!!options.decodeISO8601}providedMethodList=options.methods}if(this.__isCrossSite){if(this.__isResponseSanitized){throw Error("You are attempting to access a service on another site, and the JSON data returned by cross-site requests cannot be sanitized. You must therefore explicitly set the 'sanitize' option to false (it is true by default) in order to proceed with making potentially insecure cross-site rpc calls.")}else{if(this.__protocol=="XML-RPC"){throw Error("Unable to use the XML-RPC protocol to access services on other domains.")}}}if(this.__isCrossSite&&!providedMethodList){throw Error("You must manually supply the service's method names since auto-introspection is not permitted for cross-site services.")}if(providedMethodList){this.__methodList=providedMethodList}else{var async=this.__isAsynchronous;this.__isAsynchronous=false;this.__methodList=this.__callMethod("system.listMethods",[]);this.__isAsynchronous=async}this.__methodList.push("system.listMethods");this.__methodList.push("system.describe");for(var methodName,i=0;methodName=this.__methodList[i];i++){var methodObject=this;var propChain=methodName.split(/\./);for(var j=0;j+1<propChain.length;j++){if(!methodObject[propChain[j]]){methodObject[propChain[j]]={}}methodObject=methodObject[propChain[j]]}var wrapper=(function(instance,methodName){var call={instance:instance,methodName:methodName};return function(){if(call.instance.__isAsynchronous){if(arguments.length==1&&arguments[0] instanceof Object){call.instance.__callMethod(call.methodName,arguments[0].params,arguments[0].onSuccess,arguments[0].onException,arguments[0].onComplete)}else{call.instance.__callMethod(call.methodName,arguments[0],arguments[1],arguments[2],arguments[3])}return undefined}else{return call.instance.__callMethod(call.methodName,rpc.toArray(arguments))}}})(this,methodName);methodObject[propChain[propChain.length-1]]=wrapper}};rpc.setAsynchronous=function(serviceProxy,isAsynchronous){if(!isAsynchronous&&serviceProxy.__isCrossSite){throw Error("It is not possible to establish a synchronous connection to a cross-site RPC service.")}serviceProxy.__isAsynchronous=!!isAsynchronous};rpc.ServiceProxy.prototype.__callMethod=function(methodName,params,successHandler,exceptionHandler,completeHandler){rpc.requestCount++;if(this.__isAsynchronous){if(successHandler&&typeof successHandler!="function"){throw Error("The asynchronous onSuccess handler callback function you provided is invalid; the value you provided ("+successHandler.toString()+') is of type "'+typeof(successHandler)+'".')}if(exceptionHandler&&typeof exceptionHandler!="function"){throw Error("The asynchronous onException handler callback function you provided is invalid; the value you provided ("+exceptionHandler.toString()+') is of type "'+typeof(exceptionHandler)+'".')}if(completeHandler&&typeof completeHandler!="function"){throw Error("The asynchronous onComplete handler callback function you provided is invalid; the value you provided ("+completeHandler.toString()+') is of type "'+typeof(completeHandler)+'".')}}try{if(this.__isAsynchronous||this.__isCrossSite){rpc.pendingRequests[String(rpc.requestCount)]={onSuccess:successHandler,onException:exceptionHandler,onComplete:completeHandler}}if(this.__isCrossSite){rpc.callbacks["r"+String(rpc.requestCount)]=(function(instance,id){var call={instance:instance,id:id};return function(response){if(response instanceof Object&&(response.result||response.error)){response.id=call.id;instance.__doCallback(response)}else{instance.__doCallback({id:call.id,result:response})}}})(this,rpc.requestCount);var script=document.createElement("script");script.setAttribute("type","text/javascript");script.setAttribute("charset","utf-8");var src=this.__serviceURL+"/"+methodName+"?"+this.__callbackParamName+"=rpc.callbacks.r"+(rpc.requestCount);if(params){src+="&"+rpc.toQueryString(params)}script.setAttribute("src",src);script.setAttribute("id","rpc"+rpc.requestCount);var head=document.getElementsByTagName("head")[0];rpc.pendingRequests[rpc.requestCount].scriptElement=script;head.appendChild(script);return undefined}else{if(params){if(!(params instanceof Object)||params instanceof Date){throw Error("When making asynchronous calls, the parameters for the method must be passed as an array (or a hash); the value you supplied ("+String(params)+') is of type "'+typeof(params)+'".')}}var request,postData;if(this.__protocol=="XML-RPC"){if(!(params instanceof Array)){throw Error("Unable to pass associative arrays to XML-RPC services.")}var xml=['<?xml version="1.0"?><methodCall><methodName>'+methodName+"</methodName>"];if(params){xml.push("<params>");for(var i=0;i<params.length;i++){xml.push("<param>"+this.__toXMLRPC(params[i])+"</param>")}xml.push("</params>")}xml.push("</methodCall>");postData=xml.join("")}else{request={version:"1.1",method:methodName,id:rpc.requestCount};if(params){request.params=params}postData=this.__toJSON(request)}var xhr;if(window.XMLHttpRequest){xhr=new XMLHttpRequest()}else{if(window.ActiveXObject){try{xhr=new ActiveXObject("Msxml2.XMLHTTP")}catch(err){xhr=new ActiveXObject("Microsoft.XMLHTTP")}}}xhr.open("POST",this.__serviceURL,this.__isAsynchronous,this.__authUsername,this.__authPassword);if(this.__protocol=="XML-RPC"){xhr.setRequestHeader("Content-Type","text/xml");xhr.setRequestHeader("Accept","text/xml")}else{xhr.setRequestHeader("Content-Type","application/json");xhr.setRequestHeader("Accept","application/json")}if(this.__isAsynchronous){xhr.send(postData);var instance=this;var requestInfo={id:rpc.requestCount};xhr.onreadystatechange=function(){if(xhr.readyState==4){if(instance.__protocol=="XML-RPC"){var response=instance.__getXMLRPCResponse(xhr,requestInfo.id);instance.__doCallback(response)}else{var response=instance.__evalJSON(xhr.responseText,instance.__isResponseSanitized);if(!response.id){response.id=requestInfo.id}instance.__doCallback(response)}}};return undefined}else{xhr.send(postData);var response;if(this.__protocol=="XML-RPC"){response=this.__getXMLRPCResponse(xhr,rpc.requestCount)}else{response=this.__evalJSON(xhr.responseText,this.__isResponseSanitized)}if(response.error){throw Error('Unable to call "'+methodName+'". Server responsed with error (code '+response.error.code+"): "+response.error.message)}this.__upgradeValuesFromJSON(response);return response.result}}}catch(err){var isCaught=false;if(exceptionHandler){isCaught=exceptionHandler(err)}if(completeHandler){completeHandler()}if(!isCaught){throw err}}};rpc.pendingRequests={};rpc.callbacks={};rpc.ServiceProxy.prototype.__doCallback=function(response){if(typeof response!="object"){throw Error("The server did not respond with a response object.")}if(!response.id){throw Error("The server did not respond with the required response id for asynchronous calls.")}if(!rpc.pendingRequests[response.id]){throw Error('Fatal error with RPC code: no ID "'+response.id+'" found in pendingRequests.')}if(rpc.pendingRequests[response.id].scriptElement){var script=rpc.pendingRequests[response.id].scriptElement;script.parentNode.removeChild(script)}if(rpc.callbacks[response.id]){delete rpc.callbacks["r"+response.id]}var uncaughtExceptions=[];if(response.error!==undefined){var err=new Error(response.error.message);err.code=response.error.code;if(rpc.pendingRequests[response.id].onException){try{if(!rpc.pendingRequests[response.id].onException(err)){uncaughtExceptions.push(err)}}catch(err2){uncaughtExceptions.push(err);uncaughtExceptions.push(err2)}}else{uncaughtExceptions.push(err)}}else{if(response.result!==undefined){this.__upgradeValuesFromJSON(response);if(rpc.pendingRequests[response.id].onSuccess){try{rpc.pendingRequests[response.id].onSuccess(response.result)}catch(err){if(rpc.pendingRequests[response.id].onException){try{if(!rpc.pendingRequests[response.id].onException(err)){uncaughtExceptions.push(err)}}catch(err2){uncaughtExceptions.push(err);uncaughtExceptions.push(err2)}}else{uncaughtExceptions.push(err)}}}}}try{if(rpc.pendingRequests[response.id].onComplete){rpc.pendingRequests[response.id].onComplete(response)}}catch(err){if(rpc.pendingRequests[response.id].onException){try{if(!rpc.pendingRequests[response.id].onException(err)){uncaughtExceptions.push(err)}}catch(err2){uncaughtExceptions.push(err);uncaughtExceptions.push(err2)}}else{uncaughtExceptions.push(err)}}delete rpc.pendingRequests[response.id];if(uncaughtExceptions.length){var code;var message="There "+(uncaughtExceptions.length==1?"was 1 uncaught exception":"were "+uncaughtExceptions.length+" uncaught exceptions")+": ";for(var i=0;i<uncaughtExceptions.length;i++){if(i){message+="; "}message+=uncaughtExceptions[i].message;if(uncaughtExceptions[i].code){code=uncaughtExceptions[i].code}}var err=new Error(message);err.code=code;throw err}};rpc.ServiceProxy.prototype.__toJSON=function(value){switch(typeof value){case"number":return isFinite(value)?value.toString():"null";case"boolean":return value.toString();case"string":var specialChars={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\","/":"/"};return'"'+value.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=specialChars[b];if(c){return c}c=b.charCodeAt();return"\\u00"+rpc.zeroPad(c.toString(16))})+'"';case"object":if(value===null){return"null"}else{if(value instanceof Array){var json=["["];for(var i=0;i<value.length;i++){if(i){json.push(",")}json.push(this.__toJSON(value[i]))}json.push("]");return json.join("")}else{if(value instanceof Date){switch(this.__dateEncoding){case"classHinting":return'{"__jsonclass__":["Date",['+value.valueOf()+"]]}";case"@timestamp@":case"@ticks@":return'"@'+value.valueOf()+'@"';case"ASP.NET":return'"\\/Date('+value.valueOf()+')\\/"';default:return'"'+rpc.dateToISO8601(value)+'"'}}else{if(value instanceof Number||value instanceof String||value instanceof Boolean){return this.__toJSON(value.valueOf())}else{var useHasOwn={}.hasOwnProperty?true:false;var json=["{"];for(var key in value){if(!useHasOwn||value.hasOwnProperty(key)){if(json.length>1){json.push(",")}json.push(this.__toJSON(key)+":"+this.__toJSON(value[key]))}}json.push("}");return json.join("")}}}}}throw new TypeError('Unable to convert the value of type "'+typeof(value)+'" to JSON.')};rpc.isJSON=function(string){var testStr=string.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(testStr)};rpc.ServiceProxy.prototype.__evalJSON=function(json,sanitize){json=json.replace(/^\/\*-secure-([\s\S]*)\*\/\s*$/,"$1");var err;try{if(!sanitize||rpc.isJSON(json)){return eval("("+json+")")}}catch(e){err=e}throw new SyntaxError("Badly formed JSON string: "+json+" ... "+(err?err.message:""))};rpc.ServiceProxy.prototype.__upgradeValuesFromJSON=function(obj){var matches,useHasOwn={}.hasOwnProperty?true:false;for(var key in obj){if(!useHasOwn||obj.hasOwnProperty(key)){if(typeof obj[key]=="string"){if(this.__decodeISO8601&&(matches=obj[key].match(/^(?:(\d\d\d\d)-(\d\d)(?:-(\d\d)(?:T(\d\d)(?::(\d\d)(?::(\d\d)(?:\.(\d+))?)?)?)?)?)$/))){obj[key]=new Date(0);if(matches[1]){obj[key].setUTCFullYear(parseInt(matches[1]))}if(matches[2]){obj[key].setUTCMonth(parseInt(matches[2]-1))}if(matches[3]){obj[key].setUTCDate(parseInt(matches[3]))}if(matches[4]){obj[key].setUTCHours(parseInt(matches[4]))}if(matches[5]){obj[key].setUTCMinutes(parseInt(matches[5]))}if(matches[6]){obj[key].setUTCMilliseconds(parseInt(matches[6]))}}else{if(matches=obj[key].match(/^@(\d+)@$/)){obj[key]=new Date(parseInt(matches[1]))}else{if(matches=obj[key].match(/^\/Date\((\d+)\)\/$/)){obj[key]=new Date(parseInt(matches[1]))}}}}else{if(obj[key] instanceof Object){if(obj[key].__jsonclass__ instanceof Array){if(obj[key].__jsonclass__[0]=="Date"){if(obj[key].__jsonclass__[1] instanceof Array&&obj[key].__jsonclass__[1][0]){obj[key]=new Date(obj[key].__jsonclass__[1][0])}else{obj[key]=new Date()}}}else{this.__upgradeValuesFromJSON(obj[key])}}}}}};rpc.ServiceProxy.prototype.__toXMLRPC=function(value){var xml=["<value>"];switch(typeof value){case"number":if(!isFinite(value)){xml.push("<nil/>")}else{if(parseInt(value)==Math.ceil(value)){xml.push("<int>");xml.push(value.toString());xml.push("</int>")}else{xml.push("<double>");xml.push(value.toString());xml.push("</double>")}}break;case"boolean":xml.push("<boolean>");xml.push(value?"1":"0");xml.push("</boolean>");break;case"string":xml.push("<string>");xml.push(value.replace(/&/g,"&amp;").replace(/</g,"&lt;"));xml.push("</string>");break;case"object":if(value===null){xml.push("<nil/>")}else{if(value instanceof Array){xml.push("<array><data>");for(var i=0;i<value.length;i++){xml.push(this.__toXMLRPC(value[i]))}xml.push("</data></array>")}else{if(value instanceof Date){xml.push("<dateTime.iso8601>"+rpc.dateToISO8601(value)+"</dateTime.iso8601>")}else{if(value instanceof Number||value instanceof String||value instanceof Boolean){return rpc.dateToISO8601(value.valueOf())}else{xml.push("<struct>");var useHasOwn={}.hasOwnProperty?true:false;for(var key in value){if(!useHasOwn||value.hasOwnProperty(key)){xml.push("<member>");xml.push("<name>"+key+"</name>");xml.push(this.__toXMLRPC(value[key]));xml.push("</member>")}}xml.push("</struct>")}}}}break;default:throw new TypeError('Unable to convert the value of type "'+typeof(value)+'" to XML-RPC.')}xml.push("</value>");return xml.join("")};rpc.ServiceProxy.prototype.__parseXMLRPC=function(valueEl){if(valueEl.childNodes.length==1&&valueEl.childNodes.item(0).nodeType==3){return valueEl.childNodes.item(0).nodeValue}for(var i=0;i<valueEl.childNodes.length;i++){if(valueEl.childNodes.item(i).nodeType==1){var typeEL=valueEl.childNodes.item(i);switch(typeEL.nodeName.toLowerCase()){case"i4":case"int":var intVal=parseInt(typeEL.firstChild.nodeValue);if(isNaN(intVal)){throw Error("XML-RPC Parse Error: The value provided as an integer '"+typeEL.firstChild.nodeValue+"' is invalid.")}return intVal;case"double":var floatVal=parseFloat(typeEL.firstChild.nodeValue);if(isNaN(floatVal)){throw Error("XML-RPC Parse Error: The value provided as a double '"+typeEL.firstChild.nodeValue+"' is invalid.")}return floatVal;case"boolean":if(typeEL.firstChild.nodeValue!="0"&&typeEL.firstChild.nodeValue!="1"){throw Error("XML-RPC Parse Error: The value provided as a boolean '"+typeEL.firstChild.nodeValue+"' is invalid.")}return Boolean(parseInt(typeEL.firstChild.nodeValue));case"string":if(!typeEL.firstChild){return""}return typeEL.firstChild.nodeValue;case"datetime.iso8601":var matches,date=new Date(0);if(matches=typeEL.firstChild.nodeValue.match(/^(?:(\d\d\d\d)-(\d\d)(?:-(\d\d)(?:T(\d\d)(?::(\d\d)(?::(\d\d)(?:\.(\d+))?)?)?)?)?)$/)){if(matches[1]){date.setUTCFullYear(parseInt(matches[1]))}if(matches[2]){date.setUTCMonth(parseInt(matches[2]-1))}if(matches[3]){date.setUTCDate(parseInt(matches[3]))}if(matches[4]){date.setUTCHours(parseInt(matches[4]))}if(matches[5]){date.setUTCMinutes(parseInt(matches[5]))}if(matches[6]){date.setUTCMilliseconds(parseInt(matches[6]))}return date}throw Error("XML-RPC Parse Error: The provided value does not match ISO8601.");case"base64":throw Error("Not able to parse base64 data yet.");case"nil":return null;case"struct":var obj={};for(var memberEl,j=0;memberEl=typeEL.childNodes.item(j);j++){if(memberEl.nodeType==1&&memberEl.nodeName=="member"){var name="";valueEl=null;for(var child,k=0;child=memberEl.childNodes.item(k);k++){if(child.nodeType==1){if(child.nodeName=="name"){name=child.firstChild.nodeValue}else{if(child.nodeName=="value"){valueEl=child}}}}if(name&&valueEl){obj[name]=this.__parseXMLRPC(valueEl)}}}return obj;case"array":var arr=[];var dataEl=typeEL.firstChild;while(dataEl&&(dataEl.nodeType!=1||dataEl.nodeName!="data")){dataEl=dataEl.nextSibling}if(!dataEl){new Error("XML-RPC Parse Error: Expected 'data' element as sole child element of 'array'.")}valueEl=dataEl.firstChild;while(valueEl){if(valueEl.nodeType==1){if(valueEl.nodeName=="value"){arr.push(this.__parseXMLRPC(valueEl))}else{throw Error("XML-RPC Parse Error: Illegal element child '"+valueEl.nodeName+"' of an array's 'data' element.")}}valueEl=valueEl.nextSibling}return arr;default:throw Error("XML-RPC Parse Error: Illegal element '"+typeEL.nodeName+"' child of the 'value' element.")}}}return""};rpc.ServiceProxy.prototype.__getXMLRPCResponse=function(xhr,id){var response={};if(!xhr.responseXML){throw Error("Malformed XML document.")}var doc=xhr.responseXML.documentElement;if(doc.nodeName!="methodResponse"){throw Error("Invalid XML-RPC document.")}var valueEl=doc.getElementsByTagName("value")[0];if(valueEl.parentNode.nodeName=="param"&&valueEl.parentNode.parentNode.nodeName=="params"){response.result=this.__parseXMLRPC(valueEl)}else{if(valueEl.parentNode.nodeName=="fault"){var fault=this.__parseXMLRPC(valueEl);response.error={code:fault.faultCode,message:fault.faultString}}else{throw Error("Invalid XML-RPC document.")}}if(!response.result&&!response.error){throw Error("Malformed XML-RPC methodResponse document.")}response.id=id;return response};rpc.toQueryString=function(params){if(!(params instanceof Object||params instanceof Array)||params instanceof Date){throw Error("You must supply either an array or object type to convert into a query string. You supplied: "+params.constructor)}var str="";var useHasOwn={}.hasOwnProperty?true:false;for(var key in params){if(useHasOwn&&params.hasOwnProperty(key)){if(params[key] instanceof Array){for(var i=0;i<params[key].length;i++){if(str){str+="&"}str+=encodeURIComponent(key)+"=";if(params[key][i] instanceof Date){str+=encodeURIComponent(rpc.dateToISO8601(params[key][i]))}else{if(params[key][i] instanceof Object){throw Error("Unable to pass nested arrays nor objects as parameters while in making a cross-site request. The object in question has this constructor: "+params[key][i].constructor)}else{str+=encodeURIComponent(String(params[key][i]))}}}}else{if(str){str+="&"}str+=encodeURIComponent(key)+"=";if(params[key] instanceof Date){str+=encodeURIComponent(rpc.dateToISO8601(params[key]))}else{if(params[key] instanceof Object){throw Error("Unable to pass objects as parameters while in making a cross-site request. The object in question has this constructor: "+params[key].constructor)}else{str+=encodeURIComponent(String(params[key]))}}}}}return str};rpc.toArray=function(value){if(value instanceof Array){return value}var array=[];for(var i=0;i<value.length;i++){array.push(value[i])}return array};rpc.dateToISO8601=function(date){return date.getUTCFullYear()+"-"+rpc.zeroPad(date.getUTCMonth()+1)+"-"+rpc.zeroPad(date.getUTCDate())+"T"+rpc.zeroPad(date.getUTCHours())+":"+rpc.zeroPad(date.getUTCMinutes())+":"+rpc.zeroPad(date.getUTCSeconds())+"."+rpc.zeroPad(date.getUTCMilliseconds(),3)};rpc.zeroPad=function(value,width){if(!width){width=2}value=(value==undefined?"":String(value));while(value.length<width){value="0"+value}return value};if(typeof deconcept=="undefined"){var deconcept=new Object()}if(typeof deconcept.util=="undefined"){deconcept.util=new Object()}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object()}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1)}if(id){this.setAttribute("id",id)}if(w){this.setAttribute("width",w)}if(h){this.setAttribute("height",h)}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")))}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true}if(c){this.addParam("bgcolor",c)}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9)}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true)},setAttribute:function(_e,_f){this.attributes[_e]=_f},getAttribute:function(_10){return this.attributes[_10]},addParam:function(_11,_12){this.params[_11]=_12},getParams:function(){return this.params},addVariable:function(_13,_14){this.variables[_13]=_14},getVariable:function(_15){return this.variables[_15]},getVariables:function(){return this.variables},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key]}return _16},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath)}_19='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';_19+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var _1a=this.getParams();for(var key in _1a){_19+=[key]+'="'+_1a[key]+'" '}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+='flashvars="'+_1c+'"'}_19+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath)}_19='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';_19+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var _1d=this.getParams();for(var key in _1d){_19+='<param name="'+key+'" value="'+_1d[key]+'" />'}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+='<param name="flashvars" value="'+_1f+'" />'}_19+="</object>"}return _19},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title)}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}return false}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0])}catch(e){axo=null}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always"}catch(e){if(_23.major==6){return _23}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","))}}}return _23};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false}if(this.major>fv.major){return true}if(this.minor<fv.minor){return false}if(this.minor>fv.minor){return true}if(this.rev<fv.rev){return false}return true};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1))}}}return""}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){}}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs)};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id]}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;function f4a_bind(fn,scope){var scope=scope||window;var args=[];for(var i=2,len=arguments.length;i<len;++i){args.push(arguments[i])}return function(){fn.apply(scope,args)}}var globalFS;function f4a_js_flash(props){this.f4a_js_id=props.id;this.id=this.f4a_js_id+"f4a_js_flash";this.flashobj_id=this.id+"_f4a";this.swfname=props.swfname;this.swfuri=props.swfuri;this.height=1;this.width=1;this.mostRecentResponse="";if(window.log==undefined){log=function(txt){try{console.log(txt)}catch(e){}}}this.getFlash=function(){return document.getElementById(this.flashobj_id)};this.checkFlash=function(){try{return(this.getFlash().ping()=="pong")}catch(e){log(e);return false}};this.createSwfObject=function(){var so=new SWFObject(this.swfuri,this.flashobj_id,"1","1","8","#ffffff");so.addParam("allowScriptAccess","always");so.addParam("swliveconnect","true");so.write(this.f4a_js_id+"flashcontent")};this.open=function(args){var meth=args.meth;var url=args.url;var async=args.async;var user=args.user;var password=args.password;var headers=args.headers?args.headers:[];var contenttype=args.contenttype?args.contenttype:null;var data=args.data;var onready=args.onready;var fs=this.getFlash();var self=new Object();self.onload=onready;function callback(varName){if(self.onload){self.onload(varName)}}var cb=CallbackManager.registerCallback(this.id,callback);if(fs.xmlhttp==undefined){var id=window.setInterval(function(){if(fs.xmlhttp!=undefined){fs.xmlhttp(url,cb,meth,data,contenttype,headers);window.clearInterval(id)}},500)}else{window.clearInterval(id);fs.xmlhttp(url,cb,meth,data,contenttype,headers)}}}var CallbackManager=new Object();CallbackManager.callbacks={};CallbackManager.callbackIndexes={};CallbackManager.registerCallback=function(id,callback){if(!this.callbacks[id]){this.callbacks[id]=[];this.callbackIndexes[id]=0}var length=this.callbacks[id].push(function(rsp){f4a_bind(selfDeleteCallback,this,id,callback,rsp)()});this.callbackIndexes[id]=length-1;return"CallbackManager.callbacks['"+id+"']["+this.callbackIndexes[id]+"]";function selfDeleteCallback(id,callback,rsp){setTimeout(function(){callback(rsp)},0);return}};if(TrrTransversais==undefined){var TrrTransversais={Annotatio:{},Tags:{},Ranking:{},version:"1.0.0"}}TrrTransversais.Common={ssoUser:"",ssoSessionkey:"",ssoUserName:"",ssoUserEmail:"",ssoUserIdPerm:"",ssoNamespace:"",ssoLogged:"",inObject:function inObject(obj,arrFields){var z=0;var arrKeys=[];for(var key in obj){arrKeys[z]=key;z++}if(arrFields.subtraction(arrKeys)!=""){return arrFields.subtraction(arrKeys)}else{return true}},verifyLogged:function(objSso){var arrFields=["login","key","full_name","email","id_perm","status"];var result=TrrTransversais.Common.inObject(objSso,arrFields);if(result==true){if(objSso.status!="-1"){ssoUser=objSso.login;ssoSessionkey=objSso.key;ssoUserName=objSso.full_name;ssoUserEmail=objSso.email;ssoUserIdPerm=objSso.id_perm;ssoNamespace=objSso.getBrand();ssoLogged=objSso.status;return true}else{return false}}else{try{console.log("Invalid Object Sso")}catch(e){}}return false},returnParamsSso:function(parameters,objSso){if(objSso!=undefined&&objSso!=null&&objSso!=""){if(typeof(objSso)=="object"){if(this.verifyLogged(objSso)){parameters.user=ssoUser;parameters.idperm=ssoUserIdPerm;parameters.sessionkey=ssoSessionkey;parameters.namespace=ssoNamespace;parameters.fullName=ssoUserName;return parameters}}else{throw Error("Object SSO must be a Object")}}return parameters},getUrlParameter:function(name,url){if(url==undefined){url=window.location.href}name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(url);if(results==null){return""}else{return results[1]}}};String.prototype.ltrim=function(){return this.replace(/^[ ]+/,"")};String.prototype.rtrim=function(){return this.replace(/[ ]+$/,"")};String.prototype.trim=function(){return this.replace(/^ +| +$/g,"")};String.prototype.trimAll=function(){return this.replace(/\s+/g,"")};Array.prototype.clone=function(){return Array.apply(null,this)};Array.prototype.sortIt=Array.prototype.sort;Array.prototype.reverseIt=Array.prototype.reverse;Array.prototype.reverse=function(){var tmp=this.clone();return tmp.reverseIt.apply(tmp,arguments)};Array.prototype.inArray=function(value){var l=this.length;for(var i=0;i<l;i++){if(this[i]==value){return true}}return false};Array.prototype.checkIndex=function(value){var l=this.length;for(var i=0;i<l;i++){if(this[i]==value){return i}}return false};Array.prototype.remove=function(value){var where=this.checkIndex(value);this.splice(where,1)};Array.prototype.subtraction=function(array){if(typeof(array.length)!="number"||typeof(array)=="string"){array=new Array(array)}var result=new Array();var l=this.length;var l_m=array.length;for(var i=0;i<l;i++){var inarray=false;for(var m=0;m<l_m;m++){if(this[i]==array[m]){inarray=true;break}}if(!inarray){result.push(this[i])}}return result};var JGCookie={date:new Date(),set:function(name,content,days,path,domain){var expires="";var path=path||"/";var domainStr="";if(days!=undefined&&days>0){this.date.setTime(this.date.getTime()+(days*24*60*60*1000));expires=";expires="+this.date.toGMTString()+"; "}else{if(days==0){expires=";"}else{expires=";expires=Thu, 01-Jan-1970 00:00:01 GMT; "}}if(domain){domainStr=";domain="+domain+"; "}document.cookie=name+"="+content+expires+";path="+path+domainStr;return true},get:function(name){var nameE=name+"=";var cookies=document.cookie.split(";");for(var i=0,Cookie;Cookie=cookies[i];i++){while(Cookie.charAt(0)==" "){Cookie=Cookie.substring(1,Cookie.length)}if(Cookie.indexOf(nameE)==0){return Cookie.substring(nameE.length,Cookie.length)}}return false},unset:function(name,path,domain){this.set(name,"",-1,path,domain);return true}};var dateFormat=function(){var token=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,timezone=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,timezoneClip=/[^-+\dA-Z]/g,pad=function(val,len){val=String(val);len=len||2;while(val.length<len){val="0"+val}return val};return function(date,mask,utc){var dF=dateFormat;if(arguments.length==1&&(typeof date=="string"||date instanceof String)&&!/\d/.test(date)){mask=date;date=undefined}date=date?new Date(date):new Date();if(isNaN(date)){throw new SyntaxError("invalid date")}mask=String(dF.masks[mask]||mask||dF.masks["default"]);if(mask.slice(0,4)=="UTC:"){mask=mask.slice(4);utc=true}var _=utc?"getUTC":"get",d=date[_+"Date"](),D=date[_+"Day"](),m=date[_+"Month"](),y=date[_+"FullYear"](),H=date[_+"Hours"](),M=date[_+"Minutes"](),s=date[_+"Seconds"](),L=date[_+"Milliseconds"](),o=utc?0:date.getTimezoneOffset(),flags={d:d,dd:pad(d),m:m+1,mm:pad(m+1),yy:String(y).slice(2),yyyy:y,h:H%12||12,hh:pad(H%12||12),H:H,HH:pad(H),M:M,MM:pad(M),s:s,ss:pad(s),l:pad(L,3),L:pad(L>99?Math.round(L/10):L),t:H<12?"a":"p",tt:H<12?"am":"pm",T:H<12?"A":"P",TT:H<12?"AM":"PM",Z:utc?"UTC":(String(date).match(timezone)||[""]).pop().replace(timezoneClip,""),o:(o>0?"-":"+")+pad(Math.floor(Math.abs(o)/60)*100+Math.abs(o)%60,4),S:["th","st","nd","rd"][d%10>3?0:(d%100-d%10!=10)*d%10]};return mask.replace(token,function($0){return $0 in flags?flags[$0]:$0.slice(1,$0.length-1)})}}();dateFormat.masks={"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"dd/mm/yyyy' - 'HH:MM",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",generic:""};Date.prototype.format=function(mask,utc){return dateFormat(this,mask,utc)};document.getElementsByClass=function(searchClass,node,tag){var classElements=new Array();if(node==null){node=document}if(tag==null){tag="*"}var els=node.getElementsByTagName(tag);var elsLen=els.length;var pattern=new RegExp("(^|\\s)"+searchClass+"(\\s|$)");for(i=0,j=0;i<elsLen;i++){if(pattern.test(els[i].className)){classElements[j]=els[i];j++}}return classElements};TrrLog={enable:false,__verifyEnable:function(app){appLower=(app===undefined)?"":app.toLowerCase();if(TrrLog.enable===false||(appLower==undefined&&TrrLog.enable===false)){return false}if(TrrLog.enable===true||appLower===true||appLower==TrrLog.enable.toLowerCase()){return true}else{return false}},__formatMsg:function(msg,app){return(app!=undefined)?"["+app+"] "+msg:msg},log:function(msg,app){if(TrrLog.__verifyEnable(app)){msgApp=TrrLog.__formatMsg(msg,app);try{console.log(msgApp)}catch(e){try{opera.postError(msgApp)}catch(e){}}}},debug:function(msg,app){if(TrrLog.__verifyEnable(app)){msgApp=TrrLog.__formatMsg(msg,app);try{console.debug(msgApp)}catch(e){TrrLog.log("DEBUG: "+msg,app)}}},info:function(msg,app){if(TrrLog.__verifyEnable(app)){msgApp=TrrLog.__formatMsg(msg,app);try{console.info(msgApp)}catch(e){TrrLog.log("INFO: "+msg,app)}}},warn:function(msg,app){if(TrrLog.__verifyEnable(app)){msgApp=TrrLog.__formatMsg(msg,app);try{console.warn(msgApp)}catch(e){TrrLog.log("WARN: "+msg,app)}}},error:function(msg,app){if(TrrLog.__verifyEnable(app)){msgApp=TrrLog.__formatMsg(msg,app);try{console.error(msgApp)}catch(e){TrrLog.log("ERROR: "+msg,app)}}}};TrrTransversais.Annotatio.version="2.1.15";TrrTransversais.Annotatio.pubDate="Tue Mar  9 09:41:37 BRT 2010";TrrTransversais.AnnotatioAPI=function(objSso,wsUrl){var _ws=new Webservice("comments");var _wsUrl=(wsUrl)?wsUrl:undefined;if(_wsUrl){_ws.open(_wsUrl)}return{getObjectDataList:function(parameters,callback){var arrFields=[];if(parameters.urls!=undefined&&parameters.urls!="undefined"){arrFields=["urls"]}else{arrFields=["application","objects","groupPaths"]}var result=TrrTransversais.Common.inObject(parameters,arrFields);if(parameters.urls!=undefined&&typeof(parameters.urls)!="object"){throw Error("parameter 'urls': must be array >>> Method: getObjectDataList")}if(parameters.objects!=undefined&&typeof(parameters.objects)!="object"){throw Error("parameter 'objects': must be array >>> Method: getObjectDataList")}if(parameters.groupPaths!=undefined&&typeof(parameters.groupPaths)!="object"){throw Error("parameter 'groupPaths': must be array >>> Method: getObjectDataList")}if(parameters.objects!=undefined&&parameters.objects.length!=parameters.groupPaths.length){throw Error("parameter 'objects' & 'groupPaths': incorrect length >>> Method: getObjectDataList")}if(parameters.objects.length==0||parameters.groupPaths.length==0){return false}if(result==true){parameters=TrrTransversais.Common.returnParamsSso(parameters,objSso);_ws.send("GET","GetObjectDataList",parameters,callback)}else{throw Error("Missing Parameter: "+result.toString().replace(/,/g,", ")+" >>> Method: getObjectDataList")}},getTopCommentedObjects:function(parameters,callback){var arrFields=["viewSize","startIndex","startDate","endDate"];var result=TrrTransversais.Common.inObject(parameters,arrFields);if(result==true){parameters=TrrTransversais.Common.returnParamsSso(parameters,objSso);_ws.send("GET","GetTopCommentedObjects",parameters,callback)}else{throw Error("Missing Parameter: "+result.toString().replace(/,/g,", ")+" >>> Method: getTopCommentedObjects")}},listLastComments:function(parameters,callback){var arrFields=["application","pageSize","pageNum","count"];var result=TrrTransversais.Common.inObject(parameters,arrFields);if(result==true){parameters=TrrTransversais.Common.returnParamsSso(parameters,objSso);_ws.send("GET","ListLastComments",parameters,callback)}else{throw Error("Missing Parameter: "+result.toString().replace(/,/g,", ")+" >>> Method: listLastComments")}},getNumComments:function(parameters,callback){var arrFields=["application","groupPath"];var result=TrrTransversais.Common.inObject(parameters,arrFields);if(result==true){parameters=TrrTransversais.Common.returnParamsSso(parameters,objSso);_ws.send("GET","GetNumComments",parameters,callback)}else{throw Error("Missing Parameter: "+result.toString().replace(/,/g,", ")+" >>> Method: getNumComments")}},listFirstCommentOfObjects:function(parameters,callback){var arrFields=["application","objects","groupPaths","orderby"];var result=TrrTransversais.Common.inObject(parameters,arrFields);if(typeof(parameters.objects)!="object"){throw Error("parameter 'objects': must be array >>> Method: getObjectDataList")}if(typeof(parameters.groupPaths)!="object"){throw Error("parameter 'groupPaths': must be array >>> Method: getObjectDataList")}if(parameters.objects.length!=parameters.groupPaths.length){throw Error("parameter 'objects' & 'groupPaths': incorrect length >>> Method: getObjectDataList")}if(result==true){parameters=TrrTransversais.Common.returnParamsSso(parameters,objSso);_ws.send("GET","ListFirstCommentOfObjects",parameters,callback)}else{throw Error("Missing Parameter: "+result.toString().replace(/,/g,", ")+" >>> Method: listFirstCommentOfObjects")}},listObjectsByCommenter:function(parameters,callback){if(objSso&&objSso.login){parameters.user=objSso.login}if(objSso&&objSso.key){parameters.sessionkey=objSso.key}if(objSso&&objSso.getBrand()){parameters.namespace=objSso.getBrand()}var arrFields=["application","pageSize","pageNum"];var result=TrrTransversais.Common.inObject(parameters,arrFields);if(result==true){_ws.send("GET","ListObjectsByCommenter",parameters,callback)}else{throw Error("Missing Parameter: "+result.toString().replace(/,/g,", ")+" >>> Method: getObjectsByCommenter")}}}};TrrTransversais.AnnotatioObject=function(objSso,wsUrl){var _ws=new Webservice("comments");var _wsUrl=(wsUrl)?wsUrl:undefined;if(_wsUrl){_ws.open(_wsUrl)}return{listUserComments:function(parameters,callback){if(objSso&&objSso.login){parameters.user=objSso.login}if(objSso&&objSso.key){parameters.sessionkey=objSso.key}if(objSso&&objSso.getBrand()){parameters.namespace=objSso.getBrand()}var arrFields=["application","objectId","groupPath","pageSize","pageNum","orderby"];var result=TrrTransversais.Common.inObject(parameters,arrFields);if(result==true){parameters=TrrTransversais.Common.returnParamsSso(parameters,objSso);_ws.send("GET","ListUserComments",parameters,callback)}else{throw Error("Missing Parameter: "+result.toString().replace(/,/g,", ")+" >>> Method: ListUserComments")}},listComments:function(parameters,callback){var arrFields=["application","objectId","groupPath","pageSize","pageNum","orderby"];var result=TrrTransversais.Common.inObject(parameters,arrFields);if(result==true){parameters=TrrTransversais.Common.returnParamsSso(parameters,objSso);_ws.send("GET","ListComments",parameters,callback)}else{throw Error("Missing Parameter: "+result.toString().replace(/,/g,", ")+" >>> Method: listComments")}},listReplies:function(parameters,callback){var arrFields=["application","objectId","groupPath","parentId","pageSize","pageNum","orderby"];var result=TrrTransversais.Common.inObject(parameters,arrFields);if(result==true){parameters=TrrTransversais.Common.returnParamsSso(parameters,objSso);_ws.send("GET","ListReplies",parameters,callback)}else{throw Error("Missing Parameter: "+result.toString().replace(/,/g,", ")+" >>> Method: listReplies")}},insertComment:function(parameters,callback){var arrFields=["application","fullName","objectId","groupPath","text","enteredKey","captchaKey","groupPath","uri","objectDescription","objectType"];var result=TrrTransversais.Common.inObject(parameters,arrFields);if(result==true){parameters=TrrTransversais.Common.returnParamsSso(parameters,objSso);_ws.send("POST","InsertComment",parameters,callback)}else{throw Error("Missing Parameter: "+result.toString().replace(/,/g,", ")+" >>> Method: insertComment")}},replyComment:function(parameters,callback){if(objSso&&objSso.full_name){parameters.fullName=objSso.full_name}var arrFields=["application","fullName","objectId","groupPath","text","enteredKey","captchaKey","parentId"];var result=TrrTransversais.Common.inObject(parameters,arrFields);if(result==true){parameters=TrrTransversais.Common.returnParamsSso(parameters,objSso);_ws.send("POST","ReplyComment",parameters,callback)}else{throw Error("Missing Parameter: "+result.toString().replace(/,/g,", ")+" >>> Method: replyComment")}},getCaptchaKey:function(callback){_ws.send("GET","getCaptchaKey",{},callback)},updateScore:function(parameters,callback){var arrFields=["objectId","groupPath","commentId","oper"];var result=TrrTransversais.Common.inObject(parameters,arrFields);if(result==true){parameters=TrrTransversais.Common.returnParamsSso(parameters,objSso);_ws.send("GET","UpdateScore",parameters,callback)}else{throw Error("Missing Parameter: "+result.toString().replace(/,/g,", ")+" >>> Method: updateScore")}},TwitterRequestToken:function(parameters,callback){parameters.format="json";_ws.send("GET","TwitterRequestToken",parameters,callback)},TwitterVerifyCredentials:function(parameters,callback){parameters.format="json";_ws.send("GET","TwitterVerifyCredentials",parameters,callback)},twitterEndSession:function(parameters,callback){parameters.format="json";_ws.send("GET","TwitterEndSession",parameters,callback)},twitterSetRedirectData:function(parameters,callback){var arrFields=["token","url","formName"];var result=TrrTransversais.Common.inObject(parameters,arrFields);if(result==true){_ws.send("GET","TwitterSetRedirectData",parameters,callback)}else{throw Error("Missing Parameter: "+result.toString().replace(/,/g,", ")+" >>> Method: twitterSetRedirectData")}},twitterGetRedirectData:function(parameters,callback){var arrFields=["token"];var result=TrrTransversais.Common.inObject(parameters,arrFields);if(result==true){_ws.send("GET","TwitterGetRedirectData",parameters,callback)}else{throw Error("Missing Parameter: "+result.toString().replace(/,/g,", ")+" >>> Method: twitterGetRedirectData")}}}};