function hilightSearch ( obj_id ) { obj = $('search_link'); if ( obj.className == 'normal' ) { obj.className = 'hilighted'; } else { obj.className = 'normal'; } } 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') && valueOf('message') != _msg_contacts_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.style.display == 'none' ) { Effect.Appear('auth_panel'); //setTimeout(alert(''), 3000); } else { Effect.Fade('auth_panel'); } } function hasEnabledFlashPlugin() { var has_flash = false; for (i=0; i < navigator.plugins.length; i++) { if (navigator.plugins[i].name.indexOf("Shockwave Flash") != -1) { has_flash = true; } } return has_flash; } function showFlash( t_name, t_width, t_height, t_params ) { if( hasEnabledFlashPlugin ) { output_str = ''; output_str += ''; output_str += ''; output_str += ''; output_str += ''; output_str += ''; output_str += ''; } else { output_str = 'No ShockWave Flash Plugin Installed'; } document.write( '\n\t' + '
' + output_str + '
' + '\n' ); } 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); } function showBigImage(img_source, title) { window_name = 'myWin_' + Math.round( Math.random()*1000 ) ; myWin = open('', window_name, 'location=0,menubar=0,toolbar=0,resizable=1,scrollbars=1'); if ( myWin ) myWin.focus(); title = ( title ) ? title : _msg_site_name; str = ''; str += ''; str += ''; str += ''; str += ''+ title +''; str += ''; str += '
'; str += ' '; //str += ' \"'+'; str += '
'; str += ''; myWin.document.write( str ); } function showZeroCounter(site_id) { if( !site_id ) return; var cz_user = site_id; var cz_type = 1; var cz_str = "&wd="+screen.width; cz_str += "&hg="+screen.height; cz_str += "&du="+escape(document.URL); cz_str += "&rf="+escape(document.referrer); cz_str = ""+ "CountZero"+ "<\/A>"; document.write(cz_str); }