/* [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','85401',jdecode('Home'),jdecode(''),'/85401.html','true',[],''],
	['PAGE','452',jdecode('Contact%2FInfo'),jdecode(''),'/452.html','true',[],''],
	['PAGE','85452',jdecode('Fashion%2FModel+Portfolio'),jdecode(''),'/85452.html','true',[],''],
	['PAGE','85504',jdecode('Commercial'),jdecode(''),'/85504.html','true',[],''],
	['PAGE','85608',jdecode('Art%2FLandscape'),jdecode(''),'/85608.html','true',[],''],
	['PAGE','85556',jdecode('Interior+Images'),jdecode(''),'/85556.html','true',[],''],
	['PAGE','107001',jdecode('Club+Nights'),jdecode(''),'/107001.html','true',[],''],
	['PAGE','85478',jdecode('Wedding%2FCivil+Ceremony'),jdecode(''),'/85478.html','true',[],''],
	['PAGE','85530',jdecode('Event'),jdecode(''),'/85530.html','true',[],''],
	['PAGE','36901',jdecode('Disclaimer%2FSitemap'),jdecode(''),'/36901.html','true',[],'']];
var siteelementCount=10;
theSitetree.topTemplateName='Linedup';
theSitetree.paletteFamily='FFFFFF';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10359';
theSitetree.graphicsetId='10509';
theSitetree.contentColor='666666';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				name: 			'Linedup',
				paletteFamily: 	'FFFFFF',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10359',
				graphicsetId: 	'10509',
				contentColor: 	'666666',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85530',
internalId:  '',
customField: '20100106-112757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85504',
internalId:  '',
customField: '20100106-110032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20100106-105721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85556',
internalId:  '',
customField: '20100106-110315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '107001',
internalId:  '',
customField: '20100106-142155'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36901',
internalId:  '',
customField: '20100106-113131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85478',
internalId:  '',
customField: '20100106-112613'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85608',
internalId:  '',
customField: '20100106-110230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85401',
internalId:  '',
customField: '20100106-105433'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '85401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85452',
internalId:  '',
customField: '20100106-105922'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN2O0X';
var companyName   = 'cqphotography';
var htmlTitle	  = 'cqphotography%2Cinteriors%2Cportrait%2Cevent%2Ccommercial%2Cphotographer%3ABrighton%2CSussex%2CUK';
var metaKeywords  = 'fashion%2C+wedding%2C+model%2C+portfolio%2C+club%2C+nightclub%2C+portrait%2C+photographer%2C+photography%2C+Haywards+Heath%2C+Brighton%2C+Hove%2C+Sussex%2C+London%2C+UK%2C+family%2C+baby%2C+children%2C+commercial%2C+event%2C+contemporary%2C+informal%2C+photograph%2C+Portrait%2C+photo%2C+Photo%2C+Photographer%2C+Photography%2C+brighton%2C+hove%2C+worthing%2C+eastbourne%2C+hastings%2C+haywards+heath%2C+sussex%2C+london%2C+shoot%2C+Photograph%2C+Photographs%2C+photographers%2C+interior%2C+interiors%2C+portraits%2C+babies%2C+kids%2C+party%2C+baby%2C+design%2C+designs%2C+designer%2C+collection%2C+occasion%2C+service%2C+exclusive%2C+day%2C+services%2C+black%2C+white%2C+album%2C+quality%2C+contemporary%2C+natural%2C+quality%2C+colour%2C+photoshoot%2C+parties%2C+east%2C+west%2C+bn1%2C+bn2%2C+bn3%2C+bn4%2C+photo%2C+shoot%2C+picture%2C+pic%2C+pictures%2C+Pictures%2C+Picture%2C+image%2C+images%2C+photographer%2C+photography%2C+Brighton%2C+Hove%2C+CQphotography%2C+cqphotography%2C++Brighton+Photographer%2C+Portrait+Photographer%2C+Interiors+Brighton%2C++Brighton+Photography%2C+Commercial+photography+brighton%2C+events+brighton+photography%2C+portraits+photography+brighton%2C+south+coast%2C+special+occasion%2C+Brighton+and+Hove%2C+Brighton+Sussex%2C+black+and+white%2C+contemporary+portraits%2C+contemporary+photographer%2C+photo+shoot%2C+baby+parties%2C+kids+parties%2C+photographers+in+brighton%2C+photographers+in+sussex%2C+brighton+photo%2C+interior+design%2Cinterior+designs%2C+brighton+pictures%2C+Brighton+events+photographer%2C+Sussex+events+photographer%2C+Brighton+portrait+photographer%2C+Sussex+portrait+photographer%2C+commercial+photography%2C+East+Sussex%2C+West+Sussex%2C+Antony+Curtis+Quick%2C+Photographer+UK%2C+Brighton+portrait%2C+Sussex+portrait%2C+portrait+photographer%2C+family+portrait%2C+family+photographer%2C+kids+photographer%2C+children+photographer%2C+baby+photographer%2C+party+photographer%2C+fashion%2C+wedding%2C+model%2C+portfolio%2C+club%2C+nightclub%2C+event+photographer%2C++photography+studio%2C+CQ+photography';
var metaContents  = 'Model%2C+Portfolio%2C+Fashion%2C+Wedding%2C+Event%2C+Commercial%2C+photographer%3A%3ABrighton%2C+Hove%2C+Haywards+Heath%2C+Sussex%2C+London%2C+UK';
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();
};
