$(document).ready(function(){
  $("#media_slider").cycle({ 
    fx:    "fade", 
    speed:  5000,
    before: onBefore
	});
  $("#react_top img").hover(
    function () {
      for (i = 0; i <= $(this).attr("id");i++) {
        $("#react_top img[id="+i+"]").attr( {"src": "http://www.poessie.nl/img/star_on.jpg"} );
      }
    }, 
    function () {
      $("#react_top img").attr( {"src": "http://www.poessie.nl/img/star_off.jpg"} );
    }
  );
  $("#react_top img[id]").click(function() {
    $("#stars").html('<img border="0" src="http://www.poessie.nl/img/loading.gif" height="20" width="20" />');
    $.get("http://www.poessie.nl/content.php", { action: "add_stars", cat_id: $("#right_bar").attr("cat"), page_id: $("#right_bar").attr("page"), stars: $(this).attr("id") }, function(data) {
      $("#stars").html(data);
    });
  });
  $(".menuoff a").hover(
    function () {
      $(this).css( {"color": "#ffff00"} );
    }, 
    function () {
      $(this).css( {"color": "#fff"} );
    }
  );
  $(".menuoff,.menuon").hover(
    function () {
      $("#sub_"+$(this).attr('id')).show();
    }, 
    function () {
      $("#sub_"+$(this).attr('id')).hide();
    }
  );
  $(".menuoff td[height=24],.menuon td[height=24]").hover(
    function () {
      $(this).css( {"color": "#ffff00"} );
      $(this).css( {"background-color": "#96d8e4"} );
      $(this).next("td").html('<img border="0" src="http://www.poessie.nl/img/sub_8.jpg" width="6" height="24" />');
      $(this).prev("td").html('<img border="0" src="http://www.poessie.nl/img/sub_7.jpg" width="6" height="24" />');
    }, 
    function () {
      $(this).css( {"color": "#000"} );
      $(this).css( {"background-color": "#fff"} );
      $(this).next("td").html('');
      $(this).prev("td").html('');
    }
  );
  $("#zoek1 input").focus(function(){
    if ($(this).val() == 'Zoek en gij zult vinden.') {
      $(this).val('');
    }
  });
  $("#zoek1 input").blur(function(){
    if ($(this).val() == '') {
      $(this).val('Zoek en gij zult vinden.');
    }
  });
  $(".more1,.more2").hover(
    function () {
      $(this).css( {"color": "#006699"} );
      $(this).css( {"text-decoration": "underline"} );
      $(this).prev("td").html('<img border="0" src="http://www.poessie.nl/img/more2.jpg" width="16" height="25" />');
    }, 
    function () {
      $(this).css( {"color": "#fff"} );
      $(this).css( {"text-decoration": "none"} );
      $(this).prev("td").html('');
    }
  );
});
function onBefore() { 
  $(".media_img").attr( {"src": "http://www.poessie.nl/img/bol2.jpg"} );
  $(".media_img[id="+this.id+"]").attr( {"src": "http://www.poessie.nl/img/bol1.jpg"} );
}