<!--

	var ni;
	var newdiv;	
	var divID = 'layer1';
	var show= true;
	
	var y1 = 20;   // change the # on the left to adjuct the Y co-ordinate
	(document.getElementById) ? dom = true : dom = false;
	
	
/// create ad
	
	var divHTML = '<div id="'+divID+'" style="width:350px;height350px; position: absolute; border: 2px solid #cc0000; z-index: 2"><span style="float:right; background-color:gray; color:white; font-weight:bold; width:20px; text-align:center; cursor:pointer; position: absolute; left: 330px" onclick="javascript:hideIt()">&nbsp;X&nbsp;</span>';
	divHTML += '<a href="http://www.familyfirstaid.org" target="_blank" onclick="javascript:hideIt()"><img src="http://www.familyfirstaid.org/ad_one/ffa_ad_one.jpg" alt="familyfirstaid.org - If you have a child - you need to visit FamilyFirstAid.org. Statistics, articles, and advice. Click here for free information" border="0" /></a></div>'; 
	
	function hideIt() {
 	 	if (dom) {document.getElementById("layer1").style.visibility='hidden';}
		show = false;
	}

	function showIt() {
  		if (dom) {document.getElementById("layer1").style.visibility='visible';}
	}

	function placeIt() {
		ni = document.body;
		var cBodyHtml = ni.innerHTML;
		ni.innerHTML = '';
		ni.innerHTML = divHTML+""+cBodyHtml+"";
		
  		if (dom && !document.all) {document.getElementById(divID).style.top = window.pageYOffset + (window.innerHeight - (window.innerHeight-y1)) + "px";}
  		if (document.all) {document.all[divID].style.top = document.documentElement.scrollTop + (document.documentElement.clientHeight - (document.documentElement.clientHeight-y1)) + "px";}
 		
		initScrollDiv();
		
		
		
		 //window.setTimeout("placeIt()", 10); 
	}
	
	
/// auto scroll placement
	
	function initScrollDiv() {

		if(show){
		var x = (pagePositionLeft()+100) + 'px';
		var y = (pagePositionTop()+10) + 'px';
		moveObjectTo(divID,x,y);
		setObjVisible(divID,'visible');
		}
	}
	
	function setObjVisible(objID,param) {
		var obj = document.getElementById(objID); 
		if(obj){
		obj.style.visibility = param;
		}
	} 
	
	function moveObjectTo(objID,x,y){

		var obj = document.getElementById(objID); 
		if(obj){
		obj.style.top = y;
		obj.style.left = x;
		}
		
	}
	
	function totalPageWidth() {
		return window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ?       document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;
	} 
		
	function totalPageHeight() {
		return  window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ?  document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;
	} 
	
	function pagePositionLeft() {
		return typeof window.pageXOffset != 'undefined' ? window.pageXOffset :document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ? document.body.scrollLeft : 0;
	} 
	
	function pagePositionTop() {
		return typeof window.pageYOffset != 'undefined' ?  window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0;
	} 
	
	function pagePositionRight() {
		return pagePositionLeft()+totalPageWidth();
	} 
	
	function pagePositionBottom() {
		return pagePositionTop()+totalPageHeight();
	}	
	
	function runPopup () {
	
	
	
		var data = getCookie("hasPopped");
		if(data == "true"){
			show = false;
		} else {
			setCookie("hasPopped",true,getExpDate(0,24,0));
			placeIt();
			showIt();
		}	


		
	}
	
/// show ad once every 12 hours 

/// popup function lib

	function getCookie(name){
		var arg = name + "=";
		var alen = arg.length;
		var clen = document.cookie.length;
		var i = 0;
		while(i<clen){
			var j = i + alen;
			if(document.cookie.substring(i,j)== arg){
				return getCookieVal(j);
			}
			i = document.cookie.indexOf(" ",i)+1;
			if(i == 0) break;
		}
		return "";
	}

	function getCookieVal(offset) {
		var endstr = document.cookie.indexOf(";",offset);
		if(endstr == -1){
			endstr = document.cookie.length;
		}
		return unescape(document.cookie.substring(offset, endstr));
	}

	function setCookie(name,value,expires, path, domain, secure){
		document.cookie = name + "=" + escape(value) +
		((expires)? "; expires=" + expires : "")+ 
		((path)? "; path=" + path : "" )+
		((domain)? "; domain="+ domain : "" )+
		((secure)? "; secure" : "" );
	}

	function deleteCookie(name,path,domain){
		if(getCookie(name)){
			document.cookie = name + "=" +
			((path)?"; path=" + path :"")+
			((domain)?"; domain=" + domain: "")+
			"; expires=Thu, 01-Jan-70 00:00:01 GMT";
		}
	}

	function getExpDate(days, hours, minutes){
		var expDate = new Date();
		if(typeof days == "number" && typeof hours == "number" && typeof minutes == "number"){
			expDate.setDate(expDate.getDate() + parseInt(days));
			expDate.setHours(expDate.getHours() + parseInt(hours));
			expDate.setMinutes(expDate.getMinutes() + parseInt(minutes));
			return expDate.toGMTString();
		}
	}	
		
	
	window.onload = runPopup;
	window.onscroll = initScrollDiv; 
	window.onresize = initScrollDiv; 	
	-->