+} // initSlider()
+
+/**
+ * if the sort-order (photo-name, date, ...) has been
+ * changed, update the photo-index view.
+ */
+function update_sort_order(obj)
+{
+ var objTemp = new Object();
+ objTemp['value'] = obj.options[obj.selectedIndex].value;
+
+ var retr = HTML_AJAX.post(web_path + '/rpc.php?action=update_sort_order', objTemp);
+
+ if(retr == "ok") {
+ showPhotoIndex();
+ }
+ else {
+ window.alert("Server message: "+ retr);
+ }
+
+} // update_sort_order()
+
+/**
+ * show rate stars
+ *
+ * this function will show the requested amount of
+ * rate-stars.
+ *
+ * @param string mode
+ * @param int level
+ */
+function show_rate(mode, level)
+{
+ var i;
+
+ for(i = 1; i <= 5; i++) {
+ if(i <= level) {
+ document.getElementById('rate_' + mode + '_' + i).src = web_path + '/resources/star.png';
+ }
+ else {
+ document.getElementById('rate_' + mode + '_' + i).src = web_path + '/resources/empty_rate.png';
+ }
+ }
+
+} // show_rate()
+
+/**
+ * set rate stars
+ *
+ *
+ * this function will set the requested rate-stars-amount into a global
+ * variable (which will then later be used on form-submit) and will also
+ * update the display.
+ *
+ * @param string mode
+ * @param int level
+ */
+function set_rate(mode, level)
+{
+ rate_search[mode] = level;
+ show_rate(mode, level);
+
+} // set_rate()
+
+/**
+ * reset rate stars
+ *
+ * this function will reset the rate-star to their initial value.
+ *
+ * @param string mode
+ */
+function reset_rate(mode)
+{
+ if(rate_search[mode] == undefined)
+ rate_search[mode] = 0;
+
+ show_rate(mode, rate_search[mode]);
+
+} // reset_rate()
+
+/**
+ * handle key events
+ */
+function keyDown(e) {
+ var evt = (e) ? e:(window.event) ? window.event:null;
+
+ if(evt) {
+ var key = (evt.charCode) ? evt.charCode :
+ ((evt.keyCode) ? evt.keyCode : ((evt.which) ? evt.which : 0));
+
+
+ if(key == 37) /* left curosr */ {
+ if(document.getElementById('prev_link')) {
+ var prev_link = document.getElementById('prev_link').href;
+ window.location.href = prev_link;
+ }
+ return;
+ }
+ if(key == 38) /* up cursor */ {
+ }
+ if(key == 39) /* right curosr */ {
+ if(document.getElementById('next_link')) {
+ var next_link = document.getElementById('next_link').href;
+ window.location.href = next_link;
+ }
+ return;
+ }
+ if(key == 73 && evt.altKey && evt.ctrlKey) /* ctrl+alt+i */ {
+ showPhotoIndex();
+ return;
+ }
+ if(key == 82 && evt.altKey && evt.ctrlKey) /* ctrl+alt+r */ {
+ resetAll();
+ return;
+ }
+ }
+}
+
+document.onkeydown=keyDown;
+if(document.layers) {
+ document.captureEvents(Event.KEYDOWN);