// JavaScript Document
<!--
function setcountdown(theyear,themonth,theday,thehour,themin){
yr=theyear;mo=themonth;da=theday;hr=thehour;mi=themin;
}

function setbase(thebase, theinc) {
	base = thebase;
	inc = theinc;
}

function convertIt(_v)
{
  var _dollars=parseInt(_v);
  var _cents=parseInt((_v-_dollars)*100);
  var _negative=_dollars<0;
  if(_negative){_dollars=-_dollars;_cents=-_cents;}
  while(_cents.toString().length<2)_cents="0"+_cents;
  var _dA=_dollars.toString().split("");
  var _d="";
  for(var i=_dA.length-1;i>=0;i--)
  {
    var _comma="";
	if((_dA.length-i)%3==0 && i!=0)_comma=", ";
    _d=_comma+_dA[i]+_d;
  }
  var _neg_sign=_negative?"-":"";
  var _result=""+_neg_sign+_d;
  return _result;
}


//STEP 1: Configure the countdown-to date, in the format year, month, day:

//setcountdown(2003,9,15,16,0)
//setbase(226190590,2)
setcountdown(2007,6,17,16,0)
setbase(526190590,5)

//STEP 2: Change the two text below to reflect the occasion, and message to display on that occasion, respectively
var occasion="Above 300,000,000 CERECONS Transactions (and counting)"
var message_on_occasion="Above 300,000,000 CERECONS Transactions (and counting)"

//STEP 3: Configure the below 5 variables to set the width, height, background color, and text style of the countdown area
var countdownwidth='200px'
var countdownheight='20px'
var countdownbgcolor='white'
var opentags=''
var closetags=''

//////////DO NOT EDIT PASS THIS LINE//////////////////

var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
var crosscount=''

function start_countdown()
{

}

function countdown(){
	
	var today=new Date()
	var todayy=today.getYear()
	if (todayy < 1000)
	todayy+=1900
	var todaym=today.getMonth()
	var todayd=today.getDate()
	var todayh=today.getHours()
	var todaymin=today.getMinutes()
	var todaysec=today.getSeconds()
	var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
	futurestring=montharray[mo-1]+" "+da+", "+yr + " " + hr + ":" + mi + ":00 PST"
	dd= Date.parse(todaystring) - Date.parse(futurestring) // this will give us the difference in time between today and the day the value was set
	dday=Math.floor(dd/(60*60*1000*24)*1)
	dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
	dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
	dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
	dtotal_sec = (dday*24*60*60) + (dhour*60*60) +(dmin*60) + dsec
	total_trans = (dtotal_sec*inc) + base + Math.round(Math.random()*(inc)) 

	//if on day of occasion
	if(dday<=0&&dhour<=0&&dmin<=0&&dsec<=1&&todayd==da)
	{
		document.getElementById("timer").innerHTML=opentags+message_on_occasion+closetags
		return
	}
	//if passed day of occasion
	else if (dday<=-1)
	{
		document.getElementById("timer").innerHTML=opentags+ "Above 300,000,000 CERECONS Transactions (and counting)" + closetags
		return
	}
	//else, if not yet
	else
	{

		//document.getElementById("timer").innerHTML=opentags + "<b>"+ dday+ "</b> days<br> " + "<b>"+ dhour+"</b> hours<br> " + "<b>"+ dmin+"</b> minutes<br>" + "<b>"+ dsec+"</b> seconds<br><b>  <p><font size=1 color=teal>" + dtotal_sec + " number of seconds since last update" + dtotal_sec*2 + "</b><p> "  + convertIt(total_trans) + "  EDI transactions have been processed through CERECONS <p> 21 of the 54 california health plans have lives in CERECONS"   ;
		//document.getElementById("timer").innerHTML=opentags + "<p><font face=verdana size=2 color=blue>21 of the 54 <a style=cursor:pointer onclick=viewHPlans();><u>california health plans</u></a> have lives in CERECONS <p> Over half a million lives are captured through CERECONS. <p> " + convertIt(total_trans) + "  EDI transactions have been processed through CERECONS ";
	}document.getElementById("timer").innerHTML=opentags + "<center><font face=arial size=2 color=333333><b>" + convertIt(total_trans) + "  CERECONS transactions to date";
	
	setTimeout("countdown()",1000)

}


<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

//-->

function opencertdetails()
{
	thewindow = window.open('http://www.claredi.com/public/certdetails.php?username=cerecons_uius', 
	'windowname', config='height=550,width=470,' +
	'toolbar=no,menubar=no,' +
	'scrollbars=yes,resizable=yes,' +
	'location=no,directories=no,status=yes');
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=507,height=600');");
}
//-->