/* [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','2001',jdecode('Home'),jdecode(''),'/2001.html','true',[],''],
	['PAGE','21915',jdecode('Pontoon+Boats'),jdecode(''),'/21915.html','true',[],''],
	['PAGE','18015',jdecode('Boundary+Chart'),jdecode(''),'/18015.html','true',[],''],
	['PAGE','21936',jdecode('Waverunners'),jdecode(''),'/21936.html','true',[],''],
	['PAGE','25199',jdecode('Points+of+Interest'),jdecode(''),'/25199.html','true',[],''],
	['PAGE','26953',jdecode('Directions'),jdecode(''),'/26953.html','true',[],''],
	['PAGE','24029',jdecode('Contact+Us'),jdecode(''),'/24029.html','true',[],''],
	['PAGE','34053',jdecode('newtest'),jdecode(''),'/34053.html','false',[],'']];
var siteelementCount=8;
theSitetree.topTemplateName='Circulation';
theSitetree.paletteFamily='1243CC';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10587';
theSitetree.graphicsetId='10562';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Circulation',
				paletteFamily: 	'1243CC',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10587',
				graphicsetId: 	'10562',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2001',
internalId:  '',
customField: '20100103-092447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18015',
internalId:  '',
customField: '20090606-110429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21915',
internalId:  '',
customField: '20090707-095623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21936',
internalId:  '',
customField: '20090626-082626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24029',
internalId:  '',
customField: '20090616-160726'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25199',
internalId:  '',
customField: '20090626-112702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26953',
internalId:  '',
customField: '20100104-191344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34053',
internalId:  '',
customField: '20100103-100108'
};
var canonHostname = 'cm4all.aplus.net';
var accountId     = 'APL330INZ4VK';
var companyName   = 'South+Shore+Pier%2C+Inc.';
var htmlTitle	  = 'South+Shore+Pier%2C+Inc.+Door+County+Boat+Rentals%2C+Pontoon+Boats%2C+WaveRunners%2C+Paddle+Boats%2C+Boat+Rentals+in+Door+County%2C+Door+County%2C+Ephraim';
var metaKeywords  = 'South+Shore+Pier%2C+southshorepier.com%2C+boat+rentals%2C+Door+County%2C+entertainment%2C+Ephraim%2C+pontoon+boat%2C+pontoon+boats%2C+waverunners%2C+waverunner%2C+wave+runner%2C+wave-runner%2C+jetski%2C+jet+ski%2C+jet-ski%2C+seadoo%2C+sea+doo%2C+sea-doo%2Cjet+skis%2C+seadoos%2C+rental%2C+rent%2C+rentals%2C+%28920%29854-4324%2C+9208544324%2C+920-854-4324%2C+%28920%29+854-4324%2C+920+854-4324%2C+9993+Water+Street%2C+9993+Hwy+42%2C+horseshoe+island%2C+fish+creek%2C+sister+bay%2C+fyrbal%2C+Wilsons%2C+Wilsons+Restaurant%2C+Wilsons+Ephraim%2C+paddleboats%2C+paddle+boats%2C+paddleboat%2C+paddleboat%2C+wisconsin%2C+Wisconsin%2C+WI%2C+eagle+harbor%2C+dock%2C+ephraim+dock%2C+south+shore+dock%2C+southshore+dock%2C+southshore+pier%2C+means+boating%2C+south+shore+pier+inc.%2C+southshore+pier+inc.%2C+southshore+marina%2C+south+shore+marina%2C+marina%2C+ephraim+marina%2C+ephraim+pier%2C+south+shore+pier%2C+boat+rentals+in+door+county+wisconsin%2C+door+county+boat+rentals%2C+door+county+wi%2C+wi%2C+';
var metaContents  = 'South+Shore+Pier%2C+Boat+Rentals+in+Door+County+Wisconsin%2C+Boat+Rentals%3A+Pontoon+Boats%2C+WaveRunners%2C+Paddle+Boats+Door+County+Boat+Rentals%2C+Boat+Rentals%2C+South+Shore+Pier+Inc%2C+Located+in+Ephriam+Wisconsin%2C+Jet+Ski+Rentals%2C+Fishing+Boat+Rentals%2C+Door+County+Premier+Boat+Rental%2C+Door+County+Boat+Rentals%2C+Door+County+Boat+Rentals%2C+Door+County+Boat+Rentals%2C+Door+County+Boat+Rentals%2C+Door+County+Boat+Rentals%2C+Door+County+Boat+Rentals.';
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();
};
