$(document).ready(function(){ 

		/* *** Automated text overlay for inputs. Works for password fields **B.C.** */
		
			/* check if soft refresh happened and any inputs left over */
			$('.auto-input').each(function(i) {
				var inputvalue = $(this).val();
				if( inputvalue !="" ) {$(this).parent().find('.auto-text').hide();}
			});
			/* focus and blur functions */
			$(".auto-input").bind("focus", function () {
				var inputvalue = $(this).val();
				if( inputvalue =="" ) {$(this).parent().find('.auto-text').hide();}
		    });
			$(".auto-input").bind("blur", function () {
				var inputvalue = $(this).val();
				if( inputvalue =="" ) {$(this).parent().find('.auto-text').show();}
		    });
			/* if clicked on the text pass the click to input */
			$(".auto-text").bind("click", function () {
				$(this).parent().find('.auto-input').focus();
		    });
		    
		    /* onchange function */
			$(".auto-input").bind("onchange", function () {
				var inputvalue = $(this).val();
				if( inputvalue != "" ) {$(this).parent().find('.auto-text').hide();}
		    });
		

 
		/* user overlay opener by B.C. */
		
	    $(".hp-user-item").bind("mouseenter", function (e) {
			/* get and set the custom link from rel attribute */
			var thelink =$(this).attr('rel');
			$('.hp-user-overlay').attr('href',thelink);
			/* set the position of the overlay */
			var position = $(this).position();
			$('.hp-user-overlay').css("top", position.top-32+"px").css("left", position.left-15+"px");
			$('.hp-user-overlay').show();
	    });
		
	    $(".hp-user-overlay").bind("mouseleave", function () {
			/* hide and reset link of the overlay */
			$('.hp-user-overlay').attr('href','#');
			$('.hp-user-overlay').hide();
	    });
		
		/* slider initialization */
		$("#slider").easySlider({
			auto: true,
			continuous: true 
		});
	
	
	});
