// JavaScript Document
var divMyDotProv = new Object();
var divShowBull = new Object();

//divMyDotProv = document.all.MyDotProv;
//divShowBull = document.all.ShowBull;
//divMyDotProv = document.GetObjectByID("MyDotProv");
//divShowBull = document.GetObjectByID("ShowBull");

function ShowBullets(idx) {

	var bull = new Array();
	bull[0] = "Schedule an appointment";	//2^0 = 1
	bull[1] = "Refill medication";			//2^1 = 2	
	bull[2] = "Send a note to your doctor";	//2^2 = 4
	bull[3] = "Request a referral";			//2^3 = 8
	bull[4] = "Online consult with your doctor";	//2^4 = 16
	bull[5] = "Set up your personal health record";	//2^5 = 32

	var iVal = idx;
	var xPo = 5;
	var BullOut = "";

	for (xPo=5; xPo >= 0; xPo--) {
		if (Math.pow(2, xPo) <= iVal) {
			BullOut = "<li>" + bull[xPo] + "</li>" + BullOut;
			iVal = iVal - Math.pow(2, xPo);
		}
	}

	BullOut = "Now you can:<ul style=\"margin-top: 0px; margin-left: -10px; \">" + BullOut + "</ul>";

	document.all.ShowBull.style.posLeft = findPos(document.all.MyDotProv)[0] - document.all.MyDotProv.style.width.replace("px","") - 20;
	document.all.ShowBull.style.posTop = findPos(document.all.MyDotProv)[1] - 25;

	document.all.ShowBull.innerHTML = BullOut;
	with (document.all.ShowBull.style) {
		border = "1px dotted #911A40";
		padding = "2px";
	}
}

function HideBullets() {
	document.all.ShowBull.innerHTML="";
	with (document.all.ShowBull.style) {
		border = "none";
		backgroundColor = "none";
	}
}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
	do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
	return [curleft,curtop];
	}
}

