/* [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','5501',jdecode('Home'),jdecode(''),'/5501.html','true',[],'',''],
	['PAGE','25401',jdecode('Artists'),jdecode(''),'/25401/index.html','true',[ 
		['PAGE','25422',jdecode('Scott+Small'),jdecode(''),'/25401/25422.html','true',[],'',''],
		['PAGE','26101',jdecode('Shaun+Holiday'),jdecode(''),'/25401/26101.html','true',[],'',''],
		['PAGE','28201',jdecode('Rory+Mitchell'),jdecode(''),'/25401/28201.html','true',[],'',''],
		['PAGE','28222',jdecode('Psycho+Keaton'),jdecode(''),'/25401/28222.html','true',[],'',''],
		['PAGE','28243',jdecode('Dean+DeNielsen'),jdecode(''),'/25401/28243.html','true',[],'',''],
		['PAGE','53001',jdecode('VIRGO'),jdecode(''),'/25401/53001.html','true',[],'',''],
		['PAGE','53022',jdecode('Jason+Van+Wyk'),jdecode(''),'/25401/53022.html','true',[],'',''],
		['PAGE','53043',jdecode('Daniel+Loubscher'),jdecode(''),'/25401/53043.html','true',[],'','']
	],'',''],
	['PAGE','5552',jdecode('Come+Down+Monday'),jdecode(''),'/5552/index.html','true',[ 
		['PAGE','27701',jdecode('CDM+Track+Listings'),jdecode(''),'/5552/27701.html','true',[],'',''],
		['PAGE','52301',jdecode('CDM+Show+Links'),jdecode(''),'/5552/52301.html','true',[],'','']
	],'',''],
	['PAGE','27601',jdecode('%26%23x27%3BHALO%26%23x27%3B'),jdecode(''),'/27601/index.html','true',[ 
		['PAGE','32001',jdecode('HALO+Flyer+Archive'),jdecode(''),'/27601/32001.html','true',[],'','']
	],'',''],
	['PAGE','62401',jdecode('Featured+Events'),jdecode(''),'/62401.html','true',[],'',''],
	['PAGE','8801',jdecode('Forum'),jdecode(''),'/8801.html','true',[],'',''],
	['PAGE','52901',jdecode('Blog'),jdecode(''),'/52901.html','true',[],'',''],
	['PAGE','37501',jdecode('Media'),jdecode(''),'/37501.html','true',[],'',''],
	['PAGE','21501',jdecode('Guest+Book'),jdecode(''),'/21501.html','true',[],'',''],
	['PAGE','7001',jdecode('Contact'),jdecode(''),'/7001.html','true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Circulation';
theSitetree.paletteFamily='FC2323';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10381';
theSitetree.graphicsetId='10561';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Circulation',
				paletteFamily: 	'FC2323',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10381',
				graphicsetId: 	'10561',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5501',
internalId:  '',
customField: '20090914-130649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5552',
internalId:  '',
customField: '20100412-090147'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7001',
internalId:  '',
customField: '20100315-090250'
};
webappMappings['1003']=webappMappings['1003-ahtz10inxhj311f83df92a6']={
webappId:    '1003',
documentId:  '8801',
internalId:  'ahtz10inxhj311f83df92a6',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8801',
internalId:  '',
customField: '20090310-144943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53001',
internalId:  '',
customField: '20100202-140806'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32001',
internalId:  '',
customField: '20100308-114300'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28222',
internalId:  '',
customField: '20090821-153745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28243',
internalId:  '',
customField: '20090821-153622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25401',
internalId:  '',
customField: '20090623-093315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25422',
internalId:  '',
customField: '20091222-141959'
};
webappMappings['7060']=webappMappings['7060-b508e674a13d37706b730337714c6a9c']={
webappId:    '7060',
documentId:  '37501',
internalId:  'b508e674a13d37706b730337714c6a9c',
customField: 'language:en;country:US;'
};
webappMappings['1002']=webappMappings['1002-21501ahtz10inxhj3']={
webappId:    '1002',
documentId:  '21501',
internalId:  '21501ahtz10inxhj3',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21501',
internalId:  '',
customField: '20090310-145952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26101',
internalId:  '',
customField: '20090630-081939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27601',
internalId:  '',
customField: '20100412-091012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27701',
internalId:  '',
customField: '20100412-090305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28201',
internalId:  '',
customField: '20090811-160352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37501',
internalId:  '',
customField: '20091209-134207'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52301',
internalId:  '',
customField: '20100412-090409'
};
webappMappings['7050']=webappMappings['7050-372']={
webappId:    '7050',
documentId:  '52901',
internalId:  '372',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53022',
internalId:  '',
customField: '20100202-140806'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53043',
internalId:  '',
customField: '20100202-140806'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52901',
internalId:  '',
customField: '20100202-142142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62401',
internalId:  '',
customField: '20100412-092614'
};
var canonHostname = 'sitebuilder1.jnb2.host-h.net';
var accountId     = 'AHTZ10INXHJ3';
var companyName   = 'Mixed-Up+Productions';
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();
};
