/* [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','124789',jdecode('Wedding+Cakes'),jdecode(''),'/124789/index.html','true',[ 
		['PAGE','80829',jdecode('Wedding+Cupcakes'),jdecode(''),'/124789/80829.html','true',[],'',''],
		['PAGE','85289',jdecode('Wedding+3%2B+Tiers'),jdecode(''),'/124789/85289.html','true',[],'',''],
		['PAGE','84889',jdecode('Wedding+2+Tier'),jdecode(''),'/124789/84889.html','true',[],'',''],
		['PAGE','84689',jdecode('Wedding+1+Tier'),jdecode(''),'/124789/84689.html','true',[],'',''],
		['PAGE','113889',jdecode('Engagement'),jdecode(''),'/124789/113889.html','true',[],'',''],
		['PAGE','101889',jdecode('Cake+Toppers'),jdecode(''),'/124789/101889.html','true',[],'','']
	],'',''],
	['PAGE','124810',jdecode('Cakes'),jdecode(''),'/124810/index.html','true',[ 
		['PAGE','113089',jdecode('Cup+Cakes'),jdecode(''),'/124810/113089.html','true',[],'',''],
		['PAGE','673',jdecode('Novelty+cakes+'),jdecode(''),'/124810/673.html','true',[],'',''],
		['PAGE','118689',jdecode('Buttercream+Cakes'),jdecode(''),'/124810/118689.html','true',[],'',''],
		['PAGE','30199',jdecode('Party+Cakes'),jdecode(''),'/124810/30199.html','true',[],'',''],
		['PAGE','100489',jdecode('Number+shape+cakes'),jdecode(''),'/124810/100489.html','true',[],'',''],
		['PAGE','100989',jdecode('Baby+Cakes'),jdecode(''),'/124810/100989.html','true',[],'',''],
		['PAGE','100510',jdecode('Religious%2C+Baptism+etc'),jdecode(''),'/124810/100510.html','true',[],'',''],
		['PAGE','101010',jdecode('Picture+Cakes'),jdecode(''),'/124810/101010.html','true',[],'',''],
		['PAGE','30220',jdecode('Various+Cakes'),jdecode(''),'/124810/30220.html','true',[],'','']
	],'',''],
	['PAGE','79429',jdecode('Cake+Decorating+Classes'),jdecode(''),'/79429.html','true',[],'',''],
	['PAGE','124831',jdecode('Cake+Decorating+Supplies'),jdecode(''),'/124831.html','true',[],'',''],
	['PAGE','124852',jdecode('Info'),jdecode(''),'/124852/index.html','true',[ 
		['PAGE','55067',jdecode('Shop+Tour'),jdecode(''),'/124852/55067.html','true',[],'',''],
		['PAGE','652',jdecode('Contact%2C+map'),jdecode(''),'/124852/652.html','true',[],'',''],
		['PAGE','79950',jdecode('Friends+and+Links'),jdecode(''),'/124852/79950.html','true',[],'',''],
		['PAGE','79471',jdecode('Guestbook'),jdecode(''),'/124852/79471.html','true',[],'',''],
		['PAGE','95359',jdecode('Email'),jdecode(''),'/124852/95359.html','true',[],'','']
	],'','']];
var siteelementCount=26;
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:  '113889',
internalId:  '',
customField: '20100704-021616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '652',
internalId:  '',
customField: '20100622-225440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '673',
internalId:  '',
customField: '20100724-232103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30199',
internalId:  '',
customField: '20100704-022605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30220',
internalId:  '',
customField: '20100325-020354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55067',
internalId:  '',
customField: '20100324-221840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79129',
internalId:  '',
customField: '20100726-045109'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '118689',
internalId:  '',
customField: '20100724-233136'
};
webappMappings['1002']=webappMappings['1002-79471aen010inz1yx']={
webappId:    '1002',
documentId:  '79471',
internalId:  '79471aen010inz1yx',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79429',
internalId:  '',
customField: '20100724-220036'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95359',
internalId:  '',
customField: '20100310-023805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79471',
internalId:  '',
customField: '20100118-023353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100489',
internalId:  '',
customField: '20100622-202529'
};
webappMappings['1501']=webappMappings['1501-23439058']={
webappId:    '1501',
documentId:  '79129',
internalId:  '23439058',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '113089',
internalId:  '',
customField: '20100724-232818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79950',
internalId:  '',
customField: '20100726-045331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80829',
internalId:  '',
customField: '20100622-200824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84689',
internalId:  '',
customField: '20100622-210647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84889',
internalId:  '',
customField: '20100724-232957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85289',
internalId:  '',
customField: '20100724-232252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100510',
internalId:  '',
customField: '20100724-232355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101010',
internalId:  '',
customField: '20100724-232548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100989',
internalId:  '',
customField: '20100516-195045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101889',
internalId:  '',
customField: '20100704-020730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '124810',
internalId:  '',
customField: '20100727-035346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '124789',
internalId:  '',
customField: '20100727-035346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '124852',
internalId:  '',
customField: '20100727-035346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '124831',
internalId:  '',
customField: '20100727-035346'
};
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%2C+Cake+Tins+to+buy+or+hire';
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.+Cake+Tins+to+buy+or+hire';
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();
};
