/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],''],
	['PAGE','452',jdecode('About+Us'),jdecode(''),'/452.html','true',[],''],
	['PAGE','473',jdecode('USA+Central+%283%29'),jdecode(''),'/473.html','true',[],''],
	['PAGE','5701',jdecode('USA+East+%281%29'),jdecode(''),'/5701.html','true',[],''],
	['PAGE','515',jdecode('USA+South+%285%29'),jdecode(''),'/515.html','true',[],''],
	['PAGE','536',jdecode('USA+West+%283%29'),jdecode(''),'/536.html','true',[],''],
	['PAGE','599',jdecode('How+to+Make+Offers'),jdecode(''),'/599.html','true',[],''],
	['PAGE','620',jdecode('Favorite+Links'),jdecode(''),'/620.html','true',[],'']];
var siteelementCount=8;
theSitetree.topTemplateName='Palette';
theSitetree.paletteFamily='FBD657';
theSitetree.keyvisualId='9344';
theSitetree.keyvisualName='kv_9344.jpg';
theSitetree.fontsetId='17416';
theSitetree.graphicsetId='12794';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Palette',
				paletteFamily: 	'FBD657',
				keyvisualId: 	'9344',
				keyvisualName: 	'kv_9344.jpg',
				fontsetId: 		'17416',
				graphicsetId: 	'12794',
				contentColor: 	'000000',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20080405-161114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20081115-143245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20070814-223756'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20070814-222633'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20070814-224738'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20070814-224150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '599',
internalId:  '',
customField: '20070908-140800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '620',
internalId:  '',
customField: '20091024-182504'
};
var canonHostname = 'wsc1.brinkster.com';
var accountId     = 'ABRI10IN3TW0';
var companyName   = 'By+TRI+West+Timeshare+Resales-Rentals+International';
var htmlTitle	  = 'Hyatt+Timeshare+Broker';
var metaKeywords  = 'Hyatt+Vacation+Club%2C+buy+Hyatt+Vacation+Club%2C+sell+Hyatt+Vacation+Club%2C+rent+Hyatt+Vacation+Club%2C+upscale+timeshares+and+fractionals.+TRI+West+is+a+licensed+real+estate+broker+specializing+in+the+resale+and+rental+of+Residence+Club+properties+at+Four+Seasons+Residence+Club+at+Aviara+in+Carlsbad+California+and+at+Scottsdale+Troon+North+in+Arizona.+Mario+Collura%2C+President+of+TRI+West%2C+was+a+Preferred+Resale+Broker+from+2003+to+2008.';
var metaContents  = 'Mario+Collura%2C+President+of+TRI+West%2C+is+a+Timeshare+Resale+Broker+recommended+and+referred+by+a+number+of+resorts%2C+management+companies+and+homeowners+associations.This+site+will++provide+you+access+to+information+regarding+buying%2C+reselling+and+renting+your+Hyatt+Vacation+Club+timeshare.+The+emphasis+of+this+site+is+to+provide+you+access+to+quality+information+for+your+Hyatt+Vacation+Club+timeshare+sale+or+purchase.+TRI+West+is+a+licensed+real+estate+broker+specializing+in+the+resale+and+rental+of+Residence+Club+properties+at+Four+Seasons+Residence+Club+at+Aviara+in+Carlsbad+California+and+at+Scottsdale+Troon+North+in+Arizona.+Mario+Collura%2C+President+of+TRI+West%2C+was+a+Preferred+Resale+Broker+from+2003+to+2008.';
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();
};
