/* [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','801',jdecode('Home'),jdecode(''),'/801.html','true',[],''],
	['PAGE','9401',jdecode('Services'),jdecode(''),'/9401.html','true',[],''],
	['PAGE','2922',jdecode('Gallery'),jdecode(''),'/2922.html','true',[],''],
	['PAGE','26401',jdecode('Client+Area'),jdecode(''),'/26401.html','true',[],''],
	['PAGE','38017',jdecode('Guestbook'),jdecode(''),'/38017/index.html','true',[ 
		['PAGE','38012',jdecode('Read+Guestbook'),jdecode(''),'/38017/38012.html','false',[],'']
	],''],
	['PAGE','55612',jdecode('Videos'),jdecode(''),'/55612.html','true',[],''],
	['PAGE','57812',jdecode('News%2FEvents'),jdecode(''),'/57812.html','true',[],''],
	['PAGE','2943',jdecode('Links'),jdecode(''),'/2943.html','true',[],''],
	['PAGE','56712',jdecode('Contact+Us'),jdecode(''),'/56712.html','true',[],'']];
var siteelementCount=10;
theSitetree.topTemplateName='Medium';
theSitetree.paletteFamily='000000';
theSitetree.keyvisualId='2155';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='355';
theSitetree.graphicsetId='408';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Medium',
				paletteFamily: 	'000000',
				keyvisualId: 	'2155',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'355',
				graphicsetId: 	'408',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'8EBFC6',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9401',
internalId:  '',
customField: '20090927-155908'
};
webappMappings['1002']=webappMappings['1002-38017abri10inxx9n']={
webappId:    '1002',
documentId:  '38017',
internalId:  '38017abri10inxx9n',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '801',
internalId:  '',
customField: '20090927-154948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2922',
internalId:  '',
customField: '20090927-160008'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26401',
internalId:  '',
customField: '20090927-160038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2943',
internalId:  '',
customField: '20090927-103423'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38017',
internalId:  '',
customField: '20071223-145259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38012',
internalId:  '',
customField: '20071223-145259'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '801',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '9401',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2922',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '26401',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2943',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '38017',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '38012',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57812',
internalId:  '',
customField: '20090806-160625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55612',
internalId:  '',
customField: '20090927-161750'
};
webappMappings['7008']=webappMappings['7008-1310']={
webappId:    '7008',
documentId:  '56712',
internalId:  '1310',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56712',
internalId:  '',
customField: '20090806-160946'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '55612',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '57812',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '56712',
internalId:  '',
customField: 'language:en;country:US;'
};
var canonHostname = 'wsc1.brinkster.com';
var accountId     = 'ABRI10INXX9N';
var companyName   = 'Stephen+Allard+Photography+UK';
var htmlTitle	  = 'Weddings+-+Events+-+Mobile+Studio+-+Salford+Manchester';
var metaKeywords  = 'stephen+allard%2Cphotography%2Cmanchester%2Csalford%2Cmobile+studio%2Cmobile+photo+studio%2Cportraits%2Cwedding+photographer%2Cevents+photographer%2Cnorth+west%2Cuk+photographer%2Cbuxton+photographer%2Cmanchester%2Csalford%2Cstockport%2Cmacclesfield+photographer+bury%2Cwhitefield%2Cdisley+photographer%2Cproduct+photo%2Cproduct+photography%2Clancashire%2Cordsall+photographer%2Cwedding+photos%2Canimal+photography%2Csalford+triathlon%2Cworld+cup%2Cdragon+boat+race%2Cchild+portrait%2Cchildren+photography%2Cphotographer%2Cphotography%2Cnorth%2Cwest%2Clancashire%2Cmanchester%2Cengland%2Cuk%2Ceu%2Ceurope%2Cbritain%2Cpr%2Cpublic%2Crelations%2Ceditorial%2Ccreative%2Cpress%2Cregional%2Clocal%2Cdigital%2Cflowers%2Cgardens%2Cillustrated%2Cmagazine%2Ccity%2Ccorporate';
var metaContents  = 'Based+in+Salford%2FManchester+Stephen+Allard+Photography+covers+most+of+the+North+West+with+his+Mobile+Photo+Studio+and+Wedding+services.Allard+Photography+-+Friendly++fun%2C+inobtrusive%2C+informal++relaxed+and+ideal+for+those+that+hate+posing%21++Please+feel+free+to+ask+any+questions+about+our+services.';
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();
};
