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 == "condition") {
24 setCheckedValue(id, id.value);
25 HTML_AJAX.grab(encodeURI('rpc.php?action=tagcondition&mode=' + id.value));
28 refreshAvailableTags();
29 refreshSelectedTags();
34 function refreshAvailableTags()
36 // update available tags
37 var avail_tags = document.getElementById('available_tags');
38 avail_tags.innerHTML = "Loading...";
39 avail_tags.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=show_available_tags'));
42 function refreshSelectedTags()
44 // update selected tags
45 var selected_tags = document.getElementById("selected_tags");
46 selected_tags.innerHTML = "Loading...";
47 selected_tags.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=show_selected_tags'));
49 // if no tags are currently selected, return false from here
50 if(selected_tags.innerHTML == "")
57 function showPhotoIndex(begin_with)
59 if(begin_with == undefined)
60 HTML_AJAX.replace(document.getElementById("content"), encodeURI('rpc.php?action=show_photo_index'));
62 HTML_AJAX.replace(document.getElementById("content"), encodeURI('rpc.php?action=show_photo_index&begin_with=' + begin_with));
65 // if photo index is currently shown, refresh it
66 function refreshPhotoIndex()
68 if(document.getElementById("matrix") != undefined || startup == 1) {
74 function click(object)
81 // set the radio button with the given value as being checked
82 // do nothing if there are no radio buttons
83 // if the given value does not exist, all the radio buttons
84 // are reset to unchecked
85 function setCheckedValue(condition, value) {
87 var count = condition.length;
88 if(count == undefined) {
89 condition.checked = (condition.value == value.toString());
92 for(var i = 0; i < count; i++) {
93 condition[i].checked = false;
94 if(condition[i].value == value.toString()) {
95 condition[i].checked = true;
100 function startTagSearch(searchfor)
102 HTML_AJAX.grab(encodeURI('rpc.php?action=tag_search&for=' + searchfor));
103 refreshAvailableTags();
104 refreshSelectedTags();
108 function startDateSearch()
110 from_year = document.getElementById('fromyear').value;
111 from_month = document.getElementById('frommonth').value;
112 from_day = document.getElementById('fromday').value;
113 from = from_year +"-"+ from_month +"-"+ from_day;
114 to_year = document.getElementById('toyear').value;
115 to_month = document.getElementById('tomonth').value;
116 to_day = document.getElementById('today').value;
117 to = to_year +"-"+ to_month +"-"+ to_day;
119 HTML_AJAX.grab(encodeURI('rpc.php?action=date_search&from='+ from +'&to='+ to));
121 refreshAvailableTags();
122 refreshSelectedTags();
127 function setViewMode(mode)
129 var exprt = document.getElementById('output');
130 exprt.innerHTML = "Loading...";
131 exprt.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=get_export&mode=' + mode));
134 function clearSearch()
136 document.getElementsByName('searchfor')[0].value = '';
139 function init_phpfspot()
141 refreshAvailableTags();
143 if(photo = getPhotoToShow()) {
145 refreshSelectedTags();
148 if(refreshSelectedTags()) {
154 function setBackGrdColor(item, color)
156 if(color == 'mouseover')
157 item.style.backgroundColor='#c6e9ff';
158 if(color == 'mouseout')
159 item.style.backgroundColor='#eeeeee';
160 if(color == 'mouseclick')
161 item.style.backgroundColor='#93A8CA';
164 function getPhotoToShow()
166 // update selected tags
167 var photo_to_show = HTML_AJAX.grab(encodeURI('rpc.php?action=get_photo_to_show'));
169 // if no image needs to be shown, return false from here
170 if(photo_to_show == "")
173 return photo_to_show;
176 function showCalendar(date_box, click_obj)
178 var calendar = document.getElementById('calendar');
179 if(date_box == 'from') {
180 var xpos = document.getElementById('frompic').offsetLeft;
181 var ypos = document.getElementById('frompic').offsetTop;
182 calendar_mode = 'from';
184 if(date_box == 'to') {
185 var xpos = document.getElementById('topic').offsetLeft;
186 var ypos = document.getElementById('topic').offsetTop;
187 calendar_mode = 'to';
189 calendar.style.left = xpos + 60 + 'px';
190 calendar.style.top = ypos + 80 + 'px';
192 if(calendar.style.visibility == "" || calendar.style.visibility == 'hidden') {
193 calendar.style.visibility = 'visible';
194 calendar.innerHTML = "Loading...";
195 calendar.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=get_calendar_matrix'));
199 calendar.style.visibility = 'hidden';
204 function setMonth(year, month, day)
206 var calendar = document.getElementById('calendar');
207 calendar.innerHTML = "Loading...";
208 calendar.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=get_calendar_matrix&year='+ year +'&month='+ month +'&day='+ day));
211 function setCalendarDate(year, month, day)
213 document.getElementById(calendar_mode+'year').value = year;
214 document.getElementById(calendar_mode+'month').value = month;
215 document.getElementById(calendar_mode+'day').value = day;
220 HTML_AJAX.grab(encodeURI('rpc.php?action=reset'));
225 var calendar_shown = 0;
226 var calendar_mode = '';