// JavaScript Document
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
var image1=new Image()
image1.src="../images/banner_a.jpg"
var image2=new Image()
image2.src="../images/banner_b.jpg"
////change number of images below
var number_of_images=2
//change speed below (in seconds)
var speed=2
var step=1
var whichimage=1
function slideit(){
		if (!document.images)
		return
		if (document.all)
		slide.filters.blendTrans.apply()
		document.images.slide.src=eval("image"+step+".src")
		if (document.all)
		slide.filters.blendTrans.play()
		whichimage=step
		if (step<number_of_images)
		step++
		else
		return
if (document.all)
setTimeout("slideit()",speed*1000+3000)
else
setTimeout("slideit()",speed*1000)
}

/***********************************************
* Fading Scroller- &copy; Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var delay = 3000; //set delay between message change (in miliseconds)
var maxsteps=40; // number of steps to take to change from start color to endcolor
var stepdelay=40; // time in miliseconds of a single step
//**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect
var startcolor= new Array(255,255,255); // start color (red, green, blue)
var endcolor=new Array(125,36,80); // end color (red, green, blue)

var fcontent=new Array();
begintag='<div style="font: 12px Arial; padding: 5px; text-align: center">'; //set opening tag, such as font declarations
fcontent[0]="<strong>New Patients Always Welcome!</strong><br /><br />Contact our office to make an appointment today!";
fcontent[1]="<strong>Health Care<br />Financing Options</strong><br /><br />We can help you establish a financing plan that suits you.";
fcontent[2]="<strong>Gift Certificates Available</strong><br /><br />Buy a gift certificate for one of our most popular dental services!";
fcontent[3]="<strong>Free <br />Consultations</strong><br /><br />We offer free cosmetic dental consultations.";
fcontent[4]="<strong>Enhance Your <br />Smile Today!</strong><br /><br />Ask us about One-Hour Teeth Whitening.";
closetag='</div>';

var fwidth='149px'; //set scroller width
var fheight='105px'; //set scroller height

var fadelinks=1;  //should links inside scroller content also fade like text? 0 for no, 1 for yes.

///No need to edit below this line/////////////////
var ie4=document.all&&!document.getElementById;
var DOM2=document.getElementById;
var faderdelay=0;
var index=0;

function setDate() {
var ampm;
var d=new Date()
var weekday=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var monthname=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
var h=d.getHours();
var m=d.getMinutes();
if (h>=13 && h<=24){
h=h-12;
}
if (h>=12 && h<=24) {
ampm="pm";
}
else
{
ampm="am";
}
if (m<10) {
m=m+"0";
}
	document.write("&nbsp;&nbsp"+weekday[d.getDay()] + " ")
    document.write(monthname[d.getMonth()] + " ") 
    document.write(d.getDate() + ", ") //get the number day
    document.write(d.getFullYear())
}
function setTime() {
var ampm;
var d=new Date()
var h=d.getHours();
var m=d.getMinutes();
if (h>=13 && h<=24){
h=h-12;
}
if (h>=12 && h<=24) {
ampm="pm";
}
else
{
ampm="am";
}
if (m<10) {
m=m+"0";
}
	document.write("&nbsp;&nbsp;"+h+":"+m+" "+ampm);
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function openNewWindow(URLtoOpen,windowName,windowFeatures) { //for Flash
newWindow=window.open(URLtoOpen,windowName,windowFeatures); 
}
function newWindow (URL){
window.opener.location.href=URL // change href of parent window
window.opener.focus(); // set focus to parent window, the "window.opener"
this.window.close(); // close the terms window 
}
function checkAppointment(){ // checks to make sure text box and agree box are checked
if (document.appointment.Name.value == "" || document.appointment.Phone.value == "")
{
alert('Please enter both your name and phone number. Thank You.');
return false; // if the box and text are not entered, don't continue with form mail
}
var WeekDay;
WeekDay="";
if (appointment.Day1.checked)WeekDay+=" Monday ";
if (appointment.Day2.checked)WeekDay+=" Tuesday ";
if (appointment.Day3.checked)WeekDay+=" Wednesday ";
if (appointment.Day4.checked)WeekDay+=" Thursday ";
if (WeekDay!="")
{
appointment.WeekDay.value=WeekDay;
}
var DayTime;
DayTime="";
if (appointment.Time1.checked)DayTime+=" Morning ";
if (appointment.Time2.checked)DayTime+=" Afternoon ";
if (DayTime!="")
{
appointment.DayTime.value=DayTime;
}
}
function checkQuestion(){
if (questionform.name.value == "")
{
	alert("Please provide your name.  Thank You");
	questionform.name.focus();
	return false;
}
else if (questionform.comments.value == "")
{
	alert("Please include your comment.  Thank You.");
	questionform.comments.focus();
	return false;
}
else if ((questionform.Status[0].checked == false) && (questionform.Status[1].checked == false))
{
	alert("Please let us know if you're an existing patient");
	return false;
}
else if ((questionform.contact[1].checked == true) && (questionform.phone.value == ""))
{
	alert("Please provide your phone number so we may contact you.  Thank You.");
	questionform.phone.focus();
	return false;
}
else if ((questionform.contact[0].checked == true) && (questionform.email.value == ""))
{
	alert("Please provide your E-mail address so we may contact you.  Thank You.");
	questionform.email.focus();
	return false;
}
}