/* [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','701',jdecode('Home'),jdecode(''),'/701.html','true',[],''],
	['PAGE','752',jdecode('About+Me'),jdecode(''),'/752.html','true',[],''],
	['PAGE','794',jdecode('News+%26+Stats'),jdecode(''),'/794.html','true',[],''],
	['PAGE','6101',jdecode('Photo+Gallery'),jdecode(''),'/6101.html','true',[],''],
	['PAGE','815',jdecode('Haynie-acs+Shirts'),jdecode(''),'/815/index.html','true',[ 
		['PAGE','11101',jdecode('Questions'),jdecode(''),'/815/11101.html','true',[],'']
	],''],
	['PAGE','5906',jdecode('Guestbook'),jdecode(''),'/5906/index.html','true',[ 
		['PAGE','5901',jdecode('Read+Guestbook'),jdecode(''),'/5906/5901.html','false',[],'']
	],''],
	['PAGE','25401',jdecode('Contact+Us'),jdecode(''),'/25401.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Toronto';
theSitetree.paletteFamily='8756A7';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='16881';
theSitetree.graphicsetId='12320';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='8756A7';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Toronto',
				paletteFamily: 	'8756A7',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'16881',
				graphicsetId: 	'12320',
				contentColor: 	'FFFFFF',
				contentBGColor: '8756A7',
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				a_color: 		'8756A7',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '701',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-5906avec10in30l6']={
webappId:    '1002',
documentId:  '5906',
internalId:  '5906avec10in30l6',
customField: 'icq=false'
};
webappMappings['7060']=webappMappings['7060-d4102eac7fd0306767c1e38b0304b95c']={
webappId:    '7060',
documentId:  '6101',
internalId:  'd4102eac7fd0306767c1e38b0304b95c',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-2149']={
webappId:    '7008',
documentId:  '815',
internalId:  '2149',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-2150']={
webappId:    '7008',
documentId:  '11101',
internalId:  '2150',
customField: 'language:en;country:US;'
};
webappMappings['1501']=webappMappings['1501-9096121']={
webappId:    '1501',
documentId:  '701',
internalId:  '9096121',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20090917-073242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '752',
internalId:  '',
customField: '20090917-073310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '794',
internalId:  '',
customField: '20090609-205904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6101',
internalId:  '',
customField: '20090609-205948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '815',
internalId:  '',
customField: '20090917-073348'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11101',
internalId:  '',
customField: '20090917-073412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5906',
internalId:  '',
customField: '20070223-084300'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20080414-053702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25401',
internalId:  '',
customField: '20080714-112331'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN30L6';
var companyName   = 'Kristin+Haynie';
var htmlTitle	  = 'The+Official+Web+Site+of+Kristin+Haynie';
var metaKeywords  = 'Kristin+Haynie%2C+Mason%2C+Michigan%2C+Michigan+State+University%2C+MSU+Womens+Basketball%2C+Detroit+Shock%2C+Atlanta+Dream%2C+Sacramento+Monarchs%2C+WNBA%2C+Marlan%2C+JoAnne+Tutay+Romanek.';
var metaContents  = 'The+Official+Web+Site+of+Kristin+Haynie.++The+site+contains+bio+information%2C+a+photo+gallery%2C+news+and+stats%2C+Haynie-acs+t-shirt+ordering+information%2C+and+a+guestbook.';
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();
};
