/* [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','6201',jdecode('CH+Stellenzentrale'),jdecode(''), jdecode('%2F6201.html'), 'true',[],'',''],
	['PAGE','6252',jdecode('CH+Lehrstellenzentrale'),jdecode(''), jdecode('%2F6252.html'), 'true',[],'',''],
	['PAGE','49001',jdecode('Automobilgewerbe'),jdecode(''), jdecode('%2F49001.html'), 'true',[],'',''],
	['PAGE','33801',jdecode('Baugewerbe'),jdecode(''), jdecode('%2F33801.html'), 'true',[],'',''],
	['PAGE','52101',jdecode('Detailhandel+-+Verkauf'),jdecode(''), jdecode('%2F52101.html'), 'true',[],'',''],
	['PAGE','61901',jdecode('Druckgewerbe'),jdecode(''), jdecode('%2F61901.html'), 'true',[],'',''],
	['PAGE','45601',jdecode('Elektrogewerbe'),jdecode(''), jdecode('%2F45601.html'), 'true',[],'',''],
	['PAGE','17001',jdecode('Gastgewerbe+-+Hotel'),jdecode(''), jdecode('%2F17001.html'), 'true',[],'',''],
	['PAGE','14301',jdecode('Haustechnik+-+Geb%C3%A4ude'),jdecode(''), jdecode('%2F14301.html'), 'true',[],'',''],
	['PAGE','46701',jdecode('Mechanik+-+Elektronik'),jdecode(''), jdecode('%2F46701.html'), 'true',[],'',''],
	['PAGE','6901',jdecode('Metallbau+-+Stahlbau'),jdecode(''), jdecode('%2F6901.html'), 'true',[],'',''],
	['PAGE','58401',jdecode('Nahrung'),jdecode(''), jdecode('%2F58401.html'), 'true',[],'',''],
	['PAGE','50101',jdecode('Textilgewerbe'),jdecode(''), jdecode('%2F50101.html'), 'true',[],'',''],
	['PAGE','30301',jdecode('Transport+-+Logistik'),jdecode(''), jdecode('%2F30301.html'), 'true',[],'',''],
	['PAGE','55201',jdecode('Uni+-+Hochschulen'),jdecode(''), jdecode('%2F55201.html'), 'true',[],'',''],
	['PAGE','66901',jdecode('Versicherung'),jdecode(''), jdecode('%2F66901.html'), 'true',[],'',''],
	['PAGE','35101',jdecode('Stellen+Schweiz+-+CH'),jdecode(''), jdecode('%2F35101.html'), 'true',[],'',''],
	['PAGE','40101',jdecode('Job+-+International'),jdecode(''), jdecode('%2F40101.html'), 'true',[],'',''],
	['PAGE','53001',jdecode('Arbeitswelt+-+Links'),jdecode(''), jdecode('%2F53001.html'), 'true',[],'',''],
	['PAGE','19701',jdecode('Verb%C3%A4nde'),jdecode(''), jdecode('%2F19701.html'), 'true',[],'',''],
	['PAGE','6601',jdecode('Stelleninserat+-+info'),jdecode(''), jdecode('%2F6601.html'), 'true',[],'',''],
	['PAGE','11922',jdecode('Inserat+-+Preise+-+WIR'),jdecode(''), jdecode('%2F11922.html'), 'true',[],'',''],
	['PAGE','12001',jdecode('Kontakt'),jdecode(''), jdecode('%2F12001.html'), 'true',[],'',''],
	['PAGE','6801',jdecode('AGB+-+Datenschutz'),jdecode(''), jdecode('%2F6801.html'), 'true',[],'','']];
var siteelementCount=24;
theSitetree.topTemplateName='Quadrat';
theSitetree.paletteFamily='4755D5';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10449';
theSitetree.graphicsetId='10838';
theSitetree.contentColor='A00000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Quadrat',
				paletteFamily: 	'4755D5',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10449',
				graphicsetId: 	'10838',
				contentColor: 	'A00000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'4755D5',
				e_color: 		'807E7E',
				f_color: 		'434242',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6201',
internalId:  '',
customField: '20110201-212947'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49001',
internalId:  '',
customField: '20110201-213124'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12001',
internalId:  '',
customField: '20110201-220741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6252',
internalId:  '',
customField: '20110822-193821'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6901',
internalId:  '',
customField: '20110201-215043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6601',
internalId:  '',
customField: '20110501-111856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14301',
internalId:  '',
customField: '20110630-112743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6801',
internalId:  '',
customField: '20110201-220853'
};
webappMappings['7008']=webappMappings['7008-9546']={
webappId:    '7008',
documentId:  '11922',
internalId:  '9546',
customField: 'language:de;country:CH;'
};
webappMappings['7008']=webappMappings['7008-9547']={
webappId:    '7008',
documentId:  '12001',
internalId:  '9547',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11922',
internalId:  '',
customField: '20110801-220742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58401',
internalId:  '',
customField: '20110512-194448'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17001',
internalId:  '',
customField: '20110201-214524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19701',
internalId:  '',
customField: '20110201-220428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50101',
internalId:  '',
customField: '20110201-215534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30301',
internalId:  '',
customField: '20110201-215707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33801',
internalId:  '',
customField: '20110201-213839'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35101',
internalId:  '',
customField: '20110518-170139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40101',
internalId:  '',
customField: '20110501-105126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45601',
internalId:  '',
customField: '20111005-221402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46701',
internalId:  '',
customField: '20110601-210224'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52101',
internalId:  '',
customField: '20110201-213516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53001',
internalId:  '',
customField: '20110201-220325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55201',
internalId:  '',
customField: '20110201-215832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61901',
internalId:  '',
customField: '20110501-111125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66901',
internalId:  '',
customField: '20110201-220037'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW330INEB9R';
var companyName   = '+++++++++++www.STELLENzentrale.ch';
var htmlTitle	  = 'www.stellenzentrale.ch';
var metaKeywords  = 'Stellenzentrale%2C+Stellen-Zentrale%2C+CH+Stellenzentrale%2C+CH+Stellen-Zentrale%2C+Lehrstellenzentrale%2C%0D%0ACH+Lehrstellenzentrale%2C+Lehr-Stellenzentrale%2C+CH+Lehr-stellenzentrale%2C+Lehrstellen-vermittlung%2C+CH+Stellen%2C+Stellen+inserieren%2C+Stelleninserat%2C+offene+Stellen%2C+neue+Stellen%2C+freie+Stellen%2C+aktuelle+Stellen%2C+vakante+Stellen%2C+CH-LZ%2C+CH-ISZ%2C+neue+Stellen+2011%2C+Lehr-Stellen-Zentrale%2C+WIR+-+Inserat%2C+Arbeitsplatz%2C+Stelle%2C+Job%2C+Personal%2C+Karriere%2C+HR%2C+Anstellung%2C+Teilzeit%2C+Neu%2C+';
var metaContents  = 'Stellenzentrale%2C+Stellen-Zentrale%2C+CH+Stellenzentrale%2C+CH+Stellen-Zentrale%2C+Lehr-stellenzentrale%2C+CH+Lehrstellenzentrale%2C+Stellenzentrale+Schweiz%2C+CH-LZ%2C+CH-ISZ%2C+Stelleninserat%2C+Stellenpublikation%2C+Inserat%2C+Lehrstellenvermittlung%2C+Stellen%2C+Stellen+Schweiz%2C+Lehrstellen%2C+Stellen+inserieren%2C+Stellen+publizieren%2C+offene+Stellen%2C+aktuelle+Stellen%2C+freie+Stellen%2C+vakante+Stellen%2C+2011%2C+neue+Stellen%2C+';
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();
};

