/* [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','401',jdecode('About+Us'),jdecode(''),'/401.html','true',[],''],
	['PAGE','452',jdecode('What+YOU+can+do'),jdecode(''),'/452.html','true',[],''],
	['PAGE','22401',jdecode('Daily+Specials'),jdecode(''),'/22401.html','true',[],''],
	['PAGE','66712',jdecode('Holiday+Party+Packages'),jdecode(''),'/66712.html','true',[],''],
	['PAGE','494',jdecode('Kids+BD+Parties'),jdecode(''),'/494.html','true',[],''],
	['PAGE','40901',jdecode('Tween+to+Adult+Parties'),jdecode(''),'/40901.html','true',[],''],
	['PAGE','30101',jdecode('Storytime'),jdecode(''),'/30101.html','true',[],''],
	['PAGE','557',jdecode('Kids+Art+Time'),jdecode(''),'/557.html','true',[],''],
	['PAGE','70612',jdecode('Field+Trips'),jdecode(''),'/70612.html','true',[],''],
	['PAGE','60012',jdecode('Clay+Days'),jdecode(''),'/60012.html','true',[],''],
	['PAGE','515',jdecode('Fused+Glass'),jdecode(''),'/515.html','true',[],''],
	['PAGE','23201',jdecode('Workshops'),jdecode(''),'/23201.html','true',[],''],
	['PAGE','60112',jdecode('Custom+orders'),jdecode(''),'/60112.html','true',[],''],
	['PAGE','578',jdecode('Hours+%26+Directions'),jdecode(''),'/578.html','true',[],''],
	['PAGE','536',jdecode('Gallery'),jdecode(''),'/536.html','true',[],''],
	['PAGE','29001',jdecode('Customer+Gallery'),jdecode(''),'/29001.html','true',[],'']];
var siteelementCount=16;
theSitetree.topTemplateName='Caribic';
theSitetree.paletteFamily='1F7E8F';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10579';
theSitetree.graphicsetId='10712';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='B63636';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Caribic',
				paletteFamily: 	'1F7E8F',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10579',
				graphicsetId: 	'10712',
				contentColor: 	'FFFFFF',
				contentBGColor: 'B63636',
				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:  '401',
internalId:  '',
customField: '20091007-233624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20090618-125810'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20090928-113403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20091109-135711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20091109-140759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '557',
internalId:  '',
customField: '20091022-160447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '578',
internalId:  '',
customField: '20090828-151103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22401',
internalId:  '',
customField: '20091117-161523'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23201',
internalId:  '',
customField: '20091109-135949'
};
webappMappings['7060']=webappMappings['7060-05bab7c11ecadb696e19fdad95ccf9bc']={
webappId:    '7060',
documentId:  '29001',
internalId:  '05bab7c11ecadb696e19fdad95ccf9bc',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29001',
internalId:  '',
customField: '20080802-180151'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30101',
internalId:  '',
customField: '20091117-163646'
};
webappMappings['1501']=webappMappings['1501-12403223']={
webappId:    '1501',
documentId:  '401',
internalId:  '12403223',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40901',
internalId:  '',
customField: '20090518-222804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70612',
internalId:  '',
customField: '20091109-143154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60012',
internalId:  '',
customField: '20091029-181145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60112',
internalId:  '',
customField: '20091022-163241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66712',
internalId:  '',
customField: '20091030-163955'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INXLML';
var companyName   = 'Welcome+to+Ceramic+Lodge%21';
var htmlTitle	  = '';
var metaKeywords  = '';
var metaContents  = '';
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();
};
