$(document).ready(function() {
	
	$('input.text,textarea').hover(function(){
		$(this).addClass('hover');
	},
	function(){
		$(this).removeClass('hover');	
	});

	$('input.text,textarea').focus(function() {
		$(this).addClass('focus');
	});
	$('input.text,textarea,select').blur(function() {
		$(this).removeClass('focus');
	});
});


function swip (elementInput, swipFrom, swipTo){
	if (elementInput.value == swipFrom) elementInput.value = swipTo;
}



// tooltip text

this.tooltip = function(){	
	/* CONFIG */		
		xOffset = 10;
		yOffset = 20;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	$("a.tooltip, .sficon img, .sfposticon img").hover(function(e){											  
		this.t = this.title;
		this.title = "";									  
		$("body").append("<p id='tooltip'>"+ this.t +"</p>");
		$("#tooltip, .sficon img, .sfposticon img")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
		this.title = this.t;		
		$("#tooltip").remove();
    });	
	$("a.tooltip").mousemove(function(e){
		$("#tooltip, .sficon img, .sfposticon img")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};

// tooltip text end

// apples rollover

$(function() {	
	$("#apple_list a span.rollover").css("opacity","0");
	$("#apple_list a").hover(function () {
		$(this).children("span.rollover").stop().animate({
			opacity: 1
		}, 'slow');
	},
	function () {
		$(this).children("span.rollover").stop().animate({
			opacity: 0
		}, 'slow');
	});
});

// apples rollover
