var ids_es=new Array('es1','es2','es3', 'es4', 'es5');
var es_main='es0';

function switchid_es(id_es){
	hideallids_es();
	showdiv_es(id_es);
}

function hideallids_es(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids_es.length;i++){
		hidediv_es(ids_es[i]);
	}
}

function hidediv_es(id_es) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(es_main).style.display = 'none';
		document.getElementById(id_es).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.es_main.display = 'none';
			document.id_es.display = 'none';
		}
		else { // IE 4
			document.all.es_main.style.display = 'none';
			document.all.id_es.style.display = 'none';
		}
	}
}

function showdiv_es(id_es) {
	//safe function to show an element with a specified id

	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id_es).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id_es.display = 'block';
		}
		else { // IE 4
			document.all.id_es.style.display = 'block';
		}
	}
}

function Form_Validate(theContactForm)
{
  if (theContactForm.Name.value == "")
  {
    alert("Please enter a value in the \"Name\" field.");
    theContactForm.Name.focus();
    return (false);
  }


  if (theContactForm.email.value == "")
  {
     alert("Please enter a value in the \"E-Mail\" field.");
     theContactForm.email.focus();
     return (false);
  }

  if (theContactForm.Email2.value == "")
  {
     alert("Please enter a value in the \"Confirm E-Mail\" field.");
     theContactForm.Email2.focus();
     return (false);
  }

  if (!(theContactForm.Contact[0].checked || theContactForm.Contact[1].checked))
  {
     alert("Please select an option for \"Best Way To Reach You\" field.");
     theContactForm.Contact[0].focus();
     return (false);
  }

  if (theContactForm.Comments_Questions.value == "")
  {
      alert("Please enter a value in the \"Questions\/Comments\" field.");
      theContactForm.Comments_Questions.focus();
      return (false);
  }

  if (theContactForm.email.value != theContactForm.Email2.value)
  {
    alert("Your E-mail Addresses do not match. Please re-enter your E-mail Address in both fields.");
    theContactForm.email.focus();
    return (false);
  }

  return (true);
}

function checkPopUp(page){
var w = 350; <!--window width-->
var h = 400; <!--window height-->
var winl = (screen.width - w)/2;
var wint = (screen.height - h)/2;
var option = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+w+",height="+h+",top="+wint+",left="+winl;
window.open(page,'',option);
}

function popCal(url,fname)
{
  url +="?df="+fname;
  popWin(url,150,150);
}
function popWin(url,w2,h2)
{
 var winl2 = (screen.width - w2)/2;
 var wint2 = (screen.height - h2)/2;
 var option2 = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width="+w2+",height="+h2+",top="+wint2+",left="+winl2;
 var win = window.open(url,"Pop", option2);
 win.focus();
}

function photopopup(page){
var w = 625; <!--window width-->
var h = 475; <!--window height-->
var winl = (screen.width - w)/2;
var wint = (screen.height - h)/2;
var option = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+w+",height="+h+",top="+wint+",left="+winl;
window.open(page,'',option);
}

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000;
// Duration of crossfade (seconds)
var crossFadeDuration = 3;
// Specify the image files
var Pic = new Array();

// to add more images, just continue
// the pattern, adding to the array below

Pic[0] = 'photos/slideshow1.jpg'
Pic[1] = 'photos/slideshow2.jpg'
Pic[2] = 'photos/slideshow3.jpg'
Pic[3] = 'photos/slideshow4.jpg'
Pic[4] = 'photos/slideshow5.jpg'
Pic[5] = 'photos/slideshow6.jpg'
Pic[6] = 'photos/slideshow7.jpg'
Pic[7] = 'photos/slideshow8.jpg'
Pic[8] = 'photos/slideshow9.jpg'
Pic[9] = 'photos/slideshow10.jpg'
Pic[10] = 'photos/slideshow11.jpg'
Pic[11] = 'photos/slideshow12.jpg'


// do not edit anything below this line
var t;
var j = 0;
var p = Pic.length;
var preLoad = new Array();

for (i = 0; i < p; i++) {
preLoad[i] = new Image();
preLoad[i].src = Pic[i];
}

function runSlideShow() {
if (document.all) {
document.images.SlideShow.style.filter="blendTrans(duration=2)";
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
document.images.SlideShow.filters.blendTrans.Apply();
}

document.images.SlideShow.src = preLoad[j].src;

if (document.all) {
document.images.SlideShow.filters.blendTrans.Play();

}
j = j + 1;
if (j > (p - 1)) j = 0;
t = setTimeout('runSlideShow()', slideShowSpeed);
}