/* [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'),jdecode(''),'/401/index.html','true',[ 
		['PAGE','452',jdecode('About+us'),jdecode(''),'/401/452.html','true',[],'']
	],''],
	['PAGE','5001',jdecode('Fraud+%26+Money+Laundering'),jdecode(''),'/5001.html','true',[],''],
	['PAGE','5022',jdecode('Serious+Crime'),jdecode(''),'/5022.html','true',[],''],
	['PAGE','6322',jdecode('Health+and+Safety+Law+'),jdecode(''),'/6322.html','true',[],''],
	['PAGE','6601',jdecode('Trading+Standards+Law'),jdecode(''),'/6601.html','true',[],''],
	['PAGE','5301',jdecode('Solicitor+Referrals'),jdecode(''),'/5301.html','true',[],''],
	['PAGE','6301',jdecode('Previous+Cases'),jdecode(''),'/6301.html','true',[],''],
	['PAGE','515',jdecode('Contact'),jdecode(''),'/515.html','true',[],''],
	['PAGE','6622',jdecode('Links'),jdecode(''),'/6622.html','true',[],'']];
var siteelementCount=10;
theSitetree.topTemplateName='Impulse';
theSitetree.paletteFamily='84AACA';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10413';
theSitetree.graphicsetId='10679';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='84AACA';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				name: 			'Impulse',
				paletteFamily: 	'84AACA',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10413',
				graphicsetId: 	'10679',
				contentColor: 	'000000',
				contentBGColor: '84AACA',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'517695',
				e_color: 		'4A6C8B',
				f_color: 		'2F6999',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20091031-134105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20091031-204245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5022',
internalId:  '',
customField: '20091030-210441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5301',
internalId:  '',
customField: '20091031-135318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20091031-134325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6601',
internalId:  '',
customField: '20091031-140749'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6322',
internalId:  '',
customField: '20091031-125035'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6301',
internalId:  '',
customField: '20091031-141144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20090503-183509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6622',
internalId:  '',
customField: '20090111-213239'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-1942']={
webappId:    '7008',
documentId:  '515',
internalId:  '1942',
customField: 'language:en;country:GB;'
};
webappMappings['7008']=webappMappings['7008-1943']={
webappId:    '7008',
documentId:  '5301',
internalId:  '1943',
customField: 'language:en;country:GB;'
};
webappMappings['1501']=webappMappings['1501-5271167']={
webappId:    '1501',
documentId:  '401',
internalId:  '5271167',
customField: '1501'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN2GYU';
var companyName   = 'vhcc+solicitor+.com';
var htmlTitle	  = 'Bristol+Fraud+VHCC+criminal+defence+solicitors+for+serious+fraud%2C+regulatory+and+criminal+defence+-++business+fraud+defence+lawyers+-+VHCC+fraud+panel+member+-+VHCC+%28very+high+cost+case%29-++Serious+Fraud+Office+Carousel+Fraud+Phoenix+Fraud+Missing+Trader+F';
var metaKeywords  = 'bristol+fraud+solicitor+lawyer%2Cpyramid+scheme+fraud%2C+benefit+fraud%2C+bristol+crime+solicitor%2C+bristol+criminal+defence+solicitor%2C+fraud+solicitor%2Ccriminal+law%2C+corporate+fraud+solicitors%2Ccorporate+fraud+lawyer%2Cspecialist+fraud+solicitor%2Cfraud+defence+solicitors%2Cbusiness+crime+solicitor%2Cserious+crime+defence+solicitors%2Cvhcc+cases%2Cvhcc+panel%2Clegal+aid+solicitors%2Clegal+aid+uk%2Clegal+aid+assistance%2Clegal+aid+lawyer%2Ccriminal+law+solicitor%2Ccriminal+defence+solicitors%2Ccriminal+solicitors%2Ccriminal+solicitor+uk%2Ccriminal+lawyer+devon%2C+solicitors+devon%2Clawyer+devon%2Csolicitors+north+devon%2C+www.vhccsolicitor.com+vhcc+solicitor+solicitors+very+high+cost+case+crime+fraud+regulatory+lawyers+business+defence+';
var metaContents  = 'London+and+Bristol+criminal+defence+solicitor%2C+specialist+in+serious+criminal+cases+including+proceeds+of+crime+act%2C+cash+confiscation%2C+cash+forfeiture%2C+fraud+offences%2C++regulatory+offences+business+defence+lawyers+specialist+fraud+vhcc+panel+member+vhcc+advocate+panel';
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();
};
