
$(document).ready(
    function(){
        $('#most-popular').fadeOut('fast');
        
        var defaultVal = $('#bookseller-header-search .text-box').val();
        $('#bookseller-header-search .text-box').focus(
            function(){
              var  newVal = $(this).val();
                if(newVal == defaultVal){
                   $(this).val(''); 
                }
            }
        )
         $('#bookseller-header-search .text-box').blur(
            function(){
            var blurVal = $('#bookseller-header-search .text-box').val()
            var newVal =  jQuery.trim(blurVal);
            if(newVal == '') {
                $(this).val(defaultVal);
            }
            }
            )
    }
)

$(document).ready(
    function(){
        $('#bookseller-weekly-cover li a').each(
                function(index){
                    $(this).bind('click',
                        function(){
                         $('#bookseller-weekly-cover li a').removeClass('active');
                          $(this).addClass('active');
                          myFunction( index);
                            return false;
                        }
                    )
                }
          )
         myFunction(0); 
    } 
)
 
function most_commented_popular(id) {
  if(id == 'bookseller-most-comments') {
              $('#most-popular').fadeOut('fast'); 
		      $('#most-commented').fadeIn('fast');   
		      $('#bookseller-most-commented li a').removeClass('active');
		      $('#bookseller-most-commented li a').removeClass('notactive');
		      $('#bookseller-most-commented #bookseller-most-popularviews').addClass('notactive');
			  $('#bookseller-most-commented #' +id).addClass('active');
   		       
		       return false;
  }else{
               $('#most-commented').fadeOut('fast'); 
		       $('#most-popular').fadeIn('fast');   
		      $('#bookseller-most-commented li a').removeClass('active');
		      $('#bookseller-most-commented li a').removeClass('notactive');

  		       $('#bookseller-most-commented #bookseller-most-comments').addClass('notactive');
		       $('#bookseller-most-commented #' +id).addClass('active');
		       return false;
}
}

    function myFunction(num){
        for(i=0;i<3;i++){
           $('#bookseller-weekly-cover .cover'+i).css('display','none');
        }
        $('#bookseller-weekly-cover .cover'+num).css('display','block');
    }

function setsalarysearch(val) {
  if(document.getElementById('salary')) {
    document.getElementById('salary').value = val;
    document.jobSearch.submit();
   }
}