$(document).ready(function() {

  // hovering for the search button.
  $(".searchFieldButton > input").hover(
    function(){$(this).addClass("hover");},
    function(){$(this).removeClass("hover");}
  );

  // hovering for the search button.
  $(".prSubmit").hover(
    function(){$(this).addClass("hover");},
    function(){$(this).removeClass("hover");}
  );

  // hovering for the submit button.
  $(".submitForm").hover(
    function(){$(this).addClass("hover");},
    function(){$(this).removeClass("hover");}
  );

  // onclick for <a>
  $("ul#recent_images a").click(function(){
      $("#sel_item").children("*").remove();
      $("#sel_item").prepend($(this).parents("li").children("div.newsBody").clone());
      $("#sel_item a").attr("onclick","prPW(this.href,100);return false;");
      $("ul#recent_images a.thmb_containter img").removeClass("thmb_sel");
      $(this).children("img").addClass("thmb_sel");
      return false;
    });

  // First item is autoselected
  $("#sel_item").prepend($("ul#recent_images a.thmb_containter:first").parents("li").children("div.newsBody").clone());
  $("ul#recent_images a.thmb_containter:first").children("img").addClass("thmb_sel");

  if($("ul#recent_images li").size() == 1) $("ul#recent_images").hide();
 
  $("#sel_item a").click(function(){
    prPW($(this).attr("href"),100);
    return false;
  });

  $(".scrollNonJS").hide();




  /////
  // 
  // New Images Kiosk
  //
  /////

  /////////////////////////////////////////
  // Featured Images kiosk
  /////////////////////////////////////////
  //
  // onclick for <a>
  //
  var ic_params = {contentCurrent:"Image {current} of {total}", contentPrevious:"prev"}
  $("ul#recent_images_new a").click(function(){
      $("#sel_item").children("*").remove();
      $("div.lightBoxes ul#recent_images_new .newsImage a").attr("rel","featuredImages");
      $("#sel_item").prepend($(this).parents("li").children("div.newsBody").clone());
      $("ul#recent_images_new a.thmb_containter img").removeClass("thmb_sel");
      $(this).children("img").addClass("thmb_sel");
      $(this).parents(".newsImageSmall").siblings(".newsImage").children("a").removeAttr("rel");

//      $("div.lightBoxes #sel_item .newsImage a[rel=featuredImages]").colorbox(ic_params,function(){showDownload()});
//      $("div.lightBoxes #sel_item .newsImage a[rel=featuredImagesTitle]").colorbox(ic_params,function(){showDownload()});

      return false;
    });

  //
  // First item is autoselected
  //
  $("div.lightBoxes ul#recent_images_new .newsImage a.thmb_containter").attr("rel","featuredImages");
  $("#sel_item").prepend($("ul#recent_images_new a.thmb_containter:first").parents("li").children("div.newsBody").clone());
  $("ul#recent_images_new .newsImageSmall:first img").addClass("thmb_sel");
  $("ul#recent_images_new .newsImageSmall:first").siblings(".newsImage").children("a").removeAttr("rel");

  if($("ul#recent_images_new li").size() == 1) $("ul#recent_images").hide();

});


