function ShowPopup(ChapterID, ChapterIDMain, ArticleID) {
  var nw = null;
	var showForm = 0;
	if(ChapterID == 'uw') {		
		showForm = 1;		
	} 
	if(ChapterID == 'reactie') {		
		showForm =2;		
	} 
	if(ChapterID == 'callmeback') {		
		showForm =3;		
	} 
	if(ChapterID == 'dllijst') {		
		showForm =5;		
	} 
	if(ChapterID == 'nbrf') {		
		showForm =6;		
	} 
	if(ChapterID == 'zoek') {		
		showForm =7;		
	} 
	if(ChapterID > 0 && ChapterIDMain== 'd' && ArticleID =='l') {
		showForm = 4;
	}

  if (isNaN(ChapterIDMain)) { ChapterIDMain = 275; }
  if (isNaN(ArticleID)) { ArticleID = 0; }
	
  args = "width=780," 
    + "height=550," 
    + "location=0," 
    + "menubar=0,"
    + "resizable=0,"
    + "scrollbars=1,"
    + "status=0," 
    + "titlebar=0,"
    + "toolbar=0,"
    + "hotkeys=0,"
    + "screenx=20,"  //NN Only
    + "screeny=20,"  //NN Only
    + "left=20,"	 //IE Only
    + "top=20"       //IE Only

	if(showForm==1) {
		nw = window.open("uwgegevens.php","",args);	
	} else if (showForm==2) {
		nw = window.open("reageren.php","",args);	
	} else if (showForm==3) {
		nw = window.open("callmeback.php","",args);	
	} else if (showForm==4) {
		nw = window.open("downloaden.php?ChapterID="+ChapterID,"",args);	
	} else if (showForm==5) {
		nw = window.open("download_list.php","",args);	
	} else if (showForm==6) {
		nw = window.open("nieuwsbrief.php","",args);	
	} else if (showForm==7) {
		nw = window.open("zoek.php","",args);	
	} else { 
    if((ArticleID=="") || (ArticleID==null))	{
			nw = window.open("show.php?ChapterID="+ChapterID+"&ChapterIDMain="+ChapterIDMain+"&ArticleID="+0,"",args);
		}	else {
			nw = window.open("show.php?ChapterID="+ChapterID+"&ChapterIDMain="+ChapterIDMain+"&ArticleID="+ArticleID,"",args);
		}
	}
	//defw.focus();
}
function loadinparent(url, closeSelf)
{
	self.opener.location = url;
	
	if (closeSelf)
	{
		self.close();
	}
}

function validateNecessaryFields(form)
{
	var idNodes = document.getElementsByTagName("input");
	
	for(var i=0; i<idNodes.length; i++)
  {
		//alert(idNodes[i].id);
		
		strRequired = idNodes[i].id.split("_");
		
		if (strRequired[1] == "True")
		{
			if (idNodes[i].value == "" || !idNodes[i].value)
			{
				//if (iLanguage == 1) // Nederlands
				//{
					alert("Niet alle verplichte velden zijn ingevuld! \n Vul het volgende veld in: '" + idNodes[i].name + "'");
				//}
				//else if (iLanguage == 2) // English
				//{
				//	alert("Not all necassary fields are filled in! \n Please fill in the following field " + idNodes[i].name);
				//}
				
				idNodes[i].focus;
				return false;
			}
		}
  }

	return true;
}

