	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 += '<img src="images/web/1px.gif" class="png" style="background-image: url(\'images/web/'+ name +'.png\');" width="'+ width +'" height="'+ height +'" border="0">';
	     }
	     else
	     {
	          inner_image += '<img src="images/web/' + name + '.png" width="'+ width +'" height="'+ height +'" border="0">';
	     }
	     document.write(inner_image);
	}

	function drawAdvancedImage(name, width, height, parameters)
	{
		var inner_image = '';
	     if( is_IE )
	     {
	          inner_image += '<img align="top" src="images/web/1px.gif" class="png" style="background-image: url(\'images/web/'+ name +'.png\');" width="'+ width +'" height="'+ height +'" '+ parameters +' hspace="0" vspace="0" border="0">';
	     }
	     else
	     {
	          inner_image += '<img src="images/web/' + name + '.png" width="'+ width +'" height="'+ height +'" '+ parameters +' hspace="0" vspace="0" border="0">';
	     }
	     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  += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
				output_str += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"';
				output_str += ' width="' + t_width + '"';
				output_str += ' height="' + t_height + '"';
				output_str += ' id="' + t_name + '">';
				output_str += '<param name="movie" value="flash/' + t_name + '.swf">';
				output_str += '<param name="quality" value="high">';
				output_str += '<param name="wmode" value="transparent">';
				output_str += '<embed src="flash/'+ t_name +'.swf"';
					output_str += ' quality="high"';
					output_str += ' pluginspage="http://www.macromedia.com/go/getflashplayer"';
					output_str += ' type="application/x-shockwave-flash"';
					output_str += ' width="' + t_width + '"';
					output_str += ' height="' + t_height + '"';
					output_str += ' wmode="transparent"';
					output_str += ' swLiveConnect="true"';
					output_str += ' name="' + t_name + '">';
				output_str += '</embed>';
			output_str += '</object>';
		}
		else
		{
			output_str += 'No ShockWave Flash Plugin Installed';
		}
		document.write( '\n\t' + '<div id="flash_' + t_name + '" ' + t_params + '>' +  output_str + '</div>' + '\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 = "<img src='http://www.region.kz/counter/count.php?"+cz_str+"' alt='Статистика посещений от DG' title='Статистика посещений от DG' border='0' width='90' height='35'>";
		document.write(cz_str);
	}

	function setImageTransparency()
	{
		if( is_IE )
		{
			var image_transparency = '<style type="text/css">img.png{ background-image: none ! important; behavior: url(pngfix.htc); }</style>';
			document.write( image_transparency )
		}
	}


