/* [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','4495',jdecode('Home'),jdecode(''),'/4495.html','true',[],'',''],
	['PAGE','4552',jdecode('News'),jdecode(''),'/4552.html','true',[],'',''],
	['PAGE','46047',jdecode('Products'),jdecode(''),'/46047/index.html','true',[ 
		['PAGE','4579',jdecode('Information'),jdecode(''),'/46047/4579.html','true',[],'',''],
		['PAGE','74801',jdecode('Aprilia'),jdecode(''),'/46047/74801.html','true',[],'',''],
		['PAGE','47200',jdecode('Ducati'),jdecode(''),'/46047/47200.html','true',[],'',''],
		['PAGE','8253',jdecode('Honda'),jdecode(''),'/46047/8253.html','true',[],'',''],
		['PAGE','4660',jdecode('Kawasaki'),jdecode(''),'/46047/4660.html','true',[],'',''],
		['PAGE','4714',jdecode('Suzuki'),jdecode(''),'/46047/4714.html','true',[],'',''],
		['PAGE','41388',jdecode('Triumph'),jdecode(''),'/46047/41388.html','true',[],'',''],
		['PAGE','4687',jdecode('Yamaha'),jdecode(''),'/46047/4687.html','true',[],'',''],
		['PAGE','38711',jdecode('Lights+%2F+Reflector'),jdecode(''),'/46047/38711.html','true',[],'',''],
		['PAGE','45451',jdecode('LED+Blinker'),jdecode(''),'/46047/45451.html','true',[],'','']
	],'',''],
	['PAGE','4606',jdecode('Specialties'),jdecode(''),'/4606.html','true',[],'',''],
	['PAGE','4795',jdecode('Cont%40ct'),jdecode(''),'/4795.html','true',[],'',''],
	['PAGE','4822',jdecode('Distributor'),jdecode(''),'/4822.html','true',[],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Orbit';
theSitetree.paletteFamily='003366';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='172';
theSitetree.graphicsetId='202';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='003366';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Orbit',
				paletteFamily: 	'003366',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'172',
				graphicsetId: 	'202',
				contentColor: 	'FFFFFF',
				contentBGColor: '003366',
				a_color: 		'003366',
				b_color: 		'336699',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4495',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4495',
internalId:  '',
customField: '20091102-193333'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4552',
internalId:  '',
customField: '20091102-193602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46047',
internalId:  '',
customField: '20081223-190615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4579',
internalId:  '',
customField: '20090101-142137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74801',
internalId:  '',
customField: '20090104-141403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47200',
internalId:  '',
customField: '20090220-083555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8253',
internalId:  '',
customField: '20090220-083625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4660',
internalId:  '',
customField: '20090527-231243'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4714',
internalId:  '',
customField: '20090220-083715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41388',
internalId:  '',
customField: '20090220-083804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4687',
internalId:  '',
customField: '20090527-231529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38711',
internalId:  '',
customField: '20090220-083929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45451',
internalId:  '',
customField: '20090220-084020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4606',
internalId:  '',
customField: '20090104-145208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4795',
internalId:  '',
customField: '20090202-185541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4822',
internalId:  '',
customField: '20090101-144421'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXEO8';
var companyName   = 'inoxus+MOTORCYCLE+PARTS';
var htmlTitle	  = 'inoxus+MOTORCYCLE+PARTS';
var metaKeywords  = 'Kennzeichenhalter+aus+Edelstahl+und+diverse+LED+Produkte%3B+Spezialanfertigungen+nach+Mass%2C+Drehteile%2C+Fr%EF%BF%BDsteile+nach+Kundenwunsch';
var metaContents  = 'Kennzeichenhalter+aus+Edelstahl+und+diverse+LED+Produkte%3B+Spezialanfertigungen+nach+Mass%2C+Drehteile%2C+Fr%EF%BF%BDsteile+nach+Kundenwunsch%3B+Nummerhalter%2C+Nummernhalter';
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();
};
