/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','2801',jdecode('Our+Paper'),jdecode(''),'/2801.html','true',[],'',''],
	['PAGE','22801',jdecode('Planting+Tips'),jdecode(''),'/22801.html','true',[],'',''],
	['PAGE','25722',jdecode('Paper+Colours'),jdecode(''),'/25722.html','true',[],'',''],
	['PAGE','85801',jdecode('Seed+Paper'),jdecode(''),'/85801.html','true',[],'',''],
	['PAGE','48701',jdecode('Wholesale+Cards'),jdecode(''),'/48701.html','true',[],'',''],
	['PAGE','74201',jdecode('Gift+Card+Stockists'),jdecode(''),'/74201.html','true',[],'',''],
	['PAGE','58301',jdecode('Memorial+Cards'),jdecode(''),'/58301.html','true',[],'',''],
	['PAGE','15432',jdecode('Die-Cut+Shapes'),jdecode(''),'/15432.html','true',[],'',''],
	['PAGE','15348',jdecode('Gift+Tags'),jdecode(''),'/15348.html','true',[],'',''],
	['PAGE','78301',jdecode('Flower+Card'),jdecode(''),'/78301.html','true',[],'',''],
	['PAGE','15201',jdecode('Weddings'),jdecode(''),'/15201/index.html','true',[ 
		['PAGE','30601',jdecode('Flat+Cards'),jdecode(''),'/15201/30601.html','false',[],'',''],
		['PAGE','17501',jdecode('Favour+Cards'),jdecode(''),'/15201/17501.html','true',[],'',''],
		['PAGE','15285',jdecode('Place+Setting+Cards'),jdecode(''),'/15201/15285.html','true',[],'',''],
		['PAGE','25701',jdecode('Fonts+%26+Messages'),jdecode(''),'/15201/25701.html','false',[],'','']
	],'',''],
	['PAGE','15411',jdecode('Promotional+Ideas'),jdecode(''),'/15411.html','true',[],'',''],
	['PAGE','15453',jdecode('Q+%26+A'),jdecode(''),'/15453.html','true',[],'',''],
	['PAGE','62501',jdecode('Artists'),jdecode(''),'/62501.html','false',[],'',''],
	['PAGE','15558',jdecode('About+Us'),jdecode(''),'/15558.html','true',[],'',''],
	['PAGE','15579',jdecode('Contact+Us'),jdecode(''),'/15579.html','true',[],'',''],
	['PAGE','15600',jdecode('Folklore'),jdecode(''),'/15600.html','true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='479949';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10555';
theSitetree.graphicsetId='10895';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Alpha',
				paletteFamily: 	'479949',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10555',
				graphicsetId: 	'10895',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'479949',
				e_color: 		'479949',
				f_color: 		'479949',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100425-153035'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58301',
internalId:  '',
customField: '20081125-014807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2801',
internalId:  '',
customField: '20090223-034644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22801',
internalId:  '',
customField: '20081125-015641'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48701',
internalId:  '',
customField: '20090223-034744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74201',
internalId:  '',
customField: '20090223-035039'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15432',
internalId:  '',
customField: '20081125-015022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78301',
internalId:  '',
customField: '20081007-062456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15201',
internalId:  '',
customField: '20090223-035358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17501',
internalId:  '',
customField: '20080407-171750'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15285',
internalId:  '',
customField: '20090223-035854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25722',
internalId:  '',
customField: '20080408-174946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62501',
internalId:  '',
customField: '20081125-011922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15348',
internalId:  '',
customField: '20081007-063226'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30601',
internalId:  '',
customField: '20080130-013249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25701',
internalId:  '',
customField: '20070930-031235'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15411',
internalId:  '',
customField: '20080804-221215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15453',
internalId:  '',
customField: '20080408-181855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15558',
internalId:  '',
customField: '20080408-182046'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15579',
internalId:  '',
customField: '20081125-015726'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15600',
internalId:  '',
customField: '20070915-010241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85801',
internalId:  '',
customField: '20100425-153928'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN3VPI';
var companyName   = '';
var htmlTitle	  = 'Bloomin+Paper';
var metaKeywords  = 'HTML++HEAD++TITLEBlooming+Paper%2FTITLE++META+NAME%3DKeywords+CONTENT%3Dplantable%2C+seeded+paper%2C+New+Zealand%2C+plant+me%2C+wedding+favours%2C+greeting+cards%2C+book+marks%2C+memorial+cards%2C+promotions%2C+marketing%2C+wildflowers%2C+bloom+year+after+year%2C+recycleable%2C+green%2C+unique%2C+personalised%2C+flowers++META+NAME%3DDescription+CONTENT%3DPlantable+seeded+paper+for+wedding+favours%2C+promotions+and+marketing%2C+that+grows+into+wildflowers+year+after+year.+Unique+for+New+Zealand.+Can+be+personalised.++META+NAME%3DAuthor+CONTENT%3Dsandy%40bloominpaper.co.nz++%21--+META+Tags+generated+by+http%3A%2F%2Fsubmitexpress.com%2Fmetatag.html+--++%2FHEAD++';
var metaContents  = 'HTML++HEAD++TITLEBlooming+Paper%2FTITLE++META+NAME%3DKeywords+CONTENT%3Dplantable%2C+seeded+paper%2C+New+Zealand%2C+plant+me%2C+wedding+favours%2C+greeting+cards%2C+book+marks%2C+memorial+cards%2C+promotions%2C+marketing%2C+wildflowers%2C+bloom+year+after+year%2C+recycleable%2C+green%2C+unique%2C+personalised%2C+flowers++META+NAME%3DDescription+CONTENT%3DPlantable+seeded+paper+for+wedding+favours%2C+promotions+and+marketing%2C+that+grows+into+wildflowers+year+after+year.+Unique+for+New+Zealand.+Can+be+personalised.++META+NAME%3DAuthor+CONTENT%3Dsandy%40bloominpaper.co.nz++%21--+META+Tags+generated+by+http%3A%2F%2Fsubmitexpress.com%2Fmetatag.html+--++%2FHEAD++';
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();
};
