function lib_bwcheck(){ 
  this.ver=navigator.appVersion
  this.agent=navigator.userAgent
  this.dom=document.getElementById?1:0
  this.opera5=this.agent.indexOf("Opera 5")>-1
  this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
  this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
  this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom && !this.opera5)?1:0;
  this.ie8=(this.ver.indexOf("MSIE 8")>-1 && this.dom && !this.opera5)?1:0;
  this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
  this.ie=this.ie4||this.ie5||this.ie6
  this.mac=this.agent.indexOf("Mac")>-1
  this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
  this.ns4=(document.layers && !this.dom)?1:0;
  this.bw=(this.ie8||this.ie7||this.ie6||this.ie5||this.ie4||this.ns4||this.ns6||this.opera5)
  return this
}
bw=new lib_bwcheck() //Browsercheck object

//Debug function ******************
function lib_message(txt){alert(txt); return false}

//Lib objects  ********************
function lib_obj(obj,nest){ 
  if(!bw.bw) return lib_message('Old browser')
  nest=(!nest) ? "":'document.'+nest+'.'
  this.evnt=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+"document.layers." +obj):0;
  if(!this.evnt) return this;
  this.css=bw.dom||bw.ie4?this.evnt.style:this.evnt; 
  this.ref=bw.dom||bw.ie4?document:this.css.document;
  this.x=parseInt(this.css.left)||this.css.pixelLeft||this.evnt.offsetLeft||0;
  this.y=parseInt(this.css.top)||this.css.pixelTop||this.evnt.offsetTop||0
  this.w=this.evnt.offsetWidth||this.css.clip.width||this.ref.width||this.css.pixelWidth||0;
  this.h=this.evnt.offsetHeight||this.css.clip.height||this.ref.height||this.css.pixelHeight||0
  this.obj = obj + "Object"; eval(this.obj + "=this")
  return this
}

//Showing object ************
lib_obj.prototype.showIt = function(){this.css.visibility="visible";this.css.display="block"}

//Hiding object **********
lib_obj.prototype.hideIt = function(){this.css.visibility="hidden";this.css.display="none"}

//Writing content to object ***
lib_obj.prototype.writeIt = function(text,startHTML,endHTML){
	if(bw.ns4){
    if(!startHTML){startHTML=""; endHTML=""}
	  this.ref.open("text/html"); 
    this.ref.write(startHTML+text+endHTML); 
    this.ref.close()
	}else this.evnt.innerHTML=text
}

function setCookie(name, value){
var curCookie = name+"="+escape(value)
document.cookie = curCookie
}
function getCookie(name){
var prefix = name + "="
var cookieStartIndex = document.cookie.indexOf(prefix)
if(cookieStartIndex == -1) return null
var cookieEndIndex = document.cookie.indexOf(";",cookieStartIndex+prefix.length)
if (cookieEndIndex == -1)
	cookieEndIndex = document.cookie.length
return unescape(document.cookie.substring(cookieStartIndex+prefix.length,cookieEndIndex))
}
function deleteCookie(name) {
if (getCookie(name))
	document.cookie = name + "=; expires=Thu, 01-Jan-70 00:00:01 GMT"
}

function go(h){
unl=true
if(h)
	setCookie(cook,h)
else
	deleteCookie(cook)
}

function tog(id){
var img = document['img'+id]
var div = new lib_obj('div'+id)
if(div.evnt){
    if(div.css.visibility=="visible"){
        img.src = "images/plus.gif"
        div.hideIt()
    }
    else{
        img.src = "images/minus.gif"
        div.showIt()
//div.evnt.scrollIntoView(0)
    }
}
}

function mover(){document.body.style.cursor="hand"}
function mout(){document.body.style.cursor="default"}

