/* [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','601',jdecode('home'),jdecode(''), jdecode('%2F601.html'), 'true',[],'',''],
	['PAGE','148352',jdecode('the+jimmy+pickering+store'),jdecode(''), jdecode('%2F148352.html'), 'true',[],'',''],
	['PAGE','130101',jdecode('blog'),jdecode(''), jdecode('%2F130101.html'), 'true',[],'',''],
	['PAGE','146380',jdecode('art'),jdecode(''), jdecode('%2F146380%2Findex.html'), 'true',[ 
		['PAGE','1222',jdecode('gallery+01'),jdecode(''), jdecode('%2F146380%2F1222.html'), 'true',[],'',''],
		['PAGE','1243',jdecode('gallery+02'),jdecode(''), jdecode('%2F146380%2F1243.html'), 'true',[],'',''],
		['PAGE','19201',jdecode('gallery+03'),jdecode(''), jdecode('%2F146380%2F19201.html'), 'true',[],'',''],
		['PAGE','110601',jdecode('gallery+04'),jdecode(''), jdecode('%2F146380%2F110601.html'), 'true',[],'','']
	],'',''],
	['PAGE','146390',jdecode('black+%26+white+art'),jdecode(''), jdecode('%2F146390%2Findex.html'), 'true',[ 
		['PAGE','1264',jdecode('gallery-01'),jdecode(''), jdecode('%2F146390%2F1264.html'), 'true',[],'','']
	],'',''],
	['PAGE','146401',jdecode('dimensional+art'),jdecode(''), jdecode('%2F146401%2Findex.html'), 'true',[ 
		['PAGE','144848',jdecode('gallery-01'),jdecode(''), jdecode('%2F146401%2F144848.html'), 'true',[],'','']
	],'',''],
	['PAGE','146410',jdecode('digital+art'),jdecode(''), jdecode('%2F146410%2Findex.html'), 'true',[ 
		['PAGE','27601',jdecode('gallery-01'),jdecode(''), jdecode('%2F146410%2F27601.html'), 'true',[],'','']
	],'',''],
	['PAGE','149505',jdecode('180%C2%BA+Delirium+Gallery'),jdecode(''), jdecode('%2F149505.html'), 'true',[],'',''],
	['PAGE','1201',jdecode('upcoming+events'),jdecode(''), jdecode('%2F1201.html'), 'true',[],'',''],
	['PAGE','146443',jdecode('about+me'),jdecode(''), jdecode('%2F146443%2Findex.html'), 'true',[ 
		['PAGE','15001',jdecode('blah%2C+blah+.+.+.+blah'),jdecode(''), jdecode('%2F146443%2F15001.html'), 'true',[],'',''],
		['PAGE','146422',jdecode('publishing+credits'),jdecode(''), jdecode('%2F146443%2F146422.html'), 'true',[],'','']
	],'',''],
	['PAGE','1285',jdecode('books'),jdecode(''), jdecode('%2F1285.html'), 'true',[],'',''],
	['PAGE','144857',jdecode('from+u'),jdecode(''), jdecode('%2F144857.html'), 'true',[],'',''],
	['PAGE','148599',jdecode('mailing+list'),jdecode(''), jdecode('%2F148599.html'), 'true',[],'',''],
	['PAGE','21206',jdecode('the+guestbook'),jdecode(''), jdecode('%2F21206.html'), 'true',[],'',''],
	['PAGE','1327',jdecode('make+contact'),jdecode(''), jdecode('%2F1327.html'), 'true',[],'','']];
var siteelementCount=24;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='555454';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10555';
theSitetree.graphicsetId='10892';
theSitetree.contentColor='555454';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'valueweb',
  product: 'WSCSYSSSSLYTCR7V'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Alpha',
				paletteFamily: 	'555454',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10555',
				graphicsetId: 	'10892',
				contentColor: 	'555454',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'555454',
				e_color: 		'555454',
				f_color: 		'555454',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '148352',
internalId:  '',
customField: '20111101-184043'
};
webappMappings['1002']=webappMappings['1002-21206AHW050IN2H36']={
webappId:    '1002',
documentId:  '21206',
internalId:  '21206AHW050IN2H36',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20111101-185400'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '130101',
internalId:  '',
customField: '20111101-183940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1201',
internalId:  '',
customField: '20110916-125742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15001',
internalId:  '',
customField: '20110916-124418'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '144848',
internalId:  '',
customField: '20110112-182731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '144857',
internalId:  '',
customField: '20110112-191247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1222',
internalId:  '',
customField: '20110112-184928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1243',
internalId:  '',
customField: '20111015-122244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19201',
internalId:  '',
customField: '20110112-185301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110601',
internalId:  '',
customField: '20110112-185530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1264',
internalId:  '',
customField: '20110112-185754'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27601',
internalId:  '',
customField: '20110112-190038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1285',
internalId:  '',
customField: '20110112-190907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21206',
internalId:  '',
customField: '20110112-191403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1327',
internalId:  '',
customField: '20110112-203258'
};
webappMappings['7008']=webappMappings['7008-9782']={
webappId:    '7008',
documentId:  '148599',
internalId:  '9782',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '146380',
internalId:  '',
customField: '20110112-184749'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '146390',
internalId:  '',
customField: '20110112-185645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '146401',
internalId:  '',
customField: '20110112-181814'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '146410',
internalId:  '',
customField: '20110112-185855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '146422',
internalId:  '',
customField: '20110112-184602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '146443',
internalId:  '',
customField: '20110112-184258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '148599',
internalId:  '',
customField: '20110112-184038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '149505',
internalId:  '',
customField: '20111021-022452'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050IN2H36';
var companyName   = '';
var htmlTitle	  = 'www.jimmypickering.com';
var metaKeywords  = 'jimmy+pickering%2C+low+brow%2C+art%2C+painting%2C+childrens+book%2C+illustration%2C+low+brow%2C+pop+surrealism%2C+author%2C+illustrator%2C+designer%2C+theme+park%2C+Jimmy+Pickering%2C+the+disney+gallery%2C+walt+disney+imagineering%2C+imagineer%2C+the+disney+gallery%2C+cal-arts%2C+california+institute+of+the+arts%2C+wdi%2C+skelly%2C+skelly+the+skeleton+girl%2C+disneyland%2C+disney%2C+gay+artist%2C+gay+author%2C+yummy+wine+bar++bistro%2C+skelly++femur%2C+skelly+and+femur%2C+the+jimmy+pickering+store%2C+artist%2C+universal+studios%2C+universal+creative%2C+jimmy%2C+pickering';
var metaContents  = 'jimmy+pickering%2C+low+brow%2C+art%2C+painting%2C+childrens+book%2C+illustration%2C+low+brow%2C+pop+surrealism%2C+author%2C+illustrator%2C+designer%2C+theme+park%2C+Jimmy+Pickering%2C+the+disney+gallery%2C+walt+disney+imagineering%2C+imagineer%2C+the+disney+gallery%2C+cal-arts%2C+california+institute+of+the+arts%2C+wdi%2C+skelly%2C+skelly+the+skeleton+girl%2C+disneyland%2C+disney%2C+sugar%2C+yummy+wine+bar++bistro%2C+skelly++femur%2C+skelly+and+femur%2C+artist%2C+universal+studios%2C+universal+creative%2C+jimmy%2C+pickering%2C+the+jimmy+pickering+store+';
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();
};

