
//http://www.vmm.be/geoview/index.html?gvMeetnet=bio&gvGemeenteNIS=24055

//internet of intranet
var domein; 

//Domain ophalen
//domein = "intranet"

if (unescape(location).split('/')[2]=="www.vmm.be") {
	domein = "internet";
}
if (unescape(location).split('/')[2]=="owww.vmm.be") {
	domein = "intranet";
}
if (unescape(location).split('/')[2]=="twww.vmm.be") {
	domein = "intranet";
}
if (unescape(location).split('/')[2]=="pwww.vmm.be") {
	domein = "internet";
}
if (unescape(location).split('/')[2]=="intranet.vmm.be") {
	domein = "intranet";
}

//domein = "intranet";

var CurrentMeetnet = "ggr";
var CurrentThema = undefined;
var PreviousMeetnet = "fc";
var CurrentMeetplaats = 0;
var CurrentGemeente="";
var CurrentProvincie="";
var CurrentNisnr=0;
var ZoekLoaded=false;





var SearchInit = true;

var versie = "10.2.13"

function ShowVersion() {
alert("Geoview " + versie + "\n\nCopyright © 2000-2007 Vlaamse Milieumaatschappij");
}

function GetTime() {
	var currentTime = new Date()
	var hours = currentTime.getHours()
	var minutes = currentTime.getMinutes()
	var seconds = currentTime.getSeconds()
	if (minutes < 10)
		minutes = "0" + minutes
	//if(hours > 11){
	//	document.write("PM")
	//} else {
	//document.write("AM")
	return hours + ":" + minutes + ":" + seconds + "";
}

function GetDate() {
	var currentTime = new Date()
	var month = currentTime.getMonth() + 1
	var day = currentTime.getDate()
	var year = currentTime.getFullYear()
	return month + "/" + day + "/" + year;
}

setTimeout("DebugMessage('Geoview ' + versie);",1000);
function DebugMessage(msg) {
	document.getElementById('winMessageText').innerHTML = GetTime() + " - " + msg + "<BR>" + document.getElementById('winMessageText').innerHTML;
}

function ReturnFromSearch(s) {
	DebugMessage("Return van zoeken");
	HideSearch();
	ClickTab(CurrentMeetnet);
	ShowMap('41002','Aalst');
	GetMeetplaats(s);
	setTimeout("SetUBentHier('meetplaats')",5000);
}


firstmeetnet = true;


function ClickTab(meetnet) {
	if (!(CurrentMeetplaats==0)) {
		ShowMap(document.gemeenteform.selGemeente.value,document.gemeenteform.selGemeente.options[document.gemeenteform.selGemeente.selectedIndex].text)
	}

	DebugMessage("verander meetnet naar "+ meetnet);
	if (firstmeetnet==true) {
/*
		if (meetnet=='fc')  {document.frmSelectMeetnet.cbbSelectMeetnet.selectedIndex = 0;}
		if (meetnet=='bio') {document.frmSelectMeetnet.cbbSelectMeetnet.selectedIndex = 1;}
		if (meetnet=='rv')  {document.frmSelectMeetnet.cbbSelectMeetnet.selectedIndex = 2;}
		if (meetnet=='map') {document.frmSelectMeetnet.cbbSelectMeetnet.selectedIndex = 3;}
		if (meetnet=='wb')  {document.frmSelectMeetnet.cbbSelectMeetnet.selectedIndex = 4;}
		if (meetnet=='pw')  {document.frmSelectMeetnet.cbbSelectMeetnet.selectedIndex = 5;}
*/
		firstmeetnet = false;
	}

	if (meetnet=='0') {
		document.getElementById('cbbSelectMeetnet').options[0].selected = true;
		document.getElementById('cbbSelectMeetnet2').options[0].selected = true;

		return;
	}
	if (!(meetnet=='welkom')) {
		//document.getElementById('tab_'+CurrentMeetnet).className='plain';
		//document.getElementById('tab_'+meetnet).className='selected';
	}
	if (meetnet=='welkom') {
		ShowAbout();
		HideMpl();
		if (SearchInit) {
			document.getElementById('welkom').innerHTML="<iframe src='search.html' width='576' height='525' scrolling='auto' frameborder='0'><\/iframe>";
			SearchInit = false;
		}
	}
	else {
		CurrentThema = undefined;
		setTimeout("SetDocsCGI()",500);
		HideAbout();
		ShowThema();
		document.getElementById('divSelectThema').innerHTML="<iframe id='frThema' name='frThema' src='thema_"+meetnet+".html?' width='100%' height='100%' scrolling='no' frameborder='0'><\/iframe>";

		PreviousMeetnet = CurrentMeetnet;
		CurrentMeetnet = meetnet;
		if (CurrentMeetplaats!=0) {
			SetDocs();
			ShowRapportMeetplaats();
			ShowKaart();
			ShowOverzichtmap();
			//ShowRapportGemeente();
			ShowMpl();
			ShowLegende();
		}
		else {
			if (CurrentNisnr!=0) {
				ShowMap(CurrentNisnr,CurrentGemeente);
			}
			else {
				//alert(0)
			}
		}
	}
}


function GetTheme(thema) {

        DebugMessage("verander thema naar "+ thema);

	if (thema == CurrentMeetnet) {
		thema = undefined;
		CurrentThema = undefined;
	}
	else
	{
		CurrentThema = thema;
	}
		if (CurrentMeetplaats!=0) {
			//alert(CurrentMeetplaats)
			//GetMeetplaats(CurrentMeetplaats,false);
			SetDocs();
			ShowRapportMeetplaats();
			ShowKaart();
			ShowOverzichtmap();
			//ShowRapportGemeente();
			ShowMpl();
			ShowLegende();
		}
		else {
			if (CurrentNisnr!=0) {
				//alert(1)
				ShowMap(CurrentNisnr,CurrentGemeente,thema);
			}
			else {
				//alert(0)
				//document.getElementById('inhoud').style.visibility='visible';
			}
		}
}



function HideMessage() {
 if (winList['winMessage']) winList['winMessage'].close(); return false;
}

var Search_visibility;

function SwitchSearch() {
	if (Search_visibility == false) {
		ShowSearch();
		return false;
	} 
	if (Search_visibility == true) {
		HideSearch();
		return false;
	} 
        ShowSearch();
	return false;
}

function ShowSearch() {
 if (winList['winZoek']) {
	//if (!(ZoekLoaded)) {
		document.getElementById('frameZoek').src="zoek_"+CurrentMeetnet+".html";
	//}
	winList['winZoek'].open();
	Search_visibility = true;
	//document.getElementById('tbSwitchSearch').innerHTML="<a href='javascript:void(0);' onclick='javascript:SwitchSearch();'><img title='Zoek' alt='Zoek' src='./img/tb_img/search.png'><\/a>";
	return false;
 }
}
function HideSearch() {
 if (winList['winZoek']) {
	winList['winZoek'].close(); 
	Search_visibility = false;
	//document.getElementById('tbSwitchSearch').innerHTML="<a href='javascript:void(0);' onclick='javascript:SwitchSearch();'><img title='Zoek' alt='Zoek' src='./img/tb_img/search.png'><\/a>";
	return false;
 }
}


function ShowThema() {
 if (winList['winThema']) winList['winThema'].open(); return false;
}
function HideThema() {
 if (winList['winThema']) winList['winThema'].close(); return false;
}

function ShowKaart() {
 if (winList['winKaart']) winList['winKaart'].open(); return false;
}
function ShowMpl() {
 if (winList['winMpl']) winList['winMpl'].open(); return false;
}
function HideMpl() {
 if (winList['winMpl']) winList['winMpl'].close(); return false;
}

var About_visibility=true;

function SwitchAbout() {
	if (About_visibility == false) {
		ShowAbout();
		return false;
	} 
	if (About_visibility == true) {
		HideAbout();
		return false;
	} 
	return false;
}

function ShowAbout() {
 if (winList['winAbout']) {
	winList['winAbout'].open(); 
	About_visibility = true;
	document.getElementById('tbSwitchAbout').innerHTML="<a href='javascript:void(0);' onclick='javascript:SwitchAbout();'><img title='Verberg de info' alt='Verberg de info' src='./img/tb_img/information.png'><\/a>";
	return false;
 }
}
function HideAbout() {
 if (winList['winAbout']) {
	winList['winAbout'].close();
	About_visibility = false;
	document.getElementById('tbSwitchAbout').innerHTML="<a href='javascript:void(0);' onclick='javascript:SwitchAbout();'><img title='Toon de info' alt='Toon de info' src='./img/tb_img/information.png'><\/a>";
	return false;
  }
}

var Legende_visibility;

function SwitchLegende() {
	if (Legende_visibility == false) {
		ShowLegende();
		return false;
	} 
	if (Legende_visibility == true) {
		HideLegende();
		return false;
	} 
	return false;
}

function ShowLegende() {
 if (winList['winLegende']) {
	winList['winLegende'].open(); 
	Legende_visibility = true;
	//document.getElementById('tbSwitchLegende').innerHTML="<a href='javascript:void(0);' onclick='javascript:SwitchLegende();'><img title='Verberg de legende' alt='Verberg de legende' src='./img/tb_img/hide_legend.png'><\/a>";
	return false;
 }
}
function HideLegende() {
 if (winList['winLegende']) {
	winList['winLegende'].close();
	Legende_visibility = false;
	//document.getElementById('tbSwitchLegende').innerHTML="<a href='javascript:void(0);' onclick='javascript:SwitchLegende();'><img title='Toon de legende' alt='Toon de legende' src='./img/tb_img/show_legend.png'><\/a>";
	return false;
  }
}

var Overzichtmap_visibility;

function SwitchOverzichtmap() {
	if (Overzichtmap_visibility == false) {
		ShowOverzichtmap();
		return false;
	} 
	if (Overzichtmap_visibility == true) {
		HideOverzichtmap();
		return false;
	} 
	return false;
}

function ShowOverzichtmap() {
 if (winList['winOverzichtmap']) {
	winList['winOverzichtmap'].open(); 
	Overzichtmap_visibility = true;
	//document.getElementById('tbSwitchOverzichtmap').innerHTML="<a href='javascript:void(0);' onclick='javascript:SwitchOverzichtmap();'><img title='Overzicht' alt='Overzicht' src='./img/tb_img/globe_small_with_hand.png'><\/a>";
	return false;
 }
}
function HideOverzichtmap() {
 if (winList['winOverzichtmap']) {
	winList['winOverzichtmap'].close();
	Overzichtmap_visibility = false;
	document.getElementById('tbSwitchOverzichtmap').innerHTML="<a href='javascript:void(0);' onclick='javascript:SwitchOverzichtmap();'><img title='Overzicht' alt='Overzicht' src='./img/tb_img/globe_small_with_hand.png'><\/a>";
	return false;
  }
}



function ShowRapportGemeente() {
 if (winList['winRapportGemeente']) winList['winRapportGemeente'].open(); return false;
}
function HideRapportGemeente() {
 if (winList['winRapportGemeente']) winList['winRapportGemeente'].close(); return false;
}

function ShowRapportMeetplaats() {
 HideRapportGemeente();
 if (winList['winRapportMeetplaats']) winList['winRapportMeetplaats'].open(); return false;
}
function HideRapportMeetplaats() {
 //ShowRapportGemeente();
 if (winList['winRapportMeetplaats']) winList['winRapportMeetplaats'].close(); return false;
}

function GetMeetplaats(m,getdocs) {
	//voor backward compatibility
	GetFeature(m,getdocs)
//document.frmSelectMeetnet2.cbbSelectMeetnet2.disabled=true;
}

function GetFeature(m,getdocs) {
        DebugMessage("ophalen Feature "+ m);
	//alert("-"+m+"-")
	CurrentMeetplaats = m;
	//document.getElementById('mplinfobox').style.visibility='visible';
	ShowMpl();

	if (CurrentMeetnet== "mab") {
		document.getElementById('winMpltitleBarText').innerHTML="Meetput";
		document.getElementById('winRapportMeetplaatstitleBarText').innerHTML="Meetputrapporten";
		document.getElementById('mplinfo').innerHTML="<iframe src='mab/"+m+".html' width='100%' height='100%' scrolling='auto' frameborder='0'><\/iframe>";
	}
	else if (CurrentMeetnet== "rwzi") {
		document.getElementById('winMpltitleBarText').innerHTML="RWZI";
		document.getElementById('winRapportMeetplaatstitleBarText').innerHTML="RWZI-rapporten";
		document.getElementById('mplinfo').innerHTML="<iframe src='rwzi/"+m+".html' width='100%' height='100%' scrolling='auto' frameborder='0'><\/iframe>";
	}
	else {
		document.getElementById('winMpltitleBarText').innerHTML="Meetplaats";
		document.getElementById('winRapportMeetplaatstitleBarText').innerHTML="Meetplaatsrapporten";
		document.getElementById('mplinfo').innerHTML="<iframe src='mpl/"+m+".html' width='100%' height='100%' scrolling='auto' frameborder='0'><\/iframe>";
	}

	//try {alert(document.getElementById('mplinfo').innerHTML)}
	//catch(err) {}
	//document.getElementById('content2').innerHTML="<img class='logo' alt='' src='kaarten/meetplaats/"+m+".jpg' border='0'>";

	if (CurrentMeetnet== "mab") {
		document.getElementById('contentKaart').innerHTML="<iframe name='wKaart' id='wKaart' src='kaarten/meetput/display2.html?"+m+"' width='100%' height='100%' scrolling='auto' frameborder='0'><\/iframe>";
		document.getElementById('legendeinfo').innerHTML="<iframe src='kaarten/legende/kaartmeetput.html?'"+CurrentMeetplaats+" width='100%' height='100%' scrolling='auto' frameborder='0'><\/iframe>";
	}
	else if (CurrentMeetnet== "rwzi") {
		document.getElementById('contentKaart').innerHTML="<iframe name='wKaart' id='wKaart' src='kaarten/meetput_rwzi/display2.html?"+m+"' width='100%' height='100%' scrolling='auto' frameborder='0'><\/iframe>";
		document.getElementById('legendeinfo').innerHTML="<iframe src='kaarten/legende/kaartrwzi.html?'"+CurrentMeetplaats+" width='100%' height='100%' scrolling='auto' frameborder='0'><\/iframe>";
	}
	else {
		document.getElementById('contentKaart').innerHTML="<iframe name='wKaart' id='wKaart' src='kaarten/meetplaats/display2.html?"+m+"' width='100%' height='100%' scrolling='auto' frameborder='0'><\/iframe>";
		document.getElementById('legendeinfo').innerHTML="<iframe src='kaarten/legende/kaart.html?'"+CurrentMeetplaats+" width='100%' height='100%' scrolling='auto' frameborder='0'><\/iframe>";
	}


	if (getdocs!=false) {
		setTimeout("SetDocs()",500);
	}
	setTimeout("SetUBentHier('meetplaats')",1000);
}



function SetDocsCGI() {
	DebugMessage("SetDocsCGI()");

	DebugMessage(tYear);

	//setTimeout("DebugMessage(document.getElementById('legendeinfo').frmSelectThema.cbbSelectYear.length)",4000);
	//setTimeout("DebugMessage(winLegende.document.frmSelectThema.cbbSelectYear.length)",5000);

	myComboGGR = document.cgiform.selDocGGR
	myComboGGR.length=0;
	myComboGGR.options[myComboGGR.length] = new Option('Geen rapporten beschikbaar','');
	HideRapportGemeente();

	if (CurrentMeetnet =='idx') {
		myComboGGR.length=0;
		myComboGGR.options[myComboGGR.length] = new Option('--databank------------------------------','');
		myComboGGR.options[myComboGGR.length] = new Option('Overzicht van de PIO','UrlPIONis');
		myComboGGR.options[myComboGGR.length] = new Option('Overzicht van de BBI','UrlBBINis');

		if (domein == "intranet") {
			myComboGGR.options[myComboGGR.length] = new Option('--datawarehouse------------------------------','0');
			myComboGGR.options[myComboGGR.length] = new Option('Resultaten','UrlDWHgv_resultaat_divers');
			myComboGGR.options[myComboGGR.length] = new Option('Meetplaatsen','UrlDWHgv_meetplaats_divers');
		}
		ShowRapportGemeente();
	}

	if (CurrentMeetnet =='fc') {
		myComboGGR.length=0;
		myComboGGR.options[myComboGGR.length] = new Option('--databank------------------------------','');
		myComboGGR.options[myComboGGR.length] = new Option('Overzicht van de PIO','UrlPIONis');
		if (domein == "intranet") {
			myComboGGR.options[myComboGGR.length] = new Option('--datawarehouse------------------------------','0');
			myComboGGR.options[myComboGGR.length] = new Option('Meetplaatsen','UrlDWHgv_meetplaats_divers');
			myComboGGR.options[myComboGGR.length] = new Option('Resultaten','UrlDWHgv_resultaat_divers');
		}
		ShowRapportGemeente();
	}

	if (CurrentMeetnet =='bio') {
		myComboGGR.length=0;
		myComboGGR.options[myComboGGR.length] = new Option('--databank------------------------------','');
		myComboGGR.options[myComboGGR.length] = new Option('Overzicht van de BBI','UrlBBINis');
		if (domein == "intranet") {
			myComboGGR.options[myComboGGR.length] = new Option('--datawarehouse------------------------------','0');
			myComboGGR.options[myComboGGR.length] = new Option('Resultaten','UrlDWHgv_resultaat_divers');
			myComboGGR.options[myComboGGR.length] = new Option('Meetplaatsen','UrlDWHgv_meetplaats_divers');
		}
		ShowRapportGemeente();
	}

}



function SetDocs() {
	DebugMessage("SetDocs()");
	myCombo = document.docform.selDoc

	myCombo.length=0;

	if (CurrentMeetnet =='idx') {
		myCombo.options[myCombo.length] = new Option('--databank------------------------------','0');
		myCombo.options[myCombo.length] = new Option('Resultaten','UrlOWDataMPT');
	
		if (domein == "intranet") {
			myCombo.options[myCombo.length] = new Option('--datawarehouse------------------------------','0');
			myCombo.options[myCombo.length] = new Option('Meetplaatsinfo','UrlDWHInfoMPT');
			myCombo.options[myCombo.length] = new Option('Overzicht indexen','UrlDWHOverzicht_mpl_pio_bio_norm_kaart');
			myCombo.options[myCombo.length] = new Option('Meetplaatsen op '+unescape(gvWaterloop),'UrlDWHgv_meetplaats_divers_vhag');
			myCombo.options[myCombo.length] = new Option('Resultaten op '+unescape(gvWaterloop),'UrlDWHgv_resultaat_divers_vhag');
		}
	}

	if (CurrentMeetnet =='rv') {
		myCombo.options[myCombo.length] = new Option('--databank------------------------------','0');
		myCombo.options[myCombo.length] = new Option('Resultaten','UrlOWDataMPT');
		if (eval("Rpt_doc_bwater"+tYear)) {
			myCombo.options[myCombo.length] = new Option('--pdf------------------------------','0');
			myCombo.options[myCombo.length] = new Option('Zwemwaterrichtlijn 76/160/EEG','gegevens/bwater');
		}
	
		if (domein == "intranet") {
			myCombo.options[myCombo.length] = new Option('--datawarehouse------------------------------','0');
			myCombo.options[myCombo.length] = new Option('Meetplaatsinfo','UrlDWHInfoMPT');
			myCombo.options[myCombo.length] = new Option('Microbiologie','UrlDWHmicrobiologie');
		}
	}

	if (CurrentMeetnet =='bio') {
		myCombo.options[myCombo.length] = new Option('--databank------------------------------','0');
		myCombo.options[myCombo.length] = new Option('Resultaten','UrlOWDataMPT');
		if (domein == "intranet") {
			myCombo.options[myCombo.length] = new Option('--datawarehouse------------------------------','0');
			myCombo.options[myCombo.length] = new Option('Meetplaatsinfo','UrlDWHInfoMPT');
			myCombo.options[myCombo.length] = new Option('Overzicht indexen','UrlDWHOverzicht_mpl_pio_bio_norm_kaart');
			myCombo.options[myCombo.length] = new Option('Meetplaatsen op '+unescape(gvWaterloop),'UrlDWHgv_meetplaats_divers_vhag');
			myCombo.options[myCombo.length] = new Option('Resultaten op '+unescape(gvWaterloop),'UrlDWHgv_resultaat_divers_vhag');
		}
		if (eval("Rpt_doc_bio"+tYear)) {
			myCombo.options[myCombo.length] = new Option('--pdf------------------------------','0');
			myCombo.options[myCombo.length] = new Option('Macro-invertebraten','gegevens/bio');
			if (eval("Rpt_doc_grafiek_1"+tYear)) {
				myCombo.options[myCombo.length] = new Option('--grafiek------------------------------','0');
				myCombo.options[myCombo.length] = new Option('Biotische index en prati index','gegevens/jvgrafiek_1');
			}
		}
	}

	if (CurrentMeetnet =='wb') {
		myCombo.options[myCombo.length] = new Option('--databank------------------------------','0');
		myCombo.options[myCombo.length] = new Option('Online waterbodemdatabank','UrlWBDataMPT');
		myCombo.options[myCombo.length] = new Option('Online databank oppervlaktewater','UrlOWDataMPT');
		if (eval("Rpt_doc_triade"+tYear)) {
			myCombo.options[myCombo.length] = new Option('--pdf------------------------------','0');
			myCombo.options[myCombo.length] = new Option('Triade','gegevens/triade');
		}
	}

	if (CurrentMeetnet =='map') {
		myCombo.options[myCombo.length] = new Option('--databank------------------------------','0');
		myCombo.options[myCombo.length] = new Option('Resultaten','UrlOWDataMPT');
		if (domein == "intranet") {
			myCombo.options[myCombo.length] = new Option('--datawarehouse------------------------------','0');
			myCombo.options[myCombo.length] = new Option('Meetplaatsinfo','UrlDWHInfoMPT');
			myCombo.options[myCombo.length] = new Option('Resultaten','UrlDWHgv_resultaat_divers');
			myCombo.options[myCombo.length] = new Option('Normtoetsing','UrlDWHnormtoetsing');
			myCombo.options[myCombo.length] = new Option('Overzicht indexen','UrlDWHOverzicht_mpl_pio_bio_norm_kaart');
		}
		if (eval("Rpt_doc_evolutie_2"+tYear)) {
			myCombo.options[myCombo.length] = new Option('--pdf------------------------------','0');
			myCombo.options[myCombo.length] = new Option('Evolutie Nitraat (2 jaar)','evolutie_2');
			if (eval("Rpt_doc_evolutie_all"+tYear)) {
				myCombo.options[myCombo.length] = new Option('Evolutie Nitraat (alles)','evolutie_all');
			}
			if (eval("Rpt_doc_grafiek_2"+tYear)) {
				myCombo.options[myCombo.length] = new Option('Nitraat + nitriet','gegevens/jvgrafiek_2');
			}
			if (eval("Rpt_doc_grafiek_3"+tYear)) {
				myCombo.options[myCombo.length] = new Option('Nitraat','gegevens/jvgrafiek_3');
			}
			if (eval("Rpt_doc_grafiek_4"+tYear)) {
				myCombo.options[myCombo.length] = new Option('Kjeldahlstikstof en Ammonium','gegevens/jvgrafiek_4');
			}
			if (eval("Rpt_doc_grafiek_5"+tYear)) {
				myCombo.options[myCombo.length] = new Option('Totaal fosfor en orthofosfaat','gegevens/jvgrafiek_5');
			}
			if (eval("Rpt_doc_grafiek_9"+tYear)) {
				myCombo.options[myCombo.length] = new Option('Pesticiden','gegevens/jvgrafiek_9');
			}
		}
	}

	if (CurrentMeetnet =='fc'||CurrentMeetnet =='normen'||CurrentMeetnet =='drinkwaterproductie') {
		myCombo.options[myCombo.length] = new Option('--databank------------------------------','0');
		myCombo.options[myCombo.length] = new Option('Meest recente resultaten','UrlOWDataMPT');
	
		if (domein == "intranet") {
			myCombo.options[myCombo.length] = new Option('--datawarehouse------------------------------','0');
			myCombo.options[myCombo.length] = new Option('Meetplaatsinfo','UrlDWHInfoMPT');
			myCombo.options[myCombo.length] = new Option('Resultaten','UrlDWHgv_resultaat_divers');
			myCombo.options[myCombo.length] = new Option('Normtoetsing','UrlDWHnormtoetsing');
			myCombo.options[myCombo.length] = new Option('Lozingspunten','UrlDWHlozingspunten');
			myCombo.options[myCombo.length] = new Option('Overzicht indexen','UrlDWHOverzicht_mpl_pio_bio_norm_kaart');
			myCombo.options[myCombo.length] = new Option('Meetplaatsen op '+unescape(gvWaterloop),'UrlDWHgv_meetplaats_divers_vhag');
			myCombo.options[myCombo.length] = new Option('Resultaten op '+unescape(gvWaterloop),'UrlDWHgv_resultaat_divers_vhag');

		}
	
		if (eval("Rpt_doc_resultaten"+tYear) || eval("Rpt_doc_basiskwaliteit"+tYear) || eval("Rpt_doc_drinkwaterproductie"+tYear) || eval("Rpt_doc_viswater"+tYear)) {
			myCombo.options[myCombo.length] = new Option('--pdf------------------------------','0');
			if (eval("Rpt_doc_resultaten"+tYear)) {myCombo.options[myCombo.length] = new Option('Resultaten','gegevens/resultaten');}
			if (eval("Rpt_doc_basiskwaliteit"+tYear)) {myCombo.options[myCombo.length] = new Option('Toets Basiskwaliteit','gegevens/basiskwaliteit');}
			if (eval("Rpt_doc_drinkwaterproductie"+tYear)) {myCombo.options[myCombo.length] = new Option('Toets Drinkwaterproductie','gegevens/drinkwaterproductie');}
			if (eval("Rpt_doc_viswater"+tYear)) {myCombo.options[myCombo.length] = new Option('Toets Viswater','gegevens/viswater');}
		}
		if (eval("Rpt_doc_grafiek_1"+tYear) || eval("Rpt_doc_grafiek_2"+tYear) || eval("Rpt_doc_grafiek_3"+tYear) || eval("Rpt_doc_grafiek_4"+tYear) || eval("Rpt_doc_grafiek_5"+tYear) || eval("Rpt_doc_grafiek_6"+tYear) || eval("Rpt_doc_grafiek_7"+tYear) || eval("Rpt_doc_grafiek_8"+tYear) || eval("Rpt_doc_grafiek_9"+tYear) || eval("Rpt_doc_grafiek_10"+tYear) || eval("Rpt_doc_grafiek_11"+tYear) || eval("Rpt_doc_grafiek_12"+tYear)) {
			myCombo.options[myCombo.length] = new Option('--grafiek------------------------------','0');
			if (eval("Rpt_doc_grafiek_1"+tYear)) {
				myCombo.options[myCombo.length] = new Option('Biotische index en prati index','gegevens/jvgrafiek_1');
			}
			if (eval("Rpt_doc_grafiek_2"+tYear)) {
				myCombo.options[myCombo.length] = new Option('Nitraat + nitriet','gegevens/jvgrafiek_2');
			}
			if (eval("Rpt_doc_grafiek_3"+tYear)) {
				myCombo.options[myCombo.length] = new Option('Nitraat','gegevens/jvgrafiek_3');
			}
			if (eval("Rpt_doc_grafiek_4"+tYear)) {
				myCombo.options[myCombo.length] = new Option('Kjeldahlstikstof en Ammonium','gegevens/jvgrafiek_4');
			}
			if (eval("Rpt_doc_grafiek_5"+tYear)) {
				myCombo.options[myCombo.length] = new Option('Totaal fosfor en orthofosfaat','gegevens/jvgrafiek_5');
			}
			if (eval("Rpt_doc_grafiek_6"+tYear)) {
				myCombo.options[myCombo.length] = new Option('BZV, CZV en opgeloste zuurstof','gegevens/jvgrafiek_6');
			}
			if (eval("Rpt_doc_grafiek_7"+tYear)) {
				myCombo.options[myCombo.length] = new Option('Chloride, sulfaat en geleidbaarheid','gegevens/jvgrafiek_7');
			}
			if (eval("Rpt_doc_grafiek_8"+tYear)) {
				myCombo.options[myCombo.length] = new Option('Zware metalen en Zwevende stof','gegevens/jvgrafiek_8');
			}
			if (eval("Rpt_doc_grafiek_9"+tYear)) {
				myCombo.options[myCombo.length] = new Option('Pesticiden','gegevens/jvgrafiek_9');
			}
			if (eval("Rpt_doc_grafiek_13"+tYear)) {
				myCombo.options[myCombo.length] = new Option('Chloorpesticiden','gegevens/jvgrafiek_13');
			}
			if (eval("Rpt_doc_grafiek_14"+tYear)) {
				myCombo.options[myCombo.length] = new Option('Fosforpesticiden','gegevens/jvgrafiek_14');
			}
			if (eval("Rpt_doc_grafiek_15"+tYear)) {
				myCombo.options[myCombo.length] = new Option('Stikstofpesticiden','gegevens/jvgrafiek_15');
			}
			if (eval("Rpt_doc_grafiek_10"+tYear)) {
				myCombo.options[myCombo.length] = new Option('PAK','gegevens/jvgrafiek_10');
			}
			if (eval("Rpt_doc_grafiek_11"+tYear)) {
				myCombo.options[myCombo.length] = new Option('Chlorofyl a','gegevens/jvgrafiek_11');
			}
			if (eval("Rpt_doc_grafiek_12"+tYear)) {
				myCombo.options[myCombo.length] = new Option('Benzeen, tolueen, ethylbenzeen,xyleen','gegevens/jvgrafiek_12');
			}
		}
	}

	if (CurrentMeetnet =='pw') {
		//myCombo.options[myCombo.length] = new Option('Putwater...','0');
		//myCombo.options[myCombo.length] = new Option('--------------------------------','0');
	}

	if (CurrentMeetnet =='mab') {
		//myCombo.options[myCombo.length] = new Option('Meetput...','0');
		//myCombo.options[myCombo.length] = new Option('--------------------------------','0');
		DebugMessage("Rpt_mab_metalen_heffing"+tYear +":"+ eval("Rpt_mab_metalen_heffing"+tYear));

		if (eval("Rpt_mab_metalen_heffing"+tYear)) {
			myCombo.options[myCombo.length] = new Option('Metalen (heffing)','gegevens/mab/bedrijven/metalen_heffing');
		}
		if (eval("Rpt_mab_metalen_niet_heffing"+tYear)) {
			myCombo.options[myCombo.length] = new Option('Metalen (niet-heffing)','gegevens/mab/bedrijven/metalen_niet_heffing');
		}
		if (eval("Rpt_mab_pak"+tYear)) {
			myCombo.options[myCombo.length] = new Option('PAK','gegevens/mab/bedrijven/pak');
		}
		if (eval("Rpt_mab_vluchtige_organische_componenten"+tYear)) {
			myCombo.options[myCombo.length] = new Option('Vluchtige organische componenten','gegevens/mab/bedrijven/vluchtige_organische_componenten');
		}
		if (eval("Rpt_mab_zuurstofvragende_parameters_nutriënten"+tYear)) {
			myCombo.options[myCombo.length] = new Option('Zuurstofvragende parameters (nutriënten)','gegevens/mab/bedrijven/zuurstofvragende_parameters_nutrienten');
		}
		if (eval("Rpt_mab_2_3_MAK_PAK"+tYear)) {
			myCombo.options[myCombo.length] = new Option('MAK en PAK','gegevens/mab/bedrijven/2_3_MAK_PAK');
		}
		if (eval("Rpt_mab_4_Fenolen"+tYear)) {
			myCombo.options[myCombo.length] = new Option('Fenolen','gegevens/mab/bedrijven/4_Fenolen');
		}
		if (eval("Rpt_mab_5_Org_CL_pest"+tYear)) {
			myCombo.options[myCombo.length] = new Option('Chloorpesticiden','gegevens/mab/bedrijven/5_Org_CL_pest');
		}
		if (eval("Rpt_mab_6_And_Org_Cl_verb"+tYear)) {
			myCombo.options[myCombo.length] = new Option('Andere Chloor-verbindingen','gegevens/mab/bedrijven/6_And_Org_Cl_verb');
		}
		if (eval("Rpt_mab_7_8_Org_N_P_pest"+tYear)) {
			myCombo.options[myCombo.length] = new Option('Stikstof en fosforpesticiden','gegevens/mab/bedrijven/7_8_Org_N_P_pest');
		}
		if (eval("Rpt_mab_9_10_Org_Sn_overige_st"+tYear)) {
			myCombo.options[myCombo.length] = new Option('Organo SN verbindingen en overige Org. stoffen','gegevens/mab/bedrijven/9_10_Org_Sn_overige_st');
		}

	}

	if (CurrentMeetnet =='rwzi') {
		//myCombo.options[myCombo.length] = new Option('RWZI...','0');
		//myCombo.options[myCombo.length] = new Option('--------------------------------','0');

		if (eval("Rpt_mab_rwzi_basisparameters"+tYear)) {
			myCombo.options[myCombo.length] = new Option('Basisparameters','gegevens/mab/rwzi/basisparameters');
		}
		if (eval("Rpt_mab_rwzi_debieten"+tYear)) {
			myCombo.options[myCombo.length] = new Option('Debieten','gegevens/mab/rwzi/debieten');
		}
		if (eval("Rpt_mab_rwzi_metalen"+tYear)) {
			myCombo.options[myCombo.length] = new Option('Metalen','gegevens/mab/rwzi/metalen');
		}
		if (eval("Rpt_mab_rwzi_gewogen_concentraties_nt_pt"+tYear)) {
			myCombo.options[myCombo.length] = new Option('N t - P t','gegevens/mab/rwzi/gewogen_concentraties/nt_pt');
		}
		if (eval("Rpt_mab_rwzi_gewogen_concentraties_zs_bzv_czv"+tYear)) {
			myCombo.options[myCombo.length] = new Option('ZS - BZV - CZV','gegevens/mab/rwzi/gewogen_concentraties/zs_bzv_czv');
		}
		if (eval("Rpt_mab_rwzi_rendementen"+tYear)) {
			myCombo.options[myCombo.length] = new Option('Rendementen','gegevens/mab/rwzi/rendementen');
		}

	}

	//document.getElementById('docbox').style.visibility='visible';
	ShowRapportMeetplaats();
}



var winPdf;
var dwhurl;

function LoadDoc(dValue,dText) {
	DebugMessage("LoadDoc("+dValue+","+dText+")");
	if (dValue==0) {return;}
	if (dValue.substring(0, 3) =="Url") {
		if (dValue.substring(3, 6) =="DWH") {
			myURL = "http://dwh.vmm.be/cognos/cgi-bin/imrap.cgi?IWRUnit=imrap&cd=r&nid="
			nid   = eval(dValue); //"7cccd48a1dd211b2a20881901c8ceedf";
			if (dValue == "UrlDWHInfoMPT") {
				myArg ="cognospMain_20Query_5Fvmmnr="+CurrentMeetplaats;
				msg = "Contacteren Datawarehouse voor data "+CurrentMeetplaats+".";
			}
			if (dValue == "UrlDWHmicrobiologie") {
				myJaar = prompt("Geef het jaar op waarvoor u de gegevens wenst te bekomen:","2008");
					if (myJaar == null) {return;}
				myArg ="cognospMain_20Query_5Fmeetplaats="+CurrentMeetplaats+"&cognospMain%20Query_5Fjaar="+myJaar+"";
				msg = "Contacteren Datawarehouse voor gegevens microbiologie "+CurrentMeetplaats+".";
			}
			if (dValue == "UrlDWHgv_resultaat_divers") {
				myJaar = prompt("Geef het jaar op waarvoor u de gegevens wenst te bekomen:\n(Geef 0 in voor opvragen van alle jaren)","2008");
					if (myJaar == null) {return;}
				myArg="cognospMain%20Query_5Fjaar1="+myJaar+"&cognospMain%20Query_5Fmpl="+CurrentMeetplaats+"&cognospMain%20Query_5FVHAG=0&cognospMain%20Query_5FNISNUMMER=0&cognospMain%20Query_5FPROV_5FCODE=0&cognospMain%20Query_5FVHAZ=0&cognospMain%20Query_5FBCV_5FCODE=0";
				msg = "Contacteren Datawarehouse voor data "+CurrentMeetplaats+".";
			}
			if (dValue == "UrlDWHgv_resultaat_divers_vhag") {
				myJaar = prompt("Geef het jaar op waarvoor u de gegevens wenst te bekomen:\n(Geef 0 in voor opvragen van alle jaren)","2008");
					if (myJaar == null) {return;}
				myArg="cognospMain%20Query_5Fjaar1="+myJaar+"&cognospMain%20Query_5Fmpl=0&cognospMain%20Query_5FVHAG="+gvVHAG_code+"&cognospMain%20Query_5FNISNUMMER=0&cognospMain%20Query_5FPROV_5FCODE=0&cognospMain%20Query_5FVHAZ=0&cognospMain%20Query_5FBCV_5FCODE=0";
				msg = "Contacteren Datawarehouse voor data "+unescape(gvWaterloop)+".";
			}
			if (dValue == "UrlDWHgv_meetplaats_divers_vhag") {
				myArg="cognospMain%20Query_5Fmpl=0&cognospMain%20Query_5FVHAG="+gvVHAG_code+"&cognospMain%20Query_5FNISNUMMER=0&cognospMain%20Query_5FPROV_5FCODE=0&cognospMain%20Query_5FVHAZ=0&cognospMain%20Query_5FBCV_5FCODE=0";
				msg = "Contacteren van de DataWareHouse voor de meetplaatsen op "+unescape(gvWaterloop)+".";
			}

			if (dValue=="UrlDWHlozingspunten") {
				myArg="cognospMain_20Query_5Fvmmnr="+CurrentMeetplaats
				msg = "Contacteren Datawarehouse voor data "+CurrentMeetplaats+".";
			}
			if (dValue=="UrlDWHnormtoetsing") {
				myJaar = prompt("Geef het jaar op waarvoor u de normtoets wenst te bekomen:","2008");
					if (myJaar == null) {return;}
				myNorm = prompt("Type\nBASIS : basiskwaliteit\nVIS : viswater","BASIS");
					if (myNorm == null) {return;}
				myArg="cognospMain%20Query_5Fmp="+CurrentMeetplaats+"&cognospMain%20Query_5Fj="+myJaar+"&cognospMain%20Query_5Fnc="+ myNorm +""
				msg = "Contacteren Datawarehouse voor data "+CurrentMeetplaats+".";
			}
			if (dValue=="UrlDWHOverzicht_mpl_pio_bio_norm_kaart") {
				myArg="cognospMain%20Query_5Fvmmnr="+CurrentMeetplaats;
				msg = "Contacteren Datawarehouse voor data "+CurrentMeetplaats+".";
			}
			dwhurl = myURL+nid+"&"+myArg,
			msg = escape(msg);
			winData = window.open('./loading.html?'+msg,'_winData','width=840,height=627,screenX=62,screenY=22,top=22,left=62,toolbar=no,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
			winData.focus();
			setTimeout("winData.location = dwhurl;",2000);
			winData.focus();
			return;
		}
	}

	//this.value,this.options[selectedIndex].text
	//alert(CurrentMeetplaats+dValue+dText);
	if (dValue.substring(0, 3) =="Url") {
		if (dValue.substring(3, 5) =="OW") {
			loc=UrlOWDataMPT;
			msg = "Ophalen van analyseresultaten oppervlaktewater op meetplaats "+CurrentMeetplaats+".";
		}
		if (dValue.substring(3, 5) =="WB") {
			loc=UrlWBDataMPT;
			msg = "Ophalen van analyseresultaten waterbodem op meetplaats "+CurrentMeetplaats+".";
		}
		msg = escape(msg);
		winData = window.open('./loading.html?'+msg,'_winData','width=840,height=627,screenX=62,screenY=22,top=22,left=62,toolbar=no,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
		winData.focus();
		setTimeout("winData.location = loc+CurrentMeetplaats;",2000);
		winData.focus();
	}
	else
	{
		if(tYear=="") {
			msg = "Ophalen van document voor " +CurrentMeetplaats;
			loc="./mpl/"+dValue+"/"+CurrentMeetplaats+".pdf";
			//winPdf = window.open('./loading.html?'+msg,'_winPdf','width=840,height=627,screenX=62,screenY=22,top=22,left=62,toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes');
			//winPdf.focus();
			winPdf = window.open(loc,'_winPdf','width=800,height=600,screenX=50,screenY=50,top=50,left=50,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes');
			winPdf.focus();
			//setTimeout("winPdf.location = loc;",2000);
		} else {
			msg = "Ophalen van document voor " +CurrentMeetplaats;
			loc="./mpl/"+dValue+"/"+tYear+"/"+CurrentMeetplaats+".pdf";
			//loc="Z:/1/1.2/Meetdatabank/Internet/"+dValue+"/"+tYear+"/"+CurrentMeetplaats+".pdf";
			//winPdf = window.open('./loading.html?'+msg,'_winPdf','width=840,height=627,screenX=62,screenY=22,top=22,left=62,toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes');
			//winPdf.focus();
			winPdf = window.open(loc,'_winPdf','width=800,height=600,screenX=50,screenY=50,top=50,left=50,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes');
			winPdf.focus();
			//setTimeout("winPdf.location = loc;",2000);
		}
	}
}

CurrentNisid = 0;

function GetCgi(dValue) {
if (dValue=="") return;
DebugMessage("GetCgi("+dValue+")");
//alert(parent.CurrentNisid)
//alert(CurrentNisid)
//alert(top.CurrentNisid)
//alert(top.document.gemeenteform.selGemeente.options[top.document.gemeenteform.selGemeente.selectedIndex].value)
parent.CurrentNisid=Nisnr2Nisid(top.document.gemeenteform.selGemeente.options[top.document.gemeenteform.selGemeente.selectedIndex].value)

	if (dValue == 'UrlBBINis') {
		mURL ='http://intercgi.vmm.be/cgi-bin/amo/water/immissie/prati/prati?NISID='+parent.CurrentNisid+'%A7'+parent.CurrentGemeente+'&ENTRY=8';
		msg = "Ophalen van biotische indexen in "+parent.CurrentGemeente;
		}
	if (dValue == 'UrlPIONis') {
		mURL ='http://intercgi.vmm.be/cgi-bin/amo/water/immissie/prati/prati?NISID='+parent.CurrentNisid+'%A7'+parent.CurrentGemeente+'&ENTRY=A';
		msg = "Ophalen van prati-indexen in "+parent.CurrentGemeente;
		}

	//winData = window.open('./loading.html?'+msg,'_winData','width=840,height=600,screenX=62,screenY=22,top=22,left=62,toolbar=no,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
	//winData.focus();

	//setTimeout("winData.location = mURL;",1000);
	//winData.focus();

	if (dValue.substring(0, 3) =="Url") {
		if (dValue.substring(3, 6) =="DWH") {
			myURL = "http://dwh.vmm.be/cognos/cgi-bin/imrap.cgi?IWRUnit=imrap&cd=r&nid=";
			nid   = eval(dValue); //"7cccd48a1dd211b2a20881901c8ceedf";
			if (dValue == "UrlDWHgv_resultaat_divers") {
				myArg="cognospMain%20Query_5Fjaar1="+prompt("jaartal","2005")+"&cognospMain%20Query_5Fmpl=0&cognospMain%20Query_5FVHAG=0&cognospMain%20Query_5FNISNUMMER="+parent.CurrentNisnr+"&cognospMain%20Query_5FPROV_5FCODE=0&cognospMain%20Query_5FVHAZ=0&cognospMain%20Query_5FBCV_5FCODE=0";
				msg = "Contacteren van de DataWareHouse voor resultaten op de meetplaatsen in "+parent.CurrentGemeente+".";
			}
			if (dValue == "UrlDWHgv_meetplaats_divers") {
				myArg="cognospMain%20Query_5Fmpl=0&cognospMain%20Query_5FVHAG=0&cognospMain%20Query_5FNISNUMMER="+parent.CurrentNisnr+"&cognospMain%20Query_5FPROV_5FCODE=0&cognospMain%20Query_5FVHAZ=0&cognospMain%20Query_5FBCV_5FCODE=0";
				msg = "Contacteren van de DataWareHouse voor de meetplaatsen in "+parent.CurrentGemeente+".";
			}
			mURL = myURL+nid+"&"+myArg;
		}
	}

	msg = escape(msg);
	winData = window.open('./loading.html?'+msg,'_winData','width=840,height=627,screenX=62,screenY=22,top=22,left=62,toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes');
	winData.focus();
	setTimeout("winData.location = mURL;",2000);
	winData.focus();
}


function ShowMap(id,naam,thema) {
	DebugMessage("ophalen kaart "+ id);
	DebugMessage("ophalen kaart "+ naam);
	DebugMessage("ophalen kaart "+ thema);
	if (id==0) {
		return;
	}
	if (CurrentMeetnet=='welkom') {
		return;
	}
	HideAbout();
	HideSearch();
	ShowOverzichtmap();
	//ShowRapportGemeente();
	SetDocsCGI();
	ShowKaart();
	HideMpl();
	HideRapportMeetplaats();
	if (CurrentThema == undefined) {
	ShowKaart();
	document.getElementById('contentKaart').innerHTML="<iframe name='wKaart' id='wKaart' src='kaarten/"+CurrentMeetnet +"/"+id+".html' width='100%' height='100%' scrolling='no' frameborder='0'><\/iframe>";
	}
	else
	{
	document.getElementById('contentKaart').innerHTML="<iframe name='wKaart' id='wKaart' src='kaarten/"+CurrentThema+"/"+id+".html' width='100%' height='100%' scrolling='no' frameborder='0'><\/iframe>";
	}
	if (CurrentGemeente != naam) {
		document.getElementById('overzichtmap').innerHTML="<iframe src='kaarten/birdseye/ggr/"+id+".html' width='171px' height='72px' scrolling='no' frameborder='0'><\/iframe>";
	}
	ShowLegende();
	if (CurrentThema == undefined) {
	document.getElementById('legendeinfo').innerHTML="<iframe src='kaarten/legende/"+CurrentMeetnet+".html' width='100%' height='100%' scrolling='auto' frameborder='0'><\/iframe>";
	}
	else
	{
	document.getElementById('legendeinfo').innerHTML="<iframe src='kaarten/legende/"+CurrentThema+".html' width='100%' height='100%x' scrolling='auto' frameborder='0'><\/iframe>";
	}

	CurrentGemeente = naam;
	CurrentNisnr = id;
	CurrentMeetplaats=0;
	setTimeout("SetUBentHier('gemeente')",1000);

	document.frmSelectMeetnet2.cbbSelectMeetnet2.disabled=false;
	if (CurrentMeetnet != "ggr") {
		//ShowThema();
		//document.getElementById('divSelectThema').innerHTML="<iframe id='frThema' name='frThema' src='thema_"+CurrentMeetnet+".html?' width='100%' height='100%' scrolling='no' frameborder='0'><\/iframe>";
	}

}



function SetUBentHier(positie) {
	if (positie == 'gemeente') {
		document.getElementById('dLocatie').innerHTML="U bent hier : Vlaanderen | "+top.CurrentProvincie+" | Regio " + CurrentGemeente;
		}
	if (positie == 'meetplaats') {
		document.getElementById('dLocatie').innerHTML="U bent hier : Vlaanderen | "+top.CurrentProvincie+" | <a href='javascript:ShowMap(CurrentNisnr,CurrentGemeente);' title='Klik hier om terug te keren naar de kaart van de gemeente.' onclick=''>" + CurrentGemeente + "<\/a> | Meetplaats " + CurrentMeetplaats;
	}
}

//*****************************************************************
//commandline
var gvMeetnet = null;
//var gvMeetnet_long = "";
//var gvVlaanderen  = true;
//var gvProvincieShort  = "";
//var gvProvincieNaam  = "";
var gvGemeenteNIS = null;
var gvGemeenteNaam = "";
//var gvMeetplaats = "";
//var ServerForced = false;
//var gvGemeenteNaam = "";


function replace(string,text,by) {
    // Replaces text with by in string
    var i = string.indexOf(text), newstr = '';
    if ((!i) || (i == -1))
        return string;
    newstr += string.substring(0,i) + by;
    if (i+text.length < string.length)
        newstr += replace(string.substring(i+text.length,string.length),text,by);
    return newstr;
}

var passed = replace(replace(location.search.substring(1),"+"," "),"=","&");

function split(string,text) {
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return;
    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return;
    if (i == -1) {
        splitArray[splitIndex++] = string;
        return;
    }
    splitArray[splitIndex++] = string.substring(0,i);
    if (i+txtLength < strLength)
        split(string.substring(i+txtLength,strLength),text);
    return;
}

function split(string,text) {
    splitArray = string.split(text);
    splitIndex = splitArray.length;
}

var splitIndex = 0, splitArray = new Object();

split(passed,'&');

for (var i=0; i < splitIndex; i=i+2) {

    if (splitArray[i] == 'gvMeetnet')
                          gvMeetnet = unescape(splitArray[i+1]);
    if (splitArray[i] == 'gvGemeenteNIS')
                          gvGemeenteNIS = unescape(splitArray[i+1]);
}

if ( gvMeetnet != null ) {
	setTimeout("ClickTab(gvMeetnet)",500);
	if ( gvGemeenteNIS != null ) {
		setTimeout("ShowMap(gvGemeenteNIS,Nisnr2Naam(gvGemeenteNIS));",1000);
	}

}
//	ClickTab(CurrentMeetnet);
//	ShowMap('41002','Aalst');
//	GetMeetplaats(s);
//	setTimeout("SetUBentHier('meetplaats')",5000);
//CurrentNisnr
//CurrentMeetnet = gvMeetnet;
//ClickTab(gvMeetnet);

//*****************************************************************


