/* [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','14901',jdecode('Home'),jdecode(''),'/14901.html','true',[],''],
	['PAGE','17401',jdecode('Pearl+Shopping+Guide'),jdecode(''),'/17401.html','true',[],''],
	['PAGE','17527',jdecode('Store'),jdecode(''),'/17527.html','true',[],''],
	['PAGE','55715',jdecode('Terms+of+sale%2Fdelivery'),jdecode(''),'/55715.html','true',[],''],
	['PAGE','18001',jdecode('Testimonials'),jdecode(''),'/18001.html','true',[],''],
	['PAGE','17422',jdecode('About+Pearls+America'),jdecode(''),'/17422/index.html','true',[ 
		['PAGE','17464',jdecode('+Pearl+Necklaces'),jdecode(''),'/17422/17464.html','false',[],''],
		['PAGE','18022',jdecode('Pearl+Earrings'),jdecode(''),'/17422/18022.html','false',[],''],
		['PAGE','18043',jdecode('Triple+Strand+Pearl+Necklaces'),jdecode(''),'/17422/18043.html','false',[],''],
		['PAGE','17443',jdecode('Bracelets'),jdecode(''),'/17422/17443.html','false',[],'']
	],''],
	['PAGE','17569',jdecode('Links'),jdecode(''),'/17569.html','true',[],''],
	['PAGE','17590',jdecode('Contact'),jdecode(''),'/17590.html','true',[],''],
	['PAGE','33615',jdecode('Pearls-News+%26+Entertainment'),jdecode(''),'/33615/index.html','true',[ 
		['PAGE','34715',jdecode('Pearl+Sightings+2'),jdecode(''),'/33615/34715.html','true',[],''],
		['PAGE','34736',jdecode('Pearl+Sightings+3'),jdecode(''),'/33615/34736.html','true',[],''],
		['PAGE','34757',jdecode('Pearl+Sightings+4'),jdecode(''),'/33615/34757.html','true',[],''],
		['PAGE','34778',jdecode('Pearl+Sightings+5'),jdecode(''),'/33615/34778.html','true',[],'']
	],''],
	['PAGE','45715',jdecode('Our+Awards'),jdecode(''),'/45715/index.html','true',[ 
		['PAGE','48515',jdecode('Our+Awards+2'),jdecode(''),'/45715/48515.html','true',[],'']
	],''],
	['PAGE','50615',jdecode('Pearl+Blog'),jdecode(''),'/50615.html','true',[],'']];
var siteelementCount=20;
theSitetree.topTemplateName='Gaudy';
theSitetree.paletteFamily='5C5D96';
theSitetree.keyvisualId='5934';
theSitetree.keyvisualName='kv_5934.jpg';
theSitetree.fontsetId='11113';
theSitetree.graphicsetId='11905';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='6E8BCE';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Gaudy',
				paletteFamily: 	'5C5D96',
				keyvisualId: 	'5934',
				keyvisualName: 	'kv_5934.jpg',
				fontsetId: 		'11113',
				graphicsetId: 	'11905',
				contentColor: 	'FFFFFF',
				contentBGColor: '6E8BCE',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14901',
internalId:  '',
customField: '20090409-205449'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17422',
internalId:  '',
customField: '20090317-200548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34736',
internalId:  '',
customField: '20080906-205944'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18001',
internalId:  '',
customField: '20090317-200803'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17401',
internalId:  '',
customField: '20090317-201721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33615',
internalId:  '',
customField: '20090317-195714'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17464',
internalId:  '',
customField: '20080825-183755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18022',
internalId:  '',
customField: '20080825-185123'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18043',
internalId:  '',
customField: '20080825-185123'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17443',
internalId:  '',
customField: '20080825-183755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17527',
internalId:  '',
customField: '20081203-142743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17569',
internalId:  '',
customField: '20090317-200710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17590',
internalId:  '',
customField: '20090317-200303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50615',
internalId:  '',
customField: '20081010-161246'
};
webappMappings['7050']=webappMappings['7050-4894']={
webappId:    '7050',
documentId:  '50615',
internalId:  '4894',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34715',
internalId:  '',
customField: '20090317-195913'
};
webappMappings['4001']=webappMappings['4001-11709521']={
webappId:    '4001',
documentId:  '17527',
internalId:  '11709521',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34757',
internalId:  '',
customField: '20080906-210049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34778',
internalId:  '',
customField: '20080906-210155'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45715',
internalId:  '',
customField: '20080927-203647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48515',
internalId:  '',
customField: '20080927-202120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55715',
internalId:  '',
customField: '20090106-191652'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INE9K5';
var companyName   = 'PearlsAmerica.com';
var htmlTitle	  = 'Pearls+America';
var metaKeywords  = 'Akoya%2Cpearls%2Cdiscount%2Ccultured%2Cpearls%2Cmikimoto%2Ctiffany%2Cmaui%2CHawaii%2CNile%2Cquality%2Cdouble%2Ctriple%2Cstrand%2Cstring%2Cakoya%2Cpearl%2Caffordable%2CJapanese%2CChinese%2CTahiti%2C8%2C9%2C10%2CAAA%2Chand%2Cknotted%2Cguide%2Cbuying%2Cshop%2Cmikimoto%2Cprincess%2Cmatinee%2Cchoker%2Cround%2Cwhite%2Ccream%2C7%2Cmm%2Cnacre%2Cakoya%2Cpearls%2Clarge%2CMikimoto%2C10+mm%2C9+mm%2C8+mm%2C7+mm%2Ccultured%2Cnatural%2Creal%2Cpearl%2CJapan%2CTahitian';
var metaContents  = 'Pearls+America.+High+quality+saltwater+Akoya+pearls+at+discount+prices.+Earrings%2C+necklaces%2C+double-+triple-strand+pearls%2C+choker%2C+princess%2C+matinee%2C+opera%2C+AAA.+Akoya+salt+water+pearl+farms+to+you.+Compare+to+Mikimoto%2C+Tiffany%2C+Maui%2C+B+Nile.+Guide.';
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();
};

