/* [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','7601',jdecode('Note+Cards'),jdecode(''), jdecode('%2F7601.html'), 'true',[],'',''],
	['PAGE','30301',jdecode('Buy+Note+Cards'),jdecode(''), jdecode('%2F30301.html'), 'true',[],'',''],
	['PAGE','7622',jdecode('Holiday+Cards'),jdecode(''), jdecode('%2F7622.html'), 'false',[],'',''],
	['PAGE','37001',jdecode('Note+Card+Messages'),jdecode(''), jdecode('%2F37001.html'), 'true',[],'',''],
	['PAGE','23701',jdecode('Greeting+Cards'),jdecode(''), jdecode('%2F23701.html'), 'true',[],'',''],
	['PAGE','8022',jdecode('Personalized+Cards'),jdecode(''), jdecode('%2F8022.html'), 'true',[],'',''],
	['PAGE','8001',jdecode('Prints'),jdecode(''), jdecode('%2F8001.html'), 'true',[],'',''],
	['PAGE','18401',jdecode('Photography'),jdecode(''), jdecode('%2F18401.html'), 'true',[],'',''],
	['PAGE','33901',jdecode('Upcoming+Events'),jdecode(''), jdecode('%2F33901.html'), 'true',[],'',''],
	['PAGE','33922',jdecode('Friends+and+Links'),jdecode(''), jdecode('%2F33922.html'), 'true',[],'',''],
	['PAGE','51701',jdecode('Reviews'),jdecode(''), jdecode('%2F51701.html'), 'true',[],'',''],
	['PAGE','19901',jdecode('Contact+Us'),jdecode(''), jdecode('%2F19901.html'), 'true',[],'',''],
	['PAGE','19922',jdecode('About+'),jdecode(''), jdecode('%2F19922.html'), 'true',[],'',''],
	['PAGE','45901',jdecode('Services'),jdecode(''), jdecode('%2F45901.html'), 'true',[],'',''],
	['PAGE','42001',jdecode('Mothers+Day+Special'),jdecode(''), jdecode('%2F42001.html'), 'false',[],'',''],
	['PAGE','45201',jdecode('Online+order'),jdecode(''), jdecode('%2F45201.html'), 'false',[],'',''],
	['PAGE','49501',jdecode('Site+Updates'),jdecode(''), jdecode('%2F49501.html'), 'true',[],'',''],
	['PAGE','60301',jdecode('Published+Works'),jdecode(''), jdecode('%2F60301.html'), 'true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Groove';
theSitetree.paletteFamily='E1CEA1';
theSitetree.keyvisualId='6008';
theSitetree.keyvisualName='kv_6008.jpg';
theSitetree.fontsetId='11123';
theSitetree.graphicsetId='11920';
theSitetree.contentColor='5F5F60';
theSitetree.contentBGColor='E4E4E6';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRNU'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Groove',
				paletteFamily: 	'E1CEA1',
				keyvisualId: 	'6008',
				keyvisualName: 	'kv_6008.jpg',
				fontsetId: 		'11123',
				graphicsetId: 	'11920',
				contentColor: 	'5F5F60',
				contentBGColor: 'E4E4E6',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2001',
internalId:  '',
customField: '20101001-171246'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7601',
internalId:  '',
customField: '20090608-133948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7622',
internalId:  '',
customField: '20081129-171228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30301',
internalId:  '',
customField: '20111029-181107'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18401',
internalId:  '',
customField: '20101001-171804'
};
webappMappings['7008']=webappMappings['7008-10709']={
webappId:    '7008',
documentId:  '19901',
internalId:  '10709',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33922',
internalId:  '',
customField: '20110311-224425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23701',
internalId:  '',
customField: '20090506-113534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19901',
internalId:  '',
customField: '20081118-114425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8001',
internalId:  '',
customField: '20081209-143731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8022',
internalId:  '',
customField: '20101001-171724'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19922',
internalId:  '',
customField: '20110516-220056'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33901',
internalId:  '',
customField: '20111115-210152'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37001',
internalId:  '',
customField: '20101001-171632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42001',
internalId:  '',
customField: '20090418-194304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45201',
internalId:  '',
customField: '20090527-092534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45901',
internalId:  '',
customField: '20091026-202523'
};
webappMappings['4001']=webappMappings['4001-18843811']={
webappId:    '4001',
documentId:  '45901',
internalId:  '18843811',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49501',
internalId:  '',
customField: '20111115-210242'
};
webappMappings['1003']=webappMappings['1003-aendu0ine83x1234ef650ba']={
webappId:    '1003',
documentId:  '51701',
internalId:  'aendu0ine83x1234ef650ba',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51701',
internalId:  '',
customField: '20110313-135830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60301',
internalId:  '',
customField: '20110527-162701'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INE83X';
var companyName   = 'Cards+and+Prints+by+LJ+Creation%27s%21';
var htmlTitle	  = 'Cards+and+Prints+by+LJ+Creations%21';
var metaKeywords  = 'Fairy+Magic+Note+Cards%2C+Angel+Note+Cards%2C+Guardian+Angel+Note+Cards%2C+Nature+Angel+Cards%2C+all+occasion+cards%2C+Butterfly+Cards%2C+Christmas+Cards%2C+Personalized+Cards%2C+Thank+you+cards%2C+Graduation+cards%2C+animal+cards%2C+note+cards%2C+notecards%2C+greeting+cards%2C+Valentine+Cards%2C+Mothers+Day+Cards%2C+Birthday+Cards%2C+blank+note+cards%2C+Flower+Cards%2C+Tulip+Cards%2C+Horse+Cards%2C+Pony+cards%2C+Hi+Cards%2C+Youre+an+Angel%2C+Thinking+of+you%2C+Friends+cards%2C+Just+a+note+cards';
var metaContents  = 'Cards+and+prints+by+LJ+Creations%21';
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();
};

