OpenAjaxManagedHub-all.js 56 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534
  1. var OpenAjax=OpenAjax||{};
  2. if(!OpenAjax.hub){
  3. OpenAjax.hub=function(){
  4. var _1={};
  5. var _2="org.openajax.hub.";
  6. return {implementer:"http://openajax.org",implVersion:"2.0.4",specVersion:"2.0",implExtraData:{},libraries:_1,registerLibrary:function(_3,_4,_5,_6){
  7. _1[_3]={prefix:_3,namespaceURI:_4,version:_5,extraData:_6};
  8. this.publish(_2+"registerLibrary",_1[_3]);
  9. },unregisterLibrary:function(_7){
  10. this.publish(_2+"unregisterLibrary",_1[_7]);
  11. delete _1[_7];
  12. }};
  13. }();
  14. OpenAjax.hub.Error={BadParameters:"OpenAjax.hub.Error.BadParameters",Disconnected:"OpenAjax.hub.Error.Disconnected",Duplicate:"OpenAjax.hub.Error.Duplicate",NoContainer:"OpenAjax.hub.Error.NoContainer",NoSubscription:"OpenAjax.hub.Error.NoSubscription",NotAllowed:"OpenAjax.hub.Error.NotAllowed",WrongProtocol:"OpenAjax.hub.Error.WrongProtocol",IncompatBrowser:"OpenAjax.hub.Error.IncompatBrowser"};
  15. OpenAjax.hub.SecurityAlert={LoadTimeout:"OpenAjax.hub.SecurityAlert.LoadTimeout",FramePhish:"OpenAjax.hub.SecurityAlert.FramePhish",ForgedMsg:"OpenAjax.hub.SecurityAlert.ForgedMsg"};
  16. OpenAjax.hub._debugger=function(){
  17. };
  18. OpenAjax.hub.ManagedHub=function(_8){
  19. if(!_8||!_8.onPublish||!_8.onSubscribe){
  20. throw new Error(OpenAjax.hub.Error.BadParameters);
  21. }
  22. this._p=_8;
  23. this._onUnsubscribe=_8.onUnsubscribe?_8.onUnsubscribe:null;
  24. this._scope=_8.scope||window;
  25. if(_8.log){
  26. var _9=this;
  27. this._log=function(_a){
  28. try{
  29. _8.log.call(_9._scope,"ManagedHub: "+_a);
  30. }
  31. catch(e){
  32. OpenAjax.hub._debugger();
  33. }
  34. };
  35. }else{
  36. this._log=function(){
  37. };
  38. }
  39. this._subscriptions={c:{},s:null};
  40. this._containers={};
  41. this._seq=0;
  42. this._active=true;
  43. this._isPublishing=false;
  44. this._pubQ=[];
  45. };
  46. OpenAjax.hub.ManagedHub.prototype.subscribeForClient=function(_b,_c,_d){
  47. this._assertConn();
  48. if(this._invokeOnSubscribe(_c,_b)){
  49. return this._subscribe(_c,this._sendToClient,this,{c:_b,sid:_d});
  50. }
  51. throw new Error(OpenAjax.hub.Error.NotAllowed);
  52. };
  53. OpenAjax.hub.ManagedHub.prototype.unsubscribeForClient=function(_e,_f){
  54. this._unsubscribe(_f);
  55. this._invokeOnUnsubscribe(_e,_f);
  56. };
  57. OpenAjax.hub.ManagedHub.prototype.publishForClient=function(_10,_11,_12){
  58. this._assertConn();
  59. this._publish(_11,_12,_10);
  60. };
  61. OpenAjax.hub.ManagedHub.prototype.disconnect=function(){
  62. this._active=false;
  63. for(var c in this._containers){
  64. this.removeContainer(this._containers[c]);
  65. }
  66. };
  67. OpenAjax.hub.ManagedHub.prototype.getContainer=function(_13){
  68. var _14=this._containers[_13];
  69. return _14?_14:null;
  70. };
  71. OpenAjax.hub.ManagedHub.prototype.listContainers=function(){
  72. var res=[];
  73. for(var c in this._containers){
  74. res.push(this._containers[c]);
  75. }
  76. return res;
  77. };
  78. OpenAjax.hub.ManagedHub.prototype.addContainer=function(_15){
  79. this._assertConn();
  80. var _16=_15.getClientID();
  81. if(this._containers[_16]){
  82. throw new Error(OpenAjax.hub.Error.Duplicate);
  83. }
  84. this._containers[_16]=_15;
  85. };
  86. OpenAjax.hub.ManagedHub.prototype.removeContainer=function(_17){
  87. var _18=_17.getClientID();
  88. if(!this._containers[_18]){
  89. throw new Error(OpenAjax.hub.Error.NoContainer);
  90. }
  91. _17.remove();
  92. delete this._containers[_18];
  93. };
  94. OpenAjax.hub.ManagedHub.prototype.subscribe=function(_19,_1a,_1b,_1c,_1d){
  95. this._assertConn();
  96. this._assertSubTopic(_19);
  97. if(!_1a){
  98. throw new Error(OpenAjax.hub.Error.BadParameters);
  99. }
  100. _1b=_1b||window;
  101. if(!this._invokeOnSubscribe(_19,null)){
  102. this._invokeOnComplete(_1c,_1b,null,false,OpenAjax.hub.Error.NotAllowed);
  103. return;
  104. }
  105. var _1e=this;
  106. function _1f(_20,_21,sd,_22){
  107. if(_1e._invokeOnPublish(_20,_21,_22,null)){
  108. try{
  109. _1a.call(_1b,_20,_21,_1d);
  110. }
  111. catch(e){
  112. OpenAjax.hub._debugger();
  113. _1e._log("caught error from onData callback to Hub.subscribe(): "+e.message);
  114. }
  115. }
  116. };
  117. var _23=this._subscribe(_19,_1f,_1b,_1d);
  118. this._invokeOnComplete(_1c,_1b,_23,true);
  119. return _23;
  120. };
  121. OpenAjax.hub.ManagedHub.prototype.publish=function(_24,_25){
  122. this._assertConn();
  123. this._assertPubTopic(_24);
  124. this._publish(_24,_25,null);
  125. };
  126. OpenAjax.hub.ManagedHub.prototype.unsubscribe=function(_26,_27,_28){
  127. this._assertConn();
  128. if(!_26){
  129. throw new Error(OpenAjax.hub.Error.BadParameters);
  130. }
  131. this._unsubscribe(_26);
  132. this._invokeOnUnsubscribe(null,_26);
  133. this._invokeOnComplete(_27,_28,_26,true);
  134. };
  135. OpenAjax.hub.ManagedHub.prototype.isConnected=function(){
  136. return this._active;
  137. };
  138. OpenAjax.hub.ManagedHub.prototype.getScope=function(){
  139. return this._scope;
  140. };
  141. OpenAjax.hub.ManagedHub.prototype.getSubscriberData=function(_29){
  142. this._assertConn();
  143. var _2a=_29.split(".");
  144. var sid=_2a.pop();
  145. var sub=this._getSubscriptionObject(this._subscriptions,_2a,0,sid);
  146. if(sub){
  147. return sub.data;
  148. }
  149. throw new Error(OpenAjax.hub.Error.NoSubscription);
  150. };
  151. OpenAjax.hub.ManagedHub.prototype.getSubscriberScope=function(_2b){
  152. this._assertConn();
  153. var _2c=_2b.split(".");
  154. var sid=_2c.pop();
  155. var sub=this._getSubscriptionObject(this._subscriptions,_2c,0,sid);
  156. if(sub){
  157. return sub.scope;
  158. }
  159. throw new Error(OpenAjax.hub.Error.NoSubscription);
  160. };
  161. OpenAjax.hub.ManagedHub.prototype.getParameters=function(){
  162. return this._p;
  163. };
  164. OpenAjax.hub.ManagedHub.prototype._sendToClient=function(_2d,_2e,sd,_2f){
  165. if(!this.isConnected()){
  166. return;
  167. }
  168. if(this._invokeOnPublish(_2d,_2e,_2f,sd.c)){
  169. sd.c.sendToClient(_2d,_2e,sd.sid);
  170. }
  171. };
  172. OpenAjax.hub.ManagedHub.prototype._assertConn=function(){
  173. if(!this.isConnected()){
  174. throw new Error(OpenAjax.hub.Error.Disconnected);
  175. }
  176. };
  177. OpenAjax.hub.ManagedHub.prototype._assertPubTopic=function(_30){
  178. if(!_30||_30===""||(_30.indexOf("*")!=-1)||(_30.indexOf("..")!=-1)||(_30.charAt(0)==".")||(_30.charAt(_30.length-1)==".")){
  179. throw new Error(OpenAjax.hub.Error.BadParameters);
  180. }
  181. };
  182. OpenAjax.hub.ManagedHub.prototype._assertSubTopic=function(_31){
  183. if(!_31){
  184. throw new Error(OpenAjax.hub.Error.BadParameters);
  185. }
  186. var _32=_31.split(".");
  187. var len=_32.length;
  188. for(var i=0;i<len;i++){
  189. var p=_32[i];
  190. if((p==="")||((p.indexOf("*")!=-1)&&(p!="*")&&(p!="**"))){
  191. throw new Error(OpenAjax.hub.Error.BadParameters);
  192. }
  193. if((p=="**")&&(i<len-1)){
  194. throw new Error(OpenAjax.hub.Error.BadParameters);
  195. }
  196. }
  197. };
  198. OpenAjax.hub.ManagedHub.prototype._invokeOnComplete=function(_33,_34,_35,_36,_37){
  199. if(_33){
  200. try{
  201. _34=_34||window;
  202. _33.call(_34,_35,_36,_37);
  203. }
  204. catch(e){
  205. OpenAjax.hub._debugger();
  206. this._log("caught error from onComplete callback: "+e.message);
  207. }
  208. }
  209. };
  210. OpenAjax.hub.ManagedHub.prototype._invokeOnPublish=function(_38,_39,_3a,_3b){
  211. try{
  212. return this._p.onPublish.call(this._scope,_38,_39,_3a,_3b);
  213. }
  214. catch(e){
  215. OpenAjax.hub._debugger();
  216. this._log("caught error from onPublish callback to constructor: "+e.message);
  217. }
  218. return false;
  219. };
  220. OpenAjax.hub.ManagedHub.prototype._invokeOnSubscribe=function(_3c,_3d){
  221. try{
  222. return this._p.onSubscribe.call(this._scope,_3c,_3d);
  223. }
  224. catch(e){
  225. OpenAjax.hub._debugger();
  226. this._log("caught error from onSubscribe callback to constructor: "+e.message);
  227. }
  228. return false;
  229. };
  230. OpenAjax.hub.ManagedHub.prototype._invokeOnUnsubscribe=function(_3e,_3f){
  231. if(this._onUnsubscribe){
  232. var _40=_3f.slice(0,_3f.lastIndexOf("."));
  233. try{
  234. this._onUnsubscribe.call(this._scope,_40,_3e);
  235. }
  236. catch(e){
  237. OpenAjax.hub._debugger();
  238. this._log("caught error from onUnsubscribe callback to constructor: "+e.message);
  239. }
  240. }
  241. };
  242. OpenAjax.hub.ManagedHub.prototype._subscribe=function(_41,_42,_43,_44){
  243. var _45=_41+"."+this._seq;
  244. var sub={scope:_43,cb:_42,data:_44,sid:this._seq++};
  245. var _46=_41.split(".");
  246. this._recursiveSubscribe(this._subscriptions,_46,0,sub);
  247. return _45;
  248. };
  249. OpenAjax.hub.ManagedHub.prototype._recursiveSubscribe=function(_47,_48,_49,sub){
  250. var _4a=_48[_49];
  251. if(_49==_48.length){
  252. sub.next=_47.s;
  253. _47.s=sub;
  254. }else{
  255. if(typeof _47.c=="undefined"){
  256. _47.c={};
  257. }
  258. if(typeof _47.c[_4a]=="undefined"){
  259. _47.c[_4a]={c:{},s:null};
  260. this._recursiveSubscribe(_47.c[_4a],_48,_49+1,sub);
  261. }else{
  262. this._recursiveSubscribe(_47.c[_4a],_48,_49+1,sub);
  263. }
  264. }
  265. };
  266. OpenAjax.hub.ManagedHub.prototype._publish=function(_4b,_4c,_4d){
  267. if(this._isPublishing){
  268. this._pubQ.push({t:_4b,d:_4c,p:_4d});
  269. return;
  270. }
  271. this._safePublish(_4b,_4c,_4d);
  272. while(this._pubQ.length>0){
  273. var pub=this._pubQ.shift();
  274. this._safePublish(pub.t,pub.d,pub.p);
  275. }
  276. };
  277. OpenAjax.hub.ManagedHub.prototype._safePublish=function(_4e,_4f,_50){
  278. this._isPublishing=true;
  279. var _51=_4e.split(".");
  280. this._recursivePublish(this._subscriptions,_51,0,_4e,_4f,_50);
  281. this._isPublishing=false;
  282. };
  283. OpenAjax.hub.ManagedHub.prototype._recursivePublish=function(_52,_53,_54,_55,msg,_56){
  284. if(typeof _52!="undefined"){
  285. var _57;
  286. if(_54==_53.length){
  287. _57=_52;
  288. }else{
  289. this._recursivePublish(_52.c[_53[_54]],_53,_54+1,_55,msg,_56);
  290. this._recursivePublish(_52.c["*"],_53,_54+1,_55,msg,_56);
  291. _57=_52.c["**"];
  292. }
  293. if(typeof _57!="undefined"){
  294. var sub=_57.s;
  295. while(sub){
  296. var sc=sub.scope;
  297. var cb=sub.cb;
  298. var d=sub.data;
  299. if(typeof cb=="string"){
  300. cb=sc[cb];
  301. }
  302. cb.call(sc,_55,msg,d,_56);
  303. sub=sub.next;
  304. }
  305. }
  306. }
  307. };
  308. OpenAjax.hub.ManagedHub.prototype._unsubscribe=function(_58){
  309. var _59=_58.split(".");
  310. var sid=_59.pop();
  311. if(!this._recursiveUnsubscribe(this._subscriptions,_59,0,sid)){
  312. throw new Error(OpenAjax.hub.Error.NoSubscription);
  313. }
  314. };
  315. OpenAjax.hub.ManagedHub.prototype._recursiveUnsubscribe=function(_5a,_5b,_5c,sid){
  316. if(typeof _5a=="undefined"){
  317. return false;
  318. }
  319. if(_5c<_5b.length){
  320. var _5d=_5a.c[_5b[_5c]];
  321. if(!_5d){
  322. return false;
  323. }
  324. this._recursiveUnsubscribe(_5d,_5b,_5c+1,sid);
  325. if(!_5d.s){
  326. for(var x in _5d.c){
  327. return true;
  328. }
  329. delete _5a.c[_5b[_5c]];
  330. }
  331. }else{
  332. var sub=_5a.s;
  333. var _5e=null;
  334. var _5f=false;
  335. while(sub){
  336. if(sid==sub.sid){
  337. _5f=true;
  338. if(sub==_5a.s){
  339. _5a.s=sub.next;
  340. }else{
  341. _5e.next=sub.next;
  342. }
  343. break;
  344. }
  345. _5e=sub;
  346. sub=sub.next;
  347. }
  348. if(!_5f){
  349. return false;
  350. }
  351. }
  352. return true;
  353. };
  354. OpenAjax.hub.ManagedHub.prototype._getSubscriptionObject=function(_60,_61,_62,sid){
  355. if(typeof _60!="undefined"){
  356. if(_62<_61.length){
  357. var _63=_60.c[_61[_62]];
  358. return this._getSubscriptionObject(_63,_61,_62+1,sid);
  359. }
  360. var sub=_60.s;
  361. while(sub){
  362. if(sid==sub.sid){
  363. return sub;
  364. }
  365. sub=sub.next;
  366. }
  367. }
  368. return null;
  369. };
  370. OpenAjax.hub._hub=new OpenAjax.hub.ManagedHub({onSubscribe:function(_64,_65){
  371. return true;
  372. },onPublish:function(_66,_67,_68,_69){
  373. return true;
  374. }});
  375. OpenAjax.hub.subscribe=function(_6a,_6b,_6c,_6d){
  376. if(typeof _6b==="string"){
  377. _6c=_6c||window;
  378. _6b=_6c[_6b]||null;
  379. }
  380. return OpenAjax.hub._hub.subscribe(_6a,_6b,_6c,null,_6d);
  381. };
  382. OpenAjax.hub.unsubscribe=function(_6e){
  383. return OpenAjax.hub._hub.unsubscribe(_6e);
  384. };
  385. OpenAjax.hub.publish=function(_6f,_70){
  386. OpenAjax.hub._hub.publish(_6f,_70);
  387. };
  388. OpenAjax.hub.registerLibrary("OpenAjax","http://openajax.org/hub","2.0",{});
  389. }
  390. OpenAjax.hub.InlineContainer=function(hub,_71,_72){
  391. if(!hub||!_71||!_72||!_72.Container||!_72.Container.onSecurityAlert){
  392. throw new Error(OpenAjax.hub.Error.BadParameters);
  393. }
  394. var _73=_72.Container.scope||window;
  395. var _74=false;
  396. var _75=[];
  397. var _76=0;
  398. var _77=null;
  399. if(_72.Container.log){
  400. var log=function(msg){
  401. try{
  402. _72.Container.log.call(_73,"InlineContainer::"+_71+": "+msg);
  403. }
  404. catch(e){
  405. OpenAjax.hub._debugger();
  406. }
  407. };
  408. }else{
  409. log=function(){
  410. };
  411. }
  412. this._init=function(){
  413. hub.addContainer(this);
  414. };
  415. this.getHub=function(){
  416. return hub;
  417. };
  418. this.sendToClient=function(_78,_79,_7a){
  419. if(_74){
  420. var sub=_75[_7a];
  421. try{
  422. sub.cb.call(sub.sc,_78,_79,sub.d);
  423. }
  424. catch(e){
  425. OpenAjax.hub._debugger();
  426. _77._log("caught error from onData callback to HubClient.subscribe(): "+e.message);
  427. }
  428. }
  429. };
  430. this.remove=function(){
  431. if(_74){
  432. _7b();
  433. }
  434. };
  435. this.isConnected=function(){
  436. return _74;
  437. };
  438. this.getClientID=function(){
  439. return _71;
  440. };
  441. this.getPartnerOrigin=function(){
  442. if(_74){
  443. return window.location.protocol+"//"+window.location.hostname;
  444. }
  445. return null;
  446. };
  447. this.getParameters=function(){
  448. return _72;
  449. };
  450. this.connect=function(_7c,_7d,_7e){
  451. if(_74){
  452. throw new Error(OpenAjax.hub.Error.Duplicate);
  453. }
  454. _74=true;
  455. _77=_7c;
  456. if(_72.Container.onConnect){
  457. try{
  458. _72.Container.onConnect.call(_73,this);
  459. }
  460. catch(e){
  461. OpenAjax.hub._debugger();
  462. log("caught error from onConnect callback to constructor: "+e.message);
  463. }
  464. }
  465. _7f(_7d,_7e,_7c,true);
  466. };
  467. this.disconnect=function(_80,_81,_82){
  468. if(!_74){
  469. throw new Error(OpenAjax.hub.Error.Disconnected);
  470. }
  471. _7b();
  472. if(_72.Container.onDisconnect){
  473. try{
  474. _72.Container.onDisconnect.call(_73,this);
  475. }
  476. catch(e){
  477. OpenAjax.hub._debugger();
  478. log("caught error from onDisconnect callback to constructor: "+e.message);
  479. }
  480. }
  481. _7f(_81,_82,_80,true);
  482. };
  483. this.subscribe=function(_83,_84,_85,_86,_87){
  484. _88();
  485. _89(_83);
  486. if(!_84){
  487. throw new Error(OpenAjax.hub.Error.BadParameters);
  488. }
  489. var _8a=""+_76++;
  490. var _8b=false;
  491. var msg=null;
  492. try{
  493. var _8c=hub.subscribeForClient(this,_83,_8a);
  494. _8b=true;
  495. }
  496. catch(e){
  497. _8a=null;
  498. msg=e.message;
  499. }
  500. _85=_85||window;
  501. if(_8b){
  502. _75[_8a]={h:_8c,cb:_84,sc:_85,d:_87};
  503. }
  504. _7f(_86,_85,_8a,_8b,msg);
  505. return _8a;
  506. };
  507. this.publish=function(_8d,_8e){
  508. _88();
  509. _8f(_8d);
  510. hub.publishForClient(this,_8d,_8e);
  511. };
  512. this.unsubscribe=function(_90,_91,_92){
  513. _88();
  514. if(typeof _90==="undefined"||_90===null){
  515. throw new Error(OpenAjax.hub.Error.BadParameters);
  516. }
  517. var sub=_75[_90];
  518. if(!sub){
  519. throw new Error(OpenAjax.hub.Error.NoSubscription);
  520. }
  521. hub.unsubscribeForClient(this,sub.h);
  522. delete _75[_90];
  523. _7f(_91,_92,_90,true);
  524. };
  525. this.getSubscriberData=function(_93){
  526. _88();
  527. return _94(_93).d;
  528. };
  529. this.getSubscriberScope=function(_95){
  530. _88();
  531. return _94(_95).sc;
  532. };
  533. function _7f(_96,_97,_98,_99,_9a){
  534. if(_96){
  535. try{
  536. _97=_97||window;
  537. _96.call(_97,_98,_99,_9a);
  538. }
  539. catch(e){
  540. OpenAjax.hub._debugger();
  541. _77._log("caught error from onComplete callback: "+e.message);
  542. }
  543. }
  544. };
  545. function _7b(){
  546. for(var _9b in _75){
  547. hub.unsubscribeForClient(this,_75[_9b].h);
  548. }
  549. _75=[];
  550. _76=0;
  551. _74=false;
  552. };
  553. function _88(){
  554. if(!_74){
  555. throw new Error(OpenAjax.hub.Error.Disconnected);
  556. }
  557. };
  558. function _8f(_9c){
  559. if((_9c==null)||(_9c==="")||(_9c.indexOf("*")!=-1)||(_9c.indexOf("..")!=-1)||(_9c.charAt(0)==".")||(_9c.charAt(_9c.length-1)==".")){
  560. throw new Error(OpenAjax.hub.Error.BadParameters);
  561. }
  562. };
  563. function _89(_9d){
  564. if(!_9d){
  565. throw new Error(OpenAjax.hub.Error.BadParameters);
  566. }
  567. var _9e=_9d.split(".");
  568. var len=_9e.length;
  569. for(var i=0;i<len;i++){
  570. var p=_9e[i];
  571. if((p==="")||((p.indexOf("*")!=-1)&&(p!="*")&&(p!="**"))){
  572. throw new Error(OpenAjax.hub.Error.BadParameters);
  573. }
  574. if((p=="**")&&(i<len-1)){
  575. throw new Error(OpenAjax.hub.Error.BadParameters);
  576. }
  577. }
  578. };
  579. function _94(_9f){
  580. var sub=_75[_9f];
  581. if(sub){
  582. return sub;
  583. }
  584. throw new Error(OpenAjax.hub.Error.NoSubscription);
  585. };
  586. this._init();
  587. };
  588. OpenAjax.hub.InlineHubClient=function(_a0){
  589. if(!_a0||!_a0.HubClient||!_a0.HubClient.onSecurityAlert||!_a0.InlineHubClient||!_a0.InlineHubClient.container){
  590. throw new Error(OpenAjax.hub.Error.BadParameters);
  591. }
  592. var _a1=_a0.InlineHubClient.container;
  593. var _a2=_a0.HubClient.scope||window;
  594. if(_a0.HubClient.log){
  595. var log=function(msg){
  596. try{
  597. _a0.HubClient.log.call(_a2,"InlineHubClient::"+_a1.getClientID()+": "+msg);
  598. }
  599. catch(e){
  600. OpenAjax.hub._debugger();
  601. }
  602. };
  603. }else{
  604. log=function(){
  605. };
  606. }
  607. this._log=log;
  608. this.connect=function(_a3,_a4){
  609. _a1.connect(this,_a3,_a4);
  610. };
  611. this.disconnect=function(_a5,_a6){
  612. _a1.disconnect(this,_a5,_a6);
  613. };
  614. this.getPartnerOrigin=function(){
  615. return _a1.getPartnerOrigin();
  616. };
  617. this.getClientID=function(){
  618. return _a1.getClientID();
  619. };
  620. this.subscribe=function(_a7,_a8,_a9,_aa,_ab){
  621. return _a1.subscribe(_a7,_a8,_a9,_aa,_ab);
  622. };
  623. this.publish=function(_ac,_ad){
  624. _a1.publish(_ac,_ad);
  625. };
  626. this.unsubscribe=function(_ae,_af,_b0){
  627. _a1.unsubscribe(_ae,_af,_b0);
  628. };
  629. this.isConnected=function(){
  630. return _a1.isConnected();
  631. };
  632. this.getScope=function(){
  633. return _a2;
  634. };
  635. this.getSubscriberData=function(_b1){
  636. return _a1.getSubscriberData(_b1);
  637. };
  638. this.getSubscriberScope=function(_b2){
  639. return _a1.getSubscriberScope(_b2);
  640. };
  641. this.getParameters=function(){
  642. return _a0;
  643. };
  644. };
  645. var OpenAjax=OpenAjax||{};
  646. OpenAjax.hub=OpenAjax.hub||{};
  647. OpenAjax.gadgets=typeof OpenAjax.gadgets==="object"?OpenAjax.gadgets:typeof gadgets==="object"?gadgets:{};
  648. OpenAjax.gadgets.rpctx=OpenAjax.gadgets.rpctx||{};
  649. (function(){
  650. if(typeof gadgets==="undefined"){
  651. if(typeof oaaConfig==="undefined"){
  652. var _b3=document.getElementsByTagName("script");
  653. var _b4=/openajax(?:managedhub-(?:all|core).*|-mashup)\.js$/i;
  654. for(var i=_b3.length-1;i>=0;i--){
  655. var src=_b3[i].getAttribute("src");
  656. if(!src){
  657. continue;
  658. }
  659. var m=src.match(_b4);
  660. if(m){
  661. var _b5=_b3[i].getAttribute("oaaConfig");
  662. if(_b5){
  663. try{
  664. oaaConfig=eval("({ "+_b5+" })");
  665. }
  666. catch(e){
  667. }
  668. }
  669. break;
  670. }
  671. }
  672. }
  673. if(typeof oaaConfig!=="undefined"&&oaaConfig.gadgetsGlobal){
  674. gadgets=OpenAjax.gadgets;
  675. }
  676. }
  677. })();
  678. if(!OpenAjax.hub.IframeContainer){
  679. (function(){
  680. OpenAjax.hub.IframeContainer=function(hub,_b6,_b7){
  681. _b8(arguments);
  682. var _b9=this;
  683. var _ba=_b7.Container.scope||window;
  684. var _bb=false;
  685. var _bc={};
  686. var _bd;
  687. var _be;
  688. var _bf=_b7.IframeContainer.timeout||15000;
  689. var _c0;
  690. if(_b7.Container.log){
  691. var log=function(msg){
  692. try{
  693. _b7.Container.log.call(_ba,"IframeContainer::"+_b6+": "+msg);
  694. }
  695. catch(e){
  696. OpenAjax.hub._debugger();
  697. }
  698. };
  699. }else{
  700. log=function(){
  701. };
  702. }
  703. this._init=function(){
  704. hub.addContainer(this);
  705. _be=OpenAjax.hub.IframeContainer._rpcRouter.add(_b6,this);
  706. _bd=_113(_b7,_ba,log);
  707. var _c1=null;
  708. var _c2=OpenAjax.gadgets.rpc.getRelayChannel();
  709. if(_b7.IframeContainer.tunnelURI){
  710. if(_c2!=="wpm"&&_c2!=="nix"){
  711. throw new Error(OpenAjax.hub.Error.IncompatBrowser);
  712. }
  713. }else{
  714. log("WARNING: Parameter 'IframeContaienr.tunnelURI' not specified. Connection will not be fully secure.");
  715. if(_c2==="rmr"){
  716. _c1=OpenAjax.gadgets.rpc.getOrigin(_b7.IframeContainer.uri)+"/robots.txt";
  717. }
  718. }
  719. _c3();
  720. OpenAjax.gadgets.rpc.setupReceiver(_be,_c1);
  721. _c4();
  722. };
  723. this.sendToClient=function(_c5,_c6,_c7){
  724. OpenAjax.gadgets.rpc.call(_be,"openajax.pubsub",null,"pub",_c5,_c6,_c7);
  725. };
  726. this.remove=function(){
  727. _c8();
  728. clearTimeout(_c0);
  729. OpenAjax.gadgets.rpc.removeReceiver(_be);
  730. var _c9=document.getElementById(_be);
  731. _c9.parentNode.removeChild(_c9);
  732. OpenAjax.hub.IframeContainer._rpcRouter.remove(_be);
  733. };
  734. this.isConnected=function(){
  735. return _bb;
  736. };
  737. this.getClientID=function(){
  738. return _b6;
  739. };
  740. this.getPartnerOrigin=function(){
  741. if(_bb){
  742. var _ca=OpenAjax.gadgets.rpc.getReceiverOrigin(_be);
  743. if(_ca){
  744. return (/^([a-zA-Z]+:\/\/[^:]+).*/.exec(_ca)[1]);
  745. }
  746. }
  747. return null;
  748. };
  749. this.getParameters=function(){
  750. return _b7;
  751. };
  752. this.getHub=function(){
  753. return hub;
  754. };
  755. this.getIframe=function(){
  756. return document.getElementById(_be);
  757. };
  758. function _b8(_cb){
  759. var hub=_cb[0],_b6=_cb[1],_b7=_cb[2];
  760. if(!hub||!_b6||!_b7||!_b7.Container||!_b7.Container.onSecurityAlert||!_b7.IframeContainer||!_b7.IframeContainer.parent||!_b7.IframeContainer.uri){
  761. throw new Error(OpenAjax.hub.Error.BadParameters);
  762. }
  763. };
  764. this._handleIncomingRPC=function(_cc,_cd,_ce){
  765. switch(_cc){
  766. case "pub":
  767. hub.publishForClient(_b9,_cd,_ce);
  768. break;
  769. case "sub":
  770. var _cf="";
  771. try{
  772. _bc[_ce]=hub.subscribeForClient(_b9,_cd,_ce);
  773. }
  774. catch(e){
  775. _cf=e.message;
  776. }
  777. return _cf;
  778. case "uns":
  779. var _d0=_bc[_ce];
  780. hub.unsubscribeForClient(_b9,_d0);
  781. delete _bc[_ce];
  782. return _ce;
  783. case "con":
  784. _d1();
  785. return true;
  786. case "dis":
  787. _c4();
  788. _c8();
  789. if(_b7.Container.onDisconnect){
  790. try{
  791. _b7.Container.onDisconnect.call(_ba,_b9);
  792. }
  793. catch(e){
  794. OpenAjax.hub._debugger();
  795. log("caught error from onDisconnect callback to constructor: "+e.message);
  796. }
  797. }
  798. return true;
  799. }
  800. };
  801. this._onSecurityAlert=function(_d2){
  802. _d3(_112[_d2]);
  803. };
  804. function _c3(){
  805. var _d4=document.createElement("span");
  806. _b7.IframeContainer.parent.appendChild(_d4);
  807. var _d5="<iframe id=\""+_be+"\" name=\""+_be+"\" src=\"javascript:'<html></html>'\"";
  808. var _d6="";
  809. var _d7=_b7.IframeContainer.iframeAttrs;
  810. if(_d7){
  811. for(var _d8 in _d7){
  812. switch(_d8){
  813. case "style":
  814. for(var _d9 in _d7.style){
  815. _d6+=_d9+":"+_d7.style[_d9]+";";
  816. }
  817. break;
  818. case "className":
  819. _d5+=" class=\""+_d7[_d8]+"\"";
  820. break;
  821. default:
  822. _d5+=" "+_d8+"=\""+_d7[_d8]+"\"";
  823. }
  824. }
  825. }
  826. _d6+="visibility:hidden;";
  827. _d5+=" style=\""+_d6+"\"></iframe>";
  828. _d4.innerHTML=_d5;
  829. var _da=_b7.IframeContainer.tunnelURI;
  830. document.getElementById(_be).src=_b7.IframeContainer.uri+"#rpctoken="+_bd+(_da?"&parent="+encodeURIComponent(_da)+"&forcesecure=true":"&oaaParent="+encodeURIComponent(OpenAjax.gadgets.rpc.getOrigin(window.location.href)));
  831. };
  832. function _d1(){
  833. function _db(_dc){
  834. if(_dc){
  835. _bb=true;
  836. clearTimeout(_c0);
  837. document.getElementById(_be).style.visibility="visible";
  838. if(_b7.Container.onConnect){
  839. try{
  840. _b7.Container.onConnect.call(_ba,_b9);
  841. }
  842. catch(e){
  843. OpenAjax.hub._debugger();
  844. log("caught error from onConnect callback to constructor: "+e.message);
  845. }
  846. }
  847. }
  848. };
  849. OpenAjax.gadgets.rpc.call(_be,"openajax.pubsub",_db,"cmd","con");
  850. };
  851. function _c8(){
  852. if(_bb){
  853. _bb=false;
  854. document.getElementById(_be).style.visibility="hidden";
  855. for(var s in _bc){
  856. hub.unsubscribeForClient(_b9,_bc[s]);
  857. }
  858. _bc={};
  859. }
  860. };
  861. function _d3(_dd){
  862. try{
  863. _b7.Container.onSecurityAlert.call(_ba,_b9,_dd);
  864. }
  865. catch(e){
  866. OpenAjax.hub._debugger();
  867. log("caught error from onSecurityAlert callback to constructor: "+e.message);
  868. }
  869. };
  870. function _c4(){
  871. _c0=setTimeout(function(){
  872. _d3(OpenAjax.hub.SecurityAlert.LoadTimeout);
  873. _b9._handleIncomingRPC=function(){
  874. };
  875. },_bf);
  876. };
  877. this._init();
  878. };
  879. OpenAjax.hub.IframeHubClient=function(_de){
  880. if(!_de||!_de.HubClient||!_de.HubClient.onSecurityAlert){
  881. throw new Error(OpenAjax.hub.Error.BadParameters);
  882. }
  883. var _df=this;
  884. var _e0=_de.HubClient.scope||window;
  885. var _e1=false;
  886. var _e2={};
  887. var _e3=0;
  888. var _e4;
  889. if(_de.HubClient.log){
  890. var log=function(msg){
  891. try{
  892. _de.HubClient.log.call(_e0,"IframeHubClient::"+_e4+": "+msg);
  893. }
  894. catch(e){
  895. OpenAjax.hub._debugger();
  896. }
  897. };
  898. }else{
  899. log=function(){
  900. };
  901. }
  902. this._init=function(){
  903. var _e5=OpenAjax.gadgets.util.getUrlParameters();
  904. if(!_e5.parent){
  905. var _e6=_e5.oaaParent+"/robots.txt";
  906. OpenAjax.gadgets.rpc.setupReceiver("..",_e6);
  907. }
  908. if(_de.IframeHubClient&&_de.IframeHubClient.requireParentVerifiable&&OpenAjax.gadgets.rpc.getReceiverOrigin("..")===null){
  909. OpenAjax.gadgets.rpc.removeReceiver("..");
  910. throw new Error(OpenAjax.hub.Error.IncompatBrowser);
  911. }
  912. OpenAjax.hub.IframeContainer._rpcRouter.add("..",this);
  913. var _e7=OpenAjax.gadgets.rpc.RPC_ID;
  914. if(!_e7){
  915. throw new Error(OpenAjax.hub.Error.WrongProtocol);
  916. }
  917. _e4=_e7.substr(_e7.indexOf("_")+1);
  918. };
  919. this.connect=function(_e8,_e9){
  920. if(_e1){
  921. throw new Error(OpenAjax.hub.Error.Duplicate);
  922. }
  923. function _ea(_eb){
  924. if(_eb){
  925. _e1=true;
  926. if(_e8){
  927. try{
  928. _e8.call(_e9||window,_df,true);
  929. }
  930. catch(e){
  931. OpenAjax.hub._debugger();
  932. log("caught error from onComplete callback to connect(): "+e.message);
  933. }
  934. }
  935. }
  936. };
  937. OpenAjax.gadgets.rpc.call("..","openajax.pubsub",_ea,"con");
  938. };
  939. this.disconnect=function(_ec,_ed){
  940. if(!_e1){
  941. throw new Error(OpenAjax.hub.Error.Disconnected);
  942. }
  943. _e1=false;
  944. var _ee=null;
  945. if(_ec){
  946. _ee=function(_ef){
  947. try{
  948. _ec.call(_ed||window,_df,true);
  949. }
  950. catch(e){
  951. OpenAjax.hub._debugger();
  952. log("caught error from onComplete callback to disconnect(): "+e.message);
  953. }
  954. };
  955. }
  956. OpenAjax.gadgets.rpc.call("..","openajax.pubsub",_ee,"dis");
  957. };
  958. this.getPartnerOrigin=function(){
  959. if(_e1){
  960. var _f0=OpenAjax.gadgets.rpc.getReceiverOrigin("..");
  961. if(_f0){
  962. return (/^([a-zA-Z]+:\/\/[^:]+).*/.exec(_f0)[1]);
  963. }
  964. }
  965. return null;
  966. };
  967. this.getClientID=function(){
  968. return _e4;
  969. };
  970. this.subscribe=function(_f1,_f2,_f3,_f4,_f5){
  971. _f6();
  972. _f7(_f1);
  973. if(!_f2){
  974. throw new Error(OpenAjax.hub.Error.BadParameters);
  975. }
  976. _f3=_f3||window;
  977. var _f8=""+_e3++;
  978. _e2[_f8]={cb:_f2,sc:_f3,d:_f5};
  979. function _f9(_fa){
  980. if(_fa!==""){
  981. delete _e2[_f8];
  982. }
  983. if(_f4){
  984. try{
  985. _f4.call(_f3,_f8,_fa==="",_fa);
  986. }
  987. catch(e){
  988. OpenAjax.hub._debugger();
  989. log("caught error from onComplete callback to subscribe(): "+e.message);
  990. }
  991. }
  992. };
  993. OpenAjax.gadgets.rpc.call("..","openajax.pubsub",_f9,"sub",_f1,_f8);
  994. return _f8;
  995. };
  996. this.publish=function(_fb,_fc){
  997. _f6();
  998. _fd(_fb);
  999. OpenAjax.gadgets.rpc.call("..","openajax.pubsub",null,"pub",_fb,_fc);
  1000. };
  1001. this.unsubscribe=function(_fe,_ff,_100){
  1002. _f6();
  1003. if(!_fe){
  1004. throw new Error(OpenAjax.hub.Error.BadParameters);
  1005. }
  1006. if(!_e2[_fe]||_e2[_fe].uns){
  1007. throw new Error(OpenAjax.hub.Error.NoSubscription);
  1008. }
  1009. _e2[_fe].uns=true;
  1010. function _101(_102){
  1011. delete _e2[_fe];
  1012. if(_ff){
  1013. try{
  1014. _ff.call(_100||window,_fe,true);
  1015. }
  1016. catch(e){
  1017. OpenAjax.hub._debugger();
  1018. log("caught error from onComplete callback to unsubscribe(): "+e.message);
  1019. }
  1020. }
  1021. };
  1022. OpenAjax.gadgets.rpc.call("..","openajax.pubsub",_101,"uns",null,_fe);
  1023. };
  1024. this.isConnected=function(){
  1025. return _e1;
  1026. };
  1027. this.getScope=function(){
  1028. return _e0;
  1029. };
  1030. this.getSubscriberData=function(_103){
  1031. _f6();
  1032. if(_e2[_103]){
  1033. return _e2[_103].d;
  1034. }
  1035. throw new Error(OpenAjax.hub.Error.NoSubscription);
  1036. };
  1037. this.getSubscriberScope=function(_104){
  1038. _f6();
  1039. if(_e2[_104]){
  1040. return _e2[_104].sc;
  1041. }
  1042. throw new Error(OpenAjax.hub.Error.NoSubscription);
  1043. };
  1044. this.getParameters=function(){
  1045. return _de;
  1046. };
  1047. this._handleIncomingRPC=function(_105,_106,data,_107){
  1048. if(_105==="pub"){
  1049. if(_e2[_107]&&!_e2[_107].uns){
  1050. try{
  1051. _e2[_107].cb.call(_e2[_107].sc,_106,data,_e2[_107].d);
  1052. }
  1053. catch(e){
  1054. OpenAjax.hub._debugger();
  1055. log("caught error from onData callback to subscribe(): "+e.message);
  1056. }
  1057. }
  1058. }
  1059. if(_106==="con"){
  1060. return true;
  1061. }
  1062. return false;
  1063. };
  1064. function _f6(){
  1065. if(!_e1){
  1066. throw new Error(OpenAjax.hub.Error.Disconnected);
  1067. }
  1068. };
  1069. function _f7(_108){
  1070. if(!_108){
  1071. throw new Error(OpenAjax.hub.Error.BadParameters);
  1072. }
  1073. var path=_108.split(".");
  1074. var len=path.length;
  1075. for(var i=0;i<len;i++){
  1076. var p=path[i];
  1077. if((p==="")||((p.indexOf("*")!=-1)&&(p!="*")&&(p!="**"))){
  1078. throw new Error(OpenAjax.hub.Error.BadParameters);
  1079. }
  1080. if((p=="**")&&(i<len-1)){
  1081. throw new Error(OpenAjax.hub.Error.BadParameters);
  1082. }
  1083. }
  1084. };
  1085. function _fd(_109){
  1086. if(!_109||_109===""||(_109.indexOf("*")!=-1)||(_109.indexOf("..")!=-1)||(_109.charAt(0)==".")||(_109.charAt(_109.length-1)==".")){
  1087. throw new Error(OpenAjax.hub.Error.BadParameters);
  1088. }
  1089. };
  1090. this._init();
  1091. };
  1092. OpenAjax.hub.IframeContainer._rpcRouter=function(){
  1093. var _10a={};
  1094. function _10b(){
  1095. var r=_10a[this.f];
  1096. if(r){
  1097. return r._handleIncomingRPC.apply(r,arguments);
  1098. }
  1099. };
  1100. function _10c(_10d,_10e){
  1101. var r=_10a[_10d];
  1102. if(r){
  1103. r._onSecurityAlert.call(r,_10e);
  1104. }
  1105. };
  1106. return {add:function(id,_10f){
  1107. function _110(id,_111){
  1108. if(id===".."){
  1109. if(!_10a[".."]){
  1110. _10a[".."]=_111;
  1111. }
  1112. return;
  1113. }
  1114. do{
  1115. newID=((32767*Math.random())|0).toString(16)+"_"+id;
  1116. }while(_10a[newID]);
  1117. _10a[newID]=_111;
  1118. return newID;
  1119. };
  1120. OpenAjax.gadgets.rpc.register("openajax.pubsub",_10b);
  1121. OpenAjax.gadgets.rpc.config({securityCallback:_10c});
  1122. _112[OpenAjax.gadgets.rpc.SEC_ERROR_LOAD_TIMEOUT]=OpenAjax.hub.SecurityAlert.LoadTimeout;
  1123. _112[OpenAjax.gadgets.rpc.SEC_ERROR_FRAME_PHISH]=OpenAjax.hub.SecurityAlert.FramePhish;
  1124. _112[OpenAjax.gadgets.rpc.SEC_ERROR_FORGED_MSG]=OpenAjax.hub.SecurityAlert.ForgedMsg;
  1125. this.add=_110;
  1126. return _110(id,_10f);
  1127. },remove:function(id){
  1128. delete _10a[id];
  1129. }};
  1130. }();
  1131. var _112={};
  1132. function _113(_114,_115,log){
  1133. if(!OpenAjax.hub.IframeContainer._prng){
  1134. var seed=new Date().getTime()+Math.random()+document.cookie;
  1135. OpenAjax.hub.IframeContainer._prng=OpenAjax._smash.crypto.newPRNG(seed);
  1136. }
  1137. var p=_114.IframeContainer||_114.IframeHubClient;
  1138. if(p&&p.seed){
  1139. try{
  1140. var _116=p.seed.call(_115);
  1141. OpenAjax.hub.IframeContainer._prng.addSeed(_116);
  1142. }
  1143. catch(e){
  1144. OpenAjax.hub._debugger();
  1145. log("caught error from 'seed' callback: "+e.message);
  1146. }
  1147. }
  1148. var _117=(p&&p.tokenLength)||6;
  1149. return OpenAjax.hub.IframeContainer._prng.nextRandomB64Str(_117);
  1150. };
  1151. })();
  1152. }
  1153. if(typeof OpenAjax._smash=="undefined"){
  1154. OpenAjax._smash={};
  1155. }
  1156. OpenAjax._smash.crypto={"strToWA":function(str,_118){
  1157. var bin=Array();
  1158. var mask=(1<<_118)-1;
  1159. for(var i=0;i<str.length*_118;i+=_118){
  1160. bin[i>>5]|=(str.charCodeAt(i/_118)&mask)<<(32-_118-i%32);
  1161. }
  1162. return bin;
  1163. },"hmac_sha1":function(_119,_11a,_11b){
  1164. var ipad=Array(16),opad=Array(16);
  1165. for(var i=0;i<16;i++){
  1166. ipad[i]=_119[i]^909522486;
  1167. opad[i]=_119[i]^1549556828;
  1168. }
  1169. var hash=this.sha1(ipad.concat(this.strToWA(_11a,_11b)),512+_11a.length*_11b);
  1170. return this.sha1(opad.concat(hash),512+160);
  1171. },"newPRNG":function(_11c){
  1172. var that=this;
  1173. if((typeof _11c!="string")||(_11c.length<12)){
  1174. alert("WARNING: Seed length too short ...");
  1175. }
  1176. var _11d=[43417,15926,18182,33130,9585,30800,49772,40144,47678,55453,4659,38181,65340,6787,54417,65301];
  1177. var _11e=[];
  1178. var _11f=0;
  1179. function _120(_121){
  1180. return that.hmac_sha1(_11d,_121,8);
  1181. };
  1182. function _122(_123){
  1183. var _124=_120(_123);
  1184. for(var i=0;i<5;i++){
  1185. _11e[i]^=_124[i];
  1186. }
  1187. };
  1188. _122(_11c);
  1189. return {"addSeed":function(seed){
  1190. _122(seed);
  1191. },"nextRandomOctets":function(len){
  1192. var _125=[];
  1193. while(len>0){
  1194. _11f+=1;
  1195. var _126=that.hmac_sha1(_11e,(_11f).toString(16),8);
  1196. for(var i=0;(i<20)&(len>0);i++,len--){
  1197. _125.push((_126[i>>2]>>(i%4))%256);
  1198. }
  1199. }
  1200. return _125;
  1201. },"nextRandomB64Str":function(len){
  1202. var _127="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
  1203. var _128=this.nextRandomOctets(len);
  1204. var _129="";
  1205. for(var i=0;i<len;i++){
  1206. _129+=_127.charAt(_128[i]&63);
  1207. }
  1208. return _129;
  1209. }};
  1210. },"sha1":function(){
  1211. var _12a=function(x,y){
  1212. var lsw=(x&65535)+(y&65535);
  1213. var msw=(x>>16)+(y>>16)+(lsw>>16);
  1214. return (msw<<16)|(lsw&65535);
  1215. };
  1216. var rol=function(num,cnt){
  1217. return (num<<cnt)|(num>>>(32-cnt));
  1218. };
  1219. function _12b(t,b,c,d){
  1220. if(t<20){
  1221. return (b&c)|((~b)&d);
  1222. }
  1223. if(t<40){
  1224. return b^c^d;
  1225. }
  1226. if(t<60){
  1227. return (b&c)|(b&d)|(c&d);
  1228. }
  1229. return b^c^d;
  1230. };
  1231. function _12c(t){
  1232. return (t<20)?1518500249:(t<40)?1859775393:(t<60)?-1894007588:-899497514;
  1233. };
  1234. return function(_12d,_12e){
  1235. _12d[_12e>>5]|=128<<(24-_12e%32);
  1236. _12d[((_12e+64>>9)<<4)+15]=_12e;
  1237. var W=Array(80);
  1238. var H0=1732584193;
  1239. var H1=-271733879;
  1240. var H2=-1732584194;
  1241. var H3=271733878;
  1242. var H4=-1009589776;
  1243. for(var i=0;i<_12d.length;i+=16){
  1244. var a=H0;
  1245. var b=H1;
  1246. var c=H2;
  1247. var d=H3;
  1248. var e=H4;
  1249. for(var j=0;j<80;j++){
  1250. W[j]=((j<16)?_12d[i+j]:rol(W[j-3]^W[j-8]^W[j-14]^W[j-16],1));
  1251. var T=_12a(_12a(rol(a,5),_12b(j,b,c,d)),_12a(_12a(e,W[j]),_12c(j)));
  1252. e=d;
  1253. d=c;
  1254. c=rol(b,30);
  1255. b=a;
  1256. a=T;
  1257. }
  1258. H0=_12a(a,H0);
  1259. H1=_12a(b,H1);
  1260. H2=_12a(c,H2);
  1261. H3=_12a(d,H3);
  1262. H4=_12a(e,H4);
  1263. }
  1264. return Array(H0,H1,H2,H3,H4);
  1265. };
  1266. }()};
  1267. if(!this.JSON){
  1268. JSON={};
  1269. }
  1270. (function(){
  1271. function f(n){
  1272. return n<10?"0"+n:n;
  1273. };
  1274. if(typeof Date.prototype.toJSON!=="function"){
  1275. Date.prototype.toJSON=function(key){
  1276. return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z";
  1277. };
  1278. String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){
  1279. return this.valueOf();
  1280. };
  1281. }
  1282. var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,_12f=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,_130,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\"":"\\\"","\\":"\\\\"},rep;
  1283. function _131(_132){
  1284. _12f.lastIndex=0;
  1285. return _12f.test(_132)?"\""+_132.replace(_12f,function(a){
  1286. var c=meta[a];
  1287. return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4);
  1288. })+"\"":"\""+_132+"\"";
  1289. };
  1290. function str(key,_133){
  1291. var i,k,v,_134,mind=gap,_135,_136=_133[key];
  1292. if(_136&&typeof _136==="object"&&typeof _136.toJSON==="function"){
  1293. _136=_136.toJSON(key);
  1294. }
  1295. if(typeof rep==="function"){
  1296. _136=rep.call(_133,key,_136);
  1297. }
  1298. switch(typeof _136){
  1299. case "string":
  1300. return _131(_136);
  1301. case "number":
  1302. return isFinite(_136)?String(_136):"null";
  1303. case "boolean":
  1304. case "null":
  1305. return String(_136);
  1306. case "object":
  1307. if(!_136){
  1308. return "null";
  1309. }
  1310. gap+=_130;
  1311. _135=[];
  1312. if(Object.prototype.toString.apply(_136)==="[object Array]"){
  1313. _134=_136.length;
  1314. for(i=0;i<_134;i+=1){
  1315. _135[i]=str(i,_136)||"null";
  1316. }
  1317. v=_135.length===0?"[]":gap?"[\n"+gap+_135.join(",\n"+gap)+"\n"+mind+"]":"["+_135.join(",")+"]";
  1318. gap=mind;
  1319. return v;
  1320. }
  1321. if(rep&&typeof rep==="object"){
  1322. _134=rep.length;
  1323. for(i=0;i<_134;i+=1){
  1324. k=rep[i];
  1325. if(typeof k==="string"){
  1326. v=str(k,_136);
  1327. if(v){
  1328. _135.push(_131(k)+(gap?": ":":")+v);
  1329. }
  1330. }
  1331. }
  1332. }else{
  1333. for(k in _136){
  1334. if(Object.hasOwnProperty.call(_136,k)){
  1335. v=str(k,_136);
  1336. if(v){
  1337. _135.push(_131(k)+(gap?": ":":")+v);
  1338. }
  1339. }
  1340. }
  1341. }
  1342. v=_135.length===0?"{}":gap?"{\n"+gap+_135.join(",\n"+gap)+"\n"+mind+"}":"{"+_135.join(",")+"}";
  1343. gap=mind;
  1344. return v;
  1345. }
  1346. };
  1347. if(typeof JSON.stringify!=="function"){
  1348. JSON.stringify=function(_137,_138,_139){
  1349. var i;
  1350. gap="";
  1351. _130="";
  1352. if(typeof _139==="number"){
  1353. for(i=0;i<_139;i+=1){
  1354. _130+=" ";
  1355. }
  1356. }else{
  1357. if(typeof _139==="string"){
  1358. _130=_139;
  1359. }
  1360. }
  1361. rep=_138;
  1362. if(_138&&typeof _138!=="function"&&(typeof _138!=="object"||typeof _138.length!=="number")){
  1363. throw new Error("JSON.stringify");
  1364. }
  1365. return str("",{"":_137});
  1366. };
  1367. }
  1368. if(typeof JSON.parse!=="function"){
  1369. JSON.parse=function(text,_13a){
  1370. var j;
  1371. function walk(_13b,key){
  1372. var k,v,_13c=_13b[key];
  1373. if(_13c&&typeof _13c==="object"){
  1374. for(k in _13c){
  1375. if(Object.hasOwnProperty.call(_13c,k)){
  1376. v=walk(_13c,k);
  1377. if(v!==undefined){
  1378. _13c[k]=v;
  1379. }else{
  1380. delete _13c[k];
  1381. }
  1382. }
  1383. }
  1384. }
  1385. return _13a.call(_13b,key,_13c);
  1386. };
  1387. cx.lastIndex=0;
  1388. if(cx.test(text)){
  1389. text=text.replace(cx,function(a){
  1390. return "\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4);
  1391. });
  1392. }
  1393. if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){
  1394. j=eval("("+text+")");
  1395. return typeof _13a==="function"?walk({"":j},""):j;
  1396. }
  1397. throw new SyntaxError("JSON.parse");
  1398. };
  1399. }
  1400. })();
  1401. OpenAjax.gadgets.util=function(){
  1402. function _13d(url){
  1403. var _13e;
  1404. var _13f=url.indexOf("?");
  1405. var _140=url.indexOf("#");
  1406. if(_140===-1){
  1407. _13e=url.substr(_13f+1);
  1408. }else{
  1409. _13e=[url.substr(_13f+1,_140-_13f-1),"&",url.substr(_140+1)].join("");
  1410. }
  1411. return _13e.split("&");
  1412. };
  1413. var _141=null;
  1414. var _142=[];
  1415. return {getUrlParameters:function(_143){
  1416. if(_141!==null&&typeof _143==="undefined"){
  1417. return _141;
  1418. }
  1419. var _144={};
  1420. var _145=_13d(_143||document.location.href);
  1421. var _146=window.decodeURIComponent?decodeURIComponent:unescape;
  1422. for(var i=0,j=_145.length;i<j;++i){
  1423. var pos=_145[i].indexOf("=");
  1424. if(pos===-1){
  1425. continue;
  1426. }
  1427. var _147=_145[i].substring(0,pos);
  1428. var _148=_145[i].substring(pos+1);
  1429. _148=_148.replace(/\+/g," ");
  1430. _144[_147]=_146(_148);
  1431. }
  1432. if(typeof _143==="undefined"){
  1433. _141=_144;
  1434. }
  1435. return _144;
  1436. },registerOnLoadHandler:function(_149){
  1437. _142.push(_149);
  1438. },runOnLoadHandlers:function(){
  1439. for(var i=0,j=_142.length;i<j;++i){
  1440. _142[i]();
  1441. }
  1442. },"attachBrowserEvent":function(elem,_14a,_14b,_14c){
  1443. if(elem.addEventListener){
  1444. elem.addEventListener(_14a,_14b,_14c);
  1445. }else{
  1446. if(elem.attachEvent){
  1447. elem.attachEvent("on"+_14a,_14b);
  1448. }
  1449. }
  1450. },"removeBrowserEvent":function(elem,_14d,_14e,_14f){
  1451. if(elem.removeEventListener){
  1452. elem.removeEventListener(_14d,_14e,_14f);
  1453. }else{
  1454. if(elem.detachEvent){
  1455. elem.detachEvent("on"+_14d,_14e);
  1456. }
  1457. }
  1458. }};
  1459. }();
  1460. OpenAjax.gadgets.util.getUrlParameters();
  1461. OpenAjax.gadgets.json=OpenAjax.gadgets.json||{};
  1462. if(!OpenAjax.gadgets.json.stringify){
  1463. OpenAjax.gadgets.json={parse:function(str){
  1464. try{
  1465. if (str==="postmessage.test"){return false;}
  1466. return window.JSON.parse(str);
  1467. }
  1468. catch(e){
  1469. return false;
  1470. }
  1471. },stringify:function(obj){
  1472. try{
  1473. return window.JSON.stringify(obj);
  1474. }
  1475. catch(e){
  1476. return null;
  1477. }
  1478. }};
  1479. }
  1480. OpenAjax.gadgets.log=function(_150){
  1481. OpenAjax.gadgets.log.logAtLevel(OpenAjax.gadgets.log.INFO,_150);
  1482. };
  1483. OpenAjax.gadgets.warn=function(_151){
  1484. OpenAjax.gadgets.log.logAtLevel(OpenAjax.gadgets.log.WARNING,_151);
  1485. };
  1486. OpenAjax.gadgets.error=function(_152){
  1487. OpenAjax.gadgets.log.logAtLevel(OpenAjax.gadgets.log.ERROR,_152);
  1488. };
  1489. OpenAjax.gadgets.setLogLevel=function(_153){
  1490. OpenAjax.gadgets.log.logLevelThreshold_=_153;
  1491. };
  1492. OpenAjax.gadgets.log.logAtLevel=function(_154,_155){
  1493. if(_154<OpenAjax.gadgets.log.logLevelThreshold_||!OpenAjax.gadgets.log._console){
  1494. return;
  1495. }
  1496. var _157=OpenAjax.gadgets.log._console;
  1497. if(_154==OpenAjax.gadgets.log.WARNING&&_157.warn){
  1498. _157.warn(_155);
  1499. }else{
  1500. if(_154==OpenAjax.gadgets.log.ERROR&&_157.error){
  1501. _157.error(_155);
  1502. }else{
  1503. if(_157.log){
  1504. _157.log(_155);
  1505. }
  1506. }
  1507. }
  1508. };
  1509. OpenAjax.gadgets.log.INFO=1;
  1510. OpenAjax.gadgets.log.WARNING=2;
  1511. OpenAjax.gadgets.log.ERROR=3;
  1512. OpenAjax.gadgets.log.NONE=4;
  1513. OpenAjax.gadgets.log.logLevelThreshold_=OpenAjax.gadgets.log.INFO;
  1514. OpenAjax.gadgets.log._console=window.console?window.console:window.opera?window.opera.postError:undefined;
  1515. (function(){
  1516. if(!window.__isgadget){
  1517. var _158=false;
  1518. function _159(){
  1519. if(!_158){
  1520. _158=true;
  1521. OpenAjax.gadgets.util.runOnLoadHandlers();
  1522. OpenAjax.gadgets.util.registerOnLoadHandler=function(_15a){
  1523. setTimeout(_15a,0);
  1524. };
  1525. if(window.detachEvent){
  1526. window.detachEvent("onload",_159);
  1527. }
  1528. }
  1529. };
  1530. if(window.addEventListener){
  1531. document.addEventListener("DOMContentLoaded",_159,false);
  1532. window.addEventListener("load",_159,false);
  1533. }else{
  1534. if(window.attachEvent){
  1535. window.attachEvent("onload",_159);
  1536. }
  1537. }
  1538. }
  1539. })();
  1540. OpenAjax.gadgets.rpctx=OpenAjax.gadgets.rpctx||{};
  1541. if(!OpenAjax.gadgets.rpctx.frameElement){
  1542. OpenAjax.gadgets.rpctx.frameElement=function(){
  1543. var _15b="__g2c_rpc";
  1544. var _15c="__c2g_rpc";
  1545. var _15d;
  1546. var _15e;
  1547. function _15f(_160,from,rpc){
  1548. try{
  1549. if(from!==".."){
  1550. var fe=window.frameElement;
  1551. if(typeof fe[_15b]==="function"){
  1552. if(typeof fe[_15b][_15c]!=="function"){
  1553. fe[_15b][_15c]=function(args){
  1554. _15d(OpenAjax.gadgets.json.parse(args));
  1555. };
  1556. }
  1557. fe[_15b](OpenAjax.gadgets.json.stringify(rpc));
  1558. return;
  1559. }
  1560. }else{
  1561. var _161=document.getElementById(_160);
  1562. if(typeof _161[_15b]==="function"&&typeof _161[_15b][_15c]==="function"){
  1563. _161[_15b][_15c](OpenAjax.gadgets.json.stringify(rpc));
  1564. return;
  1565. }
  1566. }
  1567. }
  1568. catch(e){
  1569. }
  1570. return true;
  1571. };
  1572. return {getCode:function(){
  1573. return "fe";
  1574. },isParentVerifiable:function(){
  1575. return false;
  1576. },init:function(_162,_163){
  1577. _15d=_162;
  1578. _15e=_163;
  1579. return true;
  1580. },setup:function(_164,_165){
  1581. if(_164!==".."){
  1582. try{
  1583. var _166=document.getElementById(_164);
  1584. _166[_15b]=function(args){
  1585. _15d(OpenAjax.gadgets.json.parse(args));
  1586. };
  1587. }
  1588. catch(e){
  1589. return false;
  1590. }
  1591. }
  1592. if(_164===".."){
  1593. _15e("..",true);
  1594. var _167=function(){
  1595. window.setTimeout(function(){
  1596. OpenAjax.gadgets.rpc.call(_164,OpenAjax.gadgets.rpc.ACK);
  1597. },500);
  1598. };
  1599. OpenAjax.gadgets.util.registerOnLoadHandler(_167);
  1600. }
  1601. return true;
  1602. },call:function(_168,from,rpc){
  1603. _15f(_168,from,rpc);
  1604. }};
  1605. }();
  1606. }
  1607. OpenAjax.gadgets.rpctx=OpenAjax.gadgets.rpctx||{};
  1608. if(!OpenAjax.gadgets.rpctx.ifpc){
  1609. OpenAjax.gadgets.rpctx.ifpc=function(){
  1610. var _169=[];
  1611. var _16a=0;
  1612. var _16b;
  1613. function _16c(args){
  1614. var _16d=[];
  1615. for(var i=0,j=args.length;i<j;++i){
  1616. _16d.push(encodeURIComponent(OpenAjax.gadgets.json.stringify(args[i])));
  1617. }
  1618. return _16d.join("&");
  1619. };
  1620. function _16e(src){
  1621. var _16f;
  1622. for(var i=_169.length-1;i>=0;--i){
  1623. var ifr=_169[i];
  1624. try{
  1625. if(ifr&&(ifr.recyclable||ifr.readyState==="complete")){
  1626. ifr.parentNode.removeChild(ifr);
  1627. if(window.ActiveXObject){
  1628. _169[i]=ifr=null;
  1629. _169.splice(i,1);
  1630. }else{
  1631. ifr.recyclable=false;
  1632. _16f=ifr;
  1633. break;
  1634. }
  1635. }
  1636. }
  1637. catch(e){
  1638. }
  1639. }
  1640. if(!_16f){
  1641. _16f=document.createElement("iframe");
  1642. _16f.style.border=_16f.style.width=_16f.style.height="0px";
  1643. _16f.style.visibility="hidden";
  1644. _16f.style.position="absolute";
  1645. _16f.onload=function(){
  1646. this.recyclable=true;
  1647. };
  1648. _169.push(_16f);
  1649. }
  1650. _16f.src=src;
  1651. window.setTimeout(function(){
  1652. document.body.appendChild(_16f);
  1653. },0);
  1654. };
  1655. return {getCode:function(){
  1656. return "ifpc";
  1657. },isParentVerifiable:function(){
  1658. return true;
  1659. },init:function(_170,_171){
  1660. _16b=_171;
  1661. _16b("..",true);
  1662. return true;
  1663. },setup:function(_172,_173){
  1664. _16b(_172,true);
  1665. return true;
  1666. },call:function(_174,from,rpc){
  1667. var _175=OpenAjax.gadgets.rpc.getRelayUrl(_174);
  1668. ++_16a;
  1669. if(!_175){
  1670. OpenAjax.gadgets.warn("No relay file assigned for IFPC");
  1671. return;
  1672. }
  1673. var src=null;
  1674. if(rpc.l){
  1675. var _176=rpc.a;
  1676. src=[_175,"#",_16c([from,_16a,1,0,_16c([from,rpc.s,"","",from].concat(_176))])].join("");
  1677. }else{
  1678. src=[_175,"#",_174,"&",from,"@",_16a,"&1&0&",encodeURIComponent(OpenAjax.gadgets.json.stringify(rpc))].join("");
  1679. }
  1680. _16e(src);
  1681. return true;
  1682. }};
  1683. }();
  1684. }
  1685. OpenAjax.gadgets.rpctx=OpenAjax.gadgets.rpctx||{};
  1686. if(!OpenAjax.gadgets.rpctx.nix){
  1687. OpenAjax.gadgets.rpctx.nix=function(){
  1688. var _177="GRPC____NIXVBS_wrapper";
  1689. var _178="GRPC____NIXVBS_get_wrapper";
  1690. var _179="GRPC____NIXVBS_handle_message";
  1691. var _17a="GRPC____NIXVBS_create_channel";
  1692. var _17b=10;
  1693. var _17c=500;
  1694. var _17d={};
  1695. var _17e={};
  1696. var _17f;
  1697. var _180=0;
  1698. function _181(){
  1699. var _182=_17d[".."];
  1700. if(_182){
  1701. return;
  1702. }
  1703. if(++_180>_17b){
  1704. OpenAjax.gadgets.warn("Nix transport setup failed, falling back...");
  1705. _17f("..",false);
  1706. return;
  1707. }
  1708. if(!_182&&window.opener&&"GetAuthToken" in window.opener){
  1709. _182=window.opener;
  1710. if(_182.GetAuthToken()==OpenAjax.gadgets.rpc.getAuthToken("..")){
  1711. var _183=OpenAjax.gadgets.rpc.getAuthToken("..");
  1712. _182.CreateChannel(window[_178]("..",_183),_183);
  1713. _17d[".."]=_182;
  1714. window.opener=null;
  1715. _17f("..",true);
  1716. return;
  1717. }
  1718. }
  1719. window.setTimeout(function(){
  1720. _181();
  1721. },_17c);
  1722. };
  1723. function _184(){
  1724. var loc=window.location.href;
  1725. var idx=loc.indexOf("#");
  1726. if(idx==-1){
  1727. return loc;
  1728. }
  1729. return loc.substring(0,idx);
  1730. };
  1731. function _185(_186){
  1732. var _187=(2147483647*Math.random())|0;
  1733. var data=[_184(),_187];
  1734. OpenAjax.gadgets.rpc._createRelayIframe(_186,data);
  1735. var hash=window.location.href.split("#")[1]||"";
  1736. function _188(){
  1737. var _189=window.location.href.split("#")[1]||"";
  1738. if(_189!==hash){
  1739. clearInterval(_18a);
  1740. var _18b=OpenAjax.gadgets.util.getUrlParameters(window.location.href);
  1741. if(_18b.childtoken==_187){
  1742. _181();
  1743. return;
  1744. }
  1745. _17f("..",false);
  1746. }
  1747. };
  1748. var _18a=setInterval(_188,100);
  1749. };
  1750. return {getCode:function(){
  1751. return "nix";
  1752. },isParentVerifiable:function(_18c){
  1753. if(_18c){
  1754. return _17e[_18c];
  1755. }
  1756. return false;
  1757. },init:function(_18d,_18e){
  1758. _17f=_18e;
  1759. if(typeof window[_178]!=="unknown"){
  1760. window[_179]=function(data){
  1761. window.setTimeout(function(){
  1762. _18d(OpenAjax.gadgets.json.parse(data));
  1763. },0);
  1764. };
  1765. window[_17a]=function(name,_18f,_190){
  1766. if(OpenAjax.gadgets.rpc.getAuthToken(name)===_190){
  1767. _17d[name]=_18f;
  1768. _17f(name,true);
  1769. }
  1770. };
  1771. var _191="Class "+_177+"\n "+"Private m_Intended\n"+"Private m_Auth\n"+"Public Sub SetIntendedName(name)\n "+"If isEmpty(m_Intended) Then\n"+"m_Intended = name\n"+"End If\n"+"End Sub\n"+"Public Sub SetAuth(auth)\n "+"If isEmpty(m_Auth) Then\n"+"m_Auth = auth\n"+"End If\n"+"End Sub\n"+"Public Sub SendMessage(data)\n "+_179+"(data)\n"+"End Sub\n"+"Public Function GetAuthToken()\n "+"GetAuthToken = m_Auth\n"+"End Function\n"+"Public Sub CreateChannel(channel, auth)\n "+"Call "+_17a+"(m_Intended, channel, auth)\n"+"End Sub\n"+"End Class\n"+"Function "+_178+"(name, auth)\n"+"Dim wrap\n"+"Set wrap = New "+_177+"\n"+"wrap.SetIntendedName name\n"+"wrap.SetAuth auth\n"+"Set "+_178+" = wrap\n"+"End Function";
  1772. try{
  1773. window.execScript(_191,"vbscript");
  1774. }
  1775. catch(e){
  1776. return false;
  1777. }
  1778. }
  1779. return true;
  1780. },setup:function(_192,_193,_194){
  1781. _17e[_192]=!!_194;
  1782. if(_192===".."){
  1783. if(_194){
  1784. _185(_193);
  1785. }else{
  1786. _181();
  1787. }
  1788. return true;
  1789. }
  1790. try{
  1791. var _195=document.getElementById(_192);
  1792. var _196=window[_178](_192,_193);
  1793. _195.contentWindow.opener=_196;
  1794. }
  1795. catch(e){
  1796. return false;
  1797. }
  1798. return true;
  1799. },call:function(_197,from,rpc){
  1800. try{
  1801. if(_17d[_197]){
  1802. _17d[_197].SendMessage(OpenAjax.gadgets.json.stringify(rpc));
  1803. }
  1804. }
  1805. catch(e){
  1806. return false;
  1807. }
  1808. return true;
  1809. },relayOnload:function(_198,data){
  1810. var src=data[0]+"#childtoken="+data[1];
  1811. var _199=document.getElementById(_198);
  1812. _199.src=src;
  1813. }};
  1814. }();
  1815. }
  1816. OpenAjax.gadgets.rpctx=OpenAjax.gadgets.rpctx||{};
  1817. if(!OpenAjax.gadgets.rpctx.rmr){
  1818. OpenAjax.gadgets.rpctx.rmr=function(){
  1819. var _19a=500;
  1820. var _19b=10;
  1821. var _19c={};
  1822. var _19d;
  1823. var _19e;
  1824. function _19f(_1a0,_1a1,data,_1a2){
  1825. var _1a3=function(){
  1826. document.body.appendChild(_1a0);
  1827. _1a0.src="about:blank";
  1828. if(_1a2){
  1829. _1a0.onload=function(){
  1830. _1b8(_1a2);
  1831. };
  1832. }
  1833. _1a0.src=_1a1+"#"+data;
  1834. };
  1835. if(document.body){
  1836. _1a3();
  1837. }else{
  1838. OpenAjax.gadgets.util.registerOnLoadHandler(function(){
  1839. _1a3();
  1840. });
  1841. }
  1842. };
  1843. function _1a4(_1a5){
  1844. if(typeof _19c[_1a5]==="object"){
  1845. return;
  1846. }
  1847. var _1a6=document.createElement("iframe");
  1848. var _1a7=_1a6.style;
  1849. _1a7.position="absolute";
  1850. _1a7.top="0px";
  1851. _1a7.border="0";
  1852. _1a7.opacity="0";
  1853. _1a7.width="10px";
  1854. _1a7.height="1px";
  1855. _1a6.id="rmrtransport-"+_1a5;
  1856. _1a6.name=_1a6.id;
  1857. var _1a8=OpenAjax.gadgets.rpc.getRelayUrl(_1a5);
  1858. if(!_1a8){
  1859. _1a8=OpenAjax.gadgets.rpc.getOrigin(OpenAjax.gadgets.util.getUrlParameters()["parent"])+"/robots.txt";
  1860. }
  1861. _19c[_1a5]={frame:_1a6,receiveWindow:null,relayUri:_1a8,searchCounter:0,width:10,waiting:true,queue:[],sendId:0,recvId:0};
  1862. if(_1a5!==".."){
  1863. _19f(_1a6,_1a8,_1a9(_1a5));
  1864. }
  1865. _1aa(_1a5);
  1866. };
  1867. function _1aa(_1ab){
  1868. var _1ac=null;
  1869. _19c[_1ab].searchCounter++;
  1870. try{
  1871. var _1ad=OpenAjax.gadgets.rpc._getTargetWin(_1ab);
  1872. if(_1ab===".."){
  1873. _1ac=_1ad.frames["rmrtransport-"+OpenAjax.gadgets.rpc.RPC_ID];
  1874. }else{
  1875. _1ac=_1ad.frames["rmrtransport-.."];
  1876. }
  1877. }
  1878. catch(e){
  1879. }
  1880. var _1ae=false;
  1881. if(_1ac){
  1882. _1ae=_1af(_1ab,_1ac);
  1883. }
  1884. if(!_1ae){
  1885. if(_19c[_1ab].searchCounter>_19b){
  1886. return;
  1887. }
  1888. window.setTimeout(function(){
  1889. _1aa(_1ab);
  1890. },_19a);
  1891. }
  1892. };
  1893. function _1b0(_1b1,_1b2,from,rpc){
  1894. var _1b3=null;
  1895. if(from!==".."){
  1896. _1b3=_19c[".."];
  1897. }else{
  1898. _1b3=_19c[_1b1];
  1899. }
  1900. if(_1b3){
  1901. if(_1b2!==OpenAjax.gadgets.rpc.ACK){
  1902. _1b3.queue.push(rpc);
  1903. }
  1904. if(_1b3.waiting||(_1b3.queue.length===0&&!(_1b2===OpenAjax.gadgets.rpc.ACK&&rpc&&rpc.ackAlone===true))){
  1905. return true;
  1906. }
  1907. if(_1b3.queue.length>0){
  1908. _1b3.waiting=true;
  1909. }
  1910. var url=_1b3.relayUri+"#"+_1a9(_1b1);
  1911. try{
  1912. _1b3.frame.contentWindow.location=url;
  1913. var _1b4=_1b3.width==10?20:10;
  1914. _1b3.frame.style.width=_1b4+"px";
  1915. _1b3.width=_1b4;
  1916. }
  1917. catch(e){
  1918. return false;
  1919. }
  1920. }
  1921. return true;
  1922. };
  1923. function _1a9(_1b5){
  1924. var _1b6=_19c[_1b5];
  1925. var _1b7={id:_1b6.sendId};
  1926. if(_1b6){
  1927. _1b7.d=Array.prototype.slice.call(_1b6.queue,0);
  1928. _1b7.d.push({s:OpenAjax.gadgets.rpc.ACK,id:_1b6.recvId});
  1929. }
  1930. return OpenAjax.gadgets.json.stringify(_1b7);
  1931. };
  1932. function _1b8(_1b9){
  1933. var _1ba=_19c[_1b9];
  1934. var data=_1ba.receiveWindow.location.hash.substring(1);
  1935. var _1bb=OpenAjax.gadgets.json.parse(decodeURIComponent(data))||{};
  1936. var _1bc=_1bb.d||[];
  1937. var _1bd=false;
  1938. var _1be=false;
  1939. var _1bf=0;
  1940. var _1c0=(_1ba.recvId-_1bb.id);
  1941. for(var i=0;i<_1bc.length;++i){
  1942. var rpc=_1bc[i];
  1943. if(rpc.s===OpenAjax.gadgets.rpc.ACK){
  1944. _19e(_1b9,true);
  1945. if(_1ba.waiting){
  1946. _1be=true;
  1947. }
  1948. _1ba.waiting=false;
  1949. var _1c1=Math.max(0,rpc.id-_1ba.sendId);
  1950. _1ba.queue.splice(0,_1c1);
  1951. _1ba.sendId=Math.max(_1ba.sendId,rpc.id||0);
  1952. continue;
  1953. }
  1954. _1bd=true;
  1955. if(++_1bf<=_1c0){
  1956. continue;
  1957. }
  1958. ++_1ba.recvId;
  1959. _19d(rpc);
  1960. }
  1961. if(_1bd||(_1be&&_1ba.queue.length>0)){
  1962. var from=(_1b9==="..")?OpenAjax.gadgets.rpc.RPC_ID:"..";
  1963. _1b0(_1b9,OpenAjax.gadgets.rpc.ACK,from,{ackAlone:_1bd});
  1964. }
  1965. };
  1966. function _1af(_1c2,_1c3){
  1967. var _1c4=_19c[_1c2];
  1968. try{
  1969. var _1c5=false;
  1970. _1c5="document" in _1c3;
  1971. if(!_1c5){
  1972. return false;
  1973. }
  1974. _1c5=typeof _1c3["document"]=="object";
  1975. if(!_1c5){
  1976. return false;
  1977. }
  1978. var loc=_1c3.location.href;
  1979. if(loc==="about:blank"){
  1980. return false;
  1981. }
  1982. }
  1983. catch(ex){
  1984. return false;
  1985. }
  1986. _1c4.receiveWindow=_1c3;
  1987. function _1c6(){
  1988. _1b8(_1c2);
  1989. };
  1990. if(typeof _1c3.attachEvent==="undefined"){
  1991. _1c3.onresize=_1c6;
  1992. }else{
  1993. _1c3.attachEvent("onresize",_1c6);
  1994. }
  1995. if(_1c2===".."){
  1996. _19f(_1c4.frame,_1c4.relayUri,_1a9(_1c2),_1c2);
  1997. }else{
  1998. _1b8(_1c2);
  1999. }
  2000. return true;
  2001. };
  2002. return {getCode:function(){
  2003. return "rmr";
  2004. },isParentVerifiable:function(){
  2005. return true;
  2006. },init:function(_1c7,_1c8){
  2007. _19d=_1c7;
  2008. _19e=_1c8;
  2009. return true;
  2010. },setup:function(_1c9,_1ca){
  2011. try{
  2012. _1a4(_1c9);
  2013. }
  2014. catch(e){
  2015. OpenAjax.gadgets.warn("Caught exception setting up RMR: "+e);
  2016. return false;
  2017. }
  2018. return true;
  2019. },call:function(_1cb,from,rpc){
  2020. return _1b0(_1cb,rpc.s,from,rpc);
  2021. }};
  2022. }();
  2023. }
  2024. OpenAjax.gadgets.rpctx=OpenAjax.gadgets.rpctx||{};
  2025. if(!OpenAjax.gadgets.rpctx.wpm){
  2026. OpenAjax.gadgets.rpctx.wpm=function(){
  2027. var _1cc,_1cd;
  2028. var _1ce;
  2029. var _1cf=false;
  2030. var _1d0=false;
  2031. function _1d1(){
  2032. var hit=false;
  2033. function _1d2(_1d3){
  2034. if(_1d3.data=="postmessage.test"){
  2035. hit=true;
  2036. if(typeof _1d3.origin==="undefined"){
  2037. _1d0=true;
  2038. }
  2039. }
  2040. };
  2041. OpenAjax.gadgets.util.attachBrowserEvent(window,"message",_1d2,false);
  2042. window.postMessage("postmessage.test","*");
  2043. if(hit){
  2044. _1cf=true;
  2045. }
  2046. OpenAjax.gadgets.util.removeBrowserEvent(window,"message",_1d2,false);
  2047. };
  2048. function _1d4(_1d5){
  2049. var rpc=OpenAjax.gadgets.json.parse(_1d5.data);
  2050. if(!rpc||!rpc.f){
  2051. return;
  2052. }
  2053. var _1d6=OpenAjax.gadgets.rpc.getRelayUrl(rpc.f)||OpenAjax.gadgets.util.getUrlParameters()["parent"];
  2054. var _1d7=OpenAjax.gadgets.rpc.getOrigin(_1d6);
  2055. if(!_1d0?_1d5.origin!==_1d7:_1d5.domain!==/^.+:\/\/([^:]+).*/.exec(_1d7)[1]){
  2056. return;
  2057. }
  2058. _1cc(rpc);
  2059. };
  2060. return {getCode:function(){
  2061. return "wpm";
  2062. },isParentVerifiable:function(){
  2063. return true;
  2064. },init:function(_1d8,_1d9){
  2065. _1cc=_1d8;
  2066. _1cd=_1d9;
  2067. _1d1();
  2068. if(!_1cf){
  2069. _1ce=function(win,msg,_1da){
  2070. win.postMessage(msg,_1da);
  2071. };
  2072. }else{
  2073. _1ce=function(win,msg,_1db){
  2074. window.setTimeout(function(){
  2075. win.postMessage(msg,_1db);
  2076. },0);
  2077. };
  2078. }
  2079. OpenAjax.gadgets.util.attachBrowserEvent(window,"message",_1d4,false);
  2080. _1cd("..",true);
  2081. return true;
  2082. },setup:function(_1dc,_1dd,_1de){
  2083. if(_1dc===".."){
  2084. if(_1de){
  2085. OpenAjax.gadgets.rpc._createRelayIframe(_1dd);
  2086. }else{
  2087. OpenAjax.gadgets.rpc.call(_1dc,OpenAjax.gadgets.rpc.ACK);
  2088. }
  2089. }
  2090. return true;
  2091. },call:function(_1df,from,rpc){
  2092. var _1e0=OpenAjax.gadgets.rpc._getTargetWin(_1df);
  2093. var _1e1=OpenAjax.gadgets.rpc.getRelayUrl(_1df)||OpenAjax.gadgets.util.getUrlParameters()["parent"];
  2094. var _1e2=OpenAjax.gadgets.rpc.getOrigin(_1e1);
  2095. if(_1e2){
  2096. _1ce(_1e0,OpenAjax.gadgets.json.stringify(rpc),_1e2);
  2097. }else{
  2098. OpenAjax.gadgets.error("No relay set (used as window.postMessage targetOrigin)"+", cannot send cross-domain message");
  2099. }
  2100. return true;
  2101. },relayOnload:function(_1e3,data){
  2102. _1cd(_1e3,true);
  2103. }};
  2104. }();
  2105. }
  2106. if(!OpenAjax.gadgets.rpc){
  2107. OpenAjax.gadgets.rpc=function(){
  2108. var _1e4="__cb";
  2109. var _1e5="";
  2110. var ACK="__ack";
  2111. var _1e6=500;
  2112. var _1e7=10;
  2113. var _1e8={};
  2114. var _1e9={};
  2115. var _1ea={};
  2116. var _1eb={};
  2117. var _1ec=0;
  2118. var _1ed={};
  2119. var _1ee={};
  2120. var _1ef={};
  2121. var _1f0={};
  2122. var _1f1={};
  2123. var _1f2={};
  2124. var _1f3=(window.top!==window.self);
  2125. var _1f4=window.name;
  2126. var _1f5=function(){
  2127. };
  2128. var _1f6=0;
  2129. var _1f7=1;
  2130. var _1f8=2;
  2131. var _1f9=(function(){
  2132. function _1fa(name){
  2133. return function(){
  2134. OpenAjax.gadgets.log("gadgets.rpc."+name+"("+OpenAjax.gadgets.json.stringify(Array.prototype.slice.call(arguments))+"): call ignored. [caller: "+document.location+", isChild: "+_1f3+"]");
  2135. };
  2136. };
  2137. return {getCode:function(){
  2138. return "noop";
  2139. },isParentVerifiable:function(){
  2140. return true;
  2141. },init:_1fa("init"),setup:_1fa("setup"),call:_1fa("call")};
  2142. })();
  2143. if(OpenAjax.gadgets.util){
  2144. _1f0=OpenAjax.gadgets.util.getUrlParameters();
  2145. }
  2146. function _1fb(){
  2147. return typeof window.postMessage==="function"?OpenAjax.gadgets.rpctx.wpm:typeof window.postMessage==="object"?OpenAjax.gadgets.rpctx.wpm:window.ActiveXObject?OpenAjax.gadgets.rpctx.nix:navigator.userAgent.indexOf("WebKit")>0?OpenAjax.gadgets.rpctx.rmr:navigator.product==="Gecko"?OpenAjax.gadgets.rpctx.frameElement:OpenAjax.gadgets.rpctx.ifpc;
  2148. };
  2149. function _1fc(_1fd,_1fe){
  2150. var tx=_1ff;
  2151. if(!_1fe){
  2152. tx=_1f9;
  2153. }
  2154. _1f1[_1fd]=tx;
  2155. var _200=_1f2[_1fd]||[];
  2156. for(var i=0;i<_200.length;++i){
  2157. var rpc=_200[i];
  2158. rpc.t=_201(_1fd);
  2159. tx.call(_1fd,rpc.f,rpc);
  2160. }
  2161. _1f2[_1fd]=[];
  2162. };
  2163. var _202=false,_203=false;
  2164. function _204(){
  2165. if(_203){
  2166. return;
  2167. }
  2168. function _205(){
  2169. _202=true;
  2170. };
  2171. OpenAjax.gadgets.util.attachBrowserEvent(window,"unload",_205,false);
  2172. _203=true;
  2173. };
  2174. function _206(_207,_208,_209,data,_20a){
  2175. if(!_1eb[_208]||_1eb[_208]!==_209){
  2176. OpenAjax.gadgets.error("Invalid auth token. "+_1eb[_208]+" vs "+_209);
  2177. _1f5(_208,_1f8);
  2178. }
  2179. _20a.onunload=function(){
  2180. if(_1ee[_208]&&!_202){
  2181. _1f5(_208,_1f7);
  2182. OpenAjax.gadgets.rpc.removeReceiver(_208);
  2183. }
  2184. };
  2185. _204();
  2186. data=OpenAjax.gadgets.json.parse(decodeURIComponent(data));
  2187. _1ff.relayOnload(_208,data);
  2188. };
  2189. function _20b(rpc){
  2190. if(rpc&&typeof rpc.s==="string"&&typeof rpc.f==="string"&&rpc.a instanceof Array){
  2191. if(_1eb[rpc.f]){
  2192. if(_1eb[rpc.f]!==rpc.t){
  2193. OpenAjax.gadgets.error("Invalid auth token. "+_1eb[rpc.f]+" vs "+rpc.t);
  2194. _1f5(rpc.f,_1f8);
  2195. }
  2196. }
  2197. if(rpc.s===ACK){
  2198. window.setTimeout(function(){
  2199. _1fc(rpc.f,true);
  2200. },0);
  2201. return;
  2202. }
  2203. if(rpc.c){
  2204. rpc.callback=function(_20c){
  2205. OpenAjax.gadgets.rpc.call(rpc.f,_1e4,null,rpc.c,_20c);
  2206. };
  2207. }
  2208. var _20d=(_1e8[rpc.s]||_1e8[_1e5]).apply(rpc,rpc.a);
  2209. if(rpc.c&&typeof _20d!=="undefined"){
  2210. OpenAjax.gadgets.rpc.call(rpc.f,_1e4,null,rpc.c,_20d);
  2211. }
  2212. }
  2213. };
  2214. function _20e(url){
  2215. if(!url){
  2216. return "";
  2217. }
  2218. url=url.toLowerCase();
  2219. if(url.indexOf("//")==0){
  2220. url=window.location.protocol+url;
  2221. }
  2222. if(url.indexOf("://")==-1){
  2223. url=window.location.protocol+"//"+url;
  2224. }
  2225. var host=url.substring(url.indexOf("://")+3);
  2226. var _20f=host.indexOf("/");
  2227. if(_20f!=-1){
  2228. host=host.substring(0,_20f);
  2229. }
  2230. var _210=url.substring(0,url.indexOf("://"));
  2231. var _211="";
  2232. var _212=host.indexOf(":");
  2233. if(_212!=-1){
  2234. var port=host.substring(_212+1);
  2235. host=host.substring(0,_212);
  2236. if((_210==="http"&&port!=="80")||(_210==="https"&&port!=="443")){
  2237. _211=":"+port;
  2238. }
  2239. }
  2240. return _210+"://"+host+_211;
  2241. };
  2242. function _213(id){
  2243. if(typeof id==="undefined"||id===".."){
  2244. return window.parent;
  2245. }
  2246. id=String(id);
  2247. var _214=window.frames[id];
  2248. if(_214){
  2249. return _214;
  2250. }
  2251. _214=document.getElementById(id);
  2252. if(_214&&_214.contentWindow){
  2253. return _214.contentWindow;
  2254. }
  2255. return null;
  2256. };
  2257. var _1ff=_1fb();
  2258. _1e8[_1e5]=function(){
  2259. OpenAjax.gadgets.warn("Unknown RPC service: "+this.s);
  2260. };
  2261. _1e8[_1e4]=function(_215,_216){
  2262. var _217=_1ed[_215];
  2263. if(_217){
  2264. delete _1ed[_215];
  2265. _217(_216);
  2266. }
  2267. };
  2268. function _218(_219,_21a,_21b){
  2269. if(_1ee[_219]===true){
  2270. return;
  2271. }
  2272. if(typeof _1ee[_219]==="undefined"){
  2273. _1ee[_219]=0;
  2274. }
  2275. var _21c=document.getElementById(_219);
  2276. if(_219===".."||_21c!=null){
  2277. if(_1ff.setup(_219,_21a,_21b)===true){
  2278. _1ee[_219]=true;
  2279. return;
  2280. }
  2281. }
  2282. if(_1ee[_219]!==true&&_1ee[_219]++<_1e7){
  2283. window.setTimeout(function(){
  2284. _218(_219,_21a,_21b);
  2285. },_1e6);
  2286. }else{
  2287. _1f1[_219]=_1f9;
  2288. _1ee[_219]=true;
  2289. }
  2290. };
  2291. function _21d(_21e,rpc){
  2292. if(typeof _1ef[_21e]==="undefined"){
  2293. _1ef[_21e]=false;
  2294. var _21f=OpenAjax.gadgets.rpc.getRelayUrl(_21e);
  2295. if(_20e(_21f)!==_20e(window.location.href)){
  2296. return false;
  2297. }
  2298. var _220=_213(_21e);
  2299. try{
  2300. _1ef[_21e]=_220.OpenAjax.gadgets.rpc.receiveSameDomain;
  2301. }
  2302. catch(e){
  2303. OpenAjax.gadgets.error("Same domain call failed: parent= incorrectly set.");
  2304. }
  2305. }
  2306. if(typeof _1ef[_21e]==="function"){
  2307. _1ef[_21e](rpc);
  2308. return true;
  2309. }
  2310. return false;
  2311. };
  2312. function _221(_222,url,_223){
  2313. if(!/http(s)?:\/\/.+/.test(url)){
  2314. if(url.indexOf("//")==0){
  2315. url=window.location.protocol+url;
  2316. }else{
  2317. if(url.charAt(0)=="/"){
  2318. url=window.location.protocol+"//"+window.location.host+url;
  2319. }else{
  2320. if(url.indexOf("://")==-1){
  2321. url=window.location.protocol+"//"+url;
  2322. }
  2323. }
  2324. }
  2325. }
  2326. _1e9[_222]=url;
  2327. _1ea[_222]=!!_223;
  2328. };
  2329. function _201(_224){
  2330. return _1eb[_224];
  2331. };
  2332. function _225(_226,_227,_228){
  2333. _227=_227||"";
  2334. _1eb[_226]=String(_227);
  2335. _218(_226,_227,_228);
  2336. };
  2337. function _229(_22a,_22b){
  2338. function init(_22c){
  2339. var _22d=_22c?_22c.rpc:{};
  2340. var _22e=_22d.parentRelayUrl;
  2341. if(_22e.substring(0,7)!=="http://"&&_22e.substring(0,8)!=="https://"&&_22e.substring(0,2)!=="//"){
  2342. if(typeof _1f0.parent==="string"&&_1f0.parent!==""){
  2343. if(_22e.substring(0,1)!=="/"){
  2344. var _22f=_1f0.parent.lastIndexOf("/");
  2345. _22e=_1f0.parent.substring(0,_22f+1)+_22e;
  2346. }else{
  2347. _22e=_20e(_1f0.parent)+_22e;
  2348. }
  2349. }
  2350. }
  2351. var _230=!!_22d.useLegacyProtocol;
  2352. _221("..",_22e,_230);
  2353. if(_230){
  2354. _1ff=OpenAjax.gadgets.rpctx.ifpc;
  2355. _1ff.init(_20b,_1fc);
  2356. }
  2357. var _231=_22b||_1f0.forcesecure||false;
  2358. _225("..",_22a,_231);
  2359. };
  2360. var _232={parentRelayUrl:OpenAjax.gadgets.config.NonEmptyStringValidator};
  2361. OpenAjax.gadgets.config.register("rpc",_232,init);
  2362. };
  2363. function _233(_234,_235,_236){
  2364. var _237=_236||_1f0.forcesecure||false;
  2365. var _238=_235||_1f0.parent;
  2366. if(_238){
  2367. _221("..",_238);
  2368. _225("..",_234,_237);
  2369. }
  2370. };
  2371. function _239(_23a,_23b,_23c,_23d){
  2372. if(!OpenAjax.gadgets.util){
  2373. return;
  2374. }
  2375. var _23e=document.getElementById(_23a);
  2376. if(!_23e){
  2377. throw new Error("Cannot set up gadgets.rpc receiver with ID: "+_23a+", element not found.");
  2378. }
  2379. var _23f=_23b||_23e.src;
  2380. _221(_23a,_23f);
  2381. var _240=OpenAjax.gadgets.util.getUrlParameters(_23e.src);
  2382. var _241=_23c||_240.rpctoken;
  2383. var _242=_23d||_240.forcesecure;
  2384. _225(_23a,_241,_242);
  2385. };
  2386. function _243(_244,_245,_246,_247){
  2387. if(_244===".."){
  2388. var _248=_246||_1f0.rpctoken||_1f0.ifpctok||"";
  2389. if(window["__isgadget"]===true){
  2390. _229(_248,_247);
  2391. }else{
  2392. _233(_248,_245,_247);
  2393. }
  2394. }else{
  2395. _239(_244,_245,_246,_247);
  2396. }
  2397. };
  2398. return {config:function(_249){
  2399. if(typeof _249.securityCallback==="function"){
  2400. _1f5=_249.securityCallback;
  2401. }
  2402. },register:function(_24a,_24b){
  2403. if(_24a===_1e4||_24a===ACK){
  2404. throw new Error("Cannot overwrite callback/ack service");
  2405. }
  2406. if(_24a===_1e5){
  2407. throw new Error("Cannot overwrite default service:"+" use registerDefault");
  2408. }
  2409. _1e8[_24a]=_24b;
  2410. },unregister:function(_24c){
  2411. if(_24c===_1e4||_24c===ACK){
  2412. throw new Error("Cannot delete callback/ack service");
  2413. }
  2414. if(_24c===_1e5){
  2415. throw new Error("Cannot delete default service:"+" use unregisterDefault");
  2416. }
  2417. delete _1e8[_24c];
  2418. },registerDefault:function(_24d){
  2419. _1e8[_1e5]=_24d;
  2420. },unregisterDefault:function(){
  2421. delete _1e8[_1e5];
  2422. },forceParentVerifiable:function(){
  2423. if(!_1ff.isParentVerifiable()){
  2424. _1ff=OpenAjax.gadgets.rpctx.ifpc;
  2425. }
  2426. },call:function(_24e,_24f,_250,_251){
  2427. _24e=_24e||"..";
  2428. var from="..";
  2429. if(_24e===".."){
  2430. from=_1f4;
  2431. }
  2432. ++_1ec;
  2433. if(_250){
  2434. _1ed[_1ec]=_250;
  2435. }
  2436. var rpc={s:_24f,f:from,c:_250?_1ec:0,a:Array.prototype.slice.call(arguments,3),t:_1eb[_24e],l:_1ea[_24e]};
  2437. if(_24e!==".."&&!document.getElementById(_24e)){
  2438. OpenAjax.gadgets.log("WARNING: attempted send to nonexistent frame: "+_24e);
  2439. return;
  2440. }
  2441. if(_21d(_24e,rpc)){
  2442. return;
  2443. }
  2444. var _252=_1f1[_24e];
  2445. if(!_252){
  2446. if(!_1f2[_24e]){
  2447. _1f2[_24e]=[rpc];
  2448. }else{
  2449. _1f2[_24e].push(rpc);
  2450. }
  2451. return;
  2452. }
  2453. if(_1ea[_24e]){
  2454. _252=OpenAjax.gadgets.rpctx.ifpc;
  2455. }
  2456. if(_252.call(_24e,from,rpc)===false){
  2457. _1f1[_24e]=_1f9;
  2458. _1ff.call(_24e,from,rpc);
  2459. }
  2460. },getRelayUrl:function(_253){
  2461. var url=_1e9[_253];
  2462. if(url&&url.substring(0,1)==="/"){
  2463. if(url.substring(1,2)==="/"){
  2464. url=document.location.protocol+url;
  2465. }else{
  2466. url=document.location.protocol+"//"+document.location.host+url;
  2467. }
  2468. }
  2469. return url;
  2470. },setRelayUrl:_221,setAuthToken:_225,setupReceiver:_243,getAuthToken:_201,removeReceiver:function(_254){
  2471. delete _1e9[_254];
  2472. delete _1ea[_254];
  2473. delete _1eb[_254];
  2474. delete _1ee[_254];
  2475. delete _1ef[_254];
  2476. delete _1f1[_254];
  2477. },getRelayChannel:function(){
  2478. return _1ff.getCode();
  2479. },receive:function(_255,_256){
  2480. if(_255.length>4){
  2481. _20b(OpenAjax.gadgets.json.parse(decodeURIComponent(_255[_255.length-1])));
  2482. }else{
  2483. _206.apply(null,_255.concat(_256));
  2484. }
  2485. },receiveSameDomain:function(rpc){
  2486. rpc.a=Array.prototype.slice.call(rpc.a);
  2487. window.setTimeout(function(){
  2488. _20b(rpc);
  2489. },0);
  2490. },getOrigin:_20e,getReceiverOrigin:function(_257){
  2491. var _258=_1f1[_257];
  2492. if(!_258){
  2493. return null;
  2494. }
  2495. if(!_258.isParentVerifiable(_257)){
  2496. return null;
  2497. }
  2498. var _259=OpenAjax.gadgets.rpc.getRelayUrl(_257)||OpenAjax.gadgets.util.getUrlParameters().parent;
  2499. return OpenAjax.gadgets.rpc.getOrigin(_259);
  2500. },init:function(){
  2501. if(_1ff.init(_20b,_1fc)===false){
  2502. _1ff=_1f9;
  2503. }
  2504. if(_1f3){
  2505. _243("..");
  2506. }
  2507. },_getTargetWin:_213,_createRelayIframe:function(_25a,data){
  2508. var _25b=OpenAjax.gadgets.rpc.getRelayUrl("..");
  2509. if(!_25b){
  2510. return;
  2511. }
  2512. var src=_25b+"#..&"+_1f4+"&"+_25a+"&"+encodeURIComponent(OpenAjax.gadgets.json.stringify(data));
  2513. var _25c=document.createElement("iframe");
  2514. _25c.style.border=_25c.style.width=_25c.style.height="0px";
  2515. _25c.style.visibility="hidden";
  2516. _25c.style.position="absolute";
  2517. function _25d(){
  2518. document.body.appendChild(_25c);
  2519. _25c.src="javascript:\"<html></html>\"";
  2520. _25c.src=src;
  2521. };
  2522. if(document.body){
  2523. _25d();
  2524. }else{
  2525. OpenAjax.gadgets.util.registerOnLoadHandler(function(){
  2526. _25d();
  2527. });
  2528. }
  2529. return _25c;
  2530. },ACK:ACK,RPC_ID:_1f4,SEC_ERROR_LOAD_TIMEOUT:_1f6,SEC_ERROR_FRAME_PHISH:_1f7,SEC_ERROR_FORGED_MSG:_1f8};
  2531. }();
  2532. OpenAjax.gadgets.rpc.init();
  2533. }