/* [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','601',jdecode('Home'),jdecode(''),'/601.html','true',[],''],
	['PAGE','673',jdecode('Our+Services'),jdecode(''),'/673/index.html','true',[ 
		['PAGE','9370',jdecode('Marketing%2FBranding'),jdecode(''),'/673/9370.html','true',[],''],
		['PAGE','9343',jdecode('Market+Research'),jdecode(''),'/673/9343.html','true',[],''],
		['PAGE','9352',jdecode('Business+Development'),jdecode(''),'/673/9352.html','true',[],''],
		['PAGE','23101',jdecode('Social+Media'),jdecode(''),'/673/23101.html','true',[],''],
		['PAGE','9379',jdecode('Public+Relations'),jdecode(''),'/673/9379.html','true',[],''],
		['PAGE','9388',jdecode('Media+Relations'),jdecode(''),'/673/9388.html','true',[],''],
		['PAGE','9361',jdecode('Fundraising'),jdecode(''),'/673/9361.html','true',[],''],
		['PAGE','18801',jdecode('Grant+Writing'),jdecode(''),'/673/18801.html','true',[],'']
	],''],
	['PAGE','757',jdecode('Case+Studies'),jdecode(''),'/757/index.html','true',[ 
		['PAGE','14601',jdecode('Dermagraft'),jdecode(''),'/757/14601.html','true',[],''],
		['PAGE','14701',jdecode('Mandometer'),jdecode(''),'/757/14701.html','true',[],''],
		['PAGE','14722',jdecode('Neighborhood+Hcare'),jdecode(''),'/757/14722.html','true',[],''],
		['PAGE','14743',jdecode('Mannington+Floors'),jdecode(''),'/757/14743.html','true',[],''],
		['PAGE','14764',jdecode('Scripps+Health'),jdecode(''),'/757/14764.html','true',[],''],
		['PAGE','14785',jdecode('Adv.+Targeting+Systems'),jdecode(''),'/757/14785.html','true',[],''],
		['PAGE','33701',jdecode('Bon+Bon+Chocolates'),jdecode(''),'/757/33701.html','true',[],'']
	],''],
	['PAGE','19101',jdecode('Work+Samples'),jdecode(''),'/19101.html','true',[],''],
	['PAGE','9334',jdecode('About+Us'),jdecode(''),'/9334.html','true',[],''],
	['PAGE','652',jdecode('Senior+Staff'),jdecode(''),'/652.html','true',[],''],
	['PAGE','13601',jdecode('Free+Consultation'),jdecode(''),'/13601/index.html','true',[ 
		['PAGE','13622',jdecode('Submit+Press+Release'),jdecode(''),'/13601/13622.html','true',[],'']
	],''],
	['PAGE','736',jdecode('Our+Clients'),jdecode(''),'/736.html','true',[],''],
	['PAGE','19901',jdecode('What+Our+Clients+Say'),jdecode(''),'/19901.html','true',[],''],
	['PAGE','778',jdecode('Contact+Us'),jdecode(''),'/778.html','true',[],'']];
var siteelementCount=26;
theSitetree.topTemplateName='Draft';
theSitetree.paletteFamily='2D50A1';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10619';
theSitetree.graphicsetId='10611';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='2D50A1';
var theTemplate={
				name: 			'Draft',
				paletteFamily: 	'2D50A1',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10619',
				graphicsetId: 	'10611',
				contentColor: 	'FFFFFF',
				contentBGColor: '2D50A1',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'D09868',
				e_color: 		'9E9E9F',
				f_color: 		'051E56',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '652',
internalId:  '',
customField: '20090406-120412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19901',
internalId:  '',
customField: '20090415-120807'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20090416-093310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '673',
internalId:  '',
customField: '20090417-103637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23101',
internalId:  '',
customField: '20090416-101627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33701',
internalId:  '',
customField: '20090714-111805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '736',
internalId:  '',
customField: '20090714-112002'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '757',
internalId:  '',
customField: '20090714-113046'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '778',
internalId:  '',
customField: '20090416-103507'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9343',
internalId:  '',
customField: '20090415-120931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9334',
internalId:  '',
customField: '20090417-102420'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19101',
internalId:  '',
customField: '20090714-112935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18801',
internalId:  '',
customField: '20090415-121111'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9352',
internalId:  '',
customField: '20090415-135039'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9361',
internalId:  '',
customField: '20090415-124557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9370',
internalId:  '',
customField: '20090415-130841'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9379',
internalId:  '',
customField: '20090415-135618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9388',
internalId:  '',
customField: '20090415-135859'
};
webappMappings['1501']=webappMappings['1501-4282872']={
webappId:    '1501',
documentId:  '601',
internalId:  '4282872',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-2123']={
webappId:    '7008',
documentId:  '13622',
internalId:  '2123',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13601',
internalId:  '',
customField: '20090416-103654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13622',
internalId:  '',
customField: '20090406-120523'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14601',
internalId:  '',
customField: '20090406-115241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14701',
internalId:  '',
customField: '20090406-115224'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14722',
internalId:  '',
customField: '20090417-102635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14743',
internalId:  '',
customField: '20090406-115317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14764',
internalId:  '',
customField: '20090406-115328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14785',
internalId:  '',
customField: '20090406-115422'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INEAY5';
var companyName   = 'Project+Works+Marketing';
var htmlTitle	  = 'Project+Works+Marketing';
var metaKeywords  = 'Free+Press+Release+public+relations+strategic+planning+marketing+business+development+internet+marketing+social+media+viral+marketing+events++promotions+market+research+grant+writing';
var metaContents  = 'Marketing+Public+Relations+Media+Relations+Branding+Market+Research+Press+Kits+Newsletters+Free+Public+Relation+Free+Press+Releases';
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();
};
