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'));
53 // if no tags are currently selected, return false from here
54 if(selected_tags.innerHTML == "")
61 function showPhotoIndex(begin_with)
63 if(begin_with == undefined)
64 HTML_AJAX.replace(document.getElementById("content"), encodeURI('rpc.php?action=show_photo_index'));
66 HTML_AJAX.replace(document.getElementById("content"), encodeURI('rpc.php?action=show_photo_index&begin_with=' + begin_with));
69 // if photo index is currently shown, refresh it
70 function refreshPhotoIndex()
72 if(document.getElementById("matrix") != undefined || startup == 1) {
78 function click(object)
85 // set the radio button with the given value as being checked
86 // do nothing if there are no radio buttons
87 // if the given value does not exist, all the radio buttons
88 // are reset to unchecked
89 function setCheckedValue(condition, value) {
91 var count = condition.length;
92 if(count == undefined) {
93 condition.checked = (condition.value == value.toString());
96 for(var i = 0; i < count; i++) {
97 condition[i].checked = false;
98 if(condition[i].value == value.toString()) {
99 condition[i].checked = true;
104 function startTagSearch(searchfor)
106 HTML_AJAX.grab(encodeURI('rpc.php?action=tag_search&for=' + searchfor));
107 refreshAvailableTags();
108 refreshSelectedTags();
113 function setViewMode(mode)
115 var exprt = document.getElementById('output');
116 exprt.innerHTML = "Loading...";
117 exprt.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=get_export&mode=' + mode));
120 function clearSearch()
122 document.getElementsByName('searchfor')[0].value = '';
125 function init_phpfspot()
127 refreshAvailableTags();
129 if(photo = getPhotoToShow()) {
131 refreshSelectedTags();
134 if(refreshSelectedTags()) {
140 function setBackGrdColor(item, color)
142 if(color == 'mouseover')
143 item.style.backgroundColor='#c6e9ff';
144 if(color == 'mouseout')
145 item.style.backgroundColor='#eeeeee';
146 if(color == 'mouseclick')
147 item.style.backgroundColor='#93A8CA';
150 function getPhotoToShow()
152 // update selected tags
153 var photo_to_show = HTML_AJAX.grab(encodeURI('rpc.php?action=get_photo_to_show'));
155 // if no image needs to be shown, return false from here
156 if(photo_to_show == "")
159 return photo_to_show;