var current_language = 'rus'; var _msg_wrong_mail = 'You enter e-mail in wrong format.'; var _msg_enter_mail = 'Please enter the e-mail.'; var _msg_fill_all_fields = 'Please fill-in all necessary fills.'; var _msg_object_is_absent = 'Warning: missing the object '; var _msg_save_error = 'Warning: error occured while saving data.\nData not saved.'; var _msg_select_one_option = 'Please select one of option to vote!'; var _msg_enter_vote_question = 'Please enter the question text.'; var _msg_enter_vote_answer = 'Please enter the answer text.'; var _msg_img_alt_switch_text = 'Switch view to Text mode'; var _msg_img_alt_switch_hmtl = 'Switch view to HTML mode'; var _msg_common_wait = 'Please wait while in progress' + '' ; var _msg_loading = 'Loading' + '' ; var _msg_saving = 'Saving' + '' ; var _msg_moving = 'Moving' + '' ; var _msg_deleting = 'Deleting' + '' ; var _msg_sending = 'Sending' + '' ; var _msg_adding = 'Adding' + '' ; var _msg_confirm_common = 'Do you really want to do the action?'; var _msg_confirm_change_object = 'At the time you edit another element.\nAll changes will be lost.\n\nDo you want to change element?'; var _msg_confirm_cancel_changes = 'Do you really want to cancel changes?'; var _msg_confirm_save_changes = 'Do you really want to save changes?'; var _msg_confirm_menu_delete = 'Do you really want to delete this element?'; var _msg_confirm_vote_delete = 'Do you really want to delete this element?'; var _msg_confirm_vote_cancel = 'Do you really want to cancel addition of new element?'; var value_for_search = 'Поиск по сайту'; var value_for_subscribe = 'Введите эл. адрес'; var _msg_request_is_sent = 'Ваша заявка отправлена.\nСпасибо за то, что Вы воспользовались сервисом отправки заявки!\n\nВаша заявка очень важна для нас и будет рассмотрена немедленно по получении.\nМы обязательно свяжемся с Вами по указанным Вами контактным данным в кратчайшие сроки.\n\nДанный раздел находится на стадии разработки.'; function subForm( obj_id ) { obj = document.getElementById(obj_id); if( obj ) obj.submit(); } function newwin(url,w,h) { window_name = 'myWin_' + Math.round( Math.random()*1000 ) ; myWin = open(url, window_name, 'location=0,menubar=0,toolbar=0,resizable=1,scrollbars=1,width='+w+',height='+h+''); if ( myWin ) myWin.focus(); } function showLayer( obj ) { if ( obj ) { obj.style.display = (obj.style.display == 'none') ? '' : 'none'; } } function changeOption( targ,selObj ) { eval(targ + ".location='"+selObj.options[selObj.selectedIndex].value + "'"); } function switchVisibility( obj_id ) { obj = (typeof obj_id == 'object') ? obj_id : document.getElementById(obj_id); if( obj ) { obj.style.display = ( obj.style.display == 'block' ) ? 'none' : 'block'; } } function checkMail( obj_id ) { obj = (typeof obj_id == 'object') ? obj_id : document.getElementById( obj_id ); if( ! obj ) { return false; } is_valid_mail = ( /^[A-Za-z0-9\-\_\.]{2,50}@[a-z0-9\-\_\.]{2,30}\.[a-z]{2,4}$/.test( obj.value ) ) ? true : false; return is_valid_mail; } function subscribe() { if( empty('mail') || valueOf('mail') == value_for_subscribe ) { alert( _msg_enter_mail ); return false; } if( ! checkMail('mail') ) { alert( _msg_wrong_mail ); return false; } subForm('subscribe_form'); } function unsubscribe() { if( empty('mail') || valueOf('mail') == value_for_subscribe ) { alert( _msg_enter_mail ); return ; } if( ! checkMail('mail') ) { alert( _msg_wrong_mail ); return ; } query_frm.location.href = 'subscribe_delete_' + valueOf('mail') ; } function empty( obj_id ) { obj = (typeof obj_id == 'object') ? obj_id : document.getElementById( obj_id ); if( ! obj ) { return false } is_empty = false; if( obj.value ) { if( obj.value.length < 1 ) is_empty = true; } else if( obj.innerHTML.length < 1 ) is_empty = true; return is_empty; } function sendContactsForm() { if( !empty('fio') && !empty('email') && !empty('message') ) { if( checkMail('email') ) { disable('contacts_button'); subForm('contacts_form'); } else alert( _msg_wrong_mail ); } else alert( _msg_fill_all_fields ); return false; } function getObject( obj_id ) { obj = (typeof obj_id == 'object') ? obj_id : document.getElementById( obj_id ); if( obj ) return obj; else return false; } function valueOf( obj_id ) { obj = (typeof obj_id == 'object') ? obj_id : document.getElementById( obj_id ); if( obj ) { if( obj.value ) return obj.value; else return obj.innerHTML; } else return false; } function disable( obj_id ) { obj = (typeof obj_id == 'object') ? obj_id : document.getElementById( obj_id ); if( obj ) obj.disabled = true; else alert( _msg_object_is_absent + "'" + obj_id + "'" ); } function enable( obj_id ) { obj = (typeof obj_id == 'object') ? obj_id : document.getElementById( obj_id ); if( obj ) obj.disabled = false; else alert( _msg_object_is_absent + "'" + obj_id + "'" ); } function startProgress( obj_id, msg ) { obj = (typeof obj_id == 'object') ? obj_id : document.getElementById(obj_id); obj.innerHTML = ( msg ) ? msg : _msg_common_wait ; obj.style.display = 'block'; } function stopProgress( obj_id ) { obj = (typeof obj_id == 'object') ? obj_id : document.getElementById(obj_id); obj.innerHTML = ''; obj.style.display = 'none'; } function confirmed( msg ) { _temp_msg = ( msg ) ? msg : _msg_confirm_common; return window.confirm( _temp_msg ); } function getImageX(imgElem) { xPos = eval(imgElem).offsetLeft; tempEl = eval(imgElem).offsetParent; while (tempEl != null) { xPos += tempEl.offsetLeft; tempEl = tempEl.offsetParent; } return xPos; } function getImageY(imgElem) { xPos = eval(imgElem).offsetTop; tempEl = eval(imgElem).offsetParent; while (tempEl != null) { xPos += tempEl.offsetTop; tempEl = tempEl.offsetParent; } return xPos; } function switchMenu( obj_id ) { obj = (typeof obj_id == 'object') ? obj_id : document.getElementById( obj_id ); ch_obj = document.getElementById( 'sub' + obj_id); if( obj && ch_obj ) { ch_obj.style.display = ( ch_obj.style.display == 'block' ) ? 'none' : 'block'; obj.className = ( ch_obj.style.display == 'block' ) ? 'opened' : 'opener'; } } function checkSearch() { if( empty('search_text') || valueOf('search_text') == value_for_search ) { alert('Enter the search keyword, please.'); return false; } document.location.href = 'search&text='+valueOf('search_text'); } function setValue( obj_id, obj_init_value ) { obj = document.getElementById(obj_id); if( obj ) { if ( obj.value == obj_init_value ) { obj.value = ''; return; } if ( obj.value == '' ) { obj.value = obj_init_value; } } } function sendContactsTabForm() { if( !empty('email_t') && !empty('message_t') ) { if( checkMail('email_t') ) { disable('contacts_button_t'); subForm('contacts_form_t'); } else alert( _msg_wrong_mail ); } else alert( _msg_fill_all_fields ); return false; } function switchLogin() { obj = document.getElementById('auth_panel'); if( obj ) { obj.style.display = ( obj.style.display == 'block' ) ? 'none' : 'block'; l = document.getElementById('login'); if( obj.style.display == 'block' && l ){ l.focus() ;} } } function showDGArgusCounter(site_id) { if( !site_id ) return; var cz_str = "ua="+escape(navigator.userAgent); cz_str += "&id="+site_id; cz_str += "&du="+escape(document.URL); cz_str += "&rf="+escape(document.referrer); cz_str = "Статистика посещений от DG"; document.write(cz_str); }