   /*This script is for to check the radio button selected or not*/

        function isOrderMedicationSelected(transactiontype){
                var flag = false;
                 var transtype=transactiontype;
                

                var len=document.medicationDetails.radiobutton1.length;
                var healthvalue;
                for(var i=0;i<len;i++){
                    if(document.medicationDetails.radiobutton1[i].checked){
                         healthvalue=document.medicationDetails.radiobutton1[i].value;
                        flag = true;
                        break;
                    }
                }
// It display error message when user not select any option 
                if(!flag)
                    alert("Please Select anyone option button");
                
// If user select any one drug name and click tranfer button it redirect to transfer container page.
                if(flag)
                    {
                        if(transtype=="transfer")
                        {
                         window.location.href="../checkout/rx/rx_transfer_container.jsp?passedTransactionType=transfer&flow=rx&medication="+healthvalue;
                        }
                  }
// if user select any drug name and click new button it redirect to new container.jsp

                   if(flag)
                    {
                        if(transtype=="new")
                        {
                         window.location.href="../checkout/rx/rx_new_container.jsp?passedTransactionType=new&flow=rx&medication="+healthvalue;
                        }
                  }

            }


function adjustIFrameSize (frameId) {
	if(document.getElementById(frameId)!=null)
	{
		if (iframeWindow.document.height) 
		{
			var iframeElement = document.getElementById(iframeWindow.name);
			iframeElement.style.height = iframeWindow.document.height + 'px';
			iframeElement.style.width = '450px';
			iframeElement.style.padding = '15px';
		}
		else if (document.all) 
		{
			var iframeElement = document.all[iframeWindow.name];
			if (iframeWindow.document.compatMode && iframeWindow.document.compatMode != 'BackCompat') 
			{
				iframeElement.style.height = iframeWindow.document.documentElement.scrollHeight + 5 + 'px';
				iframeElement.style.width = iframeWindow.document.documentElement.scrollWidth + 5 + 'px';
				iframeElement.style.padding = '15px';
			}
			else 
			{
				iframeElement.style.height = iframeWindow.document.body.scrollHeight + 5 + 'px';
				iframeElement.style.width = iframeWindow.document.body.scrollWidth + 5 + 'px';
				iframeElement.style.padding = '15px';
			}
		}
	}
}