/* [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','201',jdecode('Home'),jdecode(''),'/201.html','true',[],'',''],
	['PAGE','103143',jdecode('Anniversary'),jdecode(''),'/103143.html','true',[],'',''],
	['PAGE','103501',jdecode('Any+Occasion'),jdecode(''),'/103501.html','true',[],'',''],
	['PAGE','103122',jdecode('Birthday'),jdecode(''),'/103122.html','true',[],'',''],
	['PAGE','103164',jdecode('Get+Well'),jdecode(''),'/103164.html','true',[],'',''],
	['PAGE','103185',jdecode('For+Him'),jdecode(''),'/103185.html','true',[],'',''],
	['PAGE','103206',jdecode('New+Baby'),jdecode(''),'/103206.html','true',[],'',''],
	['PAGE','103522',jdecode('Thankyou'),jdecode(''),'/103522.html','true',[],'',''],
	['PAGE','103101',jdecode('Corporate'),jdecode(''),'/103101.html','true',[],'',''],
	['PAGE','105601',jdecode('Gluten+%26+Sugar+Free'),jdecode(''),'/105601.html','true',[],'',''],
	['PAGE','109301',jdecode('Fathers+Day'),jdecode(''),'/109301.html','true',[],'',''],
	['PAGE','103248',jdecode('Christmas'),jdecode(''),'/103248.html','true',[],'',''],
	['PAGE','103269',jdecode('Valentines'),jdecode(''),'/103269.html','true',[],'',''],
	['PAGE','4806',jdecode('Contact'),jdecode(''),'/4806.html','true',[],'',''],
	['PAGE','106401',jdecode('Delivery+Info'),jdecode(''),'/106401.html','true',[],'',''],
	['PAGE','106422',jdecode('Links'),jdecode(''),'/106422.html','true',[],'',''],
	['PAGE','106001',jdecode('Email+Us'),jdecode(''),'/106001.html','true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Trade';
theSitetree.paletteFamily='EF6219';
theSitetree.keyvisualId='12107';
theSitetree.keyvisualName='kv_12107.jpg';
theSitetree.fontsetId='33301';
theSitetree.graphicsetId='14172';
theSitetree.contentColor='666666';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Trade',
				paletteFamily: 	'EF6219',
				keyvisualId: 	'12107',
				keyvisualName: 	'kv_12107.jpg',
				fontsetId: 		'33301',
				graphicsetId: 	'14172',
				contentColor: 	'666666',
				contentBGColor: 'FFFFFF',
				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:  '103122',
internalId:  '',
customField: '20100803-213644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103143',
internalId:  '',
customField: '20100803-042735'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '201',
internalId:  '',
customField: '20100801-233225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103101',
internalId:  '',
customField: '20100803-033011'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4806',
internalId:  '',
customField: '20100803-214143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106001',
internalId:  '',
customField: '20100801-233553'
};
webappMappings['7008']=webappMappings['7008-3754']={
webappId:    '7008',
documentId:  '106001',
internalId:  '3754',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103164',
internalId:  '',
customField: '20100803-032703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103185',
internalId:  '',
customField: '20100803-032751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103206',
internalId:  '',
customField: '20100803-032833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103522',
internalId:  '',
customField: '20100803-032914'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103501',
internalId:  '',
customField: '20100803-213925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105601',
internalId:  '',
customField: '20100818-211325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103248',
internalId:  '',
customField: '20100801-193903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103269',
internalId:  '',
customField: '20100801-193903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106401',
internalId:  '',
customField: '20100803-032023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106422',
internalId:  '',
customField: '20100803-042558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '109301',
internalId:  '',
customField: '20100818-213522'
};
var canonHostname = 'wscwrk02.ehost-services.com';
var accountId     = 'AEN010INXH0B';
var companyName   = '+The+Blissful+Box';
var htmlTitle	  = 'www.blissfulbox.com.au';
var metaKeywords  = 'gift+services+adelaide%0D%0Ablissful+boxes++%0D%0Aadelaide+gift+hampers++%0D%0Achocolate+hampers+adelaide%0D%0Achristmas+hampers+adelaide%0D%0Acorporate+gifts+adelaide%0D%0Ababy+gifts+adelaide%0D%0Avalentines+day+gifts+%0D%0Agifts+ideas+adelaide%0D%0Aadelaide+gift+services%0D%0Athankyou+gifts+%0D%0Abirthday+gifts+%0D%0Aget+well+gifts+adelaide%0D%0Agift+baskets%0D%0ACorporate+gifts%0D%0Akids+gifts+adelaide%0D%0Amens+gifts%0D%0Agift+boxes%0D%0Anew+baby+gift+hampers%0D%0A';
var metaContents  = 'The+Blissful+Box+specialises+in+giftboxes+for+all+occasions.+Located+in+South+Australia.+Our+giftboxes+contain+quality+gourmet+food%2C+chocolates%2C+nuts+and+wine.+Whatever+the+occasion+Birthday%2C+Baby%2C+Getwell%2C+Valentines%2C+Christmas%2C+Corporate+and+more.+Call+today+or+browse+our+website+for+great+gift+ideas.';
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();
};
