var title_change_threshold = 10; var title_array; var no_stories; var story_ids; no_stories = 11; title_array = new Array(no_stories); story_ids = new Array(no_stories); title_array[0] = "::::::: Abbasin's Tale :::::::"; story_ids[0] = 1; title_array[1] = "::::::: Anonymous Kosovar in Petiti Chatueau Camp, Brussels :::::::"; story_ids[1] = 2; title_array[2] = "::::::: a short tale by IJ :::::::"; story_ids[2] = 3; title_array[3] = "::::::: Anonymous Iranian, Petit Chateau, Brussels :::::::"; story_ids[3] = 4; title_array[4] = "::::::: - Anon Afghan, waiting for asylum, Petit Chateau, Brussels :::::::"; story_ids[4] = 5; title_array[5] = "::::::: Atek Nadir - an Algerian Refugee in Hanau :::::::"; story_ids[5] = 6; title_array[6] = "::::::: 4 chapters by Barry Dawda, refugee from Sierra Leone in Belgium :::::::"; story_ids[6] = 7; title_array[7] = "::::::: hate :::::::"; story_ids[7] = 8; title_array[8] = "::::::: hate :::::::"; story_ids[8] = 9; title_array[9] = "::::::: inconexa :::::::"; story_ids[9] = 10; title_array[10] = "::::::: memory and forgetting :::::::"; story_ids[10] = 11; var last_pos; var last_title; var curr_title; last_pos = new Array(2); last_pos[0] = 0; last_pos[1] = 0; last_title = 0; /* an index into the title_array */ curr_title = 0; function open_window(myurl, myname) { var childwin; if (myurl != "") { childwin = window.open(myurl, myname); } } function js_connector(image_id, toshow) { if (!toshow) { return; } opener.document.viewimage_callback.viewimage_submit_newimage.value = image_id; opener.document.viewimage_callback.submit(); window.close(); } function js_grid_callback(x, y) { document.grid_callback.mousex.value = x; document.grid_callback.mousey.value = y; document.grid_callback.submit(); } function js_story_grid_callback(x, y) { document.story_grid_callback.mousex.value = x; document.story_grid_callback.mousey.value = y; document.story_grid_callback.index_submit_storyid.value = story_ids[curr_title]; document.story_grid_callback.submit(); } function js_title_callback(x, y) { var no_stories, i; no_stories = 11; /* check if i am within 10 pixels of last update */ i = Math.sqrt(Math.pow(y - last_pos[1], 2.0) + Math.pow(x - last_pos[0], 2.0)); if (i > title_change_threshold) { /* update title, last_pos etc */ last_pos[0] = x; last_pos[1] = y; last_title = curr_title; curr_title = (last_title + 1) % (no_stories); } update_title(title_array[curr_title]); } function update_title(title) { var mypara; mypara = document.getElementById("titletext"); mypara.innerHTML = title; } function translate_helper(from_lang, to_lang, text) { var myform; myform = document.translate_callback; myform.text.value = text; myform.langpair.value = from_lang + '|' + to_lang; myform.hl.value = to_lang; myform.submit(); }