var run = 1; function blog_check() { var ok2=1; var ok3=1; var rc2='1px solid #ff0000',orc2='1px dashed #a4a4a4'; var rb2='#FFCCCC',orb2='#FFFFFF'; var lc='2px solid #ff0000', olc='0.5px solid #000000'; if (null === window.document.getElementById('blog_form')) {clearInterval(blogInt);return;} var subject=window.document.getElementById('subject_input'); var location=window.document.getElementById('location'); var mood=window.document.getElementById('mood_other'); var music=window.document.getElementById('music_input'); var message=window.document.getElementById('post_body'); var keys=window.document.getElementById('key_input'); var msgRE2=/[\>\<]/; if(msgRE2.test(subject.value)){subject.style.backgroundColor=rb2;ok2=0;} else {subject.style.backgroundColor=orb2;} if(msgRE2.test(location.value)){location.style.backgroundColor=rb2;ok2=0;} else {location.style.backgroundColor=orb2;} if(msgRE2.test(mood.value)){mood.style.backgroundColor=rb2;ok2=0;} else {mood.style.backgroundColor=orb2;} if(msgRE2.test(music.value)){music.style.backgroundColor=rb2;ok2=0;} else {music.style.backgroundColor=orb2;} if(msgRE2.test(keys.value)){keys.style.backgroundColor=rb2;ok2=0;} else {keys.style.backgroundColor=orb2;} if(msgRE2.test(message.value)){message.style.backgroundColor=rb2;ok2=0;} else {message.style.backgroundColor=orb2;} if(message.value==""){message.style.borderLeft=lc;ok2=0;ok3=0;} else {message.style.borderLeft=olc;} if(subject.value==""){subject.style.borderLeft=lc;ok2=0;} else {subject.style.borderLeft=olc;} if(ok2==1) window.document.getElementById('btn_save').disabled=false; else window.document.getElementById('btn_save').disabled=true; if(ok3==1) window.document.getElementById('btn_prev').disabled=false; else window.document.getElementById('btn_prev').disabled=true; }