/bin/html/javascripts/timeimageswitch.js

https://bitbucket.org/VirtualReality/software-testing · JavaScript · 73 lines · 65 code · 7 blank · 1 comment · 21 complexity · afcd56a68298bd8115d478c9d4d7f4b1 MD5 · raw file

  1. function bgImgRotate()
  2. {
  3. var images = Array(
  4. "../images/screenshots/welcome1.jpg",
  5. "../images/screenshots/welcome2.jpg",
  6. "../images/screenshots/welcome3.jpg",
  7. "../images/screenshots/welcome4.jpg");
  8. var myDate = new Date();
  9. var hour = myDate.getHours();
  10. // var index = Math.floor(hour/8);
  11. var index;
  12. if (hour < 5)
  13. {
  14. index = 3;
  15. }
  16. else if (hour < 10)
  17. {
  18. index = 0;
  19. }
  20. else if (hour < 18)
  21. {
  22. index = 1;
  23. }
  24. else if (hour < 21)
  25. {
  26. index = 2;
  27. }
  28. else if (hour < 24)
  29. {
  30. index = 3;
  31. }
  32. else
  33. {
  34. index = 1;
  35. }
  36. document.getElementById('mainImage').src = images[index];
  37. }
  38. function closeSurvey(div_id)
  39. {
  40. document.getElementById(div_id).style.display = "none";
  41. }
  42. function locationTextColor(){
  43. if ((document.getElementById('specifyLocation').checked == 1) && !(document.getElementById('specificLocation').value == 'Region Name')) {
  44. document.getElementById('specificLocation').style.color = '#FFFFFF';
  45. } else {
  46. document.getElementById('specificLocation').style.color = '#666666';
  47. }
  48. }
  49. function selectRegionRadio(){
  50. document.getElementById('specifyLocation').checked = 1;
  51. }
  52. function CheckFieldsNotEmpty(){
  53. var mUsername = document.getElementById('firstname_input');
  54. var mLastname = document.getElementById('lastname_input');
  55. var mPassword =document.getElementById('password_input');
  56. var myButton = document.getElementById('conbtn');
  57. if (( mUsername.value != "") && (mLastname.value != "") && (mPassword.value != "") )
  58. {
  59. myButton.disabled = false;
  60. myButton.className = "input_over";
  61. }else
  62. {
  63. myButton.disabled = true;
  64. myButton.className = "pressed";
  65. }
  66. }