/* [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(''), jdecode('%2F1801.html'), 'true',[],'',''],
	['PAGE','23101',jdecode('About+Us'),jdecode(''), jdecode('%2F23101.html'), 'true',[],'',''],
	['PAGE','72512',jdecode('IGT+2011+Winners'),jdecode(''), jdecode('%2F72512.html'), 'true',[],'',''],
	['PAGE','1878',jdecode('IGT+2011+Finalists'),jdecode(''), jdecode('%2F1878.html'), 'true',[],'',''],
	['PAGE','2327',jdecode('IGT+2011+Final'),jdecode(''), jdecode('%2F2327.html'), 'true',[],'',''],
	['PAGE','49601',jdecode('IGT+2010+Winners'),jdecode(''), jdecode('%2F49601.html'), 'true',[],'',''],
	['PAGE','1852',jdecode('IGT+2009+Winners'),jdecode(''), jdecode('%2F1852.html'), 'true',[],'',''],
	['PAGE','2301',jdecode('IGT+2012+Auditions+'),jdecode(''), jdecode('%2F2301.html'), 'true',[],'',''],
	['PAGE','51001',jdecode('Watch+It'),jdecode(''), jdecode('%2F51001.html'), 'true',[],'',''],
	['PAGE','38401',jdecode('Rehearsals'),jdecode(''), jdecode('%2F38401.html'), 'true',[],'',''],
	['PAGE','1930',jdecode('Sponsors+%26+Links'),jdecode(''), jdecode('%2F1930.html'), 'true',[],'',''],
	['PAGE','1956',jdecode('Volunteer'),jdecode(''), jdecode('%2F1956.html'), 'true',[],'',''],
	['PAGE','2008',jdecode('Application+Form'),jdecode(''), jdecode('%2F2008.html'), 'true',[],'',''],
	['PAGE','1904',jdecode('Competition+Rules'),jdecode(''), jdecode('%2F1904.html'), 'true',[],'',''],
	['PAGE','16901',jdecode('Tickets'),jdecode(''), jdecode('%2F16901.html'), 'true',[],'',''],
	['PAGE','61301',jdecode('Shop'),jdecode(''), jdecode('%2F61301.html'), 'true',[],'',''],
	['PAGE','14901',jdecode('Prizes'),jdecode(''), jdecode('%2F14901.html'), 'true',[],'',''],
	['PAGE','1982',jdecode('Contact+Us'),jdecode(''), jdecode('%2F1982.html'), 'true',[],'',''],
	['PAGE','18201',jdecode('Blog+It'),jdecode(''), jdecode('%2F18201.html'), 'true',[],'',''],
	['PAGE','60301',jdecode('Equal+Ops'),jdecode(''), jdecode('%2F60301.html'), 'true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Displace';
theSitetree.paletteFamily='2E2E2E';
theSitetree.keyvisualId='11075';
theSitetree.keyvisualName='kv_11075.jpg';
theSitetree.fontsetId='31958';
theSitetree.graphicsetId='13798';
theSitetree.contentColor='D8D8D5';
theSitetree.contentBGColor='2E2E2E';
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: 			'Displace',
				paletteFamily: 	'2E2E2E',
				keyvisualId: 	'11075',
				keyvisualName: 	'kv_11075.jpg',
				fontsetId: 		'31958',
				graphicsetId: 	'13798',
				contentColor: 	'D8D8D5',
				contentBGColor: '2E2E2E',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60301',
internalId:  '',
customField: '20110224-181203'
};
webappMappings['7008']=webappMappings['7008-6847']={
webappId:    '7008',
documentId:  '1956',
internalId:  '6847',
customField: 'language:en;country:GB;'
};
webappMappings['7008']=webappMappings['7008-6848']={
webappId:    '7008',
documentId:  '2008',
internalId:  '6848',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20111201-140727'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1801',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-11260043']={
webappId:    '1501',
documentId:  '1801',
internalId:  '11260043',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1852',
internalId:  '',
customField: '20110105-171234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1982',
internalId:  '',
customField: '20111201-140951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1956',
internalId:  '',
customField: '20111127-102611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1930',
internalId:  '',
customField: '20110526-162640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1878',
internalId:  '',
customField: '20111201-135930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2301',
internalId:  '',
customField: '20111125-115548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2327',
internalId:  '',
customField: '20111127-101251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1904',
internalId:  '',
customField: '20111127-102717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2008',
internalId:  '',
customField: '20110905-155628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18201',
internalId:  '',
customField: '20100614-131422'
};
webappMappings['7050']=webappMappings['7050-3702']={
webappId:    '7050',
documentId:  '18201',
internalId:  '3702',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14901',
internalId:  '',
customField: '20111201-140901'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23101',
internalId:  '',
customField: '20110105-170402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16901',
internalId:  '',
customField: '20111127-102827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72512',
internalId:  '',
customField: '20111202-152657'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38401',
internalId:  '',
customField: '20111127-102532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49601',
internalId:  '',
customField: '20110105-170432'
};
webappMappings['7060']=webappMappings['7060-da37e1b104ab3a8c98fb37689c473d7a']={
webappId:    '7060',
documentId:  '51001',
internalId:  'da37e1b104ab3a8c98fb37689c473d7a',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51001',
internalId:  '',
customField: '20111201-140500'
};
webappMappings['7008']=webappMappings['7008-8712']={
webappId:    '7008',
documentId:  '61301',
internalId:  '8712',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61301',
internalId:  '',
customField: '20111127-102917'
};
webappMappings['7008']=webappMappings['7008-9006']={
webappId:    '7008',
documentId:  '16901',
internalId:  '9006',
customField: 'language:en;country:GB;'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT30IN37ES';
var companyName   = 'ISLINGTON%60S+GOT+TALENT%21';
var htmlTitle	  = '';
var metaKeywords  = 'IGT%2C+Islington%2C+talent+contest%2C+islington%27s+got+talent';
var metaContents  = 'IGT%2C+islingtons+got+talent%2C+the+official+website%2C+HFI%2C+islington%2C+final%2C+HOTR%2C+contestants%2C+winners%2C+excellent%2C+fab%2C+great%2C+talent+show%2C+';
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();
};

