/* [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','77001',jdecode('Home'),jdecode(''),'/77001.html','true',[],'',''],
	['PAGE','82522',jdecode('Some+Pics+of+Us+Toons'),jdecode(''),'/82522.html','true',[],'',''],
	['PAGE','104401',jdecode('Graphite+Mist+Escapees'),jdecode(''),'/104401.html','true',[],'',''],
	['PAGE','122501',jdecode('Is+Bee+a+Bee%3F'),jdecode(''),'/122501.html','true',[],'',''],
	['PAGE','82543',jdecode('Contact+Us'),jdecode(''),'/82543.html','true',[],'',''],
	['PAGE','132601',jdecode('Bee%26%23x27%3Bs+Blog'),jdecode(''),'/132601.html','true',[],'',''],
	['ITEM','141212',jdecode('All+in+a+Twitter'),jdecode(''),'http://twitter.com/kiwiartoonist','true',[],'','_blank'],
	['ITEM','141213',jdecode('Blogger+me+Blogspot'),jdecode(''),'http://kiwiartoonist.blogspot.com/','true',[],'','_blank']];
var siteelementCount=8;
theSitetree.topTemplateName='Brush';
theSitetree.paletteFamily='E45858';
theSitetree.keyvisualId='11942';
theSitetree.keyvisualName='kv_11942.jpg';
theSitetree.fontsetId='33211';
theSitetree.graphicsetId='14100';
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: 			'Brush',
				paletteFamily: 	'E45858',
				keyvisualId: 	'11942',
				keyvisualName: 	'kv_11942.jpg',
				fontsetId: 		'33211',
				graphicsetId: 	'14100',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '77001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104401',
internalId:  '',
customField: '20100726-015545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82522',
internalId:  '',
customField: '20100519-215619'
};
webappMappings['7008']=webappMappings['7008-14077']={
webappId:    '7008',
documentId:  '82543',
internalId:  '14077',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82543',
internalId:  '',
customField: '20100608-012321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77001',
internalId:  '',
customField: '20100720-160646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '122501',
internalId:  '',
customField: '20100519-004204'
};
webappMappings['7050']=webappMappings['7050-1544']={
webappId:    '7050',
documentId:  '132601',
internalId:  '1544',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '132601',
internalId:  '',
customField: '20100619-192536'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INH51Z';
var companyName   = 'Bee+Mackey+-+Humorous+Illustrator';
var htmlTitle	  = 'Bee+Mackey+-+Humorous+Illustrator%2C+Kiwiartoonist';
var metaKeywords  = 'humorous+illustrator%2Ccartoonist%2Cillustrator%2Cvisual+communications%2C+bee+mackey%2Ckiwiartoonist%2C+promotional+illustration%2C+0T+Bee+Studio%2C+ot+bee+studio%2C+OT+Bee+studio%2C+funny+pictures%2C+laughter%2C+gag+cartoons%2C+childrens+pictures%2C+fun+pictures%2C+naughty+cartoons%2C+politically+incorrect+cartoons%2C+greeting+cards%2C+animal+cartoons%2C+zoo+cartoons%2C+party+cartoons%2C+newspaper+cartoons%2C+artist%2C+fish+cartoons%2C+best+cartoonist+in+the+world%2C+quirky+cartoons%2C+funny+cartoons%2C+looking+for+a++cartoonist%2C+need+a+cartoonist%2C+humorous+illustrator%2C+illustrator%2C+warm+fuzzy+cartoons%2C+warm+fuzzy+art%2C+cartoon+greeting+cards%2C+design+cartoons%2C+who+designs+cartoons%2C+cartoons+to+make+you+laugh%2C+cartoons+to+make+you+smile%2C+happy+cartoons%2C+fun+cartoons%2C+sunny+cartoons%2C+business+cartoons%2C+find+me+someone+who+can+draw%2C+Christmas+cartoons%2C+birthday+cartoons%2C+anniversary+cartoons%2C+cartoons+for+posters%2C+cartoons+on+canvas%2C+cartoons+on+wallpaper%2C+Cartoons+for+childrens+walls%2C+humorous+art%2C+happy+pictures%2C+funny+pictures%2C+fun+pictures%2C+cartoon+art%2C+humorous+illustrations%2C+funny+pictures%2C+art+to+make%2C+you+laugh%2C+Cartoon%2C+greeting%2C+card%2C+cartoon%2C+fairies%2C+humorous%2C+art%2C+humorous%2C+illustrations%2C+cartoon%2C+animals%2C+horse%2C+cartoons%2C+dog%2C+cartoons%2C+engaged%2C+cartoons%2C+funny%2C+greeting%2C+cards%2C+cartoonist%2C+illustrator%2C+New+Zealand+cartoonist%2C+bees%2C+cartoons%2C+illustrations%2C+Humorous+art%2C+Childrens+wall+art%2C+Childrens+artist%2C+business+cartoons%2C+cartoons+by+request%2C+children%E2%80%99s+book+illustrations%2C+humorous+wedding+invitations%2C+humorous+invitations%2C+humorous+illustrator+to+design+invitations%2C+cartoonist+to+design+invitations%2C+illustrator+to+design+invitations%2C+humorous+illustrator+to+design+logo%2C+cartoonist+art%2C+I+need+an+illustrator%2C+mackey+cartoons%2C+bee+cartoons%2C';
var metaContents  = 'Humorous+Illustrator+-+Illustrations+professionally+built+to+your+plans+and+specifications+for+business+or+personal.+There%27s+no+need+to+apply+for+building+or+resource+consents.+The+only+inspections+required+are+yours%21+It+will+be+a+color+blast+that+spreads+a+hugging+big+smile+across+your+glaxay%21';
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();
};
