function opacity(id, opacStart, opacEnd, millisec) {
	//speed for each frame
	var speed = Math.round(millisec / 100);
	var timer = 0;
	//determine the direction for the blending, if start and end are the same nothing happens
	if(opacStart > opacEnd) {
		for(i = opacStart; i >= opacEnd; i--) {
			var mytime1=setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			var	mytime2=setTimeout("wait("+i+")",(timer * speed));
			timer++;
		}

	} else if(opacStart < opacEnd) {
		for(i = opacStart; i <= opacEnd; i++)
			{
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
			
		}
	}
}

function wait(mi){
var i=mi;

if(i<=0){
pictext();
}

}
function calltxt(){
pictext();
}

function mycount(){

setTimeout("changetext()",10000);
}



//change the opacity for different browsers
function changeOpac(opacity, id) {
	var object = document.getElementById(id).style; 
	object.opacity = (opacity / 100);
	object.MozOpacity = (opacity / 100);
	object.KhtmlOpacity = (opacity / 100);
	object.filter = "alpha(opacity=" + opacity + ")";
}

function currentOpac(id, opacEnd, millisec) {
 
	//standard opacity is 100
	var currentOpac = 0;
	
	//if the element has an opacity set, get it
	
	if(document.getElementById(id).style.opacity < 100) {
		currentOpac = document.getElementById(id).style.opacity * 100;
	}
	
	//call for the function that changes the opacity
	opacity(id, currentOpac, opacEnd, millisec);
}

function changetext(){
 
currentOpac('proverb', 0, 1000);
}




function get_random(){
    var ranNum= Math.floor(Math.random()*29);
    return ranNum;
}

function pictext(){
var object=document.getElementById("proverb");


changeOpac(0, 'proverb')

var quote;
//var mynum= Math.floor(Math.random()*29);
var num=get_random();

switch(num){
	case 0:
    quote="A friend is a present you give yourself - Chinese Proverb";
	break;
	case 1:
	quote="Family is more valuable than money - Chinese Proverb";
	break;
	case 2:
	quote = "Good health is a man's Best wealth - Chinese Proverb";
	break;
	case 3:
	quote = "Youth is a gift of nature; middle age is a work of art - Chinese Proverb";
	break;
	case 4:
	quote = "A small house will hold as much happiness as a large one - Chinese Proverb";
	break;
	case 5:
	quote = "Hear with your ears but listen with your heart - Chinese Proverb";
	break;
	case 6:
 	quote = "Trouble brings experience and experience brings wisdom - Chinese Proverb";
	break;
	case 7:
 	quote = "Procrastination is the thief of time but so is planning too far ahead - Chinese Proverb";
	break;
	case 8:
 	quote = "Set your goal high and you will always move forward - Chinese Proverb";
	break;
	case 9:
 	quote = "Time is like money, you can only spend it once - Chinese Proverb";
	break;
	case 10:
 	quote = "Do not mistaken temptation for opportunity - Chinese Proverb";
	break;
	case 11:
 	quote = "Money can build a house, but it takes love to make it a home - Chinese Proverb";
	break;
	case 12:
 	quote ="Keep it Simple. The more you say, the less people remember - Chinese Proverb";
	break;
	case 13:
 	quote = "The first duty of humanity is in subduing fear - Chinese Proverb";
	break;
	case 14:
 	quote = "Doing what you like is freedom.  Liking what you do is happiness - Chinese Proverb";
  	break;
	case 15:
	quote = "Many a false step is made by standing still - Chinese Proverb";
 	break;
	case 16:
	quote = "Keep an eye open for an opportunity - Chinese Proverb";
	break;
	case 17:
	quote = "Practice makes perfect - Chinese Proverb";
	break;
	case 18:
	quote = "Through greater effort and hard work a precious dream comes true - Chinese Proverb";
  	break;
	case 19:
	quote = "Make some corner of the world distinctively yours - Chinese Proverb";
	break;
	case 20:
	quote = "Every person is the architect of his own fortune - Chinese Proverb";
	break;
	case 21:
	quote = "Sweet memories are the paradise of the mind - Chinese Proverb";
	break;
	case 22:
	quote = "Put up with small annoyances to gain great results - Chinese Proverb";
 	break;
	case 23:
	quote = "Build bridges, not walls - Chinese Proverb";
	break;
	case 24:
	quote = "Simplicity of character is the nature result of profound thought - Chinese Proverb";
	break;
	case 25:
	quote = "The first duty of humanity is in subduing fear- Chinese Proverb";
	break;
	case 26:
	quote = "Smile a lot. It costs nothing and is beyond any price - Chinese Proverb";
	break;
	case 27:
	quote = "Open your arms to change, but don't let go of your values - Chinese Proverb";
	break;
	case 28:
	quote = "Time can be wasted but never recycled - Chinese Proverb";
	break;
	}
	//alert("ITS DOWN TO THE DOCUMENT");
		//var ctname=getText(dname);
		//alert(ctname+ " " +dadd1 + " " +dadd2+ " " +dphone);
		
		object.innerHTML = quote;
 		currentOpac('proverb', 100, 1000);
		
	mycount();
}
