function slideSwitch() {
    var $active = $('#slideshow DIV.active');

    if ( $active.length == 0 ) $active = $('#slideshow DIV:last');

    // use this to pull the divs in the order they appear in the markup
    //var $next =  $active.next().length ? $active.next()
     //   : $('#slideshow DIV:first');

    // uncomment below to pull the divs randomly
     var $sibs  = $active.siblings();
    var rndNum = Math.floor(Math.random() * $sibs.length );
    var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 5000 );
});



function getQuote(){
clearTimeout(timer);
var quote   = new Array();
 quote[1]   = "The child has other powers than ours, and the creation he achieves is no small one; it is everything.<p class='align-right'>- Maria Montessori</p>";
 quote[2]   = "The adult ought never to mold the child after himself, but should leave him alone and work always from the deepest comprehension of the child himself.<p class='align-right'>- Maria Montessori</p>";
 quote[3]   = "And gradually we educators are confronted with a simple but important fact: that to help the child is not what he needs, and indeed that to give help is an impediment for the child. Therefore he must be allowed to act freely on his own initiative in this free environment.<p class='align-right'>- Maria Montessori</p>"; 
 quote[4]   = "The work of education is divided between the teacher and the environment.<p class='align-right'>- Maria Montessori</p>";
 quote[5]   = "The more the capacity to concentrate is developed, the more often the profound tranquility in work is achieved, then the clearer will be the manifestation of discipline within the child.<p class='align-right'>- Maria Montessori</p>";
 quote[6]   = "The child is truly a miraculous being, and this should be felt deeply by the educator.<p class='align-right'>- Maria Montessori</p>";
 quote[7]   = "The training of the teacher who is to help life is something far more than the learning of ideas. It includes the training of character; it is a preparation of the spirit.<p class='align-right'>- Maria Montessori</p>";
 quote[8]   = "Preventing conflict is the work of politics; establishing peace is the work of education.<p class='align-right'>- Maria Montessori</p>";
 quote[9]   = "The teacher must have faith that the child will reveal himself through work.<p class='align-right'>- Maria Montessori</p>";
 quote[10]  = "Whoever touches the life of the child touches the most sensitive point of a whole which has roots in the most distant past and climbs toward the infinite future.<p class='align-right'>- Maria Montessori</p>";
 quote[11]  = "The exercises of practical life are formative activities, a work of adaptation to the environment. Such adaptation to the environment and efficient functioning therein is the very essence of a useful education.<p class='align-right'>- Maria Montessori</p>";
 quote[12]  = "The child is truly a miraculous being, and this should be felt deeply by the educator.<p class='align-right'>- Maria Montessori</p>";
 quote[13]  = "The lesson must be presented in such a way that the personality of the teacher shall disappear. There shall remain in evidence only the object to which she wishes to call the attention of the child.<p class='align-right'>- Maria Montessori</p>";
 quote[14]  = "We should help the child - because he is endowed with great creative energies, which are of a nature so fragile as to need a loving and intelligent defense.<p class='align-right'>- Maria Montessori</p>";
 quote[15]  = "We must help the child to liberate himself from his defects without making him feel his weakness.<p class='align-right'>- Maria Montessori</p>";
 quote[16]  = "The first duty of the educator, whether he is involved with the newborn infant or the older child, is to recognize the human personality of the young being and respect it.<p class='align-right'>- Maria Montessori</p>";
 quote[17]  = "The child is much more spiritually elevated than is usually supposed.  He often suffers, not from too much work, but from work that is unworthy of him.<p class='align-right'>- Maria Montessori</p>";
 quote[18]  = "The child becomes a person through work.<p class='align-right'>- Maria Montessori</p>";
 quote[19]  = "The child is not like an oak tree born as one growing stronger and taller, but like a butterfly in a constant state of metamorphosis.<p class='align-right'>- Maria Montessori</p>"; 
 quote[20]  = "The word education must not be understood in the sense of teaching but of assisting the psychological development of the child.<p class='align-right'>- Maria Montessori</p>";
 quote[21]  = "Never help a child with a task at which he feels he can succeed.<p class='align-right'>- Maria Montessori</p>";
 quote[22]  = "Education is not something which the teacher does. It is a natural process which develops spontaneously.<p class='align-right'>- Maria Montessori</p>";
 quote[23]  = "We especially need imagination in science. It is not all mathematics, nor all logic, but it is somewhat beauty and poetry.<p class='align-right'>- Maria Montessori</p>";
 quote[24]  = "The first duty of an education is to stir up life, but leave it free to develop.<p class='align-right'>- Maria Montessori</p>";
 quote[25]  = "Education should no longer be mostly imparting of knowledge, but must take a new path, seeking the release of human potentialities.<p class='align-right'>- Maria Montessori</p>";
 quote[26]  = "Sometimes very small children in a proper environment develop a skill and exactness in their work that can only surprise us.<p class='align-right'>- Maria Montessori</p>";
 quote[27]  = "The adult ought never to mold the child after himself, but should leave him alone and work always from the deepest comprehension of the child himself.<p class='align-right'>- Maria Montessori</p>";
 quote[28]  = "The environment itself will teach the child, if every error he makes is manifest to him, without the intervention of a parent or teacher, who should remain a quiet observer of all that happens.<p class='align-right'>- Maria Montessori</p>";
 quote[29]  = "Let us give the child a vision of the whole universe.<p class='align-right'>- Maria Montessori</p>";
 quote[30]  = "Education demands, then, only this: the utilization of the inner powers of the child for his own instruction.<p class='align-right'>- Maria Montessori</p>";
 quote[0]  = "Our aim is not only to make the child understand, and still less to force him to memorize, but so to touch his imagination as to enthuse him to his innermost core. <p class='align-right'>- Maria Montessori</p>"; 

var num=Math.floor(Math.random()*30);
document.getElementById("quote").innerHTML=quote[num];
var timer=setTimeout("getQuote()", 120000);
}

var count=1;

function slideShow(){
clearTimeout(timer);
var show = new Array();

for(var a=1;a<25;a++){
	show[a]= a+".jpg";
}
	
	document.getElementById("SS").src="images/slideShow/" +show[count];
	count++;
	if(count==25)
		count=1;
	var timer=setTimeout("slideShow()", 8000);
}




function year(){

	var d = new Date();
	d=d.getFullYear();
	return d;
}	
	
	
function validate_email(field,alerttxt){
	with (field){
	apos=value.indexOf("@");
	dotpos=value.lastIndexOf(".");
	if (apos<1 || dotpos-apos<2){
    alert(alerttxt);
	return false;
	}
  else
  	return true;
  }
 }

function validateForm(thisform){
	with (thisform){
   if (!validate_email(email,"Please enter a valid email address.")){
   	email.focus();
    return false;
   }
 }
}

 /* /Retrieve all events
 


function getCalendarEvents(){
// Create the calendar service object
var calendarService = new google.gdata.calendar.CalendarService('GoogleInc-jsguide-1.0');

// The default "private/full" feed is used to retrieve events from 
// the primary private calendar with full projection 
var feedUri = 'http://www.google.com/calendar/feeds/default/private/full';

// The callback method that will be called when getEventsFeed() returns feed data
var callback = function(result) {       
  
  // Obtain the array of CalendarEventEntry
  var entries = result.feed.entry;    
  
  // Print the total number of events
  //PRINT('Total of ' + entries.length + ' event(s)');

  for (var i = 0; i < entries.length; i++ ) {
    var eventEntry = entries[i];
    var eventTitle = eventEntry.getTitle().getText();
    PRINT('Event title = ' + eventTitle);
  }    
}

// Error handler to be invoked when getEventsFeed() produces an error
var handleError = function(error) {
  PRINT(error);
}

// Submit the request using the calendar service object
calendarService.getEventsFeed(feedUri, callback, handleError);
}
*/
