/* [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','6434',jdecode('Home'),jdecode(''), jdecode('%2F6434.html'), 'true',[],'',''],
	['PAGE','6485',jdecode('Salmon'),jdecode(''), jdecode('%2F6485.html'), 'true',[],'',''],
	['PAGE','6506',jdecode('Steelhead'),jdecode(''), jdecode('%2F6506.html'), 'true',[],'',''],
	['PAGE','6527',jdecode('Sturgeon'),jdecode(''), jdecode('%2F6527.html'), 'true',[],'',''],
	['PAGE','6548',jdecode('Shad'),jdecode(''), jdecode('%2F6548.html'), 'true',[],'',''],
	['PAGE','6569',jdecode('Our+Boat'),jdecode(''), jdecode('%2F6569.html'), 'true',[],'',''],
	['PAGE','6590',jdecode('Rates'),jdecode(''), jdecode('%2F6590.html'), 'true',[],'',''],
	['PAGE','17134',jdecode('licenses'),jdecode(''), jdecode('%2F17134.html'), 'true',[],'',''],
	['PAGE','6611',jdecode('Run+Timing'),jdecode(''), jdecode('%2F6611.html'), 'true',[],'',''],
	['PAGE','6632',jdecode('About+your+guide'),jdecode(''), jdecode('%2F6632.html'), 'true',[],'',''],
	['PAGE','6653',jdecode('Contact+Information'),jdecode(''), jdecode('%2F6653.html'), 'true',[],'',''],
	['PAGE','6674',jdecode('What+my+clients+think'),jdecode(''), jdecode('%2F6674.html'), 'true',[],'',''],
	['PAGE','6695',jdecode('Lodging'),jdecode(''), jdecode('%2F6695.html'), 'true',[],'',''],
	['PAGE','6716',jdecode('Guide+booking+service'),jdecode(''), jdecode('%2F6716.html'), 'true',[],'',''],
	['PAGE','6737',jdecode('Large+Group+trips'),jdecode(''), jdecode('%2F6737.html'), 'true',[],'',''],
	['PAGE','6758',jdecode('Photos'),jdecode(''), jdecode('%2F6758.html'), 'true',[],'',''],
	['PAGE','17534',jdecode('Videos'),jdecode(''), jdecode('%2F17534.html'), 'true',[],'',''],
	['PAGE','6779',jdecode('Maps'),jdecode(''), jdecode('%2F6779.html'), 'true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Odd';
theSitetree.paletteFamily='C5EFC5';
theSitetree.keyvisualId='12134';
theSitetree.keyvisualName='kv_12134.jpg';
theSitetree.fontsetId='33320';
theSitetree.graphicsetId='14191';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='C5EFC5';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'wl_enom',
  product: 'WSCENOSSSLYTC21T'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Odd',
				paletteFamily: 	'C5EFC5',
				keyvisualId: 	'12134',
				keyvisualName: 	'kv_12134.jpg',
				fontsetId: 		'33320',
				graphicsetId: 	'14191',
				contentColor: 	'000000',
				contentBGColor: 'C5EFC5',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-0eef7eda492c9899dac9c20d575ae031']={
webappId:    '7060',
documentId:  '6758',
internalId:  '0eef7eda492c9899dac9c20d575ae031',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6434',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6434',
internalId:  '',
customField: '20111215-133521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6485',
internalId:  '',
customField: '20110805-204409'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6506',
internalId:  '',
customField: '20110807-101739'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6527',
internalId:  '',
customField: '20110807-095655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6548',
internalId:  '',
customField: '20110805-204501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6569',
internalId:  '',
customField: '20110829-093948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6590',
internalId:  '',
customField: '20110829-094006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6611',
internalId:  '',
customField: '20110829-094024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6632',
internalId:  '',
customField: '20110829-094043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6653',
internalId:  '',
customField: '20110805-204606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6674',
internalId:  '',
customField: '20111128-160525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6695',
internalId:  '',
customField: '20110829-094128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6716',
internalId:  '',
customField: '20110829-094140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6737',
internalId:  '',
customField: '20110829-094153'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6758',
internalId:  '',
customField: '20110802-120937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6779',
internalId:  '',
customField: '20110829-094220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17134',
internalId:  '',
customField: '20110807-101247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17534',
internalId:  '',
customField: '20110807-102424'
};
var webAppHostname = 'wsc.ehost-services.com:80';
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN340INPRJ4';
var companyName   = 'Quality+Fishing+Adventures';
var htmlTitle	  = 'Oregon+Fishing+Guides';
var metaKeywords  = 'Portland+fishing+guides%2Coregon+fishing+guides%2C+fishing+in+oregon%2C+sturgeon+fishing%2C+oregon+sturgeon+fishing%2Cportland+sturgeon+fishing%2C+sturgeon+fishing+guides%2Ccolumbia+river+sturgeon+fishing%2Ccolumbia+river+salmon+fishing%2C+oregon+fishing+charters%2Cportland+fishing+charters%2Coregon+fishing+trips%2Csalmon+fishing+trips%2Coregon+guides.+guided+fishing%2C+guided+salmon+fishing%2Cguided+sturgeon+fishing%2Cbest+oregon+guide%2C+willamette+river+fishing%2Cwillamette+river+salmon+fishing%2Cwillamette+river+sturgeon+fishing%2C+willamette+river+fishing+guides.+tillamook+bay+fishing+guides.sandy+river+fishing+guides';
var metaContents  = 'Premier+Portland+fishing+guides.+Fishing+for+salmon+and+sturgeon+is+hot+right+now.+Lets+go+catching';
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();
};

