/* [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','20601',jdecode('Home+Page'),jdecode(''),'/20601.html','true',[],'',''],
	['PAGE','29501',jdecode('About+Astral'),jdecode(''),'/29501.html','true',[],'',''],
	['PAGE','5001',jdecode('Astral+Business+Solutions'),jdecode(''),'/5001.html','true',[],'',''],
	['PAGE','15701',jdecode('Astral+Recruitment+Services'),jdecode(''),'/15701/index.html','true',[ 
		['PAGE','20652',jdecode('Our+Focus'),jdecode(''),'/15701/20652.html','true',[],'',''],
		['PAGE','20673',jdecode('Candidate+Zone'),jdecode(''),'/15701/20673.html','true',[],'',''],
		['PAGE','33401',jdecode('Candidate+Methodology'),jdecode(''),'/15701/33401.html','false',[],'',''],
		['PAGE','15906',jdecode('Customer+Zone'),jdecode(''),'/15701/15906.html','true',[],'',''],
		['PAGE','33422',jdecode('Customer+Methodology'),jdecode(''),'/15701/33422.html','false',[],'',''],
		['PAGE','20694',jdecode('Current+Positions'),jdecode(''),'/15701/20694.html','true',[],'','']
	],'',''],
	['PAGE','33443',jdecode('Our+Customers'),jdecode(''),'/33443.html','true',[],'',''],
	['PAGE','42801',jdecode('Newsletter'),jdecode(''),'/42801/index.html','true',[ 
		['PAGE','29522',jdecode('Newsletter'),jdecode(''),'/42801/29522.html','false',[],'',''],
		['PAGE','52901',jdecode('Newsletter+content+page+1'),jdecode(''),'/42801/52901.html','false',[],'',''],
		['PAGE','52922',jdecode('Newsletter+content+page+2'),jdecode(''),'/42801/52922.html','false',[],'',''],
		['PAGE','48443',jdecode('Newsletter+Content+Page+3'),jdecode(''),'/42801/48443.html','false',[],'','']
	],'',''],
	['PAGE','43601',jdecode('Contact+Us'),jdecode(''),'/43601/index.html','true',[ 
		['PAGE','29543',jdecode('Contact+Us'),jdecode(''),'/43601/29543.html','false',[],'','']
	],'',''],
	['PAGE','15885',jdecode('Map+%26+Directions'),jdecode(''),'/15885.html','false',[],'',''],
	['PAGE','29564',jdecode('Corporate+Social+Investment'),jdecode(''),'/29564.html','true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Champagne';
theSitetree.paletteFamily='426388';
theSitetree.keyvisualId='11364';
theSitetree.keyvisualName='kv_11364.jpg';
theSitetree.fontsetId='31946';
theSitetree.graphicsetId='13786';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='426388';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Champagne',
				paletteFamily: 	'426388',
				keyvisualId: 	'11364',
				keyvisualName: 	'kv_11364.jpg',
				fontsetId: 		'31946',
				graphicsetId: 	'13786',
				contentColor: 	'000000',
				contentBGColor: '426388',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20110530-115227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20601',
internalId:  '',
customField: '20110617-101521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15701',
internalId:  '',
customField: '20100903-164906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20652',
internalId:  '',
customField: '20090424-153631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29501',
internalId:  '',
customField: '20090424-121049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20673',
internalId:  '',
customField: '20081022-125710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15885',
internalId:  '',
customField: '20100818-131845'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15906',
internalId:  '',
customField: '20081022-142255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33401',
internalId:  '',
customField: '20090424-152142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33422',
internalId:  '',
customField: '20081022-143440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20694',
internalId:  '',
customField: '20081022-161209'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33443',
internalId:  '',
customField: '20090424-153254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29522',
internalId:  '',
customField: '20081028-120422'
};
webappMappings['7008']=webappMappings['7008-125']={
webappId:    '7008',
documentId:  '29522',
internalId:  '125',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-126']={
webappId:    '7008',
documentId:  '29543',
internalId:  '126',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29543',
internalId:  '',
customField: '20081028-125430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29564',
internalId:  '',
customField: '20081022-153744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42801',
internalId:  '',
customField: '20090424-124532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43601',
internalId:  '',
customField: '20110617-095748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52922',
internalId:  '',
customField: '20090622-114422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52901',
internalId:  '',
customField: '20090622-114422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48443',
internalId:  '',
customField: '20090320-114514'
};
var canonHostname = 'sitebuilder1.nur4.host-h.net';
var accountId     = 'AHZGE0INXSVC';
var companyName   = 'We+Deliver+what+we+Promise';
var htmlTitle	  = 'Astral+-+If+you+are+considering+changing+your+business+systems+then+you+should+be+talking+to+us';
var metaKeywords  = 'Microsoft+Dynamics+NAV+Navision+Recruitment+%22Business+Systems%22+%22Changing+Business+Systems%22+%22Nav+Training%22+%22Navision+Training%22';
var metaContents  = 'If+you+are+thinking+about+changing+your+business+systems+then+you+should+be+talking+to+us';
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();
};

