function line (content, style, link, cl) {  
//	alert("LINE: "+content);

	
	if (style == null) style = "p";
	if (link == null) link = "";
	if (cl == null) cl = "";
	if (link=="") {
		linkstart=""; 
		linkend="";
	} else {
		linkstart="<a href=\""
			+ link 
			+ ".html\""
			+ ">"
		linkend="</a>";
	}


	if (cl=="") {
		cl="";
	} else {
		cl = " class=\"" + cl + "\""; ;
	}

	stylestart = "<" + style + cl + ">";
	styleend="</" + style + ">";

//	alert(stylestart + linkstart + content + linkend + styleend);
	document.write(stylestart + linkstart + content + linkend + styleend);
/* */
}

var menuList = [

	["JERICHAU DESIGN", "h1", "index"],
	["TEXTILE TECHNIQUES AND MATERIALS", "p"],

	["DEVELOPMENT", "h2"],
	["NET_FOAMING", "p", "netfoaming"],
	["CONCRETE", "p", "concrete"],
	["ACOUSTIC", "p", "acoustic"],
	["WINDING", "p", "winding"],
	["KNOTTING", "p", "knotting"],
	["SEWING", "p", "sewing"],
	["WEAVING", "p", "weaving"],

	["RESEARCH", "h2"],
	["MATERIALS", "p", "materials"],
	["TECHNIQUE", "p", "technique"],
	["INSPIRATION", "p", "inspiration"],

	["CONTACT", "h2"],
	["BODIL JERICHAU", "p", "bodiljerichau"]
/* */
];
	
function menuItem (no, page) {
//	alert("no = " + no + " / page = " + page);

	current = menuList[no];
	if (current.length < 2) style = ""; else style = current[1];
	if (current.length < 3) link = ""; else link = current[2];
	cl = "";

	if (current[0] == page) { //menupunktet til siden selv
		link = "";
		cl = "selected";
	};
	
//	alert(current[0]+"/"+style+"/"+link+"/"+cl+"/"+page);
	line(current[0], style, link, cl);
}


function asLink(txt, lnk) {
	return "<a href='" + lnk + "' target='_blank'>" + txt + "</a>";
}

function wwwflindt() {
	return "<br>See also " + asLink("Flindt Design", "http:/" + "/www.flindtdesign.dk");
}

function jesperk() {
	return "<br>See also " + asLink("Jesper K Thomsen", "http:/" + "/www.jesperkthomsen.dk");
}


function menu (pg) {
	//alert("MENU: length = " + menuList.length);

	if (pg == null) pg = "";
	if (pg == "") pg = menuList[0][0];
//	alert("MENU: pg = " + pg);
	for (i = 0; i < menuList.length; i++) {
		menuItem(i, pg);
	};
//	alert("MENU: slut");
}

var list;
var listIndex;

function changeImage(delta) {
//	alert("changeImage 1: listIndex="+listIndex+" length="+list.length + " delta="+delta);

	listIndex = listIndex + delta;
	if (listIndex==list.length) listIndex = 0;
	if (listIndex==(-1)) listIndex = list.length-1;

	pic = list[listIndex];
	document.getElementById('billed').src=pic[0];
//	document.getElementById('billed').width=pic[1];
//	document.getElementById('billed').height=pic[2];
	document.getElementById('tekst').innerHTML=pic[3];
	//.firstChild.nodeValue
}


function billede(side) {
//	alert ("I billede");
	
	document.write("<p class=\"pile\">");
	if (list.length>1) {
		
//		document.write("<a onclick=\"changeImage(-1)\" href=\"#\">&lt</a>");
		document.write("<a href=\"#\" onclick=\"changeImage(-1)\">");
		document.write("<img name='vpil' src='pil-v-graa.jpg' witdh='30' height='30'"
		+" onmouseover=\"document.vpil.src='pil-v-orange.jpg'\""
		+" onmouseout=\"document.vpil.src='pil-v-graa.jpg'\">"
		);
		document.write("</a>");

		document.write("&nbsp;");

//		document.write("<a onclick=\"changeImage(+1)\" href=\"#\">&gt</a>");
		document.write("<a onclick=\"changeImage(+1)\" href=\"#\">");
		document.write("<img name='hpil' src='pil-h-graa.jpg' witdh='30' height='30'"
		+" onmouseover=\"document.hpil.src='pil-h-orange.jpg'\""
		+" onmouseout=\"document.hpil.src='pil-h-graa.jpg'\">"
		);
		document.write("</a>");
	} else { // Forsiden ...
		document.write("<div id='tommepile'>&nbsp;</div>");
	}
	document.write("</p>");

	btxt ="Billedtekst ...";

	document.write("<img id=\"billed\">");

	line(side, "h3");

	document.write("<p class=\"billedtekst\" id=\"tekst\">");
	document.write("&nbsp;");
	document.write("</p>");

	listIndex = 0;
	changeImage(0);
}

function celle (side) {
//	alert ("I celle");

	document.write("<td style=\" vertical-align:top; margin-top:0\">");

	menu(side);

	document.write("</td><td>");

	billede (side);

	document.write("</td>");
}

function tabel (side, themeList) {
//	alert ("I tabel");

	document.title = "BODIL JERICHAU - " + side;
	document.write ("<table class='center' border='0'>");
	document.write ("<tr>");

	list = themeList;
	celle(side);	

	document.write ("</tr>");
	document.write ("</table>");

}
	
		

		






