/****** Menu ******/
var lastmenu;

function onmenuover(menu) { 
	var menuid=menu.id.substr(8);
	var dash=document.getElementById("menudash"+menuid);

	if (lastmenu) {
			document.getElementById("menudash"+lastmenu).style.visibility="hidden";
	}

	if (dash.className=="menuselected") {
		lastmenu=undefined;
	} else {
		dash.style.visibility="visible";
		lastmenu=menuid;
	}
}

function onmenuout(menu) {
	var menuid=menu.id.substr(8);
	var dash=document.getElementById("menudash"+menuid);

	if (dash.className!="menuselected") {
		dash.style.visibility="hidden";
	} 
	lastmenu=undefined;
}

/****** News Links ******/
function highlightnews() {	
	var ul=document.getElementById("newsitems");
	var liloop;
	for (liloop=0; liloop<ul.childNodes.length; liloop++) {
		var li=ul.childNodes[liloop];
		if (li.nodeName=="LI") {
			var aloop;
			for (aloop=0; aloop<li.childNodes.length; aloop++) {
				var a=li.childNodes[aloop];
				if (a.nodeName=="A") {
					if (a.href == window.location.href) {
						a.style.color="#524e85";
					}
				}
			}
		}
	}
}

/****** Random Flash Quotes ******/
function flashQuotes() {
	var r=Math.floor(Math.random()*5)+1;
	var filename="/cancer/scottcares/includes/quotes/quotes" + r + ".swf";
	document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='156' height='210' class='flashQuotes' align='middle'>");
	document.write("<param name='allowScriptAccess' value='sameDomain' />");
	document.write("<param name='movie' value='" + filename + "' />");
	document.write("<param name='quality' value='high' />");
	document.write("<param name='bgcolor' value='#F8EEEB' />");
	document.write("<embed src='" + filename + "' quality='high' bgcolor='#F8EEEB' width='156' height='210' align='middle' class='flashQuotes' allowscriptaccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
	document.write("</object>");
}

/****** Footer ******/
function Disclaimer()
{
	hist_window = window.open('/home/popupdisclaimer.htm','Disclaimer','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizeable=no,width=500,height=300');
}

function PrivacyStatement()
{
	hist_window = window.open('/home/popupprivacy.htm','PrivacyStatement','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizeable=no,width=500,height=650');
}
 
function adjustfooter() {
	var contentheight=Math.max(document.body.offsetHeight,document.getElementById("wrapper").offsetHeight);
	
	contentheight=contentheight-68;
		
	document.getElementById("footer").style.top=contentheight+"px";
	document.getElementById("footer").style.visibility="visible";
	setTimeout("adjustfooter()",100);
}
 
/****** MailMe ******/
function MailMe(name,subj,body)
{
  var domain = 'ccf.org'
  var q = ((subj||body)?'?':'');
  if (subj) q=q+'subject='+subj;
  if (subj&&body) q=q+'&';
  if (body) q=q+'body='+body;
  window.location = 'mai' + 'lto:' + name + '@' + domain + q;
}
/*** Usage: <a href="#" onClick="MailMe('contact','subject','body');">Contact Us</a> ***/
