function SetCookie(n,v,d) { var xp = ''; if (d > 0) { var now = new Date(); then = now.getTime() + (d * 24 * 60 * 60 * 1000); now.setTime(then); xp = '; expires=' + now.toGMTString(); } document.cookie = n + "=" + escape(String(v)) + '; path=/archive/c052005/' + xp; } function check_email_onblur() { var reg_emailre = /^[0-9a-z_\.]+@[0-9a-z_]+[\.a-z]{2,9}$/; var cform = document.forms['commform'].elements; if(!cform['comm[email]'].value.match(reg_emailre)) { alert('Неверный формат E-mail'); cform['comm[email]'].focus(); return 0; } else return 1; } function checkcomments() { var cform = document.forms['commform'].elements; if (document.commform.email.value == 'Ваш E-mail') document.commform.email.value = ''; if(cform['comm[username]'].value == '' || cform['comm[username]'].value == 'Ваше имя') { alert('Не заполнено поле Ваше имя!'); //cform['username'].focus(); document.commform.username.focus(); return false; } if(cform['comm[email]'].value != '') if (!check_email_onblur()) { document.commform.email.focus(); return false; } if(cform['comm[magick]'].value == '') { alert('Не заполнено поле Защитный код!'); document.commform.elements['comm[magick]'].focus(); return false; } var text_cont = cform['comm[text]'].value != ''; if(text_cont == ' ' || text_cont == '') { alert('Не заполнено поле Cообщение!'); document.commform.elements['comm[text]'].focus(); return false; } return true; } var h,pw_status = 0, need_post = 0; function getText(url,data) { if(window.ActiveXObject) { h = new ActiveXObject("Microsoft.XMLHTTP"); h.open('GET',url+data,false); h.send(); } else { h = new XMLHttpRequest(); h.open('GET',url+data,false); h.send(null); } return h; } var tp_clicked=0; function text2pass() { if (tp_clicked == 0) { document.getElementById("pass").outerHTML = ""; document.commform.pass.setAttribute('type','password');document.commform.pass.value=''; //setFocus(document.commform.pass); //document.commform.pass.focus(); tp_clicked=1; } } function check_code() { var code = document.commform.elements['comm[magick]'].value; if(window.ActiveXObject) { h = new ActiveXObject("Microsoft.XMLHTTP"); } else { h = new XMLHttpRequest(); } h.open('GET','/ajax_code/?code='+code,false); h.send(null); if (h.readyState == 4) { if (h.status == 200) { if (h.responseText == 1) { return true; } else { alert('Не правильный защитный код'); return false; } } } } SetCookie('c_or', 'D', 1); document.write('
');