/* [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','1001',jdecode('Home'),jdecode(''), jdecode('%2F1001.html'), 'true',[],'',''],
	['PAGE','1052',jdecode('About+J.+Sean'),jdecode(''), jdecode('%2F1052.html'), 'true',[],'',''],
	['PAGE','40101',jdecode('Promo%2FBookings'),jdecode(''), jdecode('%2F40101.html'), 'true',[],'',''],
	['PAGE','1073',jdecode('News'),jdecode(''), jdecode('%2F1073.html'), 'true',[],'',''],
	['PAGE','29701',jdecode('Press'),jdecode(''), jdecode('%2F29701.html'), 'false',[],'',''],
	['PAGE','1094',jdecode('Splashy+Events'),jdecode(''), jdecode('%2F1094.html'), 'true',[],'',''],
	['PAGE','1115',jdecode('Listen'),jdecode(''), jdecode('%2F1115.html'), 'true',[],'',''],
	['PAGE','35201',jdecode('Videos'),jdecode(''), jdecode('%2F35201.html'), 'true',[],'',''],
	['PAGE','1136',jdecode('Purchase'),jdecode(''), jdecode('%2F1136%2Findex.html'), 'true',[ 
		['PAGE','8201',jdecode('At+Least+I%26%23x27%3Bve+Got+My+Looks'),jdecode(''), jdecode('%2F1136%2F8201.html'), 'true',[],'',''],
		['PAGE','1157',jdecode('No+Name+Canadian+Stars'),jdecode(''), jdecode('%2F1136%2F1157.html'), 'true',[],'','']
	],'',''],
	['PAGE','1178',jdecode('Photographs'),jdecode(''), jdecode('%2F1178%2Findex.html'), 'true',[ 
		['PAGE','16601',jdecode('At+Least+I%26%23x27%3Bve+Got+My+Looks'),jdecode(''), jdecode('%2F1178%2F16601.html'), 'true',[],'',''],
		['PAGE','38201',jdecode('In+Performance'),jdecode(''), jdecode('%2F1178%2F38201.html'), 'true',[],'',''],
		['PAGE','43001',jdecode('Six+Dance+Lessons+in+Six+Weeks'),jdecode(''), jdecode('%2F1178%2F43001.html'), 'true',[],'','']
	],'',''],
	['PAGE','1199',jdecode('Links'),jdecode(''), jdecode('%2F1199.html'), 'true',[],'',''],
	['PAGE','1220',jdecode('Contact'),jdecode(''), jdecode('%2F1220.html'), 'true',[],'',''],
	['PAGE','8601',jdecode('Agent'),jdecode(''), jdecode('%2F8601.html'), 'true',[],'',''],
	['PAGE','17006',jdecode('Guestbook'),jdecode(''), jdecode('%2F17006%2Findex.html'), 'true',[ 
		['PAGE','17001',jdecode('Read+Guestbook'),jdecode(''), jdecode('%2F17006%2F17001.html'), 'false',[],'','']
	],'',''],
	['PAGE','21101',jdecode('Map'),jdecode(''), jdecode('%2F21101.html'), 'true',[],'',''],
	['PAGE','32101',jdecode('Joseph+Tarran'),jdecode(''), jdecode('%2F32101.html'), 'true',[],'',''],
	['PAGE','43601',jdecode('Tracey+the+Musical'),jdecode(''), jdecode('%2F43601.html'), 'true',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='cutout';
theSitetree.paletteFamily='F0F1D8';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10611';
theSitetree.graphicsetId='10473';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'brinkster',
  product: 'WSCSYSSSSLYTCVUO'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'cutout',
				paletteFamily: 	'F0F1D8',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10611',
				graphicsetId: 	'10473',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1001',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-31be8948d3256aab9b8f7fdaac859f40']={
webappId:    '7060',
documentId:  '16601',
internalId:  '31be8948d3256aab9b8f7fdaac859f40',
customField: 'language:en;country:US;'
};
webappMappings['1002']=webappMappings['1002-17006abri10invbk8']={
webappId:    '1002',
documentId:  '17006',
internalId:  '17006abri10invbk8',
customField: 'icq=false'
};
webappMappings['1501']=webappMappings['1501-11410361']={
webappId:    '1501',
documentId:  '1001',
internalId:  '11410361',
customField: '1501'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '21101',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1001',
internalId:  '',
customField: '20120116-210242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1115',
internalId:  '',
customField: '20110222-173808'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1136',
internalId:  '',
customField: '20081026-134703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1157',
internalId:  '',
customField: '20081229-233300'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8201',
internalId:  '',
customField: '20081026-135816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1052',
internalId:  '',
customField: '20080924-205138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1073',
internalId:  '',
customField: '20100717-144919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1094',
internalId:  '',
customField: '20110919-120255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1178',
internalId:  '',
customField: '20080914-224020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16601',
internalId:  '',
customField: '20080914-223218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1199',
internalId:  '',
customField: '20110222-174020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1220',
internalId:  '',
customField: '20110919-171207'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8601',
internalId:  '',
customField: '20080912-170624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17006',
internalId:  '',
customField: '20080912-172050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17001',
internalId:  '',
customField: '20080912-172050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21101',
internalId:  '',
customField: '20100414-225407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29701',
internalId:  '',
customField: '20090104-201226'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32101',
internalId:  '',
customField: '20090406-205757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35201',
internalId:  '',
customField: '20100530-123944'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38201',
internalId:  '',
customField: '20100509-222110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40101',
internalId:  '',
customField: '20100524-130340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43001',
internalId:  '',
customField: '20100717-144745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43601',
internalId:  '',
customField: '20100731-183642'
};
var webAppHostname = 'wsc.brinkster.com:80';
var canonHostname = 'wsc1.brinkster.com';
var accountId     = 'ABRI10INVBK8';
var companyName   = 'J.+Sean+Elliott+++www.jsean.com';
var htmlTitle	  = 'J.+Seans+Web';
var metaKeywords  = 'J.+Sean+Elliott+Toronto+singer+comedy+at+least+Ive+got+my+looks';
var metaContents  = 'J.+Sean+Elliott+is+a+Toronto-based+actor+and+singer%2C+whos+just+released+his+second+CD+-+At+Least+Ive+Got+My+Looks.++';
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();
};

