         // Deze file is obsolete geworden, agv  call WELK#19457 - Doe een melding - stap 2/3: eruit halen
         // Dit bestand hoor(t/de) bij xsl/cust.xsl versie 7, die door dat bestand werd geincluded.
         // Nu doet dit bestand fe_mld.js niet meer mee.
         G_mb =0;
         G_srtdisc = null;
         G_mld_stdkey = null;
			document.onmousemove = mouseMove;
			document.onmouseup = mouseUp;
         var dragObject     = null;
         var mouseOffset = null;

         function mouseCoords(ev){
             if(ev.pageX || ev.pageY){
                  return {x:ev.pageX, y:ev.pageY};
              }
              return {
                  x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
                  y:ev.clientY + document.body.scrollTop  - document.body.clientTop
              };
         }

         
         function getMouseOffset(target, ev){
          ev = ev || window.event;

           var docPos    = getPosition(target);
           var mousePos  = mouseCoords(ev);
           return {x:mousePos.x - docPos.x, y:mousePos.y - docPos.y};
         }

         function getPosition(e){
           var left = 0;
           var top  = 0;

           while (e.offsetParent){
               left += e.offsetLeft;
               top  += e.offsetTop;
               e     = e.offsetParent;
           }

           left += e.offsetLeft;
           top  += e.offsetTop;

           return {x:left, y:top};
         }

         function mouseMove(ev){
           ev           = ev || window.event;
           var mousePos = mouseCoords(ev);
           
           if(dragObject){
               dragObject.style.position = 'absolute';
               dragObject.style.top      = mousePos.y - mouseOffset.y;
               dragObject.style.left     = mousePos.x - mouseOffset.x;
               show_elkien_locatie(mousePos.x, mousePos.y);
               return false;
           }
         }

         function mouseUp(ev){
           ev           = ev || window.event;
           var mousePos = mouseCoords(ev);
            
           if (G_mb == 1){
            l_loc_key = get_locatie_key(mousePos.x, mousePos.y);
            if (l_loc_key != ''){
               run_create_mld (G_srtdisc, G_mld_stdkey, l_loc_key);
            }
           }
           dragObject   = null;
         }


         function makeDraggable(item){
           if(!item) return;
           e1=document.getElementById(item);
           e1.onmousedown = function(ev){
               dragObject  = this;
               mouseOffset = getMouseOffset(this, ev);
               return false;
              }
          }
   
   
   
   		function run_create_mld (p_srtdisc, p_mld_stdkey, p_loc_key) {
   
   			// $.post('../../appl/mld/mld_edit_melding.asp?urole=fe&amp;srtdisc=' + p_srtdisc + '&amp;mld_defaultstdmelding=' + p_mld_stdkey, {action:'on'}, "", "");
   			
   			l_instructie = document.getElementById ('span_instructie');
            l_instructie.innerHTML ='STAP 3/3: Kies gebouw, verdieping, ruimte en vul omschrijving in.'
            
            alert('In de laatste stap in het volgende scherm kunt u de plaatsgegevens en de omschrijving invullen, en op bewaren drukken.');
            
   			//window.location='../../appl/mld/mld_melding.asp?urole=fe&amp;srtdisc=' + p_srtdisc + '&amp;mld_defaultstdmelding=' + p_mld_stdkey + '&amp;loc_key=' + p_loc_key;
   			FcltMgr.closeDetail(window, {close: true});
   			FcltMgr.openDetail('appl/mld/mld_melding.asp?urole=fe&amp;srtdisc=' + p_srtdisc + '&amp;mld_defaultstdmelding=' + p_mld_stdkey + '&amp;loc_key=' + p_loc_key, 'Melding');
   			
   		}
   
         function fill_draggertje(p_srtdisc, p_mld_stdkey){
            
            l_instructie = document.getElementById ('span_instructie');
            l_instructie.innerHTML ='STAP 2/3: Sleep de gekozen melding naar de locatie'
            
            l_selected_foto = document.getElementById ('img_' + p_mld_stdkey);
            G_srtdisc = p_srtdisc;
            G_mld_stdkey = p_mld_stdkey;
            
            G_mb = 1;
            hide_all_divs();
            hide_all_headers();
            
            var l_sleeppijl = document.getElementById ("sleeppijl");
            l_sleeppijl.style.position = 'absolute'; 
            l_sleeppijl.style.top='80px';
            l_sleeppijl.style.left='400px';
            l_sleeppijl.height='130';
            $('#sleeppijl').show();
            
            
            var l_drag = document.getElementById ("draggertje");
            l_drag.src=l_selected_foto.src;
            l_drag.style.position = 'absolute'; 
            l_drag.style.top='100px';
            l_drag.style.left='600';
            l_drag.style.zIndex='10';
            l_drag.style.cursor='hand';
            l_drag.title='Sleep mij op de kaart naar de locatie';
            
            $('#draggertje').show();
            makeDraggable('draggertje');
            
            var l_map = document.getElementById ("elkienmap");
            l_map.height = 1;
            $('#elkienmap').show();
            for (i=1; i < 377;i++){
               setTimeout('fly_in()', 3*i);
            }
            for (i=1; i < 10;i++){
               setTimeout('blink_draggertje()', 1500+500*i);
            }
            
         }
         
         function fly_in(){
            var l_map = document.getElementById ("elkienmap");
            l_map.height=l_map.height+1;
         }  
         
         function blink_draggertje(){
            var l_drag = document.getElementById ("draggertje");
            var l_span = document.getElementById ("span_sleepmij");
            
            l_drag.border=Math.abs(l_drag.border - 3);
         }
         
         
         
         //p_force=-1, dan toggle, als p_force=0, dan hide, als p_force=1, dan toon!
   		function show_hide(p_disc_key, p_force){
   		   l_div_name = 'div_vakgroep_' +  p_disc_key;
   		   l_span_name = 'span_vakgroep_' +  p_disc_key;
   
   		   e1=document.getElementById(l_div_name);
   		   e2=document.getElementById(l_span_name);
   		   //alert(e2.innerHTML);
            if (p_force == -1){
   			   if (e1.style.display == "none"){
                  $('#' + l_div_name).show();
                  e2.innerHTML ='-'
               }
               else{
                  $('#' + l_div_name).hide();
                  e2.innerHTML ='+'
               }
            }
            else {
               if (p_force==0){
                  $('#' + l_div_name).hide();
                  e2.innerHTML ='+'
               }
               else{
                  $('#' + l_div_name).show();
                  e2.innerHTML ='-'
               }
            }
         }
   
         function toggle_all_divs(){
            var x=document.getElementsByTagName("div");
            for (i in x){
               l_str = x[i].id;
               if (l_str != null) {
                  if (l_str.substr(0,13) == "div_vakgroep_"){
                     show_hide(l_str.substr(13),-1);
                  }
               }
            }
   
         }
         
         function hide_all_divs(){
            var x=document.getElementsByTagName("div");
            for (i in x){
               l_str = x[i].id;
               if (l_str != null) {
                  if (l_str.substr(0,13) == "div_vakgroep_"){
                     show_hide(l_str.substr(13),0);
                  }
               }
            }
         }
         
         
         function hide_all_headers(){
            var x=document.getElementsByTagName("div");
            for (i in x){
               l_str = x[i].id;
               if (l_str != null) {
                  if (l_str.substr(0,11) == "div_header_"){
                     //e1=document.getElementById(l_str);
                     $('#' + l_str).hide();
                  }
               }
            }
         }
         
         
         function get_locatie_key(p_x, p_y){
            l_loc_key='';
         
            if (p_x < 230 && p_x > 170 && p_y > 140 && p_y < 210){
               // Leeuwarden
               l_loc_key = '6';
            }
            else
            {
               if (p_x < 240 && p_x > 160 && p_y > 210 && p_y < 280){
                  // Grou
                  l_loc_key = '3';
               }
               else
               {
                  if (p_x < 160 && p_x > 100 && p_y > 230 && p_y < 310){
                     // Bolsward
                     l_loc_key = '1';
                  }
                  else
                  {
                     if (p_x < 370 && p_x > 290 && p_y > 250 && p_y < 330){
                        //Gorredijk
                        l_loc_key = '2';
                     }
                     else
                     {
                       if (p_x < 290 && p_x > 210 && p_y > 280 && p_y < 380){
                           //Heerenveen
                           l_loc_key = '5';
                        }
                     }
                  }
               }
            }
            return(l_loc_key);
         }
         
         
         function show_elkien_locatie(p_x, p_y){
            var l_elkienlocatie = document.getElementById ("elkienlocatie");
            l_loc_key = get_locatie_key(p_x, p_y);
            if (l_loc_key != ''){
               l_elkienlocatie.src='../../cust/welk/photos/locatie/' + l_loc_key + '.jpg';
               l_elkienlocatie.style.display = ''; 
               l_elkienlocatie.style.position = 'absolute'; 
               l_elkienlocatie.style.top='250px';
               l_elkienlocatie.style.left='500px';
            }
            else{
              l_elkienlocatie.style.display = 'none'; 
            }
          }
      