<!--

// this is a rename from shopdaddy.js to news.js

var iid; // Interval ID
var iin; // Interval Interation Number

// perform the scroll to location identified by goThere()
function doScroll (ts) {
	iin++;
	cs = document.body.scrollTop; // current scroll location
	if (cs == ts) { clearInterval(iid); }
	else {
		if (cs > ts) { 
			ms = Math.ceil((cs - ts) / 10);
			max = iin * 5;
			if (ms > max) { ms = max; }
			ts = cs - ms;
		}
		else {
			ms = Math.ceil((ts - cs) / 10);
			max = iin * 5;
			if (ms > max) { ms = max; }
			ts = cs + ms;
		}
		document.body.scrollTop = ts;
		if (document.body.scrollTop == cs) { clearInterval(iid); } 
	}
}

// go to the top of element with specified id
function goThere (id) {
	d=document.getElementById(id); 
	ts = d.offsetTop; // target scroll location 
	if (d.offsetParent) while (d = d.offsetParent) ts += d.offsetTop;
	iin = 0;
	iid = setInterval('doScroll(ts)', 10);
}

// toggle div between block and none
function toggleDiv(id,v) { 
	if (typeof v == 'undefined') { v = "toggle"; } 
	target = document.getElementById(id);
	if (v == "none") { target.style.display = "none"; }
	else if (v == "block") { target.style.display = "block"; }
	else {
		if (target.style.display == "none") { target.style.display = "block"; } 
		else if (target.style.display == "block") { target.style.display = "none"; } 
	}
}

// toggle span between inline and none
function toggleSpan(id,v) { 
	if (typeof v == 'undefined') { v = "toggle"; } 
	target = document.getElementById(id);
	if (v == "none") { target.style.display = "none"; }
	else if (v == "inline") { target.style.display = "inline"; }
	else {
		if (target.style.display == "none") { target.style.display = "inline"; } 
		else if (target.style.display == "inline") { target.style.display = "none"; } 
	}
}

// -->


