/* [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','45101',jdecode('English'),jdecode(''),'/45101/index.html','true',[ 
		['PAGE','701',jdecode('THE+OTTOMAN+EMPIRE'),jdecode(''),'/45101/701.html','true',[],'',''],
		['PAGE','11901',jdecode('RESPECT'),jdecode(''),'/45101/11901.html','true',[],'',''],
		['PAGE','11943',jdecode('EMPEROR+ABDULMEJID'),jdecode(''),'/45101/11943.html','true',[],'',''],
		['PAGE','10622',jdecode('EXILE'),jdecode(''),'/45101/10622.html','true',[],'',''],
		['PAGE','10601',jdecode('MY+PARENTS'),jdecode(''),'/45101/10601.html','true',[],'',''],
		['PAGE','33901',jdecode('PRINCE+BURHANEDDIN+DJEM'),jdecode(''),'/45101/33901.html','true',[],'',''],
		['PAGE','69212',jdecode('ONE+YEAR+WITHOUT+YOU'),jdecode(''),'/45101/69212.html','true',[],'',''],
		['PAGE','37401',jdecode('HIS+BELOVED+FAMILY'),jdecode(''),'/45101/37401.html','true',[],'',''],
		['PAGE','67712',jdecode('JOSEPHINE'),jdecode(''),'/45101/67712.html','true',[],'',''],
		['PAGE','24401',jdecode('SCHOOL'),jdecode(''),'/45101/24401.html','true',[],'',''],
		['PAGE','11964',jdecode('PRINCESS+TATIANA'),jdecode(''),'/45101/11964.html','true',[],'',''],
		['PAGE','26801',jdecode('MY+FAVORITE+PICTURE'),jdecode(''),'/45101/26801.html','true',[],'',''],
		['PAGE','11985',jdecode('SIFNOS'),jdecode(''),'/45101/11985.html','true',[],'',''],
		['PAGE','30601',jdecode('CHRYSSOPIGHI'),jdecode(''),'/45101/30601.html','true',[],'',''],
		['PAGE','67012',jdecode('ATHENS'),jdecode(''),'/45101/67012.html','true',[],'',''],
		['PAGE','24422',jdecode('FAMILY+REUNION'),jdecode(''),'/45101/24422.html','true',[],'',''],
		['PAGE','29501',jdecode('HELENE'),jdecode(''),'/45101/29501.html','true',[],'',''],
		['PAGE','32506',jdecode('Livre+d%26%23x27%3Bor'),jdecode(''),'/45101/32506.html','true',[],'',''],
		['PAGE','32501',jdecode('Entr%C3%A9es'),jdecode(''),'/45101/32501.html','false',[],'',''],
		['PAGE','33301',jdecode('Weblog'),jdecode(''),'/45101/33301.html','true',[],'','']
	],'',''],
	['PAGE','45122',jdecode('Fran%C3%A7ais'),jdecode(''),'/45122/index.html','true',[ 
		['PAGE','45312',jdecode('L%26%23x27%3BEMPIRE+OTTOMAN'),jdecode(''),'/45122/45312.html','true',[],'',''],
		['PAGE','47412',jdecode('RESPECT+ET+OUVERTURE'),jdecode(''),'/45122/47412.html','true',[],'',''],
		['PAGE','48212',jdecode('L%26%23x27%3BEMPEREUR+ABDULMEDJID'),jdecode(''),'/45122/48212.html','true',[],'',''],
		['PAGE','49312',jdecode('L%26%23x27%3BEXIL'),jdecode(''),'/45122/49312.html','true',[],'',''],
		['PAGE','49812',jdecode('MES+PARENTS'),jdecode(''),'/45122/49812.html','true',[],'',''],
		['PAGE','49833',jdecode('PRINCE+BURHANEDDIN+DJEM'),jdecode(''),'/45122/49833.html','true',[],'',''],
		['PAGE','69233',jdecode('UN+AN+SANS+TOI'),jdecode(''),'/45122/69233.html','true',[],'',''],
		['PAGE','49854',jdecode('SA+FAMILLE+CHERIE'),jdecode(''),'/45122/49854.html','true',[],'',''],
		['PAGE','67733',jdecode('JOSEPHINE'),jdecode(''),'/45122/67733.html','true',[],'',''],
		['PAGE','49875',jdecode('MON+ECOLE'),jdecode(''),'/45122/49875.html','true',[],'',''],
		['PAGE','49896',jdecode('PRINCESSE+TATIANA'),jdecode(''),'/45122/49896.html','true',[],'',''],
		['PAGE','49917',jdecode('MA+PHOTO+PREFEREE'),jdecode(''),'/45122/49917.html','true',[],'',''],
		['PAGE','49938',jdecode('SIFNOS'),jdecode(''),'/45122/49938.html','true',[],'',''],
		['PAGE','49959',jdecode('CHRYSSOPIGHI'),jdecode(''),'/45122/49959.html','true',[],'',''],
		['PAGE','67033',jdecode('ATHENES'),jdecode(''),'/45122/67033.html','true',[],'',''],
		['PAGE','49980',jdecode('REUNION+DE+FAMILLE'),jdecode(''),'/45122/49980.html','true',[],'',''],
		['PAGE','50001',jdecode('HELENE'),jdecode(''),'/45122/50001.html','true',[],'','']
	],'','']];
var siteelementCount=39;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='555454';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10556';
theSitetree.graphicsetId='10892';
theSitetree.contentColor='555454';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Alpha',
				paletteFamily: 	'555454',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10556',
				graphicsetId: 	'10892',
				contentColor: 	'555454',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'555454',
				e_color: 		'555454',
				f_color: 		'555454',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, 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: '20090214-194516'
};
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: '20090722-154912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10622',
internalId:  '',
customField: '20090722-183245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10601',
internalId:  '',
customField: '20090722-155226'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11964',
internalId:  '',
customField: '20090722-162354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20100623-030649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11901',
internalId:  '',
customField: '20100623-030738'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33901',
internalId:  '',
customField: '20090722-184335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37401',
internalId:  '',
customField: '20091023-035043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24401',
internalId:  '',
customField: '20091014-001510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11985',
internalId:  '',
customField: '20100315-225445'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30601',
internalId:  '',
customField: '20090722-162607'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24422',
internalId:  '',
customField: '20090722-162651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29501',
internalId:  '',
customField: '20091020-180447'
};
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: '20090407-012452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32501',
internalId:  '',
customField: '20081203-192847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45122',
internalId:  '',
customField: '20090422-005800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49312',
internalId:  '',
customField: '20090722-190843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45101',
internalId:  '',
customField: '20100623-022751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45312',
internalId:  '',
customField: '20100105-151215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48212',
internalId:  '',
customField: '20090407-014044'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49812',
internalId:  '',
customField: '20090415-072512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49833',
internalId:  '',
customField: '20091104-170426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49854',
internalId:  '',
customField: '20091104-170858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49875',
internalId:  '',
customField: '20091014-001611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49896',
internalId:  '',
customField: '20091104-171713'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49917',
internalId:  '',
customField: '20090214-182306'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49938',
internalId:  '',
customField: '20100315-225648'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49959',
internalId:  '',
customField: '20091104-171951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49980',
internalId:  '',
customField: '20090307-180750'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50001',
internalId:  '',
customField: '20091104-172102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67012',
internalId:  '',
customField: '20091023-041910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67033',
internalId:  '',
customField: '20091104-172010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67712',
internalId:  '',
customField: '20100616-190505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67733',
internalId:  '',
customField: '20100611-044420'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69212',
internalId:  '',
customField: '20091104-170136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69233',
internalId:  '',
customField: '20091116-224609'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '45101',
internalId:  '1006',
customField: '1006'
};
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();
};
