document.write(''); // форма редактирования рассылок function set_status_subscribe() { document.getElementById("subscribe_status").value = "!!!"; } function agreeForm() { // Если поставлен флажок, снимаем блокирование кнопки if (document.getElementById("registration_checkbox").checked) { document.getElementById("registration_agree").style.visibility="hidden";// В противном случае вновь блокируем кнопку document.getElementById("registration_rules").style.color="black"; document.getElementById("registration_ok_nonelink").style.display="none"; document.getElementById("registration_ok").style.display="block"; } else { document.getElementById("registration_agree").style.visibility="visible"; document.getElementById("registration_rules").style.color="#D90000"; document.getElementById("registration_ok").style.display="none"; document.getElementById("registration_ok_nonelink").style.display="block"; } } function set_main_photo(set_main, big_src, title){ i=0; while(document.getElementById('small_images' + i.toString())){ name='small_images' + i.toString(); if (document.getElementById(name) == document.getElementById(set_main)){ document.getElementById(name).style.border="2px solid #84AED6"; }else{ document.getElementById(name).style.border='2px solid #fffff0'; } i++; } document.getElementById("img_main_photo").src=big_src; document.getElementById("img_main_photo").title=title; document.getElementById("img_main_photo").alt=title; } /*document.onkeydown = NavigateNextPrev();*/ function window_show_photo(path, title, height, width){ windop = window.open(path,title,"scrollbars=yes,resizable=yes,height=" + (height*1.1 + 25) + ",width=" + (width*1.1 + 25) + ",left=100,top=30"); } function menu_img(id, show, name){ exc=document.getElementById(id).src; exc = exc.toString(); len=exc.length; exc=exc.slice(len-4, len); if (show==1) document.getElementById(id).src='/images/' + name + '_' + exc; if (show==0) document.getElementById(id).src='/images/' + name + exc; } function menu_img_background(id, show, name){ if (show==1) document.getElementById(id).style.background=' url("/images/' + name + '_.gif") no-repeat;'; if (show==0) document.getElementById(id).style.background=' url("/images/' + name + '.gif") no-repeat;'; } var Timer; function img_sc_top(){ Timer = setInterval("document.getElementById('div_over_block').scrollTop -= 3", 15); } function img_sc_down(){ Timer = setInterval("document.getElementById('div_over_block').scrollTop += 3", 15); } //выполнить после нолной загрузки страницы $(document).ready( function() { //выбор валют $('#multi-ddm_special ._container').bind('click', function(event){ //заканчиваем обрботку потока тригерров на действие событие click event.stopPropagation(); }); //search: автодополнение для поиска $("#input_search").autocomplete('/autocomplete/', { minChars: 2, width: 0, max: 40, delay:800, matchContains: "word", autoFill: false }); //search: пользователь выбрал один из предлагаемых вариантов $("#input_search").result(function(event, data, formatted) { $(this).attr('value', data); $('#frm_search').submit(); }); //JQuery: ajax авторизация, клик по "Вход" if (document.getElementById("toppanel")!=null){ //toppanel: авторизация function a_autorize_click(){ $.post( '/ajax/', { people_pw: $("#i_people_pw").attr("value"), people_mail: $("#i_people_mail").attr("value"), _type: 'autorize'}, function (data){ // Здесь мы получаем данные, отправленные сервером if (data=='1') { //АВТОРИЗАЦИЯ прошла успешно //создаём cookie $.cookie("mail", $("#i_people_mail").attr("value") ); $.cookie("pw", $("#i_people_pw").attr("value") ); //перегружаем страницу $("#i_people_pw").attr('class', 'field'); $("#i_people_mail").attr('class', 'field'); document.getElementById('frm_login').submit(); } else { if (data=='pw'){ //неверный пароль $("#i_people_pw").attr('class', 'err_field'); //нормальный стиль почты $("#i_people_mail").attr('class', 'field'); }else{ //неверный почта $("#i_people_mail").attr('class', 'err_field'); //нормальный стиль пароля $("#i_people_pw").attr('class', 'field'); } } } ); } $('#i_autor_submit').bind("click", a_autorize_click); //обрабатываем "enter" в авторизации $('#i_people_mail').keydown(function(event) { if (event.keyCode == '13') a_autorize_click(); }); $('#i_people_pw').keydown(function(event) { if (event.keyCode == '13') a_autorize_click(); }); //toppanel: регистрация function reg_valid_mail(){ function onMailCheckAjaxSuccess(data){ if (data=='1'){ //нормальный вил почты $("#i_reg_mail").attr('class', 'field'); if ($("#i_reg_nick").attr("value")!='' && $("#i_reg_pw").attr("value")!='' ) { document.getElementById('frm_reg').submit(); } }else{ //неверный мейл $("#i_reg_mail").attr('class', 'err_field'); } //форма не отправлена показываем все ошибки if ($("#i_reg_nick").attr("value")=='') $("#i_reg_nick").attr('class', 'err_field'); else $("#i_reg_nick").attr('class', 'field'); if ($("#i_reg_pw").attr("value")=='') $("#i_reg_pw").attr('class', 'err_field'); else $("#i_reg_pw").attr('class', 'field'); } $.post( 'ajax/', { reg_mail: $("#i_reg_mail").attr("value"), _type: 'checkmail'}, onMailCheckAjaxSuccess ); } $('#i_reg_submit').bind("click", reg_valid_mail); //обрабатываем "enter" в reg $('#i_reg_nick').keydown(function(event) { if (event.keyCode == '13') reg_valid_mail(); }); $('#i_reg_mail').keydown(function(event) { if (event.keyCode == '13') reg_valid_mail(); }); $('#i_reg_pw').keydown(function(event) { if (event.keyCode == '13') reg_valid_mail(); }); } } );