var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")

window.onload = function() {
	var mozilla = false; var ie = false;
  if (document.all) { ie = true; }
  else if (document.getElementById) { mozilla = true; }

	//document.getElementById('date').innerHTML = dayarray[day]+", "+montharray[month]+" "+daym+", "+year;

  rotate_testimonial();
}

function openWindow(src,w,h) {
  w+=30; h+=20;
  window.open(src,"popup",'scrollbars,width='+w+',height='+h+'');
}

function openShow(album) {
  slideshow = window.open('./slide_show.php?album='+ album,'slideshow','resizable,scrollbars,titlebar');
}

function rotate_image() {
  if(document.getElementById("rotating_image")) {
		x = Math.round(Math.random() * images.length) - 1;
		if(x < 0) {
			x = 0;
		}
    document.getElementById("rotating_image").src = "./images/"+images[x];
    setTimeout("rotate_image()", 12000);
  }
}

function preloader() {
	imageObj = new Image();
	for(i=0;i<images.length;i++)
		imageObj.src="./images/"+images[i];
}

var images = new Array("banhm.jpg");

preloader();

function rotate_testimonial() {
  if(document.getElementById("testimonial")) {
		x = Math.round(Math.random() * testimonials.length) - 1;
		if(x < 0) {
			x = 0;
		}
    document.getElementById("testimonial").innerHTML = testimonials[x];
    setTimeout("rotate_testimonial()", 30000);
  }
}

var testimonials = new Array("Great App for Spanish Students<br /><br />I downloaded this on a whim and was pleasantly surprised by what a useful and polished tool Spanish Tutor is.  I really enjoyed it!  Basic but well designed and structured for expansion. <br/>","Basic, easy to use and fun<br /><br />I spent an hour last night with a 12 year old playing with this app and we both enjoyed it.  It presents the material in different ways, making you think.  It is easy to use, free and fun.  She looked at me and said 'we just studied something for almost an hour and I liked it!'  A monumental break through for this child.  Thank you!<br/>by BigSisterVolunteer<br/>","Helpful and Interactive<br /><br />This is a terrific app! It's very interactive and uses a series of quizes and games to teach you the language. I'm amazed how much I've learned already. I've tried other ways to learn Spanish but most are so boring that I lose interest after a short time. This app actually makes it fun.<br/>","Amazed!!!!!<br /><br />This is actually worth it! If you really need to learn spanish fast and easy!");
