/* [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','2201',jdecode('Home'),jdecode(''), jdecode('%2F2201.html'), 'true',[],'',''],
	['PAGE','11901',jdecode('Uni-Seal'),jdecode(''), jdecode('%2F11901.html'), 'true',[],'',''],
	['PAGE','13977',jdecode('Road+Sludge'),jdecode(''), jdecode('%2F13977.html'), 'true',[],'',''],
	['PAGE','35531',jdecode('Top+Up'),jdecode(''), jdecode('%2F35531.html'), 'true',[],'',''],
	['PAGE','13998',jdecode('All+Terrain'),jdecode(''), jdecode('%2F13998.html'), 'true',[],'',''],
	['PAGE','38931',jdecode('Bike+Wask'),jdecode(''), jdecode('%2F38931.html'), 'true',[],'',''],
	['PAGE','38231',jdecode('Schrader+Valve+installationion'),jdecode(''), jdecode('%2F38231.html'), 'true',[],'',''],
	['PAGE','14040',jdecode('News'),jdecode(''), jdecode('%2F14040.html'), 'true',[],'',''],
	['PAGE','11922',jdecode('Contact'),jdecode(''), jdecode('%2F11922.html'), 'true',[],'',''],
	['PAGE','13001',jdecode('Pictures'),jdecode(''), jdecode('%2F13001.html'), 'true',[],'',''],
	['PAGE','16877',jdecode('Guestbook'),jdecode(''), jdecode('%2F16877.html'), 'true',[],'',''],
	['PAGE','21177',jdecode('Links'),jdecode(''), jdecode('%2F21177.html'), 'true',[],'',''],
	['PAGE','30131',jdecode('Interesting+Articles+'),jdecode(''), jdecode('%2F30131.html'), 'true',[],'',''],
	['PAGE','30731',jdecode('Testimonials+from+cyclists+'),jdecode(''), jdecode('%2F30731.html'), 'true',[],'',''],
	['PAGE','32431',jdecode('Marrick+MTB+Challenge'),jdecode(''), jdecode('%2F32431.html'), 'true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Kreis';
theSitetree.paletteFamily='4D4CD2';
theSitetree.keyvisualId='1674';
theSitetree.keyvisualName='radsport.jpg';
theSitetree.fontsetId='127';
theSitetree.graphicsetId='140';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'hetzner',
  product: 'WSCSYSSSSLY0XKDS'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Kreis',
				paletteFamily: 	'4D4CD2',
				keyvisualId: 	'1674',
				keyvisualName: 	'radsport.jpg',
				fontsetId: 		'127',
				graphicsetId: 	'140',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				a_color: 		'4D4CD2',
				b_color: 		'7794F8',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20110410-130449'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2201',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-3264736']={
webappId:    '1501',
documentId:  '2201',
internalId:  '3264736',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11901',
internalId:  '',
customField: '20100409-191831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11922',
internalId:  '',
customField: '20120126-063717'
};
webappMappings['7008']=webappMappings['7008-997']={
webappId:    '7008',
documentId:  '11922',
internalId:  '997',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13001',
internalId:  '',
customField: '20110407-152411'
};
webappMappings['7060']=webappMappings['7060-ce00ceb2437d5b6599767a82e7688fd4']={
webappId:    '7060',
documentId:  '13001',
internalId:  'ce00ceb2437d5b6599767a82e7688fd4',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14040',
internalId:  '',
customField: '20101110-172908'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13977',
internalId:  '',
customField: '20090915-165143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13998',
internalId:  '',
customField: '20110209-172220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38231',
internalId:  '',
customField: '20110601-121615'
};
webappMappings['1003']=webappMappings['1003-ahtz10inxz2d11c816dc4a8']={
webappId:    '1003',
documentId:  '14040',
internalId:  'ahtz10inxz2d11c816dc4a8',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30131',
internalId:  '',
customField: '20090915-163854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16877',
internalId:  '',
customField: '20110407-152315'
};
webappMappings['1002']=webappMappings['1002-16877ahtz10inxz2d']={
webappId:    '1002',
documentId:  '16877',
internalId:  '16877ahtz10inxz2d',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21177',
internalId:  '',
customField: '20080925-133605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30731',
internalId:  '',
customField: '20090915-163804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32431',
internalId:  '',
customField: '20091002-101350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35531',
internalId:  '',
customField: '20110209-171320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38931',
internalId:  '',
customField: '20110714-151945'
};
var webAppHostname = 'sitebuilder.host-h.net:80';
var canonHostname = 'sitebuilder1.jnb2.host-h.net';
var accountId     = 'AHTZ10INXZ2D';
var companyName   = 'SLUDGE+Tube+and+Tyre+Sealant';
var htmlTitle	  = 'SLUDGE+Tyre+and+Tube+Sealant';
var metaKeywords  = '';
var metaContents  = '';
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();
};

