
jQuery.fn.insideTextHover=function() {
  return this.each(function(){
    var el = $(this);
    var title = el.attr('title');
    if(!el.val()) { el.val(title) }
    $(this).focus(function() {
      if(el.val() == title) { el.val('') }
    }).blur(function() {
      if(!el.val()) { el.val(title) }
    })
  })
}

$(document).ready(function() {

    Cufon.replace(['h1, h3, .button, .footer a.social, .footer-menu li a'], { fontFamily: 'Geogrotesque', hover: true });
    Cufon.replace(['h2, .navigation-bar li a, .filter-link'], { fontFamily: 'Geogrotesque-Medium', hover: true });
    Cufon.replace(['h4'], { fontFamily: 'Geogrotesque-Light', hover: true });


  $('.header .search input[type="text"]').insideTextHover(); // @todo For performance reasons change selector to id after backend is ready
  
  $('a.cloud[title]').qtip({
      position: {
         corner: {
            target: 'bottomMiddle',
            tooltip: 'topRight'
         }
      },
      style: {
         name: 'cream',
		 background: '#f7f7f7',
		 border: {
         width: 2,
         radius: 2,
         color: '#e4e5e7'
      },

		 color: '#93959b',
         padding: '7px 13px',
         tip: true
      }
   });

    
});

