
ONLOAD_FUNCTIONS[ONLOAD_FUNCTIONS.length]='LoadMenuItem()';var all_frames=6;var open_frames=2;var current_frame=1;var top_animation_frames_timeout=20;var top_anim_first_frames_timeout=100;var timeout_after_menu_open=300;var top_animation_closed=1;function StartTopAnimation(){if(top_animation_closed){OpenTopAnimation()}else{current_frame=3;LoopTopAnimation(all_frames,'FinishTopAnimation()');}}
function TopAnimationOnOpen(){current_frame=3;document.getElementById('animation_image').src=temp_anim_image;window.setTimeout("LoopTopAnimation(all_frames, 'FinishTopAnimation()')",timeout_after_menu_open);}
function OpenTopAnimation(){LoopTopAnimation(open_frames,'TopAnimationOnOpen()',top_anim_first_frames_timeout)
top_animation_closed=0;}
function CloseTopAnimation(){current_frame=2;LoopTopAnimationBackward(2);}
var preload_img_preffix='pr_animation_0';function LoopTopAnimationBackward(){if(current_frame>0){var pr_image_id=preload_img_preffix+current_frame;document.getElementById('animation_image').src=document.getElementById(pr_image_id).src;current_frame--;window.setTimeout('LoopTopAnimationBackward()',top_animation_frames_timeout);}else{top_animation_closed=1;}}
function LoopTopAnimation(end_frame,handler,this_timeout){if(!this_timeout){this_timeout=top_animation_frames_timeout;}
if(current_frame<=end_frame){var pr_image_id=preload_img_preffix+current_frame;document.getElementById('animation_image').src=document.getElementById(pr_image_id).src;current_frame++;window.setTimeout('LoopTopAnimation('+end_frame+',"'+handler+'",'+this_timeout+')',this_timeout);}else{eval(handler)}}
function FinishTopAnimation(){document.getElementById('animation_image').src=temp_anim_image;PlayMenuItemAnimation();}
var menu_item_height=36;var menu_item_left=2;var menu_top=20;var menu_items_distance=20;var menu_items_obj_prefix='mi_';var skating_inc=20;var skating_speed=15;var menu=new Array();var current_menu_item=menu_items_cnt;function LoadMenuItem(){if(current_menu_item>0){StartTopAnimation();}else{CloseTopAnimation();}}
function PlayMenuItemAnimation(){var this_skating_inc=skating_inc+(current_menu_item*2);var menu_item_layer_name=menu_items_obj_prefix+current_menu_item;menu[current_menu_item]=new bcLayer(menu_item_layer_name);menu[current_menu_item].MoveTo(menu_item_left,menu_top-1);menu[current_menu_item].show();menu[current_menu_item].onSkateFinish=LoadMenuItem;var target_top_position=menu_top+(current_menu_item-1)*(menu_item_height+menu_items_distance)
current_menu_item--;menu[current_menu_item+1].SkateTo(menu_item_left,target_top_position,this_skating_inc,skating_speed);}