/* [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','801',jdecode('Home'),jdecode(''),'/801.html','true',[],''],
	['PAGE','852',jdecode('Room+%26+Rate+Info'),jdecode(''),'/852/index.html','true',[ 
		['PAGE','936',jdecode('The+Sunset+Suite'),jdecode(''),'/852/936.html','true',[],''],
		['PAGE','873',jdecode('Valley+View+1'),jdecode(''),'/852/873.html','true',[],''],
		['PAGE','894',jdecode('Valley+View+2'),jdecode(''),'/852/894.html','true',[],''],
		['PAGE','915',jdecode('Valley+View+3'),jdecode(''),'/852/915.html','true',[],''],
		['PAGE','957',jdecode('East+End+Room'),jdecode(''),'/852/957.html','true',[],'']
	],''],
	['PAGE','1104',jdecode('Availability+%26+Reservations+'),jdecode(''),'/1104.html','true',[],''],
	['PAGE','26101',jdecode('Special+Deals'),jdecode(''),'/26101.html','true',[],''],
	['PAGE','27201',jdecode('Group+Packages'),jdecode(''),'/27201.html','true',[],''],
	['PAGE','30708',jdecode('Guestbook+Comments'),jdecode(''),'/30708.html','true',[],''],
	['PAGE','1020',jdecode('Prosser%26%23x27%3Bs+Calendar+of+Events'),jdecode(''),'/1020.html','true',[],''],
	['PAGE','978',jdecode('Check+In+%2F+Check+Out'),jdecode(''),'/978.html','true',[],''],
	['PAGE','1041',jdecode('Hike%2C+Bike%2C+Kayak%2C+etc.++'),jdecode(''),'/1041.html','true',[],''],
	['PAGE','30074',jdecode('Add+a+Wine+Tour+or+Massage'),jdecode(''),'/30074.html','true',[],''],
	['PAGE','30221',jdecode('Restaurants'),jdecode(''),'/30221.html','true',[],''],
	['PAGE','8001',jdecode('Directions+to+the+Inn'),jdecode(''),'/8001.html','true',[],''],
	['PAGE','2501',jdecode('Map'),jdecode(''),'/2501.html','true',[],''],
	['PAGE','21101',jdecode('Links'),jdecode(''),'/21101.html','true',[],''],
	['PAGE','1083',jdecode('Contact+Us'),jdecode(''),'/1083.html','true',[],'']];
var siteelementCount=20;
theSitetree.topTemplateName='Capri';
theSitetree.paletteFamily='943434';
theSitetree.keyvisualId='7188';
theSitetree.keyvisualName='kv_7188.jpg';
theSitetree.fontsetId='16409';
theSitetree.graphicsetId='12137';
theSitetree.contentColor='5D1818';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Capri',
				paletteFamily: 	'943434',
				keyvisualId: 	'7188',
				keyvisualName: 	'kv_7188.jpg',
				fontsetId: 		'16409',
				graphicsetId: 	'12137',
				contentColor: 	'5D1818',
				contentBGColor: 'FFFFFF',
				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: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '801',
internalId:  '1006',
customField: '1006'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '2501',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '801',
internalId:  '',
customField: '20090914-023142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '852',
internalId:  '',
customField: '20090829-140702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '936',
internalId:  '',
customField: '20090829-141410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '873',
internalId:  '',
customField: '20090829-141121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '894',
internalId:  '',
customField: '20090829-141208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '915',
internalId:  '',
customField: '20090829-141304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '957',
internalId:  '',
customField: '20090829-140936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1104',
internalId:  '',
customField: '20090829-150859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26101',
internalId:  '',
customField: '20090627-190138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30074',
internalId:  '',
customField: '20090330-115749'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27201',
internalId:  '',
customField: '20090829-142451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1020',
internalId:  '',
customField: '20090326-014251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '978',
internalId:  '',
customField: '20090726-235358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1041',
internalId:  '',
customField: '20080721-173635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8001',
internalId:  '',
customField: '20080721-174323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30221',
internalId:  '',
customField: '20090512-192315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2501',
internalId:  '',
customField: '20080414-160431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21101',
internalId:  '',
customField: '20080223-060341'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1083',
internalId:  '',
customField: '20090813-153256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30708',
internalId:  '',
customField: '20090829-155659'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INEE9C';
var companyName   = 'Sunset+House+Wine+Country+Inn+';
var htmlTitle	  = 'Sunset+House+Wine+Country+Inn';
var metaKeywords  = 'Lodging%2C+hotel%2C+motel%2C+Inn%2C+Washington+Wine+Country%2C+Prosser%2C+Bed++Breakfast%2C+bed+and+breakfast%2C+wine+country+bed+and+breakfast%2C+Yakima+Valley+bed+and+breakfast%2C+Prosser+bed+and+breakfast%2C+Prosser+wineries%2C+Allergy+free%2C+Yakima+Valley+wineries%2C+Washington+wine+tours%2C+Washington+wine+country+bed+and+breakfasts++Luxurious+lodging.++4+star+rated+bed+and+breakfast%2C+Red+Wine%2C+Wine+tours%2C+Resort%2C+360+degree+view%2C+river+view%2C+valley+view%2C+mountain+view%2C+massage%2C+spa%2C+Resort+Inn%2C+Red+Wine+and+Chocolate%2C+Spring+Barrel+Tasting%2C+Christmas+in+Wine+Country%2C+Prosser+Scottish+Festival%2C+Art+Walk+and+Wine+Gala';
var metaContents  = 'Hilltop+Bed+and+Breakfast+in+historic+Prosser%2C+WA+at+the+heart+of+Washington+Wine+Country+in+the+Yakima+Valley.++Wine+in+rooms%2C+Wine+Tours%2C+Full+Breakfasts%2C+360+degree+View%2C+luxurious+lodging%2C+pool%2C+hot+tubs%2C+patios%2C+Yakima+Valley%2C+Washington+Wine+Country+location.++';
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();
};
