/* [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 theSitetree=[ 
	['PAGE','3801',jdecode('Home'),jdecode(''),'/3801.html','true',[],''],
	['PAGE','3901',jdecode('Caricatures'),jdecode(''),'/3901/index.html','true',[ 
		['PAGE','3922',jdecode('Regular+Size+Caricatures'),jdecode(''),'/3901/3922.html','true',[],''],
		['PAGE','23901',jdecode('Regular+Size+Caricatures+Page+2'),jdecode(''),'/3901/23901.html','false',[],''],
		['PAGE','13701',jdecode('Caricatures+w%2FPictures'),jdecode(''),'/3901/13701.html','true',[],''],
		['PAGE','23922',jdecode('Caricatures+w%2FPictures+Page+2'),jdecode(''),'/3901/23922.html','false',[],''],
		['PAGE','3943',jdecode('Mini+Caricatures'),jdecode(''),'/3901/3943.html','true',[],''],
		['PAGE','3964',jdecode('Caricatures+on+Tees'),jdecode(''),'/3901/3964.html','true',[],''],
		['PAGE','4801',jdecode('Pet+Portraits'),jdecode(''),'/3901/4801.html','true',[],'']
	],''],
	['PAGE','3985',jdecode('Air+Brush+Art'),jdecode(''),'/3985/index.html','true',[ 
		['PAGE','4006',jdecode('Airbrush+on+Tees'),jdecode(''),'/3985/4006.html','true',[],''],
		['PAGE','4027',jdecode('Airbrush+on+Hats'),jdecode(''),'/3985/4027.html','true',[],'']
	],''],
	['PAGE','7201',jdecode('Kids+Parties'),jdecode(''),'/7201.html','true',[],''],
	['PAGE','4822',jdecode('Celebrity+Impersonators'),jdecode(''),'/4822.html','true',[],''],
	['PAGE','4048',jdecode('Psychics%7CFortune+Tellers'),jdecode(''),'/4048.html','true',[],''],
	['PAGE','22601',jdecode('Storyboards'),jdecode(''),'/22601.html','true',[],''],
	['PAGE','5301',jdecode('About+Us'),jdecode(''),'/5301.html','true',[],''],
	['PAGE','5322',jdecode('Blog'),jdecode(''),'/5322.html','true',[],'']];
var siteelementCount=18;
theSitetree.topTemplateName='Comic';
theSitetree.paletteFamily='1B4082';
theSitetree.keyvisualId='9983';
theSitetree.keyvisualName='kv2.swf';
theSitetree.fontsetId='17761';
theSitetree.graphicsetId='13129';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Comic',
				paletteFamily: 	'1B4082',
				keyvisualId: 	'9983',
				keyvisualName: 	'kv2.swf',
				fontsetId: 		'17761',
				graphicsetId: 	'13129',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3801',
internalId:  '',
customField: '20090930-113812'
};
webappMappings['7050']=webappMappings['7050-12383']={
webappId:    '7050',
documentId:  '5322',
internalId:  '12383',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3901',
internalId:  '',
customField: '20091004-223845'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3922',
internalId:  '',
customField: '20091112-135823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3943',
internalId:  '',
customField: '20091004-222942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3964',
internalId:  '',
customField: '20091004-205707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4801',
internalId:  '',
customField: '20091004-221148'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3985',
internalId:  '',
customField: '20091005-104440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4006',
internalId:  '',
customField: '20091004-231237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4027',
internalId:  '',
customField: '20091004-232131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7201',
internalId:  '',
customField: '20091005-121055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4822',
internalId:  '',
customField: '20091005-121131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4048',
internalId:  '',
customField: '20091005-122403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5301',
internalId:  '',
customField: '20091112-114616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5322',
internalId:  '',
customField: '20091005-123117'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13701',
internalId:  '',
customField: '20091112-141827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22601',
internalId:  '',
customField: '20091008-102826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23901',
internalId:  '',
customField: '20091112-135252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23922',
internalId:  '',
customField: '20091112-141656'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INV02Y';
var companyName   = 'Allana+Enterprises';
var htmlTitle	  = '';
var metaKeywords  = '';
var metaContents  = '';
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();
};
