
$(function() {

// OPACITY OF BUTTON SET TO 50%

$(".blo").css("opacity","0.5");

 

// ON MOUSE OVER

$(".blo").hover(function () {

 

// SET OPACITY TO 100%

$(this).stop().animate({

opacity: 1.0

}, "fast");

},

 

// ON MOUSE OUT

function () {

 

// SET OPACITY BACK TO 50%

$(this).stop().animate({

opacity: 0.5

}, "slow");

});

});





$(document).ready(function(){
  var currentPosition = 0;
  var slideWidth = 590;
  var slides = $('.slide');
  var numberOfSlides = slides.length;

  // Remove scrollbar in JS
  $('#slidesContainer').css('overflow', 'hidden');

  // Wrap all .slides with #slideInner div
  slides
    .wrapAll('<div id="slideInner"></div>')
    // Float left to display horizontally, readjust .slides width
	.css({
      'float' : 'left',
      'width' : slideWidth
    });

  // Set #slideInner width equal to total width of all slides
  $('#slideInner').css('width', slideWidth * numberOfSlides);

  // Insert controls in the DOM
  $('#slideshow')
    .prepend('<span class="control" id="leftControl">Clicking moves left</span>')
    .append('<span class="control" id="rightControl">Clicking moves right</span>');

  // Hide left arrow control on first load
  manageControls(currentPosition);

  // Create event listeners for .controls clicks
  $('.control')
    .bind('click', function(){
    // Determine new position
	currentPosition = ($(this).attr('id')=='rightControl') ? currentPosition+1 : currentPosition-1;
    
	// Hide / show controls
    manageControls(currentPosition);
    // Move slideInner using margin-left
    $('#slideInner').animate({
      'marginLeft' : slideWidth*(-currentPosition)
    });
  });

  // manageControls: Hides and Shows controls depending on currentPosition
  function manageControls(position){
    // Hide left arrow if position is first slide
	if(position==0){ $('#leftControl').hide() } else{ $('#leftControl').show() }
	// Hide right arrow if position is last slide
    if(position==numberOfSlides-1){ $('#rightControl').hide() } else{ $('#rightControl').show() }
  }	
});







$(document).ready(function(){
  var currentPosition = 0;
  var slideWidth = 900;
  var slides = $('.f-slide');
  var numberOfSlides = slides.length;

  // Remove scrollbar in JS
  $('#f-slidesContainer').css('overflow', 'hidden');

  // Wrap all .slides with #slideInner div
  slides
    .wrapAll('<div id="f-slideInner"></div>')
    // Float left to display horizontally, readjust .slides width
	.css({
      'float' : 'left',
      'width' : slideWidth
    });

  // Set #slideInner width equal to total width of all slides
  $('#f-slideInner').css('width', slideWidth * numberOfSlides);

  // Insert controls in the DOM
  $('#f-slideshow')
    .prepend('<span class="f-control" id="f-leftControl">Clicking moves left</span>')
    .append('<span class="f-control" id="f-rightControl">Clicking moves right</span>');

  // Hide left arrow control on first load
  manageControls(currentPosition);

  // Create event listeners for .controls clicks
  $('.f-control')
    .bind('click', function(){
    // Determine new position
	currentPosition = ($(this).attr('id')=='f-rightControl') ? currentPosition+1 : currentPosition-1;
    
	// Hide / show controls
    manageControls(currentPosition);
    // Move slideInner using margin-left
    $('#f-slideInner').animate({
      'marginLeft' : slideWidth*(-currentPosition)
    });
  });

  // manageControls: Hides and Shows controls depending on currentPosition
  function manageControls(position){
    // Hide left arrow if position is first slide
	if(position==0){ $('#f-leftControl').hide() } else{ $('#f-leftControl').show() }
	// Hide right arrow if position is last slide
    if(position==numberOfSlides-1){ $('#f-rightControl').hide() } else{ $('#f-rightControl').show() }
  }	
});

$(document).ready(function() {

  $(".signin").click(function(e) {
      e.preventDefault();
      $("fieldset#signin_menu").toggle();
      $(".signin").toggleClass("menu-open");
  });

  $("fieldset#signin_menu").mouseup(function() {
      return false
  });
  $(document).mouseup(function(e) {
      if($(e.target).parent("a.signin").length==0) {
          $(".signin").removeClass("menu-open");
          $("fieldset#signin_menu").hide();
      }
  });            

});

$.fn.stickyfloat = function(options, lockBottom) {
				var $obj 				= this;
				var parentPaddingTop 	= parseInt($obj.parent().css('padding-top'));
				var startOffset 		= $obj.parent().offset().top;
				var opts 				= $.extend({ startOffset: startOffset, offsetY: parentPaddingTop, duration: 200, lockBottom:true }, options);
				
				$obj.css({ position: 'absolute' });
				
				if(opts.lockBottom){
					var bottomPos = $obj.parent().height() - $obj.height() + parentPaddingTop; //get the maximum scrollTop value
					if( bottomPos < 0 )
						bottomPos = 0;
				}
				
				$(window).scroll(function () { 
					$obj.stop(); // stop all calculations on scroll event

					var pastStartOffset			= $(document).scrollTop() > opts.startOffset;	// check if the window was scrolled down more than the start offset declared.
					var objFartherThanTopPos	= $obj.offset().top > startOffset;	// check if the object is at it's top position (starting point)
					var objBiggerThanWindow 	= $obj.outerHeight() < $(window).height();	// if the window size is smaller than the Obj size, then do not animate.
					
					// if window scrolled down more than startOffset OR obj position is greater than
					// the top position possible (+ offsetY) AND window size must be bigger than Obj size
					if( (pastStartOffset || objFartherThanTopPos) && objBiggerThanWindow ){ 
						var newpos = ($(document).scrollTop() -startOffset + opts.offsetY );
						if ( newpos > bottomPos )
							newpos = bottomPos;
						if ( $(document).scrollTop() < opts.startOffset ) // if window scrolled < starting offset, then reset Obj position (opts.offsetY);
							newpos = parentPaddingTop;
			
						$obj.animate({ top: newpos }, opts.duration );
					}
				});
			};

			$('#account').stickyfloat({ duration: 400 });
			
			
			
/*
* Placeholder plugin for jQuery
* ---
* Copyright 2010, Daniel Stocks (http://webcloud.se)
* Released under the MIT, BSD, and GPL Licenses.
*/
(function($) {
  function Placeholder(input) {
    this.input = input;
    if (input.attr('type') == 'password') {
      this.handlePassword();
    }
    // Prevent placeholder values from submitting
    $(input[0].form).submit(function() {
      if (input.hasClass('placeholder') && input[0].value == input.attr('placeholder')) {
        input[0].value = '';
      }
    });
  }
  Placeholder.prototype = {
    show: function(loading) {
      // FF and IE saves values when you refresh the page. If the user refreshes the page with
      // the placeholders showing they will be the default values and the input fields won't be empty.
      if (this.input[0].value === '' || (loading && this.valueIsPlaceholder())) {
        if (this.isPassword) {
          try {
            this.input[0].setAttribute('type', 'text');
          } catch (e) {
            this.input.before(this.fakePassword.show()).hide();
          }
        }
        this.input.addClass('placeholder');
        this.input[0].value = this.input.attr('placeholder');
      }
    },
    hide: function() {
      if (this.valueIsPlaceholder() && this.input.hasClass('placeholder')) {
        this.input.removeClass('placeholder');
        this.input[0].value = '';
        if (this.isPassword) {
          try {
            this.input[0].setAttribute('type', 'password');
          } catch (e) {}
          // Restore focus for Opera and IE
          this.input.show();
          this.input[0].focus();
        }
      }
    },
    valueIsPlaceholder: function() {
      return this.input[0].value == this.input.attr('placeholder');
    },
    handlePassword: function() {
      var input = this.input;
      input.attr('realType', 'password');
      this.isPassword = true;
      // IE < 9 doesn't allow changing the type of password inputs
      if ($.browser.msie && input[0].outerHTML) {
        var fakeHTML = $(input[0].outerHTML.replace(/type=(['"])?password\1/gi, 'type=$1text$1'));
        this.fakePassword = fakeHTML.val(input.attr('placeholder')).addClass('placeholder').focus(function() {
          input.trigger('focus');
          $(this).hide();
        });
        $(input[0].form).submit(function() {
          fakeHTML.remove();
          input.show()
        });
      }
    }
  };
  var NATIVE_SUPPORT = !! ("placeholder" in document.createElement("input"));
  $.fn.placeholder = function() {
    return NATIVE_SUPPORT ? this : this.each(function() {
      var input = $(this);
      var placeholder = new Placeholder(input);
      placeholder.show(true);
      input.focus(function() {
        placeholder.hide();
      });
      input.blur(function() {
        placeholder.show(false);
      });

      // On page refresh, IE doesn't re-populate user input
      // until the window.onload event is fired.
      if ($.browser.msie) {
        $(window).load(function() {
          if (input.val()) {
            input.removeClass("placeholder");
          }
          placeholder.show(true);
        });
        // What's even worse, the text cursor disappears
        // when tabbing between text inputs, here's a fix
        input.focus(function() {
          if (this.value == "") {
            var range = this.createTextRange();
            range.collapse(true);
            range.moveStart('character', 0);
            range.select();
          }
        });
      }
    });
  }
})(jQuery);


  // Fix placeholders in IE
  $('input[placeholder], textarea[placeholder]').placeholder();

