/*****************************************************/
/* style.js - Script for Menu and other Styles       */
/* (c) 2001-2002 by Alexander "yoman2000" Johmann    */
/* Last Update: 23.09.2002                           */
/*****************************************************/

var TDID, COLtrue="#008050", COLfalse="#1F7556", BORDtrue="1pt solid #ffffff",  BORDfalse="1pt solid #FFEDBF";
var bor_top="1pt solid #ffffff";
var bor_bottom="1pt solid #ffffff";
var bor_right="1pt solid #ffffff";
var bor_left="1pt solid #ffffff";

function DOMcolor(Nr,tf,typ) {
	if (typ == "1") {
		var TDID, COLtrue="#1F7556", COLfalse="#1F7556", BORDtrue="1pt solid #ffffff", BORDfalse="1pt solid #FFEDBF";
		var bor_top="1pt solid #ffffff";
		var bor_bottom="1pt solid #ffffff";
		var bor_right="1pt solid #ffffff";
		var bor_left="1pt solid #ffffff";
	}
	if (typ == "2") {
		var TDID, COLtrue="#1F7556", COLfalse="", BORDtrue="1pt solid #ffffff", BORDfalse="1pt solid #FFEDBF";
	}
	if (typ == "3") {
		var TDID, COLtrue="#008050", COLfalse="#008050", BORDtrue="1pt solid #ffffff", BORDfalse="1pt solid #FFEDBF";
		var bor_top="1pt solid #ffffff";
		var bor_bottom="1pt solid #ffffff";
		var bor_right="1pt solid #ffffff";
		var bor_left="1pt solid #ffffff";
	}
	if (typ == "4")	{
		var TDID, COLtrue="#008050", COLfalse="#008050", BORDtrue="1pt solid #ffffff", BORDfalse="1pt solid #FFEDBF";
		var bor_top="1pt solid #ffffff";
		var bor_bottom="1pt solid #ffffff";
		var bor_right="1pt solid #FFFFCC";
		var bor_left="1pt solid #FFFFCC";
	}

	TDID="amj"+Nr;

	if (document.getElementById) { // IE 5, IE 6, NN 6, Mozilla, Opera (DOM1 compatible)
		if (tf=="true") {
			if (typ == "4") {
				document.getElementById(TDID).style.backgroundColor=COLtrue;
				document.getElementById(TDID).style.borderTop=bor_top;
				document.getElementById(TDID).style.borderBottom=bor_bottom;
				document.getElementById(TDID).style.borderLeft=bor_left;
				document.getElementById(TDID).style.borderRight=bor_right;
			} else {
				document.getElementById(TDID).style.backgroundColor=COLtrue;
				document.getElementById(TDID).style.border=BORDtrue;
				document.getElementById(TDID).style.borderTop=BORDtrue;
			}
		} else {
			document.getElementById(TDID).style.backgroundColor=COLfalse;
			document.getElementById(TDID).style.border=BORDfalse;
		}
	}
}

function layer(MEN,TDID) {
	document.getElementById(MEN).style.visibility="visible";
	document.getElementById(TDID).style.backgroundColor=COLtrue;
	document.getElementById(TDID).style.border=BORDtrue;
	document.getElementById(TDID).style.borderTop=BORDtrue;
}

function layer_exit(MEN,TDID) {
	document.getElementById(MEN).style.visibility="hidden";
	document.getElementById(TDID).style.backgroundColor=COLfalse;
	document.getElementById(TDID).style.border=BORDfalse;
}

function showlay(LAY) {
	document.getElementById(LAY).style.visibility="visible";
}

function hidelay(LAY) {
	document.getElementById(LAY).style.visibility="hidden";
}

function showlay_2(LAY) {
	document.getElementById(LAY).style.display="inline";
	document.getElementById(LAY).style.visibility="visible";
}

function hidelay_2(LAY) {
	document.getElementById(LAY).style.display="none";
	document.getElementById(LAY).style.visibility="hidden";
}

function showlay_3(LAY) {
	document.getElementById(LAY).style.display="block";
	document.getElementById(LAY).style.visibility="visible";
}

/*
function setActiveStyleSheet(title) {
	var i, a, main;
	for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
		if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
			a.disabled = true;
			if(a.getAttribute("title") == title)
				a.disabled = false;
		}
	}
}

function getActiveStyleSheet() {
	var i, a;
	for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
		if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
	}
	return null;
}

function getPreferredStyleSheet() {
	var i, a;
	for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
		if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("rel").indexOf("alt") == -1&& a.getAttribute("title"))
			return a.getAttribute("title");
	}
	return null;
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = ";
			expires="+date.toGMTString();
	} else
		expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

window.onload = function(e) {
	var cookie = readCookie("style");
	var title = cookie ? cookie : getPreferredStyleSheet();
	setActiveStyleSheet(title);
}

window.onunload = function(e) {
	var title = getActiveStyleSheet();
	createCookie("style", title, 365);
}

var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);
*/