window.highlighter=new SearchTermHighlighter();highlighter.init();function SearchTermHighlighter()
{var ok=((document.createElement)?true:false);var isInitialized=false;var searchTerms=new Array();var foundCount=0;var styles=new Array();var usingDefaultStyles=true;var DEBUG=false;this.parameters='q as_q as_epq as_oq query search';this.legend=true;this.addStyle=addStyle;this.init=init;this.loadSearchTerms=loadSearchTerms;this.highlight=highlight;this.highlightTerm=highlightTerm;this.writeLegend=writeLegend;this.hideLegend=hideLegend;this.unhighlight=unhighlight;if(!ok)return;loadDefaults();function loadDefaults()
{var liteBG='#FF6 #BFF #9F9 #F99 #F6F'.split(/ /);var darkBG='#800 #0A0 #860 #049 #909'.split(/ /);for(var i=0;i<liteBG.length;i++){styles.push(new HighlightStyle('black',liteBG[i],'bold'));}
for(i=0;i<darkBG.length;i++){styles.push(new HighlightStyle('white',darkBG[i],'bold'));}}
function addStyle(color,background,fontWeight)
{if(!ok)return;if(usingDefaultStyles){styles=new Array();usingDefaultStyles=false;}
styles.push(new HighlightStyle(color,background,fontWeight));}
function init()
{if(!ok)return;this.loadSearchTerms();var style=0;document.write('<style type="text/css">\n');for(i=0;i<searchTerms.length;i++)
{document.write('.'+searchTerms[i].cssClass+'{'+styles[style]+'}\n');style++;if(style>=styles.length)style=0;}
if(this.legend)document.write('#sth_legend{border:1px solid #CCC;background:white;margin:0px;padding:5px;'
+'font-family:verdana,helvetica,arial,sans-serif;font-size:x-small;}\n');document.write('</style>\n');isInitialized=true;}
function loadSearchTerms()
{var a=new Array();var params=getParamValues(document.referrer,this.parameters);var terms;var index=0;for(i=0;i<params.length;i++)
{terms=parseTerms(params[i]);for(j=0;j<terms.length;j++)
{if(terms[j]!='')
{a.push(new SearchTerm(index++,terms[j].toLowerCase()));}}}
a.sort(function(t1,t2){return((t1.term==t2.term)?0:((t1.term<t2.term)?-1:1));});var prev=new SearchTerm(0,'');for(i=a.length-1;i>=0;i--)
{if(a[i].term!=prev.term)
{searchTerms.push(a[i]);prev=a[i];}}
searchTerms.sort(function(t1,t2){return t1.index-t2.index;});debugAlert('Search Terms:\n'+searchTerms.join('\n'));}
function parseTerms(query)
{var s=query+'';s=s.replace(/(^|\s)(site|related|link|info|cache):[^\s]*(\s|$)/ig,' ');s=s.replace(/[^a-z0-9_-]/ig,' ');s=s.replace(/(^|\s)-/g,' ');s=s.replace(/\b(and|not|or)\b/ig,' ');s=s.replace(/\b[a-z0-9]\b/ig,' ');return s.split(/\s+/);}
function getParamValues(url,parameters)
{var params=new Array();var p=parameters.replace(/,/,' ').split(/\s+/);if(url.indexOf('?')>0)
{var qs=url.substr(url.indexOf('?')+1);var qsa=qs.split('&');for(i=0;i<qsa.length;i++)
{nameValue=qsa[i].split('=');if(nameValue.length!=2)continue;for(j=0;j<p.length;j++)
{if(nameValue[0]==p[j])
{params.push(unescape(nameValue[1]).toLowerCase().replace(/\+/g,' '));}}}}
return params;}
function highlight()
{if(!ok)return;if(!isInitialized)this.init();searchTerms.sort(function(term1,term2){return(term2.term.length-term1.term.length)});for(var i=0;i<searchTerms.length;i++)
{this.highlightTerm(document.getElementsByTagName("body")[0],searchTerms[i]);}
if(this.legend)
{this.writeLegend();}}
function highlightTerm(node,term)
{if(node.nodeType==1)
{if(node.getAttribute("sth_x")==term.term)return;else node.setAttribute("sth_x",term.term);}
if(node.hasChildNodes())
{for(var i=0;i<node.childNodes.length;i++)
{this.highlightTerm(node.childNodes[i],term);}}
if(node.nodeType==3)
{var p=node.parentNode;if(p.nodeName!='TEXTAREA'&&p.nodeName!='SCRIPT'&&p.className.substr(0,term.CSS_CLASS_PREFIX.length)!=term.CSS_CLASS_PREFIX)
{var result=term.pattern.exec(node.nodeValue);if(result!=null)
{term.found=true;foundCount++;var v=node.nodeValue;var lt=document.createTextNode(v.substr(0,result.index));var rt=document.createTextNode(v.substr(result.index+result[0].length));var span=document.createElement('SPAN');span.className=term.cssClass;span.appendChild(document.createTextNode(result[0]));p.insertBefore(lt,node);p.insertBefore(span,node);p.replaceChild(rt,node);}}}}
function writeLegend()
{if(foundCount>0)
{var body=document.getElementsByTagName("body")[0];var legend=body.insertBefore(document.createElement('DIV'),body.childNodes[0]);legend.id='sth_legend';var s='These search terms have been highlighted:';searchTerms.sort(function(t1,t2){return t1.index-t2.index;});for(var i=0;i<searchTerms.length;i++)
{if(searchTerms[i].found==true)s+=' <span class="'+searchTerms[i].cssClass+'">'
+searchTerms[i].term+'</span>';}
s+=' | <a href="javascript:void(0);" onclick="highlighter.hideLegend()">hide this legend</a>';s+=' | <a href="javascript:void(0);" onclick="highlighter.unhighlight()">remove highlighting</a>';legend.innerHTML=s;}}
function hideLegend()
{var legend=document.getElementById('sth_legend');if(legend)legend.parentNode.removeChild(legend);}
function unhighlight()
{var prefix=searchTerms[0].CSS_CLASS_PREFIX;var spans=document.getElementsByTagName('SPAN');var elts=new Array();var parent,i,j;for(i=0;i<spans.length;i++)
{if(spans[i].className.substr(0,prefix.length)==prefix)
{elts.push(spans[i]);}}
for(i=0;i<elts.length;i++)
{parent=elts[i].parentNode;for(j=0;j<elts[i].childNodes.length;j++)
{parent.insertBefore(elts[i].childNodes[j],elts[i]);}
parent.removeChild(elts[i]);}
this.hideLegend();}
function debugAlert(msg){if(DEBUG)alert(msg);}
function SearchTerm(index,term)
{this.CSS_CLASS_PREFIX='sth_';this.index=index;this.term=term.toLowerCase();this.cssClass=this.CSS_CLASS_PREFIX+this.term.replace(/[^a-z0-9_ ]/g,'').replace(/ /g,'_');this.pattern=new RegExp('\\b'+this.term+'\\b','i');this.found=false;this.toString=function(){return this.term};}
function HighlightStyle(color,background,fontWeight)
{this.color=color;this.background=background;this.fontWeight=fontWeight;this.toString=function(){return'color:'+this.color+';background:'
+this.background+';font-weight:'+this.fontWeight+';'};}};;var fadeimages=new Array()
fadeimages[0]=["/images/highlight/image1.jpg","http://www.newportmooringassociation.org/nma_pinnipeds.htm",""]
fadeimages[1]=["/images/highlight/image2.jpg","http://www.newportmooringassociation.org/nma_pinnipeds.htm",""]
fadeimages[2]=["/images/highlight/image3.jpg","http://www.newportmooringassociation.org/nma_pinnipeds.htm",""]
var fadebgcolor="white"
var fadearray=new Array()
var fadeclear=new Array()
var dom=(document.getElementById)
var iebrowser=document.all
function fadeshow(theimages,fadewidth,fadeheight,borderwidth,delay,pause,displayorder){this.pausecheck=pause
this.mouseovercheck=0
this.delay=delay
this.degree=10
this.curimageindex=0
this.nextimageindex=1
fadearray[fadearray.length]=this
this.slideshowid=fadearray.length-1
this.canvasbase="canvas"+this.slideshowid
this.curcanvas=this.canvasbase+"_0"
if(typeof displayorder!="undefined")
theimages.sort(function(){return 0.5-Math.random();})
this.theimages=theimages
this.imageborder=parseInt(borderwidth)
this.postimages=new Array()
for(p=0;p<theimages.length;p++){this.postimages[p]=new Image()
this.postimages[p].src=theimages[p][0]}
var fadewidth=fadewidth+this.imageborder*2
var fadeheight=fadeheight+this.imageborder*2
if(iebrowser&&dom||dom)
document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div></div>')
else
document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>')
if(iebrowser&&dom||dom)
this.startit()
else{this.curimageindex++
setInterval("fadearray["+this.slideshowid+"].rotateimage()",this.delay)}}
function fadepic(obj){if(obj.degree<100){obj.degree+=10
if(obj.tempobj.filters&&obj.tempobj.filters[0]){if(typeof obj.tempobj.filters[0].opacity=="number")
obj.tempobj.filters[0].opacity=obj.degree
else
obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"}
else if(obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.degree/101
else if(obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.degree/100
else if(obj.tempobj.style.opacity&&!obj.tempobj.filters)
obj.tempobj.style.opacity=obj.degree/101}
else{clearInterval(fadeclear[obj.slideshowid])
obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")?obj.canvasbase+"_0":obj.canvasbase+"_1"
obj.tempobj=iebrowser?iebrowser[obj.nextcanvas]:document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj,obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)?obj.nextimageindex+1:0
setTimeout("fadearray["+obj.slideshowid+"].rotateimage()",obj.delay)}}
fadeshow.prototype.populateslide=function(picobj,picindex){var slideHTML=""
if(this.theimages[picindex][1]!="")
slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'
slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
if(this.theimages[picindex][1]!="")
slideHTML+='</a>'
picobj.innerHTML=slideHTML}
fadeshow.prototype.rotateimage=function(){if(this.pausecheck==1)
var cacheobj=this
if(this.mouseovercheck==1)
setTimeout(function(){cacheobj.rotateimage()},100)
else if(iebrowser&&dom||dom){this.resetit()
var crossobj=this.tempobj=iebrowser?iebrowser[this.curcanvas]:document.getElementById(this.curcanvas)
crossobj.style.zIndex++
fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50)
this.curcanvas=(this.curcanvas==this.canvasbase+"_0")?this.canvasbase+"_1":this.canvasbase+"_0"}
else{var ns4imgobj=document.images['defaultslide'+this.slideshowid]
ns4imgobj.src=this.postimages[this.curimageindex].src}
this.curimageindex=(this.curimageindex<this.postimages.length-1)?this.curimageindex+1:0}
fadeshow.prototype.resetit=function(){this.degree=10
var crossobj=iebrowser?iebrowser[this.curcanvas]:document.getElementById(this.curcanvas)
if(crossobj.filters&&crossobj.filters[0]){if(typeof crossobj.filters[0].opacity=="number")
crossobj.filters(0).opacity=this.degree
else
crossobj.style.filter="alpha(opacity="+this.degree+")"}
else if(crossobj.style.MozOpacity)
crossobj.style.MozOpacity=this.degree/101
else if(crossobj.style.KhtmlOpacity)
crossobj.style.KhtmlOpacity=this.degree/100
else if(crossobj.style.opacity&&!crossobj.filters)
crossobj.style.opacity=this.degree/101}
fadeshow.prototype.startit=function(){var crossobj=iebrowser?iebrowser[this.curcanvas]:document.getElementById(this.curcanvas)
this.populateslide(crossobj,this.curimageindex)
if(this.pausecheck==1){var cacheobj=this
var crossobjcontainer=iebrowser?iebrowser["master"+this.slideshowid]:document.getElementById("master"+this.slideshowid)
crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}}
this.rotateimage()};function newImage(arg){if(document.images){rslt=new Image();rslt.src=arg;return rslt;}}
userAgent=window.navigator.userAgent;browserVers=parseInt(userAgent.charAt(userAgent.indexOf("/")+1),10);mustInitImg=true;function initImgID(){var di=document.images;if(mustInitImg&&di){for(var i=0;i<di.length;i++){if(!di[i].id)di[i].id=di[i].name;}mustInitImg=false;}}
function findElement(n,ly){var d=document;if(browserVers<4)return d[n];if((browserVers>=6)&&(d.getElementById)){initImgID;return(d.getElementById(n))};var cd=ly?ly.document:d;var elem=cd[n];if(!elem){for(var i=0;i<cd.layers.length;i++){elem=findElement(n,cd.layers[i]);if(elem)return elem;}}
return elem;}
function changeImagesArray(array){if(preloadFlag==true){var d=document;var img;for(i=0;i<array.length;i+=2){img=null;var n=array[i];if(d.images){if(d.layers){img=findElement(n,0);}
else{img=d.images[n];}}
if(!img&&d.getElementById){img=d.getElementById(n);}
if(!img&&d.getElementsByName){var elms=d.getElementsByName(n);if(elms){for(j=0;j<elms.length;j++){if(elms[j].src){img=elms[j];break;}}}}
if(img){img.src=array[i+1];}}}}
function changeImages(){changeImagesArray(changeImages.arguments);}
CSStopExecution=false;function CSAction(array){return CSAction2(CSAct,array);}
function CSAction2(fct,array){var result;for(var i=0;i<array.length;i++){if(CSStopExecution)return false;var aa=fct[array[i]];if(aa==null)return false;var ta=new Array;for(var j=1;j<aa.length;j++){if((aa[j]!=null)&&(typeof(aa[j])=="object")&&(aa[j].length==2)){if(aa[j][0]=="VAR"){ta[j]=CSStateArray[aa[j][1]];}
else{if(aa[j][0]=="ACT"){ta[j]=CSAction(new Array(new String(aa[j][1])));}
else ta[j]=aa[j];}}else ta[j]=aa[j];}
result=aa[0](ta);}
return result;}
CSAct=new Object;CSAg=window.navigator.userAgent;CSBVers=parseInt(CSAg.charAt(CSAg.indexOf("/")+1),10);CSIsW3CDOM=((document.getElementById)&&!(IsIE()&&CSBVers<6))?true:false;function IsIE(){return CSAg.indexOf("MSIE")>0;}
function CSIEStyl(s){return document.all.tags("div")[s].style;}
function CSNSStyl(s){if(CSIsW3CDOM)return document.getElementById(s).style;else return CSFindElement(s,0);}
CSIImg=false;function CSInitImgID(){if(!CSIImg&&document.images){for(var i=0;i<document.images.length;i++){if(!document.images[i].id)document.images[i].id=document.images[i].name;}CSIImg=true;}}
function CSFindElement(n,ly){if(CSBVers<4)return document[n];if(CSIsW3CDOM){CSInitImgID();return(document.getElementById(n));}
var curDoc=ly?ly.document:document;var elem=curDoc[n];if(!elem){for(var i=0;i<curDoc.layers.length;i++){elem=CSFindElement(n,curDoc.layers[i]);if(elem)return elem;}}
return elem;}
function CSGetImage(n){if(document.images){return((!IsIE()&&CSBVers<5)?CSFindElement(n,0):document.images[n]);}else{return null;}}
CSDInit=false;function CSIDOM(){if(CSDInit)return;CSDInit=true;if(document.getElementsByTagName){var n=document.getElementsByTagName('DIV');for(var i=0;i<n.length;i++){CSICSS2Prop(n[i].id);}}}
function CSICSS2Prop(id){var n=document.getElementsByTagName('STYLE');for(var i=0;i<n.length;i++){var cn=n[i].childNodes;for(var j=0;j<cn.length;j++){CSSetCSS2Props(CSFetchStyle(cn[j].data,id),id);}}}
function CSFetchStyle(sc,id){var s=sc;while(s.indexOf("#")!=-1){s=s.substring(s.indexOf("#")+1,sc.length);if(s.substring(0,s.indexOf("{")).toUpperCase().indexOf(id.toUpperCase())!=-1)return(s.substring(s.indexOf("{")+1,s.indexOf("}")));}
return"";}
function CSGetStyleAttrValue(si,id,st){var s=si.toUpperCase();var myID=id.toUpperCase()+":";var id1=s.indexOf(myID,st);if(id1==-1)return"";var ch=s.charAt(id1-1);if(ch!=" "&&ch!="\t"&&ch!="\n"&&ch!=";"&&ch!="{")
return CSGetStyleAttrValue(si,id,id1+1);var start=id1+myID.length;ch=s.charAt(start);while(ch==" "||ch=="\t"||ch=="\n"){start++;ch=s.charAt(start);}
s=s.substring(start,si.length);var id2=s.indexOf(";");return((id2==-1)?s:s.substring(0,id2));}
function CSSetCSS2Props(si,id){var el=document.getElementById(id);if(el==null)return;var style=document.getElementById(id).style;if(style){if(style.left=="")style.left=CSGetStyleAttrValue(si,"left",0);if(style.top=="")style.top=CSGetStyleAttrValue(si,"top",0);if(style.width=="")style.width=CSGetStyleAttrValue(si,"width",0);if(style.height=="")style.height=CSGetStyleAttrValue(si,"height",0);if(style.visibility=="")style.visibility=CSGetStyleAttrValue(si,"visibility",0);if(style.zIndex=="")style.zIndex=CSGetStyleAttrValue(si,"z-index",0);}}
function CSdigitalclock(action){img1=CSGetImage(action[1]);img2=CSGetImage(action[2]);img3=CSGetImage(action[3]);img4=CSGetImage(action[4]);usemilitary=action[5];giflocation=action[6];path=giflocation.substring(0,giflocation.length-5);extension=(giflocation.indexOf("jpg")!=-1)?(".jpg"):(".gif");digClock();}
function digClock(){now=new Date();hours=now.getHours();theMonth=now.getMonth();if(navigator.appVersion.indexOf("MSIE 5.0; Macintosh")!=-1){if(theMonth<=11&&theMonth>=4){hours=hours+1};if(hours==24){hours=0};}
minutes=now.getMinutes();hours=((hours>12&&usemilitary==false)?hours-12:hours);if(hours>=0&&hours<=9)hours="0"+hours;if(usemilitary==false&&hours==00){hours=12};if(minutes>=0&&minutes<=9)minutes="0"+minutes;hours=""+hours;minutes=""+minutes;hour1=hours.substring(0,1);hour2=hours.substring(1,2);minutes1=minutes.substring(0,1);minutes2=minutes.substring(1,2);updater();}
function updater(){img1.src=path+hour1+extension;img2.src=path+hour2+extension;img3.src=path+minutes1+extension;img4.src=path+minutes2+extension;theTimer=setTimeout("digClock()",1000);}
function CSURLPopupShow(formName,popupName,target){var form=(!IsIE()&&CSBVers>=5)?document.forms[formName]:CSFindElement(formName);var popup=form.elements[popupName];window.open(popup.options[popup.selectedIndex].value,target);popup.selectedIndex=0;}
function CSClickReturn(){var bAgent=window.navigator.userAgent;var bAppName=window.navigator.appName;if((bAppName.indexOf("Explorer")>=0)&&(bAgent.indexOf("Mozilla/3")>=0)&&(bAgent.indexOf("Mac")>=0))
return true;else return false;}
function CSGotoLink(action){if(action[2].length){var hasFrame=false;for(i=0;i<parent.frames.length;i++){if(parent.frames[i].name==action[2]){hasFrame=true;break;}}
if(hasFrame==true)
parent.frames[action[2]].location=action[1];else
window.open(action[1],action[2],"");}
else location=action[1];}