
/***********************************************
* Image w/ description newtooltip- By Dynamic Web Coding (www.dyn-web.com)
* Copyright 2002-2007 by Sharon Paine
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* IMPORTANT: Put script after newtooltip div or
	 put newtooltip div just before </BODY>. */

var dom = (document.getElementById) ? true : false;
var ns5 = (!document.all && dom || window.opera) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !ie4 && !ie5 && !dom) ? true : false;

var origWidth, origHeight;

// avoid error of passing event object in older browsers
if (nodyn) { event = "nope" }

///////////////////////  CUSTOMIZE HERE   ////////////////////
// settings for newtooltip
// Do you want tip to move when mouse moves over link?
var tipFollowMouse= true;
// Be sure to set tipWidth wide enough for widest image
var tipWidth= 300;
var offX= 20;	// how far from mouse to show tip
var offY= 12;
var tipFontFamily= "Verdana, arial, helvetica, sans-serif";
var tipFontSize= "8pt";
// set default text color and background color for newtooltip here
// individual newtooltips can have their own (set in messages arrays)
// but don't have to
var tipFontColor= "#000000";
var tipBgColor= "#DDECFF";
var tipBorderColor= "#000080";
var tipBorderWidth= 3;
var tipBorderStyle= "ridge";
var tipPadding= 4;

// newtooltip content goes here (image, description, optional bgColor, optional textcolor)
var messages = new Array();
// multi-dimensional arrays containing:
// image and text for newtooltip
// optional: bgColor and color to be sent to newtooltip
messages[0] = new Array('','top', 'Platform is Here is a red balloon on a blue background', "#FFFFFF");
messages[1] = new Array('','Platform is Here is a red balloon on a blue background','', "#FFFFFF");
messages[2] = new Array('','Test description','','white','blue');
messages[3] = new Array('','Medication Content, Refill and Reorder provides capability to review medication guidelines, refill prescriptions, and reorder medical supplies at touch of a key','','white','blue');
messages[4] = new Array('','Remind patients of daily health regimen actions, scheduling of tests, appointments','','white','blue');
messages[5] = new Array('','Diary includes physiological information, symptoms, and medical regimen','','white','blue');
messages[6] = new Array('','Reward patients for adherence with regimen, meeting target numbers or attainment of other objectives','','white','blue');
messages[7] = new Array('','Redirect patient information and reports, including alarms for out-of-norm conditions, to healthcare practice team, family, other community resources','bottom','white','blue');
messages[8] = new Array('','Results and reports readily available with key reports automatically presented when entries recorded','bottom', 'white','blue');
messages[9] = new Array('','Rapid Deployment engine ensures quick implementation of programs across all touch points including various cell phones. ','bottom','white','blue');
messages[10] = new Array('','System pro-actively monitors out-of-norm situtations and alerts the teams via exception reports. ','bottom','white','blue');
messages[11] = new Array('','Provider teams can inject their specific protocols into the system thereby allowing maximum flexibility in managing their programs ','bottom','white','blue');
messages[12] = new Array('','The system connects to wide range of electronic record systems thereby enabling workflow integration. ','bottom', 'white','blue');
messages[13] = new Array('','The system can engage with patients via automated, on-demand, and two-way messaging in order to effectively collect data from patients while ensuring provider efficiencies','bottom','white','blue');
messages[14] = new Array('','Wide range of summary and individual reports are available for care team review in real-time.','bottom','white','blue');
messages[15] = new Array('','Applications are personalized and customized to treat the person (e.g. Diabetic) and not just their condition (Diabetes). ','bottom', 'white','blue');
messages[16] = new Array('','Unified Interface Engine ensures that the applications have common look and feel across multiple touch points including various cell phones. ','bottom', 'white','blue');
messages[17] = new Array('','Provisioning Tools enable easy and reliable implementation of applications on patient cell phones.','bottom', 'white','blue');
messages[18] = new Array('','Localication subsystem ensures that applications can be available in various languages. ','bottom','white','blue');
messages[19] = new Array('','Security Infrastructure ensures that applications are compliant to HIPAA and FDA privacy and security guidelines.','bottom', 'white','blue');
messages[20] = new Array('','BackOffice Interfaces enable easy integration with various Electronic Record Systems ','bottom','white','blue');
messages[21] = new Array('','Enables direct data capture from medical devices on a wireless and/or wired basis. ','bottom','white','blue');
messages[22] = new Array('do109_rw.jpg','Behavioral ','bottom','white','blue');
messages[23] = new Array('do102_rw.jpg','Biometric','bottom', 'white','blue');
messages[24] = new Array('do106_rw.jpg','Symptomatic','bottom','white','blue');
messages[25] = new Array('do108_rw.jpg','Environmental','bottom','white','blue');
messages[26] = new Array('do110_rw.jpg','Numeric','bottom','white','blue');
messages[27] = new Array('do107_rw.jpg','Scale','bottom','white','blue');
messages[28] = new Array('do104_rw.jpg','Preference','bottom','white','blue');
messages[29] = new Array('do105_rw.jpg','Time/Duration','bottom','white','blue');
messages[30] = new Array('guide_101.jpg','','bottom','white','blue');
messages[31] = new Array('guide_102.jpg','','bottom','white','blue');
messages[32] = new Array('guide_103.jpg','','bottom','white','blue');
messages[33] = new Array('pat_rep102.jpg','','bottom','white','blue');
messages[34] = new Array('pat_rep103.jpg','','bottom','white','blue');
messages[35] = new Array('pat_rep104.jpg','','bottom','white','blue');
messages[36] = new Array('pat_rep105.jpg','','bottom','white','blue');
messages[37] = new Array('phr1_rw.jpg','','bottom','white','blue');
messages[38] = new Array('phr2_rw.jpg','','bottom','white','blue');
messages[39] = new Array('phr4_rw.jpg','','bottom','white','blue');
messages[40] = new Array('phr5_rw.jpg','','bottom','white','blue');
messages[41] = new Array('phr6_rw.jpg','','bottom','white','blue');
messages[42] = new Array('random_image7.php','','bottom','white','blue');
messages[43] = new Array('int_4.jpg','Interfaces', 'Patients can use the system using their cell phones, their personal computers, and their basic telephones.','white','blue');
messages[44] = new Array('do109_rw.jpg','Behavioral ','bottom','white','blue');
messages[45] = new Array('do102_rw.jpg','Biometric','bottom','white','blue');
messages[46] = new Array('do106_rw.jpg','Symptomatic','bottom','white','blue');
messages[47] = new Array('do108_rw.jpg','Environmental','bottom','white','blue');
messages[48] = new Array('do110_rw.jpg','Numeric','bottom','white','blue');
messages[49] = new Array('do107_rw.jpg','Scale','bottom','white','blue');
messages[50] = new Array('do104_rw.jpg','Preference','bottom','white','blue');
messages[51] = new Array('do105_rw.jpg','Time/Duration','bottom','white','blue');
messages[52] = new Array('feature_wheel6.jpg','Features', 'System features include Health Dialog, Reports, Reminders, Redirection, Rewards, and Refill. ','white','blue');


////////////////////  END OF CUSTOMIZATION AREA  ///////////////////

// preload images that are to appear in newtooltip
// from arrays above
if (document.images) {
	var theImgs = new Array();
	for (var i=0; i<messages.length; i++) {
  	theImgs[i] = new Image();
		theImgs[i].src = messages[i][0];
  }
}

// to layout image and text, 2-row table, image centered in top cell
// these go in var tip in doTooltip function
// startStr goes before image, midStr goes between image and text
var startStr = '<table width="' + tipWidth + '"><tr><td align="center" width="100%"><img src="';
var start2Str = '<table width="' + tipWidth + '"><tr><td align="center" width="100%">';
var midStr = '" border="0"></td></tr><tr><td valign="top">';
var mid2Str = '</td></tr><tr><td valign="top">';
var endStr = '</td></tr></table>';
var start3Str = '<table border=0 width="' + tipWidth + '"><tr><td align="center" width="100%">';
var mid3Str = '</td></tr><tr><td align="center" width="100%"><img src="';
var mid4Str = '"></td></tr><tr><td align="left" width="100%">';

////////////////////////////////////////////////////////////
//  initTip	- initialization for newtooltip.
//		Global variables for newtooltip.
//		Set styles
//		Set up mousemove capture if tipFollowMouse set true.
////////////////////////////////////////////////////////////
var newtooltip, newtipcss;
function newinitTip() {
	if (nodyn) return;
	newtooltip = (ie4)? document.all['newtipDiv']: (ie5||ns5)? document.getElementById('newtipDiv'): null;
	newtipcss = newtooltip.style;
	if (ie4||ie5||ns5) {	// ns4 would lose all this on rewrites
		newtipcss.width = tipWidth+"px";
		newtipcss.fontFamily = tipFontFamily;
		newtipcss.fontSize = tipFontSize;
		newtipcss.color = tipFontColor;
		newtipcss.backgroundColor = tipBgColor;
		newtipcss.borderColor = tipBorderColor;
		newtipcss.borderWidth = tipBorderWidth+"px";
		newtipcss.padding = tipPadding+"px";
		newtipcss.borderStyle = tipBorderStyle;
	}
	if (newtooltip&&tipFollowMouse) {
		document.onmousemove = newtrackMouse;
	}
}
function getWindowWidth() {
		var windowWidth = 0;
		if (typeof(window.innerWidth) == 'number') {
			windowWidth = window.innerWidth;
		}
		else {
			if (document.documentElement && document.documentElement.clientWidth) {
				windowWidth = document.documentElement.clientWidth;
			}
			else {
				if (document.body && document.body.clientWidth) {
					windowWidth = document.body.clientWidth;
				}
			}
		}
		return windowWidth;
}


window.onload = newinitTip;

function jscss(a,o,c1,c2) {
   switch (a) {
      case 'swap':
         o.className= !jscss('check',o,c1) ? o.className.replace(c2,c1) : o.className.replace(c1,c2);
         break;
      case 'add':
         if(!jscss('check',o,c1)){o.className+=o.className?' '+c1:c1;}
         break;
      case 'remove':
         var rep=o.className.match(' '+c1)?' '+c1:c1;
         o.className=o.className.replace(rep,'');
         break;
      case 'check':
         return new RegExp('\\b'+c1+'\\b').test(o.className)
               break;
   }
}
function sel ( obj ) {
   if(!document.all) obj.style.cursor = "pointer";
   else if (document.getElementById && (!document.all) ) obj.style.cursor = "hand";  // IE 5
   else if (document.all) obj.style.cursor = "hand";  // IE 5
   jscss("add", obj, "boxsel");
}
function usel ( obj ) {
   jscss("remove", obj, "boxsel");
}

function findTop(obj) {
   var curtop = curleft = 0;
   if (obj.offsetParent) {
      do {
         curleft += obj.offsetLeft;
         curtop += obj.offsetTop;
      } while (obj = obj.offsetParent);
   }
   return curtop;
}

function findLeft(obj) {
   var curleft = curtop = 0;
   if (obj.offsetParent) {
      do {
         curleft += obj.offsetLeft;
         curtop += obj.offsetTop;
      } while (obj = obj.offsetParent);
   }
   return curleft;
}

/////////////////////////////////////////////////
//  doTooltip function
//			Assembles content for newtooltip and writes
//			it to newtipDiv
/////////////////////////////////////////////////
var t1,t2;	// for setTimeouts
var tipOn = false;	// check if over newtooltip link

function donewTooltip(evt,num)
{
   if (num > 42) {     // special handling for this set.
      var nm = document.getElementById("noname");
      nm.style.visibility="hidden";
	}

	if (!newtooltip) return;
	if (t1)  clearTimeout(t1);
   if (t2)  clearTimeout(t2);
	tipOn = true;
	// set colors if included in messages array
	if (messages[num][3])
		var curBgColor = messages[num][3];
	else
		curBgColor = tipBgColor;
	if (messages[num][4])
		var curFontColor = messages[num][4];
	else
		curFontColor = tipFontColor;
	if (ie4||ie5||ns5)
	{
		var tip = "";
		if (messages[num][0].length> 0)
			//tip = startStr + messages[num][0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr;
tip = start3Str +
'<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' +
mid3Str + messages[num][0] + mid4Str +
'<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][2] + '</span>'
+ endStr;
		else
		 	tip = start2Str + mid2Str + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr;

		newtipcss.backgroundColor = curBgColor;
	 	newtooltip.innerHTML = tip;
	}

   tipFollowMouse = true;          // default
   var sw = document.getElementById("footer");

   /*
   if( (num > 21) && (num < 43) ) {     // special handling for this set.
      var e = document.getElementById("content2");
      var f = findLeft(e);

      // var a = document.getElementById("newtipDiv");

      tipFollowMouse = false;
      newpositionTip(evt);    // get mouseX value
      var pointerX = mouseX - f - 225;

      var xx = 0;
      var del = 120;
      switch(num) {
         case 23: xx += del;
         case 24: xx += del;
         case 25: xx += del;
         case 22: xx += del; break;
         case 26: xx += del;
         case 27: xx += del;
         case 28: xx += del;
         case 29: xx += del; break;
	default: xx +=4*del; pointerX=0;
      }
      var xxx = xx + pointerX + del;

      var mmm = (xxx % del);
      var yyy = (xxx-mmm);;

      yyy = Math.floor(xxx / del);
      yyy *= del;

//      window.status = f + " " + mouseX + " -> " + pointerX + " " + xxx + " " + yyy;
//      alert ( f + " " + mouseX + " " + xxx + " " + yyy );
      yyy += f + 220 - 90;

      newtipcss.left = yyy + "px";
      newtipcss.top  = "150px";

      // newtooltip.innerHTML = "What the ???";;
      turnOn();

   } */

   if( (num > 21) && (num < 64) ) {     // special handling for this set.

      var e = document.getElementById("content2");
      var f = findLeft(e);

      // var a = document.getElementById("newtipDiv");

      tipFollowMouse = false;
      newpositionTip(evt);    // get mouseX value
      var pointerX = mouseX - f - 225;

      var xx = 0;
      var del = 120;
      switch(num + 10000) {
         case 23: xx += del;
         case 24: xx += del;
         case 25: xx += del;
         case 22: xx += del; break;
         case 26: xx += del;
         case 27: xx += del;
         case 28: xx += del;
         case 29: xx += del; break;
	default: xx +=1*del; pointerX=0;
      }
      var xxx = xx + pointerX + del;

      var mmm = (xxx % del);
      var yyy = (xxx-mmm);;

      yyy = Math.floor(xxx / del);
      yyy *= del;

//      window.status = f + " " + mouseX + " -> " + pointerX + " " + xxx + " " + yyy;
//      alert ( f + " " + mouseX + " " + xxx + " " + yyy );
      yyy += f + 220 - 90;

      newtipcss.left = yyy + "px";

      f = findTop(sw) - 8 * 40;   // 8 buttons, 40px each
      newtipcss.top  = f + "px";
      turnOn();

   }
	else if (!tipFollowMouse) {
		newpositionTip(evt);
	} else
		t1=setTimeout("newtipcss.visibility='visible'",100);
}


var currentOpacity= 0;
var fadeupDone = true;

function setopacity(value){   //Sets the opacity of tooltip based on value  (0 to 1 and in between)

   if (newtooltip.filters && newtooltip.filters[0]){ //IE syntax
      if(typeof newtooltip.filters[0].opacity=="number") //IE6
         newtooltip.filters[0].opacity=value*100;
      else //IE 5.5
         newtooltip.style.filter="alpha(opacity="+value*100+")";

   }  else if (typeof newtooltip.style.MozOpacity!="undefined") //Old Mozilla syntax
      newtooltip.style.MozOpacity=value;
   else if (typeof newtooltip.style.KhtmlOpacity!="undefined") //Old Mozilla syntax
      newtooltip.style.KhtmlOpacity=value;
   else if (typeof newtooltip.style.opacity!="undefined"); //Standard opacity syntax
   newtooltip.style.opacity=value;

   currentOpacity=value;
}

function fadeIn ( ) {
   if( fadeupDone ) return;

   if (currentOpacity<1) {
      setopacity( currentOpacity +.05);
      setTimeout(function(){ fadeIn( )}, 30)

   } else { //when fade is complete
      currentOpacity=0;
      fadeupDone = true;
   }
}

function turnOn() {
   newtipcss.visibility = "visible";
   fadeupDone = false;
   currentOpacity = 0;
   fadeIn( );

   /*
   newtipcss.filter = "alpha(opacity='100')";
   newtipcss.-khtml-opacity = "1";
   newtipcss.-moz-opacity = "1";
   newtipcss.opacity = "1";
   */
}

var mouseX, mouseY;
function newtrackMouse(evt) {
   if (!tipFollowMouse)
      return;
	standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body; //create reference to common "body" across doctypes
	mouseX = (ns5)? evt.pageX: window.event.clientX + standardbody.scrollLeft;
	mouseY = (ns5)? evt.pageY: window.event.clientY + standardbody.scrollTop;
	if (tipOn) newpositionTip(evt);
}

/////////////////////////////////////////////////////////////
//  positionTip function
//		If tipFollowMouse set false, so trackMouse function
//		not being used, get position of mouseover event.
//		Calculations use mouseover event position,
//		offset amounts and newtooltip width to position
//		newtooltip within window.
/////////////////////////////////////////////////////////////
function newpositionTip(evt) {
   if (!tipFollowMouse) {
      standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body;
      mouseX = (ns5)? evt.pageX: window.event.clientX + standardbody.scrollLeft;
      mouseY = (ns5)? evt.pageY: window.event.clientY + standardbody.scrollTop;
      return;
   }
   // newtooltip width and height
   var tpWd = (ie4||ie5)? newtooltip.clientWidth: newtooltip.offsetWidth;
   var tpHt = (ie4||ie5)? newtooltip.clientHeight: newtooltip.offsetHeight;
   // document area in view (subtract scrollbar width for ns)
   var winWd = (ns5)? window.innerWidth-20+window.pageXOffset: standardbody.clientWidth+standardbody.scrollLeft;
   var winHt = (ns5)? window.innerHeight-20+window.pageYOffset: standardbody.clientHeight+standardbody.scrollTop;
   // check mouse position against tip and window dimensions
   // and position the newtooltip
   if ((mouseX+offX+tpWd)>winWd)
      newtipcss.left = mouseX-(tpWd+offX)+"px";
   else newtipcss.left = mouseX+offX+"px";
   if ((mouseY+offY+tpHt)>winHt)
      newtipcss.top = winHt-(tpHt+offY)+"px";
   else newtipcss.top = mouseY+offY+"px";
   if (!tipFollowMouse) t1=setTimeout("newtipcss.visibility='visible'",100);
}

function hidenewTip() {
	if (!newtooltip) return;
	t2=setTimeout("newtipcss.visibility='hidden'",50);
   tipOn = false;

   fadeDone=true;
   currentOpacity = 0;
}

document.write('<div id="newtipDiv" style="position:absolute; visibility:hidden; z-index:100"></div>')


