
		jQuery.fn.vibrate = function(){
 
			// Loop over each of the elements in the jQuery
			// stack so that we can set up the properties
			// for the individual elements.
			this.each(
				function( intI ){
					// Get a jQuery object for this element.
					var jNode = $( this );
 
					// Default plugin to not be vibrating.
					var blnVibrate = false;
 
					// Get current position of the element.
					var intLeft = parseInt( jNode.css( "left" ) );
					var intTop = parseInt( jNode.css( "top" ) );
 
 
					// Create a function pointer that will
					// handle the updating of elements position
					// such that it will make it appear to be
					// vibrating.
					var fnUpdatePosition = function(){
						var intCurrentLeft = parseInt(
							jNode.css( "left" )
							);
 
						var intCurrentTop = parseInt(
							jNode.css( "top" )
							);
 
 
						// Check to see if we should keep going.
						if (blnVibrate){
 
							// Check to see which direction to
							// adjust in - either vert. or horz.
							if (Math.random() > .5){
 
								// Adjust vertically.
								if (intCurrentTop > intTop){
									intCurrentTop = (intTop - 1);
								} else {
									intCurrentTop = (intTop + 1);
								}
 
							} else {
 
								// Adjust horizontally.
								if (intCurrentLeft > intLeft){
									intCurrentLeft = (intLeft - 1);
								} else {
									intCurrentLeft = (intLeft + 1);
								}
 
							}
 
							// Set a timeout to call this method
							// again and update position.
							setTimeout(
								fnUpdatePosition,
								10
								);
 
						} else {
 
							// Reset position.
							intCurrentLeft = intLeft;
							intCurrentTop = intTop;
 
						}
 
 
						// Update the position.
						jNode.css(
							"top",
							(intCurrentTop + "px")
							);
 
						jNode.css(
							"left",
							(intCurrentLeft + "px")
							);
						
						jNode.css(
							"opacity",
							(Math.random())
							);
					}
 
 
					// Hoook up the mouse over event to flag
					// that the vibrating should begin.
					
					
					
					$(document).ready(function(){
						blnVibrate = true;
						fnUpdatePosition();
					});
					// Hook up the mouse out event to flag
					// that the vibrating should end.
					
 
				}
				);
			// END: each()
 
			// Return the jQuery stack to keep chaining.
			return( this );
		}


$(document).ready(function(){
	
	$( "#x" ).vibrate();

	
});
