var VetNurse=0;
function setSearchType(x)
{
  VetNurse = x;
}

function loadXMLDoc(dname)
{
if (window.XMLHttpRequest)
  {
  xhttp = new XMLHttpRequest();
  }
else
  {
  xhttp = new ActiveXObject("Microsoft.XMLHTTP");
  }
xhttp.open("GET",dname,false);
xhttp.send("");
return xhttp.responseXML;
}

function displayXML(srcXML, srcXSL, destDIV)
{
if (window.location.pathname.indexOf("content/") == "-1")
  {
  xml=loadXMLDoc("jobdb/"+srcXML);
  xsl=loadXMLDoc("jobdb/"+srcXSL);
  }
else
  {
  xml=loadXMLDoc("../jobdb/"+srcXML);
  xsl=loadXMLDoc("../jobdb/"+srcXSL);
  }
  
// code for IE
if (window.ActiveXObject)
  { 
  resultDocument = xml.transformNode(xsl);
  document.getElementById(destDIV).innerHTML=resultDocument;
  }
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation && document.implementation.createDocument)
  {
  xsltProcessor=new XSLTProcessor();
  xsltProcessor.importStylesheet(xsl);
  //xsltProcessor.setParameter "jobSrc","1";
  resultDocument = xsltProcessor.transformToFragment(xml,document);
  document.getElementById(destDIV).appendChild(resultDocument);
  } 
}

function validateSearch(fx)
{
var jobPth;
var srchWin;

if (window.location.pathname.indexOf("content") > "0")
{
jobPth="..\\jobdb\\";
} else {
jobPth="jobdb\\";
}

if (fx.jobTime.value==0||fx.jobType.value==0||fx.jobLocation.value==0)
{
  alert("Please set all search options.");
  return false;
}
srchWin = window.open(jobPth+'resultList.asp?jobSrc=0&jobTime='+fx.jobTime.value+'&jobType='+fx.jobType.value+'&jobLocation='+fx.jobLocation.value+'&jobSearchType='+VetNurse,'','status=0,toolbar=0,menubar=0,resizable=0,directories=0,scrollbars=1',1)
}

// resizes window to occupy all available screen real estate
function maximize() {
    // fill missing IE properties
    if (!window.outerWidth) {
        window.outerWidth = document.body.clientWidth
        window.outerHeight = document.body.clientHeight + 30
    }
    // fill missing IE4 properties
    if (!screen.availWidth) {
        screen.availWidth = 640
        screen.availHeight = 480
    }
    window.moveTo(0,0);
    window.resizeTo(screen.availWidth*.8, screen.availHeight);
}

function openwin2(url,name) {
var options = "top=10,left=10,width=700,height=500,status=0,toolbar=0,menubar=0,resizable=0,directories=0";
new_window = window.open(url, name, options);
window.self.name = "main";
new_window.focus();
}

