/*
(c) 2007-2009 CTBTO Preparatory Commission
*/
var tekt={};function tryMethodUntilLoaded(func){try{eval(func)}catch(ex){window.setTimeout(tryMethodUntilLoaded,500,func)}}function requireScript(C,D){var B=document.getElementsByTagName("head")[0];var A=document.createElement("script");A.type="text/javascript";A.src=C;B.appendChild(A);if(D){tryMethodUntilLoaded(D)}}var eventFunctionNames=["onclick","onmouseover","onmouseout","onchange"];Object.addBehavior=function(C,B){for(var A in B){if(A!="_init"){if(eventFunctionNames.indexOf(A)==-1){C[A]=B[A].bind(C)}else{Event.observe(C,A.substring(2),B[A].bindAsEventListener(C))}}}if(B._init){B._init.apply(C)}};function walkDOM(A,F,D){if(A){var E=F(A,D);if(E){var C=A.childNodes;for(var B=0;B<C.length;B++){walkDOM(C[B],F,D)}}}}tekt.init=function(A){A=A||tekt.bindings||{};walkDOM(document.body,initElement,A)};function initElement(B,D){for(var A in D){if(A.charAt(0)=="."){if(B.className&&B.className.search("(?:^|\\s)"+A.substring(1)+"(?:$|\\s)")>-1){var C=D[A];Object.addBehavior(B,C)}}else{if(A.charAt(0)=="#"){if(B.id&&B.id==A.substring(1)){var C=D[A];Object.addBehavior(B,C)}}}}return true}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(A){for(var B=0;B<this.length;B++){if(this[B]==A){return B}}return -1}}function cumulativeOffset(B){var A=0,C=0;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;B=B.offsetParent}while(B);return[C,A]}String.prototype.trim=function(){return this.replace(/^\s\s*/,"").replace(/\s\s*$/,"")};function getInitialHeight(B){var A=B.offsetHeight;if(!A){var D=B.style;if(B.currentStyle){D=B.currentStyle}else{if(window.getComputedStyle){D=window.getComputedStyle(B,"")}}var C=D.height;if(C.indexOf("px")>0){A=parseFloat(C.substring(0,C.indexOf("px")))}}return A}Function.prototype.bind=function(B){var A=this;return function(){return A.apply(B,arguments)}};Function.prototype.bindAsEventListener=function(B){var A=this;return function(C){return A.call(B,C||window.event)}};function $(){var C=new Array();for(var B=0;B<arguments.length;B++){var A=arguments[B];if(typeof A=="string"){A=document.getElementById(A)}if(arguments.length==1){return A}C.push(A)}return C}function getQualifiedElements(E,F,B){var D=($(B)||document.body).getElementsByTagName(E||"*");if(!F){return D}var A=[];for(var C=0;C<D.length;C++){if(D[C].className.match(new RegExp("(^|\\s)"+F+"(\\s|$)"))){A.push(D[C])}}return A}function getFirstQualifiedElement(C,D,B){var A=getQualifiedElements(C,D,B);if(A&&A.length>0){return A[0]}return null}function addClassName(C,B){if(!C.className){C.className=B;return }var A=C.className.split(/\s+/);if(A.indexOf(B)>-1){return }C.className=A.concat(B).join(" ")}function removeClassName(D,C){if(!D.className){return }var B=D.className.split(/\s+/);var A=B.indexOf(C);if(A==-1){return }B.splice(A,1);D.className=B.join(" ")}function hasClassName(C,B){var A=C.className.split(/\s+/);return(A.indexOf(B)>-1)}var FieldNotifier={_init:function(){this.fieldListeners={}},addFieldListener:function(B,A){if(!this.fieldListeners[B]){this.fieldListeners[B]=[]}if(this.fieldListeners[B].indexOf(A)==-1){this.fieldListeners[B].push(A)}},removeFieldListener:function(B,A){if(this.fieldListeners[B]){this.fieldListeners[B]=this.fieldListeners[B].without(A)}},notifyFieldListeners:function(C){if(this.fieldListeners[C]){for(var B=0,A=this.fieldListeners[C].length;B<A;B++){this.fieldListeners[C][B](this)}}},setAndNotify:function(B,A){this[B]=A;this.notifyFieldListeners(B)}};var EventNotifier={_init:function(){this.eventListeners={}},addEventListener:function(A,B){if(!this.eventListeners[A]){this.eventListeners[A]=[]}if(!this.eventListeners[A].include(B)){this.eventListeners[A].push(B)}},removeEventListener:function(A,B){if(this.eventListeners[A]){this.eventListeners[A]=this.eventListeners[A].without(B)}},notifyEventListeners:function(C,D){if(this.eventListeners[C]){for(var B=0,A=this.eventListeners[C].length;B<A;B++){this.eventListeners[C][B](this,D)}}}};var Event={KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(A){return A.target||A.srcElement},isLeftClick:function(A){return(((A.which)&&(A.which==1))||((A.button)&&(A.button==1)))},pointerX:function(A){return A.pageX||(A.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft))},pointerY:function(A){return A.pageY||(A.clientY+(document.documentElement.scrollTop||document.body.scrollTop))},stop:function(A){if(A.preventDefault){A.preventDefault();A.stopPropagation()}else{A.returnValue=false;A.cancelBubble=true}},findElement:function(C,B){var A=Event.element(C);while(A.parentNode&&(!A.tagName||(A.tagName.toUpperCase()!=B.toUpperCase()))){A=A.parentNode}return A},observers:false,_observeAndCache:function(D,C,B,A){if(!this.observers){this.observers=[]}if(D.addEventListener){this.observers.push([D,C,B,A]);D.addEventListener(C,B,A)}else{if(D.attachEvent){this.observers.push([D,C,B,A]);D.attachEvent("on"+C,B)}}},unloadCache:function(){if(!Event.observers){return }for(var A=0;A<Event.observers.length;A++){Event.stopObserving.apply(this,Event.observers[A]);Event.observers[A][0]=null}Event.observers=false},observe:function(D,C,B,A){var D=$(D);A=A||false;if(C=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||D.attachEvent)){C="keydown"}this._observeAndCache(D,C,B,A)},stopObserving:function(D,C,B,A){var D=$(D);A=A||false;if(C=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||D.detachEvent)){C="keydown"}if(D.removeEventListener){D.removeEventListener(C,B,A)}else{if(D.detachEvent){D.detachEvent("on"+C,B)}}}};Event.observe(window,"unload",Event.unloadCache,false);var Accordion={_init:function(){this.accordionTitles=[];this.accordionContents=[];this.selectedIndex=0},showPane:function(C){var A=-1;if(typeof C=="number"){A=C}else{for(var B=0;B<this.accordionTitles.length;B++){if(this.accordionTitles[B]==C){A=B;break}}}if(A>-1&&A!=this.selectedIndex){this.accordionContents[this.selectedIndex].style.height=this.accordionContents[this.selectedIndex].accordionTargetHeight+"px";Tweener.addTween(this.accordionContents[this.selectedIndex].style,{height:0,suffix:{height:"px"},onComplete:function(){this.accordionContents[A].style.height="0px";this.accordionContents[A].style.display="block";Tweener.addTween(this.accordionContents[A].style,{height:this.accordionContents[A].accordionTargetHeight,suffix:{height:"px"},time:0.3})}.bind(this),time:0.3});this.selectedIndex=A}}};var AccordionTitle={_init:function(){this.accordion=this.parentNode;this.accordion.accordionTitles.push(this)},onclick:function(A){this.accordion.showPane(this)}};var AccordionContent={_init:function(){this.accordionTargetHeight=getInitialHeight(this);if(this.parentNode.accordionContents.length!=this.parentNode.selectedIndex){this.style.display="none";this.style.height="0px"}else{this.style.display="block"}this.style.overflow="hidden";this.parentNode.accordionContents.push(this)}};var Toggle={_init:function(){var G=this.id;var C=/toggle\d*For/;var A=C.exec(G);if(A&&A[0]&&A.index==0){var D=A[0].length;var F=G.substring(D);if(F.indexOf("Group")==0){F=F.substring(5);this.toggleables=getQualifiedElements(null,"toggleGroup"+F,null)}else{F=F.substring(0,1).toLowerCase()+F.substring(1);this.toggleables=[$(F)]}}if(this.toggleables){for(var B=0;B<this.toggleables.length;B++){this.toggleables[B].toggleableHeight=getInitialHeight(this.toggleables[B]);if(!this.toggleables[B].toggles){this.toggleables[B].toggles=[]}this.toggleables[B].toggles.push(this)}Event.observe(this,"click",this.doToggle);var E=false;if(hasClassName(this,"toggleOn")||hasClassName(this.toggleables[0],"toggleableOn")||this.toggleables[0].style.display!="none"){E=true}if(hasClassName(this,"toggleOff")||hasClassName(this.toggleables[0],"toggleableOff")||this.toggleables[0].style.display=="none"){E=false}this.setState(E)}},doToggle:function(){this.setState(!this.toggleState)},setState:function(B,C){this.toggleState=B;if(B){addClassName(this,"toggleOn");removeClassName(this,"toggleOff");if(!C){for(var A=0;A<this.toggleables.length;A++){this.setToggleableState(this.toggleables[A],B)}}}else{addClassName(this,"toggleOff");removeClassName(this,"toggleOn");if(!C){for(var A=0;A<this.toggleables.length;A++){this.setToggleableState(this.toggleables[A],B)}}}},setToggleableState:function(B,C){if(C){if(hasClassName(B,"toggleableOff")){addClassName(B,"toggleableOn");removeClassName(B,"toggleableOff")}else{addClassName(B,"toggleableOn");removeClassName(B,"toggleableOff")}}else{if(hasClassName(B,"toggleableOn")){addClassName(B,"toggleableOff");removeClassName(B,"toggleableOn")}else{addClassName(B,"toggleableOff");removeClassName(B,"toggleableOn")}}if(B.toggles){for(var A=0;A<B.toggles.length;A++){if(B.toggles[A]!=this){B.toggles[A].setState(C,true)}}}}};var Tweener={looping:false,frameRate:60,objects:[],defaultOptions:{time:1,transition:"easeoutexpo",delay:0,prefix:{},suffix:{},onStart:undefined,onStartParams:undefined,onUpdate:undefined,onUpdateParams:undefined,onComplete:undefined,onCompleteParams:undefined},inited:false,easingFunctionsLowerCase:{},init:function(){this.inited=true;for(var A in Tweener.easingFunctions){this.easingFunctionsLowerCase[A.toLowerCase()]=Tweener.easingFunctions[A]}},toNumber:function(B,A,C){if(!C){C="px"}return B.toString().match(/[0-9]/)?Number(B.toString().replace(new RegExp(C+"$"),"").replace(new RegExp("^"+(A?A:"")),"")):0},addTween:function(D,B){var A=this;if(!this.inited){this.init()}var F={};F.target=D;F.targetPropeties={};for(var C in this.defaultOptions){if(B[C]){F[C]=B[C];delete B[C]}else{F[C]=this.defaultOptions[C]}}if(typeof F.transition=="function"){F.easing=F.transition}else{F.easing=this.easingFunctionsLowerCase[F.transition.toLowerCase()]}for(var C in B){if(!F.prefix[C]){F.prefix[C]=""}if(!F.suffix[C]){F.suffix[C]=""}var E=this.toNumber(D[C],F.prefix[C],F.suffix[C]);F.targetPropeties[C]={b:E,c:B[C]-E}}setTimeout(function(){F.startTime=(new Date()-0);F.endTime=F.time*1000+F.startTime;if(typeof F.onStart=="function"){if(F.onStartParams){F.onStart.apply(F,F.onStartParams)}else{F.onStart()}}A.objects.push(F);if(!A.looping){A.looping=true;A.eventLoop.call(A)}},F.delay*1000);return F},stopTween:function(C){var A=[];for(var B=0;B<this.objects.length;B++){if(this.objects[B]!=C){A.push(this.objects[B])}}this.objects=A},eventLoop:function(){var A=(new Date()-0);for(var E=0;E<this.objects.length;E++){var B=this.objects[E];var J=A-B.startTime;var G=B.endTime-B.startTime;if(J>=G){for(var H in B.targetPropeties){var C=B.targetPropeties[H];try{B.target[H]=B.prefix[H]+(C.b+C.c)+B.suffix[H]}catch(F){}}this.objects.splice(E,1);if(typeof B.onUpdate=="function"){if(B.onUpdateParams){B.onUpdate.apply(B,B.onUpdateParams)}else{B.onUpdate()}}if(typeof B.onComplete=="function"){if(B.onCompleteParams){B.onComplete.apply(B,B.onCompleteParams)}else{B.onComplete()}}}else{for(var H in B.targetPropeties){var C=B.targetPropeties[H];var D=B.easing(J,C.b,C.c,G);try{B.target[H]=B.prefix[H]+D+B.suffix[H]}catch(F){}}if(typeof B.onUpdate=="function"){if(B.onUpdateParams){B.onUpdate.apply(B,B.onUpdateParams)}else{B.onUpdate()}}}}if(this.objects.length>0){var I=this;setTimeout(function(){I.eventLoop()},1000/I.frameRate)}else{this.looping=false}}};Tweener.Utils={bezier2:function(A,D,C,B){return(1-A)*(1-A)*D+2*A*(1-A)*C+A*A*B},bezier3:function(A,E,D,C,B){return Math.pow(1-A,3)*E+3*A*Math.pow(1-A,2)*D+3*A*A*(1-A)*C+A*A*A*B},allSetStyleProperties:function(C){var B;if(document.defaultView&&document.defaultView.getComputedStyle){B=document.defaultView.getComputedStyle(C,null)}else{B=C.currentStyle}for(var A in B){if(!A.match(/^\d+$/)){try{C.style[A]=B[A]}catch(D){}}}}};Tweener.easingFunctions={easeNone:function(B,A,D,C){return D*B/C+A},easeInQuad:function(B,A,D,C){return D*(B/=C)*B+A},easeOutQuad:function(B,A,D,C){return -D*(B/=C)*(B-2)+A},easeInOutQuad:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B+A}return -D/2*((--B)*(B-2)-1)+A},easeInCubic:function(B,A,D,C){return D*(B/=C)*B*B+A},easeOutCubic:function(B,A,D,C){return D*((B=B/C-1)*B*B+1)+A},easeInOutCubic:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B*B+A}return D/2*((B-=2)*B*B+2)+A},easeOutInCubic:function(B,A,D,C){if(B<C/2){return Tweener.easingFunctions.easeOutCubic(B*2,A,D/2,C)}return Tweener.easingFunctions.easeInCubic((B*2)-C,A+D/2,D/2,C)},easeInQuart:function(B,A,D,C){return D*(B/=C)*B*B*B+A},easeOutQuart:function(B,A,D,C){return -D*((B=B/C-1)*B*B*B-1)+A},easeInOutQuart:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B*B*B+A}return -D/2*((B-=2)*B*B*B-2)+A},easeOutInQuart:function(B,A,D,C){if(B<C/2){return Tweener.easingFunctions.easeOutQuart(B*2,A,D/2,C)}return Tweener.easingFunctions.easeInQuart((B*2)-C,A+D/2,D/2,C)},easeInQuint:function(B,A,D,C){return D*(B/=C)*B*B*B*B+A},easeOutQuint:function(B,A,D,C){return D*((B=B/C-1)*B*B*B*B+1)+A},easeInOutQuint:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B*B*B*B+A}return D/2*((B-=2)*B*B*B*B+2)+A},easeOutInQuint:function(B,A,D,C){if(B<C/2){return Tweener.easingFunctions.easeOutQuint(B*2,A,D/2,C)}return Tweener.easingFunctions.easeInQuint((B*2)-C,A+D/2,D/2,C)},easeInSine:function(B,A,D,C){return -D*Math.cos(B/C*(Math.PI/2))+D+A},easeOutSine:function(B,A,D,C){return D*Math.sin(B/C*(Math.PI/2))+A},easeInOutSine:function(B,A,D,C){return -D/2*(Math.cos(Math.PI*B/C)-1)+A},easeOutInSine:function(B,A,D,C){if(B<C/2){return Tweener.easingFunctions.easeOutSine(B*2,A,D/2,C)}return Tweener.easingFunctions.easeInSine((B*2)-C,A+D/2,D/2,C)},easeInExpo:function(B,A,D,C){return(B==0)?A:D*Math.pow(2,10*(B/C-1))+A-D*0.001},easeOutExpo:function(B,A,D,C){return(B==C)?A+D:D*1.001*(-Math.pow(2,-10*B/C)+1)+A},easeInOutExpo:function(B,A,D,C){if(B==0){return A}if(B==C){return A+D}if((B/=C/2)<1){return D/2*Math.pow(2,10*(B-1))+A-D*0.0005}return D/2*1.0005*(-Math.pow(2,-10*--B)+2)+A},easeOutInExpo:function(B,A,D,C){if(B<C/2){return Tweener.easingFunctions.easeOutExpo(B*2,A,D/2,C)}return Tweener.easingFunctions.easeInExpo((B*2)-C,A+D/2,D/2,C)},easeInCirc:function(B,A,D,C){return -D*(Math.sqrt(1-(B/=C)*B)-1)+A},easeOutCirc:function(B,A,D,C){return D*Math.sqrt(1-(B=B/C-1)*B)+A},easeInOutCirc:function(B,A,D,C){if((B/=C/2)<1){return -D/2*(Math.sqrt(1-B*B)-1)+A}return D/2*(Math.sqrt(1-(B-=2)*B)+1)+A},easeOutInCirc:function(B,A,D,C){if(B<C/2){return Tweener.easingFunctions.easeOutCirc(B*2,A,D/2,C)}return Tweener.easingFunctions.easeInCirc((B*2)-C,A+D/2,D/2,C)},easeInElastic:function(C,A,G,F,B,E){var D;if(C==0){return A}if((C/=F)==1){return A+G}if(!E){E=F*0.3}if(!B||B<Math.abs(G)){B=G;D=E/4}else{D=E/(2*Math.PI)*Math.asin(G/B)}return -(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A},easeOutElastic:function(C,A,G,F,B,E){var D;if(C==0){return A}if((C/=F)==1){return A+G}if(!E){E=F*0.3}if(!B||B<Math.abs(G)){B=G;D=E/4}else{D=E/(2*Math.PI)*Math.asin(G/B)}return(B*Math.pow(2,-10*C)*Math.sin((C*F-D)*(2*Math.PI)/E)+G+A)},easeInOutElastic:function(C,A,G,F,B,E){var D;if(C==0){return A}if((C/=F/2)==2){return A+G}if(!E){E=F*(0.3*1.5)}if(!B||B<Math.abs(G)){B=G;D=E/4}else{D=E/(2*Math.PI)*Math.asin(G/B)}if(C<1){return -0.5*(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A}return B*Math.pow(2,-10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E)*0.5+G+A},easeOutInElastic:function(C,A,F,E,B,D){if(C<E/2){return Tweener.easingFunctions.easeOutElastic(C*2,A,F/2,E,B,D)}return Tweener.easingFunctions.easeInElastic((C*2)-E,A+F/2,F/2,E,B,D)},easeInBack:function(B,A,E,D,C){if(C==undefined){C=1.70158}return E*(B/=D)*B*((C+1)*B-C)+A},easeOutBack:function(B,A,E,D,C){if(C==undefined){C=1.70158}return E*((B=B/D-1)*B*((C+1)*B+C)+1)+A},easeInOutBack:function(B,A,E,D,C){if(C==undefined){C=1.70158}if((B/=D/2)<1){return E/2*(B*B*(((C*=(1.525))+1)*B-C))+A}return E/2*((B-=2)*B*(((C*=(1.525))+1)*B+C)+2)+A},easeOutInBack:function(B,A,E,D,C){if(B<D/2){return Tweener.easingFunctions.easeOutBack(B*2,A,E/2,D,C)}return Tweener.easingFunctions.easeInBack((B*2)-D,A+E/2,E/2,D,C)},easeInBounce:function(B,A,D,C){return D-Tweener.easingFunctions.easeOutBounce(C-B,0,D,C)+A},easeOutBounce:function(B,A,D,C){if((B/=C)<(1/2.75)){return D*(7.5625*B*B)+A}else{if(B<(2/2.75)){return D*(7.5625*(B-=(1.5/2.75))*B+0.75)+A}else{if(B<(2.5/2.75)){return D*(7.5625*(B-=(2.25/2.75))*B+0.9375)+A}else{return D*(7.5625*(B-=(2.625/2.75))*B+0.984375)+A}}}},easeInOutBounce:function(B,A,D,C){if(B<C/2){return Tweener.easingFunctions.easeInBounce(B*2,0,D,C)*0.5+A}else{return Tweener.easingFunctions.easeOutBounce(B*2-C,0,D,C)*0.5+D*0.5+A}},easeOutInBounce:function(B,A,D,C){if(B<C/2){return Tweener.easingFunctions.easeOutBounce(B*2,A,D/2,C)}return Tweener.easingFunctions.easeInBounce((B*2)-C,A+D/2,D/2,C)}};Tweener.easingFunctions.linear=Tweener.easingFunctions.easeNone;var CONTOUR_THICKNESS=2;var CONTOUR_COLOUR="#ffffff";var AREA_COLOUR="#ffffff";var DEFAULT_MAP_CENTER=[30.7,17];var DEFAULT_MAP_LEVEL=3;var DEFAULT_MAP_TYPE=1;var DEFAULT_MAP_TYPE=G_PHYSICAL_MAP;var toneDiv=null;var pixelPos=[0,0];var map=null;var mapDiv=null;var MAX_ZOOM=10;var MIN_ZOOM=1;function initMap(C,D,A,B){if(GBrowserIsCompatible()){if(!B){B={}}mapDiv=$(C);if(!mapDiv){return }map=new GMap2(mapDiv);if(!A){A=new GLatLng(DEFAULT_MAP_CENTER[0],DEFAULT_MAP_CENTER[1])}if(!D){D=DEFAULT_MAP_LEVEL}map.setCenter(A,D);map.setMapType(B.mapType||DEFAULT_MAP_TYPE);map.addMapType(G_PHYSICAL_MAP);map.enableContinuousZoom();GEvent.addListener(map,"moveend",mapMoved);if(B.color){setMapTone(B.color,B.opacity)}pixelPos=cumulativeOffset(mapDiv)}}function setMapTone(A,B){if(!toneDiv){toneDiv=document.createElement("DIV");toneDiv.style.position="absolute";toneDiv.style.left="-600px";toneDiv.style.top="-300px";toneDiv.style.width="2800px";toneDiv.style.height="1800px";map.getPane(G_MAP_MAP_PANE).appendChild(toneDiv)}toneDiv.style.backgroundColor=A;toneDiv.style.opacity=B;toneDiv.style.filter="alpha(opacity="+B*100+")"}function fromEventToLatLng(A){var B=[Event.pointerX(A),Event.pointerY(A)];return map.fromContainerPixelToLatLng({x:B[0]-pixelPos[0],y:B[1]-pixelPos[1]})}function fromViewHeightToZoomLevel(B){var C=18;var A=400;while(B>=A&&C>2){A*=2;C-=1}return C}function fromZoomLevelToViewHeight(D){var B=18-D;var A=400;for(var C=0;C<B-1;C++){A*=2}return A}function initOverlays(B,E,D){if(B instanceof Array){for(var A=0;A<B.length;A++){initOverlays(B[A],E,D)}}else{if(B.mapType){if(!E){E=defaultMappings}var C=new E[B.mapType](B);map.addOverlay(C);D(C)}}}function mapMoved(){if(toneDiv){var D=map.fromLatLngToDivPixel(map.getCenter());toneDiv.style.left=(D.x-1400)+"px";toneDiv.style.top=(D.y-900)+"px"}var C=map.getZoom();var A=map.getCenter();var B=document.getElementById("mapStatus");if(B){B.innerHTML="zoom level = "+C.toString()+"; center = "+A.toString()}}function mapZoomed(B,A){compressCluster()}function makePolygon(D){var C=[];for(var A=0;A<D.areas.length;A++){C.push({points:D.areas[A].encodedPoints,levels:D.areas[A].encodedLevels,color:CONTOUR_COLOUR,weight:CONTOUR_THICKNESS,opacity:0.7,zoomFactor:2,numLevels:18})}var B=new GPolygon.fromEncoded({polylines:C,fill:true,color:AREA_COLOUR,opacity:0.4,outline:(CONTOUR_THICKNESS>0)});B.data=D;return B}function mapClicked(B,A){if(!B){compressCluster()}}function lineMouseOver(A){this.deleteDiv=document.createElement("DIV");this.deleteDiv.style.position="absolute";this.deleteDiv.style.visibility="hidden";this.deleteDiv.style.overflow="hidden";this.deleteDiv.style.width="8px";this.deleteDiv.style.height="8px";this.deleteDiv.style.marginTop="-4px";this.deleteDiv.style.marginLeft="-4px";this.deleteDiv.style.zIndex="-8999998";this.deleteDiv.style.backgroundColor="#ff0000";this.deleteDiv.style.border="1px solid #000000";this.deleteDiv.className="lineDeleteButton"}function initOverlaysFromXML(A){GDownloadUrl(A,function(F,E){var C=GXml.parse(F);var G=C.documentElement.getElementsByTagName("marker");for(var D=0;D<G.length;D++){var B=new GLatLng(parseFloat(G[D].getAttribute("lat")),parseFloat(G[D].getAttribute("lng")));map.addOverlay(new GMarker(B,{title:"Foo!",draggable:true,bouncy:true,icon:tinyIcon}))}})}function zoomIn(){if(map.getZoom()<MAX_ZOOM){map.zoomIn()}}function zoomOut(){if(map.getZoom()>MIN_ZOOM){map.zoomOut()}}var TILE_ROOT="http://www.ctbto.org/map/tiles/";var STATION=1;var LABORATORY=2;var HEADQUARTER=4;var TESTSITE=8;var PLANNED=1;var UNDER_CONSTRUCTION=2;var TRANSMITTING=4;var CERTIFIED=8;var SEISMIC_P=1;var SEISMIC_A=2;var INFRASOUND=4;var HYDROACOUSTIC=8;var RADIONUCLIDE=16;var RADIONUCLIDE_LAB=32;var RADIONUCLIDE_NOBLE=64;var ALL=-1;var regionViews={ALL:{center:new GLatLng(8,17),zl:2,code:0},AFRICA:{center:new GLatLng(2,30),zl:3,code:1},EE:{center:new GLatLng(58.2,74.9),zl:3,code:2},LAC:{center:new GLatLng(-15.8,-55.2),zl:3,code:4},MESA:{center:new GLatLng(32.25,70.5),zl:3,code:8},NAWE:{center:new GLatLng(56.37,-19.16),zl:3,code:16},SEAPFE:{center:new GLatLng(8.58,138.52),zl:3,code:32}};var settings={map:{moveable:false,tone:{color:"#00aa00",opacity:0.3}}};var rows=[PLANNED,UNDER_CONSTRUCTION,TRANSMITTING,CERTIFIED];var cols=[SEISMIC_P,SEISMIC_A,INFRASOUND,HYDROACOUSTIC,RADIONUCLIDE];var bindings={".accordion":Accordion,".accordionTitle":AccordionTitle,".accordionContent":AccordionContent,".toggle":Toggle,"#verificationTitle":{onclick:function(A){hideAll();window.setTimeout(function(){hideCountries();showAllStations()},650)}},"#signatureTitle":{onclick:function(A){hideAll();window.setTimeout(function(){showCountriesNoMove()},650)}},"#testingTitle":{onclick:function(A){hideAll();window.setTimeout(function(){hideCountries();showTesting()},650)}},"#rnTrigger":{onclick:function(A){Event.stop(A);return false}},"#regionSelect":{onchange:function(A){setTimeout(showCountries,10)}},"#annex2Box":{onclick:function(A){setTimeout(showCountriesNoMove,10)}},".infoLink":{onclick:function(A){if(A.stopPropagation){A.stopPropagation()}else{A.cancelBubble=true}}}};var moveListener=null;function init(){initMap("map",2,new GLatLng(0,17),{color:"#ffffff",opacity:0.2});$("map").style.backgroundColor="#99b3cc";map.zoomWorld=function(){this.setCenter(new GLatLng(0,17),2)};map.disableDoubleClickZoom();map.disableScrollWheelZoom();initOverlays(stations);tekt.init(bindings);if(window.location.hash&&window.location.hash.length>1){var A=window.location.hash.substring(1);if(A=="testing"){var B=$("testingTitle");B.accordion.showPane(B);showTesting()}else{if(A=="ims"){var B=$("verificationTitle");B.accordion.showPane(B);showAllStations()}else{showCountries()}}}else{showCountries()}GEvent.addListener(map,"click",mapClicked);GEvent.addListener(map,"movestart",mapMove);GEvent.addListener(map,"zoomend",function(){undecluster();decluster()})}var POIs=[];function initOverlays(){var F=[];var A=null;if(stations){for(var C=0;C<stations.length;C++){var E=stations[C];if(E){if(E.location&&E.location.lat()!=0){var B=makeMarker(E);E.marker=B;map.addOverlay(B);POIs.push(B);if(E.type==HEADQUARTER){var D=getElementHack(B);D.style.zIndex=GOverlay.getZIndex(-90)}B.hide()}}}}}function getElementHack(A){for(var B in A){var C=A[B];if(C&&C.style){return C}}return null}function makeMarker(B){var A=new GMarker(B.location,{xtitle:getTitleForMarker(B),draggable:false,bouncy:false,icon:getIcon(B)});A.data=B;A.pixelPos=map.fromLatLngToDivPixel(B.location);GEvent.bind(A,"click",A,markerClick);GEvent.bind(A,"mouseover",A,markerOver);GEvent.bind(A,"mouseout",A,markerOut);return A}var infoWindow=null;var infoWindowExpanded=false;function mapClicked(A){if(!A&&infoWindowExpanded){hideInfoWindow()}}function mapMove(){if(infoWindowExpanded){hideInfoWindow()}}function markerOver(){if(!(this==infoWindowExpanded)){$("infowindowBody").style.display="none";infoWindowExpanded=false;placeInfoWindow(this)}}function markerOut(){if(!infoWindowExpanded){hideInfoWindow()}}function markerClick(){if(this==infoWindowExpanded){$("infowindowBody").style.display="none";infoWindowExpanded=false}else{$("infowindowBody").style.display="block";infoWindowExpanded=this}}function placeInfoWindow(B){$("infowindowTitle").innerHTML=getTitleForMarker(B.data);$("infowindowBody").innerHTML=getMarkerBody(B.data);var C=cumulativeOffset(getElementHack(B));var A=$("map").offsetHeight-C[1];if(B.data&&B.data.type==TESTSITE){$("infowindow").style.left=(C[0]+8)+"px"}else{$("infowindow").style.left=(C[0]+6)+"px"}$("infowindow").style.bottom=A+"px";$("infowindow").style.display="block"}function hideInfoWindow(){$("infowindow").style.display="none";$("infowindowBody").style.display="none";infoWindowExpanded=false}function decluster(){for(var C=0;C<POIs.length;C++){var B=POIs[C];if(!B.isHidden()){var E=false;for(var D=0;D<C;D++){if(!POIs[D].isHidden()){if(Math.abs(B.pixelPos.x-POIs[D].pixelPos.x)<4&&Math.abs(B.pixelPos.y-POIs[D].pixelPos.y)<4){var A=POIs[D];while(A.nextInCluster){A=A.nextInCluster}B.setLatLng(map.fromDivPixelToLatLng(new GPoint(A.pixelPos.x,A.pixelPos.y-9)));A.nextInCluster=B;B.pixelPos.x=A.pixelPos.x;B.pixelPos.y=A.pixelPos.y-9;E=true;break}}}}}}function undecluster(){for(var A=0;A<POIs.length;A++){POIs[A].setLatLng(POIs[A].data.location);POIs[A].nextInCluster=null;POIs[A].pixelPos=map.fromLatLngToDivPixel(POIs[A].data.location)}}function getTitleForMarker(A){var B="POI";if(A.treatycode){B=A.treatycode;if(A.title){B+="<br />"+A.title}}else{if(A.type==HEADQUARTER){B="CTBTO Headquarter, Vienna"}else{if(A.type==LABORATORY){B="Radionuclide Laboratory"}else{if(A.type==TESTSITE){B=A.title}}}}return B}function getMarkerBody(B){var C="";if(B.technology){switch(B.technology){case SEISMIC_A:C+="Technology: Auxiliary Seismic <br />";break;case SEISMIC_P:C+="Technology: Primary Seismic <br />";break;case INFRASOUND:C+="Technology: Infrasound <br />";break;case HYDROACOUSTIC:C+="Technology: Hydroacoustic <br />";break;case RADIONUCLIDE:C+="Technology: Radionuclide <br />";break;case RADIONUCLIDE_NOBLE:C+="Technology: Radionuclide with Noble Gas Detection <br />";break;case RADIONUCLIDE_LAB:C+="Radionuclide Laboratory <br />";break}}if(B.state){switch(B.state){case PLANNED:C+="Status: Planned <br />";break;case UNDER_CONSTRUCTION:C+="Status:<br />Under Construction ";break;case TRANSMITTING:C+="Status: Testing <br />";break;case CERTIFIED:C+="Status: Certified <br />";break}}if(B.text){C+=B.text+"<br />"}if(B.country){C+="Country: "+B.country+"<br />"}if(B.href){var A=B.href;if(B.href.indexOf("http:")==-1){A="/index.php?id="+B.href}C+='<br /><a href="'+A+'" target="_blank">More Details...</a><br />'}return C}function getIcon(B){if(B.type==HEADQUARTER){return hqIcon}else{if(B.type==STATION){var A="";if(B.href&&B.href!=""){A="_"}if(B.technology==HYDROACOUSTIC){return makeIcon("icon_h"+A)}else{if(B.technology==RADIONUCLIDE){return makeIcon("icon_r"+A)}else{if(B.technology==SEISMIC_P){return makeIcon("icon_sp"+A)}else{if(B.technology==SEISMIC_A){return makeIcon("icon_sa"+A)}else{if(B.technology==INFRASOUND){return makeIcon("icon_i"+A)}else{if(B.technology==RADIONUCLIDE_LAB){return makeIcon("icon_l"+A)}else{if(B.technology==RADIONUCLIDE_NOBLE){return makeIcon("icon_rn"+A)}else{return defaultIcon}}}}}}}}else{if(B.type==LABORATORY){return makeIcon("icon_l")}else{if(B.type==TESTSITE){return makeTestingIcon("country_"+B.countrycode.toLowerCase())}else{return defaultIcon}}}}}var defaultIcon=null;var hqIcon=null;function makeIcon(A){var B=new GIcon();B.image="icons/"+A+".png";B.iconAnchor=new GPoint(6,11);B.infoWindowAnchor=new GPoint(6,11);return B}function makeTestingIcon(A){var B=new GIcon();B.image="icons/"+A+".png";B.iconAnchor=new GPoint(8,5);B.infoWindowAnchor=new GPoint(10,11);return B}function addOverlays(B){for(var A=0;A<B.length;A++){addOverlay(B[A])}}var POIs=[];function addOverlay(A){if(A.data.type=STATION){POIs.push(A)}map.addOverlay(A)}function hideAll(){hideStations();hideTesting()}function hideStations(){for(var A=0;A<POIs.length;A++){POIs[A].hide()}currentTechnology=[]}var testMarkers=[];function showTesting(){if(moveListener){GEvent.removeListener(moveListener);$("debug").innerHTML="";moveListener=null}map.setMapType(G_PHYSICAL_MAP);var C={};if(testsites){for(var B=0;B<testsites.length;B++){if(testsites[B]){var A=new GMarker(testsites[B].location,{draggable:false,bouncy:false,icon:getIcon(testsites[B])});A.data=testsites[B];testMarkers.push(A);map.addOverlay(A);GEvent.bind(A,"click",A,markerClick);GEvent.bind(A,"mouseover",A,markerOver);GEvent.bind(A,"mouseout",A,markerOut);if(!C[testsites[B].countrycode.toUpperCase()]){C[testsites[B].countrycode.toUpperCase()]=0}C[testsites[B].countrycode.toUpperCase()]++}}$("disclaimerImg").src="images/header_moreinformation.gif";$("disclaimerImg").alt="More Information";$("disclaimerBody").innerHTML='<p>* Locations of nuclear explosions: defined as a place where one or several countries have detonated at least one nuclear bomb either for military or peaceful purposes.</p><p>The figures used in this map are approximate and based on official government sources, as well as on information provided by research institutions such as the Natural Resources Defence Council in Washington D.C., and the Stockholm International Peace Research Institute (SIPRI).</p>';$("toggleForDisclaimerBody").setState(true)}}function hideTesting(){for(var A=0;A<testMarkers.length;A++){map.removeOverlay(testMarkers[A])}}var tileLayer=null;function showCountriesNoMove(){showCountries(true)}function showCountries(A){var E=$("regionSelect").value;var F=$("annex2Box").checked?"2":"";map.setMapType(G_NORMAL_MAP);if(tileLayer!=null){map.removeOverlay(tileLayer)}tileLayer=new GTileLayerOverlay(new GTileLayer(null,null,null,{tileUrlTemplate:TILE_ROOT+E+F+"/tile{Z}-{X}-{Y}.png",isPng:true,opacity:1}));map.addOverlay(tileLayer);if(!A){var G=regionViews[E];if(G){map.setCenter(G.center,G.zl)}}var I=0;var H=0;var D=0;var B=0;for(var C=0;C<countries.length;C++){if(countries[C]){if(E=="ALL"||regionViews[E].code==countries[C].region){if(countries[C].country&&((F=="2"&&countries[C].annex2)||F!="2")){if(countries[C].ratificationdate){I++}if(countries[C].signaturedate){H++}else{D++}if(countries[C].annex2){B++}}}}}$("countryCountRAT").innerHTML=I;$("countryCountSIG").innerHTML=H;$("countryCountNON").innerHTML=D;$("countryCountA2").innerHTML=B;$("disclaimerImg").src="images/header_disclaimer.gif";$("disclaimerImg").alt="Disclaimer";$("disclaimerBody").innerHTML="The use of particular designations of countries or territories does not imply any judgement by the Commission as to the legal status of such countries or territories, of their authorities and institutions or of the delimitation of their boundaries. The dotted line on the maps represents approximately the Line of Control in Jammu and Kashmir agreed upon by India and Pakistan. The two countries have not agreed upon the final status of Jammu and Kashmir.";$("toggleForDisclaimerBody").setState(false)}function countryHover(E){if(hover_grid){var A=(180+E.lng())/360;var D=-E.lat()*Math.PI/180;D=0.5*Math.log((1+Math.sin(D))/(1-Math.sin(D)));D*=1/(2*Math.PI);D+=0.5;A=Math.round(A*256-0.5);D=Math.round(D*256-0.5);if(hover_grid[D]&&hover_grid[D][A]){id=hover_grid[D][A];if(id){$("debug").innerHTML=(id-1)+": "+countries[id-1].name;var B=country_centers[id-1];var C=map.fromLatLngToContainerPixel(new GLatLng(B[0],B[1]));$("debug").style.top=C.y+"px";$("debug").style.left=C.x+"px";$("debug").style.display="block"}else{$("debug").style.display="none"}}else{$("debug").style.display="none"}}}function hideCountries(){if(tileLayer){map.removeOverlay(tileLayer)}tileLayer=null}var currentTechnology=[];function showAllStations(){if(moveListener){GEvent.removeListener(moveListener);$("debug").innerHTML="";moveListener=null}$("disclaimerImg").src="images/header_moreinformation.gif";$("disclaimerImg").alt="More Information";$("disclaimerBody").innerHTML="<p>* The CTBTO has been equipping 40 of the 80 radionuclide stations with noble gas monitoring technology on an experimental basis since 1999.</p><p>** Stations under testing/evaluation prior to certification</p>";$("toggleForDisclaimerBody").setState(false);if(currentTechnology==null){return }map.setMapType(G_PHYSICAL_MAP);var C=[0,0,0,0,0,0,0,0,0];for(var A=0;A<stations.length;A++){if(stations[A]){if(stations[A].marker){stations[A].marker.show()}C[0]++;C[stations[A].state]++}}for(var A=0;A<C.length;A++){if($("status"+A)){$("status"+A).innerHTML=C[A]}}var B=$("stationCountTable");removeClassName(B.parentNode,"selected");B.parentNode.removeChild(B);$("allStations").appendChild(B);addClassName(B.parentNode,"selected");undecluster();decluster();currentTechnology=null}function selectStations(C,D,B){if(D.className.indexOf("selected")>-1){return }var F=[0,0,0,0,0,0,0,0,0];for(var A=0;A<stations.length;A++){if(stations[A]){if(C.indexOf(stations[A].technology)>-1){if(stations[A].marker){stations[A].marker.show()}F[0]++;if(B){F[stations[A].nge_status]++}else{F[stations[A].state]++}}else{if(stations[A].marker){stations[A].marker.hide()}}}}for(var A=0;A<F.length;A++){if($("status"+A)){$("status"+A).innerHTML=F[A]}}if(B){$("status4").innerHTML="";$("status8").innerHTML=""}var E=$("stationCountTable");removeClassName(E.parentNode,"selected");E.parentNode.removeChild(E);D.appendChild(E);addClassName(D,"selected");undecluster();decluster();currentTechnology=C}function selectStationStatus(A){for(var B=0;B<stations.length;B++){if(stations[B]){if(stations[B].marker){if(currentTechnology&&currentTechnology.length==1&&currentTechnology[0]==RADIONUCLIDE_NOBLE){if(stations[B].technology==RADIONUCLIDE_NOBLE&&(A==ALL||stations[B].nge_status==A)){stations[B].marker.show()}else{stations[B].marker.hide()}}else{if(currentTechnology==null||currentTechnology.indexOf(stations[B].technology)>-1){if(A==ALL||stations[B].state==A){stations[B].marker.show()}else{stations[B].marker.hide()}}else{stations[B].marker.hide()}}}}}undecluster();decluster()};
