﻿$(document).ready(function() {

   /* IE6 png fix */
   if($.browser.msie && parseInt($.browser.version) === 6) { DD_belatedPNG.fix('.png_bg, img') }


	/* add target blank attribute to elements with .blank class */

   $("a.blank").click(function() {
      this.target = "_blank";
   });
   
   /* add and remove highlight classes to menu elements */
   $("ul.menu a").hover(function() {
      var cl = $(this).parent().attr("class");
      $(this).parents("ul").addClass(cl);
   }, function() {
      var cl = $(this).parent().attr("class");
      $(this).parents("ul").removeClass(cl);
   });
   
   
   /* remove default value on input focus - return the value if field left blank */
   var defS = $("#s").val();
   $("#s").focus(function() {
      if ($(this).val() == defS) $(this).val("");
   }).blur(function() {
      if ($(this).val() == "") $(this).val(defS);
   });
   
   
   /* Toggle sidebar panels*/
   $("div.sidebar ul ul").hide();
   
   $("div.sidebar ul li a").click(function() {
      if ( $(this).next("ul").length > 0 ) {
         if ( $(this).next("ul").is(":visible") ) { 
            $(this).next("ul").slideUp();
         } else {
            $(this).next("ul").slideDown();
         }           
         return false;
      }    
   });
   
   /* show search button after writing text */
  
});
