/* [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','1301',jdecode('Home'),jdecode(''),'/1301.html','true',[],''],
	['PAGE','1352',jdecode('Maui+Dressage+Academy'),jdecode(''),'/1352/index.html','true',[ 
		['PAGE','1373',jdecode('The+DressageTeaching+Staff'),jdecode(''),'/1352/1373.html','true',[],''],
		['PAGE','19589',jdecode('Dressage+Calender'),jdecode(''),'/1352/19589.html','true',[],'']
	],''],
	['PAGE','1394',jdecode('Protea+Gift+Box%26%23x27%3Bs'),jdecode(''),'/1394/index.html','true',[ 
		['PAGE','1415',jdecode('Supreme+Protea+Gift+Box'),jdecode(''),'/1394/1415.html','true',[],''],
		['PAGE','1436',jdecode('Delux+Protea+Gift+Box'),jdecode(''),'/1394/1436.html','true',[],''],
		['PAGE','1478',jdecode('Delivery+service'),jdecode(''),'/1394/1478.html','true',[],'']
	],''],
	['PAGE','19518',jdecode('Oahu+Beach+House+Rental'),jdecode(''),'/19518.html','true',[],''],
	['PAGE','19871',jdecode('Beach+House+Photo%26%23x27%3Bs'),jdecode(''),'/19871.html','true',[],''],
	['PAGE','20186',jdecode('North+Shore+Attractions'),jdecode(''),'/20186.html','true',[],''],
	['PAGE','1499',jdecode('Contact'),jdecode(''),'/1499/index.html','true',[ 
		['PAGE','7501',jdecode('Contact+%28follow+up+page%29'),jdecode(''),'/1499/7501.html','false',[],'']
	],''],
	['PAGE','6706',jdecode('Guestbook'),jdecode(''),'/6706.html','true',[],''],
	['PAGE','19527',jdecode('LINKS'),jdecode(''),'/19527.html','true',[],'']];
var siteelementCount=15;
theSitetree.topTemplateName='Round';
theSitetree.paletteFamily='339966';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='441';
theSitetree.graphicsetId='491';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='72c6a1';
var theTemplate={
				name: 			'Round',
				paletteFamily: 	'339966',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'441',
				graphicsetId: 	'491',
				contentColor: 	'000000',
				contentBGColor: '72c6a1',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'72c6a1',
				b_color: 		'339966',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1352',
internalId:  '',
customField: '20090320-143038'
};
webappMappings['1002']=webappMappings['1002-6706AHW050INEEZU']={
webappId:    '1002',
documentId:  '6706',
internalId:  '6706AHW050INEEZU',
customField: 'icq=false'
};
webappMappings['1001']=webappMappings['1001-ahw050ineezuac40e27a19cb7b60']={
webappId:    '1001',
documentId:  '1499',
internalId:  'ahw050ineezuac40e27a19cb7b60',
customField: ''
};
webappMappings['1001']=webappMappings['1001-ahw050ineezuac40e27a19cb7b60']={
webappId:    '1001',
documentId:  '7501',
internalId:  'ahw050ineezuac40e27a19cb7b60',
customField: 'followUp'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1301',
internalId:  '',
customField: '20090320-143239'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1373',
internalId:  '',
customField: '20090309-222242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1394',
internalId:  '',
customField: '20090309-223006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1415',
internalId:  '',
customField: '20090309-223401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1436',
internalId:  '',
customField: '20090309-223454'
};
webappMappings['1501']=webappMappings['1501-3785307']={
webappId:    '1501',
documentId:  '1301',
internalId:  '3785307',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1478',
internalId:  '',
customField: '20090309-223948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1499',
internalId:  '',
customField: '20080112-193513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7501',
internalId:  '',
customField: '20080112-193720'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6706',
internalId:  '',
customField: '20080112-041651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19871',
internalId:  '',
customField: '20090309-224206'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19589',
internalId:  '',
customField: '20090309-222844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19518',
internalId:  '',
customField: '20090309-224105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19527',
internalId:  '',
customField: '20090127-023528'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20186',
internalId:  '',
customField: '20090326-201826'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INEEZU';
var companyName   = 'MAUI+DRESSAGE+%26+PROTEA+FLOWER+FARM';
var htmlTitle	  = 'www.mauiproteaflowers.com';
var metaKeywords  = 'Protea+flowers%2CMaui+Protea%2Cexotic+flowers%2CFresh+cut%2CDirect+from+the+Grower%2C+King+Protea%2C+Pincushion+varieties%2C+Maui+Gold%2CGift+Box%2CPincushion+Bouquet%2CAssortment+Gift+Box%2CSupreme+Gift+Box%2CDelux+Protea+Gift+Box%2CMaui+Dressage+lessons%2CHannoverians%2Cvisit+Maui%2Cdressage+education%2C+custom+dressage+lessons%2CHau+Tree+Cottage%2C+Hawaii+beach+rental%2C+North+Shore+beach+rental%2COahu+beach+rental.+The+beach+house+rental.+Best+beach+in+the+world.+Paradise.';
var metaContents  = 'Maui+Dressage+and+Protea+Flowers+Farm.+Beautiful%2C+hand+picked%2C+fresh+cut+Protea+flower+gift+boxs.+Visit+Maui+for+custom+Dressage+lessons+on+homebred+Hannoverians.+Hawaii+Beach+House+rental+on+the+North+Shore+of+Oahu.';
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();
};

