var currentTip;
var currentTopic;


function setCurrentTopic(page)
{
 currentTopic= -1;
 if(page >= 0) {selectUpperTopic(page); selectLowerTopic(page);}
 currentTopic=page;
}

function getCurrentTopic()
{
 return currentTopic;
}

function selectUpperTopic(nbtn)
{
 var btn;
 btn=nbtn+1;
 var x=topMenu.rows[0].cells;
 if(btn==getCurrentTopic()+1) return;
 x[btn].vAlign="bottom";
}

function unselectUpperTopic(nbtn)
{
 var btn;
 btn=nbtn+1;
 var x=topMenu.rows[0].cells;
 if(btn==getCurrentTopic()+1) return;
 x[btn].vAlign="top";
}

function selectLowerTopic(btn)
{
 var y=bottomMenu.rows[0].cells;
 if(btn==getCurrentTopic()) return;
 y[btn].vAlign="top";
}

function unselectLowerTopic(btn)
{
 var y=bottomMenu.rows[0].cells;
 if(btn==getCurrentTopic()) return;
 y[btn].vAlign="bottom";
}

function borderOn(btn,e)
{
 if(btn==0) { showTip("sb0Tip",e);}
 else if(btn==1) {showTip("sb1Tip",e);}
 else if(btn==2) {showTip("sb2Tip",e);}
 else if(btn==3) {showTip("sb3Tip",e);}
 else if(btn==4) {showTip("sb4Tip",e);}
 else if(btn==5) {showTip("sb5Tip",e);}
 else if(btn==6) {showTip("sb6Tip",e);}
 else if(btn==7) {showTip("sb7Tip",e);}
 else if(btn==8) {showTip("sb8Tip",e);}
 else if(btn==9) {showTip("sb9Tip",e);}
 else if(btn==10) {showTip("sb10Tip",e);}
 else if(btn==11) {showTip("sb11Tip",e);}
 else if(btn==12) {showTip("sb12Tip",e);}
 else if(btn==13) {showTip("sb13Tip",e);}
}

function borderOff(btn)
{
 if(btn==0) {hideTip()}
 else if(btn==1) {hideTip()}
 else if(btn==2) {hideTip()}
 else if(btn==3) {hideTip()}
 else if(btn==4) {hideTip()}
 else if(btn==5) {hideTip()}
 else if(btn==6) {hideTip()}
 else if(btn==7) {hideTip()}
 else if(btn==8) {hideTip()}
 else if(btn==9) {hideTip()}
 else if(btn==10) {hideTip()}
 else if(btn==11) {hideTip()}
 else if(btn==12) {hideTip()}
 else if(btn==13) {hideTip()}
}


function getRealPos(el,which) 
{
 iPos = 0; 
 while (el!=null) {
  iPos += el["offset" + which]
  el = el.offsetParent;}
 return iPos;
}

function hideTip()
{ 
 if(currentTip) currentTip.style.visibility="hidden";
}

function showTip(tipName,e)
{
 if (getNav()==1)
 {
 var currentElement=window.event.srcElement;
 tip=document.all[tipName];
 tip.style.pixelLeft=getRealPos(currentElement,"Left")+80;
 tip.style.pixelTop=getRealPos(currentElement,"Top");
 tip.style.visibility="visible";
 currentTip=tip;
 }
 else if (getNav()==2)
 {
 tip=document.getElementById(tipName);
 tip.style.visibility="visible";
 tip.style.left=e.layerX+20;
 tip.style.top=e.layerY-10;
 currentTip=tip;
 }
}

function getNav()
{
 if (navigator.appVersion.indexOf("MSIE") != -1) return 1;
 else if (navigator.appName == "Netscape") return 2;
 else return 0;
}
      
function showBanner(bannerName)
{
 if (getNav()==1)
 {
  var currentElement=window.event.srcElement;
  banner=document.all[bannerName];
  banner.style.pixelLeft=140;
  banner.style.pixelTop=30;
  banner.selectedIndex=0;
  banner.style.visibility="visible";
 }
 if (getNav()==2)
 {
  banner=document.getElementById(bannerName);
  banner.style.visibility="visible";
  banner.style.color = "#080EAA";
  banner.style.fontSize = "18px";
  banner.style.left=100;
  banner.style.top=20;
 }
}

function filterSpecChars(txt)
{
 plusString=("%2B"); upperA=("%8e");
 c=["\u0025","\u000a","\u000d","\u00e5","\u00e4","\u00f6","\u00c5","\u00c4",
    "\u00d6","\u002b","\u002f","\u003f","\u0023","\u0026","\u003e","\u003c",
    "\0022","\u0027","\u0000"];
 rc=["%25","%0a","%0d","%e5","%e4","%f6","%c5","%c4",
     "%d6","%2b","%2f","%3f","%23","%26","%3e","%3c",
     "%22","%27","\0"];
 ind=0;
 while (c[ind]!="\0")
 {
  scIndex=txt.indexOf(c[ind]);
  while (scIndex>=0)
  {
   newString=txt.substring(0,scIndex);
   newString=newString+rc[ind];
   newString=newString+txt.substring(scIndex+1,txt.length);
   txt=newString;
   scIndex=txt.indexOf(c[ind],scIndex+2);
  }
  ind++;
 }
 return txt;
}



