/* [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(''), jdecode('%2F201.html'), 'true',[],'',''],
	['PAGE','103143',jdecode('Anniversary'),jdecode(''), jdecode('%2F103143.html'), 'true',[],'',''],
	['PAGE','103501',jdecode('Any+Occasion'),jdecode(''), jdecode('%2F103501.html'), 'true',[],'',''],
	['PAGE','133501',jdecode('Bear+in+a+Bag'),jdecode(''), jdecode('%2F133501.html'), 'true',[],'',''],
	['PAGE','103122',jdecode('Birthday'),jdecode(''), jdecode('%2F103122.html'), 'true',[],'',''],
	['PAGE','103248',jdecode('Christmas'),jdecode(''), jdecode('%2F103248.html'), 'true',[],'',''],
	['PAGE','103101',jdecode('Corporate'),jdecode(''), jdecode('%2F103101.html'), 'true',[],'',''],
	['PAGE','103185',jdecode('For+Him'),jdecode(''), jdecode('%2F103185.html'), 'true',[],'',''],
	['PAGE','103164',jdecode('Get+Well'),jdecode(''), jdecode('%2F103164.html'), 'true',[],'',''],
	['PAGE','105601',jdecode('Gluten+%26+Sugar+Free'),jdecode(''), jdecode('%2F105601.html'), 'true',[],'',''],
	['PAGE','103206',jdecode('New+Baby'),jdecode(''), jdecode('%2F103206.html'), 'true',[],'',''],
	['PAGE','103522',jdecode('Thankyou'),jdecode(''), jdecode('%2F103522.html'), 'true',[],'',''],
	['PAGE','110701',jdecode('Thinking+of+You'),jdecode(''), jdecode('%2F110701.html'), 'true',[],'',''],
	['PAGE','109301',jdecode('Fathers+Day'),jdecode(''), jdecode('%2F109301.html'), 'true',[],'',''],
	['PAGE','103269',jdecode('Valentines'),jdecode(''), jdecode('%2F103269.html'), 'true',[],'',''],
	['PAGE','4806',jdecode('Contact'),jdecode(''), jdecode('%2F4806.html'), 'true',[],'',''],
	['PAGE','106401',jdecode('Delivery+Info'),jdecode(''), jdecode('%2F106401.html'), 'true',[],'',''],
	['PAGE','106422',jdecode('Links'),jdecode(''), jdecode('%2F106422.html'), 'true',[],'',''],
	['PAGE','106001',jdecode('Email+Us'),jdecode(''), jdecode('%2F106001.html'), 'true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Trade';
theSitetree.paletteFamily='EF6219';
theSitetree.keyvisualId='12107';
theSitetree.keyvisualName='kv_12107.jpg';
theSitetree.fontsetId='33301';
theSitetree.graphicsetId='14172';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'wl_enom',
  product: 'WSCENOSSSLYTC21T'
};
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: 	'000000',
				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: '20110829-190323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103143',
internalId:  '',
customField: '20111130-211531'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '201',
internalId:  '',
customField: '20111209-021830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103101',
internalId:  '',
customField: '20110710-214547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4806',
internalId:  '',
customField: '20111004-221344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106001',
internalId:  '',
customField: '20110209-173740'
};
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: '20110710-212758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103185',
internalId:  '',
customField: '20110209-173043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103206',
internalId:  '',
customField: '20110710-213416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103522',
internalId:  '',
customField: '20110710-214417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103501',
internalId:  '',
customField: '20110710-202922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105601',
internalId:  '',
customField: '20110710-214235'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103248',
internalId:  '',
customField: '20111209-021009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103269',
internalId:  '',
customField: '20110518-193759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106401',
internalId:  '',
customField: '20111004-221639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106422',
internalId:  '',
customField: '20111004-221745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '109301',
internalId:  '',
customField: '20110829-185534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110701',
internalId:  '',
customField: '20110209-173217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '133501',
internalId:  '',
customField: '20120120-170443'
};
var webAppHostname = 'wsc.ehost-services.com:80';
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%0Avalentines+day+gifts%0D%0Ablissful+boxes%0D%0Avalentines+hampers+adelaide%0D%0Aadelaide+gift+hampers%0D%0Aadelaide+valentines+gifts%0D%0Ababy+gifts%0D%0Ababy+baskets%0D%0Amens+gift+hampers%0D%0Avalentines+baskets%0D%0Abaylies+of+strathalbyn%0D%0Agift+hampers+valentines%0D%0Amorish+nuts%0D%0Avalentines+gift+hampers%0D%0Awine+gift+hampers%0D%0Avalentines+day+gift+ideas%0D%0Abeer+baskets%0D%0Abaskets+for+men+adelaide%0D%0Abeer+hampers%0D%0Avalentines+chocolates%0D%0Agift+baskets+adelaide%0D%0Achocolate+gifts+adelaide%0D%0Agift+baskets+south+australia%0D%0Achocolate+boxes%0D%0Abirthday+gift+baskets%0D%0Ahampers%0D%0Aanniversary+gifts+adelaide%0D%0Agiftboxes%0D%0Anaughty+gift+baskets%0D%0Awedding+gifts%0D%0Afemale+gift+baskets%0D%0Akids+gift+hampers%0D%0Achocoholics+box%0D%0Acreate+a+basket%0D%0Alolly+blooms%0D%0Alolly+hampers%0D%0Aedible+blooms%0D%0Agossip+box%0D%0Asurprise+box%0D%0Agifts+with+wine%0D%0Achocolate+hampers+adelaide%0D%0Ateddy+bear+baskets%0D%0Achristmas+hampers+adelaide%0D%0Agourmet+hampers%0D%0Acorporate+gifts+adelaide%0D%0Aget+well+baskets%0D%0Ababy+gifts+adelaide%0D%0Achristmas+baskets%0D%0Avalentines+day+gifts+%0D%0Asend+a+basket%0D%0Agifts+ideas+adelaide%0D%0Asend+a+gift%0D%0Aadelaide+gift+services%0D%0Aadelaide+hampers%0D%0Athankyou+gifts+%0D%0Anut+hampers%0D%0Abirthday+gifts+%0D%0Abirthday+hampers%0D%0Aget+well+gifts+adelaide%0D%0A21st+gift+baskets%0D%0Agift+baskets%0D%0A40th+gift+hampers%0D%0ACorporate+gifts%0D%0Awedding+hampers%0D%0Acorporate+gift+hampers%0D%0Akids+gifts+adelaide%0D%0Amens+gifts%0D%0Agift+boxes%0D%0Anew+baby+gift+hampers%0D%0Agifts+direct%0D%0ABaylies%0D%0ATwin+baby+gift+hampers+adelaide%0D%0Atwin+baby+gift+boxes+adelaide%0D%0Atwin+baby+gift+baskets+adelaide%0D%0AThankyou+gifts%0D%0Abirthday+gifts%0D%0Aget+well+baskets%0D%0A%0D%0A';
var metaContents  = 'The+Blissful+Box+specialises+in+giftboxes+for+all+occasions.+Located+in+Adelaide%2C+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();
};

