function nav(A,B,C) {
var x=document.getElementById(A);
if (B=='in') {
  if (x) {
  x.style.background='white';
  x.style.color='#0000FF';
  x.style.borderRight='1px solid #0000FF';
  x.style.cursor='hand'; 
  }
  document.images[C].src='http://thefutureofhealthcare.org/core/inc/img/nav-arw-bu.gif';         
  }
else {
  if (x) {
  x.style.background='';
  x.style.color='#0000B3';
  x.style.borderRight='';
  x.style.cursor='pointer';
  }
  document.images[C].src='http://thefutureofhealthcare.org/core/inc/img/x.gif';         
  }
}

function snav(A,B,C) {
var x=document.getElementById(A);
if (B=='in') {
  if (x) {
//  x.style.background='white';
  x.style.color='#0000FF';
  x.style.borderRight='1px solid #0000FF';
  x.style.cursor='hand'; 
  }
  document.images[C].src='http://thefutureofhealthcare.org/core/inc/img/nav-arw-bu.gif';         
  }
else {
  if (x) {
//  x.style.background='white';
  x.style.color='#0000B3';
  x.style.borderRight='1px solid #FFFFFF';
  x.style.cursor='pointer';
  }
  document.images[C].src='http://thefutureofhealthcare.org/core/inc/img/x.gif';         
  }
}

function launch(A) {
var pre='http://thefutureofhealthcare.org';
var post=A;
var url=pre+post;
location.replace(url); 
}

function chkurl(A,B,C,D) {
var z = location.href ;
curpage = z.lastIndexOf( '/' ) ;
var x=document.getElementById(D);
if( A == z.substr( curpage + 1 ) ) {
  document.images[B].onload=null;  
  var newimg="http://thefutureofhealthcare.org/core/inc/img/nav-arw-" + C + ".gif";
  document.images[B].src=newimg;
  x.style.background='white';
  x.style.color='#0000FF';
  x.style.borderRight=''; 
  x.onmouseout=null; 
  x.onmouseover=null; 
  }

}

now = new Date();
function makeMonthArray() {
    this.length=12;
    this[1]  = "Jan"; this[2]  = "Feb"; this[3]  = "Mar";
    this[4]  = "Apr"; this[5]  = "May"; this[6]  = "Jun";
    this[7]  = "Jul"; this[8]  = "Aug"; this[9]  = "Sep";
    this[10] = "Oct"; this[11] = "Nov"; this[12] = "Dec";
    return this;
}
function makeDayArray() {
    this.length=7;
    this[1] = "Sun"; this[2] = "Mon"; this[3] = "Tue";
    this[4] = "Wed"; this[5] = "Thu"; this[6] = "Fri";
    this[7] = "Sat";
    return this;
}
function _getFullYear() {
    var y = this.getYear();
    if (y < 1000) y += 1900;
    return y;
}
function writeDate() {
    if (!now.getFullYear) now.getFullYear = _getFullYear;
    monthName = new makeMonthArray(); dayName = new makeDayArray();
    document.write (dayName[now.getDay() + 1] + ". " + monthName[now.getMonth() + 1] + " " + now.getDate() + ", " + now.getFullYear());
}
function writeCopy(z) {
    if (!now.getFullYear) now.getFullYear = _getFullYear;
    var x=(now.getFullYear()-1);
    var y=(now.getFullYear()+1);
    document.write ("&copy; " + x + "-" + y + " " + z);
}
function openWin (fileName, windowName) { 
window.open(fileName,windowName,'width=620,height=500,directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes');
}

// Declaring valid date character, minimum year and maximum year
var dtCh= "-";
var minYear=1970;
var maxYear=2100;

function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}

function isDate(dtStr){
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strDay=dtStr.substring(pos2+1)
	var strMonth=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(0,pos1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		alert("The date format should be : yyyy-mm-dd")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert("Please enter a valid date")
		return false
	}
return true
}



function keySort(dropdownlist,caseSensitive) {
  var undefined; 
  if (dropdownlist.keypressBuffer == undefined) { 
    dropdownlist.keypressBuffer = ''; 
  } 
  var key = String.fromCharCode(window.event.keyCode); 
  dropdownlist.keypressBuffer += key;
  if (!caseSensitive) {
    dropdownlist.keypressBuffer = dropdownlist.keypressBuffer.toLowerCase();
  }
  var optionsLength = dropdownlist.options.length; 
  for (var n=0; n < optionsLength; n++) { 
    var optionText = dropdownlist.options[n].text; 
    if (!caseSensitive) {
      optionText = optionText.toLowerCase();
    }
    if (optionText.indexOf(dropdownlist.keypressBuffer,0) == 0) { 
      dropdownlist.selectedIndex = n; 
      return false; 
    } 
  }  
  dropdownlist.keypressBuffer = key; 
  return true;
} 

function subm(act,id,optA,optB) {
x=document.forms[0];
x.act.value=act;
x.id.value=id;
if (x.optA){
x.optA.value=optA;
}
if (x.optB){
x.optB.value=optB;
}

document.forms[0].submit();
}

function getXMLHttp() {
var xmlHttp
try {
  //Firefox, Opera 8.0+, Safari
  xmlHttp = new XMLHttpRequest();
  }
  catch(e) {
    //Internet Explorer
    try {
    xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch(e) {
      try {
      xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
      }
      catch(e){
      //alert("Your browser does not support AJAX!");
      return false;
      }
    }
  }
return xmlHttp;
}

function MakeRequest() {
var xmlHttp = getXMLHttp();
xmlHttp.onreadystatechange = function(){
  if(xmlHttp.readyState == 4) {
    HandleResponse(xmlHttp.responseText);
    }
  }
xmlHttp.open("GET", "news.cgi", true); 
xmlHttp.send(null);
}

function HandleResponse(response) {
document.getElementById('ResponseDiv').innerHTML = response;
}
