/* [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','15801',jdecode('MAIN'),jdecode(''),'/15801.html','true',[],''],
	['PAGE','27601',jdecode('HOTEL+PHOTOS'),jdecode(''),'/27601.html','true',[],''],
	['PAGE','90112',jdecode('AMENITIES'),jdecode(''),'/90112.html','true',[],''],
	['PAGE','56101',jdecode('FREQUENT+STAY+PROGRAM'),jdecode(''),'/56101.html','true',[],''],
	['PAGE','15873',jdecode('CONFERENCES%2FEVENTS'),jdecode(''),'/15873.html','true',[],''],
	['PAGE','15852',jdecode('PACKAGES'),jdecode(''),'/15852/index.html','false',[ 
		['PAGE','75901',jdecode('Business+Traveler'),jdecode(''),'/15852/75901.html','true',[],''],
		['PAGE','77101',jdecode('Summer+Stay+%26+Play'),jdecode(''),'/15852/77101.html','true',[],''],
		['PAGE','77122',jdecode('Relax...'),jdecode(''),'/15852/77122.html','true',[],''],
		['PAGE','77143',jdecode('Romantic+Getaway'),jdecode(''),'/15852/77143.html','true',[],''],
		['PAGE','77164',jdecode('Pet+Package'),jdecode(''),'/15852/77164.html','true',[],'']
	],''],
	['PAGE','100112',jdecode('RETURNING+GUEST%3F'),jdecode(''),'/100112.html','true',[],''],
	['PAGE','22701',jdecode('ONLINE+RESERVATIONS'),jdecode(''),'/22701.html','true',[],''],
	['PAGE','85101',jdecode('GOVERNMENT+%26+MILITARY'),jdecode(''),'/85101.html','true',[],''],
	['PAGE','27622',jdecode('MANNY%26%23x27%3BS+IS+SPORTS%21'),jdecode(''),'/27622.html','true',[],''],
	['PAGE','40501',jdecode('PET+POLICY'),jdecode(''),'/40501.html','true',[],''],
	['PAGE','15894',jdecode('LOCATION'),jdecode(''),'/15894.html','true',[],''],
	['PAGE','91812',jdecode('MAIN+STREET+STUDIOS'),jdecode(''),'/91812.html','true',[],'']];
var siteelementCount=18;
theSitetree.topTemplateName='Case';
theSitetree.paletteFamily='CE551F';
theSitetree.keyvisualId='11331';
theSitetree.keyvisualName='kv_11331.jpg';
theSitetree.fontsetId='31938';
theSitetree.graphicsetId='13782';
theSitetree.contentColor='463C38';
theSitetree.contentBGColor='F6FBFE';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Case',
				paletteFamily: 	'CE551F',
				keyvisualId: 	'11331',
				keyvisualName: 	'kv_11331.jpg',
				fontsetId: 		'31938',
				graphicsetId: 	'13782',
				contentColor: 	'463C38',
				contentBGColor: 'F6FBFE',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15801',
internalId:  '',
customField: '20100401-103918'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '15894',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15873',
internalId:  '',
customField: '20090408-214923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22701',
internalId:  '',
customField: '20090531-111452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15894',
internalId:  '',
customField: '20090529-211415'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15852',
internalId:  '',
customField: '20090403-224628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27601',
internalId:  '',
customField: '20090531-110743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27622',
internalId:  '',
customField: '20100401-104000'
};
webappMappings['7008']=webappMappings['7008-10496']={
webappId:    '7008',
documentId:  '22701',
internalId:  '10496',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56101',
internalId:  '',
customField: '20090531-111352'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '15801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75901',
internalId:  '',
customField: '20090403-222820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40501',
internalId:  '',
customField: '20090331-175951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77101',
internalId:  '',
customField: '20090403-223615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77122',
internalId:  '',
customField: '20090403-223615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77143',
internalId:  '',
customField: '20090403-223615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77164',
internalId:  '',
customField: '20090403-223615'
};
webappMappings['7060']=webappMappings['7060-773c270274b7a389173a0bd38119451c']={
webappId:    '7060',
documentId:  '27601',
internalId:  '773c270274b7a389173a0bd38119451c',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85101',
internalId:  '',
customField: '20090529-211017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90112',
internalId:  '',
customField: '20090531-111033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91812',
internalId:  '',
customField: '20100325-101652'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100112',
internalId:  '',
customField: '20100402-095322'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INE84Q';
var companyName   = 'QUALITY+INN%2C+SUITES+%26+CONFERENCE+CENTER%2C+STATESBORO';
var htmlTitle	  = 'Quality+Inn+%26+Suites%2C+Statesboro';
var metaKeywords  = '';
var metaContents  = '';
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();
};
