
function toggleLayer(whichLayer, layerStatus)
{
if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer).style;
style2.display = layerStatus;

}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer].style;
style2.display = layerStatus;
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer].style;
style2.display = layerStatus;
}
}

function tc(whichLayer, whichClass) {

	
if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer);

style2.className = whichClass;

}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer];
style2.className = whichClass;
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer];
style2.className = whichClass;
}

}
/*
function toggleClass(whichLayer, whichClass)
{
	alert("IN");
if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer);
alert(style2.className);
style2.className = whichClass;
alert(style2.className);
}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer];
style2.className = whichClass;
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer];
style2.className = whichClass;
}
}
*/

function showHideLayer(whichLayer)
{
if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer).style;

if (style2.display == 'block') style2.display = 'none';
else  style2.display = 'block';

}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer].style;
if (style2.display == 'block') style2.display = 'none';
else  style2.display = 'block';
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer].style;
if (style2.display == 'block') style2.display = 'none';
else  style2.display = 'block';
}
}

 function toggle(image,list){ 
 	
 	var listElementStyle=document.getElementById(list).style; 
 	
 	if (listElementStyle.display=="none"){ 
 		
 		listElementStyle.display="block"; 
 		document.getElementById(image).src="images/up.gif"; 
 		//document.getElementById(image).alt="Close list"; 
 	
 	} else { 
 		
 		listElementStyle.display="none"; 
 		document.getElementById(image).src="images/down.gif"; 
 		//document.getElementById(image).alt="Open list"; 
 	} 
 
 }
 
 
// gives up and down scroll buttons to images, spans, ... named up_name, down_name, respectively.
// will keep the default scroll_box's style overflow if it encounters errors (so make overflow: auto;)

// usage: put this after the scrollbox div:  var div_scroll1 = new TextScroll('div_scroll1', 'scroll_box');
function TextScrollVertical(scrollname, div_name, up_name, down_name)
{
    this.div_name = div_name;
    this.name = scrollname;
    this.scrollCursor = 0;
    this.speed = 12;
    this.timeoutID = 0;
    this.div_obj = null;
    this.up_name = up_name;
    this.dn_name = down_name;

{
        if (document.getElementById) {
            div_obj = document.getElementById(this.div_name);
            if (div_obj) {
                this.div_obj = div_obj;
                this.div_obj.style.overflow = 'hidden';
            }
            div_up_obj = document.getElementById(this.up_name);
            div_dn_obj = document.getElementById(this.dn_name);
            if (div_up_obj && div_dn_obj) {

div_up_obj.onmouseover = function() { eval(scrollname + ".scrollUp();") };
div_up_obj.onmouseout = function() { eval(scrollname + ".stopScroll();") };

div_dn_obj.onmouseover = function() { eval(scrollname + ".scrollDown();") };
div_dn_obj.onmouseout = function() { eval(scrollname + ".stopScroll();") };                
                
                
                
                
            }
        }
    }

this.stopScroll = function() {
        clearTimeout(this.timeoutID);
    }

this.scrollUp = function() {
        if (this.div_obj) {
            this.scrollCursor = (this.scrollCursor - this.speed) < 0 ? 0 : this.scrollCursor - this.speed;
            this.div_obj.scrollTop = this.scrollCursor;
            this.timeoutID = setTimeout(this.name + ".scrollUp()", 60);
        }
    }

//this.scrollDown = function() {
//        if (this.div_obj) {
//            this.scrollCursor += this.speed;
//            this.div_obj.scrollTop = this.scrollCursor;
//            this.timeoutID = setTimeout(this.name + ".scrollDown()", 60);
//        }
//    }
    
    
this.scrollDown = function() {
if (this.div_obj) {
this.scrollCursor += this.speed;
this.div_obj.scrollTop = this.scrollCursor;
if (this.div_obj.scrollTop == this.scrollCursor) {
this.timeoutID = setTimeout(this.name + ".scrollDown()", 60);
} else {
this.scrollCursor = this.div_obj.scrollTop;
}
}
}       

this.resetScroll = function() {
        if (this.div_obj) {
            this.div_obj.scrollTop = 0;
            this.scrollCursor = 0;
        }
    }
}
