/* [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','1801',jdecode('Home'),jdecode(''),'/1801.html','true',[],'',''],
	['PAGE','1852',jdecode('Services'),jdecode(''),'/1852/index.html','true',[ 
		['PAGE','27001',jdecode('End-to-End'),jdecode(''),'/1852/27001.html','true',[],'',''],
		['PAGE','1873',jdecode('Recording'),jdecode(''),'/1852/1873.html','true',[],'',''],
		['PAGE','1894',jdecode('Transcription'),jdecode(''),'/1852/1894.html','true',[],'',''],
		['PAGE','1915',jdecode('Extras'),jdecode(''),'/1852/1915.html','true',[],'','']
	],'',''],
	['PAGE','1957',jdecode('Quotes'),jdecode(''),'/1957.html','true',[],'',''],
	['PAGE','148901',jdecode('Calculator'),jdecode(''),'/148901.html','true',[],'',''],
	['PAGE','18201',jdecode('File+Transfer'),jdecode(''),'/18201/index.html','true',[ 
		['PAGE','163901',jdecode('Audio+Freelancers'),jdecode(''),'/18201/163901.html','false',[],'',''],
		['PAGE','1999',jdecode('Guidelines'),jdecode(''),'/18201/1999.html','true',[],'','']
	],'',''],
	['PAGE','2020',jdecode('Contact'),jdecode(''),'/2020.html','true',[],'','']];
var siteelementCount=12;
theSitetree.topTemplateName='Explore';
theSitetree.paletteFamily='363875';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10431';
theSitetree.graphicsetId='10766';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Explore',
				paletteFamily: 	'363875',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10431',
				graphicsetId: 	'10766',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'CBCBCB',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20101014-134514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1852',
internalId:  '',
customField: '20101014-135910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27001',
internalId:  '',
customField: '20101125-052059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1957',
internalId:  '',
customField: '20080108-134609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2020',
internalId:  '',
customField: '20100215-111848'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1873',
internalId:  '',
customField: '20100418-000808'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1894',
internalId:  '',
customField: '20100418-002237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1915',
internalId:  '',
customField: '20100418-002150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18201',
internalId:  '',
customField: '20100215-111830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1999',
internalId:  '',
customField: '20080123-173033'
};
webappMappings['7008']=webappMappings['7008-295']={
webappId:    '7008',
documentId:  '1957',
internalId:  '295',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '148901',
internalId:  '',
customField: '20100215-111819'
};
webappMappings['7008']=webappMappings['7008-7973']={
webappId:    '7008',
documentId:  '163901',
internalId:  '7973',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '163901',
internalId:  '',
customField: '20101012-071130'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN2DB4';
var companyName   = 'recording+%2B+transcription';
var htmlTitle	  = 'Two+Main+Recording+and+Transcription+Services';
var metaKeywords  = 'transcript%2C+transcription%2C+transcriptions%2C+transcription+service%2C+transcription+company%2C+recording%2C+audio+recording%2C+digital+audio%2C+audio+capture%2C+speech-to-text%2C+voice-to-text%2C+mobile+recording+service%2C+conference+audio%2C+web+content%2C+podcast+recording%2C+podcast+transcription%2C+recording+for+transcription%2C+transcription+recording%2C+London+transcription%2C+UK+transcription%2C+legal+transcription%2C+court+recording%2C+medical+transcription%2C+conference+recording%2C+conference+transcription%2C+meeting+transcription%2C+interview+transcription%2C+research+transcription%2C+podcast+recording%2C+podcast+production%2C+podcast+transcription%2C+seminar+transcription%2C+mp3+transcription%2C+wav+transcription%2C+dss+transcription%2C+media+transcription%2C+video+transcription%2C+audio+transcription%2C+digital+transcription%2C+Korean+transcription%2C+Korean+interpreting%2C+Korean+translation';
var metaContents  = 'Two+Main+is+a+London-based+professional+digital+audio+recording+and+transcription+service.+Technician+assisted+recording+for+meetings%2C+events++legal+proceedings+UK-wide.';
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();
};

