
// format date as mmm dd, 20yy
// example: January 12, 2005
//
function date_mmmddyy(date)
{
  var d = date.getDate();
  var m = date.getMonth() + 1;
  var y = date.getYear();

  // handle different year values 
  // returned by IE and NS in 
  // the year 2000.
  if(y >= 2000)
  {
    y -= 2000;
  }
  if(y >= 100)
  {
    y -= 100;
  }

  // could use splitString() here 
  // but the following method is 
  // more compatible
  var mmm = 
    ( 1==m)?'January':( 2==m)?'February':(3==m)?'March':
    ( 4==m)?'April':( 5==m)?'May':(6==m)?'June':
    ( 7==m)?'July':( 8==m)?'August':(9==m)?'September':
    (10==m)?'October':(11==m)?'November':'December';

  return "" +
    mmm + " " +
    (d<10?"0"+d:d) + ", " + "20" +
    (y<10?"0"+y:y);
}


//
// get last modified date of the 
// current document.
//
function date_lastmodified()
{
  var lmd = document.lastModified;
  var s   = "Unknown";
  var d1;

  // check if we have a valid date
  // before proceeding
  if(0 != (d1=Date.parse(lmd)))
  {
    s = "" + date_mmmddyy(new Date(d1));
  }

  return s;
}

//
// finally display the last modified date
// as MMM DD, 20YY
//
//document.write(  
 // date_lastmodified() );







//open window functions for try me, show me, and tell me
var infoWindow
function newWindow(url) {
	if (!infoWindow || infoWindow.closed) {
		infoWindow = window.open(url,"infoit","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=280,height=260,left=300,top=200");
     }
	 else {
		// window's already open; bring to front and update
		infoWindow = window.open(url,"infoit","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=280,height=240,left=300,top=200");
	 	infoWindow.focus();
	 }	
}

//open window functions for try me, show me, and tell me
var fexWindow
function fexWindow(url) {
	if (!fexWindow || fexWindow.closed) {
		fexWindow = window.open(url,"fexit","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=300,height=280,left=300,top=200");
     }
	 else {
		// window's already open; bring to front and update
		fexWindow = window.open(url,"fexit","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=300,height=280,left=300,top=200");
	 	fexWindow.focus();
	 }	
}

var popupWindow
// pop-up Window for index page referencing "Getting Started"
function popWindow(url,height,width) {
	if (!popupWindow || popupWindow.closed) {
		popupWindow = window.open(url,"popup","toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,left=200,top=50,height="+height+",width="+width);
     }
	 else {
		// window's already open; close,update,bring to front and update
		popupWindow.close();
		popupWindow = window.open(url,"popup","toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,left=200,top=50,height="+height+",width="+width);
	 }
}	 
var popupWindow2
// pop-up Window for tips in stress management
function popWindow2(url,height,width) {
	if (!popupWindow2 || popupWindow2.closed) {
		popupWindow2 = window.open(url,"popup2","toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,left=400,top=20,height="+height+",width="+width);
     }
	 else {
		// window's already open; close,update,bring to front and update
		popupWindow2.close();
		popupWindow2 = window.open(url,"popup2","toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,left=400,top=20,height="+height+",width="+width);
	 }
}	


// var doit = true
// function showm(ob,pict) {
//   if(doit) {
//     document.getElementById(ob).style.height = '100%'
//     document.getElementById(pict).src = '../images/arrowd.gif'
//     doit = false
//   }
//   else {
//     document.getElementById(ob).style.height = '65'
//     document.getElementById(pict).src = '../images/arrowl.gif'
//     doit = true
//   }
// }
// 
// 
// 
//  function OpenClose(obj) {
//    if (obj.style.display=='block') {
//      obj.style.display='none';
//    } else {
//      obj.style.display='block';
//    }
//  }

 function OpenClose(obj) {
   HeadObj = eval(obj + "_Head");
   BodyObj = eval(obj + "_Body");

   if (BodyObj.style.display=='block') {
     BodyObj.style.display='none';
     SignOffset = HeadObj.innerHTML.indexOf("-");
     HeadObj.innerHTML = "+" + HeadObj.innerHTML.substring(SignOffset+1);
   } else {
     BodyObj.style.display='block';
     SignOffset = HeadObj.innerHTML.indexOf("+");
     HeadObj.innerHTML = "-" + HeadObj.innerHTML.substring(SignOffset+1);
   }
 }