/* [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','6101',jdecode('Scissors+News'),jdecode(''), jdecode('%2F6101.html'), 'true',[],'',''],
	['PAGE','30201',jdecode('Scissors+Salon'),jdecode(''), jdecode('%2F30201.html'), 'true',[],'',''],
	['PAGE','6122',jdecode('Scissors+Produkte'),jdecode(''), jdecode('%2F6122.html'), 'true',[],'',''],
	['PAGE','8301',jdecode('Scissors+Color'),jdecode(''), jdecode('%2F8301.html'), 'true',[],'',''],
	['PAGE','13501',jdecode('Haarverl%C3%A4ngerung'),jdecode(''), jdecode('%2F13501.html'), 'true',[],'',''],
	['PAGE','22522',jdecode('%C3%96ffnungszeiten'),jdecode(''), jdecode('%2F22522.html'), 'true',[],'',''],
	['PAGE','6164',jdecode('Kontakt+%2F+Jobs'),jdecode(''), jdecode('%2F6164.html'), 'true',[],'',''],
	['PAGE','7343',jdecode('Galerie+%2F+Presse'),jdecode(''), jdecode('%2F7343.html'), 'true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Intense';
theSitetree.paletteFamily='66956C';
theSitetree.keyvisualId='3504';
theSitetree.keyvisualName='kv_3504.jpg';
theSitetree.fontsetId='10439';
theSitetree.graphicsetId='10800';
theSitetree.contentColor='666666';
theSitetree.contentBGColor='B3D0B7';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2QE'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Intense',
				paletteFamily: 	'66956C',
				keyvisualId: 	'3504',
				keyvisualName: 	'kv_3504.jpg',
				fontsetId: 		'10439',
				graphicsetId: 	'10800',
				contentColor: 	'666666',
				contentBGColor: 'B3D0B7',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'AD401A',
				e_color: 		'727171',
				f_color: 		'3F3F3F',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6101',
internalId:  '',
customField: '20111126-130746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6164',
internalId:  '',
customField: '20110731-132852'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30201',
internalId:  '',
customField: '20110802-131757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6122',
internalId:  '',
customField: '20100105-161449'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8301',
internalId:  '',
customField: '20100816-145220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13501',
internalId:  '',
customField: '20111126-125137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22522',
internalId:  '',
customField: '20110813-093254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7343',
internalId:  '',
customField: '20110806-144226'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INE4AF';
var companyName   = 'Scissors-Hotline++++041+810+40+44';
var htmlTitle	  = 'SCISSORS+Hairstyling+-+We+take+care+of+your+hair.';
var metaKeywords  = 'Arth-Goldau%2C+Goldau%2C+Schwyz%2C+Steinen%2C+Frisoer%2C+Coiffure%2C+Coiffeur%2C+Paul+Mitchell%2C+Bernd+Prassel%2C+Styling%2C+Top+Styling%2C+Colorbar%2C+Coloration%2C+Haarfarbe%2C+Straehnen%2C+Mesche%2C+aussergewoehnliche+Qualitaet%2C+Wellness%2C+Haare%2C+Haar%2C+Arth%2C+Scissors%2C+Exclusiver+Coiffure%2C+Hochwertige+Produkte+von+Paul+Mitchell%2C+Wellness+fuer+Haar+und+Seele%2C+natuerliche+Produkte%2C+Jobs%2C+Paul+Mitchell+Focussalon%2C+Paul+Mitchell+Focus+Salon%2C+Ultimate+face%2C+Angus+Mitchell%2C+Zentralschweiz%2C+Tea+Tree%2C+Lemon+Sage%2C+Kosmetik%2C+Scissors+Hairstyling%2C+Extensions%2C+Haarverl%C3%A4ngerung%2C+Hairdreams%2C+Haarverdichtung.+beste+Haarqualit%C3%A4t.';
var metaContents  = 'Gepflegtes+und+gesundes+Haar.+Gemischt+mit+einer+grossen+Portion+Perfektion%2C+wunderbaren+Colorationstechnicken+oder+traumhaften+Haarverl%C3%A4ngerungen.+Eine+Wohlf%C3%BChloase+der+Sch%C3%B6nheit%21+Das+ist+Scissors+Hairstyling...+we+take+care+of+your+hair.';
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();
};

