/* [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','2001',jdecode('Home'),jdecode(''),'/2001.html','true',[],''],
	['PAGE','2073',jdecode('AED+Defibrillator+Sales'),jdecode(''),'/2073.html','true',[],''],
	['PAGE','7601',jdecode('ALF+-+Assisted+Living'),jdecode(''),'/7601.html','true',[],''],
	['PAGE','4201',jdecode('Retail+Stores'),jdecode(''),'/4201.html','true',[],''],
	['PAGE','7001',jdecode('Transportation'),jdecode(''),'/7001.html','true',[],''],
	['PAGE','4101',jdecode('Utility+Companies'),jdecode(''),'/4101.html','true',[],''],
	['PAGE','4122',jdecode('Why+Us+-+Contact+Info'),jdecode(''),'/4122.html','true',[],'']];
var siteelementCount=7;
theSitetree.topTemplateName='Diamond';
theSitetree.paletteFamily='BFD4ED';
theSitetree.keyvisualId='6210';
theSitetree.keyvisualName='kv_6210.jpg';
theSitetree.fontsetId='11090';
theSitetree.graphicsetId='11865';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='BFD4ED';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Diamond',
				paletteFamily: 	'BFD4ED',
				keyvisualId: 	'6210',
				keyvisualName: 	'kv_6210.jpg',
				fontsetId: 		'11090',
				graphicsetId: 	'11865',
				contentColor: 	'000000',
				contentBGColor: 'BFD4ED',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2001',
internalId:  '',
customField: '20100707-105612'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4101',
internalId:  '',
customField: '20100123-103115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2073',
internalId:  '',
customField: '20100123-103214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4201',
internalId:  '',
customField: '20100123-103034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4122',
internalId:  '',
customField: '20100707-104244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7001',
internalId:  '',
customField: '20100211-014729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7601',
internalId:  '',
customField: '20100917-153419'
};
var canonHostname = 'cm4all01.carrierzone.com';
var accountId     = 'APL330INZJVO';
var companyName   = 'Florida+Safety+-+CPR+AED+First+Aid+Classes+%26+AED+Sales';
var htmlTitle	  = 'West+Palm+Beach+Florida+CPR+BLS+AED+First+Aid+Training+Classes+%7C+American+Heart+Association+CPR+First+Aid';
var metaKeywords  = 'Florida%2C+CPR+Training%2C+CPR%2C+School%2C+AED%2C+First+Aid%2C+Instructor%2C+Florida%2C++American+Heart%2C+Heart%2C+Heart+Attack%2C+cpr%2C+school%2C+college%2C++certification%2C+train%2C+construction%2C+OSHA%2C+class%2C+Jupiter%2C+Florida+Palm+Beach%2C+Assisted+Living+Facility%2C+Risk%2C+Manager%2C+Management%2C+Training%2C+Trainer%2C+Class%2C+Classes%2C+OSHA%2C+Risk%2C+Injury%2C+Safety%2C+Medtronic%2C+Phillips%2C+Defibtech%2C+Zoll%2C+palm+beach%2C+treasure+coast%2C+Miami%2C+Dade%2C+Broward%2C+Martin%2C+West+Palm%2C+Beach%2C+jupiter%2C+fort+lauderdale%2C+Ft.+Lauderdale%2C+Miami%2C+Boca%2C+boynton%2C+saint+lucie%2C+St.+Lucie%2C+Stuart%2C+wellington%2C+royal+palm+beach%2C+lake+worth%2C+lantana%2C+Orlando%2C+emergency%2C+medical%2C+direction%2C+oversight%2C+hotels%2C+golf%2C+club%2C+church%2C+fitness%2C+personal+trainers%2C+athletic%2C+clinic%2C+condo%2C+hospital%2C+doctors+office%2C+hotel%2C+HOA%2C+condominium%2C+';
var metaContents  = 'West+Palm+Beach+Florida+-+American+Heart+CPR+BLS+AED++First+Aid+Safety+Training+Certification+Classes+%7C+Workplace+Safety+with+OSHA+First+Aid+%7C+AED+Defibrillator+Sales%2C+AED+Battery+and+AED+PAds+and+Safety+Consulting.++CPR+AED+Courses+-+Florida+CPR+AED+Call+561-762-0500.';
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();
};

