/* [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','5701',jdecode('Home'),jdecode(''),'/5701.html','true',[],'',''],
	['PAGE','10201',jdecode('Who+We+Are'),jdecode(''),'/10201.html','true',[],'',''],
	['PAGE','26112',jdecode('Latest+Updates'),jdecode(''),'/26112.html','true',[],'',''],
	['PAGE','104112',jdecode('YouTube'),jdecode(''),'/104112.html','true',[],'',''],
	['PAGE','112155',jdecode('Surf+Line+%26%23x27%3B10+Summer'),jdecode(''),'/112155.html','true',[],'',''],
	['PAGE','102512',jdecode('Surf+Line+%26%23x27%3B10+Spring'),jdecode(''),'/102512.html','true',[],'',''],
	['PAGE','89612',jdecode('Surf+Line+%26%23x27%3B10+Winter'),jdecode(''),'/89612.html','true',[],'',''],
	['PAGE','80412',jdecode('Surf+Line+%26%23x27%3B09+Fall'),jdecode(''),'/80412.html','true',[],'',''],
	['PAGE','42812',jdecode('Surf+Line+%26%23x27%3B09'),jdecode(''),'/42812.html','true',[],'',''],
	['PAGE','10222',jdecode('Surf+Line+%26%23x27%3B08'),jdecode(''),'/10222.html','true',[],'',''],
	['PAGE','27712',jdecode('Beach+Happenings'),jdecode(''),'/27712.html','true',[],'',''],
	['PAGE','83812',jdecode('Halloween+2009'),jdecode(''),'/83812.html','true',[],'',''],
	['PAGE','46012',jdecode('Surf+Movies'),jdecode(''),'/46012.html','true',[],'',''],
	['PAGE','36712',jdecode('Surf+Vehicles'),jdecode(''),'/36712.html','true',[],'',''],
	['PAGE','36733',jdecode('From+the+Parking+Lot'),jdecode(''),'/36733.html','true',[],'',''],
	['PAGE','22701',jdecode('Quotes+Surfers+Use'),jdecode(''),'/22701.html','true',[],'',''],
	['PAGE','12201',jdecode('Ocean+Life'),jdecode(''),'/12201.html','true',[],'',''],
	['PAGE','35012',jdecode('Random+File'),jdecode(''),'/35012.html','true',[],'',''],
	['PAGE','11501',jdecode('Visitors'),jdecode(''),'/11501.html','true',[],'',''],
	['PAGE','19201',jdecode('Vintage+Surf+Speak'),jdecode(''),'/19201.html','true',[],'',''],
	['PAGE','25512',jdecode('Junior+Wave+Riders'),jdecode(''),'/25512.html','true',[],'',''],
	['PAGE','24201',jdecode('Future+Wave+Riders'),jdecode(''),'/24201.html','true',[],'',''],
	['PAGE','71612',jdecode('Learn+to+Surf'),jdecode(''),'/71612.html','true',[],'',''],
	['PAGE','58212',jdecode('Lifeguards'),jdecode(''),'/58212.html','true',[],'',''],
	['PAGE','30712',jdecode('Heads-Up'),jdecode(''),'/30712.html','true',[],'',''],
	['PAGE','16001',jdecode('In+Memory+Of...'),jdecode(''),'/16001.html','true',[],'',''],
	['PAGE','41712',jdecode('Resources'),jdecode(''),'/41712.html','true',[],'',''],
	['PAGE','55412',jdecode('Surf+Photog+4+Hire%21'),jdecode(''),'/55412.html','true',[],'',''],
	['PAGE','75212',jdecode('Surfboard+Repair'),jdecode(''),'/75212.html','true',[],'',''],
	['PAGE','79212',jdecode('Links'),jdecode(''),'/79212.html','true',[],'',''],
	['PAGE','110312',jdecode('The+Way+We+Were'),jdecode(''),'/110312.html','true',[],'',''],
	['PAGE','110333',jdecode('Travel'),jdecode(''),'/110333.html','true',[],'',''],
	['PAGE','109112',jdecode('Classified'),jdecode(''),'/109112.html','true',[],'',''],
	['PAGE','27012',jdecode('Contact%2FCorrections'),jdecode(''),'/27012.html','true',[],'','']];
var siteelementCount=34;
theSitetree.topTemplateName='Beach';
theSitetree.paletteFamily='E7D795';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10565';
theSitetree.graphicsetId='10929';
theSitetree.contentColor='A00000';
theSitetree.contentBGColor='E7D794';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Beach',
				paletteFamily: 	'E7D795',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10565',
				graphicsetId: 	'10929',
				contentColor: 	'A00000',
				contentBGColor: 'E7D794',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FF503F',
				e_color: 		'FF503F',
				f_color: 		'FF503F',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20100823-070318'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10201',
internalId:  '',
customField: '20081126-205341'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11501',
internalId:  '',
customField: '20100801-173627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10222',
internalId:  '',
customField: '20090930-211735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12201',
internalId:  '',
customField: '20100531-225323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16001',
internalId:  '',
customField: '20090615-205535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19201',
internalId:  '',
customField: '20081208-195001'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22701',
internalId:  '',
customField: '20091115-070938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24201',
internalId:  '',
customField: '20090531-172910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25512',
internalId:  '',
customField: '20100801-172946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26112',
internalId:  '',
customField: '20100823-071002'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27012',
internalId:  '',
customField: '20091101-163640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27712',
internalId:  '',
customField: '20100801-175153'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30712',
internalId:  '',
customField: '20100514-195836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35012',
internalId:  '',
customField: '20100801-173919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36733',
internalId:  '',
customField: '20100716-083044'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36712',
internalId:  '',
customField: '20100401-164535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41712',
internalId:  '',
customField: '20100401-171644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42812',
internalId:  '',
customField: '20091101-161043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46012',
internalId:  '',
customField: '20100823-071150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55412',
internalId:  '',
customField: '20090901-072122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58212',
internalId:  '',
customField: '20100701-091059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71612',
internalId:  '',
customField: '20090815-132940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75212',
internalId:  '',
customField: '20090901-071128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79212',
internalId:  '',
customField: '20100315-175506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80412',
internalId:  '',
customField: '20100101-083613'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83812',
internalId:  '',
customField: '20091102-182950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89612',
internalId:  '',
customField: '20100401-161823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102512',
internalId:  '',
customField: '20100614-183613'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104112',
internalId:  '',
customField: '20100415-173738'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '109112',
internalId:  '',
customField: '20100810-151207'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110333',
internalId:  '',
customField: '20100801-171631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110312',
internalId:  '',
customField: '20100801-172235'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112155',
internalId:  '',
customField: '20100823-070803'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INV66I';
var companyName   = 'Riviera+Wave+Riders';
var htmlTitle	  = 'rivierawaveriders';
var metaKeywords  = '';
var metaContents  = '';
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();
};
