/* [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','42',jdecode('Home'),jdecode(''),'/42.html','true',[],''],
	['PAGE','31101',jdecode('Oct+9th+Fundraiser'),jdecode(''),'/31101.html','false',[],''],
	['PAGE','63',jdecode('About+Us'),jdecode(''),'/63.html','true',[],''],
	['PAGE','126',jdecode('Our+Team'),jdecode(''),'/126.html','true',[],''],
	['PAGE','1526',jdecode('Photo+Album'),jdecode(''),'/1526.html','true',[],''],
	['PAGE','162',jdecode('Awareness+Fundraisers'),jdecode(''),'/162.html','true',[],''],
	['PAGE','25501',jdecode('KBK+Special+Offer'),jdecode(''),'/25501.html','true',[],''],
	['PAGE','81',jdecode('Online+Shop'),jdecode(''),'/81.html','true',[],''],
	['PAGE','2086',jdecode('Guestbook'),jdecode(''),'/2086/index.html','true',[ 
		['PAGE','2085',jdecode('Read+Guestbook'),jdecode(''),'/2086/2085.html','false',[],'']
	],''],
	['PAGE','2104',jdecode('Directions'),jdecode(''),'/2104.html','true',[],''],
	['PAGE','28701',jdecode('Benefits+of+Gemstones'),jdecode(''),'/28701.html','true',[],''],
	['PAGE','21801',jdecode('Interesting+links'),jdecode(''),'/21801.html','true',[],'']];
var siteelementCount=13;
theSitetree.topTemplateName='Curve';
theSitetree.paletteFamily='E77070';
theSitetree.keyvisualId='5771';
theSitetree.keyvisualName='kv_5771.jpg';
theSitetree.fontsetId='11089';
theSitetree.graphicsetId='11860';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FF9A9A';
var theTemplate={
				name: 			'Curve',
				paletteFamily: 	'E77070',
				keyvisualId: 	'5771',
				keyvisualName: 	'kv_5771.jpg',
				fontsetId: 		'11089',
				graphicsetId: 	'11860',
				contentColor: 	'000000',
				contentBGColor: 'FF9A9A',
				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:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '42',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-2202291']={
webappId:    '1501',
documentId:  '42',
internalId:  '2202291',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42',
internalId:  '',
customField: '20090919-161729'
};
webappMappings['1002']=webappMappings['1002-2086AHW050IN3L8A']={
webappId:    '1002',
documentId:  '2086',
internalId:  '2086AHW050IN3L8A',
customField: 'icq=false'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '2104',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['7060']=webappMappings['7060-f15c27ddbc9cc1c75d89e5b64ca9ed88']={
webappId:    '7060',
documentId:  '1526',
internalId:  'f15c27ddbc9cc1c75d89e5b64ca9ed88',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63',
internalId:  '',
customField: '20091124-111548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '126',
internalId:  '',
customField: '20091230-104032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1526',
internalId:  '',
customField: '20080203-020742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81',
internalId:  '',
customField: '20090919-161320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '162',
internalId:  '',
customField: '20090318-072123'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2086',
internalId:  '',
customField: '20080313-165447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2085',
internalId:  '',
customField: '20080313-165447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2104',
internalId:  '',
customField: '20080313-170741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21801',
internalId:  '',
customField: '20090220-133951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25501',
internalId:  '',
customField: '20090905-090837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28701',
internalId:  '',
customField: '20090325-101602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31101',
internalId:  '',
customField: '20090905-095515'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050IN3L8A';
var companyName   = 'KBK+Designs';
var htmlTitle	  = 'KBK+Designs';
var metaKeywords  = 'cancer+awareness+jewelry%2C+breast+cancer+jewelry%2C+ovarian+cancer+jewelry%2C+american+cancer+society%2C+policewomens+endowment+association%2C+buddy+walk%2C+autism+awareness+jewelry%2C+downs+syndrome+awareness+jewelry%2C+support+connection+jewelry%2C+hospice+care+of+westchester%2Fputnam%2C+making+strides+against+breast+cancer%2C+pink+ribbon+jewelry%2C+purple+ribbon+jewelry%2C+autism+puzzle+jewelry%2C+phyllis+karlin%2C+ron+karlin%2C+debbie+castriota%2C+sue+kelleher%2C+aimee+freundlich%2C+paula+kolias%2C+michele+mason%2C+handmade+jewelry%2C+awareness+jewelry%2C+watches%2C+wrist+watches%2C+meta+name%3Dverify-v1+content%3DkGAs1BAWnPWwx3leivChVpww154GtzgsM%2Fd%2BamnJB5U%3D+%2F';
var metaContents  = 'The+little+jewelry+shop+that+gives+back%21';
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();
};
