/* [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','5101',jdecode('Home'),jdecode(''),'/5101.html','true',[],''],
	['PAGE','5152',jdecode('About'),jdecode(''),'/5152.html','true',[],''],
	['PAGE','7601',jdecode('Realization'),jdecode(''),'/7601.html','true',[],''],
	['PAGE','7627',jdecode('Rentals'),jdecode(''),'/7627.html','true',[],''],
	['PAGE','7401',jdecode('Credits+%26+Images'),jdecode(''),'/7401/index.html','true',[ 
		['PAGE','7653',jdecode('Film'),jdecode(''),'/7401/7653.html','true',[],''],
		['PAGE','7679',jdecode('Theatre'),jdecode(''),'/7401/7679.html','true',[],''],
		['PAGE','7705',jdecode('TV+%26+Commercials'),jdecode(''),'/7401/7705.html','true',[],''],
		['PAGE','7783',jdecode('Celebrities+%26+Music'),jdecode(''),'/7401/7783.html','true',[],''],
		['PAGE','19101',jdecode('Weddings'),jdecode(''),'/7401/19101.html','true',[],''],
		['PAGE','19127',jdecode('Styling+%26+Design'),jdecode(''),'/7401/19127.html','true',[],'']
	],''],
	['PAGE','7809',jdecode('Contact'),jdecode(''),'/7809.html','true',[],''],
	['PAGE','14401',jdecode('Location'),jdecode(''),'/14401.html','true',[],''],
	['PAGE','11227',jdecode('Textiles+%26+Tailoring'),jdecode(''),'/11227.html','true',[],''],
	['PAGE','32201',jdecode('Links'),jdecode(''),'/32201.html','true',[],'']];
var siteelementCount=15;
theSitetree.topTemplateName='Fellow';
theSitetree.paletteFamily='000000';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10637';
theSitetree.graphicsetId='10695';
theSitetree.contentColor='DDDDDD';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				name: 			'Fellow',
				paletteFamily: 	'000000',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10637',
				graphicsetId: 	'10695',
				contentColor: 	'DDDDDD',
				contentBGColor: '000000',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				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:  '5101',
internalId:  '',
customField: '20100128-120304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7783',
internalId:  '',
customField: '20100128-165643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7653',
internalId:  '',
customField: '20100127-143637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5152',
internalId:  '',
customField: '20100128-142459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7401',
internalId:  '',
customField: '20100128-120530'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7627',
internalId:  '',
customField: '20100128-155059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7601',
internalId:  '',
customField: '20100128-153815'
};
webappMappings['7008']=webappMappings['7008-2255']={
webappId:    '7008',
documentId:  '7809',
internalId:  '2255',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7809',
internalId:  '',
customField: '20100128-120600'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '14401',
internalId:  'location',
customField: 'language:en;country:GB;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14401',
internalId:  '',
customField: '20100128-120627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11227',
internalId:  '',
customField: '20100128-163251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32201',
internalId:  '',
customField: '20100128-121914'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7679',
internalId:  '',
customField: '20100128-165748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7705',
internalId:  '',
customField: '20100128-163442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19101',
internalId:  '',
customField: '20090614-121752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19127',
internalId:  '',
customField: '20090614-121827'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INEW10';
var companyName   = 'Academy+Costumes';
var htmlTitle	  = 'Academy+Costumes';
var metaKeywords  = 'META+name%3Dkeywords+content%3Dtheatrical+costume+hire+%2Cperiod+costume+hire+%2Ccostume+rentals+%2Ctheatre+costume+hire+%2Ccostume+hire+shops+%2Ccostume+hire+london+%2Ccostume+hire+uk+%2Ccostume+suppliers+london+%2Ccostume+supplies+london+%2Cperiod+costume+hire+london+%2Cbespoke+tailor+london+%2Cbespoke+tailoring+london+%2Cbespoke+tailors+uk+%2Ctailor+made+costume+%2Cvintage+clothing+shops+%2Cdesigner+vintage+clothing+%2Clondon+vintage+clothing+%2Ctheater+costume+%2Cfilm+stars+costumes+%2Ctelevision+costumes+%2Cfilm+costume+designers+%2Cfancy+dress+costume+accessory+%2Chistorical+costumes+%2Cdress+up+costume+accessories+%2Ccostume+textiles+london+%2C+www.academycostumes.com';
var metaContents  = 'For+over+20+years+ACADEMY+Costumiers+London+have+been+supplying+costumes+to+the+entertainment+industry.+Our+wide+ranging+services+include+costume+realization%2C+rentals%2C+bespoke+tailoring%2C+styling+and+design.';
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();
};
