/* [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','5001',jdecode('Home'),jdecode(''), jdecode('%2F5001.html'), 'true',[],'',''],
	['PAGE','5101',jdecode('Accommodations'),jdecode(''), jdecode('%2F5101.html'), 'true',[],'',''],
	['PAGE','8001',jdecode('Lodge+Rules'),jdecode(''), jdecode('%2F8001.html'), 'true',[],'',''],
	['PAGE','5122',jdecode('Rates%2FReservations'),jdecode(''), jdecode('%2F5122.html'), 'true',[],'',''],
	['PAGE','8401',jdecode('Directions'),jdecode(''), jdecode('%2F8401.html'), 'true',[],'',''],
	['PAGE','5143',jdecode('Helpful+information'),jdecode(''), jdecode('%2F5143.html'), 'true',[],'',''],
	['PAGE','8701',jdecode('Photo+Gallery'),jdecode(''), jdecode('%2F8701.html'), 'true',[],'',''],
	['PAGE','7401',jdecode('Contact+Us'),jdecode(''), jdecode('%2F7401.html'), 'true',[],'',''],
	['PAGE','40229',jdecode('Guest+Book'),jdecode(''), jdecode('%2F40229.html'), 'true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Enjoy';
theSitetree.paletteFamily='BB9C60';
theSitetree.keyvisualId='2252';
theSitetree.keyvisualName='reise2.jpg';
theSitetree.fontsetId='364';
theSitetree.graphicsetId='417';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='BB9C60';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRNC'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Enjoy',
				paletteFamily: 	'BB9C60',
				keyvisualId: 	'2252',
				keyvisualName: 	'reise2.jpg',
				fontsetId: 		'364',
				graphicsetId: 	'417',
				contentColor: 	'000000',
				contentBGColor: 'BB9C60',
				a_color: 		'BB9C60',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20081214-204058'
};
webappMappings['1002']=webappMappings['1002-40229aendu0inejfp']={
webappId:    '1002',
documentId:  '40229',
internalId:  '40229aendu0inejfp',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5101',
internalId:  '',
customField: '20110115-190237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8001',
internalId:  '',
customField: '20081008-135721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5122',
internalId:  '',
customField: '20110115-184941'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5143',
internalId:  '',
customField: '20081007-100452'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8701',
internalId:  '',
customField: '20101229-182154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8401',
internalId:  '',
customField: '20090405-132643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7401',
internalId:  '',
customField: '20081214-203507'
};
webappMappings['1501']=webappMappings['1501-12539697']={
webappId:    '1501',
documentId:  '5001',
internalId:  '12539697',
customField: '1501'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INEJFP';
var companyName   = 'Lone+Pine+Ridge';
var htmlTitle	  = 'Lone+Pine+Ridge';
var metaKeywords  = 'Lone+Pine+Ridge+Hurley+WI%2C+Island+Lake+WI%2C+Vacation+Rentals%2C+Geachs+Lone+Pine+Ridge%2C+Lone+Pine+Ridge+WI%2C+Lone+Pine+Ridge%2C+www.LonePineRidge.net%2C+Fishing+WI%2C+Snowmobiling+WI%2C+ATVing+WI%2C+lodging+WI%2Cvacation+lodge';
var metaContents  = 'Lone+Pine+Ridge+is+located+on+Island+Lake+near+Hurley+WI.++A+quaint+rental+vacation+lodge+available+year+around.';
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();
};

