/* [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','1601',jdecode('Accueil+-+Liens'),jdecode(''),'/1601.html','true',[],'',''],
	['PAGE','11301',jdecode('Peinture+sur+verre'),jdecode(''),'/11301.html','true',[],'',''],
	['PAGE','13901',jdecode('Verre+industriel'),jdecode(''),'/13901.html','true',[],'',''],
	['PAGE','15901',jdecode('Vitrerie'),jdecode(''),'/15901.html','true',[],'',''],
	['PAGE','19001',jdecode('Restaurations'),jdecode(''),'/19001/index.html','true',[ 
		['PAGE','19022',jdecode('Montreux+2006'),jdecode(''),'/19001/19022.html','true',[],'','']
	],'',''],
	['PAGE','22801',jdecode('Contemporain'),jdecode(''),'/22801.html','true',[],'',''],
	['PAGE','26601',jdecode('G%C3%A9om%C3%A9tries'),jdecode(''),'/26601.html','true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Bigcity_Sydney';
theSitetree.paletteFamily='633A65';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='21081';
theSitetree.graphicsetId='13176';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='633A65';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Bigcity_Sydney',
				paletteFamily: 	'633A65',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'21081',
				graphicsetId: 	'13176',
				contentColor: 	'FFFFFF',
				contentBGColor: '633A65',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1601',
internalId:  '',
customField: '20100726-183703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15901',
internalId:  '',
customField: '20090125-164846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11301',
internalId:  '',
customField: '20090125-164708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13901',
internalId:  '',
customField: '20090714-192336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19001',
internalId:  '',
customField: '20090707-164717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19022',
internalId:  '',
customField: '20090125-165005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22801',
internalId:  '',
customField: '20090714-193016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26601',
internalId:  '',
customField: '20071102-191514'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0IN2V0F';
var companyName   = 'ATELIER+DE+VITRAIL';
var htmlTitle	  = 'ATELIER+DE+VITRAIL+SUISSE';
var metaKeywords  = 'vitrail%2C+vitraux%2C+exposition%2Cart%2C+vitrail%2C+atelier+de+vitrail+suisse.+Cr%C3%A9ationde+vitail%2C+vitrail+dart%2C+cr%C3%A9ation+de+vitraux%2C+restauration+de+vitraux%2Cpeinture+vitrail%2C+peinture+sur+verre%2C+peinture+en+vitrail%2C+fabrication+de+vitraux%2C+exposition+de+vitraux%2C+exposition+de+vitrail%2C+Grisaille%2C+%C3%A9mail%2C+jaune+dargent%2C++acide%2C+dalle+de+verre.+Interventions+dans+toute+la+Suisse.tiffany%2Cverre%2C+couleur%2C+lumi%C3%A8re%2C+vitrailliste%2C+artiste%2C+peintre%2C+grisaille%2C+%C3%A9mail%2C+jaune+dargent%2C+acide%2C+plomb%2C++architecture%2C+sacr%C3%A9%2C+civil%2C+%C3%A9glise%2C+temple%2C+cr%C3%A9ation%2C+restauration%2C+d%C3%A9coration%2C++peinture%2C+';
var metaContents  = 'vitrail%2C+atelier+de+vitrail+suisse.+Cr%C3%A9ationde+vitail%2C+vitrail+dart%2C+cr%C3%A9ation+de+vitraux%2C+restauration+de+vitraux%2Cpeinture+vitrail%2C+peinture+sur+verre%2C+peinture+en+vitrail%2C+fabrication+de+vitraux%2C+exposition+de+vitraux%2C+exposition+de+vitrail%2C+Grisaille%2C+%C3%A9mail%2C+jaune+dargent%2C++acide%2C+dalle+de+verre.+Interventions+dans+toute+la+Suisse.';
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();
};
