/* [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','4601',jdecode('Home'),jdecode(''), jdecode('%2F4601.html'), 'true',[],'',''],
	['PAGE','104012',jdecode('Clothing+%26+Gift+Ideas'),jdecode(''), jdecode('%2F104012.html'), 'true',[],'',''],
	['PAGE','51801',jdecode('%21Tattoos+Today+Our+View%21%21'),jdecode(''), jdecode('%2F51801.html'), 'true',[],'',''],
	['PAGE','40101',jdecode('Cover+ups'),jdecode(''), jdecode('%2F40101.html'), 'true',[],'',''],
	['PAGE','4652',jdecode('John'),jdecode(''), jdecode('%2F4652.html'), 'true',[],'',''],
	['PAGE','4678',jdecode('Brengunn'),jdecode(''), jdecode('%2F4678.html'), 'true',[],'',''],
	['PAGE','4730',jdecode('Dale%2CAKA%2CCC'),jdecode(''), jdecode('%2F4730.html'), 'true',[],'',''],
	['PAGE','74801',jdecode('nEWbOY+Craig'),jdecode(''), jdecode('%2F74801.html'), 'true',[],'',''],
	['PAGE','54901',jdecode('Laser+Removal'),jdecode(''), jdecode('%2F54901.html'), 'true',[],'',''],
	['PAGE','111612',jdecode('After+care'),jdecode(''), jdecode('%2F111612.html'), 'true',[],'',''],
	['ITEM','101912',jdecode('Videos'),jdecode(''), jdecode('http%3A%2F%2Fyoutu.be%2FweUyLAKn5Ok'), 'true',[],'','_blank'],
	['PAGE','5801',jdecode('F.A.Q'),jdecode(''), jdecode('%2F5801.html'), 'true',[],'',''],
	['PAGE','7701',jdecode('NEWS+FLASH'),jdecode(''), jdecode('%2F7701.html'), 'true',[],'',''],
	['PAGE','28401',jdecode('send+us+your+pics'),jdecode(''), jdecode('%2F28401.html'), 'true',[],'',''],
	['PAGE','37301',jdecode('Guest+Book'),jdecode(''), jdecode('%2F37301.html'), 'true',[],'',''],
	['ITEM','103412',jdecode('OUR+FACEBOOK'),jdecode(''), jdecode('http%3A%2F%2Fwww.facebook.com%2Fpages%2FDragon-fashions-tattoo%2F166787756693140'), 'true',[],'','_blank'],
	['PAGE','22501',jdecode('OUR+LINKS'),jdecode(''), jdecode('%2F22501.html'), 'true',[],'',''],
	['PAGE','14601',jdecode('contact+details'),jdecode(''), jdecode('%2F14601.html'), 'true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Citylights';
theSitetree.paletteFamily='336600';
theSitetree.keyvisualId='10441';
theSitetree.keyvisualName='kv_10441.jpg';
theSitetree.fontsetId='26577';
theSitetree.graphicsetId='13394';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='336600';
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: 			'Citylights',
				paletteFamily: 	'336600',
				keyvisualId: 	'10441',
				keyvisualName: 	'kv_10441.jpg',
				fontsetId: 		'26577',
				graphicsetId: 	'13394',
				contentColor: 	'FFFFFF',
				contentBGColor: '336600',
				a_color: 		'3E3535',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4601',
internalId:  '',
customField: '20111110-203516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4652',
internalId:  '',
customField: '20111110-205116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14601',
internalId:  '',
customField: '20111110-212533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5801',
internalId:  '',
customField: '20111110-212218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4678',
internalId:  '',
customField: '20111110-205210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4730',
internalId:  '',
customField: '20111110-205255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7701',
internalId:  '',
customField: '20111110-212242'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22501',
internalId:  '',
customField: '20111110-212440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28401',
internalId:  '',
customField: '20111110-212320'
};
webappMappings['1002']=webappMappings['1002-37301anbt10in3cd5']={
webappId:    '1002',
documentId:  '37301',
internalId:  '37301anbt10in3cd5',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37301',
internalId:  '',
customField: '20090517-173756'
};
webappMappings['7008']=webappMappings['7008-4739']={
webappId:    '7008',
documentId:  '14601',
internalId:  '4739',
customField: 'language:en;country:GB;'
};
webappMappings['1501']=webappMappings['1501-9645087']={
webappId:    '1501',
documentId:  '4601',
internalId:  '9645087',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40101',
internalId:  '',
customField: '20111110-203924'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51801',
internalId:  '',
customField: '20111110-203750'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54901',
internalId:  '',
customField: '20111110-205634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74801',
internalId:  '',
customField: '20111110-205417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111612',
internalId:  '',
customField: '20111110-212154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104012',
internalId:  '',
customField: '20111108-200557'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN3CD5';
var companyName   = 'DRAGON+FASHIONS+est+1984';
var htmlTitle	  = 'tattoo+art+dragon+fashions+birmingham+';
var metaKeywords  = 'tattoo%2Cfreehand%2Ctribal%2Cjapanese%2Cceltic%2Cfreehand%2Cportrait%2Ctattoo%2Cold+school%2Cnew+school%2Ctattoo+since+84%2C';
var metaContents  = 'miami+in%2Ck+la+ink%2Cbirmingham+city%2Ctattoo+studios+birmingham%2Coriginal+since+84%2Cbirminghams+oldest+studio+same+owner%2Cselly+oak%2Ctattoo+art%2Cjohn+foster%2Cjohnny2tat%2Cdragonfashions%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();
};

