/* [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','3601',jdecode('Home'),jdecode(''),'/3601.html','true',[],''],
	['PAGE','3652',jdecode('Boats'),jdecode(''),'/3652.html','true',[],''],
	['PAGE','3673',jdecode('Trips'),jdecode(''),'/3673.html','true',[],''],
	['PAGE','3694',jdecode('Rates'),jdecode(''),'/3694.html','true',[],''],
	['PAGE','3715',jdecode('Photos%2F+Video'),jdecode(''),'/3715.html','true',[],''],
	['PAGE','3736',jdecode('Contact'),jdecode(''),'/3736.html','true',[],''],
	['PAGE','3757',jdecode('Blog'),jdecode(''),'/3757.html','true',[],''],
	['PAGE','3778',jdecode('Email+Form'),jdecode(''),'/3778.html','false',[],''],
	['PAGE','3799',jdecode('Search'),jdecode(''),'/3799.html','false',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Undulate';
theSitetree.paletteFamily='67BAFF';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='33118';
theSitetree.graphicsetId='14072';
theSitetree.contentColor='001346';
theSitetree.contentBGColor='67BAFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Undulate',
				paletteFamily: 	'67BAFF',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'33118',
				graphicsetId: 	'14072',
				contentColor: 	'001346',
				contentBGColor: '67BAFF',
				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: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-30f77e0b4f2b0e95f4a6072f4f86b100']={
webappId:    '7060',
documentId:  '3715',
internalId:  '30f77e0b4f2b0e95f4a6072f4f86b100',
customField: 'language:en;country:US;'
};
webappMappings['7050']=webappMappings['7050-1347']={
webappId:    '7050',
documentId:  '3757',
internalId:  '1347',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-11460']={
webappId:    '7008',
documentId:  '3778',
internalId:  '11460',
customField: 'language:en;country:US;'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '3799',
internalId:  'search',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3601',
internalId:  '',
customField: '20091102-100547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3652',
internalId:  '',
customField: '20090930-052416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3673',
internalId:  '',
customField: '20090930-052542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3694',
internalId:  '',
customField: '20090930-052653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3715',
internalId:  '',
customField: '20090929-072939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3736',
internalId:  '',
customField: '20090929-144246'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3757',
internalId:  '',
customField: '20090929-144413'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3601',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-14383610']={
webappId:    '1501',
documentId:  '3601',
internalId:  '14383610',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3778',
internalId:  '',
customField: '20090925-085056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3799',
internalId:  '',
customField: '20090925-085056'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN3FZX';
var companyName   = 'CAPE+MAY+CHARTER+AND+GUIDE+SERVICE';
var htmlTitle	  = 'Charter+Boats+in+Cape+May%2C+New+Jersey.+Fishing%2C+Whale+%2F+Dolphin+%2F+Bird+Watching%2C+Parties%2C+Weddings%2C+Anniversaries%2C+Rehearsal+Dinners';
var metaKeywords  = 'Charter%2C+Fishing%2C+Dolphin%2C+Whales%2C+Watching%2C+Watch%2C+Fish%2C+Striped+Bass%2C+Tuna%2C+Tour%2C+Private%2C+Event%2C+party+boat%2C+Cape+May%2C+Wildwood%2C+New+Jersey%2C+NJ%2C+Stone+Harbor%2C+Philadelphia%2C+Atlantic+City%2C+Point+Pleasant%2C+Brielle%2C+Sandy+Hook%2C+Pennsylvania%2C+New+York%2C+Cape+Cod%2C+Maryland%2C+Balitmore%2C';
var metaContents  = 'Cape+May+Charters+offers+both+daily+and+private+fishing+charters%2C+boat+tours%2C+whale+and+dolphin+watching%2C+environmental+tours%2C+history+cruises%2C+party+cruises%2C+as+well+as+custom+private+charters+on+the+Spirit+of+Cape+May%2C+the+Cape+May+Whale+Watcher%2C+the+Sea+Star+III%2C+the+Calypso%2C+the+Lonestar%2C+the+Canyon+Clipper';
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();
};
