/* [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 theSitetree=[ 
	['PAGE','32',jdecode('Home'),jdecode(''),'/32.html','true',[],''],
	['PAGE','53',jdecode('Speaking'),jdecode(''),'/53/index.html','true',[ 
		['PAGE','2473',jdecode('Keynote+Lecturer'),jdecode(''),'/53/2473.html','true',[],''],
		['PAGE','2482',jdecode('Tradeshow+and+Chairman'),jdecode(''),'/53/2482.html','true',[],''],
		['PAGE','2491',jdecode('Academic+Lecturer'),jdecode(''),'/53/2491.html','true',[],''],
		['PAGE','2581',jdecode('Corporate+Meetings'),jdecode(''),'/53/2581.html','true',[],''],
		['PAGE','2663',jdecode('Workshop+Facilitator'),jdecode(''),'/53/2663.html','true',[],''],
		['PAGE','2500',jdecode('After+Dinner+Speaker'),jdecode(''),'/53/2500.html','true',[],'']
	],''],
	['PAGE','2256',jdecode('Speaker+Video'),jdecode(''),'/2256.html','true',[],''],
	['PAGE','2274',jdecode('Clients'),jdecode(''),'/2274.html','true',[],''],
	['PAGE','2265',jdecode('Recent+Addresses'),jdecode(''),'/2265.html','true',[],''],
	['PAGE','62',jdecode('Advisory'),jdecode(''),'/62/index.html','true',[ 
		['PAGE','2509',jdecode('Current+Projects'),jdecode(''),'/62/2509.html','true',[],'']
	],''],
	['PAGE','71',jdecode('Books'),jdecode(''),'/71/index.html','true',[ 
		['PAGE','2114',jdecode('Redefining+Financial+Services'),jdecode(''),'/71/2114.html','true',[],''],
		['PAGE','2283',jdecode('Thinking+beyond+Technology'),jdecode(''),'/71/2283.html','true',[],''],
		['PAGE','2292',jdecode('Synconomy'),jdecode(''),'/71/2292.html','true',[],''],
		['PAGE','2301',jdecode('Future+of+Retail+Banking'),jdecode(''),'/71/2301.html','true',[],''],
		['PAGE','2310',jdecode('Strategic+Thinking+'),jdecode(''),'/71/2310.html','true',[],''],
		['PAGE','2319',jdecode('People+-+The+New+Asset+'),jdecode(''),'/71/2319.html','true',[],''],
		['PAGE','2328',jdecode('Understanding+Islamic+Banking'),jdecode(''),'/71/2328.html','true',[],''],
		['PAGE','2337',jdecode('Islamic+Monetary+Union'),jdecode(''),'/71/2337.html','true',[],'']
	],''],
	['PAGE','2346',jdecode('Recent+Articles'),jdecode(''),'/2346.html','true',[],''],
	['PAGE','2355',jdecode('Joe+in+the+Media'),jdecode(''),'/2355.html','true',[],''],
	['PAGE','80',jdecode('Contact'),jdecode(''),'/80.html','true',[],'']];
var siteelementCount=25;
theSitetree.topTemplateName='Architekt';
theSitetree.paletteFamily='A95C61';
theSitetree.keyvisualId='1691';
theSitetree.keyvisualName='bilanz.jpg';
theSitetree.fontsetId='304';
theSitetree.graphicsetId='345';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='A95C61';
var theTemplate={
				name: 			'Architekt',
				paletteFamily: 	'A95C61',
				keyvisualId: 	'1691',
				keyvisualName: 	'bilanz.jpg',
				fontsetId: 		'304',
				graphicsetId: 	'345',
				contentColor: 	'000000',
				contentBGColor: 'A95C61',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'A95C61',
				b_color: 		'7F162D',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				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:  '32',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-1228446']={
webappId:    '1501',
documentId:  '32',
internalId:  '1228446',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32',
internalId:  '',
customField: '20080824-121730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2274',
internalId:  '',
customField: '20070706-194523'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62',
internalId:  '',
customField: '20060724-104931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53',
internalId:  '',
customField: '20060922-133035'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2473',
internalId:  '',
customField: '20061126-171831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2482',
internalId:  '',
customField: '20061119-211029'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2491',
internalId:  '',
customField: '20060922-133009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2581',
internalId:  '',
customField: '20060922-133136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2663',
internalId:  '',
customField: '20060922-133741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2500',
internalId:  '',
customField: '20060922-133426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2509',
internalId:  '',
customField: '20060922-132132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71',
internalId:  '',
customField: '20061229-151720'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2319',
internalId:  '',
customField: '20061119-211903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2346',
internalId:  '',
customField: '20080824-122357'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050IN3K6U';
var companyName   = 'Joseph+DiVanna';
var htmlTitle	  = 'DiVanna.com';
var metaKeywords  = 'innovation%2C+banking%2C+islamic+banking%2C+financial+services%2C+leadership%2C+best+practices%2C+case+studies%2C+credit+cards%2C+mortgages%2C+insight%2C+thought+leadership%2C+strategy%2C+business+initatives%2C+national+strategies%2C+socioeconomic+problems%2C+arab+banking%2C+medieval+banking';
var metaContents  = 'Joseph+DiVanna+is+a+business+thought+leader+providing+research+and+advisory+services+to+financial+institutions%2C+corporations+and+governments+worldwide.+Author+of+numerous+books+on+business%2C+banking%2C+economic%2C+technology%2C+human+capital+and+strategy+Joes+insight+is+used+by+organizations+to+develop+a+better+understanding+on+how+to+meet+todays+competitive+chanllenges.';
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();
};
