/* [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(''), jdecode('%2F501.html'), 'true',[],'',''],
	['PAGE','552',jdecode('For+Rent'),jdecode(''), jdecode('%2F552%2Findex.html'), 'true',[ 
		['PAGE','594',jdecode('Vacation+Homes'),jdecode(''), jdecode('%2F552%2F594.html'), 'true',[],'',''],
		['PAGE','615',jdecode('Vacation+Condos'),jdecode(''), jdecode('%2F552%2F615.html'), 'true',[],'',''],
		['PAGE','8301',jdecode('Cedar+Key'),jdecode(''), jdecode('%2F552%2F8301.html'), 'true',[],'',''],
		['PAGE','35729',jdecode('Newport+Apartment'),jdecode(''), jdecode('%2F552%2F35729.html'), 'true',[],'',''],
		['PAGE','11801',jdecode('Yachats+Commercial+Space'),jdecode(''), jdecode('%2F552%2F11801.html'), 'true',[],'',''],
		['PAGE','573',jdecode('Yachats+Apartment'),jdecode(''), jdecode('%2F552%2F573.html'), 'true',[],'',''],
		['PAGE','35174',jdecode('Rental+Application'),jdecode(''), jdecode('%2F552%2F35174.html'), 'true',[],'','']
	],'',''],
	['PAGE','636',jdecode('For+Sale'),jdecode(''), jdecode('%2F636%2Findex.html'), 'true',[ 
		['PAGE','657',jdecode('Building+Lots'),jdecode(''), jdecode('%2F636%2F657.html'), 'true',[],'',''],
		['PAGE','36588',jdecode('Newport+4-Plex'),jdecode(''), jdecode('%2F636%2F36588.html'), 'true',[],'',''],
		['PAGE','24001',jdecode('Commercial+Building'),jdecode(''), jdecode('%2F636%2F24001.html'), 'true',[],'','']
	],'',''],
	['PAGE','678',jdecode('Yachats%2C+Oregon'),jdecode(''), jdecode('%2F678.html'), 'true',[],'',''],
	['PAGE','699',jdecode('Newport%2C+Oregon'),jdecode(''), jdecode('%2F699.html'), 'true',[],'',''],
	['PAGE','720',jdecode('LaPine%2C+Oregon'),jdecode(''), jdecode('%2F720.html'), 'true',[],'',''],
	['PAGE','36475',jdecode('Jim+Builds+Horsies'),jdecode(''), jdecode('%2F36475.html'), 'true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Enjoy';
theSitetree.paletteFamily='93A6CC';
theSitetree.keyvisualId='2251';
theSitetree.keyvisualName='reise1.jpg';
theSitetree.fontsetId='365';
theSitetree.graphicsetId='415';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='93A6CC';
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: 			'Enjoy',
				paletteFamily: 	'93A6CC',
				keyvisualId: 	'2251',
				keyvisualName: 	'reise1.jpg',
				fontsetId: 		'365',
				graphicsetId: 	'415',
				contentColor: 	'000000',
				contentBGColor: '93A6CC',
				a_color: 		'93A6CC',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20111219-144824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20111219-145017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11801',
internalId:  '',
customField: '20100727-161128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20110801-132902'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36475',
internalId:  '',
customField: '20100727-162305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '699',
internalId:  '',
customField: '20090215-153203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35729',
internalId:  '',
customField: '20111220-114443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '594',
internalId:  '',
customField: '20100729-131912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '615',
internalId:  '',
customField: '20100729-130433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8301',
internalId:  '',
customField: '20070406-210920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '636',
internalId:  '',
customField: '20110529-141147'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '657',
internalId:  '',
customField: '20110529-141647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24001',
internalId:  '',
customField: '20090221-152522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '678',
internalId:  '',
customField: '20070802-124113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '720',
internalId:  '',
customField: '20070802-125128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35174',
internalId:  '',
customField: '20110726-110322'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36588',
internalId:  '',
customField: '20101118-125358'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INE7JA';
var companyName   = 'Oceanwayside+Management%2C+LLC';
var htmlTitle	  = 'Oceanwayside+Managment%3A++Rentals+and+Sales+in+Florence%2C+Yachats%2C+Cedar+Key+and+Newport';
var metaKeywords  = 'Oceanwayside%2C+Vacation+rentals%2C+real+estate%2C+Yachats%2C+Oregon%2C+Newport%2C+Oregon%2C+LaPine%2C+Oregon%2C+Florence%2C+Oregon%2C+Cedar+Key%2C+Florida%2C+Condo+rentals%2C+commercial+property+for+sale';
var metaContents  = 'apartments+for+rent+in+the+Newport%2C+and+Yachats%2C+Oregon+area.++Vacation+rentals+in+LaPine%2C+Oregon+and+Cedar+Key%2C+Florida.++Real+estate+for+sale+in+Yachats%2C+Oregon%2C+and+Florence%2C+Oregon.+Oceanwayside+Managment%2C+';
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();
};

