// Javascript for solving frameset related problems// When a document is opened without the containing frameset the script will reopen itself within the frameset// Date: 10-sep-2009//function frameMe( langcode ) {  // langcode: "nl" or "fr" -> determines the correct language version of the frameset to be opened  // the routine compares the name of the current window to the expected name  // in case the current window is already part of a frameset we do not reframe  var expectedWindowName = "rbottom";  var framesetURL = "/" + langcode + "/indexReframed.htm";  //var currentURL = self.document.URL;  var currentURL = self.location.pathname;  if (window.parent != window.self) return; // the document is already opened in a frameset  if (window.self.name != expectedWindowName ){     // redirect to the frameset      // supply the URL of the current page as a parameter     var newURL = framesetURL + "?newURL=" + encodeURIComponent ( currentURL);     // eventueel hash toevoeger (hash is #..... en verwijst naar een anker)     // hasp property bevat eveneens de #     if (self.location.hash != "") {     	newURL = newURL + encodeURIComponent (self.location.hash);     };     	if (self.location.search != "") {		newURL = newURL + "?" + self.location.search.slice(1);	}     window.self.location.replace ( newURL  );  }  return;} // frameMefunction initFramesetFromUrl ( langcode ) {  // this routine is called by the frameset  // in case URL for opening the frameset contains the ?newURL command the rbottom frame is loaded with the specified URL  // if no newURL command parameter is supplied nothing happens  // the script is called in the onLoad event of the frameset var startPos; var endPos; var len; var frameURL; var searchString; var searchStringPresent;  // extract the optional ?newURL parameter  // if not present then set to /nl/index-nl-text.htm or /fr/index-fr-text.htm depending on langcode  if (langcode == 'fr') {  	frameURL = "/fr/index-fr-text.htm";  } else {  	frameURL = "/nl/index-nl-text.htm";  };  searchStringPresent = false;  searchString = window.location.search; // the leading ? is included  if (searchString != "") {	searchStringPresent = true;	// look for ?newURL= or &newURL= substring     startPos = -1;     endPos = -1;	len = 0;	startPos =  searchString.indexOf ( "?newURL=" );	if (startPos >= 0) startPos = searchString.indexOf ( "?newURL=" );	if (startPos >= 0) {		startPos = startPos + 8;		// look for optional & character (in case multiple URL parameters are present)		endPos = searchString.lastIndexOf ( "&" );		if (endPos <0) {			len = searchString.length - startPos;		} else {			len = endPos - startPos;		}		searchStringPresent = true;		frameURL = decodeURIComponent ( searchString.substr ( startPos, len ) );	}  }  // in case a search string was specified force a change of the rbottom frame  // if not then only force a change if nothing is present  if ((searchStringPresent) || (window.self.rbottom.location.pathname == "")) {	  window.self.rbottom.location.replace (frameURL);  }  return;} // initFramesetFromUrl 
