/bin/html/javascripts/timeimageswitch.js
JavaScript | 73 lines | 65 code | 7 blank | 1 comment | 21 complexity | afcd56a68298bd8115d478c9d4d7f4b1 MD5 | raw file
1function 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 9 var myDate = new Date(); 10 var hour = myDate.getHours(); 11 // var index = Math.floor(hour/8); 12 var index; 13 if (hour < 5) 14 { 15 index = 3; 16 } 17 else if (hour < 10) 18 { 19 index = 0; 20 } 21 else if (hour < 18) 22 { 23 index = 1; 24 } 25 else if (hour < 21) 26 { 27 index = 2; 28 } 29 else if (hour < 24) 30 { 31 index = 3; 32 } 33 else 34 { 35 index = 1; 36 } 37 document.getElementById('mainImage').src = images[index]; 38} 39 40function closeSurvey(div_id) 41{ 42 document.getElementById(div_id).style.display = "none"; 43} 44 45function locationTextColor(){ 46 if ((document.getElementById('specifyLocation').checked == 1) && !(document.getElementById('specificLocation').value == 'Region Name')) { 47 document.getElementById('specificLocation').style.color = '#FFFFFF'; 48 } else { 49 document.getElementById('specificLocation').style.color = '#666666'; 50 } 51} 52 53function selectRegionRadio(){ 54 document.getElementById('specifyLocation').checked = 1; 55} 56 57 58function CheckFieldsNotEmpty(){ 59 var mUsername = document.getElementById('firstname_input'); 60 var mLastname = document.getElementById('lastname_input'); 61 var mPassword =document.getElementById('password_input'); 62 var myButton = document.getElementById('conbtn'); 63 64 if (( mUsername.value != "") && (mLastname.value != "") && (mPassword.value != "") ) 65 { 66 myButton.disabled = false; 67 myButton.className = "input_over"; 68 }else 69 { 70 myButton.disabled = true; 71 myButton.className = "pressed"; 72 } 73}