// JavaScript Document

    function chckpw(p2) {
       if(document.getElementById('password').value != document.getElementById('password2').value) {;
       	alert("The passwords you entered do not match. Please retype your desired passwords.");
		document.getElementById('password').value="";
		document.getElementById('password2').value="";
		document.getElementById('password').style.backgroundColor="#FF0";
		document.getElementById('password2').style.backgroundColor="#FF0";
		document.getElementById('password').focus();
	   }
    }
	
	function chckem(p2) {
       if(document.getElementById('email').value != document.getElementById('email2').value) {;
       	alert("Please re-type your email addresses to ensure they match. These fields are case sensitive.");
		
		document.getElementById('email2').value="";
		
		document.getElementById('email2').style.backgroundColor="#F00";
		document.getElementById('email2').style.color="#FFF"
		//document.getElementById('email2').focus();
	   }
    }
	
	function loadreg() {
       
		document.getElementById('cdist').style.backgroundColor="#FF0";
		document.getElementById('ssize').style.backgroundColor="#FF0";
		//document.getElementById('DPC_dat_MM/DD/YYYY').style.backgroundColor="#FF0";

    }
	
	function toggle_visibility(id) {
       var e = document.getElementById(id);
       if(e.style.display == 'block')
          e.style.display = 'none';
       else
          e.style.display = 'block';
    }

	function swapon(obj,val) {
		
		if(val=="on") {
			document.getElementById(obj).style.backgroundImage='url(images/button3.gif)';
		} else {
			document.getElementById(obj).style.backgroundImage='url(images/button2.gif)';
		}
	}
	
	function checkprepaid(thisform) {
		//alert("Please Note: After completing your payment through PayPal, you must click the 'Return to Mile Club Challenge' link to return here and complete your registration!");
		with (thisform)
		  {
		  if (validate_coupon(discount_amount)==true)
			{return true;}
		  }
	}
	
	function validate_coupon(field)
	{
	with (field)
	  {
	  val=value;
	  if (val=="20.00")
		{document.getElementById("registration").action="mc_reg.asp";return true;}
	  else {return true;}
	  }
	}
	
/*===========================================================
Script:   JavaScript Cross-Browser SlideShow Script
          With Cross-Fade Effect between Images
          Adjustable Timing and Unlimited Images
Function: Displays images continuously in a slideshow
          presentation format, with a fade effect on
          image transitions.
Browsers: All common browsers: NS3-6, IE 4-6
          Fade effect only in IE; others degrade gracefully
Author:   etLux
===========================================================*/


// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully

// =======================================
// set the following variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 4000

// Duration of crossfade (seconds)
var crossFadeDuration = 4

// Specify the image files
var Pic = new Array() // don't touch this
// to add more images, just continue
// the pattern, adding to the array below

Pic[0] = 'images/treadmill.jpg'
Pic[1] = 'images/swimmer.jpg'
Pic[2] = 'images/machine.jpg'
Pic[3] = 'images/class.jpg'
Pic[4] = 'images/bike_girls.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)
}
