/* [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','5401',jdecode('Home'),jdecode(''),'/5401.html','true',[],'',''],
	['PAGE','6701',jdecode('Search+Engine+Marketing'),jdecode(''),'/6701.html','true',[],'',''],
	['PAGE','5494',jdecode('Email+Marketing'),jdecode(''),'/5494.html','true',[],'',''],
	['PAGE','31601',jdecode('Social+Media+Marketing'),jdecode(''),'/31601.html','true',[],'',''],
	['PAGE','6743',jdecode('Concept+Development'),jdecode(''),'/6743.html','true',[],'',''],
	['PAGE','34201',jdecode('Portfolio'),jdecode(''),'/34201.html','true',[],'',''],
	['PAGE','5536',jdecode('Our+Team'),jdecode(''),'/5536.html','true',[],'',''],
	['PAGE','42501',jdecode('Our+Location'),jdecode(''),'/42501.html','true',[],'',''],
	['PAGE','6764',jdecode('Contact+Us'),jdecode(''),'/6764.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Round';
theSitetree.paletteFamily='666699';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='439';
theSitetree.graphicsetId='493';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='a1a1c6';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Round',
				paletteFamily: 	'666699',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'439',
				graphicsetId: 	'493',
				contentColor: 	'FFFFFF',
				contentBGColor: 'a1a1c6',
				a_color: 		'a1a1c6',
				b_color: 		'666699',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5401',
internalId:  '',
customField: '20110602-124826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6701',
internalId:  '',
customField: '20100809-155211'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '6701',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5536',
internalId:  '',
customField: '20110602-125131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5494',
internalId:  '',
customField: '20090825-125754'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '6743',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-13275']={
webappId:    '7008',
documentId:  '6764',
internalId:  '13275',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6764',
internalId:  '',
customField: '20110623-104654'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '5401',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6743',
internalId:  '',
customField: '20090905-225747'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '5494',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '5536',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '6764',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31601',
internalId:  '',
customField: '20090825-125703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34201',
internalId:  '',
customField: '20110626-225810'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '31601',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '34201',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '42501',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42501',
internalId:  '',
customField: '20100918-100301'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0INEPMK';
var companyName   = 'Endless+Wave+Marketing+++++++585.214.4592';
var htmlTitle	  = 'Endless+Wave+Marketing+-+Online+Marketing+Consultants+in+Rochester%2C+NY%3A+a+division+of+Endless+Wave+Productions';
var metaKeywords  = 'search+engine+optimization%2C+seo%2C+search+marketing%2C+search+engine+keyword+bidding%2C+advertising%2C+design%2C+ad+agency%2C+advertising+agency%2C+advertising+consultant%2C+email+marketing%2C+social+media+marketing%2C+brochure+design%2C+printed+material+design%2C+facebook+fan+club+page+development%2C+twitter+business+page+development%2C+rochester%2C+new+york%2C+Chris+Wilmot%2C+Kathy+Goll%2C+Christopher+Wilmot%2C+Kathleen+Goll%2C+craig+watkins%2C+pittsford%2C+endless+wave+productions%2C+endless+wave+productions+llc%2C+endless+wave+llc';
var metaContents  = 'Online+Marketing+Consultants+-+Rochester%2C+New+York+-+We+can+help+with+website+development%2C+search+engine+marketing%2C+sending+email+marketing+campaigns%2C+using+Facebook+and+Twitter+to+promote+your+business.+Let+us+help+you+find+more+customers+through+your+online+presence.+We+offer+free+consultations+and+affordable+consulting+fees.';
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();
};

