function resizeText(multiplier)

{  
  if (document.body.style.fontSize == "") {  
    document.body.style.fontSize = "0.8em";  
  }  
  document.body.style.fontSize = parseFloat(document.body.style.fontSize) + (multiplier * 0.1) + "em";  
}




$(document) .ready(function () {
  autoFill($("#query"), "Search");
  lsb.initSlideshows();
});


var lsb = (function () {
  
  var slideshows = {
  };
  
  return {
    
    
    initSlideshows: function () {
      var sss = $(".lsb-slideshow"), i;
      for (i = 0; i < sss.length; i++) {
        var ss = $(sss[i]);
        var ssObj = new lsb.Slideshow(ss);
        if (ss.id) {
          slideshows[ss.id] = ssObj;
        }
      }
    },
    
    
    getSlideshow: function (id) {
      return slideshows[id];
    }
  };
})();

lsb.Slideshow = function (slideshowElem, params) {
  /**
  Required Params:
  slideshowElem: the HTML DOM object that contains a display area (.lsb-slideshow-player) and a list of slides (.lsb-slides)
  */
  
  if (!(this instanceof lsb.Slideshow)) {
    return new lsb.Slideshow();
  }
  
  
  
  params = params | {
  };
  var i,
  hasSlides = false,
  slides = [],
  duration = params.duration | 3000,
  transSpeed = params.transitionSpeed | 2000,
  position = params.startPostion | 0,
  
  transOut = function () {
    //console.log("transOut position: ", position);
    //console.log("transOut slides[position]: ", slides[position]);
    slides[position].fadeOut(transSpeed, transIn);
    //slides[position].animate({opacity: 0}, transSpeed, "linear", transIn);
    position = (position === slides.length - 1) ? 0 : position + 1;
  },
  
  transIn = function () {
    //console.log("transIn position: ", position);
    //slides[position - 1]
    //slides[position].animate({opacity: 1.0}, transSpeed).animate({opacity: 1.0}, duration, "linear", transOut);
    slides[position].fadeIn(transSpeed) .animate({
      opacity: 1.0
    },
    duration, "linear", transOut);
  };
  
  var elems = slideshowElem.children(), elem;
  for (i = 0; i < elems.length; i++) {
    elem = elems[i];
    elem.style.display = "none";
    elem.style.listStyleType = "none";
    slides.push($(elem));
  }
  
  //target.animate({opacity: 0}, 1000, "linear", transIn);
  transIn();
};



function autoFill(id, v) {
  $(id) .css({ color: "#b2adad"
  }) .attr({ value: v
  }) .focus(function () {
    if ($(this) .val() == v) {
      $(this) .val("") .css({
        color: "#333"
      });
    }
  }) .blur(function () {
    if ($(this) .val() == "") {
      $(this) .css({
        color: "#b2adad"
      }) .val(v);
    }
  });
};
