// Initialize cookie resizing
//
// selector - jQuery selector identifying resizing links. class name from each
//            link will be used as the size
// defaultSize - what it says on the tin. will be applied to body when cookie
//               is not present
function cookieResize(a,f){var b=f;function c(i,j,k){var g="";if(k){var h=new Date();h.setTime(h.getTime()+(k*86400000));var g="; expires="+h.toGMTString()}document.cookie=i+"="+j+g+"; path=/"}function d(h){h+="=";var g=document.cookie.split(";");for(var j=0;j<g.length;j++){var k=g[j];while(k.charAt(0)==" "){k=k.substring(1,k.length)}if(k.indexOf(h)==0){return k.substring(h.length,k.length)}}return null}function e(){$("body").removeClass(b);b=d("size")||f;$("body").addClass(b)}jQuery(a).click(function(){c("size",this.className);e();return false});e()};

$(document).ready(function(){
	cookieResize('#textResize a', 'medium');
	
	$('select').sSelect();
	var $listIndex = 500;
	$('.newListSelected').each(function(){
	  $(this).css({
	    'z-index': $listIndex
	  });
	  $listIndex -= 100;
	});
	
	$('.newList').each(function(){
    var $nlCount = $(this).find('li').length;
    
    if($nlCount > 5) {
      $(this).css({
        'height': '15em',
        'max-height': '15em'
      });
    }

	});
});