/* This is Global Navigation */ 
var CUSTOMIZED_ROOT = "/docfind/custom/asa/";
function help(){
var windowName='cancel';
var url=CUSTOMIZED_ROOT+'docfind_additional_information.html';
var winOpts = 'width=600,height=525,scrollbars=yes,resizable=yes,toolbar=yes';
window.name='MAINWINDOW';
aWindow=window.open(url,windowName,winOpts);
}


function createIndex(str)
{
	resetIndex();
	if(str == "" || str == "null" )
	{
	//Changes for SR 1247 Displaying complete above button
	var additional = document.getElementById("additional");
	var submit = document.getElementById("advanced_submit");
	var provider = document.getElementById("provider_type_section");

	productID = null;
	
	if(langpref=="sp")
			additional.value = "Sobre Completa";
		else
			additional.value = "Complete Above";
		
		additional.style.display = "";
		additional.disabled = true;
		submit.style.display = "";
		submit.disabled = true;
		return;
		
	}
		
	var myStr = "input_" + str + "_div";
	show(myStr, "provider_type_section");
	
	if(str == "medical" || str == "facilities")
	{
		show("input_medical_plans", "plans_section");
		productID = "medical_plans";

	}
	else if(str == "bh")
	{
		show("input_behavioral_plans", "plans_section");
		productID = "behavioral_plans";
	}
	//Changes for SR1238
	else if(str == "hospitals")
	{
		show("input_medical_plans", "plans_section");
		productID = "medical_plans";
	
		show_additional = getAdditionalSection("hospitals");
	    ptID = "hospitals_provider_type";

	}
	else if(str == "dental")
	{
		show("input_dental_plans", "plans_section");
		productID = "dental_plans";
		
	}
	else if(str == "pharmacy")
	{
		show("input_default_plans", "plans_section");
		productID = null;
		
	}
	else if(str == "hearing" )
	{
		//Displaying complete above button
		var additional = document.getElementById("additional");
		var submit = document.getElementById("advanced_submit");
		var provider = document.getElementById("provider_type_section");
	
		if(langpref=="sp")
			additional.value = "Sobre Completa";
		else
			additional.value = "Complete Above";
		
		additional.style.display = "";
		additional.disabled = true;
	
		show("input_hearing_plans", "plans_section");
		productID = "hearing_plans";

		ptID = "hearing_provider_type";

	}
	else if( str == "vision")
	{		
	
		var pl = document.getElementById("plans_label");
		pl.style.display = 'none';
		hide("plans_section");
		hide("plans_label");
		resetDD("pharmacy_plans");
		show_additional = getAdditionalSection("eyewear");
		ptID = "vision_provider_type";
	
	}
	//Including urgent care centres and walk in clinics in categories
    else if( str == "urgent")
	{
		show("input_medical_plans", "plans_section");
		productID = "medical_plans";
		
	    show_additional = getAdditionalSection("urgent");
	    ptID = "urgent_provider_type";
 	
	}
	else if( str == "walkin")
	{
		show("input_medical_plans", "plans_section");
		productID = "medical_plans";
		
		show_additional = getAdditionalSection("walkin");
	    ptID = "walkin_provider_type";

	}
	//end of changes for SR1238
	// START CHANGES SR1263 - AUG 2010
	else if( str == "labs")
	{
		show("input_medical_plans", "plans_section");
		productID = "medical_plans";
		
	    show_additional = getAdditionalSection("labs");
	    ptID = "labs_provider_type";
 	
	}
	else if( str == "dialysis")
	{
		show("input_medical_plans", "plans_section");
		productID = "medical_plans";
		
	    show_additional = getAdditionalSection("dialysis");
	    ptID = "dialysis_provider_type";
 	
	}
	//  END CHANGES SR1263 - AUG 2010
	
	// START CHANGES SR1274 - NOV 2010 
		else if( str == "ipacal")
	{
		show("input_ipacal_plans", "plans_section");
		productID = "ipacal_plans";
	    show_additional = getAdditionalSection("ipacal");
	    ptID = "ipacal_provider_type";
 	}
	// END CHANGES SR1274 - NOV 2010 
	checkDefaultPlan();
	checkAdditional();
}

function chooseProvType(obj)
{
	var provType = obj.value;
	var pl = document.getElementById("plans_label");
	var prov_cat = document.getElementById("provider_category");

	var provCategory = prov_cat.value;
	pl.style.display = "";
	
	if(provType == "")
	{
		productID = null;
		
		//Changes for SR 1247 Displaying complete above button
		var additional = document.getElementById("additional");
		var submit = document.getElementById("advanced_submit");
	
	if(langpref=="sp")
			additional.value = "Sobre Completa";
		else
			additional.value = "Complete Above";
		
		additional.style.display = "";
		additional.disabled = true;
		submit.style.display = "";
		submit.disabled = true;
	
	}
	else if(provType == "ntp")
		location.href = "/docfind/cms/html/natural_therapy.html";
	else if(provType == "ioec" && langpref=="en")
		location.href = "/docfind/cms/html/institutes_of_excellence_pediatric.html";
	else if(provType == "ioec" && langpref=="sp")
		location.href = "/docfind/custom/sp/institutes_of_excellence_pediatric.html";
	else if(provType == "iccf" && langpref=="en")
		location.href = "/docfind/cms/html/institutes_of_quality_cardiac.html";
	else if(provType == "iccf" && langpref=="sp")
		location.href = "/docfind/custom/sp/institutes_of_quality_cardiac.html";
	else if(provType == "ioe" && langpref=="en")
		location.href = "/docfind/cms/html/institutes_of_excellence.html";
	else if(provType == "ioe" && langpref=="sp")
		location.href = "/docfind/custom/sp/institutes_of_excellence.html";
	else if(provType == "ioqocf" && langpref=="en")
		location.href = "/docfind/cms/html/orthopedic_facilities.html";
	else if(provType == "ba" && langpref=="en")
		location.href = "/docfind/cms/html/bariatric_facilities.html";
	else if(provType == "ba" && langpref=="sp")
		location.href = "/docfind/cms/html/bariatric_facilities.html";
	else if(provType == "pspec" && langpref=="en")
		location.href = "/docfind/cms/html/specialty_pharmacy.html";
	else if(provType == "pspec" && langpref=="sp")
		location.href = "/docfind/custom/sp/specialty_pharmacy.html";
	else if(provType == "psmail" && langpref=="en")
		location.href = "/docfind/cms/html/mail_order_pharmacy.html";
	else if(provType == "psmail" && langpref=="sp")
		location.href = "/docfind/custom/sp/mail_order_pharmacy.html";		
	else if(provType == "dmenat")
		location.href = "/docfind/cms/html/national_dme_providers.html";
	else if(provType == "neonatal_facilities" && langpref=="en")
		location.href = "/docfind/cms/html/neonatal_facilities.html";
	else if(provType == "neonatal_facilities" && langpref=="sp")
		location.href = "/docfind/custom/sp/neonatal_facilities.html";	
	else if(provType == "dpcpm" && langpref=="en")
		location.href = "/docfind/cms/html/mexico_dental_network.html";
	else if(provType == "dpcpm" && langpref=="sp")
		location.href = "/docfind/cms/html/sp/mexico_dental_network.html";
	else if(provType == "dialysisnat" && langpref=="en")
		location.href = "/docfind/cms/html/dialysis_center_national.html";
	else if(provType == "dialysisnat" && langpref=="sp")
		location.href = "/docfind/custom/sp/dialysis_center_national.html";	
	else if(provType=="vhp" && langpref=="en")
		location.href="/docfind/cms/html/mexico_medical_providers.html";
	else if(provType=="vhp" && langpref=="sp")
		location.href="/docfind/custom/sp/mexico_medical_providers.html";
	else if(provType=="hstp")
		provForward("/docfind/cms/html/National_Home_Sleep_Testing.html");
	else if(provType == "pharmacy")
	{
		show("input_pharmacy_plans", "plans_section");
		productID = "pharmacy_plans";
	}

	// START CHANGES SR1274 - NOV 2010 
		else if( provType == "ipacal")
	{
		show("input_ipacal_plans", "plans_section");
		productID = "ipacal_plans";
	}
	// END CHANGES SR1274 - NOV 2010 
	
	//changes for SR1238
	else if(provCategory == "medical" || provCategory == "facilities")
	{
		show("input_medical_plans", "plans_section");
		productID = "medical_plans";

	}
	//end of changes for SR1238
	else if(provCategory == "bh")
	{
		show("input_behavioral_plans", "plans_section");
		productID = "behavioral_plans";
	}

	/* START CHANGES P 8065 - AUG 2010 */
	if(( provType == "eyewear" || provType == "vision") && (langpref=="en"))
	{
			pl.style.display = "none";
			hide("plans_section");
			resetDD("pharmacy_plans");
			location.href="/docfind/external_link1.html";
	}
	else if(( provType == "eyewear" || provType == "vision") && (langpref=="sp"))
	{
		pl.style.display = "none";
		hide("plans_section");
		resetDD("pharmacy_plans");
		location.href="javascript:popUp('/docfind/custom/sp/external_link1_sp.html')";		
	}
	/* END CHANGES P 8065 - AUG 2010 */
	if(provType == "" && provCategory == "vision" ){
			pl.style.display = "none";
			hide("plans_section");
			resetDD("pharmacy_plans");
	}
	show_additional = getAdditionalSection(provType);
		
	ptID = obj.id;

	checkDefaultPlan();
	checkAdditional();
}
