/* [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','3101',jdecode('Home'),jdecode(''),'/3101.html','true',[],''],
	['PAGE','28001',jdecode('Shops+Current+Meow'),jdecode(''),'/28001.html','true',[],''],
	['PAGE','3152',jdecode('Classes'),jdecode(''),'/3152/index.html','true',[ 
		['PAGE','8101',jdecode('Beginner+Quilt+Class'),jdecode(''),'/3152/8101.html','true',[],''],
		['PAGE','3173',jdecode('Quilt+Classes'),jdecode(''),'/3152/3173.html','true',[],''],
		['PAGE','3194',jdecode('Embroidery+Classes'),jdecode(''),'/3152/3194.html','true',[],''],
		['PAGE','3215',jdecode('Children%26%23x27%3Bs+Clothing+Classes'),jdecode(''),'/3152/3215.html','true',[],''],
		['PAGE','3236',jdecode('Clothing+Classes'),jdecode(''),'/3152/3236.html','true',[],''],
		['PAGE','11301',jdecode('On+Going+Classes'),jdecode(''),'/3152/11301.html','true',[],''],
		['PAGE','3257',jdecode('One+Day%2FOther+Classes'),jdecode(''),'/3152/3257.html','true',[],'']
	],''],
	['PAGE','49301',jdecode('Kits'),jdecode(''),'/49301.html','true',[],''],
	['PAGE','10701',jdecode('Bernina+Sewing+Mastery'),jdecode(''),'/10701.html','true',[],''],
	['PAGE','52601',jdecode('Software+Mastery'),jdecode(''),'/52601.html','true',[],''],
	['PAGE','5422',jdecode('My+Label+Club'),jdecode(''),'/5422.html','true',[],''],
	['PAGE','5443',jdecode('Embroidery%2FSoftware+Club'),jdecode(''),'/5443.html','true',[],''],
	['PAGE','47801',jdecode('Repairs+by+BOB'),jdecode(''),'/47801.html','true',[],''],
	['PAGE','10722',jdecode('Who+are+we%3F'),jdecode(''),'/10722.html','true',[],''],
	['PAGE','42901',jdecode('Driving+Directions'),jdecode(''),'/42901.html','true',[],'']];
var siteelementCount=18;
theSitetree.topTemplateName='Celebration';
theSitetree.paletteFamily='51C862';
theSitetree.keyvisualId='3807';
theSitetree.keyvisualName='kv_3807.jpg';
theSitetree.fontsetId='10478';
theSitetree.graphicsetId='10981';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Celebration',
				paletteFamily: 	'51C862',
				keyvisualId: 	'3807',
				keyvisualName: 	'kv_3807.jpg',
				fontsetId: 		'10478',
				graphicsetId: 	'10981',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'47B757',
				e_color: 		'FB454D',
				f_color: 		'4545FB',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5422',
internalId:  '',
customField: '20100614-145050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3101',
internalId:  '',
customField: '20100609-085547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3152',
internalId:  '',
customField: '20090914-160755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42901',
internalId:  '',
customField: '20090305-192338'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3173',
internalId:  '',
customField: '20100614-110538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3194',
internalId:  '',
customField: '20100614-110642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3215',
internalId:  '',
customField: '20100614-110911'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3236',
internalId:  '',
customField: '20100608-102802'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3257',
internalId:  '',
customField: '20100614-111128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28001',
internalId:  '',
customField: '20100702-081943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5443',
internalId:  '',
customField: '20100601-085655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10701',
internalId:  '',
customField: '20100608-110153'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8101',
internalId:  '',
customField: '20100608-105817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11301',
internalId:  '',
customField: '20100614-173122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10722',
internalId:  '',
customField: '20100208-151906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47801',
internalId:  '',
customField: '20100608-122050'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '42901',
internalId:  'routing',
customField: 'en_US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49301',
internalId:  '',
customField: '20100620-193739'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52601',
internalId:  '',
customField: '20100608-110937'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INE31H';
var companyName   = 'Klassy+Katz+Quilts';
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();
};
