/* [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','2801',jdecode('Home'),jdecode(''),'/2801.html','true',[],''],
	['PAGE','32101',jdecode('Gifts+and+Souvenirs'),jdecode(''),'/32101.html','true',[],''],
	['PAGE','2852',jdecode('Home+Decor'),jdecode(''),'/2852.html','true',[],''],
	['PAGE','2873',jdecode('Collectibles'),jdecode(''),'/2873.html','true',[],''],
	['PAGE','2894',jdecode('Retro+Room'),jdecode(''),'/2894.html','true',[],''],
	['PAGE','2936',jdecode('Classic+Toys'),jdecode(''),'/2936.html','true',[],''],
	['PAGE','2915',jdecode('Tin+Signs'),jdecode(''),'/2915.html','true',[],''],
	['PAGE','2957',jdecode('Links'),jdecode(''),'/2957.html','true',[],''],
	['PAGE','2978',jdecode('Contact+Us%2FDirections'),jdecode(''),'/2978.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Plainly';
theSitetree.paletteFamily='ABC600';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='32125';
theSitetree.graphicsetId='13925';
theSitetree.contentColor='6e6e6d';
theSitetree.contentBGColor='fbfae8';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Plainly',
				paletteFamily: 	'ABC600',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'32125',
				graphicsetId: 	'13925',
				contentColor: 	'6e6e6d',
				contentBGColor: 'fbfae8',
				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: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2801',
internalId:  '',
customField: '20100521-113022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2852',
internalId:  '',
customField: '20100322-141921'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2894',
internalId:  '',
customField: '20100322-142234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2873',
internalId:  '',
customField: '20100325-104950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2915',
internalId:  '',
customField: '20100322-142416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2978',
internalId:  '',
customField: '20100511-171617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2957',
internalId:  '',
customField: '20100326-173444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2936',
internalId:  '',
customField: '20100322-145055'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32101',
internalId:  '',
customField: '20100511-175101'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INEO70';
var companyName   = 'Pine+Country+Antiques+Pine+-+Strawberry%2C+Arizona';
var htmlTitle	  = 'Pine+Country+Antiques+Gifts+Souvenirs+Shop+Strawberry+Payson+Mogollon+Rim+Arizona+';
var metaKeywords  = 'pine%2C+pine+antiques%2C+pine+arizona%2C+pine+arizona+antiques%2C+arizona+antiques%2C+strawberry%2C+strawberry+arizona+antiques%2C+pine+az+penny+candy%2C+Payson+AZ+Antiques%2C+Pine+AZ+Antiques%2C+Strawberry+AZ+Antiques%2C+Payson+arizona+antiques%2C+Mogollon+Rim%2C+mogollon+rim+antiques%2C+Pine+Arizona%2C+strawberry+arizona%2C+payson+arizona%2C+starr+valley+arizona%2C+Pine+az+antique+furniture%2C+Arizona+antiques%2C+sun+purple+glass%2C+85544%2C+pine+az+custom+picture+framing%2C+strawberry+az+souvenirs%2C+payson+antiques%2C+john+wayne%2C+pine-strawberry%2C+pine+az+retail%2C+pine+arizona+retail%2C+pine+az+shops%2C+pine+az+vintage%2C+strawberry+az+vintage%2C+payson+az+collectibles%2C+strawberry+az+businesses%2C+payson+az+businesses%2C+pine+az+antique+stores%2C+payson+az+antique+stores%2C+strawberry+az+antiques+stores%2C+pine+az+recreation%2C+payson+az+recreation%2C+strawberry+az+recreation%2C+pine+az+shopping%2C+payson+az+shopping%2C+strawberry+az+shopping%2C+pine+az+moose+mountain%2C+pine+az+tymeless+antiques%2C+rim+country+antiques%2C+rim+country%2C+rim+country+furniture%2C+best+Arizona+antiques%2C+john+wayne+collectibles%2C+nostalgia%2C+Gila+County+Antiques%2C+northern+arizona%2C+Hwy+87%2C+Highway+87%2C+Payson+Arizona%2C+Kohls+Ranch%2C+Kohls+Ranch%2C+Tonto+National+Forest%2C+Tonto+Natural+Bridge';
var metaContents  = 'Pine+Strawberry+Payson+Arizona+Antiques+Gifts+Shops+Collectibles+Souvenirs+T-shirts';
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();
};
