var Reference= Class.create(); Reference.prototype = { initialize: function(map,id_div) { var that2=null; this.A0=this.A67.bindAsEventListener(this); this.A1=this.A68.bindAsEventListener(this); this.A2=this.A69.bindAsEventListener(this); this.A3=this.A16.bindAsEventListener(this); this.A4=false; this.A5=map; this.A5.A11=this; this.A6=this.A5.A44;this.A7=this.A5.A46;this.A8=this.A5.A45;this.A9=this.A5.A47;this.A10=new Array(); this.A11=this.A5.A16;this.A12=this.A5.A17;this.A13=this.A5.A20;this.A14=this.A5.A21;this.A15=4; this.A16=true; this.A18=this.A17=this.A5.A19-this.A15;this.A19=this.A5.A22;this.A20=this.A5.A23;this.A21=0; this.A22=0; this.A24=this.A23=0; this.A26=this.A25=0; this.A28=this.A27=0; this.A29=new Array(); this.A30=new Array(); this.A31=new Array(); this.A32=this.A5.A43;this.A33=this.A5.A38;this.A34=this.A5.A39;this.A35=this.A5.A40;this.A36=this.A5.A41;this.A37=this.A5.A42;this.A39=this.A38=this.A5.A51;this.A41=this.A40=this.A5.A53;this.A42="reference_container1"; this.A43="reference_container2"; this.A44="contenaire2image"; this.A45="reference_plan"; this.A46="reference_satellite"; this.A47="cadre2reference"; this.A48="hide"; this.A49="show"; this.A50="con"; var refe_cont = '<div id ="'+this.A42+'"' +'style="position:absolute;' +'background-color:#ffffff;' +'bottom:0px;right:0px;' +'width:205px;height:155px;' +'border-left: solid 1px #cccccc;' +'border-top: solid 1px #cccccc;' +'overflow:hidden;' +'display:none;z-index:100;">' +'</div>'; var id = '<div id ="'+this.A43+'"' +'style="position:absolute;' +'bottom:0px;right:0px;' +'overflow:hidden;' +'width:200px;height:150px;' +'border-left: solid 1px #cccccc;' +'border-top: solid 1px #cccccc;' +'overflow:hidden;z-index:100;">' +'</div>'; var aff_ref= '<div id ="'+this.A49+'"' +'style="position:absolute; ' +'overflow:hidden;' +'bottom:0px;right:0px;' +'width:15px;height:15px;' +'z-index:100;' +'background-image:url(images/show.gif)">' +'</div>'; var hide_ref= '<div id ="'+this.A48+'"' +'style="position:absolute;' +'display:none;' +'z-index:100;' +'bottom:0px;right:0px;' +'width:15px;height:15px;' +'overflow:hidden;' +'background-image:url(images/hide.gif)">' +'</div>'; var cadre = '<div id ="'+this.A47+'"' +' style="position:absolute; ' +'border: solid 2px #000CCC;' +'overflow:hidden;' +'z-index:130;">' +'</div>'; var container1 = '<div id ="'+this.A50+'"' +'style="position:absolute; ' +'width:200px;height:150px;' +'">' +'</div>'; var container = '<div id ="'+this.A44+'"' +'style="position:absolute; ' +'">' +'</div>'; var carte_container = '<div id ="'+this.A45+'"' +' style="position:absolute;z-index:110; " >' +'</div>'; var carte_satellite_cont = '<div id ="'+this.A46+'"' +' style="position:absolute; z-index:120;" >' +'</div>'; new Insertion.Bottom($(id_div),refe_cont); new Insertion.Bottom($(this.A42),id); new Insertion.Bottom($(id_div),aff_ref); new Insertion.Bottom($(id_div),hide_ref); new Insertion.Bottom($(this.A43),container1); new Insertion.Bottom($(this.A50),container); new Insertion.Bottom($(this.A44),carte_container); new Insertion.Bottom($(this.A44),carte_satellite_cont); new Insertion.Bottom($(this.A43),cadre); $(this.A44).style.width=$(this.A45).style.width=$(this.A46).style.width=this.A33[this.A12]*this.A20+'px'; $(this.A44).style.height=$(this.A45).style.height=$(this.A46).style.height=this.A34[this.A12]*this.A19+'px'; this.A65(); this.A51=this.A53.bindAsEventListener(this); Event.observe($(this.A48),'click',this.A51); Event.observe($(this.A49),'click',this.A51); }, A53:function(){ $(this.A49).toggle(); $(this.A48).toggle(); $(this.A42).toggle(); if(this.A4)this.A4=false; else { this.A4=true; this.A5.A84(this.A5.A51,this.A5.A53); this.A55(); this.A54(); } }, A54:function(){ var left=(this.A76($(this.A43)).width-this.A76($(this.A47)).width)/2; var top=(this.A76($(this.A43)).height-this.A76($(this.A47)).height)/2; this.A74(left,top,this.A47); }, A55:function(){ var ext=this.A76($(this.A5.A1)).width*this.A37[this.A5.A19]; var width_cadre=ext/this.A37[this.A18]; var ext=this.A76($(this.A5.A1)).height*this.A37[this.A5.A19]; var height_cadre=ext/this.A37[this.A18]; this.A75(width_cadre,height_cadre,this.A47); this.A16=true; var width=this.A76($(this.A43)).width-2; var height=this.A76($(this.A43)).height-2; if (width<width_cadre || height<height_cadre) this.A16=false; }, A56:function() { var aff_extent=new Array(); aff_extent[0]=this.A39-this.A37[this.A18]*this.A76($(this.A43)).width/2; aff_extent[1]=this.A41-this.A37[this.A18]*this.A76($(this.A43)).height/2; aff_extent[2]=this.A39+this.A37[this.A18]*this.A76($(this.A43)).width/2; aff_extent[3]=this.A41+this.A37[this.A18]*this.A76($(this.A43)).height/2; aff_extent[3]=this.A41+this.A37[this.A18]*this.A76($(this.A43)).height/2; return aff_extent; }, A57:function (i,j) { if (this.A5.A57){ if(!$('refe_plan'+i+'_'+j)) { var html ='<img id="refe_plan'+i+'_'+j+'" onerror="this.src=\'images/erreur.png\';"' +'src="plan.php?x='+i+'&y='+j +'&zoom='+(this.A18)+'"' +'width="'+this.A20+'"' +'height="'+this.A19+'"' +'style="position: absolute;' +'left:'+((i)*this.A20)+'px;' +'top:'+((this.A34[this.A12]-j-1)*this.A19)+'px;' +'"' +'/>'; new Insertion.Bottom($(this.A45),html); } else { $('refe_plan'+i+'_'+j).src='plan.php?x='+i+'&y='+j +'&zoom='+this.A18;} } if (this.A5.A58){ if(!$('refe_sat_'+i+'_'+j)) { var html ='<img id="refe_sat_'+i+'_'+j+'" onerror="this.src=\'images/erreur.png\';"' +'src="satellite.py?x='+i+'&y='+j +'&zoom='+(this.A18)+'&stepX='+this.A35[this.A18]+'&stepY='+this.A36[this.A18]+'"' +'width="'+this.A20+'"' +'height="'+this.A19+'"' +'style="position: absolute;' +'left:'+((i)*this.A20)+'px;' +'top:'+((this.A34[this.A12]-j-1)*this.A19)+'px;' +'"' +'/>'; new Insertion.Bottom($(this.A46),html); } else { $('refe_sat_'+i+'_'+j).src='satellite.py?x='+i+'&y='+j +'&zoom='+this.A18+'&stepX='+this.A35[this.A18]+'&stepY='+this.A36[this.A18]; } } }, A58:function(newCenterX,newCenterY) { this.A57(newCenterX,newCenterY); var total=this.remplir_hor+this.remplir_vert; if (total==4) { this.A57(newCenterX-1,newCenterY); this.A57(newCenterX-1,newCenterY-1); this.A57(newCenterX,newCenterY-1); } if (total==5) { this.A57(newCenterX+1,newCenterY); this.A57(newCenterX,newCenterY-1); this.A57(newCenterX+1,newCenterY-1); } if (total==7) { this.A57(newCenterX-1,newCenterY); this.A57(newCenterX-1,newCenterY+1); this.A57(newCenterX,newCenterY+1); } if (total==8) { this.A57(newCenterX,newCenterY+1); this.A57(newCenterX+1,newCenterY+1); this.A57(newCenterX+1,newCenterY); } }, A59:function(extX,extY) { var dX=extX-this.A6;var dY=extY-this.A7;var coord=new Array(); coord[0]=parseInt(dX/this.A35[this.A18]); coord[1]=parseInt(dY/this.A36[this.A18]); var difhorizontal=dX%this.A35[this.A18]; var difvertical=dY%this.A36[this.A18]; if (difhorizontal<this.A35[this.A18]/2) this.remplir_hor=0; else this.remplir_hor=1; if( difvertical<this.A36[this.A18]/2) this.remplir_vert=4; else this.remplir_vert=7; return coord; }, A60:function(pixelX,pixelY){ var new_ext=new Array(); new_ext[0]=this.A39-((this.A76($(this.A43)).width/2-pixelX)*this.A37[this.A18]); new_ext[1]=this.A41+((this.A76($(this.A43)).height/2-pixelY)*this.A37[this.A18]); return(new_ext) }, A61:function () { this.A18=this.A5.A19-this.A15;if(this.A18<0)this.A18=0; this.A32=this.A59(this.A5.A51,this.A5.A53); this.A39=this.A5.A51;this.A41=this.A5.A53;this.A62(this.A39,this.A41); this.A58(this.A32[0],this.A32[1]); this.A55(); this.A54(); }, A62:function(extX,extY) { var extaff=this.A56(); var dif1=extaff[2]-extaff[0]; var dif2=extaff[0]-this.A6;; var pos_x=-this.A76($(this.A43)).width*dif2/dif1; dif1=extaff[3]-extaff[1]; dif2=extaff[1]-this.A7;var pos_y=this.A76($(this.A43)).height*dif2/dif1; pos_y+=this.A76($(this.A43)).height; pos_y=-(this.A76($(this.A44)).height-pos_y); $(this.A44).setStyle({left: pos_x+"px",top:pos_y+"px"}); }, A63:function(x,y){ var dans =false; var left=this.A77($(this.A47)).left+2; var top=this.A77($(this.A47)).top+2; var right=left+this.A76($(this.A47)).width-4; var down=top+this.A76($(this.A47)).height-4; if (x>left &&x<right &&y>top &&y<down )dans =true; return dans; }, A64:function(w,h){ $(this.A47).style.left=(this.A26+w)+'px'; $(this.A47).style.top=(this.A25+h)+'px'; }, A65:function(){ Event.observe($(this.A43),'mousedown',this.A0,false); }, A66:function() { var pas=2; var left = Position.positionedOffset($(this.A44))[0]; var top = Position.positionedOffset($(this.A44))[1]; if (this.left && left > this.A72[2]) { $(this.A44).style.left =(left-pas)+'px'; var dif_left=this.carte_left-left; var depl_image=parseInt(dif_left/10); if (depl_image!=this.depl_image_x) { this.depl_image_x=depl_image; new_extCenterX=this.A39+dif_left*this.A37[this.A18]; this.coord_slide=this.A59(new_extCenterX,this.A41); this.A58(this.coord_slide[0],this.coord_slide[1]); } } if (this.right && left<this.A72[0]) { $(this.A44).style.left =(left+pas)+'px'; var dif_left=left-this.carte_left; var depl_image=parseInt(dif_left/10); if (depl_image!=this.depl_image_x) { this.depl_image_x=depl_image; new_extCenterX=this.A39-dif_left*this.A37[this.A18]; this.coord_slide=this.A59(new_extCenterX,this.A41); this.A58(this.coord_slide[0],this.coord_slide[1]); } } if (this.down && top>this.A72[1]) { $(this.A44).style.top =(top-pas)+'px'; var dif_top=top-this.carte_top; var depl_image=parseInt(dif_top/10); if (depl_image!=this.depl_image_y) { this.depl_image_y=depl_image; new_extCenterY=this.A41+dif_top*this.A37[this.A18]; this.coord_slide=this.A59(this.A39,new_extCenterY); this.A58(this.coord_slide[0],this.coord_slide[1]); } } if (this.up && top <this.A72[3]) { $(this.A44).style.top =(top+pas)+'px'; var dif_top=this.carte_top-top; var depl_image=parseInt(dif_top/10); if (depl_image!=this.depl_image_y) { this.depl_image_y=depl_image; new_extCenterY=this.A41-dif_top*this.A37[this.A18]; this.coord_slide=this.A59(this.A39,new_extCenterY); this.A58(this.coord_slide[0],this.coord_slide[1]); } } if (this.coord_slide[0]<this.A30[0]) this.A30[0]=this.coord_slide[0]; else if (this.coord_slide[0]>this.A31[0]) this.A31[0]=this.coord_slide[0]; if (this.coord_slide[1]<this.A30[1]) this.A30[1]=this.coord_slide[1]; else if (this.coord_slide[1]>this.A31[1]) this.A31[1]=this.coord_slide[1]; }, A67:function(evt) { var d_x = Event.pointerX(evt)-Position.page($(this.A43))[0]-Position.realOffset($(this.A43))[0]; var d_y = Event.pointerY(evt)-Position.page($(this.A43))[1]-Position.realOffset($(this.A43))[1]; if (this.A63(d_x,d_y)&&this.A16){ this.depl_image_x=this.depl_image_y=0; this.coord_debutpan=this.A59(this.A39,this.A41); this.A30=this.coord_debutpan; this.A31=[0,0]; this.coord_slide=new Array(); this.carte_left = this.A77($(this.A44)).left; this.carte_top = this.A77($(this.A44)).top; this.cadre_left = this.A77($(this.A47)).left; this.cadre_top = this.A77($(this.A47)).top; this.A28=Event.pointerX(evt); this.A27=Event.pointerY(evt); this.A26=this.A25=0; this.slide_id=null; this.left=this.right=this.up=this.down=false; this.maxx=(this.A76(this.A43).width-this.A76(this.A47).width)/2; this.maxy=(this.A76(this.A43).height-this.A76(this.A47).height)/2; this.A71(); this.A72(); Event.observe($(this.A43),'mousemove',this.A1); Event.observe(document,'mouseup',this.A2); } else Event.observe(document,'mouseup',this.A3); Event.stop(evt); }, A68:function(evt) { this.A26=Event.pointerX(evt)-this.A28;this.A25=Event.pointerY(evt)-this.A27;if (this.A26<0 && Math.abs(this.A26)>this.A10[0]) this.A26=-this.A10[0]; if (this.A26>0 && this.A26>this.A10[2]) this.A26=this.A10[2]; if (this.A25<0 && Math.abs(this.A25)>this.A10[3]) this.A25=-this.A10[3]; if (this.A25>0 && this.A25>this.A10[1]) this.A25=this.A10[1]; $(this.A47).style.left=(this.A26+this.cadre_left)+'px'; $(this.A47).style.top=(this.A25+this.cadre_top)+'px'; if (Math.abs(this.A26)>this.maxx || Math.abs(this.A25)>this.maxy) { if(Math.abs(this.A26)>this.maxx ) { if (this.A26>0 ){this.left=true;this.right=false;} if (this.A26<0 ){this.teft=false;this.right=true;} } if(Math.abs(this.A25)>this.maxy ) { if (this.A25>0 ) {this.down=true;this.up=false;} if (this.A25<0 ) {this.down=false;this.up=true;} } that2=this; if (this.slide_id==null)this.slide_id = setInterval ("that2.A66()",20); } else{ clearInterval(this.slide_id); this.slide_id =null; this.left=this.right=this.up=this.down=false; } Event.stop(evt); }, A69:function() { Event.stopObserving($(this.A43),'mousemove',this.A1); Event.stopObserving(document,'mouseup',this.A2); if(this.slide_id!=null)clearInterval(this.slide_id); var dif_x = this.A77($(this.A44)).left-this.carte_left; var dif_y = this.A77($(this.A44)).top-this.carte_top; var difx=(this.A26-dif_x)*this.A37[this.A18]; var dify=(this.A25-dif_y)*this.A37[this.A18]; this.A39+=difx; this.A41-=dify; this.A5.A84(this.A39,this.A41); if (this.A31[0]!=0 ||this.A31[1]!=0) this.A70(); }, A16:function (evt) { var x = Event.pointerX(evt)-Position.page($(this.A43))[0]-Position.realOffset($(this.A43))[0]; var y = Event.pointerY(evt)-Position.page($(this.A43))[1]-Position.realOffset($(this.A43))[1]; var new_extent=this.A60(x,y); this.A39=new_extent[0]; this.A41=new_extent[1]; this.A73(); this.A5.A84(this.A39,this.A41); Event.stopObserving(document,'mouseup',this.A3); }, A70:function(){ var center=this.A59(this.A39,this.A41); for (var i=this.A30[0]-1;i<=this.A31[0]+1;i++) for (var j=this.A30[1]-1;j<=this.A31[1]+1;j++) { if ((i<(center[0]-1))||(i>(center[0]+1))||(j<(center[1]-1))||(j>(center[1]+1))) { if ($('refe_sat_'+i+'_'+j)) $('refe_sat_'+i+'_'+j).src="images/transparent.png"; if ($('refe_plan'+i+'_'+j)) $('refe_plan'+i+'_'+j).src="images/transparent.png"; } } }, A71:function() { this.A10[0]=(this.A39-this.A6)/this.A37[this.A18]-this.A76($(this.A47)).width/2; this.A10[1]=(this.A41-this.A7)/this.A37[this.A18]-this.A76($(this.A47)).height/2; this.A10[2]=(this.A8-this.A39)/this.A37[this.A18]-this.A76($(this.A47)).width/2; this.A10[3]=(this.A9-this.A41)/this.A37[this.A18]-this.A76(this.A47).height/2; }, A72:function() { this.A72[0]=0; this.A72[1]=-this.A34[this.A12]*this.A19+this.A76($(this.A43)).height; this.A72[2]=-this.A33[this.A18]*this.A19+this.A76($(this.A43)).width; this.A72[3]=-(this.A34[this.A12]-this.A34[this.A18])*this.A19}, A73:function(){ var minextx=this.A6+this.A37[this.A18]*this.A76($(this.A47)).width/2; var minexty=this.A7+this.A37[this.A18]*this.A76($(this.A47)).height/2; var maxextx=this.A8-this.A37[this.A18]*this.A76($(this.A47)).width/2; var maxexty=this.A9-this.A37[this.A18]*this.A76($(this.A47)).height/2; if (this.A39<minextx) this.A39=minextx; else if (this.A39>maxextx) this.A39=maxextx ; if (this.A41<minexty) this.A41=minexty; else if (this.A41>maxexty) this.A41=maxexty ; }, A74:function(l,t,div) { $(div).setStyle({left:l+'px',top:t+'px'}); }, A75:function(w,h,div) { $(div).setStyle({height:h+'px',width:w+'px'}); }, A76:function(div) { var dimension = $(div).getDimensions(); return(dimension); }, A77:function(div) { var position={}; position.left = parseInt($(div).getStyle('left')); position.top = parseInt($(div).getStyle('top')); return(position); } }; 
