/* [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','201',jdecode('Home'),jdecode(''),'/201.html','true',[],'',''],
	['PAGE','207',jdecode('About+us'),jdecode(''),'/207.html','true',[],'',''],
	['PAGE','18601',jdecode('Our+Toys'),jdecode(''),'/18601.html','true',[],'',''],
	['PAGE','217',jdecode('Pictures'),jdecode(''),'/217.html','true',[],'',''],
	['PAGE','222',jdecode('Contact+Us'),jdecode(''),'/222.html','true',[],'',''],
	['PAGE','1736',jdecode('Sign+Guestbook'),jdecode(''),'/1736.html','true',[],'',''],
	['PAGE','3070',jdecode('Links'),jdecode(''),'/3070.html','true',[],'',''],
	['PAGE','43001',jdecode('Our+Travels'),jdecode(''),'/43001.html','true',[],'',''],
	['PAGE','102389',jdecode('Hobbies'),jdecode(''),'/102389.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Postcards';
theSitetree.paletteFamily='4C82DA';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10490';
theSitetree.graphicsetId='11060';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='EDF3FB';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Postcards',
				paletteFamily: 	'4C82DA',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10490',
				graphicsetId: 	'11060',
				contentColor: 	'000000',
				contentBGColor: 'EDF3FB',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'4C82DA',
				e_color: 		'4C82DA',
				f_color: 		'4C82DA',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-1736aen010inxpvj']={
webappId:    '1002',
documentId:  '1736',
internalId:  '1736aen010inxpvj',
customField: 'icq=false'
};
webappMappings['1501']=webappMappings['1501-1152128']={
webappId:    '1501',
documentId:  '201',
internalId:  '1152128',
customField: '1501'
};
webappMappings['7060']=webappMappings['7060-e328a3438868426b51b5d4f0759bed64']={
webappId:    '7060',
documentId:  '43001',
internalId:  'e328a3438868426b51b5d4f0759bed64',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '201',
internalId:  '',
customField: '20060428-081507'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3070',
internalId:  '',
customField: '20101031-114756'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '207',
internalId:  '',
customField: '20101031-114910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18601',
internalId:  '',
customField: '20100920-113926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '217',
internalId:  '',
customField: '20071231-090934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '222',
internalId:  '',
customField: '20060302-073937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1736',
internalId:  '',
customField: '20050819-120536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43001',
internalId:  '',
customField: '20080623-212801'
};
webappMappings['1002']=webappMappings['1002-1736aen010']={
webappId:    '1002',
documentId:  '1736',
internalId:  '1736aen010',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102389',
internalId:  '',
customField: '20101031-113634'
};
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN010INXPVJ';
var companyName   = 'Don+and+DeAnna+Schaffer';
var htmlTitle	  = 'Don+and+DeAnna+Schaffer';
var metaKeywords  = 'student%2C+ambassador%2C+people%2C+travel%2C+education%2C+schaffer%2C+usmc%2C+marines%2C+arvada%2C+colorado%2C+ranum%2C+santistevan%2C+military%2C+corps%2C+gilpin%2C+russell%2C+gulch%2C+people%2C+stella%2C+genuine%2Cnsw-b7vmcml71myvm9rgrna5g5ga0snke0m5s04usgh7lzg2oqrifoq3321wscgom0fzypqhqkjzhzsdmj5onpj98-gk9ecqcetzbli6g01yba0b2h7vw839jv98rqxue9mj';
var metaContents  = 'student%2C+ambassador%2C+honda%2C+motor%2C+scooter%2C+triumph%2C+spitfire%2C+schaffer%2C+people%2C+stella%2C+genuine';
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();
};

