/* [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','5701',jdecode('Startseite'),jdecode(''), jdecode('%2F5701.html'), 'true',[],'',''],
	['PAGE','6201',jdecode('Wir+%C3%BCber+uns'),jdecode(''), jdecode('%2F6201.html'), 'true',[],'',''],
	['PAGE','6222',jdecode('Team'),jdecode(''), jdecode('%2F6222.html'), 'true',[],'',''],
	['PAGE','6401',jdecode('Produkte'),jdecode(''), jdecode('%2F6401.html'), 'true',[],'',''],
	['PAGE','6422',jdecode('Preise+'),jdecode(''), jdecode('%2F6422.html'), 'true',[],'',''],
	['PAGE','13501',jdecode('Prozentbuch'),jdecode(''), jdecode('%2F13501.html'), 'true',[],'',''],
	['PAGE','6464',jdecode('Events'),jdecode(''), jdecode('%2F6464.html'), 'true',[],'',''],
	['PAGE','6485',jdecode('Knigge+goes+color'),jdecode(''), jdecode('%2F6485.html'), 'true',[],'',''],
	['PAGE','6506',jdecode('Terminanfrage%2FKontakt'),jdecode(''), jdecode('%2F6506.html'), 'true',[],'',''],
	['PAGE','6527',jdecode('Ihr+Weg+zu+uns'),jdecode(''), jdecode('%2F6527.html'), 'true',[],'',''],
	['PAGE','6548',jdecode('Lage'),jdecode(''), jdecode('%2F6548.html'), 'true',[],'',''],
	['PAGE','6569',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F6569.html'), 'true',[],'',''],
	['PAGE','6590',jdecode('Links'),jdecode(''), jdecode('%2F6590.html'), 'true',[],'',''],
	['PAGE','23601',jdecode('Fotos'),jdecode(''), jdecode('%2F23601%2Findex.html'), 'true',[ 
		['PAGE','23622',jdecode('Event+vom+13.2.2009'),jdecode(''), jdecode('%2F23601%2F23622.html'), 'true',[],'','']
	],'',''],
	['PAGE','31201',jdecode('Events+RIDE-IN'),jdecode(''), jdecode('%2F31201.html'), 'true',[],'',''],
	['PAGE','35601',jdecode('misshandicap2009'),jdecode(''), jdecode('%2F35601.html'), 'true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Natural';
theSitetree.paletteFamily='136F83';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='154';
theSitetree.graphicsetId='170';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FCFCF4';
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: 			'Natural',
				paletteFamily: 	'136F83',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'154',
				graphicsetId: 	'170',
				contentColor: 	'000000',
				contentBGColor: 'FCFCF4',
				a_color: 		'136F83',
				b_color: 		'66CCFF',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20110925-152134'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6201',
internalId:  '',
customField: '20090211-194135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6222',
internalId:  '',
customField: '20120212-161632'
};
webappMappings['7008']=webappMappings['7008-759']={
webappId:    '7008',
documentId:  '6506',
internalId:  '759',
customField: 'language:de;country:CH;'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '6527',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '6548',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:true;'
};
webappMappings['1002']=webappMappings['1002-6569abw0x0ine7o1']={
webappId:    '1002',
documentId:  '6569',
internalId:  '6569abw0x0ine7o1',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6506',
internalId:  '',
customField: '20090209-190641'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6401',
internalId:  '',
customField: '20090314-135954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6422',
internalId:  '',
customField: '20120212-161847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6590',
internalId:  '',
customField: '20090224-190820'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6464',
internalId:  '',
customField: '20120212-163519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6485',
internalId:  '',
customField: '20090209-185753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6548',
internalId:  '',
customField: '20090209-190816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6527',
internalId:  '',
customField: '20090209-190744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13501',
internalId:  '',
customField: '20100522-172128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6569',
internalId:  '',
customField: '20090209-191056'
};
webappMappings['1501']=webappMappings['1501-28439320']={
webappId:    '1501',
documentId:  '5701',
internalId:  '28439320',
customField: '1501'
};
webappMappings['7060']=webappMappings['7060-a4b6b5f7e399aecafcf812eff517fbfe']={
webappId:    '7060',
documentId:  '23622',
internalId:  'a4b6b5f7e399aecafcf812eff517fbfe',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23601',
internalId:  '',
customField: '20090215-143220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23622',
internalId:  '',
customField: '20090215-180607'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31201',
internalId:  '',
customField: '20101101-192503'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35601',
internalId:  '',
customField: '20101101-191945'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INE7O1';
var companyName   = 'Coiffeur+Tscharner';
var htmlTitle	  = 'Coiffeur+Tscharner';
var metaKeywords  = 'Cornelia+Hoebenstreit%2C+Claudia+Brand%2C+Michelle+Knobel%2C+Ursula+Burri%2C+Tamara+Schuler%2C+Tscharner%2C+Coiffeur%2C+Coiffeur+Tscharner%2C+Wabern%2C+Tscharner+Wabern%2C+Coiffeur+Wabern%2C+Schwarzkopf%2C+Wellness%2C+Verwoehnen%2C+Styling+Wabern%2C+Styling%2C+Farb-+und+Stylberatung%2C+Outfitberatung%2C+Die+Mobiliar%2C+BEKB%2C+Dorfstrasse+Wabern%2C+Daniel+Hoebenstreit%2C+Hanspeter+Merz%2C+Marcel+Baeriswyl%2C+Heinrich+Gasser%2C+Rahel+K%C3%BCng%2C+Peter+K%C3%BCng%2C+Elsbeth+K%C3%BCng%2C+Anita+Ritschard%2C+Sandra+Hoebenstreit%2C+Kurt+Howald%2C+Monique+Scheiwiller+Howald%2C+Monika+Knobel%2C+Kilian+Egger%2C+Melchior+Stoller%2C+Beatrice+Stoller%2C+RIDE-IN%2C+Ride-in%2C+ride-in%2C+misshandicap%2C+Tamara+Sahra+Huber%2C+Cornelia+Hoebenstreit';
var metaContents  = 'Coiffeur+Wabern%2C+Haare+schneiden+Wabern%2C+Styling%2C+Hairstyling%2C+Wellness%2C+Sch%C3%B6nheit%2C+Coiffure';
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();
};

