/* [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','2001',jdecode('Home'),jdecode(''),'/2001.html','true',[],'',''],
	['PAGE','4901',jdecode('Class+Offerings'),jdecode(''),'/4901.html','true',[],'','']];
var siteelementCount=2;
theSitetree.topTemplateName='Animal';
theSitetree.paletteFamily='3468BD';
theSitetree.keyvisualId='4294';
theSitetree.keyvisualName='kv_4294.jpg';
theSitetree.fontsetId='10789';
theSitetree.graphicsetId='11209';
theSitetree.contentColor='313F73';
theSitetree.contentBGColor='D8E0ED';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Animal',
				paletteFamily: 	'3468BD',
				keyvisualId: 	'4294',
				keyvisualName: 	'kv_4294.jpg',
				fontsetId: 		'10789',
				graphicsetId: 	'11209',
				contentColor: 	'313F73',
				contentBGColor: 'D8E0ED',
				a_color: 		'3468BD',
				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: '20100901-073911'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4901',
internalId:  '',
customField: '20100702-081247'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INVSY8';
var companyName   = 'Scuba+%E2%80%93+Buceo+%E2%80%93+Plong%C3%A9e+%E2%80%93+Mergulho';
var htmlTitle	  = 'SCUBA+DIving';
var metaKeywords  = 'Scuba%2C+Buceo%2C+Plong%C3%A9e%2C+Mergulho%2C+PADI%2C+DAN%2C+PSI%2C+Professional+Scuba+Inspectors%2CDivers+Alert+Network%2C+Scuba+gear%2C+breathing+underwater%2C+coral+reef%2C+dive+shop%2C+learn+to+scuba+dive%2C+master+scuba+diver%2C+scuba+certification%2C+scuba+dive+equipment%2C+scuba+dive+shop%2C+scuba+diving%2C+scuba+diving+class%2C+scuba+diving+equipment%2C+scuba+diving+gear%2C+scuba+diving+lessons%2C+scuba+diving+training%2C+scuba+diving+vacations%2C+scuba+equipment%2C+scuba+instructor%2C+scuba+lessons%2C+underwater%2C+underwater+photography%2C+dive+computer%2C+dive+resort%2C+nitrox%2C+scuba+diver%2C+scuba+diving+pictures%2C+scuba+diving+shop%2C+scuba+mask%2C+scuba+regulator%2C+scuba+tank';
var metaContents  = 'Experience+the+excitement+of+the+Under+Water+World.+Learn+to+Scuba+Dive.+It%E2%80%99s+fun%2C+it%E2%80%99s+easy+and+it%E2%80%99s+fast%21+To+start+your+adventure+contact+me%2C+I+can+guide+you+from+entry+level+to+become+a+professional+Scuba+Diver%2C+and+even+make+a+career+out+of+it%21Your+SCUBA+experience+can+start+right+here+in+Fabulous+Las+Vegas%2C+NV.%2C+and+from+here+you+can+take+it+where+ever+you+want%2C+there+are+no+limits.+You+can+escape+to+a+different+world%2C+explore+new+places%2C+experience+a+connection+with+nature+and+even+make+a+career+out+of+it%2C+Go+Pro%21Escape+to+a+different+world.+++Scuba+takes+you+to+a+different+world+with+new+colors%2C+shapes%2C+textures+and+creatures+%E2%80%93+a+world+where+the+roles+you+play+%E2%80%93+husband%2C+wife%2C+mother%2C+father%2C+friend+%E2%80%93+take+on+a+new+dimension.+Become+a+scuba+diver+and+escape+to+a+peaceful+place+to+renew+your+energy+and+excite+your+senses.Explore+new+places.+Scuba+diving+frees+you+to+explore+the+underwater+world+%E2%80%93+from+historic+shipwrecks+and+pristine+reefs+to+the+mysteries+of+your+local+quarry.+Become+a+scuba+diver+and+explore+what+you%E2%80%99ve+been+missing.Experience+a+connection+with+nature%3B+a+feeling+of+freedom%2C+and+a+transformation.+Diving+connects+you+with+nature.+It+immerses+you+in+new+sensations+and+experiences.+It+transforms+your+perception+of+life+forever.+Become+a+diver+and+transform+yourself.Why+go+Pro%3F+The+Love+of+Diving%2C+The+Opportunity+to+Teach%2C+Lifestyle%2C+Self+Improvement%2C+Enjoy+Outdoor+Activities%2C+A+Passion+to+Care+for+the+Environment+or+you+may+have+your+own+personal+reason.';
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();
};
