var $j = jQuery.noConflict();

$j(document).ready(function() {
   
   // search
   $j('.inputReplace').each(function(i, el) {
      var val = $j(el).val();
      $j(el).focus(function() {
         $j(this).addClass('focus');
         if($j(this).val() == val) {
            $j(this).val('');
         }
      });
      $j(el).blur(function() {
         $j(this).removeClass('focus');
         if($j(this).val() == '') {
            $j(this).val(val);
         }
      });
   });
   
   // homepage slides
   if($j('.slides').length) {
      $j('.slides')
         .after('<div class="thumbNav">')
         .cycle({
            fx: 'fade',
            pager: '.thumbNav',
            pause: 1,
            speed: 2000,
            timeout: 5000
         });
   }

   /*$j('#fortTabs .slides').each(function(i, el) {
      $j(el).anythingSlider({
         autoPlay : true,
         delay    : '5000',
         hashTags : false,
         theme    : 'minimalist-round'
      });
   });*/
   
   // Reset Font Size
   var originalFontSize = $j('html').css('font-size');
   var originalLineHeight = $j('html').css('line-height');
   
   var originalFontSizeNum = parseFloat(originalFontSize, 10);
   var originalLineHeightNum = parseFloat(originalLineHeight, 10);
   $j(".resetFont").click(function(){
     $j('html').css('font-size', originalFontSize);
     $j('html').css('line-height', originalLineHeight);
     $j(".decreaseFont").addClass('d');
     return false;
   });
   // Increase Font Size
   $j(".increaseFont").click(function(){
     var currentFontSize = $j('html').css('font-size');
     var currentFontSizeNum = parseFloat(currentFontSize, 10);
     var newFontSize = currentFontSizeNum*1.2;
      $j('html').css('font-size', newFontSize);
     var currentLineHeight = $j('html').css('line-height');
     var currentLineHeightNum = parseFloat(currentLineHeight, 10);
     var newLineHeight = currentLineHeightNum*1.2;
     $j('html').css('line-height', newLineHeight);
     $j(".decreaseFont").removeClass('d');
     
    
     return false;
   });
   // Decrease Font Size
   $j(".decreaseFont").click(function(){
     var currentFontSize = $j('html').css('font-size');
     var currentFontSizeNum = parseFloat(currentFontSize, 10);
     var newFontSize = currentFontSizeNum*0.8;
     if(newFontSize < originalFontSizeNum) {
      newFontSize = originalFontSizeNum;
      $j(".decreaseFont").addClass('d');
     }
     $j('html').css('font-size', newFontSize);
     return false;
   });
   
});
