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_image();
  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",
											 "banhm10.jpg",
											 "banhm12.jpg",
											 "banhm13.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()", 14000);
  }
}

var testimonials = new Array("The advantage is that NasoNeb delivers enough saline - not too much, not too little - with broad distribution in the nasal cavity, quickly. <br/><br/> ENT",
"I can smell! Never can I smell food from 12-15 feet away and today I can. The NasoNeb worked.<br/><br/> After the first use of NasoNeb",
"Because the NasoNeb is so neat, I can see using this at work mid-day and keeping my clothes dry.<br/><br/>NasoNeb user",
"The NasoNeb is easy, quick, and not messy like the others.<br/><br/>NasoNeb user",
"The NasoNeb is better than the other nasal irrigators that I have tried, both the powered and the non-powered device types.<br/><br/>NasoNeb user",				"My patient's nasal cavity and surgically-exposed sinuses were clear after 2 weeks of twice daily treatments with the NasoNeb.<br/><br/> ENT");
