/* [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','10201',jdecode('Home'),jdecode(''), jdecode('%2F10201.html'), 'true',[],'',''],
	['PAGE','10252',jdecode('Pictures+of+Magical+Events'),jdecode(''), jdecode('%2F10252%2Findex.html'), 'true',[ 
		['PAGE','16964',jdecode('New+Years+Eve+Wedding'),jdecode(''), jdecode('%2F10252%2F16964.html'), 'true',[],'',''],
		['PAGE','16943',jdecode('Yellow+and+Black+Steelers+Wedding'),jdecode(''), jdecode('%2F10252%2F16943.html'), 'true',[],'',''],
		['PAGE','17912',jdecode('Weddings+at+the+Winery'),jdecode(''), jdecode('%2F10252%2F17912.html'), 'true',[],'',''],
		['PAGE','16922',jdecode('Photography'),jdecode(''), jdecode('%2F10252%2F16922.html'), 'true',[],'',''],
		['PAGE','16901',jdecode('Cakes'),jdecode(''), jdecode('%2F10252%2F16901.html'), 'true',[],'','']
	],'',''],
	['PAGE','10273',jdecode('Services'),jdecode(''), jdecode('%2F10273.html'), 'true',[],'',''],
	['PAGE','10294',jdecode('Products'),jdecode(''), jdecode('%2F10294.html'), 'true',[],'',''],
	['PAGE','10315',jdecode('Magical+Musings'),jdecode(''), jdecode('%2F10315.html'), 'false',[],'',''],
	['PAGE','26212',jdecode('Special+events'),jdecode(''), jdecode('%2F26212.html'), 'true',[],'',''],
	['PAGE','24912',jdecode('Guestbook'),jdecode(''), jdecode('%2F24912.html'), 'true',[],'',''],
	['PAGE','10357',jdecode('Contact'),jdecode(''), jdecode('%2F10357.html'), 'true',[],'',''],
	['PAGE','10378',jdecode('About+us'),jdecode(''), jdecode('%2F10378.html'), 'true',[],'',''],
	['PAGE','15201',jdecode('Local+Weather'),jdecode(''), jdecode('%2F15201.html'), 'true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Antigua';
theSitetree.paletteFamily='617F92';
theSitetree.keyvisualId='6914';
theSitetree.keyvisualName='kv_6914.jpg';
theSitetree.fontsetId='11214';
theSitetree.graphicsetId='12036';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='809DAF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRNU'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Antigua',
				paletteFamily: 	'617F92',
				keyvisualId: 	'6914',
				keyvisualName: 	'kv_6914.jpg',
				fontsetId: 		'11214',
				graphicsetId: 	'12036',
				contentColor: 	'000000',
				contentBGColor: '809DAF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['4001']=webappMappings['4001-37927928']={
webappId:    '4001',
documentId:  '10294',
internalId:  '37927928',
customField: 'language:en;country:US;'
};
webappMappings['7050']=webappMappings['7050-20192']={
webappId:    '7050',
documentId:  '10315',
internalId:  '20192',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10201',
internalId:  '',
customField: '20110827-211549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16922',
internalId:  '',
customField: '20110317-142944'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10273',
internalId:  '',
customField: '20120102-172251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16901',
internalId:  '',
customField: '20120110-074321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10294',
internalId:  '',
customField: '20110825-231344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10315',
internalId:  '',
customField: '20110227-221315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10252',
internalId:  '',
customField: '20120219-091240'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '10201',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-24912aendu0inzl8v']={
webappId:    '1002',
documentId:  '24912',
internalId:  '24912aendu0inzl8v',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10357',
internalId:  '',
customField: '20110828-143816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10378',
internalId:  '',
customField: '20110825-231823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24912',
internalId:  '',
customField: '20110825-231630'
};
webappMappings['7080']=webappMappings['7080-889']={
webappId:    '7080',
documentId:  '15201',
internalId:  '889',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15201',
internalId:  '',
customField: '20110301-105139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16943',
internalId:  '',
customField: '20120219-103547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16964',
internalId:  '',
customField: '20120219-091123'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17912',
internalId:  '',
customField: '20120220-072801'
};
webappMappings['7008']=webappMappings['7008-34571']={
webappId:    '7008',
documentId:  '10357',
internalId:  '34571',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26212',
internalId:  '',
customField: '20120102-172055'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INZL8V';
var companyName   = 'Magical+Events';
var htmlTitle	  = 'Magical+Events+Springfield+Illinois';
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();
};

