/* [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','5101',jdecode('Home'),jdecode(''), jdecode('%2F5101.html'), 'true',[],'',''],
	['PAGE','8827',jdecode('This+Months+Buzz'),jdecode(''), jdecode('%2F8827.html'), 'true',[],'',''],
	['PAGE','8701',jdecode('Who+We+Are'),jdecode(''), jdecode('%2F8701%2Findex.html'), 'true',[ 
		['PAGE','8722',jdecode('Our+Bakery'),jdecode(''), jdecode('%2F8701%2F8722.html'), 'true',[],'',''],
		['PAGE','8743',jdecode('Our+Chef'),jdecode(''), jdecode('%2F8701%2F8743.html'), 'true',[],'','']
	],'',''],
	['PAGE','5215',jdecode('What+We+Offer'),jdecode(''), jdecode('%2F5215%2Findex.html'), 'true',[ 
		['PAGE','5236',jdecode('Custom+Cakes+and+Cupcakes'),jdecode(''), jdecode('%2F5215%2F5236.html'), 'true',[],'',''],
		['PAGE','5257',jdecode('Flavors+and+Prices'),jdecode(''), jdecode('%2F5215%2F5257.html'), 'true',[],'',''],
		['PAGE','8764',jdecode('Cake+Truffles'),jdecode(''), jdecode('%2F5215%2F8764.html'), 'true',[],'',''],
		['PAGE','5278',jdecode('Cookies+'),jdecode(''), jdecode('%2F5215%2F5278.html'), 'true',[],'',''],
		['PAGE','8785',jdecode('Pies+and+Everything+Else'),jdecode(''), jdecode('%2F5215%2F8785.html'), 'true',[],'','']
	],'',''],
	['PAGE','5152',jdecode('When+We+Are+Open'),jdecode(''), jdecode('%2F5152.html'), 'true',[],'',''],
	['PAGE','5173',jdecode('Where+We+Are'),jdecode(''), jdecode('%2F5173.html'), 'true',[],'',''],
	['PAGE','8806',jdecode('Why+Suzybeez%3F'),jdecode(''), jdecode('%2F8806.html'), 'true',[],'',''],
	['PAGE','5194',jdecode('How+To+Contact+Us'),jdecode(''), jdecode('%2F5194%2Findex.html'), 'true',[ 
		['PAGE','13901',jdecode('Email'),jdecode(''), jdecode('%2F5194%2F13901.html'), 'true',[],'','']
	],'',''],
	['PAGE','25601',jdecode('Placing+an+Order'),jdecode(''), jdecode('%2F25601.html'), 'true',[],'',''],
	['PAGE','11101',jdecode('Pictures'),jdecode(''), jdecode('%2F11101%2Findex.html'), 'true',[ 
		['PAGE','12501',jdecode('Custom+Cakes'),jdecode(''), jdecode('%2F11101%2F12501.html'), 'true',[],'',''],
		['PAGE','12522',jdecode('Cupcakes'),jdecode(''), jdecode('%2F11101%2F12522.html'), 'true',[],'',''],
		['PAGE','12543',jdecode('Everything+Else'),jdecode(''), jdecode('%2F11101%2F12543.html'), 'true',[],'','']
	],'',''],
	['PAGE','61601',jdecode('Employment++'),jdecode(''), jdecode('%2F61601.html'), 'true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Celebration';
theSitetree.paletteFamily='FDF68D';
theSitetree.keyvisualId='3790';
theSitetree.keyvisualName='kv_3790.jpg';
theSitetree.fontsetId='10584';
theSitetree.graphicsetId='10986';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp35-attweb',
  product: 'WSCSYSSSSLY0X9RC'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Celebration',
				paletteFamily: 	'FDF68D',
				keyvisualId: 	'3790',
				keyvisualName: 	'kv_3790.jpg',
				fontsetId: 		'10584',
				graphicsetId: 	'10986',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'948D21',
				e_color: 		'948D21',
				f_color: 		'948D21',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5101',
internalId:  '',
customField: '20120104-115157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8701',
internalId:  '',
customField: '20111020-230328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8722',
internalId:  '',
customField: '20110617-152346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8743',
internalId:  '',
customField: '20100713-210327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5215',
internalId:  '',
customField: '20111013-234813'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5236',
internalId:  '',
customField: '20111013-235614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5257',
internalId:  '',
customField: '20111020-230804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5152',
internalId:  '',
customField: '20120131-142533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5173',
internalId:  '',
customField: '20090628-162358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8806',
internalId:  '',
customField: '20111020-215721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8764',
internalId:  '',
customField: '20111020-230928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5278',
internalId:  '',
customField: '20111020-231100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8785',
internalId:  '',
customField: '20111020-231822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5194',
internalId:  '',
customField: '20111020-221203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11101',
internalId:  '',
customField: '20111020-223511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8827',
internalId:  '',
customField: '20120131-143144'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12501',
internalId:  '',
customField: '20111204-184107'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12522',
internalId:  '',
customField: '20111204-184139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12543',
internalId:  '',
customField: '20111204-184311'
};
webappMappings['7008']=webappMappings['7008-8492']={
webappId:    '7008',
documentId:  '13901',
internalId:  '8492',
customField: 'language:en;country:US;'
};
webappMappings['1501']=webappMappings['1501-15493224']={
webappId:    '1501',
documentId:  '5101',
internalId:  '15493224',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25601',
internalId:  '',
customField: '20111020-223436'
};
webappMappings['7008']=webappMappings['7008-20835']={
webappId:    '7008',
documentId:  '61601',
internalId:  '20835',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61601',
internalId:  '',
customField: '20111020-223912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13901',
internalId:  '',
customField: '20111020-221459'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INHRFX';
var companyName   = 'Suzybeez+Cakez+N+Sweetz';
var htmlTitle	  = 'Suzybeez+Custom+Cakes+and+Cupcakes';
var metaKeywords  = 'cupcakes%2C+cakes%2C+wedding%2C+baby+shower%2C+birthday+cakes%2C+cypress%2Ctx%2C+houston%2C+tx';
var metaContents  = 'Cupcakes%2C+wedding+cakes+and+cupcakes%2C+baby+shower+cakes%2C+cookies%2C+Pies%2C+desserts';
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();
};

