/* [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','2001',jdecode('Home'),jdecode(''), jdecode('%2F2001.html'), 'true',[],'',''],
	['PAGE','2304',jdecode('About+us'),jdecode(''), jdecode('%2F2304.html'), 'true',[],'',''],
	['PAGE','12501',jdecode('Necklaces'),jdecode(''), jdecode('%2F12501.html'), 'true',[],'',''],
	['PAGE','12886',jdecode('Earrings+%26+Bracelets'),jdecode(''), jdecode('%2F12886.html'), 'true',[],'',''],
	['PAGE','12907',jdecode('Hair+Accessories'),jdecode(''), jdecode('%2F12907.html'), 'true',[],'',''],
	['PAGE','29412',jdecode('Brooch+Bouquets'),jdecode(''), jdecode('%2F29412.html'), 'true',[],'',''],
	['PAGE','14501',jdecode('Specials'),jdecode(''), jdecode('%2F14501.html'), 'true',[],'',''],
	['PAGE','13101',jdecode('Our+Brides+%26+Testimonials'),jdecode(''), jdecode('%2F13101.html'), 'true',[],'',''],
	['PAGE','2136',jdecode('Custom+Jewelry'),jdecode(''), jdecode('%2F2136%2Findex.html'), 'true',[ 
		['PAGE','2178',jdecode('Details'),jdecode(''), jdecode('%2F2136%2F2178.html'), 'true',[],'','']
	],'',''],
	['PAGE','14001',jdecode('Consultation+Days'),jdecode(''), jdecode('%2F14001.html'), 'true',[],'',''],
	['PAGE','2241',jdecode('Order+%26+Delivery'),jdecode(''), jdecode('%2F2241.html'), 'true',[],'',''],
	['PAGE','8801',jdecode('Contact+Us'),jdecode(''), jdecode('%2F8801.html'), 'true',[],'',''],
	['PAGE','8822',jdecode('Guestbook'),jdecode(''), jdecode('%2F8822.html'), 'true',[],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Brush';
theSitetree.paletteFamily='E45858';
theSitetree.keyvisualId='11943';
theSitetree.keyvisualName='kv_11943.jpg';
theSitetree.fontsetId='33211';
theSitetree.graphicsetId='14100';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRN4'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Brush',
				paletteFamily: 	'E45858',
				keyvisualId: 	'11943',
				keyvisualName: 	'kv_11943.jpg',
				fontsetId: 		'33211',
				graphicsetId: 	'14100',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2001',
internalId:  '',
customField: '20120218-104047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2304',
internalId:  '',
customField: '20120218-101300'
};
webappMappings['7060']=webappMappings['7060-8e51af95d9f2d2186732a3a0e3be7788']={
webappId:    '7060',
documentId:  '12886',
internalId:  '8e51af95d9f2d2186732a3a0e3be7788',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2136',
internalId:  '',
customField: '20120218-102149'
};
webappMappings['7008']=webappMappings['7008-19963']={
webappId:    '7008',
documentId:  '8801',
internalId:  '19963',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2178',
internalId:  '',
customField: '20120218-102429'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12501',
internalId:  '',
customField: '20111017-162933'
};
webappMappings['7060']=webappMappings['7060-6b02605a030fdf1807b4fd7a2768ffd7']={
webappId:    '7060',
documentId:  '12907',
internalId:  '6b02605a030fdf1807b4fd7a2768ffd7',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-b183f42b04bff133d179c6d0e4d1fb8d']={
webappId:    '7060',
documentId:  '12501',
internalId:  'b183f42b04bff133d179c6d0e4d1fb8d',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2241',
internalId:  '',
customField: '20120218-103139'
};
webappMappings['1002']=webappMappings['1002-8822aendu0ine0b3']={
webappId:    '1002',
documentId:  '8822',
internalId:  '8822aendu0ine0b3',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8801',
internalId:  '',
customField: '20120218-103207'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8822',
internalId:  '',
customField: '20090820-140021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12907',
internalId:  '',
customField: '20120218-101848'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12886',
internalId:  '',
customField: '20111017-162830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13101',
internalId:  '',
customField: '20111017-181734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14001',
internalId:  '',
customField: '20120218-103047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14501',
internalId:  '',
customField: '20111017-163424'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29412',
internalId:  '',
customField: '20120218-103750'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INE0B3';
var companyName   = 'MarEva+Custom+Jewelry';
var htmlTitle	  = 'MarEva+Custom+Jewelry';
var metaKeywords  = 'mareva%2C+jewelry%2C+custom+jewelry%2C+Eva+Mores%2C+Maressa+Busboom%2C+bridal%2C+formal+occasion%2C+necklace%2C+bracelet%2C+earrings%2C+comb%2C+headband%2C+crystals%2C+pearls%2C+sterling+silver%2C++jewelry+design%2C+bridal+jewelry%2C+formal+jewelry%2C+freshwater+pearls%2C+Swarovski+crystals';
var metaContents  = 'MarEva+specializes+in+custom+jewelry+for+weddings+and+formal+occasions.';
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();
};

