/* [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','1401',jdecode('Home'),jdecode(''),'/1401.html','true',[],''],
	['PAGE','1452',jdecode('About+Us'),jdecode(''),'/1452.html','true',[],''],
	['PAGE','1494',jdecode('Dive+Charter+Calendar'),jdecode(''),'/1494.html','true',[],''],
	['PAGE','1515',jdecode('Prices'),jdecode(''),'/1515/index.html','true',[ 
		['PAGE','12501',jdecode('How+to+charter+guide'),jdecode(''),'/1515/12501.html','true',[],''],
		['PAGE','12901',jdecode('Release+Form'),jdecode(''),'/1515/12901.html','true',[],''],
		['PAGE','12922',jdecode('What+to+bring+-+checklist'),jdecode(''),'/1515/12922.html','true',[],'']
	],''],
	['PAGE','1725',jdecode('Contact+Us'),jdecode(''),'/1725.html','true',[],''],
	['PAGE','1536',jdecode('Photo+Gallery'),jdecode(''),'/1536/index.html','true',[ 
		['PAGE','1641',jdecode('Puget+Sound+-+our+Home'),jdecode(''),'/1536/1641.html','true',[],''],
		['PAGE','1599',jdecode('Truk+Lagoon'),jdecode(''),'/1536/1599.html','true',[],''],
		['PAGE','1620',jdecode('Cozumel'),jdecode(''),'/1536/1620.html','true',[],'']
	],''],
	['PAGE','1473',jdecode('Northwest+Dive+News'),jdecode(''),'/1473.html','true',[],''],
	['PAGE','1683',jdecode('Visit+our+Dive+Buddies'),jdecode(''),'/1683.html','true',[],''],
	['PAGE','1704',jdecode('Dive+Resources'),jdecode(''),'/1704.html','true',[],''],
	['PAGE','7006',jdecode('Guestbook'),jdecode(''),'/7006/index.html','true',[ 
		['PAGE','7001',jdecode('Read+Guestbook'),jdecode(''),'/7006/7001.html','false',[],'']
	],'']];
var siteelementCount=17;
theSitetree.topTemplateName='Sportive';
theSitetree.paletteFamily='E9EEF4';
theSitetree.keyvisualId='2689';
theSitetree.keyvisualName='unterwasserwelt.jpg';
theSitetree.fontsetId='220';
theSitetree.graphicsetId='262';
theSitetree.contentColor='000066';
theSitetree.contentBGColor='E9EEF4';
var theTemplate={
				name: 			'Sportive',
				paletteFamily: 	'E9EEF4',
				keyvisualId: 	'2689',
				keyvisualName: 	'unterwasserwelt.jpg',
				fontsetId: 		'220',
				graphicsetId: 	'262',
				contentColor: 	'000066',
				contentBGColor: 'E9EEF4',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'E9EEF4',
				b_color: 		'C1C4D3',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1452',
internalId:  '',
customField: '20061101-205537'
};
webappMappings['1002']=webappMappings['1002-7006AHW050IN2FLJ']={
webappId:    '1002',
documentId:  '7006',
internalId:  '7006AHW050IN2FLJ',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1401',
internalId:  '',
customField: '20090325-172057'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1494',
internalId:  '',
customField: '20090325-174025'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1515',
internalId:  '',
customField: '20090325-172403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12501',
internalId:  '',
customField: '20070531-172144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12901',
internalId:  '',
customField: '20070531-200728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12922',
internalId:  '',
customField: '20061106-183049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1725',
internalId:  '',
customField: '20061031-192525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1536',
internalId:  '',
customField: '20070531-172317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1641',
internalId:  '',
customField: '20061102-175102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1599',
internalId:  '',
customField: '20061102-173818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1620',
internalId:  '',
customField: '20061102-174631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1473',
internalId:  '',
customField: '20090325-180552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1683',
internalId:  '',
customField: '20090325-175748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1704',
internalId:  '',
customField: '20061031-182736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7006',
internalId:  '',
customField: '20061031-193821'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7001',
internalId:  '',
customField: '20061031-193821'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050IN2FLJ';
var companyName   = 'Dolphin+Charters+-+Diving+Adventures';
var htmlTitle	  = 'Dolphin+Charters+-+Adventure+in+Diving';
var metaKeywords  = 'diving%2C+charter+boats%2C+day+trips%2C+live+aboard%2C+scuba%2C+rebreather%2C+doubles%2C+scuba+gear%2C+dive%2C+lifestyle+charters%2C+lifestyle%2C+couples%2C+sports%2C+outdoors%2C+water%2C+puget+sound%2C+Crescent+lake%2C+Seattle%2C+Mukilteo%2C+Northwest%2C+Diving%2C+Charters%2C+Charter%2C+California%2C+Oregon%2C+Dive+Tours%2C+recreational%2C+outdoors%2C+deep%2C+google%2C+microsoft%2C+sun%2C+money%2C+chicks%2C+hot%2C+babe%2C+sex';
var metaContents  = 'diving%2C+charter+boats%2C+day+trips%2C+live+aboard%2C+scuba%2C+rebreather%2C+doubles%2C+scuba+gear%2C+dive%2C+lifestyle+charters%2C+lifestyle%2C+couples%2C+sports%2C+outdoors%2C+water%2C+family%2C+family+tours%2C+norhwest+diving%2C+puget+sound%2C+killer+whales%2C+dolphin%2C+dolphin+charters%2C+great+outdoors%2C+microsoft';
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();
};
