
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.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	  this.ie=this.ie4||this.ie5||this.ie6||this.ie7
	  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.ie = (this.ie7||this.ie6||this.ie5||this.ie4);
	  this.bw=(this.ie7||this.ie6||this.ie5||this.ie4||this.ns4||this.ns6||this.opera5)
	  return this
}

var bw = new lib_bwcheck() //Browsercheck object


//Debug function ******************
function lib_message(txt){alert(txt); return false}


//Lib objects  ********************
function lib_obj(obj,nest)
{ 
	  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 lib_message('The layer does not exist ('+obj+')' 
	    +'- \nIf your using Netscape please check the nesting of your tags!')
	  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.c=0 //Clip values
	  if((bw.dom || bw.ie4) && this.css.clip) {
	  this.c=this.css.clip; this.c=this.c.slice(5,this.c.length-1); 
	  this.c=this.c.split(' ');
	  for(var i=0;i<4;i++){this.c[i]=parseInt(this.c[i])}
	  }
	  this.ct=this.css.clip.top||this.c[0]||0; 
	  this.cr=this.css.clip.right||this.c[1]||this.w||0
	  this.cb=this.css.clip.bottom||this.c[2]||this.h||0;
	  this.close_in_progress = false; 
	  this.cl=this.css.clip.left||this.c[3]||0
	  this.obj = obj + "Object"; eval(this.obj + "=this")
	  
	  this.setPosition = setPosition;
	  this.moveIt = moveIt;
	  this.hideIt_now = hideIt_now;
	  this.hideIt = hideIt;
	  this.blend = blend;
	  this.showIt = showIt;
	  this.align_right = align_right;
	  this.setPosition_offset = setPosition_offset;
	  this.setPosition_offsetxy = setPosition_offsetxy;
	  this.showIt_xy = showIt_xy;
  
}


function MainMenuOver1(aobject, linkcolor, bgcolor, left, description)
{

	aobject.style.backgroundColor = bgcolor;
	aobject.style.color			  = linkcolor;
	
	if (document.all)
	{
		aobject.style.cursor = "hand";
	}
	else
	{
		aobject.style.cursor = "pointer";
	}
}

function MainMenuOut1 (aobject, linkcolor, bgcolor)
{
	aobject.style.backgroundColor = bgcolor;
	aobject.style.color			  = linkcolor;

	//
	// Hide navigation hint
	//
	//document.getElementById('NavigationHint').style.display = 'none';
}


function setPosition(pic_name)
{
	var offset = 22;
	if (bw.ns4 || bw.ns6) 
	{
     		    		
     		
     		pos = document.images[pic_name];
     		this.moveIt(pos.x -1 ,pos.y + offset);
	     	
	}
	
	else
	{
	
		var pos = document.all[pic_name];
		this.moveIt(getLeft(pos)-1,getTop(pos)+offset);
	      
	}
}

function setPosition_offset(pic_name, offset)
{
	
	var yoffset = 51;
	if (bw.ns4 || bw.ns6) 
	{
     		
     		pos = document.images[pic_name];
		this.moveIt(pos.x - offset,pos.y+yoffset);
	     	
	}
	
	else
	{
	
		var pos = document.all[pic_name];
		this.moveIt(getLeft(pos) - yoffset,getTop(pos)+offset);
	      
	}
	
	
}

function setPosition_offsetxy(pic_name, x, y)
{
	y += 1;
	x += 1;
	
	if (bw.ns4 || bw.ns6) 
	{
     		
     	pos = document.images[pic_name];
		this.moveIt(pos.x + x,pos.y + y);
	     	
	}
	
	else
	{
	
		var pos = document.all[pic_name];
		this.moveIt(getLeft(pos) + x, getTop(pos) + y);
	      
	}
	
	
}

function getLeft(l)
{
  if (l.offsetParent) return (l.offsetLeft + getLeft(l.offsetParent));
  else return (l.offsetLeft);
}


function getTop(l)
{
  if (l.offsetParent) return (l.offsetTop + getTop(l.offsetParent));
  else return (l.offsetTop);
}

//Moving object to **************
function moveIt(x, y)
{
  this.x=x;
  this.y=y;

  this.css.left=x;
  this.css.top=y;

}


//Showing object ************
function showIt(name)
{
	this.close_in_progress = false;
	this.setPosition(name);
	this.css.visibility="visible";
	
	
}

//Showing object ************
function showIt_xy(name, x, y)
{
	this.close_in_progress = false;
	this.setPosition_offsetxy(name, x, y);
	this.css.visibility="visible";
}

//Showing object ************
function align_right(name, offset)
{
	
	this.close_in_progress = false;
	this.setPosition_offset(name, offset);
	this.css.visibility="visible";
	
}

//Hiding object **********
function hideIt_now()
{ 
	if (this.close_in_progress == true)
	{
		this.close_in_progress = false;
		this.blend('hidden');
	}
		
}

//Hiding object **********
function hideIt()
{
	if (this.close_in_progress == false)
	{
		this.close_in_progress = true;
		window.setTimeout(this.obj + ".hideIt_now()",100);
	}
			
}


function blend (what)
{
	this.css.visibility = what;
}


		
function lib_init()
{		
	l0 = new lib_obj('elhidden');
	l1 = new lib_obj('Layer1');
	l2 = new lib_obj('Layer2');
	l3 = new lib_obj('Layer3');
	l4 = new lib_obj('Layer4');
	l5 = new lib_obj('Layer5');
	l6 = new lib_obj('Layer6');
	l7 = new lib_obj('Layer7');
	l8 = new lib_obj('Layer8');		
	l9 = new lib_obj('Layer9');
	l10 = new lib_obj('Layer10');	
	l11 = new lib_obj('Layer11');
	
}
			
function hideall(what_not)
{
	if (what_not != 'l1') l1.blend('hidden');
	if (what_not != 'l2') l2.blend('hidden');
	if (what_not != 'l3') l3.blend('hidden');
	if (what_not != 'l4') l4.blend('hidden');
	if (what_not != 'l5') l5.blend('hidden');
	if (what_not != 'l6') l6.blend('hidden');
	if (what_not != 'l7') l7.blend('hidden');
	if (what_not != 'l8') l8.blend('hidden');
	if (what_not != 'l9') l9.blend('hidden');
	if (what_not != 'l10') l10.blend('hidden');
	if (what_not != 'l11') l11.blend('hidden');

}		