jQuery.fn.hint = function (blurClass) {
  if (!blurClass) { 
    blurClass = 'blur';
  }

  return this.each(function () {
    // get jQuery version of 'this'
    var $input = jQuery(this),

    // capture the rest of the variable to allow for reuse
      title = $input.attr('title'),
      $form = jQuery(this.form),
      $win = jQuery(window);

    function remove() {
      if ($input.val() === title && $input.hasClass(blurClass)) {
        $input.val('').removeClass(blurClass);
      }
    }

    // only apply logic if the element has the attribute
    if (title) { 
      // on blur, set value to title attr if text is blank
      $input.blur(function () {
        if (this.value === '') {
          $input.val(title).addClass(blurClass);
        }
      }).focus(remove).blur(); // now change all inputs to title

      // clear the pre-defined text when form is submitted
      $form.submit(remove);
      $win.unload(remove); // handles Firefox's autocomplete
    }
  });
};

$(document).ready(function(){
$("#slider img").css({"position": "relative"});
$("ul#tabs").tabs("div.panes > div", {
	rotate: true,
	current: 'current',
	initialIndex: 2
}).slideshow({
	autoplay: true,
	interval: 7000,
	autopause: true
});

$("input#header-search-field").autocomplete({
    source: ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby" , "random text"]
});


$("#header-signin").click(function(){$("#prompt").show();});
$(".close").click(function(){$("#prompt").hide(); });

$("#main-menu a[title]").tooltip({offset: [-10,90]});

$(".io").hint();

$('#cat-menu li').hover(
			function() { $(this).children("ul").slideDown("fast");
			$(this).children("a").addClass("sel"); },
			function() { $(this).children("ul").slideUp("fast"); 
			$(this).children("a").removeClass("sel");});

$("#cat-menu li ul").hover(
  function () {
	$(this).parent().children("a").addClass("sel");
  }, 
  function () {
	$(this).parent().children("a").removeClass("sel");
  }
	 );
	 
var fields = $(".hidden").html(); 
$("#e2").click(function(){$("#breaker").before(fields);});



  });


