// kt.js - Created by Bradley J. Gibby q:)
// Version 1.0 - 20040517

function drawHeader() {
	document.writeln("<table width=\"1000px\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"white\">");
		document.writeln("<tr>");
			document.writeln("<td><a href=\"http://www.flexiblelearning.net.au/\" target=\"_adlsfj\"><img src=\"../images/aflflogo_home.gif\" width=\"400\" height=\"50\" border=\"0\" alt=\"Australian Flexible Learning Framework\"></a></td>");
			document.writeln("<td align=\"right\">&nbsp;</td>");
		document.writeln("</tr>");
	document.writeln("</table>");
	
	document.writeln("<table border=\"0\" width=\"1000px\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"white\">");
		document.writeln("<tr>");
			document.writeln("<td>");
			document.writeln("<a href=\"http://www.flexiblelearning.net.au/knowledgetree/index.htm\"><img src=\"../images/knowledgetreelogo5.gif\" alt=\"The Knowledge Tree - An e-Journal of Learning Innovation\" width=\"300\" height=\"75\" border=\"0\"><img src=\"../images/sharing_research.gif\" alt=\"Sharing research and innovation in global e-learning practice\" width=\"300\" height=\"75\" border=\"0\"></a>");
			document.writeln("</td>");
			document.writeln("<td valign=\"top\" align=\"right\">");
				document.writeln("<table width=\"222px\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" background=\"images/searchBox.gif\">");
					document.writeln("<tr>");
						document.writeln("<td width=\"34%\"><img src=\"../images/search.gif\" alt=\"Search\" width=\"73\" height=\"36\"></td>");
						document.writeln("<td width=\"47%\"><form id=\"form1\" action=\"../perl/search.pl\" method=POST><input type=\"text\" name=\"keywords\" class=\"form-SearchBox\" /></td>");
						document.writeln("<td width=\"19%\"><a href=\"javascript:form1.submit();\"><img src=\"../images/go.gif\" alt=\"Go\" width=\"24\" height=\"36\" border=\"0\"></a></form></td>");
					document.writeln("</tr>");
				document.writeln("</table>");
			document.writeln("</td>");
		document.writeln("</tr>");
	document.writeln("</table>");
}

function downloadable(path) {
	var ext = path.substring(path.length - 4);
	
	var icon = "";
	var fileType = "";
	
	if (ext == ".doc") {
		icon = "../images/iconDoc.gif";
		fileType = "Word Document";
	} else if (ext == ".pdf") {
		icon = "../images/iconPdf.gif";
		fileType = "Adobe PDF Document";
	} else if (ext == ".wmv") {
		icon = "../images/iconWmv.gif";
		fileType = "Windows Media Document";
	} else if (ext == ".mp3") {
		icon = "../images/iconMp3.gif";
		fileType = "Audio File";
	} else if (ext == ".txt") {
		icon = "../images/iconTxt.gif";
		fileType = "Text Document";
	} else if (ext == ".html") {
		icon = "../images/iconhtml.gif";
		fileType = "Text Document";
	} else if (ext == ".htm") {
		icon = "../images/iconhtml.gif";
		fileType = "Text Document";
	} else {
		alert("File extension does not match one that I am familiar with!\n\nPath: (" + path + ")");
	}

	var altText = "Download " + fileType;
	
	document.writeln("<a href=\"../download/" + path + "\" class=\"downloadableLink\" target=\"" + path + "\"><img src=\"" + icon + "\" border=\"0\" alt=\"" + altText + "\" /></a> <a href=\"../download/" + path + "\" class=\"downloadableLink\" target=\"" + path + "\">Access " + fileType + "</a>");
}

function goTo(path) {
	document.location.href = "../html/" + path;
}

function search() {
	var i = document.getElementsByTagName("input");
	
	document.location.href = "../perl/search.pl?keywords=" + i[0].value;
}
	
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=200,left = 312,top = 284');");
}

