3 var image_div = document.getElementById("content");
4 image_div.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=showphoto&id=' + id));
9 var credits = document.getElementById("content");
10 credits.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=showcredits'));
13 function Tags(mode, id)
16 // add the tag to users session
17 HTML_AJAX.grab(encodeURI('rpc.php?action=addtag&id=' + id));
19 else if(mode == "del") {
20 // del the tag from users session
21 HTML_AJAX.grab(encodeURI('rpc.php?action=deltag&id=' + id));
23 else if(mode == "reset") {
24 HTML_AJAX.grab(encodeURI('rpc.php?action=reset'));
27 else if(mode == "condition") {
28 setCheckedValue(id, id.value);
29 HTML_AJAX.grab(encodeURI('rpc.php?action=tagcondition&mode=' + id.value));
32 refreshAvailableTags();
33 refreshSelectedTags();
38 function refreshAvailableTags()
40 // update available tags
41 var avail_tags = document.getElementById('available_tags');
42 avail_tags.innerHTML = "Loading...";
43 avail_tags.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=show_available_tags'));
46 function refreshSelectedTags()
48 // update selected tags
49 var selected_tags = document.getElementById("selected_tags");
50 selected_tags.innerHTML = "Loading...";
51 selected_tags.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=show_selected_tags'));
54 function showPhotoIndex(begin_with)
56 if(begin_with == undefined)
57 HTML_AJAX.replace(document.getElementById("content"), encodeURI('rpc.php?action=show_photo_index'));
59 HTML_AJAX.replace(document.getElementById("content"), encodeURI('rpc.php?action=show_photo_index&begin_with=' + begin_with));
62 function showBubbleDetails(object, id, direction)
64 HTML_AJAX.replace(object, encodeURI('rpc.php?action=showbubbledetails&id=' + id + '&direction=" + direction'));
67 // if photo index is currently shown, refresh it
68 function refreshPhotoIndex()
70 if(document.getElementById("matrix") != undefined) {
75 function click(object)
82 // set the radio button with the given value as being checked
83 // do nothing if there are no radio buttons
84 // if the given value does not exist, all the radio buttons
85 // are reset to unchecked
86 function setCheckedValue(condition, value) {
88 var count = condition.length;
89 if(count == undefined) {
90 condition.checked = (condition.value == value.toString());
93 for(var i = 0; i < count; i++) {
94 condition[i].checked = false;
95 if(condition[i].value == value.toString()) {
96 condition[i].checked = true;
101 function startTagSearch(searchfor)
103 HTML_AJAX.grab(encodeURI('rpc.php?action=tag_search&for=' + searchfor));
104 refreshAvailableTags();
105 refreshSelectedTags();
110 function clearSearch()
112 document.getElementsByName('searchfor')[0].value = '';