﻿// JScript File

CountyListStr = "~~countylist$~~"

Clist = CountyListStr.split(",")

function GetCounty( ListElement ){
  var t
  t = ListElement.split("!")
  return t[0]
}

function GetDistrict( ListElement ){
  var t
  t = ListElement.split("!")
  return t[1]
}


function JumpTo() {
	var varCtyName = "";
	varCtyName = CountyList.options[CountyList.selectedIndex].value;
	//alert(varCtyName)
	if ( varCtyName == "NO_SELECT") { return; }
	if (varCtyName.length > 0) {
		varCtyName = "County.aspx?CountyName=" + varCtyName;
		location.href = varCtyName;
	}//endif
}//end function

function ShowDistrict(DSelect) {
  if (DSelect == "00") {
     MapImage.innerHTML = "<IMG height=420 src=\"media/txMap.gif\" onMouseOut=\"DistrictName()\"  useMap=#DistrictMap border=0 name=Districts id=MapImageHTML >";
     DistrictName();
  }
  else {
      MapImage.innerHTML = "<IMG src=\"\" onMouseOut=\"CountyName()\"  useMap=\"#DistrictMap\" border=\"0\" name=\"Districts\" id=\"MapImageHTML\" >";
      document.getElementById("MapImageHTML").useMap="#DistrictMap" + DSelect;
      document.getElementById("MapImageHTML").src="media/district" + DSelect + ".gif";
      if ( DSelect == "06" ) { document.getElementById("MapImageHTML").width="444" };
      CountyName();

  }

}

function DistrictName(varText) {
var vText
vText = "" + varText
 if  ( varText == null ) {
  lblDName.innerText = "Click On Map To Select A District";
  window.status = '';
 }
 else  {
  lblDName.innerText = "Click To Select " + varText;
  window.status = varText;
 } //IF-then
}//function DistrictName

function CountyName(varText) {
var vText
vText = "" + varText
 if  ( varText == null ){
  lblDName.innerText = "Click On Map To Select A County";
  window.status = '';
 }
 else {
  lblDName.innerText = "Click To Select " + varText;
  window.status = varText;
 }
}// function CountyName


function Do_onLoad(){
return;
PopulateList();
DistrictName();
}

function GetCountyPage(CountyName){

//alert("Picked County: " + CountyName);
 // We Have To Translate from SELECT list because
 // There are hyphenated hames that translate
 //  for example Coke-Sterling is in list as Coke And Sterling
 //    However, both have a value of Coke-Sterling

// for(i=0;i<CountyList.options.length;i++){

//   if (CountyName.toUpperCase() == CountyList.options[i].text.toUpperCase()){
     this.location = "county.aspx?County=" + CountyName
//     return;
//   }
}

function GetCountyPageDD(CountyDD){

    var sValue = CountyDD.options[CountyDD.selectedIndex].value;
    this.location = "county.aspx?County=" + sValue
}
