// JavaScript Programmed by Prakash Shakya
function jump(selectedObject,restore){
  eval("parent.location='"+selectedObject.options[selectedObject.selectedIndex].value+"'");
  if (restore) selectedObject.selectedIndex=0;
}

function companyselect(companies){
  var company = document.companies.mycompany.options[document.companies.mycompany.selectedIndex].value;
  window.location.href = company;
}

function ajax(url,id){
  if (document.getElementById(id)) {
    var x;
    if(window.XMLHttpRequest){
      x = new XMLHttpRequest();
    }
    else if(window.ActiveXObject){
      x = new ActiveXObject("Msxml2.XMLHTTP");
      if(! x){
        x = new ActiveXObject("Microsoft.XMLHTTP");
      }
    }
  }
  if (x){
    x.open('get', url, true);
    x.onreadystatechange = function(){
      if (x.readyState == 4 && x.status == 200){
        el = document.getElementById(id);
        el.innerHTML = x.responseText;
      }
    }
    x.send(null);
  }
}

function doFocus(){
  document.companies.mycompany.options[document.companies.mycompany.selectedIndex].value = 'http://www.bemidjiwoolenmills.com';
  if (document.forms.length > 0){
    var field = document.forms[1];
    for (i = 0; i < field.length; i++){
      if ((field.elements[i].type == "text") || (field.elements[i].type.toString().charAt(0) == "s")) {
        document.forms[1].elements[i].focus();
        break;
      }
    }
  }
}
