/*
 * Bravenet Apps Copy/Paste Code v1.2.0
 *
 * Copyright (c) 2008 Bravenet Web Services Inc. (bravenet.com)
 */
(function(){if(!window.Bravenet){window.Bravenet={}}var A=window.Bravenet;if(A.Core){A.Core.launch()}var F=/http:\/\/apps\.bravenet\.com\/go(\.\w*)?\.js(\?.*)?$/;var E="";var D=(function(){var J=null,H=null;var G=document.getElementsByTagName("script");for(var I=0;(J=G[I]);I++){H=J.src.match(F);if(H){E=(H[1]||"");return J.src.replace(/go(\.\w*)?\.js(\?.*)?$/,"")}}})();var C=(function(){var I="1.2.2";var J=(function(){var K=document.getElementsByTagName("HEAD");if(K.length==0){return false}return !!K[0]})();function G(K){var L=K.split(".");return parseInt(L[0],10)*1000000+parseInt(L[1],10)*1000+parseInt(L[2],10)}function H(K){return K&&(G(I)<=G(K.prototype.jquery))}return function(){if(!J){this.writeRawScript(this.getErrorUrl("dom"));return }var M=[],K=null;if(!H(A.jQuery)){M=["jquery"+E,"jquery.swfobject","jquery.bnet-adapter"]}for(var L=0;(K=M[L]);++L){this.writeRawScript(this.getLibraryUrl(K))}if(H(A.jQuery)){this.launch()}}})();C.prototype=(function(){var L="8.0.0",R="libraries/",P="services/",M="errors/",J="bravenet.ready.event",I=(function(){var Y={},W="guestbook,photocenter,forum".split(",");for(var X=0;X<W.length;++X){Y[W[X]]=true}return Y})();var T={};var G={};var V={};function K(){return this.bn_processed||!!(this.src.match(F))}function U(){var W={};A.jQuery("script").filter(K).each(function(){var X=this.src.match(/\?(.*)$/);if(!X){return }A.jQuery.each(X[1].split(";"),function(){var Y=this.split("=");W[Y[0]]=Y[1]});this.bn_processed=true});return W}function S(){var W=true;for(var Y in T){if(!T[Y]){W=false;break}}var X=A.jQuery;if(W){X(document).trigger(J)}}function H(X){var Z={id:"1"};try{if(I[X.service]){Z.service=X.service}var W=parseInt(X.usernum,10);if(!isNaN(W)){Z.usernum=W.toString()}var c=parseInt(X.id,10);if(!isNaN(c)){Z.id=c.toString()}var a=parseInt(X.editor,10);if(!isNaN(a)&&a==1){Z.editor=a.toString()}}catch(b){}for(var Y in X){delete X[Y]}for(var Y in Z){X[Y]=Z[Y]}return(X.service&&X.usernum)}function N(X){if(!arguments.callee.uid){arguments.callee.uid=0}var W=["bn"];W.push(X.service);W.push(X.id);W.push(arguments.callee.uid+=1);W.push(X.usernum);return W.join("-")}function O(W){return["bn",W.service,W.id,W.usernum,"xd"].join("")}function Q(W){return"bravenet.com"!=""&&!W.match(/^http:\/\/(\w*\.)*bravenet\.com/)}return{version:"1.2.0",getPubNumber:function(W){return Math.ceil(W/85899346)},getUrl:function(W){return D+W},getLibraryUrl:function(W){var X=R;X+=W;X+=".js";return this.getUrl(X)},getServiceUrl:function(W){var X=P;X+=W;X+=".js";return this.getUrl(X)},getErrorUrl:function(W){var X=M;X+=W;X+=".error.js";return this.getUrl(X)},writeRawScript:function(W){if(Q(W)){return }document.write('<script type="text/javascript" src="'+W+'"><\/script>')},prependStyleSheet:function(X,W){if(Q(X)){return }if(document.createStyleSheet){document.createStyleSheet(X,0)}else{var Y=A.jQuery;Y("head",0).prepend(Y("<link></link>").attr({rel:"stylesheet",type:"text/css",href:X}))}},getScript:function(W,X){if(Q(W)){return }return A.jQuery.ajax({dataType:"script",type:"GET",url:W,data:null,cache:true,success:X})},launch:function(X){var a=A.jQuery;if(!a.swfobject.hasFlashPlayerVersion(L)){this.writeRawScript(this.getErrorUrl("flash"));return }X=a.extend({id:"1"},X||U());if(!H(X)){this.writeRawScript(this.getErrorUrl("options"));return }var Y=O(X);var Z=N(X);var W=X.service;if(V[W]){this.writeRawScript(this.getErrorUrl("duplicate"));return }V[W]=true;var c='<div id="'+Z+'-wrapper" style="position: relative;">';if(!A._xd_ajax){c+='<div id="'+Y+'" style="position: relative; top: 0; left: 0;">&nbsp;</div>'}c+='<div id="'+Z+'">&nbsp;</div>';c+="</div>";document.writeln(c);var b=this;(function(){var d=arguments.callee;if(!d.opera_synced){d.opera_synced=true;setTimeout(d,10);return }if(!G[W]){b.getScript(b.getServiceUrl(W),d);return }b.ready(function(){a(document).unbind(J,arguments.callee);if(!A._xd_ajax){var f={menu:"false",wmode:"transparent",allowscriptaccess:"always",allownetworking:"all"},e={style:"position: absolute; top: 0; left: 0; visbility: visible;"};a.swfobject.embedSWF(b.getUrl("go.swf"),Y,"1","1",L,false,X,f,e)}if(!A.xd_ajax){A._xd_ajax=a.swfobject.getObjectById(Y)}X.container=a("#"+Z);new (G[W])(X)})})()},ready:function(W){A.jQuery(document).bind(J,W);S()},register:function(X,W){G[X]=W},require:function(W){if(T[W]){return true}T[W]=false;this.getScript(this.getLibraryUrl(W),function(){T[W]=true;S()})}}})();A.urlencode=function(H){var G=H;G=G.toString();G=encodeURIComponent(G);G=G.replace(/%20/g,"+");return G};A.urldecode=function(H){var G=H;G=G.replace(/\+/g,"%20");G=decodeURIComponent(G);G=G.toString();return G};A.encode=function(G){var H="";for(i=0;i<G.length;i++){if(G.charCodeAt(i)>127){H+="&#"+G.charCodeAt(i)+";"}else{H+=G.charAt(i)}}return A.urlencode(H)};A.require=function(G){A.Core.require.apply(A.Core,arguments)};A.register=function(H,G){A.Core.register.apply(A.Core,arguments)};A.ready=function(G){A.Core.ready.apply(A.Core,arguments)};A.Core=new C();var B=A.Service=function(G){this.options=G;this.initialize.apply(this)};B.prototype={initialize:function(){},getPubNumber:function(){return A.Core.getPubNumber(this.options.usernum)},addCss:function(G){A.Core.prependStyleSheet(G)}};B.extend=function(I){var H=function(){};H.prototype=B.prototype;function G(J){this.options=J;this.initialize.apply(this)}G.prototype=new H();G.prototype.constructor=G;A.jQuery.extend(G.prototype,I);return G}})();

