/* Clsoe window via button without alert */

function closeMe()
{
    window.opener='X'; 
    window.open('','_parent',''); 
    window.close();
}
       

/* Hide Show Div */

function showHideDiv(theId,imageid) 
{
    var theContainer = document.getElementById(theId);
    if (imageid != null)
    {
        theIcon = document.getElementById(imageid);
    }
    
    if (theContainer.style.display == '' ||
        theContainer.style.display == 'block') 
    {
        theContainer.style.display = 'none';
        if (imageid != null)
        {
            theIcon.src = "../images/plus.gif";
        }
    } 
    else if (theContainer.style.display == 'none') 
    {
        theContainer.style.display = '';
        if (imageid != null)
        {
            theIcon.src = "../images/minus.gif";
        }
    } 
}

function setHiddenDiv(theId)
{
    document.getElementById(theId).style.display = "none";
}

/* Scroller */
	var delay = new Array();
	var browser=navigator.appName;

	function beginScroll(elt){
        try{
        	if (elt == 1){
                stopScroll('1');
        		scroll('1','1');
            }
            else if (elt == 2){
                 stopScroll('2');
        		 scroll('1','2');
            }
            else {
                stopScroll('1');
        		scroll('1','1');
                stopScroll('2');
        		scroll('1','2');
            }
        } catch(e) {}
	}
	
	function scroll(direction, elt){
			var topstr = document.getElementById('scroller'+elt).style.top
			if(topstr==""){topstr="0px"}
			topstr = topstr.substring(0, topstr.length-2)
			//alert('topstr: ' + topstr)
			var topint = parseInt(topstr) - parseInt(direction);
			//alert ('topint: ' + topint);
			var scrollContainerHeight = document.getElementById('scrollcontainer'+elt).offsetHeight
			var scrollerHeight = document.getElementById('scroller'+elt).offsetHeight
			if (parseInt(direction)<0)
				if (topint>(scrollContainerHeight + 10)){topint = (scrollerHeight*-1)}
			if (parseInt(direction)>0)
				if (topint<((scrollerHeight*-1) - 10)){topint = scrollContainerHeight }
			document.getElementById('scroller'+elt).style.top = topint + "px";
			//alert('t: ' + document.getElementById('scroller').style.top);//document.getElementById('scroller').style.top = document.getElementById('scroller').style.top + '100px';
			if(browser!="Microsoft Internet Explorer"){
				delay[elt] = setTimeout("scroll("+direction+","+elt+")", 45)
			}
			else {
				delay[elt] = setTimeout("scroll("+direction+","+elt+")", 33)
			}
	}
	
	function stopScroll(elt){
		clearTimeout(delay[elt]);
		timerOn=0;
		//alert(browser)
		//alert("offsetHeight: " + document.getElementById('scroller').offsetHeight);
	}

    
