var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;

if (checkIt('konqueror'))
{
	browser = "Konqueror";
	OS = "Linux";
}
else if (checkIt('safari')) browser = "Safari"
else if (checkIt('omniweb')) browser = "OmniWeb"
else if (checkIt('opera')) browser = "Opera"
else if (checkIt('webtv')) browser = "WebTV";
else if (checkIt('icab')) browser = "iCab";
else if (checkIt('firefox')) browser = "Firefox"
else if (checkIt('msie')) browser = "Internet Explorer"
else if (!checkIt('compatible'))
{
	browser = "Netscape Navigator"
	version = detect.charAt(8);
}
else browser = "An unknown browser";

if (!version) version = detect.charAt(place + thestring.length);

if (!OS)
{
	if (checkIt('linux')) OS = "Linux";
	else if (checkIt('x11')) OS = "Unix";
	else if (checkIt('mac')) OS = "Mac"
	else if (checkIt('win')) OS = "Windows"
	else OS = "an unknown operating system";
}

function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}


function ah(){
ak=window.location.pathname
al=ak.lastIndexOf('/')
x='http://'+window.location.hostname+'/'+ak.substring(1,al+1)
return x
}

function cs(y){
	if(y==1)
	{
		parent.document.body.rows='0,74,1,*';
	} else if(y==0)
	{
		parent.document.body.rows='16,0,1,*';
		
		parent.frames['MiniFrame'].document.SearchForm.q.value = document.SearchForm.q.value;
		
//		if (navigator.userAgent.indexOf("Firefox") == -1)
		if ((browser == "Internet Explorer") || (browser == "Opera"))
		  parent.frames['MiniFrame'].document.SearchForm.q.focus();

		//parent.MiniFrame.document.getElementById('q').value=document.getElementById('q').value;
		//parent.MiniFrame.document.getElementById('q').focus()

	} else
	{
		parent.document.body.rows='0,0,0,*';
	};
}

function isl(l){
	ai = document.SearchForm.q.value;
//	ai = document.getElementById('q').value;
	ai = ai.replace(/\+/g,"%2B");
	ai = escape(ai);
	ai = ai.replace(/%25/g,"%");
	document.location.href=ah()+'default2.asp?q='+ai+'&e='+l;
}

function tsl(l){
	ai = document.SearchForm.q.value;
//	ai = document.getElementById('q').value;
	ai = ai.replace(/\+/g,"%2B");
	ai = escape(ai);
	ai = ai.replace(/%25/g,"%");
//	alert(ah()+'search.asp?q='+ai+'&e='+l);
	parent.MainFrame.location.href=ah()+'search.asp?q='+ai+'&e='+l
}

var h=[1,"sc1"]
function aa(w,n,i){
if(w.currentStyle)
return w.currentStyle[n]
else if(window.getComputedStyle){
var r=window.getComputedStyle(w,"")
return r.getPropertyValue(i)
}
}
var c=""
function ec(u,b){
if(document.getElementById){
ag(b)
ac(b)
if(c!="")
document.getElementById(c).style.display="none"
document.getElementById(u).style.display="block"
c=u

// RC050528
//if ((navigator.userAgent.indexOf("Firefox") == -1) && (navigator.userAgent.indexOf("Mozilla") == -1))
if ((browser == "Internet Explorer") || (browser == "Opera"))
  switch (c)
  {
  case "sc1":
    document.sf1.q.focus();
    break;

  case "sc2":
    document.sf2.q.focus();
    break;

  case "sc3":
    document.sf3.q.focus();
    break;
  
  case "sc4":
    document.sf4.q.focus();
    break;
  
  case "sc5":
    document.sf5.q.focus();
    break;
  
  case "sc6":
    document.sf6.q.focus();
    break;
  
  case "sc7":
    document.sf7.q.focus();
    break;

  case "sc8":
    document.sf8.q.focus();
    break;


  };

// RC050528

if(b.blur)
//b.blur()
return false
}
else
return true
}
function ag(b){
if(typeof a=="undefined")
s()
for(i=0;i<a.length;i++)
a[i].style.backgroundColor=k
var o=b.getAttribute("theme")?b.getAttribute("theme"):g
b.style.backgroundColor=document.getElementById("tabcontentcontainer").style.backgroundColor=o
}
function s(){
var t=document.getElementById("tablist")
a=t.getElementsByTagName("A")
}
function ac(b){
for(i=0;i<a.length;i++){
if(b==a[i]){
ae=i
break
}
}
}
function ab(){
var m=window.z&&z("lasttab").indexOf("|")!=-1
s()
k=aa(a[1],"backgroundColor","background-color")
g=aa(a[0],"backgroundColor","background-color")
if(typeof d!="undefined"&&d&&m){
var e=z("lasttab").split("|")
var q=e[0]
var j=e[1]
ec(j,a[q])
}
else
ec(h[1],a[h[0]-1])
}
if(window.addEventListener)
window.addEventListener("load",ab,false)
else if(window.attachEvent)
window.attachEvent("onload",ab)
else if(document.getElementById)
window.onload=ab
var d=true
function z(v){
var p=v+"="
var f="";
if(document.cookie.length>0){
ad=document.cookie.indexOf(p)
if(ad!=-1){
ad+=p.length
aj=document.cookie.indexOf(";",ad);
if(aj==-1)aj=document.cookie.length;
f=unescape(document.cookie.substring(ad,aj))
}
}
return f;
}
function af(){
document.cookie="lasttab="+ae+"|"+c
}
window.onunload=af
