/* [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','22',jdecode('HOME'),jdecode(''),'/22.html','true',[],'',''],
	['PAGE','4185',jdecode('RESUME'),jdecode(''),'/4185.html','true',[],'',''],
	['PAGE','8038',jdecode('MY+PICTURES'),jdecode(''),'/8038.html','true',[],'',''],
	['PAGE','1062',jdecode('MY+REELS'),jdecode(''),'/1062.html','true',[],'',''],
	['PAGE','1071',jdecode('CONTACT'),jdecode(''),'/1071.html','true',[],'',''],
	['PAGE','1044',jdecode('NEWS'),jdecode(''),'/1044.html','true',[],'',''],
	['PAGE','4390',jdecode('BIOGRAPHY'),jdecode(''),'/4390.html','true',[],'',''],
	['PAGE','8192',jdecode('MY+FAMILY'),jdecode(''),'/8192.html','false',[],'',''],
	['PAGE','1998',jdecode('GUESTBOOK'),jdecode(''),'/1998/index.html','false',[ 
		['PAGE','1997',jdecode('Read+Guestbook'),jdecode(''),'/1998/1997.html','false',[],'','']
	],'',''],
	['PAGE','2753',jdecode('%22Deployment+Strategy%22photos'),jdecode(''),'/2753.html','true',[],'',''],
	['PAGE','3473',jdecode('%22Taylor+Made%22+photos'),jdecode(''),'/3473.html','true',[],'',''],
	['PAGE','3482',jdecode('%22Touching%22+photos'),jdecode(''),'/3482.html','true',[],'',''],
	['PAGE','2147',jdecode('%22Devil%26%23x27%3Bs+Detail%22+photos'),jdecode(''),'/2147.html','true',[],'',''],
	['PAGE','2315',jdecode('%22Wooden+Bucket%22+photos'),jdecode(''),'/2315.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Tide';
theSitetree.paletteFamily='B8B8B9';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='13619';
theSitetree.graphicsetId='12071';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Tide',
				paletteFamily: 	'B8B8B9',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'13619',
				graphicsetId: 	'12071',
				contentColor: 	'FFFFFF',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-1998AHW050IN37WQ']={
webappId:    '1002',
documentId:  '1998',
internalId:  '1998AHW050IN37WQ',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '22',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-fc9e8b6fac02be2190638a2799e7a40a']={
webappId:    '7060',
documentId:  '2315',
internalId:  'fc9e8b6fac02be2190638a2799e7a40a',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-11ee9f3c575f731fa096b7b905650546']={
webappId:    '7060',
documentId:  '2147',
internalId:  '11ee9f3c575f731fa096b7b905650546',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-240b34b8d06f50202b41a46fb57b1f98']={
webappId:    '7060',
documentId:  '2753',
internalId:  '240b34b8d06f50202b41a46fb57b1f98',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-06a7475e402a5bed85ef29d9493937ba']={
webappId:    '7060',
documentId:  '8038',
internalId:  '06a7475e402a5bed85ef29d9493937ba',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-fc43ef134adce8f255bb8dcb4d562d20']={
webappId:    '7060',
documentId:  '8192',
internalId:  'fc43ef134adce8f255bb8dcb4d562d20',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22',
internalId:  '',
customField: '20110111-144019'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4185',
internalId:  '',
customField: '20110111-155827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8038',
internalId:  '',
customField: '20071015-161556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1062',
internalId:  '',
customField: '20110111-161423'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1071',
internalId:  '',
customField: '20110111-151853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1044',
internalId:  '',
customField: '20110111-151944'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4390',
internalId:  '',
customField: '20110111-162111'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8192',
internalId:  '',
customField: '20071017-124819'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1998',
internalId:  '',
customField: '20080329-190225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1997',
internalId:  '',
customField: '20060604-164337'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2753',
internalId:  '',
customField: '20061005-203650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3473',
internalId:  '',
customField: '20070128-021956'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3482',
internalId:  '',
customField: '20070128-023035'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2147',
internalId:  '',
customField: '20070930-184122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2315',
internalId:  '',
customField: '20060604-174036'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050IN37WQ';
var companyName   = 'DAMON+STONE++SAG';
var htmlTitle	  = 'www.DamonStone.com';
var metaKeywords  = 'Damon+Stone%2C+Damon%2C+Stone%2C+DMITRY%2CPOMIRCHY%2CACTOR%2CDANCER%2CTEENAGE+ACTOR%2CTEENAGER%2C+YOUNG+ACTOR%2CKID+ACTOR%2Cteen+actor%2C+Dmitry+Pomirchy%2C+DMITRY+POMIRCHY%2C+actor%2C+reelact.com%2C+imdb.com%2C+www.imdb.com%2Fname%2Fnm1998480%2F++%2C+www.markcheng.com%2C+dmitry+pomirchy';
var metaContents  = 'This+is+an+Official+website+of+a+young+actor+and+dancer+Damon+Stone.';
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();
};

