function checkAll(theForm) 
{
	for (i=0,n=theForm.elements.length;i<n;i++)
		if (theForm.elements[i].name.indexOf('cb_') != -1)
		{
			if (theForm.cb_ZoekWaarinAlles.checked)
				theForm.elements[i].checked = true;
			else
				theForm.elements[i].checked = false;
		}
}
	
function OpenBestelling(bestellingurl)
{
	var detailpagina = window.open(bestellingurl,'VerkennerScherm','height=500,width=790,top=5,left=5,channelmode=no,directories=yes,status=yes,toolbar=yes,menubar=yes,location=yes,resizable=yes,scrollbars=yes');
	detailpagina.focus();
}
		
function OpenZoeken()
{
	if(zoeken == "eenvoudig")
	{
		if(navigator.appName == "Netscape" || navigator.appVersion.indexOf('Mac') != -1)
			window.location.href="UitgebreidZoeken.aspx";
		else
			window.frames.parent.location.href="UitgebreidZoeken.aspx";
	}
	else
	{
		window.location.href="UitgebreidZoeken.aspx";
	}
}
		
var infownd = null;
function ShowInfo(url)
{ 
	if (infownd)
	{  
		if (true!=infownd.closed)
		{ 
			infownd.close();
		}
	}
	infownd = window.open(url,'InfoScherm',"left=15,top=15,height=400,width=540,channelmode=no,directories=no,status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes");
	infownd.focus();
}

var wndmelding =null;
function ShowMelding(url)
{ 
	if (wndmelding)
	{  
		if (true!=wndmelding.closed)
		{ 
			wndmelding.close();
		}
	}
	wndmelding = window.open(url,'Meldingen',"left=40,top=45,height=400,width=600,channelmode=no,directories=no,status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes");
	wndmelding.focus();
}

var imagewnd = null;
function ShowImage(url)
{ 
	if (imagewnd)
	{  
		if (true!=imagewnd.closed)
		{ 
			imagewnd.close();
		}
	}
	imagewnd = window.open(url,'InfoScherm',"left=15,top=15,height=500,width=500,channelmode=no,directories=no,status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes");
	imagewnd.focus();
}
		
var wndzoekvraag = null;
function ShowZoekvraag(url)
{
	if (wndzoekvraag)
	{  
		if (true!=wndzoekvraag.closed)
		{ 
			wndzoekvraag.close();
		}
	}
	wndzoekvraag = window.open(url,'Zoekvraag',"left=50,top=55,height=300,width=610,channelmode=no,directories=no,status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes");
	wndzoekvraag.focus();
}		

function RefreshOpener()
{
	if(window.opener.document.title == "Status zoekopdracht")
	{
		window.opener.location.href = "StatusZoekopdracht.aspx";
	}
}

function ReadVariabelen(statusZoekopdrachtArray, statusSegmenten)
{
	//per zoekopdracht vullen
	if(window.document.all('statusZoekopdrachtSpan5'))
	{
		window.document.statusZoekopdrachtImage.width = ((statusZoekopdrachtArray[0]*1.2)-4);
		window.document.all('statusZoekopdrachtSpan1').innerHTML = statusZoekopdrachtArray[0] + '%';
		window.document.all('statusZoekopdrachtSpan2').innerHTML = statusZoekopdrachtArray[2];
		//document.all('statusZoekopdrachtSpan3').innerHTML = statusZoekopdrachtArray[3];
			
		if(statusZoekopdrachtArray[1] == 'True')
		{
			window.document.all('statusZoekopdrachtSpan4').innerHTML = 'gereed';
			window.document.all('statusZoekopdrachtSpan0').innerHTML = 'gereed met zoeken!';
		}
		else 
		{
			window.document.all('statusZoekopdrachtSpan4').innerHTML = 'bezig...';	
		}
				
		window.document.all('statusZoekopdrachtSpan5').innerHTML = statusZoekopdrachtArray[4];
	}
	
	//per segment vullen
	if (statusSegmenten)
	{
		for(var i = 0; i < statusSegmenten.length; i++)
		{
			if(document.all('DivRow' + i + 'Col4'))
			{
				window.document.all('DivRow' + i + 'Col0').innerHTML = statusSegmenten[i][0]; // collectie
				eval('window.document.image' + i + '.width = ((statusSegmenten[i][4]*1.2)-4)');
				window.document.all('DivRow' + i + 'Col1').innerHTML = statusSegmenten[i][4] + '%'; // percentage
				window.document.all('DivRow' + i + 'Col2').innerHTML = statusSegmenten[i][2]; // ontvangen
				
				if(statusSegmenten[i][7] == 'True')
					window.document.all('DivRow' + i + 'Col2').innerHTML = '>1000'; // als er teveel resultaten zijn gevonden
				
				//document.all('DivRow' + i + 'Col3').innerHTML = statusSegmenten[i][1]; // teontvangen
				window.document.all('DivRow' + i + 'Col4').innerHTML = statusSegmenten[i][3]; // gereed
						
				if(statusSegmenten[i][3] == 'True')
					//window.document.all('DivRow' + i + 'Col4').innerHTML = '<img src=\"images/img_gereed.gif\" name=\"GereedKnop'+i+'\" border=\"0\">';
					window.document.all('DivRow' + i + 'Col4').innerHTML = 'gereed';
				else
					//window.document.all('DivRow' + i + 'Col4').innerHTML = '<img src=\"images/img_nietGereed.gif\" name=\"GereedKnop'+i+'\" border=\"0\">';
					window.document.all('DivRow' + i + 'Col4').innerHTML = 'bezig...';
				
				//Werkt nog niet goed.
				/*var gereedknopIndex = 'GereedKnop'+i;
				if(statusSegmenten[i][3] == 'True')
					document[gereedknopIndex].src = parent.frames["imagecache"].document.images["gereedplaatje"].src;
				else 
					document[gereedknopIndex].src = parent.frames["imagecache"].document.images["nietgereedplaatje"].src;*/
				
				/*
				if(statusSegmenten[i][5] != '-')
						document.all('DivRow' + i + 'Col5').innerHTML = '<a onMouseOut=\"(window.status=\'Done\'); return true\" onMouseOver=\"(window.status=\'Meldingen\'); return true\" href=\"javascript:ShowMelding(\'Meldingen.aspx?segment=' +  statusSegmenten[i][5] + '\')\"><img src=\"images/btn_meldingen.gif\" border=\"0\"></a>'; // melding
				else document.all('DivRow' + i + 'Col5').innerHTML = '-';
				*/
				if(statusSegmenten[i][2] != 0)
				{
					if(statusSegmenten[i][3] == 'True')
					{
					    window.document.all('DivRow' + i + 'Col0').innerHTML = statusSegmenten[i][0]; // collectie

						//window.document.all('DivRow' + i + 'Col0').innerHTML = '<a onMouseOut=\"(window.status=\'Done\'); return true\" onMouseOver=\"(window.status=\'Resultaat\'); return true\" target=\"_parent\" href=\"ResultaatZoekopdracht.aspx?gereed=true&segmenten=' + statusSegmenten[i][6] + '&aantal=' + statusSegmenten[i][2] +'\">' + statusSegmenten[i][0] + '</a>'; // collectie link naar resultaat
						//window.document.all('DivRow' + i + 'Col6').innerHTML = '<a onMouseOut=\"(window.status=\'Done\'); return true\" onMouseOver=\"(window.status=\'Resultaat\'); return true\" target=\"_parent\" href=\"ResultaatZoekopdracht.aspx?gereed=true&segmenten=' + statusSegmenten[i][6] + '&aantal=' + statusSegmenten[i][2] +'\"><img src=\"images/btn_resultaat.gif\" alt=\"Toon Resultaat\" border=\"0\" name=\"ResultaatKnop'+i+'\"></a>' ; // resultaatlink
						window.document.all('DivRow' + i + 'Col6').innerHTML = '<a class="hyper" onMouseOut=\"(window.status=\'Done\'); return true\" onMouseOver=\"(window.status=\'Resultaat\'); return true\" target=\"_parent\" href=\"ResultaatZoekopdracht.aspx?gereed=true&segmenten=' + statusSegmenten[i][6] + '&aantal=' + statusSegmenten[i][2] +'\">Resultaat</a>' ; // resultaatlink
					}
					else {
					    window.document.all('DivRow' + i + 'Col0').innerHTML = statusSegmenten[i][0]; // collectie

						//window.document.all('DivRow' + i + 'Col0').innerHTML = '<a onMouseOut=\"(window.status=\'Done\'); return true\" onMouseOver=\"(window.status=\'Resultaat\'); return true\" target=\"_parent\" href=\"ResultaatZoekopdracht.aspx?gereed=false&segmenten=' + statusSegmenten[i][6] + '&aantal=' + statusSegmenten[i][2] +'\">' + statusSegmenten[i][0] + '</a>'; // collectie link naar resultaat
						//window.document.all('DivRow' + i + 'Col6').innerHTML = '<a onMouseOut=\"(window.status=\'Done\'); return true\" onMouseOver=\"(window.status=\'Resultaat\'); return true\" target=\"_parent\" href=\"ResultaatZoekopdracht.aspx?gereed=false&segmenten=' + statusSegmenten[i][6] + '&aantal=' + statusSegmenten[i][2] +'\"><img src=\"images/btn_resultaat.gif\" alt=\"Toon Resultaat\" border=\"0\" name=\"ResultaatKnop'+i+'\"></a>' ; // resultaatlink
						window.document.all('DivRow' + i + 'Col6').innerHTML = '<a class="hyper" onMouseOut=\"(window.status=\'Done\'); return true\" onMouseOver=\"(window.status=\'Resultaat\'); return true\" target=\"_parent\" href=\"ResultaatZoekopdracht.aspx?gereed=false&segmenten=' + statusSegmenten[i][6] + '&aantal=' + statusSegmenten[i][2] +'\">Resultaat</a>' ; // resultaatlink
					}
					//document.all('DivRow' + i + 'Col6').
				
					//var resultaatknopIndex='ResultaatKnop'+i;
					//document[resultaatknopIndex].src = parent.frames["imagecache"].document.images["resultaatplaatje"].src;
				}
				else 
				{
					if(statusSegmenten[i][7] == 'True') {
					    window.document.all('DivRow' + i + 'Col0').innerHTML = statusSegmenten[i][0]; // collectie

						//window.document.all('DivRow' + i + 'Col0').innerHTML = '<a onMouseOut=\"(window.status=\'Done\'); return true\" onMouseOver=\"(window.status=\'Meldingen\'); return true\" href=\"javascript:ShowMelding(\'Meldingen.aspx?segment=' +  statusSegmenten[i][5] + '\')\">' + statusSegmenten[i][0] + '</a>'; // collectie link naar resultaat
						//window.document.all('DivRow' + i + 'Col6').innerHTML = '<a onMouseOut=\"(window.status=\'Done\'); return true\" onMouseOver=\"(window.status=\'Meldingen\'); return true\" href=\"javascript:ShowMelding(\'Meldingen.aspx?segment=' +  statusSegmenten[i][5] + '\')\"><img src=\"images/btn_meldingen.gif\" border=\"0\"></a>' ; // resultaatlink				
						window.document.all('DivRow' + i + 'Col6').innerHTML = '<a class="hyper" onMouseOut=\"(window.status=\'Done\'); return true\" onMouseOver=\"(window.status=\'Meldingen\'); return true\" href=\"javascript:ShowMelding(\'Meldingen.aspx?segment=' +  statusSegmenten[i][5] + '\')\">Melding</a>' ; // resultaatlink	
					} else {
						window.document.all('DivRow' + i + 'Col6').innerHTML = '-' ; // resultaatlink
					}
				}
			}
		}
	}
}

function OpenHelp(pagina,bookmark,paginaNaam,niveau, hoogte, breedte)
{	
	var url = pagina;
	var querystringindex = url.indexOf("?");
	if(querystringindex != -1)
		url = url.substring(0,querystringindex);
		
	url = url.replace(".aspx",".html");
	
	var lastslashindex = url.lastIndexOf("/");
	var partone = url.substring(0,lastslashindex);
	var parttwo = url.substring(lastslashindex,url.length);
	url = partone+ "/helpsysteem/help.aspx?url="+partone+"/help&helpbestand="+parttwo;
	
	
	if (bookmark.length != 0)
		url = url+"#"+bookmark;
	
	OpenPopup(url,paginaNaam,niveau, hoogte, breedte);
}

function OpenPopup(url, paginaNaam, niveau, hoogte, breedte)
{
	var links=0;
	var boven=0;
	links+=niveau*25;
	boven+=niveau*25;
	
	wnd = window.open(url,paginaNaam,"left=" + links + ",top=" + boven + ",height=" + hoogte + ",width=" + breedte + ",channelmode=no,directories=no,status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes");
	wnd.focus();
	return true;
}

function OpenDetail(url, paginaNaam, niveau, hoogte, breedte)
{
	var links=0;
	var boven=0;
	links+=niveau*25;
	boven+=niveau*25;
	
	rExp = / /g;
	newString = new String ("%20");
	var newurl = url.replace(rExp, newString);
	
	wnd = window.open(newurl,'Detail',"left=" + links + ",top=" + boven + ",height=" + hoogte + ",width=" + breedte + ",channelmode=no,directories=no,status=yes,toolbar=yes,menubar=yes,location=yes,resizable=yes,scrollbars=yes");
	wnd.focus();
	//return true;
}

function AlertMelding(melding)
{
	if (melding != '')
		alert(melding);
}

// BEGIN functies rollover harrymeides

browser = (((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 3 )) || ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 )))
if (browser)
{
    harryVraaga = new Image(); harryVraaga.src = "images/harryvraag.gif";
	harryPleureika = new Image(); harryPleureika.src = "images/harrypleureika.gif";
	harryMunta = new Image(); harryMunta.src = "images/harrymunt.gif";
	harryMuntResultaata = new Image(); harryMuntResultaata.src = "images/harrymunt.gif";
	zoekenarchimedesa = new Image(); zoekenarchimedesa.src = "images/txt_zoekenarchimedes.gif";
	
	harryVraagb = new Image(); harryVraagb.src = "images/harryvraagMO.gif";
	harryPleureikb = new Image(); harryPleureikb.src = "images/harrypleureikaMO.gif";
	harryMuntb = new Image(); harryMuntb.src = "images/harrymuntMO.gif";
	harryMuntResultaatb = new Image(); harryMuntResultaatb.src = "images/harrymuntMO.gif";
	zoekenarchimedesb = new Image(); zoekenarchimedesb.src = "images/txt_zoekenharrymeides.gif";
}

function rollIn(imgName)
{
    if (browser)
    {
		imgFile = eval(imgName + "b.src");
        document [imgName].src = imgFile;
        if(imgName == 'harryMunt')
			rollIn('zoekenarchimedes');
    }
}

function rollOut(imgName)
{
    if (browser)
    {
        imgFile = eval(imgName + "a.src");
        document [imgName].src = imgFile;
        if(imgName == 'harryMunt')
			rollOut('zoekenarchimedes');
    }
}

// EINDE functies rollover harrymeides

