/* [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','1801',jdecode('Home'),jdecode(''),'/1801.html','true',[],''],
	['PAGE','4001',jdecode('CPR+AED+First+Aid+Classes'),jdecode(''),'/4001.html','true',[],''],
	['PAGE','4022',jdecode('Why+Chose+Us%3F'),jdecode(''),'/4022.html','true',[],''],
	['PAGE','2001',jdecode('Our+Services'),jdecode(''),'/2001.html','true',[],''],
	['PAGE','6701',jdecode('Ports+%26+Marinas'),jdecode(''),'/6701.html','true',[],''],
	['PAGE','2601',jdecode('Airplanes'),jdecode(''),'/2601.html','true',[],''],
	['PAGE','2022',jdecode('Contact+Us'),jdecode(''),'/2022.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:  '1801',
internalId:  '',
customField: '20100208-154245'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2001',
internalId:  '',
customField: '20100111-094853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2022',
internalId:  '',
customField: '20100111-092211'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2601',
internalId:  '',
customField: '20100208-154539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4001',
internalId:  '',
customField: '20100111-095114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4022',
internalId:  '',
customField: '20100208-154824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6701',
internalId:  '',
customField: '20100209-084109'
};
var canonHostname = 'cm4all.aplus.net';
var accountId     = 'APL330INZJEP';
var companyName   = 'Florida+AED+Defibrillator+Sales+%7C+Yacht+%26+Boat+AEDs';
var htmlTitle	  = 'Florida+Yacht+Boat+Automated+External+Defibrillator+Sales+%26+Service+%7C+MARINE+CPR+AED+First+Aid+Training+Classes';
var metaKeywords  = 'marine%2C+ship%2C+boat%2C+yacht%2C+mega+yacht%2C+boating%2C+Florida%2C+yacht%2C+marine%2C+boating+safety%2C+boating+supplies%2C+AED%2C+sailboat%2C+florida%2C+USCG%2C+STCW%2C+STCW95%2C+Automated+External+Defibrillator%2C+marine+safety%2C+captain%2C+ship%2C+cruise%2C+Defibrillator%2C+safety%2C+heart+attack%2C+cardiac+arrest%2C+medical%2C+CPR%2C+First+Aid%2C+aed%2C+defibrillator%2C+automatic+external+defibrillator%2C+equipment+heart%2C+AED+cabinets%2C+aed+cabinet%2C+automated+external+defibrillator%2Caed%2Cdefibrillation%2Cdefibrillators%2C+CPR%2Cdefibrillators%2C+cardiac+arrrest%2C+physio+control%2Cmedtronic%2C+defibrillators%2Ccardiac+science%2C+powerheart%2C+philips%2C+inlet%2C+jupiter%2C+florida%2C+fl%2C+heartstreat%2C+heartstart%2C';
var metaContents  = 'Yacht++Boat+-+Miami+%28Dade%29%2C+Fort+Lauderdale+%28Broward%29%2C+West+Palm+Beach+%28Palm+Beach%29+and+All+of+Florida.++We+sell+and+service+AEDs+for+marine+vessels.++Florida+Automated+External+Defibrillator+AED+Sales+-+AEDs+for+Boats%2C+Yachts%2C+Cruise+Ships+-+If+it+floats+you+need+an+AED+-+Purchase+the+right+AED+Automatic+External+Defibrillator+for+your+marine+vessel.++Florida+AED+Sales+%2B+AED+CPR%2C+First+Aid+Onboard+Crew+Training.++Fishing+boats%2C+dive+boats%2C+yachts%2C+race+boats%2C+charter+boats+etc.++Florida+based+CPR+AED+First+Aid+Company.';
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();
};
