/* [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','401',jdecode('Home+-+About+Us'),jdecode(''),'/401.html','true',[],''],
	['PAGE','422',jdecode('The+Team'),jdecode(''),'/422.html','true',[],''],
	['PAGE','494',jdecode('Our+Services'),jdecode(''),'/494/index.html','true',[ 
		['PAGE','5901',jdecode('Marketing+%26+Management'),jdecode(''),'/494/5901.html','true',[],''],
		['PAGE','7501',jdecode('Due+Diligence+Services'),jdecode(''),'/494/7501.html','true',[],''],
		['PAGE','515',jdecode('Technical+Consulting'),jdecode(''),'/494/515.html','true',[],''],
		['PAGE','536',jdecode('Accounting+Services'),jdecode(''),'/494/536.html','true',[],''],
		['PAGE','9901',jdecode('Introduction+Services'),jdecode(''),'/494/9901.html','true',[],''],
		['PAGE','9922',jdecode('Property+Acquisitions'),jdecode(''),'/494/9922.html','true',[],''],
		['PAGE','9943',jdecode('Ontario+LMS'),jdecode(''),'/494/9943.html','true',[],'']
	],''],
	['PAGE','599',jdecode('Contact'),jdecode(''),'/599.html','true',[],''],
	['PAGE','5001',jdecode('Useful+Links'),jdecode(''),'/5001.html','true',[],''],
	['PAGE','10501',jdecode('Photo+Album'),jdecode(''),'/10501.html','true',[],''],
	['PAGE','14601',jdecode('Map'),jdecode(''),'/14601.html','true',[],'']];
var siteelementCount=14;
theSitetree.topTemplateName='Aeskulap';
theSitetree.paletteFamily='1E3F20';
theSitetree.keyvisualId='2496';
theSitetree.keyvisualName='labor.jpg';
theSitetree.fontsetId='434';
theSitetree.graphicsetId='486';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Aeskulap',
				paletteFamily: 	'1E3F20',
				keyvisualId: 	'2496',
				keyvisualName: 	'labor.jpg',
				fontsetId: 		'434',
				graphicsetId: 	'486',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-9413341']={
webappId:    '1501',
documentId:  '401',
internalId:  '9413341',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20090923-074949'
};
webappMappings['7060']=webappMappings['7060-03a3f3a047a7f5fe064db7e34e535d56']={
webappId:    '7060',
documentId:  '10501',
internalId:  '03a3f3a047a7f5fe064db7e34e535d56',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-344']={
webappId:    '7008',
documentId:  '599',
internalId:  '344',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '422',
internalId:  '',
customField: '20081017-105202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20081026-172816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20071128-083106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7501',
internalId:  '',
customField: '20081026-175311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20071128-074234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20080317-080431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9901',
internalId:  '',
customField: '20080610-111550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9922',
internalId:  '',
customField: '20080610-111550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9943',
internalId:  '',
customField: '20080610-111550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '599',
internalId:  '',
customField: '20080610-132857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20090228-195937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10501',
internalId:  '',
customField: '20080813-173106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14601',
internalId:  '',
customField: '20090112-133257'
};
var canonHostname = 'cm4all.aplus.net';
var accountId     = 'AAPLU0INLEMW';
var companyName   = 'Avanti+Management+%26+Consulting+Limited';
var htmlTitle	  = 'Avanti+Management++Consulting+Limited';
var metaKeywords  = 'Avanti%2C+Managment%2C+Consulting%2C+Limited%2C+Michael+Dehn%2C+Michael+A.+Dehn%2C+Glen+Wylie%2C+Glen+H.+Wylie%2C+Marketing%2C+Due+Diligence%2C+Accounting%2C+Technical%2C+Introductions%2C+Gold%2C+Red+Lake%2C+Titanium%2C+Goldcorp%2C+Gold%2C+Silver%2C+Cobalt%2C+Nickel%2C+Vanadium%2C+Iron%2C+Natural+Gas';
var metaContents  = 'Avanti+Management+and+Consulting+Provides+Management+and+Consulting+Services+to+the+Mineral+Exploration%2C+Mining+and+Finance+Industry';
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();
};
