/* [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(''), jdecode('%2F5701.html'), 'true',[],'',''],
	['PAGE','10201',jdecode('Who+We+Are'),jdecode(''), jdecode('%2F10201.html'), 'true',[],'',''],
	['PAGE','104112',jdecode('YouTube+Channel'),jdecode(''), jdecode('%2F104112.html'), 'true',[],'',''],
	['PAGE','165555',jdecode('Latest+Updates'),jdecode(''), jdecode('%2F165555.html'), 'true',[],'',''],
	['PAGE','161755',jdecode('Surf+Line+%26%23x27%3B12+Winter'),jdecode(''), jdecode('%2F161755.html'), 'true',[],'',''],
	['PAGE','27712',jdecode('Beach+Happenings'),jdecode(''), jdecode('%2F27712.html'), 'true',[],'',''],
	['PAGE','36712',jdecode('Surf+Vehicles'),jdecode(''), jdecode('%2F36712.html'), 'true',[],'',''],
	['PAGE','36733',jdecode('From+the+Parking+Lot'),jdecode(''), jdecode('%2F36733.html'), 'true',[],'',''],
	['PAGE','22701',jdecode('Quotes+Surfers+Use'),jdecode(''), jdecode('%2F22701.html'), 'true',[],'',''],
	['PAGE','12201',jdecode('Ocean+Life'),jdecode(''), jdecode('%2F12201.html'), 'true',[],'',''],
	['PAGE','35012',jdecode('Random+File'),jdecode(''), jdecode('%2F35012.html'), 'true',[],'',''],
	['PAGE','11501',jdecode('Visitors'),jdecode(''), jdecode('%2F11501.html'), 'true',[],'',''],
	['PAGE','25512',jdecode('Junior+Wave+Riders'),jdecode(''), jdecode('%2F25512.html'), 'true',[],'',''],
	['PAGE','71612',jdecode('Learn+to+Surf'),jdecode(''), jdecode('%2F71612.html'), 'true',[],'',''],
	['PAGE','58212',jdecode('Lifeguards'),jdecode(''), jdecode('%2F58212.html'), 'true',[],'',''],
	['PAGE','30712',jdecode('Heads-Up'),jdecode(''), jdecode('%2F30712.html'), 'true',[],'',''],
	['PAGE','110312',jdecode('The+Way+We+Were'),jdecode(''), jdecode('%2F110312.html'), 'true',[],'',''],
	['PAGE','160255',jdecode('Surf+for+Life'),jdecode(''), jdecode('%2F160255.html'), 'true',[],'',''],
	['PAGE','110333',jdecode('Travel'),jdecode(''), jdecode('%2F110333.html'), 'true',[],'',''],
	['PAGE','41712',jdecode('Resources'),jdecode(''), jdecode('%2F41712.html'), 'true',[],'',''],
	['PAGE','155155',jdecode('Halloween+2011'),jdecode(''), jdecode('%2F155155.html'), 'true',[],'',''],
	['PAGE','150555',jdecode('Surf+Line+%26%23x27%3B11+Fall'),jdecode(''), jdecode('%2F150555.html'), 'true',[],'',''],
	['PAGE','142355',jdecode('Surf+Line+%26%23x27%3B11+Summer'),jdecode(''), jdecode('%2F142355.html'), 'true',[],'',''],
	['PAGE','136255',jdecode('Surf+Line+%26%23x27%3B11+Spring'),jdecode(''), jdecode('%2F136255.html'), 'true',[],'',''],
	['PAGE','129755',jdecode('Surf+Line+%26%23x27%3B11+Winter'),jdecode(''), jdecode('%2F129755.html'), 'true',[],'',''],
	['PAGE','83812',jdecode('Halloween+%26%23x27%3B09+%26+%26%23x27%3B10'),jdecode(''), jdecode('%2F83812.html'), 'true',[],'',''],
	['PAGE','122555',jdecode('Surf+Line+%26%23x27%3B10+Fall'),jdecode(''), jdecode('%2F122555.html'), 'true',[],'',''],
	['PAGE','112155',jdecode('Surf+Line+%26%23x27%3B10+Summer'),jdecode(''), jdecode('%2F112155.html'), 'true',[],'',''],
	['PAGE','102512',jdecode('Surf+Line+%26%23x27%3B10+Spring'),jdecode(''), jdecode('%2F102512.html'), 'true',[],'',''],
	['PAGE','89612',jdecode('Surf+Line+%26%23x27%3B10+Winter'),jdecode(''), jdecode('%2F89612.html'), 'true',[],'',''],
	['PAGE','80412',jdecode('Surf+Line+%26%23x27%3B09+Fall'),jdecode(''), jdecode('%2F80412.html'), 'true',[],'',''],
	['PAGE','42812',jdecode('Surf+Line+%26%23x27%3B09'),jdecode(''), jdecode('%2F42812.html'), 'true',[],'',''],
	['PAGE','10222',jdecode('Surf+Line+%26%23x27%3B08'),jdecode(''), jdecode('%2F10222.html'), 'true',[],'',''],
	['PAGE','16001',jdecode('In+Memory+Of...'),jdecode(''), jdecode('%2F16001.html'), 'true',[],'',''],
	['PAGE','27012',jdecode('Contact%2FCorrections'),jdecode(''), jdecode('%2F27012.html'), 'true',[],'','']];
var siteelementCount=35;
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 prodDef={
  wl_name: 'verizon',
  product: 'WSCSYSSSSLYTC245'
};
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: '20120131-174904'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10201',
internalId:  '',
customField: '20111231-134957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11501',
internalId:  '',
customField: '20100801-173627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10222',
internalId:  '',
customField: '20110602-184213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12201',
internalId:  '',
customField: '20120131-171721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16001',
internalId:  '',
customField: '20110613-175505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '160255',
internalId:  '',
customField: '20111215-084843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22701',
internalId:  '',
customField: '20091115-070938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '142355',
internalId:  '',
customField: '20110915-090540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25512',
internalId:  '',
customField: '20100801-172946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '165555',
internalId:  '',
customField: '20120131-175317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27012',
internalId:  '',
customField: '20091101-163640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27712',
internalId:  '',
customField: '20120114-163504'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30712',
internalId:  '',
customField: '20120114-165650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35012',
internalId:  '',
customField: '20110815-073134'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36733',
internalId:  '',
customField: '20120131-172325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36712',
internalId:  '',
customField: '20111231-090520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41712',
internalId:  '',
customField: '20100401-171644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42812',
internalId:  '',
customField: '20110602-183755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '155155',
internalId:  '',
customField: '20111114-214930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '150555',
internalId:  '',
customField: '20111201-093050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58212',
internalId:  '',
customField: '20110815-071639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71612',
internalId:  '',
customField: '20110715-143203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '129755',
internalId:  '',
customField: '20110602-181419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '136255',
internalId:  '',
customField: '20110615-203521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80412',
internalId:  '',
customField: '20110602-182939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83812',
internalId:  '',
customField: '20111101-144550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89612',
internalId:  '',
customField: '20110602-182356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102512',
internalId:  '',
customField: '20110602-181900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104112',
internalId:  '',
customField: '20101230-123205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110333',
internalId:  '',
customField: '20111015-070254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110312',
internalId:  '',
customField: '20120131-175706'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112155',
internalId:  '',
customField: '20100930-163934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '122555',
internalId:  '',
customField: '20101215-151655'
};
webappMappings['1501']=webappMappings['1501-10039782']={
webappId:    '1501',
documentId:  '5701',
internalId:  '10039782',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '161755',
internalId:  '',
customField: '20120131-173534'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker02.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();
};

