// -----------------------------------------------
// Licence notice:                                
//                                                
//  Copyright 2007, "Rijkswaterstaat"             
//                                                
//   This file is part of Matroos.                
//                                                
//    Matroos is free software; you can redistri- 
//    bute it and/or modify it under the terms of 
//    the GNU General Public License as           
//    published by the Free Software Foundation;  
//    either version 3 of the License, or         
//    (at your option) any later version.         
//                                                
//    Matroos is distributed in the hope that it  
//    will be useful, but WITHOUT ANY WARRANTY;   
//    without even the implied warranty of        
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR 
//    PURPOSE.  See the GNU General Public        
//    License for more details.                   
//                                                
//    You should have received a copy of the GNU  
//    General Public License along with this      
//    program.                                    
//    If not, see <http://www.gnu.org/licenses/>. 
// -----------------------------------------------
  function breadcrumbs(){
    sServer = new String;
    sURL = new String;
    bits = new Object;
    var x = 0;
    var stop = 0;
    var output = new Object;
   
    var output = "";

    sURL = location.href;
    //sURL = sURL.slice(44,sURL.length);
    //sURL = sURL.slice(22,sURL.length);
    //chunkStart = sURL.indexOf("rikznet/");
    chunkStart = sURL.indexOf("://");
    sURL = sURL.slice(chunkStart+3,sURL.length)

    while(!stop){
      chunkStart = sURL.indexOf("/");
      if (chunkStart != -1){
        bits[x] = sURL.slice(0,chunkStart)
        sURL = sURL.slice(chunkStart+1,sURL.length);
      }else{
        stop = 1;
      }
      x++;
    }

    for(var i in bits){
      if (bits[i] != "NL" && bits[i] != "EN" && bits[i] != "home" && bits[i] != "portal" ){
        output += "<A HREF=\"";
        if (i>0){
          for(y=1;y<x-i;y++){
            output += "../";
          }
          output += bits[i] + "/\">" + bits[i] + "</A> &gt; ";
        }else{
          output += "/\">" + bits[i] + "</A> &gt; ";
        }
      }
    }
     
   var vervang,r;
   vervang = />px</g;
   r=output.replace(vervang,">P&O<");
   document.write(r + document.title);
   //alert(r);
  }
  breadcrumbs();


