$(document).ready(function(){
$('#yeardropdown').selectbox();
$('#alphadropdown').selectbox(); 
$('#langdropdown').selectbox(); 

 $('input.dropdown').change(function(e) {
  // set the window's location property to the value of the option the user has selected
  window.location = $(this).val();
});

 $('div.selectbox-wrapper ul li').click(function(e) {
  // set the window's location property to the value of the option the user has selected
  window.location = $(this).attr('id');
});

	  
if($('div.spanpost') != null){
$('div.spanpost').hide();
 $('div.spanpost').after('<a href="#" id="readfull" rel="read">Read Full Introduction</a><br/><br/>');
 $('a#readfull').click(function(e){
 e.preventDefault();
 var rel = $(this).attr('rel');
 if(rel == "read")
 {
    $('div.spanpost').show();
    $(this).html('Less');
    $(this).attr('rel', 'hide');
 }else
 {
     $('div.spanpost').hide();
     $(this).html('Read Full Introduction');
     $(this).attr('rel', 'read');
 }
 
 });
 }
 

var inactivityTimerReset = (function() {
    var handle = 0;

    function reset() {
        if (handle != 0) {
            clearTimeout(handle);
        }
        handle = setTimeout(tick, 6000);
    }

    function tick() {
	
		var position = $('table#playersmain').position();
		var top = $(window).scrollTop();
		var height = $(document).height();
		top = Math.min(top, height - 750); 
		top = Math.max(0,top-200);
        $('div#leftbar').css('padding-top',top);
		inactivityTimerReset();
    }

    return reset;
})();

// Kick start
inactivityTimerReset();

// ...and anywhere you see what you consider to be activity, call it
// again
inactivityTimerReset();


 
});

