// kukuk_nav.js
// Version 0.1

var urlroot = "";
var basedir = "Bilder/";
var thisSection = "";

function init_section() 
{
	thisSection = document.title;
	document.images["navSectionname"].src = basedir + "Design_aa" + thisSection + "_05.gif";
	document.title = "KUKUK - " + thisSection;

	reset_section();
	
	return true;
}

function grey_all() 
{
	document.images["navStartseite"].src = basedir + "Design_aaNavgrey_07.gif";
	document.images["navInformationen"].src = basedir + "Design_aaNavgrey_08.gif";
	document.images["navProjekt"].src = basedir + "Design_aaNavgrey_09.gif";
	document.images["navUmfrage"].src = basedir + "Design_aaNavgrey_10.gif";
	document.images["navPartner"].src = basedir + "Design_aaNavgrey_11.gif";
	return true;
}

function find_secid( secname ) 
{
	var id = "_07";	
	
	if ( secname == "Informationen" ) {
		id = "_08";
	}
	if ( secname == "Projekt" ) {
		id = "_09";
	}
	if ( secname == "Umfrage" ) {
		id = "_10";
	}
	if ( secname == "Partner" ) {
		id = "_11";
	}

	return id;
}

function set_section( secname )
{
	if ( secname == "Newsletter" ) {
		secname = "Umfrage";
	}
	var id = find_secid( secname );	
	grey_all();
	document.images["nav" + secname ].src = basedir + "Design_aa" + id + ".gif";

	document.images["navtext"].src = basedir + "Design_aa" + secname + "_13.gif";
	return true;
}

function reset_section()
{
	grey_all();
	
	var ts = thisSection;
	if ( ts == "Newsletter" ) {
	    ts = "Umfrage";
	}

	var id = find_secid( ts );
    var name = "nav" + ts;
    // the next line is required, because for some reason ts is empty
    if ( name == "nav" ) { name = "navStartseite"; }
	
	document.images[name].src = basedir + "Design_aa"+ id + ".gif";
	document.images["navtext"].src = basedir + "Design_aa_13.gif";
	
	return true;
}
