
  function open_window(url,width,height,name,scroll,winl,wint) {
   if (winl == "") { var winl = (screen.width - width) / 2; }
   if (wint == "") { var wint = (screen.height - height) / 2; }
       mywin = window.open(url,name,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars='+scroll+',resizable=1,width='+width+',height='+height+',left='+winl+',top='+wint+',dependent=1');
     if (parseInt(navigator.appVersion) >= 4) { mywin.window.focus(); }
  }

function MM_preloadImages() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
  var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
  if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function embedSound(pg) {
   document.write('<BGSOUND id="BGSOUND_ID" LOOP=1 SRC="over.wav">');
   document.write('<EMBED SRC="//www.sandyanimalclinic.org/over.wav" HIDDEN=TRUE AUTOSTART="false" MASTERSOUND NAME="over" id="over">');
   document.write('<EMBED SRC="//www.sandyanimalclinic.org/meow.wav" HIDDEN=TRUE AUTOSTART="false" MASTERSOUND NAME="meow" id="meow">');
   if (pg == 'home') {
      document.write('<EMBED src="bark.wav" autostart=true loop=false volume=100 hidden=true NAME="bark" id="bark" MASTERSOUND><NOEMBED><BGSOUND src="bark.wav"></NOEMBED>');
   }

}

function Over(img_name,state,element_name) {
   var img = "//www.sandyanimalclinic.org/Images/" + img_name + "_" + state + ".jpg";
   document[element_name].src = img;
   playSound('over');
}

function playSound(id) {
  soundFile = id + ".wav";
  if (document.all) {
     document.all['BGSOUND_ID'].src=soundFile;
  } else if (document.getElementById) {
       var thissound=document.getElementById(id);
       thissound.Play();
  } else {
     return null;
  }
}
function stopSound() {
  if (document.all) {
     document.all['BGSOUND_ID'].src='over.wav';
  }
  if ((ns4||ns3) && navigator.javaEnabled() && navigator.mimeTypes['audio/x-wav'] ) {
     self.document.id.stop()
  }
}

