/* [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','5601',jdecode('Home'),jdecode(''),'/5601.html','true',[],'',''],
	['PAGE','7501',jdecode('Why+Work+With+SAC'),jdecode(''),'/7501/index.html','true',[ 
		['PAGE','15001',jdecode('Gerri+Lynn+Martin'),jdecode(''),'/7501/15001.html','true',[],'',''],
		['PAGE','15022',jdecode('Jeanine+M.+Rhode'),jdecode(''),'/7501/15022.html','true',[],'','']
	],'',''],
	['PAGE','7522',jdecode('Services'),jdecode(''),'/7522.html','true',[],'',''],
	['PAGE','28401',jdecode('Class+Schedule'),jdecode(''),'/28401.html','true',[],'',''],
	['PAGE','17601',jdecode('Newsletter+Archives'),jdecode(''),'/17601/index.html','true',[ 
		['PAGE','29201',jdecode('August+2010'),jdecode(''),'/17601/29201.html','true',[],'','']
	],'',''],
	['PAGE','23101',jdecode('Online+Presentations'),jdecode(''),'/23101/index.html','true',[ 
		['PAGE','27201',jdecode('LexisNexis+Time+Matters'),jdecode(''),'/23101/27201.html','true',[],'',''],
		['PAGE','27022',jdecode('Peachtree+Software'),jdecode(''),'/23101/27022.html','true',[],'',''],
		['PAGE','27043',jdecode('QuickBooks+Software'),jdecode(''),'/23101/27043.html','true',[],'',''],
		['PAGE','27001',jdecode('Timeslips+Software'),jdecode(''),'/23101/27001.html','true',[],'','']
	],'',''],
	['PAGE','12243',jdecode('Contact+Us'),jdecode(''),'/12243.html','true',[],'',''],
	['PAGE','14601',jdecode('Location%2FDirections'),jdecode(''),'/14601.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Amaze';
theSitetree.paletteFamily='3F7177';
theSitetree.keyvisualId='2416';
theSitetree.keyvisualName='digital.jpg';
theSitetree.fontsetId='399';
theSitetree.graphicsetId='447';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3F7177';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Amaze',
				paletteFamily: 	'3F7177',
				keyvisualId: 	'2416',
				keyvisualName: 	'digital.jpg',
				fontsetId: 		'399',
				graphicsetId: 	'447',
				contentColor: 	'FFFFFF',
				contentBGColor: '3F7177',
				a_color: 		'3F7177',
				b_color: 		'2F5358',
				c_color: 		'3268E2',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20090630-170131'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7501',
internalId:  '',
customField: '20090630-233423'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7522',
internalId:  '',
customField: '20100426-125304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29201',
internalId:  '',
customField: '20100812-103806'
};
webappMappings['7008']=webappMappings['7008-3605']={
webappId:    '7008',
documentId:  '12243',
internalId:  '3605',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12243',
internalId:  '',
customField: '20090629-112039'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28401',
internalId:  '',
customField: '20100426-124607'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '14601',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14601',
internalId:  '',
customField: '20090630-164549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15001',
internalId:  '',
customField: '20090630-170611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15022',
internalId:  '',
customField: '20090630-170559'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17601',
internalId:  '',
customField: '20091228-103223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27001',
internalId:  '',
customField: '20100426-101115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23101',
internalId:  '',
customField: '20100318-105011'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27201',
internalId:  '',
customField: '20100426-101257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27022',
internalId:  '',
customField: '20100426-101115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27043',
internalId:  '',
customField: '20100527-104609'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INV33S';
var companyName   = 'Software+Analysis+Corporation';
var htmlTitle	  = 'Software+Analysis+Corporation+-+%22When+Your+Help+Key+Isn%27t+Enough%22';
var metaKeywords  = 'Time+Matters+Peachtree+Timeslips+PCLaw+AbacusLaw+Billing+Matters+LexisNexis+Sage+Bloomingdale+CIC';
var metaContents  = 'Certified+Consultants+supporting+Timeslips%2C+Peachtree%2C+LNTPA%2C+Time+Matters%2C+Billing+Matters%2C+AbacusLaw%2C+CIC%2C+Lexis+Nexis%2C+Chicago%2C+PClaw';
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();
};
