var numofchar=130; /*initial length to shorten quote to*/
var quotemin=122; /*after shortening quote it must be at least this many charaters to be shown*/
var quotemax=128; /*after shortening quote it can not be more than this many charaters to be shown*/
var seconds=6; /* rotate every x seconds */
var numofchartemp=numofchar;
var Quotation=[]
var which;

function rotate()
{
       which = Math.round(Math.random()*(Quotation.length - 1));
 if(Quotation[which].length >= numofchar){
		numofchartemp=numofchar;
		for(var i=0; i==0; ) {
		if((Quotation[which].charAt(numofchartemp)==' ')&&(Quotation[which].charAt(numofchartemp)!=',')){
		i=1;
			}else{
		numofchartemp--;
			}
        }
if((numofchartemp > quotemin)&&(numofchartemp < quotemax)){		
        document.getElementById('textrotator').innerHTML = Quotation[which].substr(0,numofchartemp) + '... <span class="closing-quote">&nbsp;</span>';
		/*alert(Quotation[which].length + '    ' + numofchartemp);*/
}
 }
}

function start()
{
	setInterval("rotate()",seconds*1000);
}



	window.onload=start;

        