/* [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','16801',jdecode('home'),jdecode(''),'/16801.html','true',[],''],
	['PAGE','24085',jdecode('services'),jdecode(''),'/24085.html','true',[],''],
	['PAGE','24001',jdecode('clients'),jdecode(''),'/24001.html','true',[],''],
	['PAGE','61512',jdecode('design+samples'),jdecode(''),'/61512.html','true',[],''],
	['PAGE','25522',jdecode('contact'),jdecode(''),'/25522.html','true',[],''],
	['PAGE','30001',jdecode('about+us'),jdecode(''),'/30001.html','true',[],'']];
var siteelementCount=6;
theSitetree.topTemplateName='Mote';
theSitetree.paletteFamily='C20404';
theSitetree.keyvisualId='11392';
theSitetree.keyvisualName='kv_11392.jpg';
theSitetree.fontsetId='31998';
theSitetree.graphicsetId='13831';
theSitetree.contentColor='565656';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Mote',
				paletteFamily: 	'C20404',
				keyvisualId: 	'11392',
				keyvisualName: 	'kv_11392.jpg',
				fontsetId: 		'31998',
				graphicsetId: 	'13831',
				contentColor: 	'565656',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16801',
internalId:  '',
customField: '20091223-094219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30001',
internalId:  '',
customField: '20091219-124115'
};
webappMappings['7008']=webappMappings['7008-8605']={
webappId:    '7008',
documentId:  '25522',
internalId:  '8605',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25522',
internalId:  '',
customField: '20091219-134428'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '16801',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24001',
internalId:  '',
customField: '20091219-133719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24085',
internalId:  '',
customField: '20091223-102830'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '30001',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '24085',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '24001',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '25522',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61512',
internalId:  '',
customField: '20100109-141254'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INE5ZE';
var companyName   = '';
var htmlTitle	  = 'brandaugroup+marketing+and+creative+services';
var metaKeywords  = 'Maryland+marketing%2C+Virginia+marketing%2C+District+of+Columbia+marketing%2C+graphic+design%2C+logos%2C+website+design%2C+product+marketing%2C+graphic+design+services%2C+Marketing+writing%2C+Technical+writingcustom+publishing%2C+corporate+identity+packages%2C+brochures%2C+collateral%2C+competitive+analysis%2C+SWOT+analysis%2C+market+analysis%2F+industry+assessments%2C+branding%2C+pricing+analysis%2C+online+marketing%2C+email+marketing%2C+SEO%2C+website+design%2C+print+design';
var metaContents  = 'brandaugroup+provides+you+with+an+experienced%2C+award-winning+team+that+ensures+you+find+the+best+way+to+reach+your+marketing+objectives.+We+offer+marketing+communication+and+consulting+services+that+provide+crisp%2C+clear+solutions+to+your+toughest+marketing+challenges.brandaugroup+services+include+writing%2C+graphic+design%2C+corporate+and+product+marketing+and+management+services+across+several+practice+areas.Founded+in+2003%2C+brandaugroup+continues+to+provide+exceptional+writing%2C+graphic+design+and+consulting+services+that+yield+proven+business+results+to+our+clients.+brandaugroup+clients+have+seen+their+businesses+grow%2C+margins+improve%2C+competitors+marginalized%2C+products+successfully+repositioned+and+brought+to+market%2C+and+corporate+and+product+awareness+increase.';
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();
};
