/* [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','4598',jdecode('Home'),jdecode(''), jdecode('%2F4598.html'), 'true',[],'',''],
	['PAGE','56101',jdecode('SLB+SPRAYS+AU+POIVRE'),jdecode(''), jdecode('%2F56101%2Findex.html'), 'true',[ 
		['PAGE','6415',jdecode('English'),jdecode(''), jdecode('%2F56101%2F6415.html'), 'true',[],'',''],
		['PAGE','7466',jdecode('Fran%C3%A7ais'),jdecode(''), jdecode('%2F56101%2F7466.html'), 'true',[],'',''],
		['PAGE','7493',jdecode('Deutsch'),jdecode(''), jdecode('%2F56101%2F7493.html'), 'true',[],'',''],
		['PAGE','7203',jdecode('Portuguese'),jdecode(''), jdecode('%2F56101%2F7203.html'), 'true',[],'','']
	],'',''],
	['PAGE','56501',jdecode('MINILAB'),jdecode(''), jdecode('%2F56501%2Findex.html'), 'true',[ 
		['PAGE','7823',jdecode('Fran%C3%A7ais'),jdecode(''), jdecode('%2F56501%2F7823.html'), 'true',[],'',''],
		['PAGE','4655',jdecode('English'),jdecode(''), jdecode('%2F56501%2F4655.html'), 'true',[],'',''],
		['PAGE','7850',jdecode('Allemand'),jdecode(''), jdecode('%2F56501%2F7850.html'), 'true',[],'',''],
		['PAGE','7796',jdecode('Portuguese'),jdecode(''), jdecode('%2F56501%2F7796.html'), 'true',[],'','']
	],'',''],
	['PAGE','56901',jdecode('QUICKTESTPen'),jdecode(''), jdecode('%2F56901%2Findex.html'), 'true',[ 
		['PAGE','4709',jdecode('English'),jdecode(''), jdecode('%2F56901%2F4709.html'), 'true',[],'',''],
		['PAGE','9044',jdecode('Fran%C3%A7ais'),jdecode(''), jdecode('%2F56901%2F9044.html'), 'true',[],'',''],
		['PAGE','9071',jdecode('Deutsch'),jdecode(''), jdecode('%2F56901%2F9071.html'), 'true',[],'',''],
		['PAGE','9017',jdecode('Portugu%C3%AAse'),jdecode(''), jdecode('%2F56901%2F9017.html'), 'true',[],'','']
	],'',''],
	['PAGE','22705',jdecode('MAGIC+GLUE'),jdecode(''), jdecode('%2F22705%2Findex.html'), 'true',[ 
		['PAGE','22732',jdecode('Fran%C3%A7ais'),jdecode(''), jdecode('%2F22705%2F22732.html'), 'true',[],'',''],
		['PAGE','22759',jdecode('Deutsch'),jdecode(''), jdecode('%2F22705%2F22759.html'), 'true',[],'','']
	],'',''],
	['PAGE','21505',jdecode('Shop+on+line'),jdecode(''), jdecode('%2F21505.html'), 'true',[],'',''],
	['PAGE','12106',jdecode('CONTACT+%2F+KONTAKT'),jdecode(''), jdecode('%2F12106%2Findex.html'), 'true',[ 
		['PAGE','13402',jdecode('CONTACT+%2F+KONTAKT+%28follow+up+page%29'),jdecode(''), jdecode('%2F12106%2F13402.html'), 'false',[],'','']
	],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Kreis';
theSitetree.paletteFamily='4D4CD2';
theSitetree.keyvisualId='581';
theSitetree.keyvisualName='autovermietung.jpg';
theSitetree.fontsetId='124';
theSitetree.graphicsetId='140';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Kreis',
				paletteFamily: 	'4D4CD2',
				keyvisualId: 	'581',
				keyvisualName: 	'autovermietung.jpg',
				fontsetId: 		'124',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4598',
internalId:  '1006',
customField: '1006'
};
webappMappings['4001']=webappMappings['4001-NDzC_BIz2_cFBa_r']={
webappId:    '4001',
documentId:  '21505',
internalId:  'NDzC_BIz2_cFBa_r',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56101',
internalId:  '',
customField: '20111004-222310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6415',
internalId:  '',
customField: '20111005-103410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4598',
internalId:  '',
customField: '20111004-153111'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7466',
internalId:  '',
customField: '20111005-103429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7493',
internalId:  '',
customField: '20111005-103636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7203',
internalId:  '',
customField: '20090912-085451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56501',
internalId:  '',
customField: '20111004-163052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7823',
internalId:  '',
customField: '20111004-163507'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4655',
internalId:  '',
customField: '20111004-163629'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7850',
internalId:  '',
customField: '20111004-163710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7796',
internalId:  '',
customField: '20111004-163735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56901',
internalId:  '',
customField: '20111003-155803'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4709',
internalId:  '',
customField: '20090916-154648'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9044',
internalId:  '',
customField: '20090912-090112'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9071',
internalId:  '',
customField: '20090912-090205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9017',
internalId:  '',
customField: '20090912-090319'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22705',
internalId:  '',
customField: '20111003-155843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22732',
internalId:  '',
customField: '20090912-090359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22759',
internalId:  '',
customField: '20090912-090500'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21505',
internalId:  '',
customField: '20061105-113106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12106',
internalId:  '',
customField: '20111003-112556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13402',
internalId:  '',
customField: '20040313-193245'
};
webappMappings['7008']=webappMappings['7008-3502']={
webappId:    '7008',
documentId:  '12106',
internalId:  '3502',
customField: 'language:fr;country:FR;'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INX2WD';
var companyName   = 'SLB+S%C3%A9curit%C3%A9';
var htmlTitle	  = 'www.swiss-netshop.ch';
var metaKeywords  = 'LEIGH-SMITH+EIRA+POLAR+EXPEDITION+SPONSOR+swiss-netshop++SWISSSOY+SOY+MEDALLIONS+VEGAN+VEGETARIAN+FOOD+HEALTH+FITNESS+SLB+DEFENCE+PEPPER+SPRAY+NARCOTEST+MINLAB+QUICKTEST+MAGIC+GLUE+TRAINING+FOOD+ecological+economic+equitable+shop+cuisine+planete+equitable++';
var metaContents  = 'LEIGH-SMITH+EIRA+POLAR+EXPEDITION+SPONSOR+swiss-netshop++SWISSSOY+SOY+MEDALLIONS+VEGAN+VEGETARIAN+FOOD+HEALTH+FITNESS+SLB+DEFENCE+PEPPER+SPRAY+NARCOTEST+MINLAB+QUICKTEST+MAGIC+GLUE+TRAINING+FOOD+ecological+economic+equitable+shop+cuisine+planete+equitable++';
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();
};

