var active = "";
var subactive = "";

var menu = new Array();
var submenu = new Array();

var root = "";

function CreateMenu(){
	for (var i = 0; i < menu.length; i++){
		if (menu[i] != null){
			name = menu[i].split(",")[0];
			url = menu[i].split(",")[1];
			cssClass = (name == active)?"menu_active":"menu"
			document.write("<td><img src=\""+root+"layout/pixel.gif\" width=\"20\" height=\"1\"></td><td align=center nowrap><a href='"+root+"" + url + "' class=" + cssClass + ">" + name + "</a></td>");
		}
	}
	document.write("<td width=\"100%\"></td>")
	document.write("<td><img src=\""+root+"layout/pixel.gif\" width=\"10\" height=\"1\" border=\"0\"></td>")
	document.write("<td><a href=\""+root+"index.htm\"><img src=\""+root+"layout/home.gif\" width=\"11\" height=\"14\" alt=\"Home\" border=\"0\"></a></td>")
	document.write("<td><img src=\""+root+"layout/pixel.gif\" width=\"10\" height=\"1\" border=\"0\"></td>")
	document.write("<td><a href=\"mailto:info@aluboot.nl\"><img src=\""+root+"layout/mail.gif\" width=\"18\" height=\"13\" alt=\"E-mail\" border=\"0\"></a></td>")
	document.write("<td><img src=\""+root+"layout/pixel.gif\" width=\"10\" height=\"1\" border=\"0\"></td>")
}


function CreateSubMenu(){
	document.write("<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" class=\"border\">")
	document.write("	<tr>")
	document.write("		<td class=\"boxheader\">" + active + "</td>")
	document.write("	</tr>")
	document.write("	<tr>")
	document.write("		<td height=\"5\"><table width=\"160\"></table></td>")
	document.write("	</tr>")

	for (var i = 0; i < submenu.length; i++){
		if (submenu[i] != null){
			name = submenu[i].split(",")[0];
			url = submenu[i].split(",")[1];
			cssClass = (name == subactive)?"submenu_active":"submenu"
			jscript = (name == subactive)?"":"onmouseover=\"changeBg(this,'#7189B9')\" onmouseout=\"changeBg(this,'')\""
			document.write("<tr><td class=" + cssClass + " " + jscript + "><a href=\"" + url + "\" class=\"submenulink\" width=\"100%\">" + name + "</a></td></tr>")
		}
	}
	document.write("	<tr>")
	document.write("		<td height=\"10\"></td>")
	document.write("	</tr>")
	document.write("</table>")
}

function changeBg(obj, color){
	obj.style.backgroundColor=color
}

function CreateFooter(){
	document.write("<a href=\""+root+"aluboot.htm\" class=\"footermenu\">Aluboot BV - Oosterstrand 6a - 8713JS Hindeloopen </a> <span style=\"color:#7189B9;\">|</span> About..<a href=\""+root+"nl-site/index-nl.htm\" class=\"footermenu\">.</a> <span style=\"color:#7189B9;\">|</span> <span style=\"color:#7189B9;\"> ©2010 Aluboot BV </span>")
}

function CreateImage(image){
	image = image.split(";");
	title = image[0];
	url = image[1];
	image = image[2];
	a_begin = ""
	a_close = ""
	if (url != null && url != ""){
		a_begin = "<a href=\"" + root + "" + url + "\" class=\"menu_active\">"
		a_close = "</a>"
	}
	document.write("<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" class=\"border\"><tr><td class=\"boxheader\">" + a_begin + "" + title + "" + a_close + "</td></tr><tr><td>" + a_begin + "<img src=\"" + root + image + "\" border=\"0\">" + a_close + "</td></tr></table>");
}

function CreateText(text){
	text = text.split(";");
	title = text[0];
	url = text[1];
	text = text[2];
	a_begin = ""
	a_close = ""
	if (url != null && url != ""){
		a_begin = "<a href=\"" + root + "" + url + "\" class=\"menu_active\">"
		a_close = "</a>"
	}
	document.write("<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" class=\"border\"><tr><td class=\"boxheader\">" + a_begin + "" + title + "" + a_close + "</td></tr><tr><td class=\"box\">" + text + "</td></tr></table>");
}

function CreateList(list){
	title = list[0];
	document.write("<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" class=\"border\"><tr><td class=\"boxheader\">" + title + "</td></tr><tr><td class=\"box\">");
	for (var i = 1; i < list.length; i++){
		if (list[i] != null){
			title = list[i].split(",")[0];
			url = list[i].split(",")[1];
			target = "";
			if (url.indexOf("http:") > -1)
				target = " target=\"_new\""
			else
				url = root + url
			document.write("<li><a href=\"" + url + "\" " + target + ">" + title + "</a></li>");
		}
	}
	document.write("</td></tr></table>");
}

var image = new Array();
var count = 0;

function PlayMovie(){
	count = (count > image.length-2)?0:count+1;
	document.images["img"].filters.blendTrans.Apply();
	document.images["img"].src = image[count];
	document.images["img"].filters.blendTrans.Play();
	setTimeout("PlayMovie()",4000)
}

function CreateMovie(){
	if (image.length > 0){
		document.write("<img style=\"filter:blendTrans(duration=1);\" src=\"" + image[0] + "\" name=\"img\">")
		setTimeout("PlayMovie()",4000)
	}
}

