
// define navi array
document.menustate 							= new Array;
document.menustate['main_hom'] 				= 'normal';
document.menustate['main_exc'] 				= 'normal';
document.menustate['main_hea']				= 'normal';
document.menustate['main_kon']				= 'normal';

document.menustate['exc_about']				= 'normal';
document.menustate['exc_team']				= 'normal';
document.menustate['exc_instore']			= 'normal';
document.menustate['exc_crossmedia']		= 'normal';
document.menustate['exc_partner']			= 'normal';
document.menustate['exc_references']		= 'normal';

document.menustate['hea_fakten']			= 'normal';
document.menustate['hea_vorteile']			= 'normal';
document.menustate['hea_programm']			= 'normal';
document.menustate['hea_reichweite']		= 'normal';
document.menustate['hea_preismodelle']		= 'normal';
document.menustate['hea_themen']			= 'normal';
document.menustate['hea_newsflash']			= 'normal';
document.menustate['hea_spot']				= 'normal';
document.menustate['hea_imagefilm']			= 'normal';
document.menustate['hea_faq']				= 'normal';
document.menustate['hea_log']				= 'normal';

document.menustate['kon_verkauf']			= 'normal';
document.menustate['kon_kontakt']			= 'normal';


function set_derivatives() {
	// page url
	if (document.pagegroup != ''){
		document.pagehtml = document.pagegroup + '_' + document.pageid + '.' + document.pagesuffix;
	}else{
		document.pagehtml = document.pageid + '.' + document.pagesuffix;
	}
	//main menu - var
	document.menustate['main_' + document.pagegroup] = 'high';
	//submenu - var
	document.menustate[document.pagegroup + '_' + document.pageid] = 'high';
}


function setnavi(menuitem) {
	document.getElementById(menuitem).src = '../' + document.pagelang + '/img/menu/high/' + menuitem + '.jpg';
}

function unsetnavi(menuitem) {
	document.getElementById(menuitem).src = '../' + document.pagelang + '/img/menu/' + document.menustate[menuitem] + '/' + menuitem + '.jpg';
}

function initnavi() {
	for (var hashkey in document.menustate) {
		//alert('key is: ' + hashkey + ', value is: ' + document.menustate[hashkey]);
		if (document.getElementById(hashkey) != null){
			document.getElementById(hashkey).src =  '../' + document.pagelang + '/img/menu/' + document.menustate[hashkey] + '/' + hashkey + '.jpg';
		}
	}
}

function printlangswitch(){
	//exclude login area
	if (document.pageid != 'log'){
		if (document.pagelang != 'de'){
			document.write('<a href="../de/' + document.pagehtml + '">Deutsch</a> &nbsp; ');
		}
		if (document.pagelang != 'fr'){
			document.write('<a href="../fr/' + document.pagehtml + '">Fran&ccedil;ais</a> &nbsp; ');
		}
		if (document.pagelang != 'it'){
			document.write('<a href="../it/' + document.pagehtml + '">Italiano</a> &nbsp; ');
		}
	}
}


// build links at http://jumk.de/nospam/stopspam.html
function UnCryptMailto( s ){
    var n = 0;
    var r = "";
    for( var i = 0; i < s.length; i++){
        n = s.charCodeAt( i )
        if( n >= 8364 ){ n = 128; }
        r += String.fromCharCode( n - 1 );
    }
    return r;
}

function linkTo_UnCryptMailto( s ){
    location.href=UnCryptMailto( s );
}

