////////////////////////////
// switch content of layer
//
function WriteLayer(ID1, ID2, parentID, level, nummer, titles, subtitles, date, text, images, count) {
//////////////////////
// archive content
/////////////////////

	/////// LEVEL 1
	///////////////////////
	// left colum	
	if (level == 1){
		if(nummer == 0){
			txt_L = ("<h1>"+titles[nummer]+"<\/h1>")
			var arLen= subtitles.length;
			for ( var i=arLen-1, len=-1; i>len; --i ){
				txt_L = txt_L.concat("<a class=\"archive\" href=\"javascript:WriteLayer(\'archive\', \'txt\', null, 2, " + [i] + ", LINKS, N_TITLE, N_DATE, N_CONTENT, N_IMAGE, 0)\">"+ subtitles[i] + "<\/a><span class=\"dateAgenda\"> "+ date[i] +" <\/span><br>")
			}
			txt_L = txt_L.concat("<br><h1><\/h1>")	
		}
		if(nummer == 1){
			txt_L = ("<h1>"+titles[nummer]+"<\/h1>")
			var arLen= subtitles.length;
			for ( var i=arLen-1, len=-1; i>len; --i ){
				txt_L = txt_L.concat("<a class=\"archive\" href=\"javascript:WriteLayer(\'archive\', \'txt\', null, 2, " + [i] + ", LINKS, A_TITLE, A_DATE, A_CONTENT, A_IMAGE, 1)\">"+ subtitles[i] + "<\/a><span class=\"dateAgenda\"> "+ date[i] +" <\/span><br>")
			}
			txt_L = txt_L.concat("<br><h1><\/h1>")	
		}
		if(nummer == 2){
			txt_L = ("<h1>"+titles[nummer]+"<\/h1>")
			var arLen= subtitles.length;
			//for (Initialization statements; Condition; Updation statements)
			//for (var x = 1; x <= 10; x++)
			for ( var i=0, len=arLen-1; i<=len; i++ ){
				txt_L = txt_L.concat("<a class=\"archive\" href=\"javascript:WriteLayer(\'archive\', \'txt\', null, 2, " + [i] + ", LINKS, P_TITLE, P_DATE, P_CONTENT, P_IMAGE, 2)\">"+ subtitles[i] + "<\/a><span class=\"dateAgenda\"> "+ date[i] +" <\/span><br>")
			}
			txt_L = txt_L.concat("<br><h1><\/h1>")	
		}
		if(nummer == 3){
			txt_L = ("<h1>"+titles[nummer]+"<\/h1>")
			txt_L = txt_L.concat("<p><a class=\"image\" href=\"javascript:dirtypop('Images\/fab4.jpg');\"><img src=\"Images\/fab4.jpg\" id=\"imageSmall\"></a> <a class=\"image\" href=\"javascript:dirtypop('Images\/fab3.jpg');\"><img src=\"Images\/fab3.jpg\" id=\"imageSmall\"><\/a><\/p>")		
			//txt_L = txt_L.concat("<p>If you want to know more about De Fabriek downloud our pdf booklet! <br> <a class=\"mail\" href=\"files\/de_fabriek.pdf\" target=\"_blank\">booklet download<\/a><\/p>")	
			txt_L = txt_L.concat("<h1><\/h1>")	
		}
		if(nummer == 4){
			txt_L = ("<h1>"+titles[nummer]+"<\/h1>")
			txt_L = txt_L.concat("<p><a class=\"image\" href=\"javascript:dirtypop('Images\/fab2.jpg');\"><img src=\"Images\/fab2.jpg\" id=\"imageSmall\"><\/a><\/p>")		
			txt_L = txt_L.concat("<h1><\/h1>")	
		}
		if(nummer == 5){
			txt_L = ("<h1>Movie Nights<\/h1>")
			txt_L = txt_L.concat("<h4>CONCEPT <\/h4><p><span class=\"dateAgenda\"> "+ M_DATE[0] +"<\/span><br><br>" + M_CONTENT[0] +"<\/p>")		
			txt_L = txt_L.concat("<a class=\"archive\" href=\"javascript:WriteLayer(\'archive\', \'txt\', null, 2, 1, LINKS, M_TITLE, A_DATE, A_CONTENT, A_IMAGE, 2008)\">movies of 2008<\/a><br>")
			txt_L = txt_L.concat("<a class=\"archive\" href=\"javascript:WriteLayer(\'archive\', \'txt\', null, 2, 1, LINKS, M_TITLE, A_DATE, A_CONTENT, A_IMAGE, 2007)\">movies of 2007<\/a><br>")
			txt_L = txt_L.concat("<a class=\"archive\" href=\"javascript:WriteLayer(\'archive\', \'txt\', null, 2, 1, LINKS, M_TITLE, A_DATE, A_CONTENT, A_IMAGE, 2006)\">movies of 2006<\/a><br><br>")
		
			txt_L = txt_L.concat("<h1><\/h1>")
			
		}


	}
	/////// LEVEL 1
	///////////////////////////////
	// right colum
	
	if (level == 1){
		if(nummer == 0){
			var total = subtitles.length -1;
			if (images[total].length > 0)
			   {
				txt_R = ("<h4>" + subtitles[total] + " <span class=\"dateAgenda\"> " + date[total] +"<\/span><\/h4><p> <a class=\"image\" href=\"javascript:dirtypop('Images\/" + images[total] + "');\"><img src=\"Images\/" + images[total] + "\" id=\"imageSmall\"><br></a>" + text[total] + "<\/p>")
			   }
			else
			{
				txt_R = ("<h4>" + subtitles[total] + " <span class=\"dateAgenda\"> " + date[total] +"<\/span><\/h4><p>" + text[total] + "<\/p>")

			}

			txt_R = txt_R.concat("<h1><\/h1>")
		}


		if(nummer == 1){
			var total = subtitles.length -1;
			if (images[total].length > 0)
			   {
				txt_R = ("<h4>" + subtitles[total] + " <span class=\"dateAgenda\"> "+ date[total] +"<\/span><\/h4><p><a class=\"image\" href=\"javascript:dirtypop('Images\/" + images[total] + "');\"><img src=\"Images\/" + images[total] + "\" id=\"imageSmall\"><br></a>" + text[total] + "<\/p>")
			   }
			else
			{
				txt_R = ("<h4>" + subtitles[total] + " <span class=\"dateAgenda\"> "+ date[total] +"<\/span><\/h4><p>" + text[total] + "<\/p>")

			}

			txt_R = txt_R.concat("<h1><\/h1>")
		}
		
		
		if(nummer == 2){
			txt_R = ("<h1><br><\/h1><p><\/p>")
			txt_R = txt_R.concat("<h1><\/h1>")
		}
		
		
		
		
		if(nummer == 3){
			txt_R = ("<h4>De Fabriek<\/h4><p>"+ ABOUT[1] +"<\/p>")	
			txt_R = txt_R.concat("<h1><\/h1>")
		}
		
		
		
		if(nummer == 4){
			txt_R = ("<h4>" + CONTACT[0] + " <\/h4><p>" + CONTACT[1] + " <br>" + CONTACT[2] + " <br>" + CONTACT[3] + " <br><br>mail: <a href=\"mailto:" + CONTACT[4] + " \">" + CONTACT[4] + " <\/a><\/p>")		
			txt_R = txt_R.concat("<h1><\/h1>")
		}
		
		if(nummer == 5){
			txt_R = ("<h4>Past nights 2008<\/h4><p>")
			
			listLen = M_LIST.length -1
			for (i = 0; i <= M_LIST[listLen].length-1; i=i+2){
				txt_R = txt_R.concat("<span class=\"movieList\"> " + M_LIST[listLen][i] + "<\/span> " + M_LIST[listLen][i+1] + "<br>")		
				
			}
			txt_R = txt_R.concat("<\/p><h1><\/h1>")
		}
	
	}
	

	
	
	
	
	
	
	/////// LEVEL 2
	///////////////////////////////
	// right colum
	
	if (level == 2){
		if(count == 0){
			if (N_TITLE[nummer].length > 0){
				txt_R = ("<h4>" + N_TITLE[nummer] + "")
			}
			if (N_DATE[nummer].length > 0){
				txt_R = txt_R.concat("<span class=\"dateAgenda\"> "+ N_DATE[nummer] +"<\/span><\/h4>")
			}
			if (N_IMAGE[nummer].length > 0){
				txt_R = txt_R.concat("<p><a class=\"image\" href=\"javascript:dirtypop('Images\/" + N_IMAGE[nummer] + "');\"><img src=\"Images\/" + N_IMAGE[nummer] + "\" id=\"imageSmall\"></a><\/p>")
			}
			if (N_CONTENT[nummer].length > 0){
				txt_R = txt_R.concat("<br><p>"+ N_CONTENT[nummer] +"<\/p>")
			}
			
			txt_R = txt_R.concat("<h1><\/h1>")
		
		}


		if(count == 1){
			txt_R = ("<h4>" + A_TITLE[nummer] + "<span class=\"dateAgenda\"> "+ A_DATE[nummer] +"<\/span><\/h4> <p> <a class=\"image\" href=\"javascript:dirtypop('Images\/" + A_IMAGE[nummer] + "');\"><img src=\"Images\/" + A_IMAGE[nummer] + "\" id=\"imageSmall\"><br></a>" + A_CONTENT[nummer] + "<\/p>")
			txt_R = txt_R.concat("<h1><\/h1>")
		}


		if(count == 2){
			if (P_TITLE[nummer].length > 0){
				txt_R = ("<h4>" + P_TITLE[nummer] + "<\/h4><p>")
			}
			if (P_DATE[nummer].length > 0){
				txt_R = txt_R.concat("<span class=\"dateAgenda\"> " + P_DATE[nummer] +"<\/span><br>")
			}
			if (P_IMAGE[nummer].length > 0){
				txt_R = txt_R.concat("<a class=\"image\" href=\"javascript:dirtypop('Images\/" + P_IMAGE[nummer] + "');\"><img src=\"Images\/" + P_IMAGE[nummer] + "\" id=\"imageSmall\"></a>")
			}
			if (P_CONTENT[nummer].length > 0){
				txt_R = txt_R.concat(""+ P_CONTENT[nummer] +"<\/p>")
			}
			if (P_MAIL[nummer].length > 0){
				txt_R = txt_R.concat("<p><a class=\"mail\" href=\"mailto:"+P_MAIL[nummer]+"\">"+ P_MAIL[nummer] + "</a><br>")
			}
			if (P_WEBSITE[nummer].length > 0){
				txt_R = txt_R.concat("<a class=\"mail\" href=\"" + P_WEBSITE[nummer] + "\" target=\"_blank\">" + P_WEBSITE[nummer] + " </a><\/p>")
			}
			
			txt_R = txt_R.concat("<h1><\/h1>")
		
		}


		if(count == 2008){
			txt_R = ("<h4>Past nights 2008<\/h4><p>")
			for (i = 0; i <= M_LIST[2].length-1; i=i+2){
				txt_R = txt_R.concat("<span class=\"movieList\"> " + M_LIST[2][i] + "<\/span> " + M_LIST[2][i+1] + "<br>")		

			}
			txt_R = txt_R.concat("<\/p><h1><\/h1>")
		}


		if(count == 2007){
			txt_R = ("<h4>Past nights 2007<\/h4><p>")
			for (i = 0; i <= M_LIST[1].length-1; i=i+2){
				txt_R = txt_R.concat("<span class=\"movieList\"> " + M_LIST[1][i] + "<\/span> " + M_LIST[1][i+1] + "<br>")		

			}
			txt_R = txt_R.concat("<\/p><h1><\/h1>")
		}

		if(count == 2006){
			txt_R = ("<h4>Past nights 2006<\/h4><p>")
			for (i = 0; i <= M_LIST[0].length-1; i=i+2){
				txt_R = txt_R.concat("<span class=\"movieList\"> " + M_LIST[0][i] + "<\/span> " + M_LIST[0][i+1] + "<br>")		

			}
			txt_R = txt_R.concat("<\/p><h1><\/h1>")
		}

	}
	
///////////////////
// picking the right content
//////////////////
	//
	
	
	if (document.layers) {
		var oLayer = (parentID)? eval('document.' + parentID + '.document.' + ID1 + '.document') : document.layers[ID1].document;
		oLayer.open();
		oLayer.write(txt_L);
		oLayer.close();
		document.write(parentID)

	}
	else if (document.all) document.all[ID1].innerHTML = txt_L
	else if (parseInt(navigator.appVersion)>=5&&navigator.appName=="Netscape") {
		document.getElementById(ID1).innerHTML = txt_L;
	}
	
	if (document.layers) {
		var oLayer = (parentID)? eval('document.' + parentID + '.document.' + ID2 + '.document') : document.layers[ID2].document;
		oLayer.open();
		oLayer.write(txt_R);
		oLayer.close();
		document.write(parentID)

	}
	else if (document.all) document.all[ID2].innerHTML = txt_R
	else if (parseInt(navigator.appVersion)>=5&&navigator.appName=="Netscape") {
		document.getElementById(ID2).innerHTML = txt_R;
	}
}


