/* [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(''), jdecode('%2F4495.html'), 'true',[],'',''],
	['PAGE','4552',jdecode('News'),jdecode(''), jdecode('%2F4552.html'), 'true',[],'',''],
	['PAGE','46047',jdecode('Products'),jdecode(''), jdecode('%2F46047%2Findex.html'), 'true',[ 
		['PAGE','4579',jdecode('Information'),jdecode(''), jdecode('%2F46047%2F4579.html'), 'true',[],'',''],
		['PAGE','74801',jdecode('Aprilia'),jdecode(''), jdecode('%2F46047%2F74801.html'), 'true',[],'',''],
		['PAGE','47200',jdecode('Ducati'),jdecode(''), jdecode('%2F46047%2F47200.html'), 'true',[],'',''],
		['PAGE','8253',jdecode('Honda'),jdecode(''), jdecode('%2F46047%2F8253.html'), 'true',[],'',''],
		['PAGE','4660',jdecode('Kawasaki'),jdecode(''), jdecode('%2F46047%2F4660.html'), 'true',[],'',''],
		['PAGE','4714',jdecode('Suzuki'),jdecode(''), jdecode('%2F46047%2F4714.html'), 'true',[],'',''],
		['PAGE','41388',jdecode('Triumph'),jdecode(''), jdecode('%2F46047%2F41388.html'), 'true',[],'',''],
		['PAGE','4687',jdecode('Yamaha'),jdecode(''), jdecode('%2F46047%2F4687.html'), 'true',[],'',''],
		['PAGE','38711',jdecode('Lights+%2F+Reflector'),jdecode(''), jdecode('%2F46047%2F38711.html'), 'true',[],'',''],
		['PAGE','45451',jdecode('LED+Blinker'),jdecode(''), jdecode('%2F46047%2F45451.html'), 'true',[],'','']
	],'',''],
	['PAGE','4606',jdecode('Specialties'),jdecode(''), jdecode('%2F4606.html'), 'true',[],'',''],
	['PAGE','83401',jdecode('Streetwear'),jdecode(''), jdecode('%2F83401.html'), 'true',[],'',''],
	['PAGE','4795',jdecode('Cont%40ct'),jdecode(''), jdecode('%2F4795.html'), 'true',[],'',''],
	['PAGE','4822',jdecode('Distributor'),jdecode(''), jdecode('%2F4822.html'), 'true',[],'','']];
var siteelementCount=17;
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 prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MX'
};
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: '20111222-131622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4552',
internalId:  '',
customField: '20111222-132633'
};
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: '20111222-134630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4714',
internalId:  '',
customField: '20111222-140419'
};
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: '20111222-141219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45451',
internalId:  '',
customField: '20111222-142552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4606',
internalId:  '',
customField: '20111222-132559'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4795',
internalId:  '',
customField: '20101222-095629'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4822',
internalId:  '',
customField: '20101222-095658'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83401',
internalId:  '',
customField: '20110512-192455'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.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+Fraesteile+nach+Kundenwunsch';
var metaContents  = 'Kennzeichenhalter+aus+Edelstahl+und+diverse+LED+Produkte%3B+Spezialanfertigungen+nach+Mass%2C+Drehteile%2C+Fraesteile+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();
};

