/* [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','901',jdecode('Home'),jdecode(''),'/901.html','true',[],'',''],
	['PAGE','952',jdecode('About+us'),jdecode(''),'/952.html','true',[],'',''],
	['PAGE','973',jdecode('Wedding+Cakes'),jdecode(''),'/973.html','true',[],'',''],
	['PAGE','26812',jdecode('Icing+%26+Flavored+Fillings'),jdecode(''),'/26812.html','true',[],'',''],
	['PAGE','21712',jdecode('Wedding+Cake+Gallery'),jdecode(''),'/21712.html','true',[],'',''],
	['PAGE','1036',jdecode('Wedding+Cup+Cakes'),jdecode(''),'/1036.html','true',[],'',''],
	['PAGE','994',jdecode('Wedding+Cake+Accessories'),jdecode(''),'/994.html','true',[],'',''],
	['PAGE','23612',jdecode('Rentals'),jdecode(''),'/23612.html','true',[],'',''],
	['PAGE','1057',jdecode('Price+List'),jdecode(''),'/1057.html','true',[],'',''],
	['PAGE','1078',jdecode('Make+An+Appointment'),jdecode(''),'/1078.html','true',[],'',''],
	['PAGE','1099',jdecode('Directions'),jdecode(''),'/1099.html','true',[],'',''],
	['PAGE','1120',jdecode('Links'),jdecode(''),'/1120.html','true',[],'',''],
	['PAGE','7701',jdecode('Bridal+Shows'),jdecode(''),'/7701.html','true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Padma';
theSitetree.paletteFamily='CBB99C';
theSitetree.keyvisualId='1024';
theSitetree.keyvisualName='rose.jpg';
theSitetree.fontsetId='183';
theSitetree.graphicsetId='219';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='9E8B75';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Padma',
				paletteFamily: 	'CBB99C',
				keyvisualId: 	'1024',
				keyvisualName: 	'rose.jpg',
				fontsetId: 		'183',
				graphicsetId: 	'219',
				contentColor: 	'FFFFFF',
				contentBGColor: '9E8B75',
				a_color: 		'CBB99C',
				b_color: 		'52443C',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-5e79269f5c0c4a3518f1333cc8fd3a87']={
webappId:    '7060',
documentId:  '21712',
internalId:  '5e79269f5c0c4a3518f1333cc8fd3a87',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '901',
internalId:  '',
customField: '20100422-065622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '952',
internalId:  '',
customField: '20070815-220413'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '973',
internalId:  '',
customField: '20070815-220514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26812',
internalId:  '',
customField: '20070815-222417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21712',
internalId:  '',
customField: '20090130-211407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1036',
internalId:  '',
customField: '20070916-160138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '994',
internalId:  '',
customField: '20070630-135347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23612',
internalId:  '',
customField: '20070916-150624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1057',
internalId:  '',
customField: '20100422-065302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1078',
internalId:  '',
customField: '20070618-224030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1099',
internalId:  '',
customField: '20070630-102351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1120',
internalId:  '',
customField: '20070916-144853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7701',
internalId:  '',
customField: '20070815-221122'
};
var canonHostname = 'wscwrk02.ehost-services.com';
var accountId     = 'AEN010IN3XIJ';
var companyName   = '';
var htmlTitle	  = 'Bohemia+Bakery+Wedding+Cakes';
var metaKeywords  = 'wedding%2Cweddings%2Cwedding+cake%2Cwedding+cakes%2C+wedding+cakes+kamloops%2C+kamloops+weddings+cakes%2C+wedding+cup+cakes%2C+cup+cakes%2C+bakery%2C+bakeries%2C+wedding+cake+bakery%2C+kamloops+bakery%2C+kamloops%2C+kamloops+bakeries%2C+bakeries+kamloops%2C+pstry+shops+kamloops%2C+kamloops+pastry+shops%2C+kamloops+cup+cakes%2C+cup+cakes+kamloops';
var metaContents  = 'Creating+and+designing+wedding+cakes+from+modern+to+traditional%2C+I+Marie+Bijok+a+Professional+European+Pastry+Chef+of+25+years+and+owner+of+Bohemia+Bakery+can+create+a+unique+wedding+cake+you+have+always+dreamed+of%2C+from+an+elegant+rolled+fondant+masterpiece+to+a+Butter+Cream+tower+Bohemia+Bakery+is+The+Wedding+Cake+Specialist.';
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();
};
