/* [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','32012',jdecode('Home'),jdecode(''),'/32012.html','true',[],''],
	['PAGE','25252',jdecode('About+us'),jdecode(''),'/25252.html','true',[],''],
	['PAGE','25336',jdecode('Weddings'),jdecode(''),'/25336/index.html','true',[ 
		['PAGE','25357',jdecode('Wedding+Packages'),jdecode(''),'/25336/25357.html','true',[],''],
		['PAGE','48626',jdecode('Decoration+Packages'),jdecode(''),'/25336/48626.html','true',[],''],
		['PAGE','30112',jdecode('Honeymoon+Packages'),jdecode(''),'/25336/30112.html','false',[],'']
	],''],
	['PAGE','25273',jdecode('Corporate+Events'),jdecode(''),'/25273/index.html','true',[ 
		['PAGE','25294',jdecode('Team+Building'),jdecode(''),'/25273/25294.html','true',[],''],
		['PAGE','50126',jdecode('Team+Building+Continued'),jdecode(''),'/25273/50126.html','false',[],''],
		['PAGE','25315',jdecode('Themed+Events'),jdecode(''),'/25273/25315.html','false',[],'']
	],''],
	['PAGE','25378',jdecode('Special+Occasions'),jdecode(''),'/25378.html','true',[],''],
	['PAGE','25399',jdecode('Gallery'),jdecode(''),'/25399.html','true',[],''],
	['PAGE','34712',jdecode('Specials'),jdecode(''),'/34712.html','false',[],''],
	['PAGE','25420',jdecode('Contact+Us'),jdecode(''),'/25420/index.html','true',[ 
		['PAGE','34312',jdecode('Interesting+links'),jdecode(''),'/25420/34312.html','false',[],''],
		['PAGE','25462',jdecode('Legal+Disclaimer'),jdecode(''),'/25420/25462.html','false',[],''],
		['PAGE','25483',jdecode('Privacy+Statement'),jdecode(''),'/25420/25483.html','false',[],'']
	],'']];
var siteelementCount=17;
theSitetree.topTemplateName='Mazy';
theSitetree.paletteFamily='64A9B6';
theSitetree.keyvisualId='11322';
theSitetree.keyvisualName='kv_11322.jpg';
theSitetree.fontsetId='31988';
theSitetree.graphicsetId='13820';
theSitetree.contentColor='3C3D3C';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Mazy',
				paletteFamily: 	'64A9B6',
				keyvisualId: 	'11322',
				keyvisualName: 	'kv_11322.jpg',
				fontsetId: 		'31988',
				graphicsetId: 	'13820',
				contentColor: 	'3C3D3C',
				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:  '25420',
internalId:  '',
customField: '20090603-215318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25399',
internalId:  '',
customField: '20090210-231836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32012',
internalId:  '',
customField: '20090811-225538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25252',
internalId:  '',
customField: '20090716-205145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25273',
internalId:  '',
customField: '20090601-230457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25336',
internalId:  '',
customField: '20090811-225614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25357',
internalId:  '',
customField: '20090601-230131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25378',
internalId:  '',
customField: '20090402-195210'
};
webappMappings['7008']=webappMappings['7008-12857']={
webappId:    '7008',
documentId:  '25420',
internalId:  '12857',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25294',
internalId:  '',
customField: '20090402-195116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25315',
internalId:  '',
customField: '20090222-193620'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30112',
internalId:  '',
customField: '20090208-050326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34312',
internalId:  '',
customField: '20090210-205316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25462',
internalId:  '',
customField: '20090208-050913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25483',
internalId:  '',
customField: '20090208-051032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34712',
internalId:  '',
customField: '20090601-230832'
};
webappMappings['7060']=webappMappings['7060-59eeb59ea0aec961f470b20ed4412d42']={
webappId:    '7060',
documentId:  '25399',
internalId:  '59eeb59ea0aec961f470b20ed4412d42',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '32012',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48626',
internalId:  '',
customField: '20090402-194423'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50126',
internalId:  '',
customField: '20090216-223711'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0INEQAJ';
var companyName   = '';
var htmlTitle	  = 'Eat+Cake+Events+-+Have+your+cake+and+eat+it+too';
var metaKeywords  = '';
var metaContents  = '';
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();
};

