function RedirectURL(strRequiredURL)
{
    window.parent.location.href = strRequiredURL;    
}

function DisableTextBox(dropdownlist, textbox)
{
    var ddl=document.getElementById(dropdownlist);
    var ddlValue = ddl.options[ddl.selectedIndex].value;
    if(ddlValue=="Other")
    {
        document.getElementById(textbox).disabled=false;
    }
    else
    {
    document.getElementById(textbox).disabled=true;
    }    
}

function ShowHideSelectState()
{
     if(document.getElementById('rblSltUse_0') != null) 
     {
        if(document.getElementById('rblSltUse_0').checked)
        {
            document.getElementById('stateRow').style.visibility = "visible";
        }
        else
        {
            document.getElementById('stateRow').style.visibility = "hidden";
        } 
     }
}   

function RedirectState(strCategory, strAdditionalURL)
{
    if(strCategory == 'medicaidmembers')
    {   
        if(document.getElementById('rblSltUse_0') != null) 
        {
            if(document.getElementById('rblSltUse_0').checked)
            {
                if(document.getElementById('ddlMembers_SelectState').value == "0")
                {
                    alert('Please select a state');
                }
                else
                {
                    window.parent.location.href = document.getElementById('ddlMembers_SelectState').value;
                }
            } 
            else
            {
                window.parent.location.href = strAdditionalURL;
            }  
        }                    
    }
    else if(strCategory == 'medicaidproviders')
    {
        if(document.getElementById('ddlProviders_SelectState').value == "0")
        {
            alert('Please select a state');
        }
        else
        {
            window.parent.location.href = document.getElementById('ddlProviders_SelectState').value;
        }
    }
    else if(strCategory == 'findapharmacy')
    {
        if(document.getElementById('ddlSelectState').value == "0")
        {
            alert('Please select a state');
        }
        else
        {
            if (confirmLinkMed())
	        window.open(document.getElementById('ddlSelectState').value,'','width=800,height=600,scrollbars=yes');	
        }    
    }    
    else if( strCategory == 'enroll')
    {
        if(document.getElementById('ddlPlanLoc').value == "0")
        {
            alert('Please select a plan');
        }
        else
        {        
            var currentMURL = strAdditionalURL + "/pages/confirm.aspx";
            window.parent.location.href = document.getElementById('ddlPlanLoc').value + "&Zip=" + document.getElementById('txtZip').value + "&ReturnURL=" + currentMURL ;
        }      
    }
return false;
}

function confirmLinkMed()
{
	 bConfirmMed=confirm("You are now leaving the Molina Healthcare Website.  Any links to other non-Molina web sites are solely for your convenience in obtaining related information. Such inclusion or mention does not constitute or imply a recommendation or endorsement by Molina. Molina does not control the contents of these web sites and does not guarantee the accuracy or completeness of any such information.")
	 return (bConfirmMed);
}

 /*Added for 3000 character count*/
    maxL=3000;
var bName = navigator.appName;
function taLimit(taObj) {
	if (taObj.value.length>=maxL) 
	{
	    taObj.value = taObj.value.substring(0,3000);
	    return false;
	}
	return true;
}

function taCount(taObj,Cnt) {
	objCnt=createObject(Cnt);
	objVal=taObj.value;
	if (objVal.length>maxL) objVal=objVal.substring(0,maxL);
	if (objCnt) {
		if(bName == "Netscape"){	
			objCnt.textContent=maxL-objVal.length;}
		else{objCnt.innerText=maxL-objVal.length;}
	}
	return true;
}
function createObject(objId) {
	if (document.getElementById) return document.getElementById(objId);
	else if (document.layers) return eval("document." + objId);
	else if (document.all) return eval("document.all." + objId);
	else return eval("document." + objId);
}
/*End of Key Press character count*/
