/* [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','30501',jdecode('Home'),jdecode(''), jdecode('%2F30501.html'), 'true',[],'',''],
	['PAGE','10501',jdecode('Pictures'),jdecode(''), jdecode('%2F10501%2Findex.html'), 'true',[ 
		['PAGE','13522',jdecode('Main+Floor'),jdecode(''), jdecode('%2F10501%2F13522.html'), 'true',[],'',''],
		['PAGE','13564',jdecode('Upstairs+Floor'),jdecode(''), jdecode('%2F10501%2F13564.html'), 'true',[],'',''],
		['PAGE','13543',jdecode('Ground+Floor'),jdecode(''), jdecode('%2F10501%2F13543.html'), 'true',[],'',''],
		['PAGE','13585',jdecode('Outdoor+Areas'),jdecode(''), jdecode('%2F10501%2F13585.html'), 'true',[],'',''],
		['PAGE','55901',jdecode('Photo+Gallery'),jdecode(''), jdecode('%2F10501%2F55901.html'), 'false',[],'','']
	],'',''],
	['PAGE','14801',jdecode('Location+'),jdecode(''), jdecode('%2F14801.html'), 'true',[],'',''],
	['PAGE','13501',jdecode('Amenities'),jdecode(''), jdecode('%2F13501.html'), 'true',[],'',''],
	['PAGE','47701',jdecode('Our+Ads'),jdecode(''), jdecode('%2F47701.html'), 'true',[],'',''],
	['PAGE','10552',jdecode('Siesta+Key'),jdecode(''), jdecode('%2F10552%2Findex.html'), 'true',[ 
		['PAGE','12022',jdecode('The+Beach'),jdecode(''), jdecode('%2F10552%2F12022.html'), 'true',[],'',''],
		['PAGE','12001',jdecode('The+Village'),jdecode(''), jdecode('%2F10552%2F12001.html'), 'true',[],'',''],
		['PAGE','23201',jdecode('Around+Town'),jdecode(''), jdecode('%2F10552%2F23201.html'), 'true',[],'','']
	],'',''],
	['PAGE','63501',jdecode('About+Us'),jdecode(''), jdecode('%2F63501.html'), 'false',[],'',''],
	['PAGE','54522',jdecode('Reviews'),jdecode(''), jdecode('%2F54522.html'), 'true',[],'',''],
	['PAGE','10901',jdecode('FAQs'),jdecode(''), jdecode('%2F10901%2Findex.html'), 'true',[ 
		['PAGE','54543',jdecode('Guest+Info'),jdecode(''), jdecode('%2F10901%2F54543.html'), 'false',[],'','']
	],'',''],
	['PAGE','10741',jdecode('Rates'),jdecode(''), jdecode('%2F10741%2Findex.html'), 'true',[ 
		['PAGE','20901',jdecode('Terms+%26+Conditions'),jdecode(''), jdecode('%2F10741%2F20901.html'), 'true',[],'',''],
		['PAGE','51301',jdecode('Sample+Proposal'),jdecode(''), jdecode('%2F10741%2F51301.html'), 'true',[],'',''],
		['PAGE','20922',jdecode('Privacy+Policy'),jdecode(''), jdecode('%2F10741%2F20922.html'), 'true',[],'','']
	],'',''],
	['PAGE','11601',jdecode('Request+a+Quote'),jdecode(''), jdecode('%2F11601.html'), 'true',[],'','']];
var siteelementCount=23;
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 localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'valueweb',
  product: 'WSCSYSSSSLYTCR7V'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Caribic',
				paletteFamily: 	'7050FA',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10419',
				graphicsetId: 	'10707',
				contentColor: 	'FFFFFF',
				contentBGColor: 'B63636',
				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:  '55901',
internalId:  '',
customField: '20120107-132451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10501',
internalId:  '',
customField: '20120106-205428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23201',
internalId:  '',
customField: '20110809-105245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11601',
internalId:  '',
customField: '20120106-085427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13585',
internalId:  '',
customField: '20120109-164349'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '30501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10552',
internalId:  '',
customField: '20120106-082438'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13564',
internalId:  '',
customField: '20120109-164032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13543',
internalId:  '',
customField: '20120106-130148'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13522',
internalId:  '',
customField: '20120106-210124'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13501',
internalId:  '',
customField: '20120106-132907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10901',
internalId:  '',
customField: '20120108-095051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30501',
internalId:  '',
customField: '20120108-094320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10741',
internalId:  '',
customField: '20120108-094609'
};
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: '20110809-110934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20901',
internalId:  '',
customField: '20120106-205404'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12022',
internalId:  '',
customField: '20110810-075559'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12001',
internalId:  '',
customField: '20120109-083704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47701',
internalId:  '',
customField: '20120106-080204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51301',
internalId:  '',
customField: '20110815-141415'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14801',
internalId:  '',
customField: '20120105-212620'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63501',
internalId:  '',
customField: '20120108-095219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54522',
internalId:  '',
customField: '20120106-134319'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54543',
internalId:  '',
customField: '20120105-091308'
};
webappMappings['7060']=webappMappings['7060-7318803d7ba9e2c1d97faf40fd150f0d']={
webappId:    '7060',
documentId:  '55901',
internalId:  '7318803d7ba9e2c1d97faf40fd150f0d',
customField: 'language:en;country:US;'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INVHE8';
var companyName   = 'The+Shells+Villa';
var htmlTitle	  = 'The+Shells+Villa';
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%2C+34242%2C+vacation+rental%2C+vacation+resort%2C+hotel%2C+motel%2C';
var metaContents  = 'The+Shells+Villa+on+Siesta+Key.++Great+location+and+a+luxury+home.++3+BR%2C+2.5+bath+home+next+to+Siesta+Key+Beach.++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();
};

