﻿// JScript File

//used with gridviews to change the background color on click
function toggle(obj){
    if (obj.style.backgroundColor == 'yellow')
        {obj.style.backgroundColor='';}
    else
        {obj.style.backgroundColor='yellow';
    }
};


// an ajaxy way to switch displaying between 2 div sections
// Used in search page only
function ToggleDisplay(id1,id2)
	{
	    var Yposition = 0
	    if (navigator.appName == "Microsoft Internet Explorer")
	        {Yposition = document.body.scrollTop;}
	    else
	        {Yposition = window.pageYOffset;}

	    
		var elem1 = document.getElementById(id1);
		var elem2 = document.getElementById(id2);
		var Details_v = document.getElementById('l1' + id1);
		var Details_c = document.getElementById('l2' + id1);
		
		if (elem1)
		{
		if (elem1.style.display != 'none')
		{
			elem1.style.display = 'none';
			Details_c.style.display = 'none';
			Details_v.style.display = '';
		}
		else
		{
			elem1.style.display = '';
			Details_c.style.display = '';
			Details_v.style.display = 'none';
		}
		}
		
		if (elem2)
		{
		if (elem2.style.display != 'none')
		{
			elem2.style.display = 'none';
			Details_c.style.display = 'none';
			Details_v.style.display = '';
		}
		else
		{
			elem2.style.display = '';
			Details_c.style.display = '';
			Details_v.style.display = 'none';
		}
		}

		//scrollToCoordinates(0,Yposition)
	}
	

function resetTimer(timerID){
    var b = $find(timerID);
    if(b){
    b._stopTimer();
    b._startTimer();
    }
}
function stopTimer(timerID){
    var b = $find(timerID);
    b._stopTimer();
}
function startTimer(timerID){
    var b = $find(timerID);
    b._startTimer();
}