/*------------------------------------------------------------------- 
Author's Statement:
This script is based on ideas of the author.
You may copy, modify and use it for any purpose. The only condition is that if you publish web pages that use this script you point to its author at a suitable place and don't remove this Statement from it.
It's your responsibility to handle possible bugs even if you didn't modify anything. I cannot promise any support.
Dieter Bungers
GMD (www.gmd.de) and infovation (www.infovation.de)
--------------------------------------------------------------------*/
if (navigator.appName.toLowerCase().indexOf("explorer") > -1) {
	var mdi=textSizes[1], sml=textSizes[2];
}
else {
	//var mdi=textSizes[3], sml=textSizes[4];
	//var mdi=textSizes[2], sml=textSizes[2];
}

function reDisplay(currentNumber,currentIsExpanded,cols) {
	toc.document.open();
	toc.document.write("<html>\n<head>\n<title>ToC</title>\n");
	toc.document.write("<link href=\"/includes/style.css\" rel=\"stylesheet\" type=\"text/css\">");
toc.document.write("<SCRIPT TYPE=\"text/javascript\"><!--\n");
toc.document.write("function checknull()\n");
toc.document.write("{\n");

toc.document.write("if (document.CurrentUser.name.value == 'e-postadress')\n");
toc.document.write("{\n");
toc.document.write("alert('Vi har gjort förändringar i systemet och på grund av detta behöver fylla i din e-postadress på nytt i fältet Användarnamn.');");
toc.document.write("document.CurrentUser.name.focus(); document.CurrentUser.name.value=''; return;");
toc.document.write("}\n");

toc.document.write("if (document.CurrentUser.password.value == '')\n");
toc.document.write("{\n");
toc.document.write("alert('Var vänlig fyll i lösenord');");
toc.document.write("document.CurrentUser.password.focus();");
toc.document.write("}\n");
toc.document.write("else\n{");
toc.document.write("document.CurrentUser.submit();");
toc.document.write("}\n");
toc.document.write("}\n");

toc.document.write("function submitenter(myfield,e)\n");
toc.document.write("{\n");
toc.document.write("var keycode;\n");
toc.document.write("if (window.event) keycode = window.event.keyCode;\n");
toc.document.write("else if (e) keycode = e.which;\n");
toc.document.write("else return true;\n");
toc.document.write("if (keycode == 13)\n");
toc.document.write("{\n");
toc.document.write("checknull();\n");
toc.document.write("return false;\n");
toc.document.write("}\n");
toc.document.write("else\n");
toc.document.write("return true;\n");
toc.document.write("}\n");
toc.document.write("//-->\n");
toc.document.write("</SCRIPT>\n");
	toc.document.write("</head>\n<body LEFTMARGIN=\"0\" TOPMARGIN=\"0\" MARGINWIDTH=\"0\" MARGINHEIGHT=\"0\" bgcolor=\"#ffffff\">\n");
	toc.document.write("<form name=\"CurrentUser\" method=\"post\" action=\"/LogIn.aspx\" target=\"content\" onsubmit=\"return(checknull(this))\">");
	toc.document.write("<TABLE WIDTH=\"180\" height=\"100%\" BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\">");
	//------Loginrutorna----------//
	toc.document.write("<TR><TD width=\"23\" background=\"/images/menu_left_border.gif\"><IMG SRC=\"/images/menu_left_border.gif\" WIDTH=\"23\" HEIGHT=\"8\"  alt=\"\"></TD>");
	toc.document.write("<TD background=\"/images/menu_back.gif\" valign=\"top\">");
	toc.document.write("&nbsp;&nbsp;<span class=\"smallprint\">Användarnamn</span><BR>");
	toc.document.write("&nbsp;&nbsp;<input name=\"name\" type=\"text\" size=\"10\" class=\"login\" value=\"e-postadress\" onFocus=\"if (this.value == 'e-postadress') {this.value = '';}\" onKeyPress=\"return submitenter(this,event)\">");
	toc.document.write("<BR>&nbsp;&nbsp;<span class=\"smallprint\">Lösenord</span><BR>");
    toc.document.write("&nbsp;&nbsp;<input name=\"password\" type=\"password\" size=\"10\" class=\"login\" value=\"\" onKeyPress=\"return submitenter(this,event)\">");
    toc.document.write("<br>&nbsp;&nbsp;<a href=\"javascript:checknull();\">Logga in &raquo;</a>");
	toc.document.write("<br>&nbsp;&nbsp;<a href=\"register/page2.asp\" target=\"content\">Testa Gratis &raquo;</a></TD>");
	toc.document.write("<TD width=\"7\" background=\"/images/menu_right_border.gif\"><IMG SRC=\"/images/menu_right_border.gif\" WIDTH=\"7\" HEIGHT=\"2\" alt=\"\"></TD>");
	toc.document.write("</TR>");

	toc.document.write("<TR><TD width=\"23\" height=\"100%\" background=\"/images/menu_left_border.gif\"><IMG SRC=\"/images/menu_left_border.gif\" WIDTH=\"23\" HEIGHT=\"2\" alt=\"\"></TD>");
	toc.document.write("<TD background=\"/images/menu_back.gif\" valign=\"top\"><table border=\"0\" WIDTH=\"150\" cellspacing=\"0\" cellpadding=\"0\">\n");
	if (cols == 'undefined'){
		nCols = 1;
	}
	else{
		nCols = cols;
	}
	var currentNumArray = currentNumber.split(".");
	var currentLevel = currentNumArray.length-1;
	var scrollY=0, addScroll=true, theHref=""; theTarget=""; highCols = 0;
	for (i = 0; i < tocTab.length; i++) {
	    thisNumber = tocTab[i][0];
	    var isCurrentNumber = (thisNumber == currentNumber);
	    if (isCurrentNumber) {
	        theHref = tocTab[i][2];
	        theTarget = tocTab[i][3];
	    }
	    var thisNumArray = thisNumber.split(".");
	    var thisLevel = thisNumArray.length - 1;
	    var toDisplay = true;
	    if (thisLevel > 0) {
	        for (j = 0; j < thisLevel; j++) {
	            toDisplay = (j > currentLevel) ? false : toDisplay && (thisNumArray[j] == currentNumArray[j]);
	        }
	    }
	    thisIsExpanded = toDisplay && (thisNumArray[thisLevel] == currentNumArray[thisLevel])
	    if (currentIsExpanded) {
	        toDisplay = toDisplay && (thisLevel <= currentLevel);
	        if (isCurrentNumber) thisIsExpanded = false;
	    }
	    if (toDisplay) {
	        if (i == 0) {
	            toc.document.writeln("<TR><td valign=\"middle\" colspan=" + (nCols + 1) + " height=\"2\"><img src=\"/images/menu_space.gif\" alt=\"\"></TD></TR>");
	        }
	        else {
	            if (addScroll) scrollY += ((thisLevel < 2) ? mdi : sml) * 25;
	            if (isCurrentNumber) addScroll = false;
	            var isLeaf = (i == tocTab.length - 1) || (thisLevel >= tocTab[i + 1][0].split(".").length - 1);
	            img = (isLeaf) ? "leaf" : (thisIsExpanded) ? "minus" : "plus";
	            toc.document.writeln("<tr onmouseover=\"javascript:this.style.backgroundColor='#FFFFFF';\" onmouseout=\"javascript:this.style.backgroundColor='" + ((isCurrentNumber) ? currentColor : normalColor) + "';\">");
	            for (k = 1; k <= thisLevel; k++) {
	                toc.document.writeln("<td align=\"left\">&nbsp;</td>");
	            }
	            toc.document.writeln("<td height=18 valign=\"middle\"><img src=\"/Images/" + img + ".gif\" width=7 border=0></td><td valign=\"middle\" colspan=" + (nCols - thisLevel) + "><a href=\"javaScript:\parent.reDisplay('" + thisNumber + "'," + thisIsExpanded + "," + ((thisIsExpanded) ? (tocTab[i][5]) : (tocTab[i][4])) + ")\" style=\"font-family: " + fontLines + ";" + ((thisLevel <= mLevel) ? "font-weight:bold" : "") + "; font-size:" + ((thisLevel <= mLevel) ? mdi : sml) + "px; color:#333333 ; text-decoration:none \">" + ((showNumbers) ? (thisNumber + " ") : "") + tocTab[i][1] + "</a></td></tr>");
	            toc.document.writeln("<TR><td valign=\"middle\" colspan=" + (nCols + 1) + " height=\"2\"><img src=\"/images/menu_space.gif\" alt=\"\"></TD></TR>");
	        }
	    }
	}
	toc.document.writeln("<TR><td valign=\"middle\" colspan=" + (nCols+1) + "></TD></TR>");
	toc.document.writeln("</table>");
	toc.document.writeln("</TD><TD width=\"7\" height=\"100%\" background=\"/images/menu_right_border.gif\"><IMG SRC=\"/images/menu_right_border.gif\" WIDTH=\"7\" HEIGHT=\"2\" alt=\"\"></TD>");
	toc.document.writeln("</TR><TR><TD width=\"23\" height=\"100%\" background=\"/images/menu_left_border.gif\"><IMG SRC=\"/images/menu_left_border.gif\" WIDTH=\"23\" HEIGHT=\"2\" alt=\"\"></TD>");
	toc.document.writeln("<TD align=\"CENTER\" background=\"/images/menu_back.gif\"></TD>");
	toc.document.writeln("<TD width=\"7\" height=\"100%\" background=\"/images/menu_right_border.gif\"><IMG SRC=\"/images/menu_right_border.gif\" WIDTH=\"7\" HEIGHT=\"2\" alt=\"\"></TD>");
	toc.document.writeln("</TR></TABLE>");
	toc.document.writeln("</Form>\n</body></HTML>");
	
	toc.document.close();
	if (screen.Height <= 600) scrollY = 0;
	toc.scroll(0,scrollY);
	if (theHref != ""){ 
		if (theTarget){
			top.location.href = theHref
			}
		else
			content.location.href = theHref;
	}
}