/* [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','79129',jdecode('Home'),jdecode(''),'/79129.html','true',[],'',''],
	['PAGE','80829',jdecode('Wedding+Cupcakes'),jdecode(''),'/80829.html','true',[],'',''],
	['PAGE','85289',jdecode('Wedding+3%2B+Tiers'),jdecode(''),'/85289.html','true',[],'',''],
	['PAGE','84889',jdecode('Wedding+2+Tier'),jdecode(''),'/84889.html','true',[],'',''],
	['PAGE','84689',jdecode('Wedding+1+Tier'),jdecode(''),'/84689.html','true',[],'',''],
	['PAGE','30199',jdecode('Party+Cakes'),jdecode(''),'/30199.html','true',[],'',''],
	['PAGE','673',jdecode('Novelty+cakes+'),jdecode(''),'/673.html','true',[],'',''],
	['PAGE','30220',jdecode('Various+Cakes'),jdecode(''),'/30220.html','true',[],'',''],
	['PAGE','79429',jdecode('Cake+Decorating+Classes'),jdecode(''),'/79429.html','true',[],'',''],
	['PAGE','55067',jdecode('Shop+Tour'),jdecode(''),'/55067.html','true',[],'',''],
	['PAGE','79471',jdecode('Guestbook'),jdecode(''),'/79471.html','true',[],'',''],
	['PAGE','652',jdecode('Contact%2C+map'),jdecode(''),'/652.html','true',[],'',''],
	['PAGE','95759',jdecode('Shop+Online'),jdecode(''),'/95759.html','true',[],'',''],
	['PAGE','79950',jdecode('Freinds+and+Links'),jdecode(''),'/79950.html','true',[],'',''],
	['PAGE','95359',jdecode('Email'),jdecode(''),'/95359.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Mondrian';
theSitetree.paletteFamily='7281CC';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10460';
theSitetree.graphicsetId='10887';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3E51B5';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Mondrian',
				paletteFamily: 	'7281CC',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10460',
				graphicsetId: 	'10887',
				contentColor: 	'FFFFFF',
				contentBGColor: '3E51B5',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'D3D3D3',
				e_color: 		'D3D3D3',
				f_color: 		'D3D3D3',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '79129',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '652',
internalId:  '',
customField: '20100216-033621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '673',
internalId:  '',
customField: '20100216-032228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30199',
internalId:  '',
customField: '20100216-032228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30220',
internalId:  '',
customField: '20100216-032228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55067',
internalId:  '',
customField: '20100216-032228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79129',
internalId:  '',
customField: '20100116-212947'
};
webappMappings['4001']=webappMappings['4001-24043468']={
webappId:    '4001',
documentId:  '95759',
internalId:  '24043468',
customField: 'language:en;country:US;'
};
webappMappings['1002']=webappMappings['1002-79471aen010inz1yx']={
webappId:    '1002',
documentId:  '79471',
internalId:  '79471aen010inz1yx',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79429',
internalId:  '',
customField: '20100309-022938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95359',
internalId:  '',
customField: '20100310-021740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79471',
internalId:  '',
customField: '20100118-023353'
};
webappMappings['1501']=webappMappings['1501-23439058']={
webappId:    '1501',
documentId:  '79129',
internalId:  '23439058',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95759',
internalId:  '',
customField: '20100310-030554'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79950',
internalId:  '',
customField: '20100216-033508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80829',
internalId:  '',
customField: '20100215-034608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84689',
internalId:  '',
customField: '20100216-025236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84889',
internalId:  '',
customField: '20100216-032115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85289',
internalId:  '',
customField: '20100216-031114'
};
var canonHostname = 'wscwrk02.ehost-services.com';
var accountId     = 'AEN010INZ1YX';
var companyName   = 'The+Cake+Gallery';
var htmlTitle	  = 'Wedding+Cakes+Perth++Rockingham+Mandurah+6168+WA';
var metaKeywords  = 'Wedding+Cakes+Rockingham+Mandurah+WA+Weddings+Rockingham+Mandurah+WA+novelty+cakes+Rockingham+Mandurah+WA+Cakes+Rockingham+Rockingham+Mandurah+Perth+WA+Decorating+supplies+Cakes+Rockingham+Mandurah+Perth+WA+novelty+cakes+Rockingham+Mandurah+Perth+WA+Cake+Decorating+Classes+Rockingham+Mandurah+Perth+WA+Cake+Toppers+Rockingham+Mandurah+Perth+WA+Photograph+Cakes+Rockingham+Mandurah+Perth+WA+Cup+Cakes+Rockingham+Mandurah+Perth+WA+Birthday+Cakes+Rockingham+Mandurah+Perth+WA+Christening+Cakes+Rockingham+Mandurah+Perth+WA+cake+decorating+equipment+Rockingham+cake+decorating+equipment+WA+cake+decorating+equipment+Mandurah%2C+cake+decorating+equipment+Perth';
var metaContents  = 'Wedding+Cakes+Rockingham+Mandurah+WA+Weddings+Rockingham+Mandurah+WA+novelty+cakes+Rockingham+Mandurah+WA+Cakes+Rockingham+Rockingham+Mandurah+Perth+WA+Decorating+supplies+Cakes+Rockingham+Mandurah+Perth+WA+novelty+cakes+Rockingham+Mandurah+Perth+WA+Cake+Decorating+Classes+Rockingham+Mandurah+Perth+WA+Cake+Toppers+Rockingham+Mandurah+Perth+WA+Photograph+Cakes+Rockingham+Mandurah+Perth+WA+Cup+Cakes+Rockingham+Mandurah+Perth+WA+Birthday+Cakes+Rockingham+Mandurah+Perth+WA+Christening+Cakes+Rockingham+Mandurah+Perth+WA+cake+decorating+equipment+Rockingham+cake+decorating+equipment+WA+cake+decorating+equipment+Mandurah%2C+cake+decorating+equipment+Perth';
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();
};
