/* [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','45122',jdecode('Fran%C3%A7ais'),jdecode(''), jdecode('%2F45122%2Findex.html'), 'true',[ 
		['PAGE','45312',jdecode('L%26%23x27%3BEMPIRE+OTTOMAN'),jdecode(''), jdecode('%2F45122%2F45312.html'), 'true',[],'',''],
		['PAGE','47412',jdecode('RESPECT+ET+OUVERTURE'),jdecode(''), jdecode('%2F45122%2F47412.html'), 'true',[],'',''],
		['PAGE','48212',jdecode('L%26%23x27%3BEMPEREUR+ABDULMEDJID'),jdecode(''), jdecode('%2F45122%2F48212.html'), 'true',[],'',''],
		['PAGE','49312',jdecode('L%26%23x27%3BEXIL'),jdecode(''), jdecode('%2F45122%2F49312.html'), 'true',[],'',''],
		['PAGE','49812',jdecode('MES+PARENTS'),jdecode(''), jdecode('%2F45122%2F49812.html'), 'true',[],'',''],
		['PAGE','49833',jdecode('PRINCE+BURHANEDDIN+DJEM'),jdecode(''), jdecode('%2F45122%2F49833.html'), 'true',[],'',''],
		['PAGE','69233',jdecode('TROIS+ANS+SANS+TOI'),jdecode(''), jdecode('%2F45122%2F69233.html'), 'true',[],'',''],
		['PAGE','49854',jdecode('SA+FAMILLE+CHERIE'),jdecode(''), jdecode('%2F45122%2F49854.html'), 'true',[],'',''],
		['PAGE','67733',jdecode('JOSEPHINE'),jdecode(''), jdecode('%2F45122%2F67733.html'), 'true',[],'',''],
		['PAGE','49875',jdecode('MON+ECOLE'),jdecode(''), jdecode('%2F45122%2F49875.html'), 'true',[],'',''],
		['PAGE','49896',jdecode('PRINCESSE+TATIANA'),jdecode(''), jdecode('%2F45122%2F49896.html'), 'true',[],'',''],
		['PAGE','49917',jdecode('MA+PHOTO+PREFEREE'),jdecode(''), jdecode('%2F45122%2F49917.html'), 'true',[],'',''],
		['PAGE','49938',jdecode('SIFNOS'),jdecode(''), jdecode('%2F45122%2F49938.html'), 'true',[],'',''],
		['PAGE','49959',jdecode('CHRYSSOPIGHI'),jdecode(''), jdecode('%2F45122%2F49959.html'), 'true',[],'',''],
		['PAGE','67033',jdecode('ATHENES'),jdecode(''), jdecode('%2F45122%2F67033.html'), 'true',[],'',''],
		['PAGE','49980',jdecode('REUNION+DE+FAMILLE'),jdecode(''), jdecode('%2F45122%2F49980.html'), 'true',[],'',''],
		['PAGE','50001',jdecode('HELENE'),jdecode(''), jdecode('%2F45122%2F50001.html'), 'true',[],'','']
	],'',''],
	['PAGE','45101',jdecode('English'),jdecode(''), jdecode('%2F45101%2Findex.html'), 'true',[ 
		['PAGE','701',jdecode('THE+OTTOMAN+EMPIRE'),jdecode(''), jdecode('%2F45101%2F701.html'), 'true',[],'',''],
		['PAGE','11901',jdecode('RESPECT'),jdecode(''), jdecode('%2F45101%2F11901.html'), 'true',[],'',''],
		['PAGE','11943',jdecode('EMPEROR+ABDULMEJID'),jdecode(''), jdecode('%2F45101%2F11943.html'), 'true',[],'',''],
		['PAGE','10622',jdecode('EXILE'),jdecode(''), jdecode('%2F45101%2F10622.html'), 'true',[],'',''],
		['PAGE','10601',jdecode('MY+PARENTS'),jdecode(''), jdecode('%2F45101%2F10601.html'), 'true',[],'',''],
		['PAGE','33901',jdecode('PRINCE+BURHANEDDIN+DJEM'),jdecode(''), jdecode('%2F45101%2F33901.html'), 'true',[],'',''],
		['PAGE','69212',jdecode('THREE+YEARS+WITHOUT+YOU'),jdecode(''), jdecode('%2F45101%2F69212.html'), 'true',[],'',''],
		['PAGE','37401',jdecode('HIS+BELOVED+FAMILY'),jdecode(''), jdecode('%2F45101%2F37401.html'), 'true',[],'',''],
		['PAGE','67712',jdecode('JOSEPHINE'),jdecode(''), jdecode('%2F45101%2F67712.html'), 'true',[],'',''],
		['PAGE','24401',jdecode('SCHOOL'),jdecode(''), jdecode('%2F45101%2F24401.html'), 'true',[],'',''],
		['PAGE','11964',jdecode('PRINCESS+TATIANA'),jdecode(''), jdecode('%2F45101%2F11964.html'), 'true',[],'',''],
		['PAGE','26801',jdecode('MY+FAVORITE+PICTURE'),jdecode(''), jdecode('%2F45101%2F26801.html'), 'true',[],'',''],
		['PAGE','11985',jdecode('SIFNOS'),jdecode(''), jdecode('%2F45101%2F11985.html'), 'true',[],'',''],
		['PAGE','30601',jdecode('CHRYSSOPIGHI'),jdecode(''), jdecode('%2F45101%2F30601.html'), 'true',[],'',''],
		['PAGE','67012',jdecode('ATHENS'),jdecode(''), jdecode('%2F45101%2F67012.html'), 'true',[],'',''],
		['PAGE','24422',jdecode('FAMILY+REUNION'),jdecode(''), jdecode('%2F45101%2F24422.html'), 'true',[],'',''],
		['PAGE','29501',jdecode('HELENE'),jdecode(''), jdecode('%2F45101%2F29501.html'), 'true',[],'',''],
		['PAGE','32506',jdecode('Livre+d%26%23x27%3Bor'),jdecode(''), jdecode('%2F45101%2F32506.html'), 'true',[],'',''],
		['PAGE','32501',jdecode('Entr%C3%A9es'),jdecode(''), jdecode('%2F45101%2F32501.html'), 'false',[],'',''],
		['PAGE','33301',jdecode('Weblog'),jdecode(''), jdecode('%2F45101%2F33301.html'), 'true',[],'','']
	],'','']];
var siteelementCount=39;
theSitetree.topTemplateName='Basic';
theSitetree.paletteFamily='36566E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10828';
theSitetree.graphicsetId='11283';
theSitetree.contentColor='36566E';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MX'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Basic',
				paletteFamily: 	'36566E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10828',
				graphicsetId: 	'11283',
				contentColor: 	'36566E',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-32506abw0x0in2f1g']={
webappId:    '1002',
documentId:  '32506',
internalId:  '32506abw0x0in2f1g',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47412',
internalId:  '',
customField: '20120107-034311'
};
webappMappings['7050']=webappMappings['7050-130']={
webappId:    '7050',
documentId:  '33301',
internalId:  '130',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11943',
internalId:  '',
customField: '20120109-065234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10622',
internalId:  '',
customField: '20120118-214739'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10601',
internalId:  '',
customField: '20120107-002718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11964',
internalId:  '',
customField: '20120107-003810'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20120109-172401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11901',
internalId:  '',
customField: '20120109-065139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33901',
internalId:  '',
customField: '20120107-002948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37401',
internalId:  '',
customField: '20120109-172555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24401',
internalId:  '',
customField: '20120107-003625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11985',
internalId:  '',
customField: '20120109-092709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30601',
internalId:  '',
customField: '20120109-092752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24422',
internalId:  '',
customField: '20120107-142745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29501',
internalId:  '',
customField: '20120109-065616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32506',
internalId:  '',
customField: '20081203-192847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33301',
internalId:  '',
customField: '20090130-182100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26801',
internalId:  '',
customField: '20120107-003835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32501',
internalId:  '',
customField: '20081203-192847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45122',
internalId:  '',
customField: '20120109-064547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49312',
internalId:  '',
customField: '20120109-084821'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45101',
internalId:  '',
customField: '20120109-064942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45312',
internalId:  '',
customField: '20120107-005532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48212',
internalId:  '',
customField: '20120109-172010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49812',
internalId:  '',
customField: '20120107-144736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49833',
internalId:  '',
customField: '20120107-145929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49854',
internalId:  '',
customField: '20120107-145703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49875',
internalId:  '',
customField: '20120106-235251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49896',
internalId:  '',
customField: '20120106-235442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49917',
internalId:  '',
customField: '20120106-235513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49938',
internalId:  '',
customField: '20120109-092506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49959',
internalId:  '',
customField: '20120109-092526'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49980',
internalId:  '',
customField: '20120107-142918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50001',
internalId:  '',
customField: '20120107-000354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67012',
internalId:  '',
customField: '20120107-004424'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67033',
internalId:  '',
customField: '20120106-235959'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67712',
internalId:  '',
customField: '20120109-172615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67733',
internalId:  '',
customField: '20120109-172202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69212',
internalId:  '',
customField: '20120109-092405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69233',
internalId:  '',
customField: '20120109-092434'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '45122',
internalId:  '1006',
customField: '1006'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0IN2F1G';
var companyName   = 'His+Imperial+Highness+Prince+Selim+Djem';
var htmlTitle	  = '';
var metaKeywords  = 'Royalty%2C+Novel';
var metaContents  = 'Ottoman+prince.+In+the+following+pages%2C+I+have+summarized+my+understanding+of+the+rise+and+fall+of+the+Ottoman+Empire.+I+then+introduce+my+close+family+and+some+friends.+Prince+ottoman.+Dans+ce+qui+suit%2C+j+ai+resume+ma+comprehension+de+l+avenement+et+de+la+chute+de+l+Empire+Ottoman.+Je+presente+ensuite+ma+famille+proche+ainsi+que+quelques+amis.';
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();
};

