/* [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','3241',jdecode('SHOP'),jdecode(''),'/3241.html','true',[],'',''],
	['PAGE','3094',jdecode('Products%2FServices'),jdecode(''),'/3094/index.html','true',[ 
		['PAGE','3115',jdecode('Custom+Design+Work'),jdecode(''),'/3094/3115.html','true',[],'',''],
		['PAGE','3136',jdecode('Jewelry+Making+Supplies'),jdecode(''),'/3094/3136.html','true',[],'',''],
		['PAGE','41201',jdecode('Rocks+in+our+head'),jdecode(''),'/3094/41201.html','true',[],'','']
	],'',''],
	['PAGE','3178',jdecode('Contact%2FHours'),jdecode(''),'/3178/index.html','true',[ 
		['PAGE','7201',jdecode('About+us'),jdecode(''),'/3178/7201.html','true',[],'','']
	],'',''],
	['PAGE','30701',jdecode('Beadwave+Twitter'),jdecode(''),'/30701.html','true',[],'',''],
	['PAGE','54301',jdecode('BEADWAVE+HAS+MOVED%21'),jdecode(''),'/54301/index.html','true',[ 
		['PAGE','56512',jdecode('WESTWARD+BOUND'),jdecode(''),'/54301/56512.html','true',[],'','']
	],'',''],
	['PAGE','58112',jdecode('AZ+Mining'),jdecode(''),'/58112.html','true',[],'',''],
	['PAGE','58812',jdecode('FUN+STUFF'),jdecode(''),'/58812/index.html','true',[ 
		['PAGE','29501',jdecode('Bead+%26+Button+Show+%26%23x27%3B09'),jdecode(''),'/58812/29501.html','true',[],'',''],
		['PAGE','46801',jdecode('FEB.+2010+MINING'),jdecode(''),'/58812/46801.html','true',[],'',''],
		['PAGE','50601',jdecode('NEW+MEXICO+2010'),jdecode(''),'/58812/50601.html','true',[],'','']
	],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Angkor';
theSitetree.paletteFamily='879ED6';
theSitetree.keyvisualId='6884';
theSitetree.keyvisualName='kv_6884.jpg';
theSitetree.fontsetId='11211';
theSitetree.graphicsetId='12030';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='94AAE1';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Angkor',
				paletteFamily: 	'879ED6',
				keyvisualId: 	'6884',
				keyvisualName: 	'kv_6884.jpg',
				fontsetId: 		'11211',
				graphicsetId: 	'12030',
				contentColor: 	'FFFFFF',
				contentBGColor: '94AAE1',
				a_color: 		'94AAE1',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3178',
internalId:  '',
customField: '20100707-072542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3094',
internalId:  '',
customField: '20100707-073122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3115',
internalId:  '',
customField: '20100601-190908'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3136',
internalId:  '',
customField: '20100707-073200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54301',
internalId:  '',
customField: '20100707-072254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58812',
internalId:  '',
customField: '20100728-223310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56512',
internalId:  '',
customField: '20100711-102748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58112',
internalId:  '',
customField: '20100728-222523'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3241',
internalId:  '',
customField: '20100707-073017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7201',
internalId:  '',
customField: '20090630-194337'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50601',
internalId:  '',
customField: '20100408-084345'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46801',
internalId:  '',
customField: '20100210-080105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30701',
internalId:  '',
customField: '20090607-220513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29501',
internalId:  '',
customField: '20090607-094604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41201',
internalId:  '',
customField: '20100707-073251'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INX2P8';
var companyName   = '';
var htmlTitle	  = 'Beadwave+Jewelry+-+Artisan+Jewelry%2C+Rare+Stones%2C+Supplies%2C+Classes+and+Parties';
var metaKeywords  = 'bead%2C+beadwave%2C+jewelry%2C+westport%2C+bead%2C+parties%2C+kid%2C+parties%2C+artisan%2C+jewelry%2C+beads%2C+high%2C+karat%2C+gold%2C+diamond%2C+beads%2C+rare%2C+stones%2C+supplies%2C+Beadalon%2C+crimps%2C+scrimps%2C+beading+wire%2C+findings%2C+clasps%2C+22k+gold%2C+18k+gold%2C+20k+gold%2C+sterling+silver%2C+organic+diamonds%2C+organic+stones%2C+watermelon+tourmaline%2C+gold%2C+silver%2C+copper%2C+ruby%2C+sapphire%2C+aquamarine%2C+kabana%2C+andrea+levine+jewelry%2C+pet+jewelry%2C+cat%2C+dog%2C+horse%2C+geodes%2C+crystals%2C+crystal%2C+geode%2C+drusy%2C+pendants%2C+jade%2C+stretch+magic%2C+wire%2C+dichroic+glass%2C+swarovski%2C+tools%2C+pliers%2C+lindstrom%2C+eyeglass+holders%2C+rock+crystal%2C+garnet%2C+peridot%2C+topaz%2C+opal%2C+boulder+opal%2C+connecticut%2C+ct+CRYSTALLIZED%EF%BF%BD%EF%BF%BD%EF%BF%BD+-+SWAROVSKI+ELEMENTS%2C+watermelon+tourmaline%2C+ocean+jasper%2C+workshops%2C+bead+classes';
var metaContents  = 'Beadwave+Jewelry+and+Supplies+in+Westport+offers+artisan+jewelry%2C+custom+fine+jewelry%2C+bead+supplies%2C+rare+beads%2C+CRYSTALLIZED%EF%BF%BD%EF%BF%BD%EF%BF%BD+-+SWAROVSKI+ELEMENTS%2C+diamond+beads%2C+high+karat+gold+findings%2C+unique+sterling+silver+clasps+and+spacer+beads%2C+handcrafted+gifts%2C+beading+classes+and+parties+for+kids+and+jewelry+lovers+of+all+ages.++';
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();
};
