// JavaScript Document

var cities_array=new Array("Alamance_4,5,6,7",
"Alexander_4,5,6,7",
"Alleghany_21,22",
"Anson_21,22",
"Ashe_21,22",
"Avery_21,22",
"Beaufort_21,22",
"Bertie_21,22",
"Bladen_21,22",
"Brunswick_4,5,6,7",
"Buncombe_4,5,6,7",
"Burke_4,5,6,7",
"Cabarrus_21,22",
"Caldwell_21,22",
"Camden_21,22",
"Carteret_21,22",
"Caswell_21,22",
"Catawba_4,5,6,7",
"Chatham_21,22",
"Cherokee_21,22",
"Chowan_21,22",
"Clay_21,22",
"Cleveland_21,22",
"Columbus_21,22",
"Craven_21,22",
"Cumberland_4,5,6,7",
"Currituck_4,5,6,7",
"Dare_21,22",
"Davidson_4,5,6,7",
"Davie_21,22",
"Duplin_21,22",
"Durham_4,5,6,7",
"Edgecombe_21,22",
"Forsyth_4,5,6,7",
"Franklin_21,22",
"Gaston_21,22",
"Gates_21,22",
"Graham_21,22",
"Granville_21,22",
"Greene_21,22",
"Guilford_4,5,6,7",
"Halifax_21,22",
"Harnett_21,22",
"Haywood_4,5,6,7",
"Henderson_4,5,6,7",
"Hertford_21,22",
"Hoke_21,22",
"Hyde_4,5,6,7",
"Iredell_21,22",
"Jackson_21,22",
"Johnston_21,22",
"Jones_21,22",
"Lee_21,22",
"Lenoir_21,22",
"Lincoln_21,22",
"Macon_4,5,6,7",
"Madison_4,5,6,7",
"Martin_21,22",
"Mc Dowell_21,22",
"Mecklenburg_4,5,6,7",
"Mitchell_4,5,6,7",
"Montgomery_21,22",
"Moore_21,22",
"Nash_21,22",
"New Hanover_21,22",
"Northampton_21,22",
"Onslow_21,22",
"Orange_21,22",
"Pamlico_21,22",
"Pasquotank_21,22",
"Pender_21,22",
"Perquimans_21,22",
"Person_4,5,6,7",
"Pitt_21,22",
"Polk_21,22",
"Randolph_4,5,6,7",
"Richmond_21,22",
"Robeson_21,22",
"Rockingham_4,5,6,7",
"Rowan_4,5,6,7",
"Rutherford_21,22",
"Sampson_21,22",
"Scotland_21,22",
"Stanly_21,22",
"Stokes_21,22",
"Surry_21,22",
"Swain_21,22",
"Transylvania_21,22",
"Tyrrell_21,22",
"Union_21,22",
"Vance_21,22",
"Wake_4,5,6,7",
"Warren_21,22",
"Washington_21,22",
"Watauga_21,22",
"Wayne_21,22",
"Wilkes_21,22",
"Wilson_21,22",
"Yadkin_21,22",
"Yancey_21,22"
);


var pdf_urls_name=new Array();
//1,2,6,7,8,16,17
pdf_urls_name["4"]="Summary of Benefits for Patriot Plan 4$_$NC-004-006.pdf";
pdf_urls_name["5"]="Summary of Benefits for Patriot Plus Plan  05$_$NC-005-007.pdf";
pdf_urls_name["6"]="Summary of Benefits for Presidential Plan 06$_$NC-004-006.pdf";
pdf_urls_name["7"]="Summary of Benefits for Presidential Plus Plan 07$_$NC-005-007.pdf";
pdf_urls_name["21"]="Summary of Benefits for Presidential Plan 21$_$NC-021.pdf";
pdf_urls_name["22"]="Summary of Benefits for Presidential Plus Plan 22$_$NC-022.pdf";





var eoc_pdf_urls_name=new Array();
eoc_pdf_urls_name["4"]="Evidence of Coverage for Patriot Plan 4$_$H0979_EOC_004_2010.pdf";
eoc_pdf_urls_name["5"]="Evidence of Coverage for Patriot Plus Plan 05$_$H0979_EOC_005_2010.pdf";
eoc_pdf_urls_name["6"]="Evidence of Coverage for Presidential Plan 06$_$H0979_EOC_006_2010.pdf";
eoc_pdf_urls_name["7"]="Evidence of Coverage for Presidential Plus Plan  07$_$H0979_EOC_007_2010.pdf";
eoc_pdf_urls_name["21"]="Evidence of Coverage for Presidential Plan 21$_$H0979_EOC_021_2010.pdf";
eoc_pdf_urls_name["22"]="Evidence of Coverage for Presidential Plus Plan 22$_$H0979_EOC_022_2010.pdf";


var app_pdf_urls_name=new Array();
app_pdf_urls_name["4"]="Application and Instruction Forms for Patriot Plan 4$_$APP_NC_PFFS-004-006-T1.pdf";
app_pdf_urls_name["5"]="Application and Instruction Forms for Patriot Plus Plan 05$_$APP_NC_PFFS-PD-005-007-T1.pdf";
app_pdf_urls_name["6"]="Application and Instruction Forms for Presidential Plan 06$_$APP_NC_PFFS-004-006-T1.pdf";
app_pdf_urls_name["7"]="Application and Instruction Forms for Presidential Plus Plan  07$_$APP_NC_PFFS-PD-005-007-T1.pdf";
app_pdf_urls_name["21"]="Application and Instruction Forms for Presidential Plan 21$_$APP_NC_PFFS-021-T2.pdf";
app_pdf_urls_name["22"]="Application and Instruction Forms for Presidential Plus Plan 22$_$APP_NC_PFFS-PD-022-T2.pdf";


function fill_nc_counties_2010(selcun)
{
	//alert(selcun);	
	var sel_options="<select name='county_name' id='county_name' onchange='showDivs(this.value)'><option value=0>Select One</option>";
	for(i=0;i<cities_array.length;i++)
	{
			sel="";
			c_arr=cities_array[i].split("_");
			//if(c_arr[1]!=4)
			if(cities_array[i]==selcun) { sel="Selected"; }
			sel_options+="<option value='"+c_arr[1]+"' "+sel+" >"+c_arr[0]+"</option>";
	}
	sel_options+="</select>";
	//alert(sel_options);
	document.getElementById("sel_counties").innerHTML=sel_options;
	if(selcun!="") 
	{ 
		
		delayLoader(c_v);
	}
}
function showDivs(val)
{
	val = val.split(",");
	
	if(val[0]==4 && val[1]==5 && val[2]==6 && val[3]==7)
	{
		
		document.getElementById("pres").style.display = "block";
		document.getElementById("pat").style.display = "block";
		document.getElementById("presidential").style.display = "none";
	}
	else
	{
		document.getElementById("pres").style.display = "none";
		document.getElementById("pat").style.display = "none";
		document.getElementById("presidential").style.display = "block";
	}
}
function show_county(val)
{
	switch (val)
	{
		case 4:
			window.location = "patriot.php";
			break;
		case 5:
			window.location = "patriot_plus.php";
			break;
		case 6:
			window.location = "presidential.php";
			break;
		case 7:
			window.location = "presidential_plus.php";
			break;
		case 21:
			window.location = "presidential_information.php";
			break;
		case 22:
			window.location = "presidential_plus_information.php";
			break;
	}
	
}
/*
function fill_2010_counties()
{
	var sel_options="<select name='county_name' id='county_name' onchange='redirect_url()' ><option value=0>Select One</option>";
	
	for(i=0;i<cities_array.length;i++)
	{
			c_arr=cities_array[i].split("_");
			if(c_arr[1]!=4)
			sel_options+="<option value="+c_arr[1]+">"+c_arr[0]+"</option>";
	}
	sel_options+="</select>";
	//alert(sel_options);
	document.getElementById("sel_counties").innerHTML=sel_options;
}*/

function delayLoader(pdfids)
{
		//alert(cityval);
		
		if(pdfids==0)
		document.getElementById("showlinks").innerHTML='';
		else
		{
		document.getElementById("showlinks").innerHTML='<img src="images/ajax-loader.gif">';
		setTimeout("showLinks('"+pdfids+"')", 2000);
		}
		//return false;
}

function showLinks(pdfids)
{
		//alert(pdfids);
		var opt_indx=document.getElementById("county_name").selectedIndex;
		//alert(opt_indx);
		var opt_txt=document.getElementById("county_name").options[opt_indx].text;
		//alert(opt_txt);
		stat=0;pdfvals="";
		pdfArr=pdfids.split(",");
		//alert(pdfArr[0]);
		
		var pdf_data='';
		pdf_data+='<span class="bb" style="font-size:16px;">Review the Plan Overview <a href="'+pdfpath+'AFCNCPlanOverview_preview.pdf" target="_blank">click here</a></span>';
		pdf_data+='<span class="bb" style="font-size:16px;"><br><br>To Review the Summary of Benefits for this area</span> Click below';
		for(i=0;i<pdfArr.length;i++)
		{
			var pdfid=pdfArr[i];
			pdfitem=pdf_urls_name[pdfid];
			pdfitm_arr=pdfitem.split("$_$");
			pdfname=pdfitm_arr[0];
			pdfurl=pdfitm_arr[1];
			if(pdfurl=="")
			{
				pdffilepath="#";
			}
			else
			{
				pdffilepath=pdfpath+pdfurl;
			}
			pdf_data+='<br><a href="'+pdffilepath+'" target="_blank">'+pdfname+'</a>';
			//break;
		}
		
		
		//EOCS
		pdf_data+='<span class="bb" style="font-size:16px;"><br><br>To Review Evidence of Coverage for this area</span> Click below';
		for(i=0;i<pdfArr.length;i++)
		{
			var pdfid_e=pdfArr[i];
			pdfitem_e=eoc_pdf_urls_name[pdfid_e];
			//alert(pdfitem);break;
			pdfitm_arr=pdfitem_e.split("$_$");
			pdfname_e=pdfitm_arr[0];
			pdfurl_e=pdfitm_arr[1];
			pdf_data+='<br><a href="'+pdfpath+pdfurl_e+'" target="_blank">'+pdfname_e+'</a>';
			//break;
		}
		//APPLICATION
		pdf_data+='<span class="bb" style="font-size:16px;"><br><br>To Apply for a Particular Plan</span> Click below';
		for(i=0;i<pdfArr.length;i++)
		{
			var pdfid_e=pdfArr[i];
			pdfitem_e=app_pdf_urls_name[pdfid_e];
			//alert(pdfitem);break;
			pdfitm_arr=pdfitem_e.split("$_$");
			pdfname_e=pdfitm_arr[0];
			pdfurl_e=pdfitm_arr[1];
			pdf_data+='<br><a href="'+pdfpath+pdfurl_e+'" target="_blank">'+pdfname_e+'</a>';
			//break;
		}
		document.getElementById("showlinks").innerHTML=pdf_data;
}

