// JavaScript Document
rnd.today=new Date();
rnd.seed=rnd.today.getTime();

function rnd() {
  rnd.seed = (rnd.seed*9301+49297) % 233280;
  return rnd.seed/(233280.0);
}

function rand(number) {
  return Math.ceil(rnd()*number);
}

function PopUp(url,w,h,sb,rs,st,tb,mb,ti,lc)
{
  lft = (screen.availWidth -w)/2;
  t = (screen.availHeight -h)/2;
  p = "scrollbars=" + sb + ",resizable=" + rs + ",status=" + st + ",toolbar=" + tb + ",menubar=" + mb + ",titlebar=" + ti + ",location=" + lc + ",top=" + t + ",left=" +lft + ",width=" + w + ",height=" + h;
  window.open(url, rand(101)-1, p);
}

function outsideLink(where){
	if(!readCookie("seenDisclaimer")){
		if(confirm("Throughout our web site, we have placed live \"links\" to other web sites. Such external sites contain information created, published, maintained, or otherwise posted by institutions or organizations independent of The Health Foundation of Greater Cincinnati, and the copyright and privacy policies of these institutions or organizations apply to that material. The Health Foundation of Greater Cincinnati does not endorse, approve, certify, or control these external sites and does not guarantee the accuracy, completeness, efficacy, or timeliness of information located at such sites. Reference to any specific commercial product, process, or service does not constitute or imply endorsement, recommendation, or favoring by The Health Foundation of Greater Cincinnati. The Health Foundation of Greater Cincinnati assumes no responsibility for consequences resulting from use of information obtained at linked sites. The Health Foundation of Greater Cincinnati is not responsible for, and expressly disclaims all liability for, damages of any kind arising out of use, reference to, reliance on, or performance of such information.\n\nYou are being sent to " + where + ". Click OK to continue")){
			//document.location = where;
			createCookie("seenDisclaimer","true","1");
			window.open(where, rand(101)-1);
		}
	} else {
			if(confirm("You are now leaving the Health Foundation's site. Click OK to continue")){
				window.open(where, rand(101)-1);
			}
	}
}



function createCookie(name, value, days) 
{
	if(days) 
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else 
		var expires = '';
	
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) 
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		
		while (c.charAt(0)==' ') 
			c = c.substring(1,c.length);
			
		if (c.indexOf(nameEQ) == 0) 
			return c.substring(nameEQ.length,c.length);
	}
	
	return false;
}

function eraseCookie(name) 
{
	createCookie(name, "", -1);
}