/* [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','701',jdecode('Heute+%26+morgen...'),jdecode(''),'/701/index.html','true',[ 
		['PAGE','11601',jdecode('Gestern...'),jdecode(''),'/701/11601.html','true',[],'','']
	],'',''],
	['PAGE','1151',jdecode('Wir+produzieren...'),jdecode(''),'/1151/index.html','true',[ 
		['PAGE','1193',jdecode('Dokumentarfilme'),jdecode(''),'/1151/1193.html','true',[],'',''],
		['PAGE','1172',jdecode('Auftragsfilme'),jdecode(''),'/1151/1172.html','true',[],'','']
	],'',''],
	['PAGE','752',jdecode('Wir+verleihen...'),jdecode(''),'/752/index.html','true',[ 
		['PAGE','773',jdecode('Antonio+Negri'),jdecode(''),'/752/773.html','true',[],'',''],
		['PAGE','857',jdecode('Faustrecht'),jdecode(''),'/752/857.html','true',[],'',''],
		['PAGE','878',jdecode('Feltrinelli'),jdecode(''),'/752/878.html','true',[],'',''],
		['PAGE','899',jdecode('Heroes+Never+Die'),jdecode(''),'/752/899.html','true',[],'',''],
		['PAGE','920',jdecode('Image+%C3%A0+paroles'),jdecode(''),'/752/920.html','true',[],'',''],
		['PAGE','941',jdecode('Tibetan+Medicine'),jdecode(''),'/752/941.html','true',[],'',''],
		['PAGE','962',jdecode('Lost+in+Liberia'),jdecode(''),'/752/962.html','true',[],'',''],
		['PAGE','983',jdecode('Massaker'),jdecode(''),'/752/983.html','true',[],'',''],
		['PAGE','1004',jdecode('mittendrin'),jdecode(''),'/752/1004.html','true',[],'',''],
		['PAGE','794',jdecode('Pfad+des+Kriegers'),jdecode(''),'/752/794.html','true',[],'',''],
		['PAGE','25201',jdecode('THE+AGA+KHAN+'),jdecode(''),'/752/25201.html','true',[],'',''],
		['PAGE','1067',jdecode('The+Corporation'),jdecode(''),'/752/1067.html','true',[],'',''],
		['PAGE','1088',jdecode('Testamento'),jdecode(''),'/752/1088.html','true',[],'',''],
		['PAGE','1109',jdecode('Workingman%26%23x27%3Bs+Death'),jdecode(''),'/752/1109.html','true',[],'',''],
		['PAGE','1130',jdecode('Unser+America'),jdecode(''),'/752/1130.html','true',[],'','']
	],'',''],
	['PAGE','1256',jdecode('Wer%2C+wie+%26+wo...'),jdecode(''),'/1256.html','true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Neon';
theSitetree.paletteFamily='6699CC';
theSitetree.keyvisualId='901';
theSitetree.keyvisualName='auge.jpg';
theSitetree.fontsetId='160';
theSitetree.graphicsetId='186';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Neon',
				paletteFamily: 	'6699CC',
				keyvisualId: 	'901',
				keyvisualName: 	'auge.jpg',
				fontsetId: 		'160',
				graphicsetId: 	'186',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				a_color: 		'000000',
				b_color: 		'666666',
				c_color: 		'000000',
				d_color: 		'6699CC',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-13767723']={
webappId:    '1501',
documentId:  '701',
internalId:  '13767723',
customField: '1501'
};
webappMappings['7050']=webappMappings['7050-358']={
webappId:    '7050',
documentId:  '11601',
internalId:  '358',
customField: 'language:de;country:CH;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20100621-153230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11601',
internalId:  '',
customField: '20100304-102018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1151',
internalId:  '',
customField: '20070514-123619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1193',
internalId:  '',
customField: '20091027-155349'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1172',
internalId:  '',
customField: '20080522-143648'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '752',
internalId:  '',
customField: '20090618-235426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '773',
internalId:  '',
customField: '20070512-160710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '857',
internalId:  '',
customField: '20080627-115104'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '878',
internalId:  '',
customField: '20080627-115122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '899',
internalId:  '',
customField: '20080820-145755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '920',
internalId:  '',
customField: '20080820-145832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '941',
internalId:  '',
customField: '20080820-145907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '962',
internalId:  '',
customField: '20080820-145942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '983',
internalId:  '',
customField: '20080820-150030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1004',
internalId:  '',
customField: '20080820-150106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '794',
internalId:  '',
customField: '20080522-142844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25201',
internalId:  '',
customField: '20090110-200011'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1067',
internalId:  '',
customField: '20070514-143922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1088',
internalId:  '',
customField: '20080820-150428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1109',
internalId:  '',
customField: '20070512-161710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1130',
internalId:  '',
customField: '20070512-162353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1256',
internalId:  '',
customField: '20100607-161640'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0IN23AG';
var companyName   = 'docufactory+-+filme+f%C3%BCrs+kino';
var htmlTitle	  = 'docufactory+filmverleih+und+-produktion';
var metaKeywords  = 'Dokumentarfilm%2C+Filmproduktion%2C+Diskussionsveranstaltung%2C+Dokumentarfilme%2C+Filmproduktion%2C+Antonio+Negri%2C+Journeys+with+Tibetan+Medicine%2C+The+Corporation%2C+Workingmans+Death%2C+Heroes+Never+Die%2C+mittendrin%2C+Feltrinelli%2C+Faustrecht%2C+M%C3%A4dchen+am+Sonntag%2C+Lost+in+Liberia%2C+Bosshard%2C+Testamento%2C+Unser+America%2C+Auftragsfilm%2C+Event';
var metaContents  = 'Dokumentarfilme%2C+Filmproduktion%2C+Antonio+Negri%2C+Journeys+with+Tibetan+Medicine%2C+The+Corporation%2C+Workingmans+Death%2C+Heroes+Never+Die%2C+mittendrin%2C+Feltrinelli%2C+Faustrecht%2C+M%C3%A4dchen+am+Sonntag%2C+Lost+in+Liberia%2C+Bosshard%2C+Testamento%2C+Unser+America%2C+Auftragsfilm%2C+Event';
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();
};
