/* [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','401',jdecode('Adorn'),jdecode(''), jdecode('%2F401.html'), 'true',[],'','']];
var siteelementCount=1;
theSitetree.topTemplateName='Clean';
theSitetree.paletteFamily='B6B156';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='33270';
theSitetree.graphicsetId='14152';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp19-dulles',
  product: 'WSCSYSSSSLYTCVNO'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Clean',
				paletteFamily: 	'B6B156',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'33270',
				graphicsetId: 	'14152',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'868B56',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20110516-094402'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INLC7Z';
var companyName   = '';
var htmlTitle	  = 'Adorn+Studios+%3A%3A+Art+%26+Jewelry';
var metaKeywords  = 'jewelry%2C+fused+glass%2C+glass%2C+silver%2C+earrings%2C+necklace%2C+ring%2C+cuff+links%2C+cufflinks%2C+bracelets%2C+leather%2C+stone%2C+wood%2C+shell%2C+chrysophase%2C+silver%2C+fused%2C+agate%2C+jasper%2C+cowrie%2C+leather%2C+snap%2C+snaps%2C+bracelet%2C+lapis%2C+moonstone%2C+onyx%2C+mens%2C+womens%2C+apparrel%2C+accessories%2C+wear%2C+adorn%2C+adornments%2C+custom%2C+one+of+a+kind%2C+onak%2C+studio%2C+torch%2C+metal%2C+copper%2C+brass%2C+moneyclip%2C+local%2C+wildhorse%2C+picture%2C+blue%2C+red%2C+pink%2C+yellow%2C+bronze%2C+brown%2C+black%2C+white%2C+purple%2C+orange%2C+green%2C+pink+lace%2C+druzy%2C+mother+of+pearl%2C+swirl%2C+comfortable%2C+comfort%2C+affordable%2C+wholesale%2C+trade%2C+jewelry%2C+turquoise%2C+strap%2C+silk%2C+coil%2C+lobster%2C+clasp%2C+garnet%2C+citrine%2C+wood%2C+travel%2C+inspiration%2C+ocean%2C+beach%2C+size%2C+color%2C+multi%2C+chinese+writing+stone%2C+confetti%2C+beads%2C+donut%2C+disc%2C+freshwater%2C+pearl%2C+laborodite%2C+amethyst%2C+dyed%2C+fused%2C+rainbow%2C+yin+yang%2C+dreamcatcher%2C+woven%2C+stabilized%2C+howlite%2C+quartz%2C+feathers%2C+feathered%2C+feather%2C+lightweight%2C+set%2C+matching%2C+pair%2C+bezel%2C+metalsmith%2C+studio%2C+garage%2C+handmade%2C+festivals%2C+fairs%2C+gem%2C+geme%2C+gems%2C+hematite%2C+hemetite%2C+apatite%2C+smoky%2C+topaz%2C+iolite%2C+bloodstone%2C+aquamarine%2C+diamond%2C+cubic+zirconia%2C+sapphire%2C+ruby%2C+emerald%2C+leopard%2C+indian%2C+';
var metaContents  = 'jewelry%2C+fused+glass%2C+glass%2C+silver%2C+earrings%2C+necklace%2C+ring%2C+cuff+links%2C+cufflinks%2C+bracelets%2C+leather%2C+stone%2C+wood%2C+shell%2C+chrysophase%2C+silver%2C+fused%2C+agate%2C+jasper%2C+cowrie%2C+leather%2C+snap%2C+snaps%2C+bracelet%2C+lapis%2C+moonstone%2C+onyx%2C+mens%2C+womens%2C+apparrel%2C+accessories%2C+wear%2C+adorn%2C+adornments%2C+custom%2C+one+of+a+kind%2C+onak%2C+studio%2C+torch%2C+metal%2C+copper%2C+brass%2C+moneyclip%2C+local%2C+wildhorse%2C+picture%2C+blue%2C+red%2C+pink%2C+yellow%2C+bronze%2C+brown%2C+black%2C+white%2C+purple%2C+orange%2C+green%2C+pink+lace%2C+druzy%2C+mother+of+pearl%2C+swirl%2C+comfortable%2C+comfort%2C+affordable%2C+wholesale%2C+trade%2C+jewelry%2C+turquoise%2C+strap%2C+silk%2C+coil%2C+lobster%2C+clasp%2C+garnet%2C+citrine%2C+wood%2C+travel%2C+inspiration%2C+ocean%2C+beach%2C+size%2C+color%2C+multi%2C+chinese+writing+stone%2C+confetti%2C+beads%2C+donut%2C+disc%2C+freshwater%2C+pearl%2C+laborodite%2C+amethyst%2C+dyed%2C+fused%2C+rainbow%2C+yin+yang%2C+dreamcatcher%2C+woven%2C+stabilized%2C+howlite%2C+quartz%2C+feathers%2C+feathered%2C+feather%2C+lightweight%2C+set%2C+matching%2C+pair%2C+bezel%2C+metalsmith%2C+studio%2C+garage%2C+handmade%2C+festivals%2C+fairs%2C+gem%2C+geme%2C+gems%2C+hematite%2C+hemetite%2C+apatite%2C+smoky%2C+topaz%2C+iolite%2C+bloodstone%2C+aquamarine%2C+diamond%2C+cubic+zirconia%2C+sapphire%2C+ruby%2C+emerald%2C+leopard%2C+indian%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();
};

