

//gebruikt voor het laden van de panorama popup
function openPopup(theUrl) {
	popup = window.open(theUrl, "my_popup", 'width=400,height=300,left=300,top=300,resizable=no,scrollbars=no,toolbar=no')
	popup.focus()
}

//gebruikt voor het laden van de popup met boerderijen...
function openPopupInfo(theUrl) {
	if (theUrl==null)
		(popup = window.open("", "my_popup", 'width=335,height=300,left=300,top=300,resizable=no,scrollbars=yes,toolbar=no'))
	else
		(popup = window.open(theUrl, "my_popup", 'width=335,height=325,left=300,top=300,resizable=no,scrollbars=yes,toolbar=no'))
	popup.focus()
}


//boxenverandering voor de linker mapframe
function change_box(id) {

	mynumrec=document.form_choice.check.length

//extra records in array? denk aan extra images in maps_main

	mijn_tabel=new Array(mynumrec)
	mijn_tabel[0]="landschap"
	mijn_tabel[1]="grens"
	mijn_tabel[2]="toerisme"
	mijn_tabel[3]="boerderijen"
	mijn_tabel[4]="monumenten"
	mijn_tabel[5]="landgoed"
	mijn_tabel[6]="panorama"
	mijn_tabel[7]="ehs"
	mijn_tabel[8]="vogels"
	mijn_tabel[9]="zout"
	mijn_tabel[10]="industrie"

	//relevante verwijzingen:
	mijn_link=new Array(mynumrec)
	mijn_link[0]="landschap.htm"
	mijn_link[1]="historie.htm"
	mijn_link[2]="recreatie.htm"
	mijn_link[3]="boerderijen.php"
	mijn_link[4]="monumenten.php"
	mijn_link[5]="locatie_stroot.htm"
	mijn_link[6]="javascript:void(0)"
	mijn_link[7]="landschap_abiotisch.htm"
	mijn_link[8]="landschap_fauna.htm"
	mijn_link[9]="historie_zout.htm"
	mijn_link[10]="ontwikkelingen.htm"

	doorklik_id=0	

//	alert(document.bgColor)
		teller=-1
		for (xx=0; xx<=mynumrec-1;xx++) {
			if (document.form_choice.check[xx].checked) {
				my_image="images/maps_"+mijn_tabel[xx]+".gif"
				teller=xx
			}
			else {
				my_image="images/maps_leeg.gif"
			}

			//images[0] is de achtergrond
			//images[1] is de schaalbar
			//images[2] is de legenda
	
//			alert(xx+" "+mynumrec+my_image)
//			document.images[xx+3].src=my_image
			document.images[xx+2].src=my_image
			
		}


		// de legenda erbij: op twee manieren, of de laatst aangeklikte of de onderste

 		//ook de verwijzing in de legenda nog even netjes zetten
 		
		legenda_image="images/legenda_leeg.gif"		
		legenda_link="javascript:void(0)"

		
		//laat de legenda zien van de laatst aangevinkte
		if (id!=null) {
			if (document.form_choice.check[id].checked) {
		 		legenda_image="images/legenda_"+mijn_tabel[id]+".gif"
		 		legenda_link=mijn_link[id]
				doorklik_id=id
			}
			else {
				//laat de legenda zien van het onderste aangevinkte 
				if (teller!=-1) {
					legenda_image="images/legenda_"+mijn_tabel[teller]+".gif"
					legenda_link=mijn_link[teller]
					doorklik_id=teller
				}
			}
		}
		else {
			//laat de legenda zien van het onderste aangevinkte 
			if (teller!=-1) {
				legenda_image="images/legenda_"+mijn_tabel[teller]+".gif"
				legenda_link=mijn_link[teller]
				doorklik_id=teller
			}
		}
		
		document.images[0].src=legenda_image

//		document.links[33].href=legenda_link
//	alert("hier"+doorklik_id)

//		alert("test "+doorklik_id)
		set_verwijzing(doorklik_id)
		
}

//radioverandering voor de linker mapframe
function change_radio() {
		//alert("changing radio")
		if (document.form_check.radio[0].checked) {
			my_image="images/maps0.jpg"
		}
		else if (document.form_check.radio[1].checked) {
			my_image="images/maps1.jpg"
		}
		else if (document.form_check.radio[2].checked) {
			my_image="images/maps3.jpg"
		}
		else if (document.form_check.radio[3].checked) {
			my_image="images/maps2.jpg"
		}
		else if (document.form_check.radio[4].checked) {
			my_image="images/maps4.jpg"
		}
		document.images[1].src=my_image

}

//doorklikacties instellen
function set_verwijzing(mynum) {

//	alert(doorklik_id)

//      190 shapes benoemd....eventueel wijzigen wanneer aantal shapes wijzigen, let op 
//	een paar weggegooid op de plek van de legenda....
	numshapes=1267

	//dit duurt behoorlijk lang voor java.....hierdoor is het wachten op het klikken...
	//beter alleen de shapes wijzigen die hieronder benoemd zijn....
//	for (xx=1; xx<=numshapes;xx++) {
//		document.links[xx].href="javascript:void(0)"
//	}
//	alert(doorklik_id)

	//LET OP: afhankelijk van aantal links in het menu van de pagina!!!!!!
	mystartlink=33

	document.links[mystartlink].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=1')"
	if (mynum==3) {

		document.links[mystartlink+1117].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=1')"
		document.links[mystartlink+1159].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=50')"
		document.links[mystartlink+1182].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=76')"
		document.links[mystartlink+1176].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=77')"
		document.links[mystartlink+1156].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=65')"
		document.links[mystartlink+1070].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=48')"
		document.links[mystartlink+828].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=55')"
		document.links[mystartlink+829].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=34')"
		document.links[mystartlink+747].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=79')"
		document.links[mystartlink+622].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=87')"
		document.links[mystartlink+590].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=51')"
		document.links[mystartlink+620].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=88')"
		document.links[mystartlink+661].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=64')"
		document.links[mystartlink+541].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=66')"
		document.links[mystartlink+13].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=22')"
		document.links[mystartlink+17].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=15')"
		document.links[mystartlink+19].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=16')"
		document.links[mystartlink+25].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=44')"
		document.links[mystartlink+22].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=75')"
		document.links[mystartlink+21].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=59')"
		document.links[mystartlink+26].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=9')"
		document.links[mystartlink+739].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=92')"
		document.links[mystartlink+701].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=69')"
		document.links[mystartlink+700].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=89')"
		document.links[mystartlink+575].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=82')"
		document.links[mystartlink+613].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=72')"
		document.links[mystartlink+445].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=24')"
		document.links[mystartlink+483].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=40')"
		document.links[mystartlink+402].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=0')"
		document.links[mystartlink+322].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=43')"
		document.links[mystartlink+365].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=78')"
		document.links[mystartlink+405].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=85')"
		document.links[mystartlink+283].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=74')"
		document.links[mystartlink+286].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=95')"
		document.links[mystartlink+683].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=68')"
		document.links[mystartlink+888].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=83')"
		document.links[mystartlink+1007].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=63')"
		document.links[mystartlink+930].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=84')"
		document.links[mystartlink+1012].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=47')"
		document.links[mystartlink+1015].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=80')"
		document.links[mystartlink+1058].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=31')"
		document.links[mystartlink+1060].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=67')"
		document.links[mystartlink+1255].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=70')"
		document.links[mystartlink+1252].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=90')"
		document.links[mystartlink+1232].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=71')"
		document.links[mystartlink+1231].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=81')"
		document.links[mystartlink+1230].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=60')"
		document.links[mystartlink+1210].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=90')"
		document.links[mystartlink+1189].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=61')"
		document.links[mystartlink+1207].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=93')"
		document.links[mystartlink+765].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=27')"
		document.links[mystartlink+568].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=8')"
		document.links[mystartlink+932].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=35')"
		document.links[mystartlink+972].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=25')"
		document.links[mystartlink+652].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=54')"
		document.links[mystartlink+893].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=3')"
		document.links[mystartlink+1054].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=5')"
		document.links[mystartlink+614].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=38')"
		document.links[mystartlink+974].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=31')"
		document.links[mystartlink+534].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=4')"
		document.links[mystartlink+655].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=23')"
		document.links[mystartlink+576].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=28')"
		document.links[mystartlink+1016].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=32')"
		document.links[mystartlink+658].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=29')"
		document.links[mystartlink+1098].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=36')"
		document.links[mystartlink+1018].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=53')"
		document.links[mystartlink+779].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=20')"
		document.links[mystartlink+819].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=33')"
		document.links[mystartlink+979].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=49')"
		document.links[mystartlink+499].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=42')"
		document.links[mystartlink+1059].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=45')"
		document.links[mystartlink+740].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=12')"
		document.links[mystartlink+1121].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=39')"
		document.links[mystartlink+1101].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=13')"
		document.links[mystartlink+1061].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=11')"
		document.links[mystartlink+621].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=10')"
		document.links[mystartlink+542].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=6')"
		document.links[mystartlink+582].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=18')"
		document.links[mystartlink+743].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=30')"
		document.links[mystartlink+663].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=37')"
		document.links[mystartlink+1023].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=17')"
		document.links[mystartlink+1145].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=19')"
		document.links[mystartlink+1063].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=56')"
		document.links[mystartlink+703].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=12')"
		document.links[mystartlink+704].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=14')"
		document.links[mystartlink+1147].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=7')"
		document.links[mystartlink+786].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=26')"
		document.links[mystartlink+507].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=52')"
		document.links[mystartlink+868].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=2')"
		document.links[mystartlink+1134].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=46')"
		document.links[mystartlink+995].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=21')"
		document.links[mystartlink+24].href="javascript:openPopupInfo('boerderij_detail.php?shape_row=57')"

	}


//oude methode, elke box een eigen referentie....

	if (mynum==4) {
		document.links[mystartlink+205].href="javascript:openPopupInfo('monument_detail.php?shape_row=1')"
		document.links[mystartlink+445].href="javascript:openPopupInfo('monument_detail.php?shape_row=2')"
		document.links[mystartlink+648].href="javascript:openPopupInfo('monument_detail.php?shape_row=3')"
		document.links[mystartlink+652].href="javascript:openPopupInfo('monument_detail.php?shape_row=4')"
		document.links[mystartlink+621].href="javascript:openPopupInfo('monument_detail.php?shape_row=5')"
		document.links[mystartlink+1121].href="javascript:openPopupInfo('monument_detail.php?shape_row=6')"
		document.links[mystartlink+1101].href="javascript:openPopupInfo('monument_detail.php?shape_row=7')"
		document.links[mystartlink+976].href="javascript:openPopupInfo('monument_detail.php?shape_row=8')"
		document.links[mystartlink+1060].href="javascript:openPopupInfo('monument_detail.php?shape_row=9')"
		document.links[mystartlink+717].href="javascript:openPopupInfo('monument_detail.php?shape_row=10')"
		document.links[mystartlink+908].href="javascript:openPopupInfo('monument_detail.php?shape_row=11')"
		document.links[mystartlink+907].href="javascript:openPopupInfo('monument_detail.php?shape_row=12')"
		document.links[mystartlink+950].href="javascript:openPopupInfo('monument_detail.php?shape_row=13')"
		document.links[mystartlink+909].href="javascript:openPopupInfo('monument_detail.php?shape_row=14')"
		document.links[mystartlink+869].href="javascript:openPopupInfo('monument_detail.php?shape_row=15')"
		document.links[mystartlink+868].href="javascript:openPopupInfo('monument_detail.php?shape_row=16')"
		document.links[mystartlink+867].href="javascript:openPopupInfo('monument_detail.php?shape_row=17')"
		document.links[mystartlink+789].href="javascript:openPopupInfo('monument_detail.php?shape_row=18')"
	}

	if (mynum==2) {
		document.links[mystartlink+652].href="accomodatie_camping.htm"
		document.links[mystartlink+1023].href="kerk.htm"
		document.links[mystartlink+1101].href="accomodatie_bb_domushorst.htm"
		document.links[mystartlink+908].href="locatie_stroot.htm"
		document.links[mystartlink+982].href="school.htm"
		document.links[mystartlink+663].href="http://www.oorbeck.nl/index_main.php"
		document.links[mystartlink+986].href="accomodatie_bb_landhuistwekkelo.htm"
	}

	if (mynum==6) {
		document.links[mystartlink+624].href="javascript:openPopup('panorama_overbeek.htm')"
		document.links[mystartlink+820].href="javascript:openPopup('panorama_es.htm')"
		document.links[mystartlink+934].href="javascript:openPopup('panorama_kotman.htm')"
		document.links[mystartlink+1023].href="javascript:openPopup('panorama_johanneskerk.htm')"
	}



} 


