       g_link_array = [{"id": "block_about", "name": "о компании"}, {"id": "block_catalogue", "name": "каталог"}, {"id": "block_service", "name": "сервис"}]

	   g_opacity_level = 10;
	   g_current_num = 1;
	   g_direction = null;
       g_timeout = null;
       
       function change_opacity_level( direction) {
            result = (direction) ? (g_opacity_level += 1) : ( g_opacity_level -= 1 );
			if ( isIE) {
				$( "banner_bg").style.filter = "alpha(opacity="+ (g_opacity_level * 10) +")";
			} else {
				$( "banner_bg").style.opacity = (g_opacity_level * 0.1);
			}
			if ( g_opacity_level == 0) {
			    change_block();
			} else if ( g_opacity_level == 10) {
     		   clearTimeout( g_timeout);
			    return true;
			} else {
			    g_timeout = setTimeout( function() { change_opacity_level.call( this, direction)}, 2);
			}
       }
       
		function change_block() {
		   $( g_link_array[g_current_num].id).style.display = "none";

           g_current_num += ( g_direction ) ? 1 : -1;
           g_current_num = ( g_current_num > 2 ) ? (g_current_num - 3) : g_current_num;
           g_current_num = ( g_current_num < 0 ) ? (g_current_num + 3) : g_current_num;

           switch ( g_current_num ) {
               case 0:
					$( "left_link").innerHTML = g_link_array[2].name;
					$( "right_link").innerHTML = g_link_array[1].name;
                    break;
               case 1:
					$( "left_link").innerHTML = g_link_array[0].name;
					$( "right_link").innerHTML = g_link_array[2].name;
                    break;
               case 2:
					$( "left_link").innerHTML = g_link_array[1].name;
					$( "right_link").innerHTML = g_link_array[0].name;
                    break;
           }
		   $( g_link_array[g_current_num].id).style.display = "block";
 		   change_opacity_level( true);
		}
	   
	   function change_picture( direction) {
	       clearTimeout( g_timeout);
	       g_direction = direction;
 		   change_opacity_level( false);
	   }
	   
	function init_motion( flag) {
		if ( !flag) {
			$( current_motion.moutingDiv).style.left = "0px";
			current_motion.tempChild = $( current_motion.moutingDiv).removeChild( current_motion.elementArray[0]);
			$( current_motion.moutingDiv).appendChild( current_motion.tempChild);
			current_motion.currentElement = 0;
		}
		current_motion.delta = getElementsArray( $( "hid"), "img")[current_motion.currentElement].offsetWidth;
		current_motion.init( -1);
	}
 
