// JavaScript Document
var total_leaders=6;
var main_leaders=5;
var current_index=0;
var suffle_delay=5000;
var current_index_main=0;
var today=TODAY()
var history=Array();
var index=0;
//history[0]=-1;

var today_thought=Array();

today_thought[1]="'It is not a mistake to commit a mistake, for no one commits a mistake knowing it to be one. But it is a mistake not to correct the mistake after knowing it to be one. If you are afraid of committing a mistake, you are afraid of doing anything at all. You will correct your mistakes whenever you find them.' ";

today_thought[2]="'Silence is a great help to the seeker after truth. In the attitude of silence, the soul finds the path in a clearer light, and what is elusive and deceptive resolves itself into crystal clearness. Our life is a long and arduous quest after truth, and the soul requires inward restfulness to attain its full height.'";

today_thought[3]="'If blood be shed, let it be our blood. Cultivate the quiet courage of dying without killing. For man lives freely only by his readiness to die, if need be, at the hands of his brother, never by killing him.'";

today_thought[4]="Man often becomes what he believes himself to be. If I keep on saying to myself that I cannot do a certain thing, it is possible that I may end by really becoming incapable of doing it. On the contrary, if I have the belief that I can do it, I shall surely acquire the capacity to do it even if I may not have it at the beginning.";

today_thought[5]="Mental violence has no potency and injures only the person whose thoughts are violent. It is otherwise with mental non-violence. It has potency which the world does not yet know.";

today_thought[6]="As human beings, our greatness lies not so much in being able to remake the world... as in being able to remake ourselves.";

today_thought[7]="'When I admire the wonder of a sunset or the beauty of the moon, my soul expands in worship of the Creator.'";

today_thought[8]="'When I admire the wonder of a sunset or the beauty of the moon, my soul expands in worship of the Creator.'";

today_thought[9]="'When I admire the wonder of a sunset or the beauty of the moon, my soul expands in worship of the Creator.'";

today_thought[10]="'When I admire the wonder of a sunset or the beauty of the moon, my soul expands in worship of the Creator.'";

today_thought[11]="'It is not a mistake to commit a mistake, for no one commits a mistake knowing it to be one. But it is a mistake not to correct the mistake after knowing it to be one. If you are afraid of committing a mistake, you are afraid of doing anything at all. You will correct your mistakes whenever you find them.' ";

today_thought[12]="'Silence is a great help to the seeker after truth. In the attitude of silence, the soul finds the path in a clearer light, and what is elusive and deceptive resolves itself into crystal clearness. Our life is a long and arduous quest after truth, and the soul requires inward restfulness to attain its full height.'";

today_thought[13]="'If blood be shed, let it be our blood. Cultivate the quiet courage of dying without killing. For man lives freely only by his readiness to die, if need be, at the hands of his brother, never by killing him.'";

today_thought[14]="Man often becomes what he believes himself to be. If I keep on saying to myself that I cannot do a certain thing, it is possible that I may end by really becoming incapable of doing it. On the contrary, if I have the belief that I can do it, I shall surely acquire the capacity to do it even if I may not have it at the beginning.";

today_thought[15]="Mental violence has no potency and injures only the person whose thoughts are violent. It is otherwise with mental non-violence. It has potency which the world does not yet know.";

today_thought[16]="As human beings, our greatness lies not so much in being able to remake the world... as in being able to remake ourselves.";

today_thought[17]="'When I admire the wonder of a sunset or the beauty of the moon, my soul expands in worship of the Creator.'";

today_thought[18]="'When I admire the wonder of a sunset or the beauty of the moon, my soul expands in worship of the Creator.'";

today_thought[19]="'When I admire the wonder of a sunset or the beauty of the moon, my soul expands in worship of the Creator.'";

today_thought[20]="'When I admire the wonder of a sunset or the beauty of the moon, my soul expands in worship of the Creator.'";

today_thought[21]="'It is not a mistake to commit a mistake, for no one commits a mistake knowing it to be one. But it is a mistake not to correct the mistake after knowing it to be one. If you are afraid of committing a mistake, you are afraid of doing anything at all. You will correct your mistakes whenever you find them.' ";

today_thought[22]="'Silence is a great help to the seeker after truth. In the attitude of silence, the soul finds the path in a clearer light, and what is elusive and deceptive resolves itself into crystal clearness. Our life is a long and arduous quest after truth, and the soul requires inward restfulness to attain its full height.'";

today_thought[23]="'If blood be shed, let it be our blood. Cultivate the quiet courage of dying without killing. For man lives freely only by his readiness to die, if need be, at the hands of his brother, never by killing him.'";

today_thought[24]="Man often becomes what he believes himself to be. If I keep on saying to myself that I cannot do a certain thing, it is possible that I may end by really becoming incapable of doing it. On the contrary, if I have the belief that I can do it, I shall surely acquire the capacity to do it even if I may not have it at the beginning.";

today_thought[25]="Mental violence has no potency and injures only the person whose thoughts are violent. It is otherwise with mental non-violence. It has potency which the world does not yet know.";

today_thought[26]="As human beings, our greatness lies not so much in being able to remake the world... as in being able to remake ourselves.";

today_thought[27]="'When I admire the wonder of a sunset or the beauty of the moon, my soul expands in worship of the Creator.'";

today_thought[28]="'When I admire the wonder of a sunset or the beauty of the moon, my soul expands in worship of the Creator.'";

today_thought[29]="'When I admire the wonder of a sunset or the beauty of the moon, my soul expands in worship of the Creator.'";

today_thought[30]="'When I admire the wonder of a sunset or the beauty of the moon, my soul expands in worship of the Creator.'";

today_thought[31]="'When I admire the wonder of a sunset or the beauty of the moon, my soul expands in worship of the Creator.'";

function TODAY_THOUGHT(index)
{
	document.getElementById('leaders_statement').innerHTML=today_thought[index];
	CHANGE_THOUGHT();
}

function CHANGE_THOUGHT()
{
		
		var index=TODAY()
		if(today!=index)
		{
			today=index;
			document.getElementById('leaders_statement').innerHTML=today_thought[index]
		}
		clockID = setTimeout("CHANGE_THOUGHT()", 1000);
}

function TODAY()
{
	var day=Date()
	return parseInt(day.charAt(8))*10+parseInt(day.charAt(9));
}

function SHUFFLE() 
{
    if(current_index_main!=main_leaders)
	{
		current_index_main++;
		document.getElementById('leaders_img').src='leaders/main_'+current_index_main+'.jpg'
		clockID = setTimeout("SHUFFLE()", suffle_delay);
	}
	else
	{
		current_index=RANDOM(2);
		document.getElementById('leaders_img').src='leaders/img_'+current_index+'.jpg'	
		clockID = setTimeout("SHUFFLE()", suffle_delay);
	}
}

function START() 
{
   TODAY_THOUGHT(today);
   clockID = setTimeout("SHUFFLE()", suffle_delay);
}

function RANDOM(digit)
{
	while(true)
	{
		var temp = Math.random();
		temp*=Math.pow(10,digit);
		temp=Math.floor(temp);	
		if(temp<189)
		break;			
	}
	return temp;
}

