/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','6468',jdecode('The+Rooms'),jdecode(''),'/6468.html','false',[],'',''],
	['PAGE','8301',jdecode('Arrival'),jdecode(''),'/8301.html','true',[],'',''],
	['PAGE','8501',jdecode('Our+Hotel'),jdecode(''),'/8501/index.html','true',[ 
		['PAGE','8522',jdecode('The+Rooms'),jdecode(''),'/8501/8522.html','true',[],'',''],
		['PAGE','8543',jdecode('The+Restaurant'),jdecode(''),'/8501/8543.html','true',[],'',''],
		['PAGE','8564',jdecode('Fitness%2FWellness'),jdecode(''),'/8501/8564.html','true',[],'',''],
		['PAGE','8585',jdecode('Service'),jdecode(''),'/8501/8585.html','true',[],'','']
	],'',''],
	['PAGE','11601',jdecode('Area+Photo'),jdecode(''),'/11601.html','true',[],'',''],
	['PAGE','23801',jdecode('Map%2FDirections'),jdecode(''),'/23801.html','true',[],'',''],
	['PAGE','9601',jdecode('Online+reservation'),jdecode(''),'/9601.html','true',[],'',''],
	['PAGE','9801',jdecode('Price+and+service'),jdecode(''),'/9801.html','true',[],'',''],
	['PAGE','10101',jdecode('About+us'),jdecode(''),'/10101.html','true',[],'',''],
	['PAGE','5406',jdecode('Guestbook'),jdecode(''),'/5406/index.html','true',[ 
		['PAGE','5401',jdecode('Read+Guestbook'),jdecode(''),'/5406/5401.html','false',[],'','']
	],'',''],
	['PAGE','11622',jdecode('Our+neighbourhood'),jdecode(''),'/11622.html','true',[],'',''],
	['PAGE','23501',jdecode('Links'),jdecode(''),'/23501.html','true',[],'',''],
	['PAGE','32712',jdecode('Events'),jdecode(''),'/32712.html','true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='3E6E72';
theSitetree.keyvisualId='1748';
theSitetree.keyvisualName='freizeit.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='354';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3E6E72';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'3E6E72',
				keyvisualId: 	'1748',
				keyvisualName: 	'freizeit.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'354',
				contentColor: 	'FFFFFF',
				contentBGColor: '3E6E72',
				a_color: 		'3E6E72',
				b_color: 		'101C1D',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5406',
internalId:  '',
customField: '20090803-173818'
};
webappMappings['1002']=webappMappings['1002-5406AHW050IN3CQV']={
webappId:    '1002',
documentId:  '5406',
internalId:  '5406AHW050IN3CQV',
customField: 'icq=false'
};
webappMappings['1501']=webappMappings['1501-1121894']={
webappId:    '1501',
documentId:  '501',
internalId:  '1121894',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20110622-232838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5401',
internalId:  '',
customField: '20080531-150311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6468',
internalId:  '',
customField: '20090707-172908'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8301',
internalId:  '',
customField: '20100803-140749'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8501',
internalId:  '',
customField: '20110616-122512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8543',
internalId:  '',
customField: '20100803-145014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8564',
internalId:  '',
customField: '20100803-145253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8585',
internalId:  '',
customField: '20100803-145520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9601',
internalId:  '',
customField: '20100803-182434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9801',
internalId:  '',
customField: '20100803-182853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10101',
internalId:  '',
customField: '20100803-183216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8522',
internalId:  '',
customField: '20090803-235432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11601',
internalId:  '',
customField: '20100803-145736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11622',
internalId:  '',
customField: '20100803-184846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23501',
internalId:  '',
customField: '20110616-173940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32712',
internalId:  '',
customField: '20100803-181427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23801',
internalId:  '',
customField: '20100803-181956'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050IN3CQV';
var companyName   = 'THE+SURF+MOTEL';
var htmlTitle	  = 'The+Surf+Motel+at+Gualala+is+the+best+value+for+your+travel+dollar.';
var metaKeywords  = 'motel%2C+inn%2C+ocean+views%2C+free+hot+breakfast%2C+wild+flowers%2C+fishing%2C+abalone+diving%2C+boating%2C+golf%2C+hiking%2C+beach%2C+surfing%2C+tennis%2C+walking%2C+feathers%2C+king%2C+queen%2C+kitchen%2C+internet%2C+wifi%2C+I-pod%2C+sunsets%2C+kids%2C+family%2C+open+spaces%2C+bluffs%2C+art%2C+home%2C+triple+a%2C+food%2C+gas%2C+trails%2C+views%2C+open+space%2C+birds%2C+otters%2C+fish%2C+salmon%2C+steelheads%2C+raft%2C+romatic%2C+getaway%2C+peace%2C+green%2C+inexpensive%2C+gifts%2C+lodging%2C+hotel%2C+bed+and+breakfast%2C+river%2C+kayaks%2C+bait%2C+bones+roadhouse%2C+gualala+hotel%2C+highway+one%2C+hotels%2C+wifi%2C+surf+market%2C+trinks%2C+gualala+market.+surf+market%2C+gualala+country+inn%2C+breakers+inn%2C+sea+cliffs%2C+st+ores%2C+boating%2C+hiking%2C+senic+coast+highway%2C+discount+rooms%2C+best+value%2C+3a+discount%2C+steelhead+salmon%2C+redwood%2C+redwood+trees%2C+bluff+train%2C+biking%2C+';
var metaContents  = 'Surf+Motel+is+your+best+value+for+the+travel+dollar+on+the+North+Coast+of+California.+Rooms+start+at+%2499.00+and+a+hot+breakfast+is+served+each+day.';
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();
};

