/* [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','77601',jdecode('General+Travel+Inquiry'),jdecode(''),'/77601.html','true',[],''],
	['PAGE','39422',jdecode('Cruises+Inquiry'),jdecode(''),'/39422.html','true',[],''],
	['PAGE','85501',jdecode('Tours+Inquiry'),jdecode(''),'/85501.html','true',[],''],
	['PAGE','85601',jdecode('Marketing+%26+Designs'),jdecode(''),'/85601.html','true',[],''],
	['PAGE','8401',jdecode('old+home+page'),jdecode(''),'/8401.html','false',[],''],
	['PAGE','1901',jdecode('Plan+your+trip'),jdecode(''),'/1901.html','false',[],''],
	['PAGE','2036',jdecode('About+us'),jdecode(''),'/2036.html','false',[],'']];
var siteelementCount=7;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='555454';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10461';
theSitetree.graphicsetId='10892';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Alpha',
				paletteFamily: 	'555454',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10461',
				graphicsetId: 	'10892',
				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: 		'555454',
				e_color: 		'555454',
				f_color: 		'555454',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1901',
internalId:  '',
customField: '20090901-120911'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39422',
internalId:  '',
customField: '20100325-142211'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2036',
internalId:  '',
customField: '20091120-161632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85501',
internalId:  '',
customField: '20100325-143755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77601',
internalId:  '',
customField: '20100325-144618'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '77601',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '77601',
internalId:  '1501',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-11563']={
webappId:    '7008',
documentId:  '8401',
internalId:  '11563',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85601',
internalId:  '',
customField: '20100325-145418'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8401',
internalId:  '',
customField: '20091015-121017'
};
webappMappings['7008']=webappMappings['7008-11185']={
webappId:    '7008',
documentId:  '77601',
internalId:  '11185',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '8401',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-11580']={
webappId:    '7008',
documentId:  '85501',
internalId:  '11580',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-11605']={
webappId:    '7008',
documentId:  '39422',
internalId:  '11605',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '39422',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '85601',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '85501',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '1901',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2036',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '77601',
internalId:  '',
customField: 'language:en;country:US;'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN2H0O';
var companyName   = 'Greenwave+Travel%2C+LLC';
var htmlTitle	  = 'Greenwave+Travel%3A+Resorts%2C+Cruises%2C+Tours%2C+Honeymoons%2C+and+Disney+Vacations';
var metaKeywords  = 'Greenville%3B+Easley%3B+SC%3B+All+Inclusive+Resorts%3B+Disney%3B+Las+Vegas%3B+travel%3B+cruises%3B+tours%3B+honeymoons%3B+Cheap+vacations+deals%3B+getaways%3B+Air%3B+Cancun%3B+Jamaica%3B+Aruba%3B+Caribbean%3B+London%3B+Tokyo%3B+Europe%3B+Italy%3B+Australia%3B+Amsterdam';
var metaContents  = 'Greenwave+Travel+is+a+full+service+travel+specialist+agency+with+experienced+agents.+Our+agents+have+trained+extensively+and+go+on+frequent+site+inspections.+Come+let+us+save+you+money+on+your+next+vacation+while+ensuring+that+if+any+problem+arises+we+will+be+there+every+step+of+the+way.';
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();
};
