/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','9601',jdecode('About+Us'),jdecode(''),'/9601/index.html','true',[ 
		['PAGE','9706',jdecode('Organization'),jdecode(''),'/9601/9706.html','true',[],'',''],
		['PAGE','9685',jdecode('Our+Approach'),jdecode(''),'/9601/9685.html','true',[],'',''],
		['PAGE','9664',jdecode('Recruitment'),jdecode(''),'/9601/9664.html','true',[],'','']
	],'',''],
	['PAGE','63801',jdecode('Research+Gateway'),jdecode(''),'/63801/index.html','true',[ 
		['PAGE','63822',jdecode('F.A.Q'),jdecode(''),'/63801/63822.html','true',[],'',''],
		['PAGE','63843',jdecode('The+Gateway+Advantages'),jdecode(''),'/63801/63843.html','true',[],'',''],
		['PAGE','63864',jdecode('The+Certification'),jdecode(''),'/63801/63864.html','true',[],'',''],
		['PAGE','67501',jdecode('Gateway+Statistics'),jdecode(''),'/63801/67501.html','true',[],'','']
	],'',''],
	['PAGE','63885',jdecode('Appraisal+Project'),jdecode(''),'/63885/index.html','true',[ 
		['PAGE','63906',jdecode('Our+Tools'),jdecode(''),'/63885/63906.html','true',[],'',''],
		['PAGE','63927',jdecode('The+Report'),jdecode(''),'/63885/63927.html','true',[],'','']
	],'',''],
	['PAGE','9643',jdecode('Newsletter%2FArticles'),jdecode(''),'/9643.html','true',[],'',''],
	['PAGE','9727',jdecode('Contact+Us%2FSubscribe'),jdecode(''),'/9727.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Global';
theSitetree.paletteFamily='0E6C84';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='85';
theSitetree.graphicsetId='106';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Global',
				paletteFamily: 	'0E6C84',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'85',
				graphicsetId: 	'106',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'0E6C84',
				b_color: 		'FFE151',
				c_color: 		'000000',
				d_color: 		'E6EEF1',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20101130-175139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9601',
internalId:  '',
customField: '20101130-162347'
};
webappMappings['7008']=webappMappings['7008-4270']={
webappId:    '7008',
documentId:  '9727',
internalId:  '4270',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9727',
internalId:  '',
customField: '20091116-123253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9706',
internalId:  '',
customField: '20101130-152950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9664',
internalId:  '',
customField: '20101126-140113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9643',
internalId:  '',
customField: '20101130-161853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9685',
internalId:  '',
customField: '20101126-135252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63801',
internalId:  '',
customField: '20101130-172447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63822',
internalId:  '',
customField: '20101130-153638'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63843',
internalId:  '',
customField: '20101130-154749'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63885',
internalId:  '',
customField: '20101130-155520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63906',
internalId:  '',
customField: '20101130-160642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63927',
internalId:  '',
customField: '20101130-181151'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63864',
internalId:  '',
customField: '20101130-160922'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '9727',
internalId:  '',
customField: 'language:fr;country:FR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '9643',
internalId:  '',
customField: 'language:fr;country:FR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '63927',
internalId:  '',
customField: 'language:fr;country:FR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '63906',
internalId:  '',
customField: 'language:fr;country:FR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '63885',
internalId:  '',
customField: 'language:fr;country:FR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '63864',
internalId:  '',
customField: 'language:fr;country:FR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '63843',
internalId:  '',
customField: 'language:fr;country:FR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '63822',
internalId:  '',
customField: 'language:fr;country:FR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '63801',
internalId:  '',
customField: 'language:fr;country:FR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '9664',
internalId:  '',
customField: 'language:fr;country:FR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '9685',
internalId:  '',
customField: 'language:fr;country:FR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '9706',
internalId:  '',
customField: 'language:fr;country:FR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '9601',
internalId:  '',
customField: 'language:fr;country:FR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '501',
internalId:  '',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67501',
internalId:  '',
customField: '20101211-225230'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0IN2BFB';
var companyName   = 'The+Due+Diligence+Specialist';
var htmlTitle	  = 'Hedge+Fund+Appraisal+-+The+Due+Diligence+Specialist';
var metaKeywords  = 'hedge+fund%2C+due+diligence%2C+Alternative+investments%2C+amaranth%2C+philadelphia%2C+bayou%2C+operational+due+diligence%2C+corporate+governance%2C+operational+risk%2C+fraud%2C+fund+of+funds';
var metaContents  = 'Hedge+Fund+Due+Diligence+solution';
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();
};

