/* accsub.js: Subset of access.js. Search routines, search boxes, and
 simple cookie read and CSS\DOM alter only. No Buttons or complex
 WAI switching. 'Copy of relevant parts from Access. */

d_=document;

// Functions present in Access, but not implemented here:
// (Easy expansion/revert.)
function navaid2(){void 0}
function navbut(){void 0}
function textaid2(){void 0}
function sizebut(){void 0}
function sizebutb(sfx){void 0}
function bothbut(){void 0}

// Search box support:
function seartb(){d_.write('\x3cINPUT type=button value='
+'" this Page "\n title="Search and highlight in this page only:\naccesskey'
+' %" accesskey="%" class=searpage onclick="search(d_.searbx)"\x3e')}
// No newline on end.

function searthis(){if(incompat) return;//No option if not possible.
d_.write('\x3cBR\x3e');seartb()}

// Similar; whole FORM in js:
function searthisonly(){if(incompat) //No option if not possible.
d_.write('\x3cDIV id=searalt\x3eUse your Browser\'s search facility to '
+'search text in this\npage, or export content to a Text&nbsp;Editor.\x3c'
+'/DIV\x3e\n'); else{
d_.write('\x3cFORM name=searbx id=searbx action="" style="width:9em"\x3e\n'
+'\x3cLABEL title="Type your query here"\x3eFind\n\x3cINPUT '
+'name=query size=10\x3e\x3c/LABEL\x3e\x3cBR\x3e\nin ');
seartb();
d_.write('\x3cBR\x3e\x3cA class=fffont href="/find.php"\x3eAdvanced find'
+'\x3c/A\x3e\n');
d_.write('\x3c/FORM\x3e\n')}}

function CookieObey(){//Observe cookie presets without [offering] controls:
if(d_.cookie.indexOf("TextSize=Large")>-1)
 {u=d_.getElementsByTagName("div");
 for(i=0;u.length>i;i++){var uu=u[i],un=uu.getAttribute("className");
 if(un=="coll")uu.className="co2l";if(un=="colr")uu.className="co2r"}
 d_.getElementsByTagName("body")[0].style.fontSize="24pt"}
if(d_.cookie.indexOf("NavAids=Hide")>-1){s("a");s("p")}
function s(t){u=d_.getElementsByTagName(t);
for(i=0;u.length>i;i++){if(u[i].getAttribute("className")=="nav")
 {u[i].style.visibility="hidden";u[i].style.speak="none"}}}
}


// Third party code:

// Find In Page Script by Alan Koontz alankoontz@REMOVETHISyahoo.com
// Via http://www.dynamicdrive.com/ (Crunched)

var tRg=null,dupeRange=null,TstRg=null;
var agt=navigator.userAgent.toLowerCase();
var is_major=parseInt(navigator.appVersion);
var is_minor=parseFloat(navigator.appVersion);
var is_ie4up=((agt.indexOf("msie")!=-1)&&(is_major>=4));
var is_not_moz=(agt.indexOf('netscape')!=-1);
var is_nav4=(((navigator.appName.toLowerCase()).indexOf('netscape')!=-1)&&(is_major==4));
var is_gecko=(agt.indexOf('gecko')!=-1);
var is_rev=0;if(is_gecko){temp=agt.split("rv:");is_rev=parseFloat(temp[1])}
var incompat=((is_ie4up&(agt.indexOf("mac")!=-1))|(is_gecko&(1>is_rev))|(agt.indexOf("opera")!=-1));

function search(){wfm=d_.searbx.query;
if(wfm.value!=null&&wfm.value!='')str=wfm.value; else return;
if(is_nav4&&(5>is_minor))sF=self.find(str);if(is_gecko&&(is_rev>=1))
{sF=self.find(str,false,false,true);if(is_not_moz)wfm.focus()}
if(is_ie4up){if(tRg!=null){TstRg=d_.body.createTextRange();
if(dupeRange.inRange(TstRg)){tRg.collapse(false);sF=tRg.findText(str);
if(sF){d_.body.scrollTop=d_.body.scrollTop+tRg.offsetTop;tRg.select()}}
else{tRg=d_.body.createTextRange();tRg.collapse(false);subr()}}
if(tRg==null||sF==0){tRg=d_.body.createTextRange();
dupeRange=tRg.duplicate();subr()}}if(!sF)alert("'"+str+"' not there.")}
function subr(){sF=tRg.findText(str);
if(sF){d_.body.scrollTop=tRg.offsetTop;tRg.select()}}

