/* [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','30501',jdecode('Home'),jdecode(''),'/30501.html','true',[],''],
	['PAGE','10501',jdecode('Pictures'),jdecode(''),'/10501/index.html','true',[ 
		['PAGE','13522',jdecode('Main+Floor'),jdecode(''),'/10501/13522.html','true',[],''],
		['PAGE','13564',jdecode('Upstairs+Floor'),jdecode(''),'/10501/13564.html','true',[],''],
		['PAGE','13543',jdecode('Ground+Floor'),jdecode(''),'/10501/13543.html','true',[],''],
		['PAGE','13585',jdecode('Outdoor+Areas'),jdecode(''),'/10501/13585.html','true',[],'']
	],''],
	['PAGE','14801',jdecode('Location+'),jdecode(''),'/14801.html','true',[],''],
	['PAGE','13501',jdecode('Features'),jdecode(''),'/13501.html','true',[],''],
	['PAGE','12022',jdecode('The+Beach'),jdecode(''),'/12022.html','true',[],''],
	['PAGE','12001',jdecode('The+Village'),jdecode(''),'/12001.html','true',[],''],
	['PAGE','10552',jdecode('Siesta+Key'),jdecode(''),'/10552.html','true',[],''],
	['PAGE','23201',jdecode('Around+Town'),jdecode(''),'/23201.html','true',[],''],
	['PAGE','10741',jdecode('Rates'),jdecode(''),'/10741/index.html','true',[ 
		['PAGE','20901',jdecode('Terms+%26+Conditions'),jdecode(''),'/10741/20901.html','true',[],''],
		['PAGE','20922',jdecode('Privacy+Policy'),jdecode(''),'/10741/20922.html','true',[],'']
	],''],
	['PAGE','10901',jdecode('FAQs'),jdecode(''),'/10901.html','true',[],''],
	['PAGE','11601',jdecode('Contact+Us'),jdecode(''),'/11601.html','true',[],'']];
var siteelementCount=17;
theSitetree.topTemplateName='Caribic';
theSitetree.paletteFamily='7050FA';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10419';
theSitetree.graphicsetId='10707';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='B63636';
var theTemplate={
				name: 			'Caribic',
				paletteFamily: 	'7050FA',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10419',
				graphicsetId: 	'10707',
				contentColor: 	'FFFFFF',
				contentBGColor: 'B63636',
				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:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10501',
internalId:  '',
customField: '20091124-094624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23201',
internalId:  '',
customField: '20090922-205612'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11601',
internalId:  '',
customField: '20090205-202921'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13585',
internalId:  '',
customField: '20100307-081821'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '30501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10552',
internalId:  '',
customField: '20090922-205024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13564',
internalId:  '',
customField: '20100307-082556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13543',
internalId:  '',
customField: '20100307-083728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13522',
internalId:  '',
customField: '20100307-135103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13501',
internalId:  '',
customField: '20100307-135328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10901',
internalId:  '',
customField: '20100312-075249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30501',
internalId:  '',
customField: '20100419-151913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10741',
internalId:  '',
customField: '20100419-151720'
};
webappMappings['7008']=webappMappings['7008-1651']={
webappId:    '7008',
documentId:  '11601',
internalId:  '1651',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20922',
internalId:  '',
customField: '20090317-152719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20901',
internalId:  '',
customField: '20090317-152744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12022',
internalId:  '',
customField: '20091125-144112'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12001',
internalId:  '',
customField: '20090204-214058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14801',
internalId:  '',
customField: '20100312-075403'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INVHE8';
var companyName   = 'The+Shells+Villa+on+Siesta+Key';
var htmlTitle	  = 'The+Shells+Villa+on+Siesta+Key';
var metaKeywords  = 'Siesta+Key%2C+Shells+Villa%2C+Beach+Rd.%2C+Sarasota%2C+Siesta+Key+Beach%2C+Siesta+Key+Village%2C+Siesta+Village%2C+Siesta+Beach%2C+Drum+Circle%2C+sunset%2C+best+sand%2C+gulf+coast%2C+walk+to+beach%2C+villa%2C+best+beach%2C+quartz+sand%2C+finest+sand';
var metaContents  = 'The+Shells+Villa+on+Siesta+Key.++Great+location+and+a+luxury+home.++3+BR%2C+2.5+bath+home+with+private+beach+access.++Steps+from+beach+and+village.++Located+on+Beach+Rd.+near+Ocean+Blvd.++';
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();
};
