/* [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','4701',jdecode('Home'),jdecode(''), jdecode('%2F4701.html'), 'true',[],'',''],
	['PAGE','4778',jdecode('About+us'),jdecode(''), jdecode('%2F4778.html'), 'true',[],'',''],
	['PAGE','4752',jdecode('Studio+Details'),jdecode(''), jdecode('%2F4752.html'), 'true',[],'',''],
	['PAGE','44499',jdecode('Song+Production'),jdecode(''), jdecode('%2F44499.html'), 'true',[],'',''],
	['PAGE','4934',jdecode('What+Our+Customers+Say'),jdecode(''), jdecode('%2F4934.html'), 'true',[],'',''],
	['PAGE','12201',jdecode('Listen+to+songs'),jdecode(''), jdecode('%2F12201.html'), 'true',[],'',''],
	['PAGE','23688',jdecode('Buy+Gift+Voucher%28s%29'),jdecode(''), jdecode('%2F23688.html'), 'true',[],'',''],
	['PAGE','4804',jdecode('Prices'),jdecode(''), jdecode('%2F4804%2Findex.html'), 'true',[ 
		['PAGE','4830',jdecode('Special+Offers'),jdecode(''), jdecode('%2F4804%2F4830.html'), 'false',[],'','']
	],'',''],
	['PAGE','23488',jdecode('Bookings'),jdecode(''), jdecode('%2F23488.html'), 'true',[],'',''],
	['PAGE','4882',jdecode('News'),jdecode(''), jdecode('%2F4882.html'), 'true',[],'',''],
	['PAGE','4856',jdecode('Links'),jdecode(''), jdecode('%2F4856.html'), 'true',[],'',''],
	['PAGE','15733',jdecode('Blog'),jdecode(''), jdecode('%2F15733.html'), 'false',[],'',''],
	['PAGE','24188',jdecode('Jobs'),jdecode(''), jdecode('%2F24188.html'), 'true',[],'',''],
	['PAGE','32888',jdecode('FAQ%26%23x27%3Bs'),jdecode(''), jdecode('%2F32888.html'), 'true',[],'',''],
	['PAGE','37388',jdecode('BMTH+Unplugged+2011'),jdecode(''), jdecode('%2F37388.html'), 'false',[],'',''],
	['PAGE','40488',jdecode('Pics'),jdecode(''), jdecode('%2F40488.html'), 'true',[],'',''],
	['PAGE','13701',jdecode('Contact+Us'),jdecode(''), jdecode('%2F13701.html'), 'true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='355';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'en',
  country: 'GB'
};
var prodDef={
  wl_name: 'easily_co_uk',
  product: 'WSCSYSSSSLY0XVDH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'355',
				contentColor: 	'FFFFFF',
				contentBGColor: '333F65',
				a_color: 		'333F65',
				b_color: 		'040507',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20120119-153448'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4752',
internalId:  '',
customField: '20120120-103858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4934',
internalId:  '',
customField: '20110921-110716'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13701',
internalId:  '',
customField: '20111223-115904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4778',
internalId:  '',
customField: '20120120-104906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4804',
internalId:  '',
customField: '20110602-094336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4856',
internalId:  '',
customField: '20110629-112922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4882',
internalId:  '',
customField: '20120119-140954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12201',
internalId:  '',
customField: '20110330-103309'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4830',
internalId:  '',
customField: '20110504-103539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37388',
internalId:  '',
customField: '20110509-210854'
};
webappMappings['7008']=webappMappings['7008-6398']={
webappId:    '7008',
documentId:  '13701',
internalId:  '6398',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32888',
internalId:  '',
customField: '20110502-192541'
};
webappMappings['7050']=webappMappings['7050-3418']={
webappId:    '7050',
documentId:  '15733',
internalId:  '3418',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15733',
internalId:  '',
customField: '20100104-160537'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23488',
internalId:  '',
customField: '20110601-131004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23688',
internalId:  '',
customField: '20120109-114026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24188',
internalId:  '',
customField: '20100921-171151'
};
webappMappings['1501']=webappMappings['1501-11004759']={
webappId:    '1501',
documentId:  '4701',
internalId:  '11004759',
customField: '1501'
};
webappMappings['7060']=webappMappings['7060-1c70f28419eb44ac107343f071a1693f']={
webappId:    '7060',
documentId:  '40488',
internalId:  '1c70f28419eb44ac107343f071a1693f',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40488',
internalId:  '',
customField: '20110630-094505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44499',
internalId:  '',
customField: '20110907-110417'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN3DS9';
var companyName   = 'ITG+Productions';
var htmlTitle	  = '';
var metaKeywords  = 'Recording+Studio%2C+Acoustic+Music%2C+Singer%2FSongwriters%2C+Studio+Production%2C+Recording%2C+Songwriting%2C+Song+Publishing%2C+Live+Music%2C+Recorded+Music.';
var metaContents  = 'Recording+Studio+%2F+Production+Company+based+in+Poole+%2F+Dorset.+Ideal+for+vocalists%2C+singer%2Fsongwriters+seeking+production+input%2C+or+bands+seeking+high+quality+demos+from+a+well+established+studio.';
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();
};

