main.js 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. var rootElement = document.documentElement;
  2. function scrollToTop() {
  3. rootElement.scrollTo({
  4. top: 0,
  5. behavior: "smooth"
  6. })
  7. }
  8. function changeImage1(src) { document.getElementById('obsledovanie').src = src;}
  9. function changeImage2(src) { document.getElementById('vakcinaciya').src = src;}
  10. function changeImage3(src) { document.getElementById('analizy').src = src;}
  11. function changeImage4(src) { document.getElementById('stomatologiya').src = src;}
  12. function changeImage5(src) { document.getElementById('gruming').src = src;}
  13. function changeImage6(src) { document.getElementById('operaciya').src = src;}
  14. function tab(field, event) {
  15. if (event.which == 13 /* IE9/Firefox/Chrome/Opera/Safari */ || event.keyCode == 13 /* IE8 and earlier */ ) {
  16. for (i = 0; i < field.form.elements.length; i++) {
  17. if (field.form.elements[i].tabIndex == field.tabIndex + 1) {
  18. field.form.elements[i].focus();
  19. if (field.form.elements[i].type == "text") {
  20. field.form.elements[i].select();
  21. break;
  22. }
  23. }
  24. }
  25. return false;
  26. }
  27. return true;
  28. }