/* [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','1901',jdecode('About+Us....'),jdecode(''),'/1901.html','true',[],'',''],
	['PAGE','2101',jdecode('Chair+Covers'),jdecode(''),'/2101.html','true',[],'',''],
	['PAGE','22312',jdecode('Table+Runners'),jdecode(''),'/22312.html','true',[],'',''],
	['PAGE','19812',jdecode('*New*+Sash+Hire'),jdecode(''),'/19812.html','true',[],'',''],
	['PAGE','20612',jdecode('*New*+DIY+Chair+Covers'),jdecode(''),'/20612.html','true',[],'',''],
	['PAGE','21412',jdecode('*Coming+Soon*+FAIRYLIGHT+BACKDROP'),jdecode(''),'/21412.html','true',[],'',''],
	['PAGE','2301',jdecode('Venue+Decoration'),jdecode(''),'/2301.html','true',[],'',''],
	['PAGE','2501',jdecode('Sweet+Stand%2F+Cupcake+Stand'),jdecode(''),'/2501.html','true',[],'',''],
	['PAGE','2701',jdecode('Powder+Room+-+Cake+Towels'),jdecode(''),'/2701.html','true',[],'',''],
	['PAGE','7512',jdecode('Centrepiece+Ideas+2010'),jdecode(''),'/7512.html','true',[],'',''],
	['PAGE','2901',jdecode('Church+Decoration'),jdecode(''),'/2901.html','true',[],'',''],
	['PAGE','2927',jdecode('Civil+Ceremonies'),jdecode(''),'/2927.html','true',[],'',''],
	['PAGE','2953',jdecode('Wedding+Planning'),jdecode(''),'/2953.html','true',[],'',''],
	['PAGE','2979',jdecode('Venues+Covered'),jdecode(''),'/2979.html','true',[],'',''],
	['PAGE','3005',jdecode('Bridal+Beauty+%26+Make-up'),jdecode(''),'/3005.html','false',[],'',''],
	['PAGE','3031',jdecode('Wedding+Stationery'),jdecode(''),'/3031.html','false',[],'',''],
	['PAGE','3057',jdecode('Wedding+Favors'),jdecode(''),'/3057.html','true',[],'',''],
	['PAGE','3083',jdecode('Wedding+Cameras'),jdecode(''),'/3083.html','true',[],'',''],
	['PAGE','3109',jdecode('Photo+Gallery'),jdecode(''),'/3109.html','true',[],'',''],
	['PAGE','3135',jdecode('Testimonials'),jdecode(''),'/3135.html','true',[],'',''],
	['PAGE','7312',jdecode('SPECIAL+OFFERS'),jdecode(''),'/7312.html','true',[],'',''],
	['PAGE','7338',jdecode('Enquiry+Form'),jdecode(''),'/7338.html','true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Oblique';
theSitetree.paletteFamily='DD9390';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='33311';
theSitetree.graphicsetId='14185';
theSitetree.contentColor='333333';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Oblique',
				paletteFamily: 	'DD9390',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'33311',
				graphicsetId: 	'14185',
				contentColor: 	'333333',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Palatino Linotype, Book Antiqua, Palatino, serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1901',
internalId:  '',
customField: '20100723-011610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20100721-052050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2301',
internalId:  '',
customField: '20100501-220451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2501',
internalId:  '',
customField: '20100504-001446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2701',
internalId:  '',
customField: '20100501-200142'
};
webappMappings['7060']=webappMappings['7060-8127777c482897f03c849cdfe425e6d2']={
webappId:    '7060',
documentId:  '3109',
internalId:  '8127777c482897f03c849cdfe425e6d2',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3109',
internalId:  '',
customField: '20100319-044112'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2953',
internalId:  '',
customField: '20100319-045620'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3031',
internalId:  '',
customField: '20091105-133932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2901',
internalId:  '',
customField: '20100723-202041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2927',
internalId:  '',
customField: '20100723-012339'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3135',
internalId:  '',
customField: '20100319-044631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2979',
internalId:  '',
customField: '20100721-054812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3083',
internalId:  '',
customField: '20100501-200411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3057',
internalId:  '',
customField: '20100723-201934'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3005',
internalId:  '',
customField: '20091105-133932'
};
webappMappings['7008']=webappMappings['7008-4978']={
webappId:    '7008',
documentId:  '7338',
internalId:  '4978',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7312',
internalId:  '',
customField: '20100725-014748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7338',
internalId:  '',
customField: '20100723-011441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7512',
internalId:  '',
customField: '20100721-050151'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20612',
internalId:  '',
customField: '20100723-162219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19812',
internalId:  '',
customField: '20100723-163411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21412',
internalId:  '',
customField: '20100725-014328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22312',
internalId:  '',
customField: '20100726-004511'
};
var canonHostname = 'wc1.hosting.digiweb.ie';
var accountId     = 'AGW010IN24UL';
var companyName   = 'Diamond+Wedding+Services';
var htmlTitle	  = 'Chair+covers+Venue+Decoration+Fairylight+Backdrop+Cork+Kerry+Waterford+';
var metaKeywords  = 'chair+coverswedding+decor%0Afairylight+backdrop%0Avenue+decor';
var metaContents  = 'Chair+covers+and+venue+decor+in+Munster%0Afairylight+backdrop';
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();
};
