
var debug=false;
function alrt(msg) { if(debug)alert(msg); }
function p(str) {document.write(str);}

function HREFparValue(parName){ //extracts parameter value from HREF string
   HREF=unescape(location.href); alrt("HREF="+HREF);
   beg=HREF.indexOf(parName+'=');
   if(beg==-1)return''; //no such parValue
   prefix=HREF.charAt(beg-1)+"";alrt("Prefix"+prefix);
   if(prefix!='?'&&prefix!='&')return'';//extra check
   // now go get param value
   beg+=parName.length+1; // past equal sign
   end=HREF.indexOf("&",beg); if(end==-1)end=HREF.length; alrt("beg="+beg+",end="+end);
   return HREF.substring(beg,end);
 }
 
function swLang() { alrt('Entering swLang()');
  if(location.href.indexOf('/_en')>0)newLocation=location.href.replace('/_en','/_nl'); else
  if(location.href.indexOf('/_nl')>0)newLocation=location.href.replace('/_nl','/_en');
  alrt('New Location:'+newLocation); location.href=newLocation;
}
function testFn() { return 'testing JS function...'; }
function testFn(n) {return n;}
								
