/* [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','1901',jdecode('Home'),jdecode(''),'/1901.html','true',[],'',''],
	['PAGE','1994',jdecode('AED+Defibrillators'),jdecode(''),'/1994.html','true',[],'',''],
	['PAGE','1952',jdecode('Ports+and+Marinas'),jdecode(''),'/1952.html','true',[],'',''],
	['PAGE','11001',jdecode('Scuba+Divers'),jdecode(''),'/11001.html','true',[],'',''],
	['PAGE','3701',jdecode('Aviation+-+Jets'),jdecode(''),'/3701.html','true',[],'',''],
	['PAGE','9101',jdecode('Caribbean'),jdecode(''),'/9101.html','true',[],'',''],
	['PAGE','3101',jdecode('Why+chose+us%3F'),jdecode(''),'/3101.html','true',[],'',''],
	['PAGE','1973',jdecode('Contact+Us'),jdecode(''),'/1973.html','true',[],'','']];
var siteelementCount=8;
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 prodDef={
  wl_name: 'aplus',
  product: 'WSCSYSSSSLYTCPZ2'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Diamond',
				paletteFamily: 	'BFD4ED',
				keyvisualId: 	'6210',
				keyvisualName: 	'kv_6210.jpg',
				fontsetId: 		'11090',
				graphicsetId: 	'11865',
				contentColor: 	'000000',
				contentBGColor: 'BFD4ED',
				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:  '1901',
internalId:  '',
customField: '20100916-115305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1952',
internalId:  '',
customField: '20100209-052454'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1994',
internalId:  '',
customField: '20100815-144256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1973',
internalId:  '',
customField: '20100209-044458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3101',
internalId:  '',
customField: '20100703-055649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3701',
internalId:  '',
customField: '20100703-055607'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9101',
internalId:  '',
customField: '20100302-081031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11001',
internalId:  '',
customField: '20100322-012555'
};
var webAppHostname = 'cm4all.aplus.net:80';
var canonHostname = 'cm4all01.carrierzone.com';
var accountId     = 'APL330INZJEH';
var companyName   = 'Onboard+CPR+AED+First+Aid+Training+for+Captains+%26+Crew';
var htmlTitle	  = 'USCG+STCW+CPR+AED+and+First+Aid+training+classes+for+Captain+and+Boat+Crew+%7C+Florida+Maritime+CPR+First+Aid+Classes+%7C+Shipboard+training+classes';
var metaKeywords  = 'CPR%2C+First+Aid%2C+cpr%2C+c.p.r.%2C+training%2C+boating%2C+Florida%2C+yacht%2C+marine%2C+boating+safety%2C+boating+supplies%2C++sailboat%2C+Florida%2C+USCG%2C+STCW%2C+STCW95%2C+STCW+95%2C+STCW-95%2C+Automated+External+Defibrillator%2C+marine+safety%2C+captain%2C+ship%2C+cruise%2C+Tempus%2C+Telemediciine%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++automated+external+defibrillator%2C+aed%2C+defibrillation%2C+defibrillators%2C+CPR%2C+defibrillators%2C+cardiac+arrest%2C++inlet%2C+Jupiter%2C+Florida%2C+fort+lauderdale%2C+broward%2C+Shipboard%2C+marine%2C+caribbean';
var metaContents  = 'Maritime+Captain+and+Ships+Crew+CPR+AED+First+Aid+Shipboard+Training+on+your+Florida+boat.++We+offer+USCG+STCW+CPR+AED+First+Aid+Emergency+Medical+Safety+Classest+for+Yacht+Captains+and+Ships+Crew.++We+provide+CPR+AED+First+Aid+%26+Telemedicine+Training+on+all+Boats%2C+Yachts%2C+Cruise+Ships%2C+tankers%2C+marine+vessels+and+marinas.+-+If+you+work+around+water+you+should+know+CPR.++AED+Sales+%2B+AED+CPR%2C+First+Aid+Training.++Ideal+for+Florida+Marinas%2C+Sport+Fishing+boats%2C+dive+boats%2C+yachts%2C+mega+yachts%2C+race+boats%2C+charter+boats+etc.++Florida+based+CPR+AED+First+Aid+Training+Classes.++Call+561-762-0500+-+We+put+the+Sea+in+CPR';
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();
};

