var defaultWidth = 140;
function setWidth(obj, val) {
	defaultWidth = obj.style.width;
	obj.style.width = val+'px';
}
function restoreWidth(obj) {
	obj.style.width = defaultWidth;
}

$(".prevfeat").livequery(function(){
   $(this).empty().remove();
});

$(function() {

$.fn.cycle.defaults.delay = 9000;
$.fn.cycle.defaults.timeout = 9000;

$.ajax({
  type: "GET", 
  url: "/Knowledge-Management/includes/cycle.js",
	dataType: "script",
	cache: false,
	success: function(data){
  	eval(data);
  	for (i=0; i<slides.length; i++) { 
  	$("<div></div>").load("/Knowledge-Management/includes/" + slides[i]).appendTo("#ss");
		$(".prevfeat").empty().remove();
  	}
    $("#ss").css({overflow: "hidden"});
    $("#ss>div").css({textAlign: "left", backgroundColor: "#618E31" , color:"#FFF"});
  	$('#ss').before('<div class="spotlights" id="ssnav"></div>').cycle({ 
      fx:'fade', speed: 1000, cleartype: 0, pause: 1, pauseOnPagerHover: 1, pager: '#ssnav'
  	});
		resizeFeatures();
  }
});

$(window).wresize(function(){
  resizeFeatures();
});

});

function resizeFeatures() {
	$('#ss').width("100%");
  var maxHeight = 0;
  $("#ss").children().each(function(){
    if (maxHeight < $(this).height()) { maxHeight = $(this).height(); } 
  });
  $("#ss").height(maxHeight);
}