var bg=bg||{};bg.nullFunction=function(){};bg.abstractMethod=function(){throw new Error("unimplemented abstract method")};bg.addSingletonGetter=function(B){var A=B;A.getInstance=function(){return A.instance_||(A.instance_=new A())}};
if(!this.JSON){this.JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}return"null"}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}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,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());
bg.utils={};
bg.bind=function(C,B){var D=C;var A=function(){return D.apply(B,arguments)};return A};bg.inherits=function(D,C){var A=function(){};var B=C;A.prototype=B.prototype;D.superclass=B.prototype;D.prototype=new B();D.prototype.constructor=D};bg.base=function(E,A,G){var C=arguments.callee.caller;if(C.superclass){return C.superclass.constructor.apply(E,Array.prototype.slice.call(arguments,1))}var B=Array.prototype.slice.call(arguments,2);var F=false;for(var D=E.constructor;D;D=D.superclass&&D.superclass.constructor){if(D.prototype[A]===C){F=true}else{if(F){return D.prototype[A].apply(E,B)}}}if(E[A]===C){return E.constructor.prototype[A].apply(E,B)}else{throw new Error("bg.base called from a method of one name to a method of a different name")}};
bg.isSet=function(A){return A!==null&&typeof A!="undefined"};bg.isNumber=function(A){return !isNaN(parseFloat(A))};bg.isInteger=function(A){return !isNaN(parseInt(A,10))};bg.isArray=function(A){if(!bg.isSet(A)){return false}if(typeof A!="object"){return false}if(!("length" in A)){return false}if(typeof A.length!="number"){return false}return true};bg.isString=function(A){return typeof A=="string"};
bg.utils.assert={};bg.utils.assert.TYPE={EQUAL:"equal",NOT_EQUAL:"notEqual",STRICT_EQUAL:"strictEqual",NOT_STRICT_EQUAL:"notStrictEqual",NULL:"null",NOT_NULL:"notNull",UNDEFINED:"undefined",DEFINED:"defined",TYPE_OF:"typeOf",NOT_TYPE_OF:"notTypeOf",INSTANCE_OF:"instanceOf"};bg.utils.assert.assert=function(D,C,B){if(arguments.length<1){throw new Error("NO ARGUMENTS ON ASSERT")}var A=bg.utils.is.set(B)?" ("+B+") ":"";if(!D){throw new Error("Assertion failed "+A+"! "+C)}};bg.utils.assert.equal=function(A,C,B){bg.utils.assert.assert(A==C,B,bg.utils.assert.TYPE.EQUAL)};bg.utils.assert.notEqual=function(A,C,B){bg.utils.assert.assert(A!=C,B,bg.utils.assert.TYPE.NOT_EQUAL)};bg.utils.assert.strictEqual=function(A,C,B){bg.utils.assert.assert(A===C,B,bg.utils.assert.TYPE.STRICT_EQUAL)};bg.utils.assert.notStrictEqual=function(A,C,B){bg.utils.assert.assert(A!==C,B,bg.utils.assert.TYPE.NOT_STRICT_EQUAL)};bg.utils.assert.isNull=function(A,B){bg.utils.assert.assert(A===null,B,bg.utils.assert.TYPE.NULL)};bg.utils.assert.isUndefined=function(A,B){bg.utils.assert.assert(typeof A=="undefined",B,bg.utils.assert.TYPE.UNDEFINED)};bg.utils.assert.isDefined=function(A,B){bg.utils.assert.assert(A!==null&&typeof A!="undefined",B,bg.utils.assert.TYPE.DEFINED)};bg.utils.assert.isNotNull=function(A,B){bg.utils.assert.assert(A!==null,B,bg.utils.assert.TYPE.NOT_NULL)};bg.utils.assert.typeOf=function(A,B,C){bg.utils.assert.assert(typeof A===B,C,bg.utils.assert.TYPE.TYPE_OF)};bg.utils.assert.notTypeOf=function(A,B,C){bg.utils.assert.assert(typeof A!==B,C,bg.utils.assert.TYPE.NOT_TYPE_OF)};bg.utils.assert.instanceOf=function(B,A,C){bg.utils.assert.assert(B instanceof A,C,bg.utils.assert.TYPE.INSTANCE_OF)};
bg.utils.communication={properties:{ajaxproxy:"",siteurl:"/gmapspe",domain:"",encoding:"utf-8"},initProperties:function(A,B){if(bg.isSet(A)){bg.utils.communication.properties.ajaxproxy=A}if(bg.isSet(B)){bg.utils.communication.properties.siteurl=B}bg.utils.communication.properties.domain=window.location.hostname},initPropertiesFromScript:function(){var A=document.getElementsByTagName("script");var F;var D,B=A.length;var E=null;var C;for(D=0;D<B;D++){F=A[D].src;if(/GetApi/.test(F)){C=bg.utils.communication.parseUri(F);E=C.baseUri.split("/");E=E.slice(0,E.length-1);E=E.join("/");break}}if(E===null){throw new Error("unable to get informations about location!")}bg.utils.communication.properties.ajaxproxy="";bg.utils.communication.properties.siteurl=E;bg.utils.communication.properties.domain=window.location.hostname},createXhr:function(){var A;var D;if(window.XMLHttpRequest){return function(){return new XMLHttpRequest()}}if(window.ActiveXObject){var C=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP","Microsoft.XMLHTTP"];for(A in C){try{new ActiveXObject(C[A]);return function(){return new ActiveXObject(C[A])}}catch(B){}}}window.alert("Votre navigateur ne prend pas en charge l'objet XMLHTTPRequest.");return null}(),request:function(A,E,B){var D=!!B;var C=bg.utils.communication.createXhr();if(C===null){return }C.onreadystatechange=function(){var F;if(C.readyState==4&&C.status==200){if(D){F=C.responseText}else{F=JSON.parse(C.responseText)}E(F)}};C.open("GET",A,true);C.send(null)},formatServletUrl:function(F,H){var C=bg.utils.communication.properties.ajaxproxy+bg.utils.communication.properties.siteurl+"/GServlet?";var A=["r="+F];var E,G;var D,B;if(bg.isSet(H)){for(E in H){G=H[E];if(bg.isArray(G)){for(D=0,B=G.length;D<B;D++){A.push(E+"="+encodeURIComponent(G[D]))}}else{A.push(E+"="+encodeURIComponent(G))}}}C+=A.join("&");return C},formatUrl:function(F,H){var E,G;var C=F;if(!/\?/.test(C)){C+="?"}else{if(!/&$/.test(C)){C+="&"}}var A=[];var D,B;if(bg.isSet(H)){for(E in H){G=H[E];if(bg.isArray(G)){for(D=0,B=G.length;D<B;D++){A.push(E+"="+encodeURIComponent(G[D]))}}else{A.push(E+"="+encodeURIComponent(G))}}}C+=A.join("&");return C},formatDefaultUrl:function(B,C){var A=bg.utils.communication.properties.ajaxproxy+bg.utils.communication.properties.siteurl;A=A.replace(/\/$/,"");B=B.replace(/^\//,"");A+="/"+B;return bg.utils.communication.formatUrl(A,C)},parseUri:function(A){var C=A||window.location.toString();var D=C.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!bg.isSet(D)||D.length<10){return null}var B={scheme:D[2],authority:D[4],path:D[5],query:D[7],fragment:D[9],baseUri:"",fullUri:""};B.baseUri=(bg.isSet(B.scheme)?B.scheme+":":"")+(bg.isSet(B.authority)?"//"+B.authority:"")+(bg.isSet(B.path)?B.path:"");B.fullUri=B.baseUri+(bg.isSet(B.query)?"?"+B.query:"")+(bg.isSet(B.fragment)?"#"+B.fragment:"");return B}};
bg.utils.Ajax=function(){};bg.utils.Ajax.prototype.request=function(C,D,E,B){var A=bg.utils.communication.formatUrl(C,D);bg.utils.communication.request(A,E,!!B)};
bg.utils.Jsonp=function(){this.head=document.getElementsByTagName("head")[0];this.jsonp={};this.lastid=-1;this._waitNextClean()};bg.addSingletonGetter(bg.utils.Jsonp);bg.utils.Jsonp.MAX_AVAILABLE_SCRIPT=30000;bg.utils.Jsonp.TIMEOUT_SCRIPT=60000;bg.utils.Jsonp.WAIT_CLEAN=30000;bg.utils.Jsonp.prototype.head=null;bg.utils.Jsonp.prototype.jsonp=null;bg.utils.Jsonp.prototype.lastid=null;bg.utils.Jsonp.prototype._addCallback=function(A){this.lastid+=1;this.jsonp[this.lastid]={callback:A};return this.lastid};bg.utils.Jsonp.prototype._executeCallback=function(B,A){this.jsonp[B].received_at=new Date();this.jsonp[B].callback(A)};bg.utils.Jsonp.prototype._addJsonP=function(B,C){var A=document.createElement("script");A.id="jsonp_"+C;A.charset=bg.utils.communication.properties.encoding;A.src=B;this.jsonp[C].asked_at=new Date();this.head.appendChild(A)};bg.utils.Jsonp.prototype.request=function(B,C,E){var D=this._addCallback(E);if(!bg.isSet(C)){C={}}C.jsonpid=D;var A=bg.utils.communication.formatServletUrl(B,C);this._addJsonP(A,D)};bg.utils.Jsonp.prototype.externalRequest=function(A,B,D){var C=this._addCallback(D);if(!bg.isSet(B)){B={}}B.jsonpid=C;var A=bg.utils.communication.formatUrl(A,B);this._addJsonP(A,C)};bg.utils.Jsonp.prototype.clean=function(){var D=new Date();var H,G,F;var B=[];for(H in this.jsonp){if("received_at" in this.jsonp[H]){G=D-this.jsonp[H].received_at;F=G>bg.utils.Jsonp.MAX_AVAILABLE_SCRIPT}else{G=D-this.jsonp[H].asked_at;F=G>bg.utils.Jsonp.TIMEOUT_SCRIPT}if(F){B.push(H)}}var E,A=B.length;var C;for(E=0;E<A;E++){C=document.getElementById("jsonp_"+H);if(!bg.isSet(C)){continue}C.parentNode.removeChild(C);delete this.jsonp[H]}this._waitNextClean()};bg.utils.Jsonp.prototype._waitNextClean=function(){window.setTimeout(bg.bind(this.clean,this),bg.utils.Jsonp.WAIT_CLEAN)};

