/* [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=[ 
	['ITEM','21602',jdecode('Tahiti+Offers'),jdecode(''),'http://www.investinromance.com/tahiti/default.asp?agid=25024&wid=17','true',[],'','_blank'],
	['ITEM','21601',jdecode('Romance+Travel'),jdecode(''),'http://www.investinromance.com/islandsinthesun/default.asp?id=25024','true',[],'','_blank'],
	['ITEM','21901',jdecode('Vacations'),jdecode(''),'http://www.pleasantholidays.com/PleasantHolidaysWeb/PartnerLinkCmd.do?Partner_PartnerOID=partnerCode__.__61285__..__webSerialNumber__.__2627','true',[],'','_blank'],
	['ITEM','21603',jdecode('Week+Sale'),jdecode(''),'http://www.australiawalkabout.com/default.asp?agid=25024&wid=11','true',[],'','_blank'],
	['PAGE','18701',jdecode('Service'),jdecode(''),'/18701.html','true',[],'',''],
	['PAGE','9201',jdecode('Travel+Request'),jdecode(''),'/9201.html','true',[],'',''],
	['PAGE','2722',jdecode('About+us'),jdecode(''),'/2722.html','true',[],'',''],
	['PAGE','18001',jdecode('Contact'),jdecode(''),'/18001.html','true',[],'',''],
	['PAGE','2252',jdecode('Home'),jdecode(''),'/2252.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Curve';
theSitetree.paletteFamily='87A6E8';
theSitetree.keyvisualId='5774';
theSitetree.keyvisualName='kv_5774.jpg';
theSitetree.fontsetId='11085';
theSitetree.graphicsetId='11858';
theSitetree.contentColor='464646';
theSitetree.contentBGColor='9BBBFD';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Curve',
				paletteFamily: 	'87A6E8',
				keyvisualId: 	'5774',
				keyvisualName: 	'kv_5774.jpg',
				fontsetId: 		'11085',
				graphicsetId: 	'11858',
				contentColor: 	'464646',
				contentBGColor: '9BBBFD',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2252',
internalId:  '',
customField: '20090206-212927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2722',
internalId:  '',
customField: '20090209-152109'
};
webappMappings['7008']=webappMappings['7008-10558']={
webappId:    '7008',
documentId:  '9201',
internalId:  '10558',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18701',
internalId:  '',
customField: '20090207-020827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9201',
internalId:  '',
customField: '20090207-021510'
};
webappMappings['7008']=webappMappings['7008-13330']={
webappId:    '7008',
documentId:  '18001',
internalId:  '13330',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18001',
internalId:  '',
customField: '20090207-021621'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INEYT7';
var companyName   = 'Tahiti+Travel+Specialist++650-610-8782';
var htmlTitle	  = 'Tahiti+Luxury+Vacations+%7C+Tahiti+Luxury+Honeymoons+%7C+Tahiti+Luxury+Weddings+%7C+Tahiti+Romantic+Getaway+';
var metaKeywords  = 'tahiti%2C+bora+bora%2C+moorea%2C+romantic%2C+honeymoon%2C+vacation%2C+cruise%2C+huahine%2C+raiatea%2C+tahaa%2C+rangiroa%2C+manihi%2C+tikehau%2C+fakarava%2C+nuku+hiva%2C+hiva+oa%2C+marquesas%2C+overwater+bungalow%2C+tahitian%2C+polynesia%2C+scuba+diving%2C+snorkel%2C+south+pacific%2C+island+paradise%2C+destination+wedding%2C+honeymoon+planning%2C+family+vacations%2Cluxury+voyages%2C+luxury+cruises%2C+luxury+vacations%2C+luxury+tours%2C+luxury+travel%2C+voyages%2C+luxury+voyage%2C+yachts%2C+cruises%2C+private+yachts%2C+private+jets+';
var metaContents  = 'Tahiti%2C+Bora+Bora%2C+Moorea+and+every+other+Island+in+this+South+Pacific+Paradise%2C+Destination+wedding%2C+Cruise%2C+Vacation%2C+Family+Vacations+and+Honeymoon+planning.+Luxury+honeymoons+and+vacations+planning.+';
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();
};

