/* [nodename, id, name, navigationtext, href, isnavigation, childs[], templatename] */

function jdecode(s) {
    s = s.replace(/\+/g, "%20")
    return unescape(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','home',jdecode('Home'),jdecode(''),'/home.html','true',[],''],
	['PAGE','about_us',jdecode('About+us'),jdecode(''),'/about_us.html','true',[],''],
	['PAGE','stories',jdecode('Stories'),jdecode(''),'/stories.html','true',[],''],
	['PAGE','catalogs',jdecode('Catalogs'),jdecode(''),'/catalogs/index.html','true',[
		['PAGE','christmas_ornaments',jdecode('Christmas+Ornaments'),jdecode(''),'/catalogs/christmas_ornaments.html','true',[],''],
		['PAGE','glass',jdecode('Glass'),jdecode(''),'/catalogs/glass.html','true',[],''],
		['PAGE','crystal',jdecode('Crystal'),jdecode(''),'/catalogs/crystal.html','true',[],''],
		['PAGE','pottery',jdecode('Pottery'),jdecode(''),'/catalogs/pottery.html','true',[],'']
	],''],
	['PAGE','news',jdecode('News'),jdecode(''),'/news.html','true',[],''],
	['PAGE','contact',jdecode('Contact'),jdecode(''),'/contact.html','true',[],'']];
var siteelementCount=20;
theSitetree.topTemplateName='Citadel';
theSitetree.paletteFamily='6C6C6C';
theSitetree.keyvisualId='8139';
theSitetree.keyvisualName='kv_8139.jpg';
theSitetree.fontsetId='28173';
theSitetree.graphicsetId='12401';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='6C6C6C';
var theTemplate={
				name: 			'Citadel',
				paletteFamily: 	'6C6C6C',
				keyvisualId: 	'8139',
				keyvisualName: 	'kv_8139.jpg',
				fontsetId: 		'28173',
				graphicsetId: 	'12401',
				contentColor: 	'FFFFFF',
				contentBGColor: '6C6C6C',
				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'
			  };
var webappMappings = {};
webappMappings['5000']={
webappId:    '5000',
documentId:  'home',
internalId:  '',
customField: '20080513-202206'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  'about_us',
internalId:  '',
customField: '20080513-202503'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  'stories',
internalId:  '',
customField: '20080513-202804'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  'catalogs',
internalId:  '',
customField: '20080513-203035'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  'christmas_ornaments',
internalId:  '',
customField: '20080513-203113'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  'glass',
internalId:  '',
customField: '20080513-203255'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  'crystal',
internalId:  '',
customField: '20080513-203335'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  'pottery',
internalId:  '',
customField: '20080513-203414'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  'news',
internalId:  '',
customField: '20080513-203632'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  'contact',
internalId:  '',
customField: '20080513-205555'
};
webappMappings['1006']={
webappId:    '1006',
documentId:  'home',
internalId:  '1006',
customField: '1006'
};
webappMappings['1008']={
webappId:    '1008',
documentId:  'contact',
internalId:  '13927515',
customField: 'pl:PL:'
};
var canonHostname = 'wsc1.home.net.pl';
var accountId     = 'AHPL10INVPFH';
var companyName   = 'All+the+best+from+Poland';
var htmlTitle	  = 'All+the+best+from+Poland';
var metaKeywords  = 'polish+pottery%2C+pottery%2C+christmas+ornaments%2C+christmas+decorations%2C+christmas%2C+polish+glass%2C+polish+handicraft%2C+poland+wholesale%2C+wholesale%2C+polish+crystal%2C+polish+gifts%2C+poland%2C+polish+christmas+ornaments%2C+christmas+ornaments+wholesale%2C+crystal%2C+crystal+wholesale%2C+boles%C5%82awiec+pottery%2C+pottery+wholesale%2C+plish+pottery+wholesale';
var metaContents  = 'Polish+handicraft+wholesale.+Best+Polish+pottery%2C+crystal%2C+glass%2C+Christmas+ornaments+';

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;
	};
/* EOF */

