/* [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','401',jdecode('Home%2F+Kontakt'),jdecode(''), jdecode('%2F401.html'), 'true',[],'',''],
	['PAGE','5001',jdecode('Das+Team'),jdecode(''), jdecode('%2F5001.html'), 'true',[],'',''],
	['PAGE','452',jdecode('Kurse+in+Z%C3%BCrich'),jdecode(''), jdecode('%2F452.html'), 'true',[],'',''],
	['PAGE','5801',jdecode('Kursinformationen+'),jdecode(''), jdecode('%2F5801.html'), 'true',[],'',''],
	['PAGE','49401',jdecode('Kursdaten+2012'),jdecode(''), jdecode('%2F49401.html'), 'true',[],'',''],
	['PAGE','9001',jdecode('Unterlagen+anfordern'),jdecode(''), jdecode('%2F9001.html'), 'true',[],'',''],
	['PAGE','42001',jdecode('Referenzen'),jdecode(''), jdecode('%2F42001.html'), 'true',[],'',''],
	['PAGE','5022',jdecode('TV-Auftritte'),jdecode(''), jdecode('%2F5022.html'), 'true',[],'',''],
	['PAGE','8401',jdecode('Perspektiven'),jdecode(''), jdecode('%2F8401.html'), 'true',[],'',''],
	['PAGE','71512',jdecode('Jobs'),jdecode(''), jdecode('%2F71512.html'), 'true',[],'',''],
	['PAGE','77312',jdecode('Qualit%C3%A4t'),jdecode(''), jdecode('%2F77312.html'), 'true',[],'',''],
	['PAGE','38901',jdecode('Anmeldung'),jdecode(''), jdecode('%2F38901%2Findex.html'), 'true',[ 
		['PAGE','41601',jdecode('AGB'),jdecode(''), jdecode('%2F38901%2F41601.html'), 'true',[],'','']
	],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Sportive';
theSitetree.paletteFamily='F6F6E6';
theSitetree.keyvisualId='2679';
theSitetree.keyvisualName='schoenheit.jpg';
theSitetree.fontsetId='222';
theSitetree.graphicsetId='260';
theSitetree.contentColor='666666';
theSitetree.contentBGColor='F6F6E6';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MS'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Sportive',
				paletteFamily: 	'F6F6E6',
				keyvisualId: 	'2679',
				keyvisualName: 	'schoenheit.jpg',
				fontsetId: 		'222',
				graphicsetId: 	'260',
				contentColor: 	'666666',
				contentBGColor: 'F6F6E6',
				a_color: 		'F6F6E6',
				b_color: 		'CCCCC0',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49401',
internalId:  '',
customField: '20120215-192856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41601',
internalId:  '',
customField: '20090605-091815'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20110902-113114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20110209-134828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5801',
internalId:  '',
customField: '20111213-152529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20110902-113502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5022',
internalId:  '',
customField: '20110311-113536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8401',
internalId:  '',
customField: '20110323-132057'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9001',
internalId:  '',
customField: '20111101-102344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42001',
internalId:  '',
customField: '20120130-142636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38901',
internalId:  '',
customField: '20090824-082712'
};
webappMappings['7008']=webappMappings['7008-1912']={
webappId:    '7008',
documentId:  '38901',
internalId:  '1912',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77312',
internalId:  '',
customField: '20110407-090208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71512',
internalId:  '',
customField: '20110227-152157'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INEWPJ';
var companyName   = 'THE+STYLING+ACADEMY+Z%C3%9CRICH';
var htmlTitle	  = 'AUSBILDUNG+STYLIST+%2F+STYLISTIN%3A+Ein+Beruf+mit+Zukunft.';
var metaKeywords  = 'Ausbildung+Stylist%2C+Ausbildung+Stylistin%2C+Stylist%2C+Stylistin%2C+Stilberaterin%2C+Farbberaterin%2C+Imageberaterin%2C+Stilberatung%2C+Stilberatung%2C+Farbberatung%2C+Farbberatung%2C+Typbberaterin%2C+Typberatung%2C+Imageberatung%2C+Dresscode%2C+++www.the-styling-academy.ch%3B+Denise+von+Moos%2C+Modeschule%2C+Modeschulen%2C+Visagistenschule%2C+Visagistenschulen%2C+the+styling+academy.ch%3B+styling+academy%2C+styling-acadeny%2C+the+styling+academy%2C+Denise+von+Moos';
var metaContents  = 'THE+STYLING+ACADEMY+IN+ZUERICH%3A+Ausbildung+zum+Stylisten+%2F+Stylistin.+Weitere+Informationen+finden+Sie+auf+unserer+Homepage+www.the-styling-academy.ch.+';
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();
};

