/* [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','2401',jdecode('Faire+Lady+Designs+++++++Men%26%23x27%3Bs+%26+Women%26%23x27%3Bs+Renaissance%2C+Medieval%2C+Pirate+Clothing+%26+Halloween+Costumes'),jdecode(''),'/2401.html','true',[],'',''],
	['PAGE','5801',jdecode('About+us'),jdecode(''),'/5801/index.html','true',[ 
		['PAGE','5822',jdecode('Our+History'),jdecode(''),'/5801/5822.html','true',[],'','']
	],'','']];
var siteelementCount=3;
theSitetree.topTemplateName='Fantasy';
theSitetree.paletteFamily='FFED11';
theSitetree.keyvisualId='9901';
theSitetree.keyvisualName='kv1.swf';
theSitetree.fontsetId='17882';
theSitetree.graphicsetId='13068';
theSitetree.contentColor='FFED11';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Fantasy',
				paletteFamily: 	'FFED11',
				keyvisualId: 	'9901',
				keyvisualName: 	'kv1.swf',
				fontsetId: 		'17882',
				graphicsetId: 	'13068',
				contentColor: 	'FFED11',
				contentBGColor: '000000',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2401',
internalId:  '',
customField: '20090915-171621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5801',
internalId:  '',
customField: '20110609-204332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5822',
internalId:  '',
customField: '20110609-204332'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2401',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '5801',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '5822',
internalId:  '',
customField: 'language:en;country:US;'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN2QC9';
var companyName   = 'Faire+Lady+Designs';
var htmlTitle	  = 'Faire+Lady+Designs';
var metaKeywords  = 'Faire+Lady+Designs+Original+Renaissance+Clothing+most+authentic+men%27s+and+women%27s+garb+for+pirate%2C+wench%2C+belly+dance%2C+gypsy%2C+fair+peasant+costumes+for+Faire%2C+Festivals%2C+Pyratcon+%26+Halloween+Party.+garb%2C+clothes%2C+clothing%2C+renaissance%2C+medieval%2C+garb%2C+costumes%2C+SCA%2C+gypsy%2C+steampunk%2C+pirate%2C+LARP%2C+belly+dance%2C+bellydance%2C+scottish%2C+irish%2C+celtic%2C+highlander%2C+plaid%2C+wench%2C+tartan%2C+shoes%2C+boots%2C+hat%2C+skirts%2C+bodice%2C+corset%2C+blouse%2C+chemise%2C+dress%2C+overdress%2C+hip+belt%2C+coins%2C+bra%2C+coin+bra%2C+coin+belt%2C+flamenco%2C+spanish%2C+swashbuckler%2C+jack+sparrow%2C+rogue%2C+pirates+of+the+Caribbean%2C+cavalier%2C+musketeers%2C+brooch%2C+hoop+skirt%2C+hoop+slip%2C+petty+coat%2C+ghwazee%2C+choli%2C+penannular%2C++ring%2C+elizabethan%2C+pin%2C+harem%2C+bloomers%2C+ghillies%2C+potc%2C+waist+cincher%2C+leather%2C+black%2C+burlesque%2C+saloon%2C+bar+maid%2C+maiden%2C+fair%2C+faire%2C+festival%2C+fairy%2C+faerie%2C+faery%2C+petal%2C+grommets%2C+metal%2C+grommet+machine%2C+press%2C+tool%2C+setter%2C+rhinestone%2C+nailhead%2C+dies%2C+homepro%2C+american+tag%2C+studs%2C+spots%2C+patterns%2C+pantaloons%2C+overdress%2C+civil+war%2C+merchant%2C+victorian%2C+tudor%2C+tribal%2C+ats%2C+cabaret%2C+turkish%2C+pilot%2C+punch%2C+peasant%2C+shirt%2C+crop+top%2C+brocade%2C+silk%2C+embroidered%2C+brass%2C+nickel%2C+antique%2C+gown%2C+boning%2C+petticoat%2C+bridal%2C+bride%2C+cotton%2C+floppy+hat%2C+rivet%2C+stays%2C+busk%2C+bust%2C+witch%2C+wicca%2C+plus+size%2C+vampire%2C+goddess%2C+gothic%2C+goth%2C+skull%2C+cross+bones%2C+vest%2C+washers%2C+cincher%2C+bra%2C+ebay%2C+steam+punk%2C+top+hat%2C+lace%2C+lacing%2C+elizabeth+swan%2C+angelica%2C+middle+eastern%2C+tricorn%2C+edwardian%2C+flat%2C+muffin%2C+court%2C+queen%2C+king%2C+ladies+in+waiting%2C+white%2C+red%2C+green%2C+blue%2C+prince%2C+princess%2C+halloween%2C+italian%2C+dickens%2C+pilgrim%2C+colonial%2C+women%2C+men%2C+children%2C+teen%2C+juniors%2C+tassles%2C+indian%2C+india%2C+robin+hood%2C+twilight%2C+new+moon%2C+eclipse%2C+fantasy%2C+woodland%2C+elf%2C+lotr%2C+lord+of+the+rings%2C+dwarf%2C+cloak%2C+cape%2C+revolutionary%2C+underworld%2C+werewolf%2C+poet%2C+shakespeare%2C+robe%2C+tunic%2C+boleyn%2C+doublet%2C+bracers%2C+reniassance%2C+mardi+gras%2C+purple%2C+cross%2C+wedding%2C+boho%2C+warrior%2C+archer%2C+horsemen%2C+knight%2C+stockings%2C+jerkin%2C+british%2C+rome%2C+roman%2C+troy%2C+adult%2C+woman%2C+man%2C+child%2C+youth%2C+teenager%2C+hunter%2C+juliet%2C+romeo%2C+tristan%2C+isolde%2C+duke%2C+duchess%2C+count%2C+countess%2C+maid+marion%2C+veil';
var metaContents  = '';
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();
};

