/* [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','42',jdecode('Home'),jdecode(''), jdecode('%2F42.html'), 'true',[],'',''],
	['PAGE','57823',jdecode('Anniversary+Raffle'),jdecode(''), jdecode('%2F57823.html'), 'false',[],'',''],
	['PAGE','38201',jdecode('Thanksgiving+Hours'),jdecode(''), jdecode('%2F38201.html'), 'false',[],'',''],
	['PAGE','58523',jdecode('New+Year%26%23x27%3Bs+Eve+Hours'),jdecode(''), jdecode('%2F58523.html'), 'false',[],'',''],
	['PAGE','41412',jdecode('Summer+Hours'),jdecode(''), jdecode('%2F41412.html'), 'false',[],'',''],
	['PAGE','57223',jdecode('Yom+Kippur+Hours'),jdecode(''), jdecode('%2F57223.html'), 'false',[],'',''],
	['PAGE','63',jdecode('About+Us'),jdecode(''), jdecode('%2F63.html'), 'true',[],'',''],
	['PAGE','126',jdecode('Our+Team'),jdecode(''), jdecode('%2F126.html'), 'true',[],'',''],
	['PAGE','1526',jdecode('Photo+Album'),jdecode(''), jdecode('%2F1526.html'), 'true',[],'',''],
	['PAGE','37401',jdecode('Special+Offer%21'),jdecode(''), jdecode('%2F37401.html'), 'false',[],'',''],
	['PAGE','162',jdecode('Awareness+Fundraisers'),jdecode(''), jdecode('%2F162.html'), 'true',[],'',''],
	['PAGE','25501',jdecode('KBK+Special+Offer'),jdecode(''), jdecode('%2F25501.html'), 'false',[],'',''],
	['PAGE','81',jdecode('Online+Shop'),jdecode(''), jdecode('%2F81.html'), 'true',[],'',''],
	['PAGE','2086',jdecode('Guestbook'),jdecode(''), jdecode('%2F2086%2Findex.html'), 'true',[ 
		['PAGE','2085',jdecode('Read+Guestbook'),jdecode(''), jdecode('%2F2086%2F2085.html'), 'false',[],'','']
	],'',''],
	['PAGE','2104',jdecode('Directions+%26+Store+Hours'),jdecode(''), jdecode('%2F2104.html'), 'true',[],'',''],
	['PAGE','28701',jdecode('Benefits+of+Gemstones'),jdecode(''), jdecode('%2F28701.html'), 'true',[],'',''],
	['PAGE','21801',jdecode('Interesting+links'),jdecode(''), jdecode('%2F21801.html'), 'false',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Disco';
theSitetree.paletteFamily='62213C';
theSitetree.keyvisualId='4618';
theSitetree.keyvisualName='juweliere.jpg';
theSitetree.fontsetId='310';
theSitetree.graphicsetId='366';
theSitetree.contentColor='DDDDDD';
theSitetree.contentBGColor='62213C';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'optimum',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Disco',
				paletteFamily: 	'62213C',
				keyvisualId: 	'4618',
				keyvisualName: 	'juweliere.jpg',
				fontsetId: 		'310',
				graphicsetId: 	'366',
				contentColor: 	'DDDDDD',
				contentBGColor: '62213C',
				a_color: 		'62213C',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '42',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57823',
internalId:  '',
customField: '20111029-102102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42',
internalId:  '',
customField: '20110920-193410'
};
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: '20110920-194422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '126',
internalId:  '',
customField: '20110903-145652'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1526',
internalId:  '',
customField: '20100327-151331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81',
internalId:  '',
customField: '20110920-193615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41412',
internalId:  '',
customField: '20110705-095719'
};
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: '20110920-211548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21801',
internalId:  '',
customField: '20090220-133951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25501',
internalId:  '',
customField: '20101021-111403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37401',
internalId:  '',
customField: '20101021-113801'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28701',
internalId:  '',
customField: '20090325-101602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38201',
internalId:  '',
customField: '20101231-155816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57223',
internalId:  '',
customField: '20111006-122735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58523',
internalId:  '',
customField: '20111228-132341'
};
webappMappings['1501']=webappMappings['1501-2202291']={
webappId:    '1501',
documentId:  '42',
internalId:  '2202291',
customField: '1501'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
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();
};

