/* [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','1301',jdecode('Home'),jdecode(''), jdecode('%2F1301.html'), 'true',[],'',''],
	['PAGE','1352',jdecode('Books+and+Reviews'),jdecode(''), jdecode('%2F1352.html'), 'true',[],'',''],
	['PAGE','1373',jdecode('What%26%23x27%3Bs+New%2FContests'),jdecode(''), jdecode('%2F1373.html'), 'true',[],'',''],
	['PAGE','26201',jdecode('Blog+%2F+Best+Blog+Posts'),jdecode(''), jdecode('%2F26201.html'), 'true',[],'',''],
	['PAGE','1394',jdecode('Links'),jdecode(''), jdecode('%2F1394.html'), 'true',[],'',''],
	['PAGE','7701',jdecode('Contact'),jdecode(''), jdecode('%2F7701.html'), 'true',[],'',''],
	['PAGE','1415',jdecode('Guestbook'),jdecode(''), jdecode('%2F1415.html'), 'true',[],'','']];
var siteelementCount=7;
theSitetree.topTemplateName='Blossom';
theSitetree.paletteFamily='AC2E53';
theSitetree.keyvisualId='7103';
theSitetree.keyvisualName='kv_7103.jpg';
theSitetree.fontsetId='16394';
theSitetree.graphicsetId='12128';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='E5E2E2';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'powweb',
  product: 'WSCSYSSSSLY0XRNC'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Blossom',
				paletteFamily: 	'AC2E53',
				keyvisualId: 	'7103',
				keyvisualName: 	'kv_7103.jpg',
				fontsetId: 		'16394',
				graphicsetId: 	'12128',
				contentColor: 	'000000',
				contentBGColor: 'E5E2E2',
				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['1002']=webappMappings['1002-1415aendu0in23u4']={
webappId:    '1002',
documentId:  '1415',
internalId:  '1415aendu0in23u4',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1301',
internalId:  '',
customField: '20120102-092858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1352',
internalId:  '',
customField: '20120102-092743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1373',
internalId:  '',
customField: '20111230-095457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1394',
internalId:  '',
customField: '20111230-095539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1415',
internalId:  '',
customField: '20111230-095615'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7701',
internalId:  '',
customField: '20111230-095601'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26201',
internalId:  '',
customField: '20111230-095523'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN23U4';
var companyName   = 'Linda+Banche-+Romance+Author';
var htmlTitle	  = '';
var metaKeywords  = 'author%2C+romance+author%2C+romance%2C+Regency%2C+historical%2C++Regency+romance%2C+historical+romance%2C+Banche%2C+Linda+Banche%2C+book%2C+novel%2C+fiction%2C+humor%2C+comedy%2C+fantasy%2C+paranormal%2C+Lady+of+the+Stars%2C+Pumpkinnapper%2C+Halloween%2C+Regency+Halloween%2C+time+travel%2C+Happily+Ever+After%2C+HEA%2C+Classic+Romance+Revival%2C+CRR%2C+Lindsays+Romantics%2C+Romantic+Synonymous%2C+The+Neverending+Story%2C+Historical+Hussies%2C+Eppie%2C+Eppie+Finalist%2C+2010+EPIC+eBook+Competition+Awards+Finalist%2C+science+fiction+romance%2C+Mistletoe+Everywhere%2C+Regency+Christmas%2C+Christmas%2C+Linda+Banche--Regency+Romance%2C+Janes+of+Romance%2C+Historical+Hilarity%2C+Welcome+to+My+World+of+Historical+Hilarity%2C+TWRP+Historical+Roses%2C+Historical+Belles+and+Beaus%2C+2011+EPIC+eBook+Competition+Awards+Finalist%2C+British+Romance+Fiction%2C+Gifts+Gone+Astray%2C+An+Inheritance+for+the+Birds';
var metaContents  = 'Linda+Banche%2C+Romance+Author--Welcome+to+My+World+of++Historical+Hilarity%21+Regency+romance--most+with+humor%2C+some+with+fantasy%2C+and+occasionally+a+paranormal';
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();
};

