function handleCB(id, checked_bool){				
	var urlstr ;
	if(checked_bool==true)
		urlstr = "/hsa/hsa_ds.php?ajaxuncheck_id="+ id ; 
	else
		urlstr = "/hsa/hsa_ds.php?ajaxcheck_id="+ id ; 
	makeRequest(urlstr);

}

function makeRequest(url) {

        http_request = false;

        if (window.XMLHttpRequest) { // Mozilla, Safari,...
            http_request = new XMLHttpRequest();
            if (http_request.overrideMimeType) {
                http_request.overrideMimeType('text/xml');
                // See note below about this line
            }
        } else if (window.ActiveXObject) { // IE
            try {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    http_request = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }
        if (!http_request) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }
        http_request.onreadystatechange = alertContents;
        http_request.open('GET', url, true);
        http_request.send(null);

}

function alertContents() {
    if (http_request.readyState == 4) {
        if (http_request.status == 200) {
            //alert(http_request.responseText);
        } else {
            alert('There was a problem with the request.');
        }
    }
}	

	
	function submitForm()
    {
        document.hsaSelectorForm.submit();
    }


	function quote()
	{

    	document.hsaCompareForm.action="/health-plans/quote.php";
    	document.hsaCompareForm.module.value='healthplan';
    	document.hsaCompareForm.sub_tab.value='quote';
        document.hsaCompareForm.method="GET";
//        getHSAIds();
/*
		var retval = getHSAIds();
		if (retval == false) {
			return false;
		}
*/
		document.hsaCompareForm.submit();
	}


        // Start of function getHSAIds
	function getHSAIds()
	{

        var appendString = "";

		// set var checkbox_choices to zero
		var checkbox_choices = 0;

		// Loop from zero to the one minus the number of checkbox button selections
		for (counter = 0; counter < document.hsaCompareForm.checkbox.length; counter++)
		{
			// If a checkbox has been selected it will return true
			// (If not it will return false)
			if (document.hsaCompareForm.checkbox[counter].checked)
			{
				checkbox_choices = checkbox_choices + 1;
				appendString = appendString + document.hsaCompareForm.checkbox[counter].value+",";
			}

		}

			if (checkbox_choices > 3 )
			{
				msg="You're limited to only three selections.\n"
				msg=msg + "You have made " + checkbox_choices + " selections.\n"
				msg=msg + "Please remove " + (checkbox_choices-3) + " selection(s)."
				alert(msg);
				return false;
			}

/*
		if (checkbox_choices < 1 )
		{
			msg="Please choose atleast one HSA Plan"
			alert(msg);
			return false;
		}
*/
        document.hsaCompareForm.hsacompareids.value = appendString+"0";
	}


	// End of function getHSAIds
	function compare(idexist)
	{
        var appendString = "";
		// set var checkbox_choices to zero
		var checkbox_choices = 0;
		var idexists = idexist.split(",");
		
		// Loop from zero to the one minus the number of checkbox button selections
		for (counter = 0; counter < document.hsaCompareForm.checkbox.length; counter++)
		{
			// If a checkbox has been selected it will return true
			// (If not it will return false)
			if (document.hsaCompareForm.checkbox[counter].checked)
			{
				var flag=0;
				for(var i=0;i<idexists.length;i++)
				{
					if(idexists[i]==document.hsaCompareForm.checkbox[counter].value)
						flag=1;
				}
				if(flag==0)
				{
					checkbox_choices = checkbox_choices + 1;
					appendString = appendString + document.hsaCompareForm.checkbox[counter].value+",";
				}
			}
			else
			{
				for(var i=0;i<idexists.length;i++)
				{
					if(idexists[i]==document.hsaCompareForm.checkbox[counter].value)
						idexists[i]="";
				}
			}
		}
		
		var idexists_new=new Array();
		var j=0;
		for(var i=0;i<idexists.length;i++)
		{
			if(idexists[i]!="")
			{
				idexists_new[j]=idexists[i];
				j++;
			}
		}

		var idexist_str = idexists_new.join(",");
		var idexists = idexist_str.split(",");
		
			if (checkbox_choices+j > 3 )
			{
				msg="You're limited to only three selections.\n"
				msg=msg + "You have made " + (checkbox_choices+j) + " selections.\n"
				msg=msg + "Please remove " + (checkbox_choices+j-3) + " selection(s)."
				alert(msg);
				return false;
			}
		
		if (checkbox_choices < 1 && j== 0 )
		{
			msg="No HSA(s) selected. Please select atleast one HSA."
			alert(msg);
			return false;
		}

    	document.hsaCompareForm.action="/hsa/hsacompare.php";
    	document.hsaCompareForm.module.value='hsa';
    	document.hsaCompareForm.sub_tab.value='compare';
        document.hsaCompareForm.hsacompareids.value = appendString+"0";
        document.hsaCompareForm.method="GET";
    	document.hsaCompareForm.submit();

	}
      function custom(txt){
	    //alert(Text[txt]);
		if (Text[txt]!=null) {
			stm(Text[txt],Style[0]);
		}
	    return true;
	  }
