clearing_allowed=false;function handle_skeleton_mode(){res=document.CC3D.getNodeEventOut("SCR_KBD","stripParts");document.skel_on.src=res==1?"./img/green.png":"./img/white.png";document.skel_off.src=res==0?"./img/green.png":"./img/white.png"}
function handle_cover_mode(){res=document.CC3D.getNodeEventOut("SCR_COVER","cover_mode");document.cover_auto.src=res==0?"./img/green.png":"./img/white.png";document.cover_show.src=res==1?"./img/green.png":"./img/white.png";document.cover_hide.src=res==2?"./img/green.png":"./img/white.png"}
function handle_col_set_mode(){res=document.CC3D.getNodeEventOut("SEC_SET_COL","col_set_mode");document.col_set_show.src=res==1?"./img/green.png":"./img/white.png";document.col_set_hide.src=res==0?"./img/green.png":"./img/white.png"}function handle_exploded_view_mode(){res=document.CC3D.getNodeEventOut("EXP_IMP_HANDLER","exploded_view_mode");document.exploded_on.src=res==1?"./img/green.png":"./img/white.png";document.exploded_off.src=res==0?"./img/green.png":"./img/white.png"}fps_old=0;cnt=0;
filter_fac=0.4;function getFrameRate(){if(cnt==0){fps_new=filter_fac*fps_old+(1-filter_fac)*document.CC3D.getCurrentFrameRate();fps_old=fps_new;document.getElementById("current_frame_rate").innerHTML=Math.round(fps_new)+" fps";cnt=4}--cnt}
function handle_clearing_lever_pos(){res=document.CC3D.getNodeEventOut("SEC_CARRIAGE","leverMode");clearing_allowed=res==1;document.clearing_lever_fold.src=res==0?"./img/green.png":"./img/white.png";document.clearing_lever_expand.src=res==1?"./img/green.png":"./img/white.png"}
function handle_clearing_actions(){if(clearing_allowed){document.clearing_action_results.src=document.CC3D.getNodeEventOut("SEC_CARRIAGE","ClearingAD_ActiveOut")=="TRUE"?"./img/green.png":"./img/white.png";document.clearing_action_results.title="click to clear the results [CR]"}else{document.clearing_action_results.src="./img/red.png";document.clearing_action_results.title="first expand the clearing lever  [CX]"}if(clearing_allowed){document.clearing_action_tc.src=document.CC3D.getNodeEventOut("SEC_CARRIAGE",
"ClearingTC_ActiveOut")=="TRUE"?"./img/green.png":"./img/white.png";document.clearing_action_tc.title="click to clear the turns counter [CT]"}else{document.clearing_action_tc.src="./img/red.png";document.clearing_action_tc.title="first expand the clearing lever  [CX]"}document.clearing_action_set.src=document.CC3D.getNodeEventOut("SEC_SET_AD","Clearing_Set_Active")=="TRUE"?"./img/green.png":"./img/white.png"}function try_clearing_res(){if(clearing_allowed)keyboard_2_keys(67,82)}
function try_clearing_tc(){if(clearing_allowed)keyboard_2_keys(67,84)}
function handle_car_pos(){res=document.CC3D.getNodeEventOut("SEC_CARRIAGE","offsetCur_changed");document.car_pos_1.src=res==0?"./img/green.png":"./img/white.png";document.car_pos_2.src=res==1?"./img/green.png":"./img/white.png";document.car_pos_3.src=res==2?"./img/green.png":"./img/white.png";document.car_pos_4.src=res==3?"./img/green.png":"./img/white.png";document.car_pos_5.src=res==4?"./img/green.png":"./img/white.png";document.car_pos_6.src=res==5?"./img/green.png":"./img/white.png";document.car_pos_7.src=
res==6?"./img/green.png":"./img/white.png";document.car_pos_8.src=res==7?"./img/green.png":"./img/white.png"}function handle_adder_mode(){res=document.CC3D.getNodeEventOut("SEC_ROTOR","isSubtractMode");document.adder_mode_add.src=res=="FALSE"?"./img/green.png":"./img/white.png";document.adder_mode_sub.src=res=="TRUE"?"./img/green.png":"./img/white.png"}
function handle_tc_mode(){res=document.CC3D.getNodeEventOut("SEC_SET_TC","tc_mode");document.tc_mode_inc.src=res==0?"./img/green.png":"./img/white.png";document.tc_mode_dec.src=res==1?"./img/green.png":"./img/white.png"}function handle_cranking(){res=document.CC3D.getNodeEventOut("SEC_ROTOR","isCranking");document.crank.src=res=="TRUE"?"./img/green.png":"./img/white.png";return res=="TRUE"}function keyboard_1_key(k1){document.CC3D.setNodeEventIn("SCR_KBD","fromPage",k1)}
function keyboard_2_keys(k1,k2){document.CC3D.setNodeEventIn("SCR_KBD","fromPage",k1);document.CC3D.setNodeEventIn("SCR_KBD","fromPage",k2)}function background(){document.CC3D.setNodeEventIn("_Background","frontUrl","./bkg/up.jpg");document.CC3D.setNodeEventIn("_Viewpoint","fieldOfView","1.57")}function loadURL(url){document.CC3D.loadURL(url,"")}function save_my_world(){document.CC3D.saveWorld("./koe.wrl")}
function setHeadlight(val){document.CC3D.setNodeEventIn("NAV_INFO","headlight",val?"TRUE":"FALSE")}function setCollission(s){res=document.CC3D.setOption("collisionDetection",s?"TRUE":"FALSE")};
