/* [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','401',jdecode('Willkommen'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','452',jdecode('Leistungen'),jdecode(''),'/452/index.html','true',[ 
		['PAGE','46601',jdecode('interactive+lab'),jdecode(''),'/452/46601.html','false',[],'',''],
		['PAGE','114101',jdecode('1%3A1+interactive+tool'),jdecode(''),'/452/114101.html','false',[],'',''],
		['PAGE','40601',jdecode('Werden+Sie+interaktiv+%28Folgeseite%29'),jdecode(''),'/452/40601.html','false',[],'','']
	],'',''],
	['PAGE','7485',jdecode('Kunden+%2F+Projekte'),jdecode(''),'/7485/index.html','true',[ 
		['PAGE','126601',jdecode('Dialog-Projekte'),jdecode(''),'/7485/126601.html','true',[],'',''],
		['PAGE','175301',jdecode('interactive+Projekte'),jdecode(''),'/7485/175301.html','true',[],'','']
	],'',''],
	['PAGE','151901',jdecode('News+2010'),jdecode(''),'/151901/index.html','true',[ 
		['PAGE','118401',jdecode('News+2009'),jdecode(''),'/151901/118401.html','true',[],'',''],
		['PAGE','174601',jdecode('Linkwoche10'),jdecode(''),'/151901/174601.html','true',[],'','']
	],'',''],
	['PAGE','11801',jdecode('Team+%2F+Mobile+%2F+Email'),jdecode(''),'/11801.html','true',[],'',''],
	['PAGE','7901',jdecode('Partner+%2F+isuntu.com'),jdecode(''),'/7901.html','true',[],'',''],
	['PAGE','473',jdecode('Kontakt+%2F+Lageplan'),jdecode(''),'/473/index.html','true',[ 
		['PAGE','2101',jdecode('Kontakt+%28Folgeseite%29'),jdecode(''),'/473/2101.html','false',[],'',''],
		['PAGE','106401',jdecode('Lageplan'),jdecode(''),'/473/106401.html','true',[],'','']
	],'',''],
	['PAGE','157201',jdecode('Praktikum+%2F+Jobangebot'),jdecode(''),'/157201.html','true',[],'',''],
	['PAGE','7506',jdecode('Info+%2F+Bankverbindung'),jdecode(''),'/7506.html','true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='555454';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10555';
theSitetree.graphicsetId='10892';
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: 			'Alpha',
				paletteFamily: 	'555454',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10555',
				graphicsetId: 	'10892',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'555454',
				e_color: 		'555454',
				f_color: 		'555454',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '175301',
internalId:  '',
customField: '20100707-091524'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '126601',
internalId:  '',
customField: '20100820-164940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '114101',
internalId:  '',
customField: '20090127-164857'
};
webappMappings['7008']=webappMappings['7008-1180']={
webappId:    '7008',
documentId:  '157201',
internalId:  '1180',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '157201',
internalId:  '',
customField: '20100803-085346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20100817-090324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20100609-095512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46601',
internalId:  '',
customField: '20090310-164122'
};
webappMappings['7008']=webappMappings['7008-1152']={
webappId:    '7008',
documentId:  '473',
internalId:  '1152',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11801',
internalId:  '',
customField: '20100817-091102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '151901',
internalId:  '',
customField: '20100816-165731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7485',
internalId:  '',
customField: '20100803-085507'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20100106-072308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20070327-221458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106401',
internalId:  '',
customField: '20090702-095049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '118401',
internalId:  '',
customField: '20100106-072515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '174601',
internalId:  '',
customField: '20100630-172513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40601',
internalId:  '',
customField: '20070516-221713'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7901',
internalId:  '',
customField: '20100817-091240'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7506',
internalId:  '',
customField: '20100312-080701'
};
var canonHostname = 'wsc.genotec.ch';
var accountId     = 'AGT010IN2CW7';
var companyName   = 'interagis.com';
var htmlTitle	  = 'Agentur+f%C3%BCr+Interaktion+und+Dialogf%C3%BChrung';
var metaKeywords  = 'Schweizer+Interactive+Agentur%2C+interaktive+Markenerlebnisse%2C+dialoggef%C3%BChrte+Kommunikation%2C+Direkt+Marketing%2C+Direct+Marketing%2C+Dialog+Marketing%2C+Interone%2C+Start';
var metaContents  = 'Agentur+f%C3%BCr+interaktive+Markenerlebnisse+und+dialoggef%C3%BChrte+Kommunikation.+15+Jahren+Erfahrung+in+der+Dialogf%C3%BChrung+und+im+Direkt+Marketing.+Entwicklung+von+interactive+-Kampagnen+zur+Kundengewinnung+und+f%C3%BCr+die+Kundenbindung+-+offline+und+online.++';
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();
};
