/* [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','5601',jdecode('Home'),jdecode(''),'/5601.html','true',[],''],
	['PAGE','5652',jdecode('Artist'),jdecode(''),'/5652.html','true',[],''],
	['PAGE','5673',jdecode('Contact'),jdecode(''),'/5673.html','true',[],''],
	['PAGE','19149',jdecode('Gallery+1+-+Paintings'),jdecode(''),'/19149.html','true',[],''],
	['PAGE','17807',jdecode('Gallery+2+-+Photography'),jdecode(''),'/17807.html','true',[],''],
	['PAGE','17828',jdecode('Gallery+3+-+Of+Flowers+And+such'),jdecode(''),'/17828.html','true',[],''],
	['PAGE','17849',jdecode('Gallery+4+-+A+Tale+Of+A+Tree'),jdecode(''),'/17849.html','true',[],''],
	['PAGE','17870',jdecode('Gallery+5+-+Digital+Effects'),jdecode(''),'/17870.html','true',[],''],
	['PAGE','27489',jdecode('Gallery+6+-+Digital+Effects+II'),jdecode(''),'/27489.html','true',[],''],
	['PAGE','28717',jdecode('Gallery+7+-+Misc'),jdecode(''),'/28717.html','true',[],''],
	['PAGE','31245',jdecode('Erotic'),jdecode(''),'/31245.html','true',[],''],
	['PAGE','13125',jdecode('My+Guestbook'),jdecode(''),'/13125.html','true',[],''],
	['PAGE','13225',jdecode('Email+Me'),jdecode(''),'/13225.html','true',[],'']];
var siteelementCount=13;
theSitetree.topTemplateName='Delta';
theSitetree.paletteFamily='453102';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10440';
theSitetree.graphicsetId='10812';
theSitetree.contentColor='FF0000';
theSitetree.contentBGColor='453102';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Delta',
				paletteFamily: 	'453102',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10440',
				graphicsetId: 	'10812',
				contentColor: 	'FF0000',
				contentBGColor: '453102',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'856417',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20081031-183602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5652',
internalId:  '',
customField: '20081031-183733'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5673',
internalId:  '',
customField: '20081027-123639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31245',
internalId:  '',
customField: '20081027-125542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17828',
internalId:  '',
customField: '20081031-184216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17807',
internalId:  '',
customField: '20081104-163150'
};
webappMappings['7060']=webappMappings['7060-b8ffad301b3fe9441ace912d452b453f']={
webappId:    '7060',
documentId:  '31245',
internalId:  'b8ffad301b3fe9441ace912d452b453f',
customField: 'language:en;country:US;'
};
webappMappings['1002']=webappMappings['1002-13125aendu0ineqbb']={
webappId:    '1002',
documentId:  '13125',
internalId:  '13125aendu0ineqbb',
customField: 'icq=false'
};
webappMappings['7008']=webappMappings['7008-9802']={
webappId:    '7008',
documentId:  '13225',
internalId:  '9802',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28717',
internalId:  '',
customField: '20081027-140047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13125',
internalId:  '',
customField: '20081021-164807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13225',
internalId:  '',
customField: '20081027-124033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19149',
internalId:  '',
customField: '20090425-143955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27489',
internalId:  '',
customField: '20081031-184544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17849',
internalId:  '',
customField: '20081026-135556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17870',
internalId:  '',
customField: '20081027-133528'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INEQBB';
var companyName   = 'Tabstract+Studio';
var htmlTitle	  = 'Tabstract+Studio';
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();
};
