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'; } if( file = $('file_id') ) { file.value = ''; } } 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 = $('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 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); } function checkDate( date_str ) { var date_exp = new RegExp( /^[0-9]{4}\-[0-9]{2}\-[0-9]{2}$/ ); valid_date = ( date_exp.test( date_str ) ) ? true : false; return valid_date; } function SetPosition(obj_id, event, x_, y_,absolute) { obj = $(obj_id); if( absolute ) { x = document.documentElement.scrollTop + 70 + 'px'; y = document.documentElement.scrollLeft; } else { x = '200px'; } obj.style.display = "block"; obj.style.top = x; obj.style.left = '500px'; } var Utf8 = { // public method for url encoding encode : function (string) { string = string.replace(/\r\n/g,"\n"); var utftext = ""; for (var n = 0; n < string.length; n++) { var c = string.charCodeAt(n); if (c < 128) { utftext += String.fromCharCode(c); } else if((c > 127) && (c < 2048)) { utftext += String.fromCharCode((c >> 6) | 192); utftext += String.fromCharCode((c & 63) | 128); } else { utftext += String.fromCharCode((c >> 12) | 224); utftext += String.fromCharCode(((c >> 6) & 63) | 128); utftext += String.fromCharCode((c & 63) | 128); } } return utftext; }, // public method for url decoding decode : function (utftext) { var string = ""; var i = 0; var c = c1 = c2 = 0; while ( i < utftext.length ) { c = utftext.charCodeAt(i); if (c < 128) { string += String.fromCharCode(c); i++; } else if((c > 191) && (c < 224)) { c2 = utftext.charCodeAt(i+1); string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); i += 2; } else { c2 = utftext.charCodeAt(i+1); c3 = utftext.charCodeAt(i+2); string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); i += 3; } } return string; } } function showLocationForPrint() { document.write( '
Источник:<\/span> ' + document.location + '<\/span>'); } function emptyFn() { }