/* [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','3201',jdecode('Home'),jdecode(''),'/3201.html','true',[],''],
	['PAGE','4701',jdecode('Weddings'),jdecode(''),'/4701.html','false',[],''],
	['PAGE','4722',jdecode('Corporate'),jdecode(''),'/4722.html','false',[],''],
	['PAGE','11901',jdecode('Other'),jdecode(''),'/11901.html','false',[],''],
	['PAGE','3322',jdecode('Products'),jdecode(''),'/3322/index.html','false',[ 
		['PAGE','13201',jdecode('Favors'),jdecode(''),'/3322/13201.html','true',[],''],
		['PAGE','13222',jdecode('Flowers'),jdecode(''),'/3322/13222.html','true',[],''],
		['PAGE','13243',jdecode('Invitations'),jdecode(''),'/3322/13243.html','true',[],'']
	],''],
	['PAGE','12301',jdecode('Portfolio'),jdecode(''),'/12301.html','false',[],''],
	['PAGE','3301',jdecode('Services'),jdecode(''),'/3301/index.html','true',[ 
		['PAGE','16501',jdecode('Weddings'),jdecode(''),'/3301/16501.html','true',[],''],
		['PAGE','39022',jdecode('Corporate'),jdecode(''),'/3301/39022.html','true',[],''],
		['PAGE','39001',jdecode('Other+Events'),jdecode(''),'/3301/39001.html','true',[],'']
	],''],
	['PAGE','40501',jdecode('Event+Blogger'),jdecode(''),'/40501.html','true',[],''],
	['PAGE','3364',jdecode('Contact'),jdecode(''),'/3364.html','true',[],'']];
var siteelementCount=15;
theSitetree.topTemplateName='Vita02';
theSitetree.paletteFamily='F0DCB8';
theSitetree.keyvisualId='11348';
theSitetree.keyvisualName='kv_11348.jpg';
theSitetree.fontsetId='32117';
theSitetree.graphicsetId='13934';
theSitetree.contentColor='3C3D3C';
theSitetree.contentBGColor='F6FBFE';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Vita02',
				paletteFamily: 	'F0DCB8',
				keyvisualId: 	'11348',
				keyvisualName: 	'kv_11348.jpg',
				fontsetId: 		'32117',
				graphicsetId: 	'13934',
				contentColor: 	'3C3D3C',
				contentBGColor: 'F6FBFE',
				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: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3201',
internalId:  '',
customField: '20100715-234137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3364',
internalId:  '',
customField: '20091015-045837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39001',
internalId:  '',
customField: '20100620-135801'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3301',
internalId:  '',
customField: '20100329-220942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3322',
internalId:  '',
customField: '20090916-052237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11901',
internalId:  '',
customField: '20100620-135649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4722',
internalId:  '',
customField: '20091015-045646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20091020-235947'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16501',
internalId:  '',
customField: '20100620-134347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12301',
internalId:  '',
customField: '20091015-045728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13201',
internalId:  '',
customField: '20090916-054556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13222',
internalId:  '',
customField: '20090916-054456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13243',
internalId:  '',
customField: '20090916-054456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40501',
internalId:  '',
customField: '20100527-222446'
};
webappMappings['7050']=webappMappings['7050-14888']={
webappId:    '7050',
documentId:  '40501',
internalId:  '14888',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39022',
internalId:  '',
customField: '20100620-135521'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3201',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-796c2a198f33fc423f71c620f6d9424c']={
webappId:    '7060',
documentId:  '16501',
internalId:  '796c2a198f33fc423f71c620f6d9424c',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-382cede61388bcf95e1f9fc823965c7b']={
webappId:    '7060',
documentId:  '39022',
internalId:  '382cede61388bcf95e1f9fc823965c7b',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-a63e3c00b65b1f4f2487f559bd5c39da']={
webappId:    '7060',
documentId:  '39001',
internalId:  'a63e3c00b65b1f4f2487f559bd5c39da',
customField: 'language:en;country:US;'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INV1PK';
var companyName   = 'Events+To+Remember';
var htmlTitle	  = 'Event+and+Wedding+Planners%2FDesigners';
var metaKeywords  = 'Wedding+Planniers+in+Detroit+Michigan%2C+Event+Planners+in+Detroit+Michiagn%2C+Wedding+planners+in+the+Tricounty+area%2C+Event+planners+in+the+Tricounty+area%2C+Wedding+Planniers+in+Oakland+County%2C+++Event+planners+in+the+Tricounty+area%2C+Unique+Wedding+Planners+in+Oakland+county%2C+Certified+Wedding+Planners+in+Detroit+Michigan%2C+Certified+Wedding+Planners%2C+Wedding+Flowers';
var metaContents  = 'Wedding+PlanningEvent+PlanningParty+PlanningCertified+Event+PlannerCertified+Wedding+Planner';
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();
};
