var na = navigator.userAgent; var is_IE = ( na.indexOf('MSIE') != -1 ) ? true : false ; function catchPressedButton() { if ( is_IE ) { var code; if (!e) var e = window.event; if (e.keyCode) code = e.keyCode; else if (e.which) code = e.which; shift = e.shiftKey //shift control = e.ctrlKey //ctrl login_button = 76; // L if ( control && shift && ( code == login_button ) ) { showLogin(); } } } function showLogin() { var log_form = document.getElementById('login_div'); log_form.style.display = ( log_form.style.display == 'none' ) ? 'block' : 'none'; if ( log_form.style.display == 'block' ) { document.getElementById('login').focus() ; } } function enableSubmit() { var log = document.getElementById('login').value ; var pass = document.getElementById('password').value ; if ( (log == "") || (log == login_text) ) { alert(login_alert_message_one); return false; } if ( (pass == "") || (pass == password_text) ) { alert(login_alert_message_two); return false; } document.getElementById('loginForm').submit(); return true; } function defineCurrentURL() { var current_url = document.location.href ; document.getElementById('currenturl').value = current_url; } function preloadImages() { var my_images = new Array('web','art','media','advert','agency','news','contact'); var number_of_images = my_images.length; document.imageArray = new Array( number_of_images ); for( var i in my_images ) { var full_image = 'images/web/img_' + my_images[i] + '_f.gif'; document.imageArray[i] = new Image; document.imageArray[i].src = full_image ; } } function swap(id,type) { var some_img = document.getElementById(id) ; some_img.src = 'images/web/img_' + id + '_' + type + '.gif' ; } function drawImage(name, width, height) { var inner_image = ''; if( is_IE ) { inner_image += ''; } else { inner_image += ''; } document.write(inner_image); } function drawAdvancedImage(name, width, height, parameters) { var inner_image = ''; if( is_IE ) { inner_image += ''; } else { inner_image += ''; } document.write(inner_image); } function getImageX(imgElem) { var xPos = eval(imgElem).offsetLeft; var tempEl = eval(imgElem).offsetParent; while (tempEl != null) { xPos += tempEl.offsetLeft; tempEl = tempEl.offsetParent; } return xPos; } function getImageY(imgElem) { var xPos = eval(imgElem).offsetTop; var tempEl = eval(imgElem).offsetParent; while (tempEl != null) { xPos += tempEl.offsetTop; tempEl = tempEl.offsetParent; } return xPos; } function newwin(name,w,h) { var myWin= window.open(name, 'myWin', 'location=0,menubar=0,toolbar=0,resizable=0,scrollbars=0,width='+w+',height='+h+''); myWin.focus(); } function newwin2(name,w,h) { var myWin= window.open(name, 'myWin', 'location=0,menubar=0,toolbar=0,resizable=1,scrollbars=1,width='+w+',height='+h+''); myWin.focus(); } function isFlash() { var shock = false; for (i=0; i < navigator.plugins.length; i++) { if (navigator.plugins[i].name.indexOf("Shockwave Flash") != -1) shock = true; } return shock; } function setValue( obj_id, obj_init_value ) { var 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 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 ) { var output_str = ''; 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) { 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 setImageTransparency() { if( is_IE ) { var image_transparency = ''; document.write( image_transparency ) } }