+/**
+ * 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()
+