callback/ack service");}if(serviceName===DEFAULT_NAME){throw new Error("Cannot overwrite default service:"+" use registerDefault");}services[serviceName]=handler;},unregister:function(serviceName){if(serviceName===CALLBACK_NAME||serviceName===ACK){throw new Error("Cannot delete callback/ack service");}if(serviceName===DEFAULT_NAME){throw new Error("Cannot delete default service:"+" use unregisterDefault");}delete services[serviceName];},registerDefault:function(handler){services[DEFAULT_NAME]=handler;},unregisterDefault:function(){delete services[DEFAULT_NAME];},forceParentVerifiable:function(){if(!transport.isParentVerifiable()){transport=gadgets.rpctx.ifpc;}},call:function(targetId,serviceName,callback,var_args){targetId=targetId||'..';var from='..';if(targetId==='..'){from=rpcId;}++callId;if(callback){callbacks[callId]=callback;}var rpc={s:serviceName,f:from,c:callback?callId:0,a:Array.prototype.slice.call(arguments,3),t:authToken[targetId],l:useLegacyProtocol[targetId]};if(targetId!=='..'&&!document.getElementById(targetId)){gadgets.log("WARNING: attempted send to nonexistent frame: "+targetId);return;}if(callSameDomain(targetId,rpc)){return;}var channel=receiverTx[targetId];if(!channel){if(!earlyRpcQueue[targetId]){earlyRpcQueue[targetId]=[rpc];}else{earlyRpcQueue[targetId].push(rpc);}return;}if(useLegacyProtocol[targetId]){channel=gadgets.rpctx.ifpc;}if(channel.call(targetId,from,rpc)===false){receiverTx[targetId]=fallbackTransport;transport.call(targetId,from,rpc);}},getRelayUrl:function(targetId){var url=relayUrl[targetId];if(url&&url.substring(0,1)==='/'){if(url.substring(1,2)==='/'){url=document.location.protocol+url;}else{url=document.location.protocol+'//'+document.location.host+url;}}return url;},setRelayUrl:setRelayUrl,setAuthToken:setAuthToken,setupReceiver:setupReceiver,getAuthToken:getAuthToken,removeReceiver:function(receiverId){delete relayUrl[receiverId];delete useLegacyProtocol[receiverId];delete authToken[receiverId];delete setup[receiverId];delete sameDomain[receiverId];delete receiverTx[receiverId];},getRelayChannel:function(){return transport.getCode();},receive:function(fragment,otherWindow){if(fragment.length>4){process(gadgets.json.parse(decodeURIComponent(fragment[fragment.length-1])));}else{relayOnload.apply(null,fragment.concat(otherWindow));}},receiveSameDomain:function(rpc){rpc.a=Array.prototype.slice.call(rpc.a);window.setTimeout(function(){process(rpc);},0);},getOrigin:getOrigin,getReceiverOrigin:function(receiverId){var channel=receiverTx[receiverId];if(!channel){return null;}if(!channel.isParentVerifiable(receiverId)){return null;}var origRelay=gadgets.rpc.getRelayUrl(receiverId)||gadgets.util.getUrlParameters().parent;return gadgets.rpc.getOrigin(origRelay);},init:function(){if(transport.init(process,transportReady)===false){transport=fallbackTransport;}if(isChild){setupReceiver('..');}},_getTargetWin:getTargetWin,_createRelayIframe:function(token,data){var relay=gadgets.rpc.getRelayUrl('..');if(!relay){return null;}var src=relay+'#..&'+rpcId+'&'+token+'&'+encodeURIComponent(gadgets.json.stringify(data));var iframe=document.createElement('iframe');iframe.style.border=iframe.style.width=iframe.style.height='0px';iframe.style.visibility='hidden';iframe.style.position='absolute';function appendFn(){document.body.appendChild(iframe);iframe.src='javascript:"<html></html>"';iframe.src=src;}if(document.body){appendFn();}else{gadgets.util.registerOnLoadHandler(function(){appendFn();});}return iframe;},ACK:ACK,RPC_ID:rpcId,SEC_ERROR_LOAD_TIMEOUT:LOAD_TIMEOUT,SEC_ERROR_FRAME_PHISH:FRAME_PHISH,SEC_ERROR_FORGED_MSG:FORGED_MSG};}();gadgets.rpc.init();}gadgets.rpc.register('update_security_token',function(token){shindig.auth.updateSecurityToken(token);});gadgets.window=gadgets.window||{};(function(){var oldHeight;function parseIntFromElemPxAttribute(elem,attr){var style=window.getComputedStyle(elem,"");var value=style.getPropertyValue(attr);value.match(/^([0-9]+)/);return parseInt(RegExp.$1,10);}function getHeightForWebkit(){var result=0;var queue=[document.body];while(queue.length>0){var elem=queue.shift();var children=elem.childNodes;for(var i=0;i<children.length;i++){var child=children[i];if(typeof child.offsetTop!=='undefined'&&typeof child.scrollHeight!=='undefined'){var bottom=child.offsetTop+child.scrollHeight+parseIntFromElemPxAttribute(child,"margin-bottom");result=Math.max(result,bottom);}queue.push(child);}}return result+parseIntFromElemPxAttribute(document.body,"border-bottom")+parseIntFromElemPxAttribute(document.body,"margin-bottom")+parseIntFromElemPxAttribute(document.body,"padding-bottom");}gadgets.window.adjustHeight=function(opt_height){var newHeight=parseInt(opt_height,10);var heightAutoCalculated=false;if(isNaN(newHeight)){heightAutoCalculated=true;var vh=gadgets.window.getViewportDimensions().height;var body=document.body;var docEl=document.documentElement;if(document.compatMode==='CSS1Compat'&&docEl.scrollHeight){newHeight=docEl.scrollHeight!==vh?docEl.scrollHeight:docEl.offsetHeight;}else if(navigator.userAgent.indexOf('AppleWebKit')>=0){newHeight=getHeightForWebkit();}else if(body&&docEl){var sh=docEl.scrollHeight;var oh=docEl.offsetHeight;if(docEl.clientHeight!==oh){sh=body.scrollHeight;oh=body.offsetHeight;}if(sh>vh){newHeight=sh>oh?sh:oh;}else{newHeight=sh<oh?sh:oh;}}}if(!isNaN(newHeight)&&!(heightAutoCalculated&&newHeight===0)){oldHeight=newHeight;document.getElementById("iframe_proxy").src="http://apps.337.com/proxy.html?rand="+Math.random()+"#"+newHeight;}};}());var _IG_AdjustIFrameHeight=gadgets.window.adjustHeight;var tamings___=tamings___||[];tamings___.push(function(imports){caja___.whitelistFuncs([[gadgets.window,'adjustHeight'],[gadgets.window,'getViewportDimensions']]);});window['FieldTranslations']=(function(){function translateEnumJson(enumJson){if(enumJson){enumJson.key=enumJson.value;}};function translateUrlJson(urlJson){if(urlJson){urlJson.address=urlJson.value;}};return{'translateEnumJson':translateEnumJson,'translateUrlJson':translateUrlJson,'translateServerPersonToJsPerson':function(serverJson,opt_params){if(serverJson.emails){for(var i=0;i<serverJson.emails.length;i++){serverJson.emails[i].address=serverJson.emails[i].value;}}if(serverJson.phoneNumbers){for(var p=0;p<serverJson.phoneNumbers.length;p++){serverJson.phoneNumbers[p].number=serverJson.phoneNumbers[p].value;}}if(serverJson.birthday){serverJson.dateOfBirth=serverJson.birthday;}if(serverJson.utcOffset){serverJson.timeZone=serverJson.utcOffset;}if(serverJson.addresses){for(var j=0;j<serverJson.addresses.length;j++){serverJson.addresses[j].unstructuredAddress=serverJson.addresses[j].formatted;}}if(serverJson.gender){var key=serverJson.gender=='male'?'MALE':(serverJson.gender=='female')?'FEMALE':null;serverJson.gender={key:key,displayValue:serverJson.gender};}translateUrlJson(serverJson.profileSong);translateUrlJson(serverJson.profileVideo);if(serverJson.urls){for(var u=0;u<serverJson.urls.length;u++){translateUrlJson(serverJson.urls[u]);}}translateEnumJson(serverJson.drinker);translateEnumJson(serverJson.lookingFor);translateEnumJson(serverJson.networkPresence);translateEnumJson(serverJson.smoker);if(serverJson.organizations){serverJson.jobs=[];serverJson.schools=[];for(var o=0;o<serverJson.organizations.length;o++){var org=serverJson.organizations[o];if(org.type=='job'){serverJson.jobs.push(org);}else if(org.type=='school'){serverJson.schools.push(org);}}}if(serverJson.name){serverJson.name.unstructured=serverJson.name.formatted;}if(serverJson.appData){serverJson.appData=opensocial.Container.escape(serverJson.appData,opt_params,true);}},'translateJsPersonFieldsToServerFields':function(fields){for(var i=0;i<fields.length;i++){if(fields[i]=='dateOfBirth'){fields[i]='birthday';}else if(fields[i]=='timeZone'){fields[i]='utcOffset';}else if(fields[i]=='jobs'){fields[i]='organizations';}else if(fields[i]=='schools'){fields[i]='organizations';}}fields.push('id');fields.push('displayName');},'translateIsoStringToDate':function(isoString){var regexp='([0-9]{4})(-([0-9]{2})(-([0-9]{2})'+'(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?'+'(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?';var d=isoString.match(new RegExp(regexp));var offset=0;var date=new Date(d[1],0,1);if(d[3]){date.setMonth(d[3]-1);}if(d[5]){date.setDate(d[5]);}if(d[7]){date.setHours(d[7]);}if(d[8]){date.setMinutes(d[8]);}if(d[10]){date.setSeconds(d[10]);}if(d[12]){date.setMilliseconds(Number("0."+d[12])*1000);}if(d[14]){offset=(Number(d[16])*60)+Number(d[17]);offset*=((d[15]=='-')?1:-1);}offset-=date.getTimezoneOffset();var time=(Number(date)+(offset*60*1000));return new Date(Number(time));},'addAppDataAsProfileFields':function(opt_params){if(opt_params){if(opt_params['appData']){var appDataKeys=opt_params['appData'];if(typeof appDataKeys==='string'){appDataKeys=[appDataKeys];}var profileDetail=opt_params['profileDetail']||[];for(var i=0;i<appDataKeys.length;i++){if(appDataKeys[i]==='*'){profileDetail.push('appData');}else{profileDetail.push('appData.'+appDataKeys[i]);}}opt_params['appData']=appDataKeys;}}},'translateStandardArguments':function(opt_params,rpc_params){if(opt_params['first']){rpc_params.startIndex=opt_params['first'];}if(opt_params['max']){rpc_params.count=opt_params['max'];}if(opt_params['sortOrder']){rpc_params.sortBy=opt_params['sortOrder'];}if(opt_params['filter']){rpc_params.filterBy=opt_params['filter'];}if(opt_params['filterOp']){rpc_params.filterOp=opt_params['filterOp'];}if(opt_params['filterValue']){rpc_params.filterValue=opt_params['filterValue'];}if(opt_params['fields']){rpc_params.fields=opt_params['fields'];}},'translateNetworkDistance':function(idSpec,rpc_params){if(idSpec.getField('networkDistance')){rpc_params.networkDistance=idSpec.getField('networkDistance');}}};})();var JsonActivity=function(opt_params,opt_skipConversions){opt_params=opt_params||{};if(!opt_skipConversions){JsonActivity.constructArrayObject(opt_params,"mediaItems",JsonMediaItem);}opensocial.Activity.call(this,opt_params);};JsonActivity.inherits(opensocial.Activity);JsonActivity.prototype.toJsonObject=function(){var jsonObject=JsonActivity.copyFields(this.fields_);var oldMediaItems=jsonObject['mediaItems']||[];var newMediaItems=[];for(var i=0;i<oldMediaItems.length;i++){newMediaItems[i]=oldMediaItems[i].toJsonObject();}jsonObject['mediaItems']=newMediaItems;return jsonObject;};var JsonMediaItem=function(opt_params){opensocial.MediaItem.call(this,opt_params['mimeType'],opt_params['url'],opt_params);};JsonMediaItem.inherits(opensocial.MediaItem);JsonMediaItem.prototype.toJsonObject=function(){return JsonActivity.copyFields(this.fields_);};JsonActivity.constructArrayObject=function(map,fieldName,className){var fieldValue=map[fieldName];if(fieldValue){for(var i=0;i<fieldValue.length;i++){fieldValue[i]=new className(fieldValue[i]);}}};JsonActivity.copyFields=function(oldObject){var newObject={};for(var field in oldObject){newObject[field]=oldObject[field];}return newObject;};var JsonPerson=function(opt_params){opt_params=opt_params||{};JsonPerson.constructObject(opt_params,"bodyType",opensocial.BodyType);JsonPerson.constructObject(opt_params,"currentLocation",opensocial.Address);JsonPerson.constructObject(opt_params,"name",opensocial.Name);JsonPerson.constructObject(opt_params,"profileSong",opensocial.Url);JsonPerson.constructObject(opt_params,"profileVideo",opensocial.Url);JsonPerson.constructDate(opt_params,"dateOfBirth");JsonPerson.constructArrayObject(opt_params,"addresses",opensocial.Address);JsonPerson.constructArrayObject(opt_params,"emails",opensocial.Email);JsonPerson.constructArrayObject(opt_params,"jobs",opensocial.Organization);JsonPerson.constructArrayObject(opt_params,"phoneNumbers",opensocial.Phone);JsonPerson.constructArrayObject(opt_params,"schools",opensocial.Organization);JsonPerson.constructArrayObject(opt_params,"urls",opensocial.Url);JsonPerson.constructEnum(opt_params,"gender");JsonPerson.constructEnum(opt_params,"smoker");JsonPerson.constructEnum(opt_params,"drinker");JsonPerson.constructEnum(opt_params,"networkPresence");JsonPerson.constructEnumArray(opt_params,"lookingFor");opensocial.Person.call(this,opt_params,opt_params['isOwner'],opt_params['isViewer']);};JsonPerson.inherits(opensocial.Person);JsonPerson.constructEnum=function(map,fieldName){var fieldValue=map[fieldName];if(fieldValue){map[fieldName]=new opensocial.Enum(fieldValue.key,fieldValue.displayValue);}};JsonPerson.constructEnumArray=function(map,fieldName){var fieldValue=map[fieldName];if(fieldValue){for(var i=0;i<fieldValue.length;i++){fieldValue[i]=new opensocial.Enum(fieldValue[i].key,fieldValue[i].displayValue);}}};JsonPerson.constructObject=function(map,fieldName,className){var fieldValue=map[fieldName];if(fieldValue){map[fieldName]=new className(fieldValue);}};JsonPerson.constructDate=function(map,fieldName){var fieldValue=map[fieldName];if(fieldValue){map[fieldName]=FieldTranslations.translateIsoStringToDate(fieldValue);}};JsonPerson.constructArrayObject=function(map,fieldName,className){var fieldValue=map[fieldName];if(fieldValue){for(var i=0;i<fieldValue.length;i++){fieldValue[i]=new className(fieldValue[i]);}}};JsonPerson.prototype.getDisplayName=function(){return this.getField("displayName");};JsonPerson.prototype.getAppData=function(key){var appData=this.getField("appData");return appData&&appData[key];};var JsonMessageCollection=function(opt_params){opt_params=opt_params||{};opensocial.MessageCollection.call(this,opt_params);};JsonMessageCollection.inherits(opensocial.MessageCollection);JsonMessageCollection.prototype.toJsonObject=function(){return JsonMessageCollection.copyFields(this.fields_);};JsonMessageCollection.copyFields=function(oldObject){var newObject={};for(var field in oldObject){newObject[field]=oldObject[field];}return newObject;};var JsonMessage=function(body,opt_params){opt_params=opt_params||{};opensocial.Message.call(this,body,opt_params);};JsonMessage.inherits(opensocial.Message);JsonMessage.prototype.toJsonObject=function(){return JsonMessage.copyFields(this.fields_);};JsonMessage.copyFields=function(oldObject){var newObject={};for(var field in oldObject){newObject[field]=oldObject[field];}return newObject;};var JsonRpcContainer=function(configParams){opensocial.Container.call(this);var path=configParams.path;this.path_=path.replace("%host%",document.location.host);var invalidatePath=configParams.invalidatePath;this.invalidatePath_=invalidatePath.replace("%host%",document.location.host);var supportedFieldsArray=configParams.supportedFields;var supportedFieldsMap={};for(var objectType in supportedFieldsArray){if(supportedFieldsArray.hasOwnProperty(objectType)){supportedFieldsMap[objectType]={};for(var i=0;i<supportedFieldsArray[objectType].length;i++){var supportedField=supportedFieldsArray[objectType][i];supportedFieldsMap[objectType][supportedField]=true;}}}this.environment_=new opensocial.Environment(configParams.domain,supportedFieldsMap);this.securityToken_=shindig.auth.getSecurityToken();gadgets.rpc.register('shindig.requestShareApp_callback',JsonRpcContainer.requestShareAppCallback_);};var JsonRpcRequestItem=function(rpc,opt_processData){this.rpc=rpc;this.processData=opt_processData||function(rawJson){return rawJson;};this.processResponse=function(originalDataRequest,rawJson,error,errorMessage){var errorCode=error?JsonRpcContainer.translateHttpError(error['code']):null;return new opensocial.ResponseItem(originalDataRequest,error?null:this.processData(rawJson),errorCode,errorMessage);};};(function(){var callbackIdStore={};JsonRpcContainer.inherits(opensocial.Container);JsonRpcContainer.prototype.getEnvironment=function(){return this.environment_;};JsonRpcContainer.prototype.requestShareApp=function(recipientIds,reason,opt_callback,opt_params){var callbackId="cId_"+Math.random();callbackIdStore[callbackId]=opt_callback;var body=gadgets.util.unescapeString(reason.getField(opensocial.Message.Field.BODY));if(!body||body.length===0){var bodyMsgKey=gadgets.util.unescapeString(reason.getField(opensocial.Message.Field.BODY_ID));body=gadgets.Prefs.getMsg(bodyMsgKey);}gadgets.rpc.call('..','shindig.requestShareApp',null,callbackId,recipientIds,body);};JsonRpcContainer.requestShareAppCallback_=function(callbackId,success,opt_errorCode,recipientIds){callback=callbackIdStore[callbackId];if(callback){callbackIdStore[callbackId]=null;var data=null;if(recipientIds){data={'recipientIds':recipientIds};}var responseItem=new opensocial.ResponseItem(null,data,opt_errorCode);callback(responseItem);}};JsonRpcContainer.prototype.requestCreateActivity=function(activity,priority,opt_callback){opt_callback=opt_callback||function(){};var req=opensocial.newDataRequest();var viewer=opensocial.newIdSpec({'userId':'VIEWER'});req.add(this.newCreateActivityRequest(viewer,activity),'key');req.send(function(response){opt_callback(response.get('key'));});};JsonRpcContainer.prototype.requestData=function(dataRequest,callback){callback=callback||function(){};var requestObjects=dataRequest.getRequestObjects();var totalRequests=requestObjects.length;if(totalRequests===0){window.setTimeout(function(){callback(new opensocial.DataResponse({},true));},0);return;}var jsonBatchData=new Array(totalRequests);for(var j=0;j<totalRequests;j++){var requestObject=requestObjects[j];jsonBatchData[j]=requestObject.request.rpc;if(requestObject.key){jsonBatchData[j].id=requestObject.key;}}var sendResponse=function(result){if(result.errors[0]){JsonRpcContainer.generateErrorResponse(result,requestObjects,callback);return;}result=result.result||result.data;var globalError=false;var responseMap={};for(var i=0;i<result.length;i++){result[result[i].id]=result[i];}for(var k=0;k<requestObjects.length;k++){var request=requestObjects[k];var response=result[k];if(request.key&&response.id!==request.key){throw"Request key("+request.key+") and response id("+response.id+") do not match";}var rawData=response.result||response.data;var error=response.error;var errorMessage="";if(error){errorMessage=error.message;}var processedData=request.request.processResponse(request.request,rawData,error,errorMessage);globalError=globalError||processedData.hadError();if(request.key){responseMap[request.key]=processedData;}}var dataResponse=new opensocial.DataResponse(responseMap,globalError);callback(dataResponse);};var makeRequestParams={"CONTENT_TYPE":"JSON","METHOD":"POST","AUTHORIZATION":"SIGNED","POST_DATA":gadgets.json.stringify(jsonBatchData)};var url=[this.path_];var token=shindig.auth.getSecurityToken();if(token){url.push("?st=",encodeURIComponent(token));}this.sendRequest(url.join(''),sendResponse,makeRequestParams,"application/json");};JsonRpcContainer.prototype.sendRequest=function(relativeUrl,callback,params,contentType){gadgets.io.makeNonProxiedRequest(relativeUrl,callback,params,contentType);};JsonRpcContainer.generateErrorResponse=function(result,requestObjects,callback){var globalErrorCode=JsonRpcContainer.translateHttpError(result.rc||result.result.error||result.data.error)||opensocial.ResponseItem.Error.INTERNAL_ERROR;var errorResponseMap={};for(var i=0;i<requestObjects.length;i++){errorResponseMap[requestObjects[i].key]=new opensocial.ResponseItem(requestObjects[i].request,null,globalErrorCode);}callback(new opensocial.DataResponse(errorResponseMap,true));};JsonRpcContainer.translateHttpError=function(httpError){if(httpError==501){return opensocial.ResponseItem.Error.NOT_IMPLEMENTED;}else if(httpError==401){return opensocial.ResponseItem.Error.UNAUTHORIZED;}else if(httpError==403){return opensocial.ResponseItem.Error.FORBIDDEN;}else if(httpError==400){return opensocial.ResponseItem.Error.BAD_REQUEST;}else if(httpError==500){return opensocial.ResponseItem.Error.INTERNAL_ERROR;}else if(httpError==404){return opensocial.ResponseItem.Error.BAD_REQUEST;}else if(httpError==417){return opensocial.ResponseItem.Error.LIMIT_EXCEEDED;}};JsonRpcContainer.prototype.makeIdSpec=function(id){return opensocial.newIdSpec({'userId':id});};JsonRpcContainer.prototype.translateIdSpec=function(newIdSpec){var userIds=newIdSpec.getField('userId');var groupId=newIdSpec.getField('groupId');if(!opensocial.Container.isArray(userIds)){userIds=[userIds];}for(var i=0;i<userIds.length;i++){if(userIds[i]==='OWNER'){userIds[i]='@owner';}else if(userIds[i]==='VIEWER'){userIds[i]='@viewer';}}if(groupId==='FRIENDS'){groupId="@friends";}else if(groupId=='ALL'){groupId="@all";}else if(groupId==='SELF'||!groupId){groupId="@self";}return{userId:userIds,groupId:groupId};};JsonRpcContainer.prototype.newFetchPersonRequest=function(id,opt_params){var peopleRequest=this.newFetchPeopleRequest(this.makeIdSpec(id),opt_params);var me=this;return new JsonRpcRequestItem(peopleRequest.rpc,function(rawJson){return me.createPersonFromJson(rawJson,opt_params);});};JsonRpcContainer.prototype.newFetchPeopleRequest=function(idSpec,opt_params){var rpc={method:"people.get"};rpc.params=this.translateIdSpec(idSpec);FieldTranslations.addAppDataAsProfileFields(opt_params);FieldTranslations.translateStandardArguments(opt_params,rpc.params);FieldTranslations.translateNetworkDistance(idSpec,rpc.params);if(opt_params['profileDetail']){FieldTranslations.translateJsPersonFieldsToServerFields(opt_params['profileDetail']);rpc.params.fields=opt_params['profileDetail'];}var me=this;return new JsonRpcRequestItem(rpc,function(rawJson){var jsonPeople;if(rawJson['list']){jsonPeople=rawJson['list'];}else{jsonPeople=[rawJson];}var people=[];for(var i=0;i<jsonPeople.length;i++){people.push(me.createPersonFromJson(jsonPeople[i],opt_params));}return new opensocial.Collection(people,rawJson['startIndex'],rawJson['totalResults']);});};JsonRpcContainer.prototype.createPersonFromJson=function(serverJson,opt_params){FieldTranslations.translateServerPersonToJsPerson(serverJson,opt_params);return new JsonPerson(serverJson);};JsonRpcContainer.prototype.getFieldsList=function(keys){if(this.hasNoKeys(keys)||this.isWildcardKey(keys[0])){return[];}else{return keys;}};JsonRpcContainer.prototype.hasNoKeys=function(keys){return!keys||keys.length===0;};JsonRpcContainer.prototype.isWildcardKey=function(key){return key==="*";};JsonRpcContainer.prototype.newFetchPersonAppDataRequest=function(idSpec,keys,opt_params){var rpc={method:"appdata.get"};rpc.params=this.translateIdSpec(idSpec);rpc.params.appId="@app";rpc.params.fields=this.getFieldsList(keys);FieldTranslations.translateNetworkDistance(idSpec,rpc.params);return new JsonRpcRequestItem(rpc,function(appData){return opensocial.Container.escape(appData,opt_params,true);});};JsonRpcContainer.prototype.newUpdatePersonAppDataRequest=function(key,value){var rpc={method:"appdata.update"};rpc.params={userId:["@viewer"],groupId:"@self"};rpc.params.appId="@app";rpc.params.data={};rpc.params.data[key]=value;rpc.params.fields=key;return new JsonRpcRequestItem(rpc);};JsonRpcContainer.prototype.newRemovePersonAppDataRequest=function(keys){var rpc={method:"appdata.delete"};rpc.params={userId:["@viewer"],groupId:"@self"};rpc.params.appId="@app";rpc.params.fields=this.getFieldsList(keys);return new JsonRpcRequestItem(rpc);};JsonRpcContainer.prototype.newFetchActivitiesRequest=function(idSpec,opt_params){var rpc={method:"activities.get"};rpc.params=this.translateIdSpec(idSpec);rpc.params.appId="@app";FieldTranslations.translateStandardArguments(opt_params,rpc.params);FieldTranslations.translateNetworkDistance(idSpec,rpc.params);return new JsonRpcRequestItem(rpc,function(rawJson){rawJson=rawJson['list'];var activities=[];for(var i=0;i<rawJson.length;i++){activities.push(new JsonActivity(rawJson[i]));}return new opensocial.Collection(activities);});};JsonRpcContainer.prototype.newActivity=function(opt_params){return new JsonActivity(opt_params,true);};JsonRpcContainer.prototype.newMediaItem=function(mimeType,url,opt_params){opt_params=opt_params||{};opt_params['mimeType']=mimeType;opt_params['url']=url;return new JsonMediaItem(opt_params);};JsonRpcContainer.prototype.newCreateActivityRequest=function(idSpec,activity){var rpc={method:"activities.create"};rpc.params=this.translateIdSpec(idSpec);rpc.params.appId="@app";FieldTranslations.translateNetworkDistance(idSpec,rpc.params);rpc.params.activity=activity.toJsonObject();return new JsonRpcRequestItem(rpc);};JsonRpcContainer.prototype.invalidateCache=function(){var rpc={method:"cache.invalidate"};var invalidationKeys={invalidationKeys:["@viewer"]};rpc.params=invalidationKeys;var makeRequestParams={"CONTENT_TYPE":"JSON","METHOD":"POST","AUTHORIZATION":"SIGNED","POST_DATA":gadgets.json.stringify(rpc)};var url=[this.invalidatePath_];var token=shindig.auth.getSecurityToken();if(token){url.push("?st=",encodeURIComponent(token));}this.sendRequest(url.join(''),null,makeRequestParams,"application/json");};})();JsonRpcContainer.prototype.newMessage=function(body,opt_params){return new JsonMessage(body,opt_params);};JsonRpcContainer.prototype.newMessageCollection=function(opt_params){return new JsonMessageCollection(opt_params);};JsonRpcContainer.prototype.newFetchMessageCollectionsRequest=function(idSpec,opt_params){var rpc={method:"messages.get"};rpc.params=this.translateIdSpec(idSpec);return new JsonRpcRequestItem(rpc,function(rawJson){rawJson=rawJson['list'];var messagecollections=[];for(var i=0;i<rawJson.length;i++){messagecollections.push(new JsonMessageCollection(rawJson[i]));}return new opensocial.Collection(messagecollections);});};JsonRpcContainer.prototype.newFetchMessagesRequest=function(idSpec,msgCollId,opt_params){var rpc={method:"messages.get"};rpc.params=this.translateIdSpec(idSpec);rpc.params.msgCollId=msgCollId;return new JsonRpcRequestItem(rpc,function(rawJson){rawJson=rawJson['list'];var messages=[];for(var i=0;i<rawJson.length;i++){messages.push(new JsonMessage(rawJson[i]));}return new opensocial.Collection(messages);});};var requiredConfig={"path":gadgets.config.NonEmptyStringValidator,"invalidatePath":gadgets.config.NonEmptyStringValidator,"domain":gadgets.config.NonEmptyStringValidator,"enableCaja":gadgets.config.BooleanValidator,"supportedFields":gadgets.config.ExistsValidator};gadgets.config.register("opensocial",requiredConfig,function(config){ShindigContainer=function(){JsonRpcContainer.call(this,config["opensocial"]);};ShindigContainer.inherits(JsonRpcContainer);opensocial.Container.setContainer(new ShindigContainer());});opensocial.DataRequest.prototype.newUpdatePersonAppDataRequest_09=opensocial.DataRequest.prototype.newUpdatePersonAppDataRequest;opensocial.DataRequest.prototype.newUpdatePersonAppDataRequest=function(id,key,value){if(id!==opensocial.IdSpec.PersonId.VIEWER){throw Error("Cannot update app data for person "+id);}return this.newUpdatePersonAppDataRequest_09(key,value);};opensocial.DataRequest.prototype.newRemovePersonAppDataRequest_09=opensocial.DataRequest.prototype.newRemovePersonAppDataRequest;opensocial.DataRequest.prototype.newRemovePersonAppDataRequest=function(id,keys){if(id!==opensocial.IdSpec.PersonId.VIEWER){throw Error("Cannot remove app data for person "+id);}return this.newRemovePersonAppDataRequest_09(keys);};gadgets.config.init({"core.io":{"proxyUrl":"\/\/%host%\/gadgets\/proxy?container=default&refresh=%refresh%&url=%url%%rewriteMime%","jsonProxyUrl":"\/\/%host%\/gadgets\/makeRequest"},"rpc":{"parentRelayUrl":"\/container\/rpc_relay.html","useLegacyProtocol":false},"opensocial":{"path":"http:\/\/%host%\/rpc","invalidatePath":"http:\/\/%host%\/rpc","domain":"shindig","enableCaja":false,"supportedFields":{"person":["id",{"name":["familyName","givenName","unstructured"]},"thumbnailUrl","profileUrl"],"activity":["appId","body","bodyId","externalId","id","mediaItems","postedTime","priority","streamFaviconUrl","streamSourceUrl","streamTitle","streamUrl","templateParams","title","url","userId"],"album":["id","thumbnailUrl","title","description","location","ownerId"],"mediaItem":["album_id","created","description","duration","file_size","id","language","last_updated","location","mime_type","num_comments","num_views","num_votes","rating","start_time","tagged_people","tags","thumbnail_url","title","type","url"]}},"core.util":{"core.none":{},"globals":{},"core.config":{},"core.json":{},"core.log":{},"core.util":{},"core.prefs":{},"shindig.auth":{},"core.io":{},"core.legacy":{},"core":{},"dynamic-height.util":{},"locked-domain":{},"opensocial-reference":{},"rpc":{},"auth-refresh":{},"dynamic-height":{},"opensocial-base":{},"security-token":{},"opensocial-jsonrpc":{},"opensocial":{},"opensocial-0.9":{},"opensocial-0.8":{}},"osapi.services":{"gadgets.rpc":["container.listMethods"],"http:\/\/%host%\/rpc":["messages.update","albums.update","activities.delete","activities.update","activities.supportedFields","albums.get","activities.get","mediaitems.update","messages.get","appdata.get","system.listMethods","people.supportedFields","messages.create","mediaitems.delete","mediaitems.create","people.get","people.create","albums.delete","messages.delete","appdata.update","activities.create","mediaitems.get","albums.create","appdata.delete","people.update","appdata.create"],"http:\/\/%host%\/gadgets\/api\/rpc":["cache.invalidate","http.head","http.get","http.put","http.post","http.delete"]}});gadgets.Prefs.setMessages_([]);gadgets.Prefs.setDefaultPrefs_([]);gadgets.io.preloaded_ = {};</script></head><body> <link rel="stylesheet" href="jquery-ui.css" type="text/css" media="all"> <script type="text/javascript" src="jquery.min-1.4.2.js"></script> <script type="text/javascript" src="jquery-ui.min.js"></script> <script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript" src="init.js"></script> <script type="text/javascript" src="jquery.cookie.js" language="javascript"></script> <script src="elex_all.js"></script> <center> <div id="flash"> <style type="text/css"><!--body { background-color:;}div, form, img, ul, ol, li, dl, dt, dd, p {border: 0 none; margin: 0; padding: 0;}.GameWrap { margin: 0 auto; position: relative;}#gamebody {text-align: left;}#elexFlash {height: 0;margin: 0 auto;position: relative;width: 0;}#elexFlash .elexSwf {position: absolute; z-index: 0;}#elexFlash .elexSwf .elexSwfImg {display: none;left: 0;position: absolute;top: 0;}--></style><div id="gamebody"> <!--game main--> <div class="GameWrap" style="width: 1263px; height: 673px; "> <div id="elexFlash"> <div class="elexSwf" style="top: 0px; width: 1263px; height: 673px; left: -631px; "> <object type="application/x-shockwave-flash" id="lp_main_flash" name="lp_main_flash" data="http://p.img.337.com/337/lp/ddtank_pt.swf?v=201109021546" width="100%" height="100%" style="visibility: visible; "><param name="menu" value="false"><param name="allowFullScreen" value="true"><param name="scale" value="noscale"><param name="wmode" value="window"><param name="allowScriptAccess" value="always"></object> <div class="elexSwfImg" style="width: 1263px; height: 673px; "> <img src="spacer(2).gif" width="1500" height="800" alt="spacer"> </div> </div> </div> </div> <!--game main end--></div><div style="display:none"> <iframe id="win_ad_click_log" height="1" width="1" src=""></iframe> </div></div> <div id="flash_content" style="height: 663px; position: absolute; top: 0pt; left: 0pt; width: 100%; background-color: rgb(0, 0, 0); display: none; "> <div id="loadingDiv"><img id="load" style="position: absolute; left: -363px; top: -204px; margin-top: 315px; margin-right: 50%; margin-bottom: 315px; margin-left: 50%; display: block; " src="loading_b.gif"></div> </div> <div id="app_content" style="width:100%;display:none"></div> <div id="showuid"></div> </center> <script type="text/javascript"> var loadImg