/* [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','32',jdecode('home'),jdecode(''),'/32.html','false',[],''],
	['PAGE','3207',jdecode('about'),jdecode(''),'/3207.html','true',[],''],
	['PAGE','3252',jdecode('new'),jdecode(''),'/3252.html','false',[],''],
	['PAGE','15707',jdecode('gallery'),jdecode(''),'/15707/index.html','true',[ 
		['PAGE','15774',jdecode('holiday'),jdecode(''),'/15707/15774.html','true',[],''],
		['PAGE','15783',jdecode('invites'),jdecode(''),'/15707/15783.html','true',[],''],
		['PAGE','15792',jdecode('announcing'),jdecode(''),'/15707/15792.html','false',[],''],
		['PAGE','26701',jdecode('photos'),jdecode(''),'/15707/26701.html','false',[],''],
		['PAGE','29801',jdecode('commercial'),jdecode(''),'/15707/29801.html','false',[],'']
	],''],
	['PAGE','33501',jdecode('press'),jdecode(''),'/33501.html','false',[],''],
	['PAGE','36237',jdecode('photograhy'),jdecode(''),'/36237.html','true',[],''],
	['PAGE','14803',jdecode('blog'),jdecode(''),'/14803.html','true',[],''],
	['PAGE','12119',jdecode('events'),jdecode(''),'/12119.html','false',[],''],
	['PAGE','14113',jdecode('kudos'),jdecode(''),'/14113.html','true',[],''],
	['PAGE','11449',jdecode('FAQ'),jdecode(''),'/11449.html','false',[],''],
	['PAGE','3270',jdecode('contact'),jdecode(''),'/3270.html','true',[],'']];
var siteelementCount=16;
theSitetree.topTemplateName='Fluent';
theSitetree.paletteFamily='4971AD';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10644';
theSitetree.graphicsetId='10523';
theSitetree.contentColor='757675';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Fluent',
				paletteFamily: 	'4971AD',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10644',
				graphicsetId: 	'10523',
				contentColor: 	'757675',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'A4A5A4',
				e_color: 		'4971AD',
				f_color: 		'26487C',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-c47b49ea4f005e986f97d638fce3d6fa']={
webappId:    '7060',
documentId:  '26701',
internalId:  'c47b49ea4f005e986f97d638fce3d6fa',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3252',
internalId:  '',
customField: '20091104-132744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15707',
internalId:  '',
customField: '20090828-141159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3207',
internalId:  '',
customField: '20100210-130506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32',
internalId:  '',
customField: '20100118-141354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15774',
internalId:  '',
customField: '20100210-131223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15783',
internalId:  '',
customField: '20100210-131603'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15792',
internalId:  '',
customField: '20090303-070921'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29801',
internalId:  '',
customField: '20090228-110527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26701',
internalId:  '',
customField: '20090304-054355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14803',
internalId:  '',
customField: '20100208-144006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12119',
internalId:  '',
customField: '20090908-104012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14113',
internalId:  '',
customField: '20090828-141307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11449',
internalId:  '',
customField: '20081113-094345'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3270',
internalId:  '',
customField: '20100208-144035'
};
webappMappings['7008']=webappMappings['7008-398']={
webappId:    '7008',
documentId:  '3270',
internalId:  '398',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3207',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33501',
internalId:  '',
customField: '20090828-141214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36237',
internalId:  '',
customField: '20100210-145649'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INXSTY';
var companyName   = '';
var htmlTitle	  = 'shawns+things';
var metaKeywords  = 'custom+cards%2C+holiday+cards%2C+custom+invitations%2C+notecards%2C+stationary%2Cgift+items';
var metaContents  = 'invitations%2C+hand+crafted+cards%2C+holiday+cards%2C+gift+items%2C+hancrafted+from+Wilton%2C+Wilton+Connecticut%2C+';
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();
};

