
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 Over(img_name,state,element_name) {
   if (state == 'over') {
      playSound('over.wav');
   }
   var img = "http://www.sandyanimalclinic.com/wp-content/themes/Sandy_Animal_Clinic/images/" + img_name + "_" + state + ".jpg";
   document[element_name].src = img;
}

function playSound(soundfile) {
   document.getElementById("over").innerHTML = '<embed type="application/x-mplayer2" src="' + soundfile + '" hidden="true" autostart="true" loop="false" />';
}

if (document.getElementById("bark")) {
   document.getElementById("bark").innerHTML = '<embed type="application/x-mplayer2" src="bark.wav" hidden="true" autostart="true" loop="false" />';
}

function playSoundOLD(id) {
  soundFile = id + ".wav";
  if (document.getElementById) {
       var thissound=document.getElementById(id);
       thissound.Play();
  } else {
     return null;
  }
}

