/* [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','1801',jdecode('Page+d%26%23x27%3Baccueil'),jdecode(''),'/1801.html','true',[],'',''],
	['PAGE','6501',jdecode('NOS+PRODUITS'),jdecode(''),'/6501.html','true',[],'',''],
	['PAGE','22601',jdecode('Blog+'),jdecode(''),'/22601.html','true',[],'',''],
	['PAGE','96822',jdecode('inscription'),jdecode(''),'/96822.html','true',[],'','']];
var siteelementCount=4;
theSitetree.topTemplateName='Pixelprofi';
theSitetree.paletteFamily='330066';
theSitetree.keyvisualId='1112';
theSitetree.keyvisualName='autofahrer.jpg';
theSitetree.fontsetId='184';
theSitetree.graphicsetId='224';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='330066';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Pixelprofi',
				paletteFamily: 	'330066',
				keyvisualId: 	'1112',
				keyvisualName: 	'autofahrer.jpg',
				fontsetId: 		'184',
				graphicsetId: 	'224',
				contentColor: 	'FFFFFF',
				contentBGColor: '330066',
				a_color: 		'330066',
				b_color: 		'2E1AB4',
				c_color: 		'000000',
				d_color: 		'003399',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20101028-214816'
};
webappMappings['7050']=webappMappings['7050-998']={
webappId:    '7050',
documentId:  '22601',
internalId:  '998',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20101028-215137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22601',
internalId:  '',
customField: '20101028-215335'
};
webappMappings['7008']=webappMappings['7008-10637']={
webappId:    '7008',
documentId:  '96822',
internalId:  '10637',
customField: 'language:fr;country:FR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '1801',
internalId:  '',
customField: 'language:fr;country:FR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '6501',
internalId:  '',
customField: 'language:fr;country:FR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '96822',
internalId:  '',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96822',
internalId:  '',
customField: '20100917-180038'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '22601',
internalId:  '',
customField: 'language:fr;country:FR;'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW330INE8U6';
var companyName   = 'TRAVAILLEMAISONPROLIFER.CH';
var htmlTitle	  = '';
var metaKeywords  = 'travail+%C3%A0+la+maison%2Ctravail+%C3%A0+domicile%2Cjob+sur+internet%2Ctravail%2C+produits%2Ctravail+sur+internet%2C+emploi+avec+internet%2C+job%2Cmaison%2Cdomicile%2Cbusiness+en+ligne%2Ce-commerce%2Cjob+a+domicile%2Ctravail+s%C3%A9rieux.liste+de+prospects+';
var metaContents  = 'offre+travail+%C3%A0+la+maison+sur+internet%2Ctravail+a+domicile%2C+job+sur+internet%2C+travail+s%C3%A9rieux%2Ccr%C3%A9er+votre+business+en+ligne%2Ccr%C3%A9er+votre+liste+de+prospects+gratuitement+en+quelques+jours+et+viral+a+20+niveaux.';
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();
};

