// global vars var active_section, open_section, active_sub, anim_timeout; var a_main_layers = new Array(); var a_sub_layers = new Array(); var menu_running = false; // menu (animation) preferences var menu_x = 0; var menu_y = 145; var item_height = 20; var anim_speed = 30; // the smaller the faster var anim_step = 8; // the higher thgife faster var a_sections = new Array('tickets','account','infos','contact','footer'); // menu sections (needs two layers: 'main...' and 'sub...') var a_img_list = new Array('main_high.gif','main_selected.gif','sub_high.gif','sub_selected.gif'); // filenames of the menu arrows var img_dir = '../../images/nav/'; img_pas_markup = '_normal'; img_act_markup = '_high'; // ******** startup functions ******** function init_nav(section,sub) { if(!nex_browser_check()) { location.href = '../browser.html'; return; } active_section = section; active_sub = sub; // preload arrow images /* if(document.images) { document.nexImageStack = new Array(); for(var i=0; i0 ? pos.x : 0; menu_y = pos.y-1; // define all menu layers for(var i=0; i0 ? 'high' : 'normal'; img_obj.src = img_dir+'main_'+switch_to+'.gif'; } } function select_main(section) { var lay_obj = new layer_object('main'+section); if(!lay_obj || !lay_obj.doc.images.length || !lay_obj.doc.images['main_'+section]) return; lay_obj.doc.images['main_'+section].src = img_dir+'main_selected.gif'; } */ function high_sub(section,item) { if(!(item==active_sub && section==active_section) && loaded) { var lay_obj = new layer_object('sub'+section); var img_obj = lay_obj.doc.images['sub_'+section+'_'+item]; var switch_to = img_obj.src.indexOf('normal')>0 ? 'high' : 'normal'; img_obj.src = img_dir+'sub_'+switch_to+'.gif'; } } function select_sub(section,item) { var lay_obj = new layer_object('sub'+section); lay_obj.doc.images['sub_'+section+'_'+item].src = img_dir+'sub_selected.gif'; } function anim_sub(section, image_name, nr) { if(!document.images) return; // stop previous anim if(anim_timeout && nr==0) clearTimeout(anim_timeout); if(nr==6) return; // show next pic var lay_obj = new layer_object('sub'+section); var img_obj = lay_obj.doc.images['sub_'+section+'_'+image_name]; if(!lay_obj.doc.images['sub_'+section+'_'+image_name]) return; if (img_obj.src.indexOf('normal') == -1) img_obj.src = img_obj.src.replace(/selected/, 'normal'); else img_obj.src = img_obj.src.replace(/normal/, 'selected'); // wait before next pic anim_timeout = setTimeout('anim_sub(\''+section+'\', \''+image_name+'\','+(nr+1)+')', 200); } // ******** end image animations ******** // ******** menu animations ******** function click_main(section, obj) { if (obj && obj.blur) obj.blur(); if(menu_running || !window.loaded || !nex_browser_check(1)) return false; var pos = find_in_array(a_sections,section); if(section == active_section) // if clicked on active section { if(open_section) // if a sectin is opened { // close it close_menu_tree(open_section); open_section = false; } return false; // exit } else if(!open_section) // if no section is opened { // open new submenu open_section = section; open_menu_tree(section); } else if(open_section == section) // if click on opened section { // close open submenu and exit close_menu_tree(open_section); open_section = false; } else // if click on any section except the active and the opended one { // close open submenu and open new one close_menu_tree(open_section); open_section = section; open_menu_tree(section); } return false; } var menu_working; function close_menu_tree(section) { var start_clip = (a_sub_layers[section]) ? a_sub_layers[section].height : item_height*2; menu_working = true; slide_menu_tree(section,start_clip,0,-1,'menu_working=false'); } function open_menu_tree(section) { if(!menu_working && a_main_layers[section]) { var end_height = (a_sub_layers[section]) ? a_sub_layers[section].height : item_height*2; var y_pos = a_main_layers[section].y+item_height; a_sub_layers[section].clip(0,120,0,0); a_sub_layers[section].move(menu_x,y_pos); a_sub_layers[section].show(1); slide_menu_tree(section,0,end_height,1); } else setTimeout('open_menu_tree(\''+section+'\')',anim_speed); } function slide_menu_tree(section,clipY,endY,dir,end_action) { if(!a_sub_layers[section]){ menu_running=false; return; } var pos = find_in_array(a_sections, section); var go_on = true; menu_running = true; if(end_action==null) end_action=''; if((dir>0 && clipY>=endY) || (dir<0 && clipY<=endY)) { clipY = endY; go_on = false; } a_sub_layers[section].clip(0,120,clipY,0); if(pos>=0) { var y_pos = a_main_layers[section].y+clipY+item_height; var sect; for(var n=pos+1; n