/* [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','203',jdecode('Welcome'),jdecode(''),'/203.html','true',[],'',''],
	['PAGE','4456',jdecode('Jaydee+Coiffure'),jdecode(''),'/4456/index.html','true',[ 
		['PAGE','4477',jdecode('Team'),jdecode(''),'/4456/4477.html','true',[],'',''],
		['PAGE','4498',jdecode('Location'),jdecode(''),'/4456/4498.html','true',[],'',''],
		['PAGE','4519',jdecode('Pictures'),jdecode(''),'/4456/4519.html','true',[],'','']
	],'',''],
	['PAGE','4540',jdecode('Contact'),jdecode(''),'/4540.html','true',[],'','']];
var siteelementCount=6;
theSitetree.topTemplateName='Sober';
theSitetree.paletteFamily='F2710B';
theSitetree.keyvisualId='3485';
theSitetree.keyvisualName='kv_3485.jpg';
theSitetree.fontsetId='10435';
theSitetree.graphicsetId='10785';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFF7CE';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Sober',
				paletteFamily: 	'F2710B',
				keyvisualId: 	'3485',
				keyvisualName: 	'kv_3485.jpg',
				fontsetId: 		'10435',
				graphicsetId: 	'10785',
				contentColor: 	'000000',
				contentBGColor: 'FFF7CE',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'F2710B',
				e_color: 		'707070',
				f_color: 		'979696',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '203',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '203',
internalId:  '',
customField: '20110119-193531'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4456',
internalId:  '',
customField: '20110119-193344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4477',
internalId:  '',
customField: '20110119-193418'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4498',
internalId:  '',
customField: '20100502-205643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4519',
internalId:  '',
customField: '20100502-205643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4540',
internalId:  '',
customField: '20110119-193522'
};
var canonHostname = 'wsc.genotec.ch';
var accountId     = 'AGT010INX2Z3';
var companyName   = '';
var htmlTitle	  = 'Jaydee+Coiffure+Biel%2FBienne';
var metaKeywords  = 'lakeland.ch+...+das+ServiceCenter+f%C3%BCr+KMUs%2C+haircut.ch%2C+ScissorArtists%2C+Scherenk%C3%BCnstler%2C+Scissor%2C+Scissors%2C+Coiffeur+Biel%2C+Coiffeur+Bienne%2C+Coiffure+Biel%2C+Coiffure+Bienne%2C+Coiffuregesch%C3%A4fte%2C+Coiffuregesch%C3%A4fte+MB%2C+Chillout%2C+Jaydee%2C+Jaydee+Coiffure%2C+CC%2C+JD%2C+CMB%2C+Florastrasse+28%2C+rue+de+flore+28%2C+Biel%2C+Bienne%2C+Schweiz%2C+Suisse%2C+Rico+Janssen%2C+Marilyn+Bangerter%2C+Nadia+Boder%2C+Estefania+Gonzalez%2C+Magalie+Pampuri%2C+Vichitree+B%C3%BChler%2C+Malika+Rizzo%2C+Patricia+Grimm%2C+Luna+Lupinacci%2C+Rosanna+Oglialoro%2C+haare%2C+schneiden%2C+frisieren%2C+beauty%2C+salon%2C+beautysalon%2C+beauty-salon%2C+wohlf%C3%BChlen%2C+geniessen%2C+entspannen%2C+relaxen%2C+chillouten%2C+chillen%2C+haareschneiden%2C+haarschneiden%2C+stylen%2C+haare+verl%C3%A4ngern%2C+Haarverl%C3%A4ngerung%2C+ladiesnight%2C+ladies-night%2C+gutschein%2C+bon%2C+x-mas%2C+hair%2C+cheveux%2C+hair+professionals%2C+hair-professionals%2C+bart%2C+f%C3%A4rben%2C+meche%2C+Tecktonic%2C+tectonic';
var metaContents  = 'Jaydee+Coiffure+by+ScissorArtists+-+Kunst+ist+zu+tun%2C+wovon+andere+sprechen-lart+consiste+%C3%A0+r%C3%A9aliser+ce+que+les+autres+se+contentent+d%C3%A9voquer.+for+women%2C+men%2C+kids';
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();
};

