/* [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','6401',jdecode('Home'),jdecode(''),'/6401.html','true',[],'',''],
	['PAGE','13901',jdecode('FUDGE'),jdecode(''),'/13901.html','true',[],'',''],
	['PAGE','38141',jdecode('BEST+DEAL+SAVE%24%24'),jdecode(''),'/38141.html','true',[],'',''],
	['PAGE','17741',jdecode('Confectionery+Bags'),jdecode(''),'/17741.html','true',[],'',''],
	['PAGE','17762',jdecode('Condiments%2FJams%2FChutneys'),jdecode(''),'/17762.html','true',[],'',''],
	['PAGE','17783',jdecode('Hand-made+Chocolates'),jdecode(''),'/17783.html','true',[],'',''],
	['PAGE','17804',jdecode('Gift+Baskets'),jdecode(''),'/17804.html','true',[],'',''],
	['PAGE','20841',jdecode('Gift+Boxes'),jdecode(''),'/20841.html','true',[],'',''],
	['PAGE','14001',jdecode('Special+Packs'),jdecode(''),'/14001.html','true',[],'',''],
	['PAGE','14101',jdecode('Orders%2FShopping+Cart'),jdecode(''),'/14101.html','true',[],'',''],
	['PAGE','39141',jdecode('Message+on+Gift+'),jdecode(''),'/39141.html','true',[],'',''],
	['PAGE','14022',jdecode('contacts'),jdecode(''),'/14022.html','true',[],'',''],
	['PAGE','18141',jdecode('Picture+Gallery'),jdecode(''),'/18141.html','true',[],'',''],
	['PAGE','40141',jdecode('Wholesale'),jdecode(''),'/40141.html','true',[],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Vienna';
theSitetree.paletteFamily='D6D2C5';
theSitetree.keyvisualId='11869';
theSitetree.keyvisualName='kv_11869.jpg';
theSitetree.fontsetId='33180';
theSitetree.graphicsetId='14088';
theSitetree.contentColor='696146';
theSitetree.contentBGColor='ebe8df';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Vienna',
				paletteFamily: 	'D6D2C5',
				keyvisualId: 	'11869',
				keyvisualName: 	'kv_11869.jpg',
				fontsetId: 		'33180',
				graphicsetId: 	'14088',
				contentColor: 	'696146',
				contentBGColor: 'ebe8df',
				a_color: 		'EBE8DF',
				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:  '6401',
internalId:  '',
customField: '20100423-174652'
};
webappMappings['7008']=webappMappings['7008-15165']={
webappId:    '7008',
documentId:  '14001',
internalId:  '15165',
customField: 'language:en;country:US;'
};
webappMappings['4001']=webappMappings['4001-15119249']={
webappId:    '4001',
documentId:  '14101',
internalId:  '15119249',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13901',
internalId:  '',
customField: '20100407-191403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14001',
internalId:  '',
customField: '20100423-173322'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14022',
internalId:  '',
customField: '20100301-184712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18141',
internalId:  '',
customField: '20100225-181510'
};
webappMappings['7060']=webappMappings['7060-ee007e405c112172d1309fe7fc5de597']={
webappId:    '7060',
documentId:  '18141',
internalId:  'ee007e405c112172d1309fe7fc5de597',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17741',
internalId:  '',
customField: '20100302-193854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17762',
internalId:  '',
customField: '20100302-194731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17783',
internalId:  '',
customField: '20100302-194557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17804',
internalId:  '',
customField: '20100302-194956'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14101',
internalId:  '',
customField: '20100423-171920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20841',
internalId:  '',
customField: '20100302-195112'
};
webappMappings['7008']=webappMappings['7008-15215']={
webappId:    '7008',
documentId:  '14022',
internalId:  '15215',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38141',
internalId:  '',
customField: '20100423-174807'
};
webappMappings['7008']=webappMappings['7008-17553']={
webappId:    '7008',
documentId:  '39141',
internalId:  '17553',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39141',
internalId:  '',
customField: '20100603-220751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40141',
internalId:  '',
customField: '20100624-154238'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30I7C9K7';
var companyName   = 'Guilty+by+Confection+%26+A+Cat+above+the+Rest';
var htmlTitle	  = '';
var metaKeywords  = '';
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();
};
