/* [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','4901',jdecode('Zandkorrel'),jdecode(''), jdecode('%2F4901.html'), 'true',[],'',''],
	['PAGE','5401',jdecode('Unser+Mobilheim'),jdecode(''), jdecode('%2F5401.html'), 'true',[],'',''],
	['PAGE','5301',jdecode('Rund+um+...'),jdecode(''), jdecode('%2F5301.html'), 'true',[],'',''],
	['PAGE','16201',jdecode('Ausfl%C3%BCge+und+Infos'),jdecode(''), jdecode('%2F16201.html'), 'true',[],'',''],
	['PAGE','22601',jdecode('A+-+Z'),jdecode(''), jdecode('%2F22601.html'), 'true',[],'',''],
	['PAGE','16222',jdecode('Links'),jdecode(''), jdecode('%2F16222.html'), 'true',[],'',''],
	['PAGE','15901',jdecode('Fotoalbum'),jdecode(''), jdecode('%2F15901.html'), 'true',[],'',''],
	['PAGE','8601',jdecode('Das+sind+wir'),jdecode(''), jdecode('%2F8601.html'), 'true',[],'',''],
	['PAGE','5057',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F5057.html'), 'true',[],'',''],
	['PAGE','26501',jdecode('Kontakt%2FImpressum'),jdecode(''), jdecode('%2F26501.html'), 'true',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Roadsign';
theSitetree.paletteFamily='CFD5F7';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10741';
theSitetree.graphicsetId='10496';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'DE'
};
var prodDef={
  wl_name: 'netcologne',
  product: 'WSCSYSSSSLYTCPL1'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Roadsign',
				paletteFamily: 	'CFD5F7',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10741',
				graphicsetId: 	'10496',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'666666',
				e_color: 		'999999',
				f_color: 		'663300',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-5057anc330in26or']={
webappId:    '1002',
documentId:  '5057',
internalId:  '5057anc330in26or',
customField: 'icq=false'
};
webappMappings['7060']=webappMappings['7060-4ee558c0a16cf5fed7ca63fa272239f0']={
webappId:    '7060',
documentId:  '15901',
internalId:  '4ee558c0a16cf5fed7ca63fa272239f0',
customField: 'language:de;country:DE;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4901',
internalId:  '',
customField: '20111218-144230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22601',
internalId:  '',
customField: '20110215-165103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8601',
internalId:  '',
customField: '20111116-122304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15901',
internalId:  '',
customField: '20100223-231310'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5057',
internalId:  '',
customField: '20090726-211430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16222',
internalId:  '',
customField: '20111218-152526'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5301',
internalId:  '',
customField: '20111218-153616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16201',
internalId:  '',
customField: '20111218-154759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5401',
internalId:  '',
customField: '20111218-145022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26501',
internalId:  '',
customField: '20110118-161903'
};
var webAppHostname = 'cm4all.netcologne.de:80';
var canonHostname = 'cm4all4.netcologne.de';
var accountId     = 'ANC330IN26OR';
var companyName   = '%22de+Zandkorrel%22';
var htmlTitle	  = 'De+Zandkorrel+Nieuwvliet';
var metaKeywords  = 'Zandkorrel%2C+Mobilheim%2C+Nieuwvliet%2C+Cadzand%2C+Nooitgedacht%2C+Ferien%2C+Zeeland%2C+Zeeuwsch-Vlaanderen%2CUrlaub%2CHolland%2CNiederlande%2CSchwimmen%2CNordsee%2CMeer%2CWasser%2CCamping%2CZelt%2CZeltplatz%2CCaravan%2CWohnwagen%2C+Stacaravan%2CCadzand-Bad%2CMobilehome%2COostburg%2CBreskens%2Cte+huur%2Czu+vermieten%2CAldi%2C+Urlaub+mit+Hund%2CUrlaub+mit+Kind%2C+Urlaub+mit+Kindern%2CVakantie%2C+Sommerferien%2C+Osterferien%2C+Herbstferien%2C+Ferien%2C+Schulferien%2CNaturschutzgebiete%2C+Zwin%2C+Het+Zwin%2C+Strand%2C+Zwarte+Polder%2C+St.+Pierre%2C+Nieuwvliet-Bad%2C+Cadzand-Bad%2C+Aldi%2C+Het+Gemaal%2C+Pannenschuur%2C+Breskens%2C+Oostburg%2C+Sluis%2C+VVV%2C+Koekoeksnest%2C+Reiten%2C+Minigolf%2C+Weihnachten%2C+Winter%2C+Nooitgedacht%2C+Ruhe%2C+Natur';
var metaContents  = 'Zandkorrel%2C+Mobilheim%2C+Nieuwvliet%2C+Cadzand%2C+Nooitgedacht%2C+Ferien%2C+Zeeland%2C+Zeeuwsch-Vlaanderen%2CUrlaub%2CHolland%2CNiederlande%2CSchwimmen%2CNordsee%2CMeer%2CWasser%2CCamping%2CZelt%2CZeltplatz%2CCaravan%2CWohnwagen%2C+Stacaravan%2CCadzand-Bad%2CMobilehome%2COostburg%2CBreskens%2Cte+huur%2Czu+vermieten%2CAldi%2C+Urlaub+mit+Hund%2CUrlaub+mit+Kind%2C+Urlaub+mit+Kindern%2CVakantie%2C+Sommerferien%2C+Osterferien%2C+Herbstferien%2C+Ferien%2C+Schulferien%2CNaturschutzgebiete%2C+Zwin%2C+Het+Zwin%2C+Strand%2C+Zwarte+Polder%2C+St.+Pierre%2C+Nieuwvliet-Bad%2C+Cadzand-Bad%2C+Aldi%2C+Het+Gemaal%2C+Pannenschuur%2C+Breskens%2C+Oostburg%2C+Sluis%2C+VVV%2C+Koekoeksnest%2C+Reiten%2C+Minigolf%2C+Weihnachten%2C+Winter%2C+Nooitgedacht%2C+Ruhe%2C+Natur%2C+';
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();
};

