// JavaScript for the pages. Only included on pages that need it.
function change_country() {
// set the Country textbox from a selection in the Province box
// called from details
	var SelInd = document.Form1.Province.selectedIndex;
	if(SelInd >=   1 && SelInd <=  13) { document.Form1.Country.value = "Canada" };
	if(SelInd >=  14 && SelInd <=  65) { document.Form1.Country.value = "U.S.A." };
	if(SelInd >=  66 && SelInd <= 104) { document.Form1.Country.value = "England" };
	if(SelInd >= 105 && SelInd <= 117) { document.Form1.Country.value = "Wales" };
	if(SelInd >= 118 && SelInd <= 151) { document.Form1.Country.value = "Scotland" };
	if(SelInd >= 152 && SelInd <= 157) { document.Form1.Country.value = "Northern Ireland" };
	return true;
}

function browser_type() {
// determine the browser type and add it as a URL parameter to the MapLink literal
// called from Details
	var browser_string;
	var stds = (document.getElementById) ? 1 : 0;
	var ie = (document.all) ? 1 : 0;
	if (stds) {
		browser_string = "STDS";
	} else if (ie) {	
		browser_string = "IE";
	} else {
		browser_string = "OTH";
	}
	for (var ilink = 0; ilink < document.links.length; ilink++) {
		if(document.links[ilink].id == "MapLink") {
			document.links[ilink].href = document.links[ilink].href + "&BrowserType=" + browser_string;
		}
	}
}

function ElementRef(elementID) {
// called from the routines below
// get a reference to an element in the current document
  if(document.getElementById) {	//ie6+ ns6+
    this.obj=document.getElementById(elementID);
    this.style=document.getElementById(elementID).style;
  } else {						//ie5
    this.obj=document.elementID;
    this.style=document.elementID.style;
  }
}

function hidediv(divid) {
// hides the named div
// called from register
	var thisdiv = new ElementRef(divid);
	thisdiv.style.visibility = "hidden";
	return true;
}
