/* [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','3001',jdecode('Home'),jdecode(''),'/3001.html','true',[],'',''],
	['PAGE','10101',jdecode('Consulting'),jdecode(''),'/10101.html','true',[],'',''],
	['PAGE','3052',jdecode('B%C3%BCro+Service'),jdecode(''),'/3052.html','true',[],'',''],
	['PAGE','3073',jdecode('Buchhaltung'),jdecode(''),'/3073.html','true',[],'',''],
	['PAGE','3115',jdecode('%C3%9Cbersetzungen'),jdecode(''),'/3115/index.html','true',[ 
		['PAGE','11201',jdecode('Dolmetschern'),jdecode(''),'/3115/11201.html','true',[],'',''],
		['PAGE','3136',jdecode('Portugiesisch'),jdecode(''),'/3115/3136.html','true',[],'',''],
		['PAGE','3220',jdecode('Chinesisch'),jdecode(''),'/3115/3220.html','true',[],'','']
	],'',''],
	['PAGE','10201',jdecode('Networking'),jdecode(''),'/10201.html','true',[],'',''],
	['PAGE','11222',jdecode('Kontakt'),jdecode(''),'/11222/index.html','true',[ 
		['PAGE','12601',jdecode('So+finden+Sie+uns'),jdecode(''),'/11222/12601.html','true',[],'','']
	],'',''],
	['PAGE','3262',jdecode('Links'),jdecode(''),'/3262.html','true',[],'','']];
var siteelementCount=12;
theSitetree.topTemplateName='Ragtime';
theSitetree.paletteFamily='B3CA99';
theSitetree.keyvisualId='3597';
theSitetree.keyvisualName='kv_3597.jpg';
theSitetree.fontsetId='10737';
theSitetree.graphicsetId='10852';
theSitetree.contentColor='5D6B55';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Ragtime',
				paletteFamily: 	'B3CA99',
				keyvisualId: 	'3597',
				keyvisualName: 	'kv_3597.jpg',
				fontsetId: 		'10737',
				graphicsetId: 	'10852',
				contentColor: 	'5D6B55',
				contentBGColor: 'FFFFFF',
				a_color: 		'B3CA99',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'747475',
				e_color: 		'899D75',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3001',
internalId:  '',
customField: '20110530-115842'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3052',
internalId:  '',
customField: '20110530-122237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3073',
internalId:  '',
customField: '20110530-123603'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11201',
internalId:  '',
customField: '20110530-094838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3115',
internalId:  '',
customField: '20100621-091445'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3136',
internalId:  '',
customField: '20100621-090727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10201',
internalId:  '',
customField: '20110328-134750'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11222',
internalId:  '',
customField: '20110530-130827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12601',
internalId:  '',
customField: '20110530-131339'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3220',
internalId:  '',
customField: '20100621-091706'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10101',
internalId:  '',
customField: '20110530-123844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3262',
internalId:  '',
customField: '20100621-091744'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3001',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-12280']={
webappId:    '7008',
documentId:  '11222',
internalId:  '12280',
customField: 'language:de;country:CH;'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW330INEGOA';
var companyName   = 'OFFICE+SOLUTION';
var htmlTitle	  = 'OFFICE+SOLUTION';
var metaKeywords  = 'Delene%2C+delene+klein%2C+klein%2C++hilfe%2C+brasil%2C+schweiz%2C+beratung%2C+office%2C+service%2C+%C3%BCbersetzungen%2C+buchhaltung%2C+finanzen%2C+events%2C+consulting%2C+dolmetschen%2C+b%C3%BCro%2C+b%C3%BCrohilfe%2C+telefon%2C+schreibdienst%2C+administration%2C+portugiesisch%2C+italienisch%2C+spanisch%2C+escrit%C3%B3rio%2C+servi%C3%A7o+administrativo%2C+contabilidade%2C+ajuda%2C+su%C3%AD%C3%A7a%2C+management%2C+domizilierung%2C+steuern%2C+';
var metaContents  = 'Delene+Klein';
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();
};

