/* [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','1901',jdecode('Home'),jdecode(''), jdecode('%2F1901.html'), 'true',[],'',''],
	['PAGE','1952',jdecode('%C3%9Cber+uns'),jdecode(''), jdecode('%2F1952.html'), 'true',[],'',''],
	['PAGE','2015',jdecode('So+finden+Sie+uns'),jdecode(''), jdecode('%2F2015.html'), 'true',[],'',''],
	['PAGE','3523',jdecode('%C3%96ffnungszeiten'),jdecode(''), jdecode('%2F3523.html'), 'true',[],'',''],
	['PAGE','1994',jdecode('Gerichte+zum+Mitnehmen'),jdecode(''), jdecode('%2F1994.html'), 'true',[],'',''],
	['PAGE','1973',jdecode('Bilder'),jdecode(''), jdecode('%2F1973.html'), 'true',[],'',''],
	['PAGE','5723',jdecode('Kegelbahn'),jdecode(''), jdecode('%2F5723.html'), 'false',[],'',''],
	['PAGE','5744',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F5744.html'), 'true',[],'',''],
	['PAGE','2036',jdecode('Kontakt'),jdecode(''), jdecode('%2F2036.html'), 'true',[],'',''],
	['PAGE','2057',jdecode('Impressum'),jdecode(''), jdecode('%2F2057.html'), 'false',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Restaurant';
theSitetree.paletteFamily='50423D';
theSitetree.keyvisualId='11902';
theSitetree.keyvisualName='kv_11902.jpg';
theSitetree.fontsetId='33198';
theSitetree.graphicsetId='14092';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'DE'
};
var prodDef={
  wl_name: 'alfahosting',
  product: 'WSCSYSSSSLY0XNQ8'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Restaurant',
				paletteFamily: 	'50423D',
				keyvisualId: 	'11902',
				keyvisualName: 	'kv_11902.jpg',
				fontsetId: 		'33198',
				graphicsetId: 	'14092',
				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:'Tahoma',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-84fee2292083b88e4056bcbe85fc0063']={
webappId:    '7060',
documentId:  '1973',
internalId:  '84fee2292083b88e4056bcbe85fc0063',
customField: 'language:de;country:DE;'
};
webappMappings['7008']=webappMappings['7008-4877']={
webappId:    '7008',
documentId:  '2036',
internalId:  '4877',
customField: 'language:de;country:DE;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1901',
internalId:  '',
customField: '20110131-130338'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1952',
internalId:  '',
customField: '20100327-125537'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1973',
internalId:  '',
customField: '20100324-075932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2015',
internalId:  '',
customField: '20100716-063642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2036',
internalId:  '',
customField: '20100323-102409'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1994',
internalId:  '',
customField: '20110125-082448'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2057',
internalId:  '',
customField: '20100323-102435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3523',
internalId:  '',
customField: '20100323-095715'
};
webappMappings['7002']=webappMappings['7002-3578']={
webappId:    '7002',
documentId:  '5744',
internalId:  '3578',
customField: 'language:de;country:DE;'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '2015',
internalId:  'routing',
customField: 'de_DE'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5723',
internalId:  '',
customField: '20100324-121736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5744',
internalId:  '',
customField: '20100325-144807'
};
var webAppHostname = 'cgi-wsc.alfahosting.de:80';
var canonHostname = 'wsc.alfahosting.de';
var accountId     = 'AAHS10IN2A2G';
var companyName   = 'Ristorante+Pizzeria+F%C3%A4ssle+M%C3%BCnchingen';
var htmlTitle	  = 'Ristorante+Pizzeria+F%C3%A4ssle+M%C3%BCnchingen';
var metaKeywords  = 'Ristorante%2C+Pizzeria%2C+F%C3%A4ssle%2C+M%C3%BCnchingen%2Cbestes+italienisches+restaurant+in+stuttgart+%2CItalienisch%2C+Raffaele%2C+Kegelbahn%2C+Fischspezialit%C3%A4ten%2C+Truoiolo%2C+F%C3%A4ssle+%2C+Amato+Truoiolo%2C+Amato%2C+Italiener%2C+Pizza%2C+Fisch%2C+Pasta%2C+Napoli%2C+Pia+Truoiolo%2C+Antipasti%2C+Raffaele+Truoiolo%2C+Essen%2C+Italiano%2C+Stuttgart%2C+Gerlingen%2C+Ditzingen%2C+Ludwigsburg%2C+M%C3%BCnchingen%2C+Korntal%2C+Schwieberdingen%2C+Feuerbach%2C+Deutschland%2C+Zuffenhausen%2C+Porsche%2C+Essen%2C+Trinken%2C+Wein%2C+Vino%2C+Tr%C3%BCffel%2C+Feinkost%2C+Cesarini%2C+Champagner%2C+Spumante%2C+Heidi%2C+pizza+muenchingen%2C+pizza+m%C3%BCnchingen%2C+m%C3%BCnchingen%2C+m%C3%BCnchingen%2C+m%C3%BCnchingen%2C+tsv+m%C3%BCnchingen%2C+sg+weilimdorf%2C+italiener+m%C3%BCnchingen%2C+italiener+muenchingen%2C+italiener+gerlingen%2C+essen+in+muenchingen%2C+essen+in+m%C3%BCnchingen%2C+italiener+korntal-muenchingen%2C+italiener+korntal-muenchingen%2C+korntal%2C+70825%2C+napoli%2C+faessle+italia%2C+campioni+del+mondo%2C+mangiare%2C+essen+und+trinken+%2C+amato+pignano%2C+italia%2C+campioni+del+mondo+amato+truoiolo%2C+campioni+del+mondo+amato%2C+chicco+amato%2C+pizza+amato%2C+raffaele+der+gro%C3%9Fe+%2C+tutto+pare+pare+pare%2C+beste+pizza+stuttgart%2C+beste+pizza+ludwigsburg%2C+tr%C3%BCffel+essen+stuttgart%2C+tr%C3%BCffel+essen+ludwigsburg%2C+geheimtipp+stuttgart%2C+bestes+restaurant+stuttgart%2C+bestes+restaurant+ludwigsburg%2C+bestes+restaurant+raum+stuttgart%2C+bestes+restaurant+raum+ludwigsburg%2C+sterne+koch+stuttgart%2C+quindici+faessle%2C+quindici%2C+quindici+raffaele%2C+pignano+michele+truoiolo';
var metaContents  = 'Familie+Truoiolo%2C+Ristorante+Pizzeria+F%C3%A4ssle+M%C3%BCnchingen+Mannengasse+7%2C+70825+Korntal-M%C3%BCnchingen%2C+%C3%96ffnungszeiten%3A+Montag+Ruhetag%2C+Dienstag+bis+Sonntag+17%3A30+Uhr+bis+24%3A00+Uhr';
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();
};

