/* [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','601',jdecode('Home'),jdecode(''),'/601.html','true',[],'',''],
	['PAGE','30612',jdecode('Travel+Inquiry+Form'),jdecode(''),'/30612.html','true',[],'',''],
	['PAGE','30712',jdecode('2010+Passion+Play'),jdecode(''),'/30712/index.html','true',[ 
		['PAGE','31112',jdecode('Oberammergau%2CGermany'),jdecode(''),'/30712/31112.html','true',[],'','']
	],'',''],
	['PAGE','30733',jdecode('Passport+Information'),jdecode(''),'/30733.html','true',[],'',''],
	['PAGE','32212',jdecode('Travel+Photo+Album'),jdecode(''),'/32212/index.html','true',[ 
		['PAGE','33112',jdecode('Arizona+Photos'),jdecode(''),'/32212/33112.html','true',[],'',''],
		['PAGE','33133',jdecode('England+Photos'),jdecode(''),'/32212/33133.html','true',[],'',''],
		['PAGE','47712',jdecode('Estonia+Photos'),jdecode(''),'/32212/47712.html','true',[],'',''],
		['PAGE','47733',jdecode('Finland+Photos'),jdecode(''),'/32212/47733.html','true',[],'',''],
		['PAGE','47754',jdecode('New+York+Photos'),jdecode(''),'/32212/47754.html','true',[],'',''],
		['PAGE','47775',jdecode('Norway+Photos'),jdecode(''),'/32212/47775.html','true',[],'',''],
		['PAGE','47796',jdecode('Puerto+Rico+Photos'),jdecode(''),'/32212/47796.html','true',[],'',''],
		['PAGE','47817',jdecode('Russia+Photos'),jdecode(''),'/32212/47817.html','true',[],'',''],
		['PAGE','47838',jdecode('St.+Thomas+Photos'),jdecode(''),'/32212/47838.html','true',[],'',''],
		['PAGE','47859',jdecode('Sweden+Photos'),jdecode(''),'/32212/47859.html','true',[],'',''],
		['PAGE','47880',jdecode('Tulum+Photos'),jdecode(''),'/32212/47880.html','true',[],'','']
	],'',''],
	['PAGE','60012',jdecode('Contact%2FTravel+Links'),jdecode(''),'/60012.html','true',[],'',''],
	['PAGE','69512',jdecode('Sandals+Vacations'),jdecode(''),'/69512.html','true',[],'',''],
	['PAGE','72912',jdecode('Beaches+Vacations'),jdecode(''),'/72912.html','true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Amaze';
theSitetree.paletteFamily='3F7177';
theSitetree.keyvisualId='2433';
theSitetree.keyvisualName='urlaub.jpg';
theSitetree.fontsetId='397';
theSitetree.graphicsetId='447';
theSitetree.contentColor='DDDDDD';
theSitetree.contentBGColor='3F7177';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Amaze',
				paletteFamily: 	'3F7177',
				keyvisualId: 	'2433',
				keyvisualName: 	'urlaub.jpg',
				fontsetId: 		'397',
				graphicsetId: 	'447',
				contentColor: 	'DDDDDD',
				contentBGColor: '3F7177',
				a_color: 		'3F7177',
				b_color: 		'2F5358',
				c_color: 		'3268E2',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30712',
internalId:  '',
customField: '20090715-191538'
};
webappMappings['7008']=webappMappings['7008-3972']={
webappId:    '7008',
documentId:  '30612',
internalId:  '3972',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20100610-110453'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33112',
internalId:  '',
customField: '20090715-204018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32212',
internalId:  '',
customField: '20090713-015953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47733',
internalId:  '',
customField: '20090713-020524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47712',
internalId:  '',
customField: '20090713-020432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47754',
internalId:  '',
customField: '20090713-020625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30733',
internalId:  '',
customField: '20090715-144311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31112',
internalId:  '',
customField: '20090712-201857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30612',
internalId:  '',
customField: '20090713-021242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33133',
internalId:  '',
customField: '20090713-020344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47775',
internalId:  '',
customField: '20090713-020724'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47796',
internalId:  '',
customField: '20090713-020826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47817',
internalId:  '',
customField: '20090713-020924'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47838',
internalId:  '',
customField: '20090713-021020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47859',
internalId:  '',
customField: '20090713-021124'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47880',
internalId:  '',
customField: '20090713-021213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60012',
internalId:  '',
customField: '20090719-033328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72912',
internalId:  '',
customField: '20090719-043123'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69512',
internalId:  '',
customField: '20090719-045135'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INET0W';
var companyName   = 'Ready+4+Adventure+Travel+Agency';
var htmlTitle	  = 'Ready+4+Adventure+Travel+Agency';
var metaKeywords  = '%2Ftravel%2Fcruise%2Fflorida%2Fnaples%2Fcaribbean%2Fcarnival%2Fmexico%2Fgrand+canyon%2Flas+vegas%2Fhotels%2Ftransportation';
var metaContents  = 'Travel+Agency+Naples+Florida';
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();
};

