/* [nodename, id, name, navigationtext, href, isnavigation, childs[], templatename] */

if (typeof(decodeURIComponent) == 'undefined') {
  decodeURIComponent = function(s) {
    return unescape(s);
  }
}

function jdecode(s) {
    s = s.replace(/\+/g, "%20")
    return decodeURIComponent(s);
}

var POS_NODENAME=0;
var POS_ID=1;
var POS_NAME=2;
var POS_NAVIGATIONTEXT=3;
var POS_HREF=4;
var POS_ISNAVIGATION=5;
var POS_CHILDS=6;
var POS_TEMPLATENAME=7;
var POS_TARGET=8;
var theSitetree=[ 
	['PAGE','4597',jdecode('Home'),jdecode(''),'/4597.html','true',[],'',''],
	['PAGE','4654',jdecode('Team'),jdecode(''),'/4654.html','true',[],'',''],
	['PAGE','37420',jdecode('Philosophie'),jdecode(''),'/37420.html','true',[],'',''],
	['PAGE','4708',jdecode('Diensteistungen'),jdecode(''),'/4708.html','true',[],'',''],
	['PAGE','4735',jdecode('Arbeitsproben'),jdecode(''),'/4735/index.html','true',[ 
		['PAGE','88398',jdecode('Response-Inserate'),jdecode(''),'/4735/88398.html','true',[],'',''],
		['PAGE','88425',jdecode('Mailings%2FBeilagen'),jdecode(''),'/4735/88425.html','true',[],'',''],
		['PAGE','88452',jdecode('Banner%2C+3-D%2C+etc.'),jdecode(''),'/4735/88452.html','true',[],'',''],
		['PAGE','88479',jdecode('Klassisch'),jdecode(''),'/4735/88479.html','true',[],'',''],
		['PAGE','88506',jdecode('Corporate+Design'),jdecode(''),'/4735/88506.html','true',[],'','']
	],'',''],
	['PAGE','86808',jdecode('Erfolgs-Kostproben'),jdecode(''),'/86808/index.html','true',[ 
		['PAGE','85498',jdecode('Kostprobe+1'),jdecode(''),'/86808/85498.html','true',[],'',''],
		['PAGE','85525',jdecode('Kostprobe+2'),jdecode(''),'/86808/85525.html','true',[],'',''],
		['PAGE','85552',jdecode('Kostprobe+3'),jdecode(''),'/86808/85552.html','true',[],'',''],
		['PAGE','85579',jdecode('Kostprobe+4'),jdecode(''),'/86808/85579.html','true',[],'',''],
		['PAGE','85606',jdecode('Kostprobe+5'),jdecode(''),'/86808/85606.html','true',[],'','']
	],'',''],
	['PAGE','4762',jdecode('Kundenliste'),jdecode(''),'/4762/index.html','true',[ 
		['PAGE','65164',jdecode('aktuelle+Kunden'),jdecode(''),'/4762/65164.html','true',[],'','']
	],'',''],
	['PAGE','65648',jdecode('Referenzen'),jdecode(''),'/65648.html','true',[],'',''],
	['PAGE','4789',jdecode('Partner%2FLinks'),jdecode(''),'/4789.html','true',[],'',''],
	['PAGE','64126',jdecode('FTP+Public-Ordner'),jdecode(''),'/64126.html','true',[],'',''],
	['PAGE','4816',jdecode('Kontakt'),jdecode(''),'/4816/index.html','true',[ 
		['PAGE','37517',jdecode('Kontakt+%28Folgeseite%29'),jdecode(''),'/4816/37517.html','false',[],'','']
	],'',''],
	['PAGE','96097',jdecode('Anfahrt'),jdecode(''),'/96097.html','true',[],'','']];
var siteelementCount=24;
theSitetree.topTemplateName='Moonflight';
theSitetree.paletteFamily='5B7A93';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='450';
theSitetree.graphicsetId='499';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Moonflight',
				paletteFamily: 	'5B7A93',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'450',
				graphicsetId: 	'499',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'2C5574',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4597',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4654',
internalId:  '',
customField: '20100824-104401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4597',
internalId:  '',
customField: '20100810-174848'
};
webappMappings['7008']=webappMappings['7008-1142']={
webappId:    '7008',
documentId:  '4816',
internalId:  '1142',
customField: 'language:de;country:CH;'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '96097',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37420',
internalId:  '',
customField: '20070618-114354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4708',
internalId:  '',
customField: '20070618-114036'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4735',
internalId:  '',
customField: '20100331-173508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '88398',
internalId:  '',
customField: '20080407-143605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '88425',
internalId:  '',
customField: '20080624-174305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '88452',
internalId:  '',
customField: '20080407-144923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '88479',
internalId:  '',
customField: '20080407-143144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '88506',
internalId:  '',
customField: '20080407-142834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86808',
internalId:  '',
customField: '20070910-173244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85498',
internalId:  '',
customField: '20070910-164502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85525',
internalId:  '',
customField: '20060124-231132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85552',
internalId:  '',
customField: '20080331-144826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85579',
internalId:  '',
customField: '20060124-234323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85606',
internalId:  '',
customField: '20080331-144729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4762',
internalId:  '',
customField: '20100628-120422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65164',
internalId:  '',
customField: '20100810-175021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65648',
internalId:  '',
customField: '20070618-114843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4789',
internalId:  '',
customField: '20100129-164832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64126',
internalId:  '',
customField: '20091222-135639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4816',
internalId:  '',
customField: '20070618-114135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37517',
internalId:  '',
customField: '20040727-234820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96097',
internalId:  '',
customField: '20061121-100104'
};
var canonHostname = 'webomat02.hostpoint.ch';
var accountId     = 'Ahp010IN20AM';
var companyName   = 'PHOENIX+VISUALS+AG+-+Direct+Marketing-Gestaltung+seit+28+Jahren%21';
var htmlTitle	  = 'PHOENIX+VISUALS+AG+-+Direct+Marketing%2C+das+verkauft.';
var metaKeywords  = 'Direct+Marketing%2C++Direkt+Marketing%2C+Direktmarketing%2C+Directmarketing%2C+DM%2C+DM-Grafiker%2C+DM-Gestaltung%2C+Direktmarketingfreelancer%2C+Mailing%2C+Responsewerbung%2C+Ruecklauf%2C+Felix+Hohl%2C+Freelancer++';
var metaContents  = 'Phoenix+Visuals+AG%2C+Agentur+fuer+Direct+Marketing.+Felix+Hohl+ist+seit+1982+als+erster+Grafiker+in+Europa+offiziell+ausgebildet+und+spezialsiert+auf+die+Gestaltug+von+Direct+Marketing.+Phoenix+Visuals+plant+DM-Projekte+von+der+Konzeption%2C+ueber+die+Gestaltung%2C+bis+zur+Produktion.';
theSitetree.getById = function(id, ar) {
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		if (ar[i][POS_ID] == id){
			return ar[i];
		}
		if (ar[i][POS_CHILDS].length > 0) {
			var result=this.getById(id, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getParentById = function(id, ar) {
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		for (var j = 0; j < ar[i][POS_CHILDS].length; j++) {
			if (ar[i][POS_CHILDS][j][POS_ID] == id) {
				// child found
				return ar[i];
			}
			var result=this.getParentById(id, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getName = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_NAME];
	}
	return null;
};

theSitetree.getNavigationText = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_NAVIGATIONTEXT];
	}
	return null;
};

theSitetree.getHREF = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_HREF];
	}
	return null;
};

theSitetree.getIsNavigation = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_ISNAVIGATION];
	}
	return null;
};

theSitetree.getTemplateName = function(id, lastTemplateName, ar) {
	if (typeof(lastTemplateName) == 'undefined'){
		lastTemplateName = this.topTemplateName;
	}
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		var actTemplateName = ar[i][POS_TEMPLATENAME];
		if (actTemplateName == ''){
			actTemplateName = lastTemplateName;
		}
		if (ar[i][POS_ID] == id) {
			return actTemplateName;
		}
		if (ar[i][POS_CHILDS].length > 0) {
			var result=this.getTemplateName(id, actTemplateName, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getByXx = function(lookup, xx, ar) {
    if (typeof(ar) == 'undefined'){
    	ar = this;
    }
    for (var i=0; i < ar.length; i++) {
        if (ar[i][xx] == lookup){
        	return ar[i];
        }
        if (ar[i][POS_CHILDS].length > 0) {
        	var result=this.getByXx(lookup, xx, ar[i][POS_CHILDS]);
            if (result != null){
                return result;
               }
        }
    }
    return null;
};

function gotoPage(lookup) {
	if(__path_prefix__ == "/servlet/CMServeRES" && typeof (changePage) == 'function'){
		changePage(lookup);
		return;
	}
	var page = theSitetree.getHREF(lookup);
	if (!page) {
		var testFor = [ POS_NAME, POS_NAVIGATIONTEXT ];
		for (var i=0 ; i < testFor.length ; i++) {
			var p = theSitetree.getByXx(lookup, testFor[i]);
			if (p != null) {
				page = p[POS_HREF];
				break;
			}
		}
	}
	document.location.href = (new URL(__path_prefix__ + page, true, true)).toString();
};
