/* [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','135428',jdecode('Home'),jdecode(''), jdecode('%2F135428%2Findex.html'), 'true',[ 
		['PAGE','124428',jdecode('Archiv+%282010%29'),jdecode(''), jdecode('%2F135428%2F124428.html'), 'true',[],'',''],
		['PAGE','89828',jdecode('Archiv+%28bis+2009%29'),jdecode(''), jdecode('%2F135428%2F89828.html'), 'true',[],'',''],
		['PAGE','4556',jdecode('Archiv+%28bis+2007%29'),jdecode(''), jdecode('%2F135428%2F4556.html'), 'true',[],'','']
	],'',''],
	['PAGE','4694',jdecode('Statuten'),jdecode(''), jdecode('%2F4694.html'), 'true',[],'',''],
	['PAGE','4721',jdecode('Grundsatzerkl%C3%A4rung'),jdecode(''), jdecode('%2F4721.html'), 'true',[],'',''],
	['PAGE','4640',jdecode('Vorstand+%2F+Mitglieder'),jdecode(''), jdecode('%2F4640.html'), 'true',[],'',''],
	['PAGE','89879',jdecode('Moscheen'),jdecode(''), jdecode('%2F89879.html'), 'true',[],'',''],
	['PAGE','4667',jdecode('Moschee+Besuche'),jdecode(''), jdecode('%2F4667%2Findex.html'), 'true',[ 
		['PAGE','125428',jdecode('Moscheef%C3%BChrung'),jdecode(''), jdecode('%2F4667%2F125428.html'), 'true',[],'','']
	],'',''],
	['PAGE','97528',jdecode('Foto-Gallery'),jdecode(''), jdecode('%2F97528.html'), 'true',[],'',''],
	['PAGE','123828',jdecode('Veranstaltungen'),jdecode(''), jdecode('%2F123828%2Findex.html'), 'true',[ 
		['PAGE','88828',jdecode('Archiv+%28bis+2009%29'),jdecode(''), jdecode('%2F123828%2F88828.html'), 'true',[],'',''],
		['PAGE','4613',jdecode('Archiv+%28bis+2007%29'),jdecode(''), jdecode('%2F123828%2F4613.html'), 'true',[],'','']
	],'',''],
	['PAGE','110528',jdecode('Islamische+Feiertage'),jdecode(''), jdecode('%2F110528.html'), 'true',[],'',''],
	['PAGE','4748',jdecode('Zusammenarbeit'),jdecode(''), jdecode('%2F4748.html'), 'true',[],'',''],
	['PAGE','4775',jdecode('Kontakt'),jdecode(''), jdecode('%2F4775%2Findex.html'), 'true',[ 
		['PAGE','6617',jdecode('Kontakt+%28Folgeseite%29'),jdecode(''), jdecode('%2F4775%2F6617.html'), 'false',[],'','']
	],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Hands';
theSitetree.paletteFamily='0B7ACD';
theSitetree.keyvisualId='7395';
theSitetree.keyvisualName='kv_7395.jpg';
theSitetree.fontsetId='16502';
theSitetree.graphicsetId='12168';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'hostpoint',
  product: 'WSCSYSSSSLYTC21F'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Hands',
				paletteFamily: 	'0B7ACD',
				keyvisualId: 	'7395',
				keyvisualName: 	'kv_7395.jpg',
				fontsetId: 		'16502',
				graphicsetId: 	'12168',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '135428',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4556',
internalId:  '',
customField: '20090209-210850'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89828',
internalId:  '',
customField: '20100418-094801'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4640',
internalId:  '',
customField: '20110522-195244'
};
webappMappings['7008']=webappMappings['7008-1301']={
webappId:    '7008',
documentId:  '4775',
internalId:  '1301',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4694',
internalId:  '',
customField: '20081111-210826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4721',
internalId:  '',
customField: '20100102-224504'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89879',
internalId:  '',
customField: '20111223-200011'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4667',
internalId:  '',
customField: '20100418-103640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97528',
internalId:  '',
customField: '20111125-182110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '88828',
internalId:  '',
customField: '20100407-201437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4613',
internalId:  '',
customField: '20100407-202108'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110528',
internalId:  '',
customField: '20111223-195825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4748',
internalId:  '',
customField: '20111223-195349'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4775',
internalId:  '',
customField: '20110914-183525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6617',
internalId:  '',
customField: '20050508-131219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '123828',
internalId:  '',
customField: '20111211-170516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '124428',
internalId:  '',
customField: '20110102-134942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '135428',
internalId:  '',
customField: '20111230-153517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125428',
internalId:  '',
customField: '20101031-154431'
};
webappMappings['7008']=webappMappings['7008-2975']={
webappId:    '7008',
documentId:  '125428',
internalId:  '2975',
customField: 'language:de;country:CH;'
};
var webAppHostname = 'cgi.webomat.ch:80';
var canonHostname = 'webomat01.hostpoint.ch';
var accountId     = 'Ahp010IN2ESU';
var companyName   = 'Vereinigung+der+Islamischen+Organisationen+in+Z%C3%BCrich';
var htmlTitle	  = 'VIOZ+-+Ihr+Ansprechpartner+in+Stadt+und+Kanton+Z%C3%BCrich';
var metaKeywords  = 'Islam%2C+Muslim%2C+VIOZ%2C+Vioz%2C+vioz%2C+Vereinigung+der+Islamischen+Organisationen+in+Z%C3%BCrich%2C+Zurich%2C+Schweiz%2C+Dialog%2C+Integration%2C+Religion%2C+Kultur%2C+Moschee%2C+Besuch%2C+F%C3%BChrung%2C+Beratung%2C+Ansprechpartner%2C+muslimischer%2C+islamischer%2C+Dachverband%2C+Dachorganisation%2C+Minarett%2C+Winterthur%2C+Fatih+Dursun%2C+Hasan+Taner+Hatipoglu%2C+Schule%2C+Ramadan%2C+Feiertag%2C+Opferfest%2C+Demokratie%2C+Rechtsstaat%2C+Gesetz%2C+Friedhof%2C+Grabfeld%2C+Mosque%2C+Zurich%2C+Zurigo%2C++Tag+der+Offenen+Moschee%2C+Tag+der+Offenen+T%C3%BCr';
var metaContents  = 'Islam%2C+Muslim%2C+VIOZ%2C+Vioz%2C+vioz%2C+Vereinigung+der+Islamischen+Organisationen+in+Z%C3%BCrich%2C+Zurich%2C+Schweiz%2C+Dialog%2C+Integration%2C+Religion%2C+Kultur%2C+Moschee%2C+Besuch%2C+F%C3%BChrung%2C+Beratung%2C+Ansprechpartner%2C+muslimischer%2C+islamischer%2C+Dachverband%2C+Dachorganisation%2C+Minarett%2C+Winterthur%2C+Fatih+Dursun%2C+Hasan+Taner+Hatipoglu%2C+Schule%2C+Ramadan%2C+Feiertag%2C+Opferfest%2C+Demokratie%2C+Rechtsstaat%2C+Gesetz%2C+Friedhof%2C+Grabfeld%2C+Mosque%2C+Zurich%2C+Zurigo%2C+Tag+der+Offenen+Moschee%2C+Tag+der+Offenen+T%C3%BCr';
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();
};

