// JavaScript Document

this.randomtip = function(){
var length = $('#quotes .quote').length;
var ran = Math.floor(Math.random()*length) + 1;
$('#quotes .quote:nth-child(' + ran + ')').show();
};

this.randomtip = function(){

var pause = 6000; // define the pause for each tip (in milliseconds)
var length = $('#quotes div.quote').length;
var temp = -1;

this.getRan = function(){
// get the random number
var ran = Math.floor(Math.random()*length) + 1;
return ran;
};
this.show = function(){
var ran = getRan();
// to avoid repeating
while (ran == temp && $('#quotes .quote').length > 1){
    ran = getRan();
};
temp = ran;
$('#quotes div.quote').hide();
$('#quotes div.quote:nth-child(' + ran + ')').fadeIn(2000);
};

show(); setInterval(show,pause);

};

$(document).ready(function(){
randomtip();
});
