// JavaScript Document
//FOR CLIENTS MAP PAGE
function ShowHide(field1, field2,show) { 
document.getElementById(field1).style.display = show ? 'block' : 'block'; 
document.getElementById(field2).style.display = show ? 'block' : 'none'; 
} 
 

function ShowHide2(field1, field2,show) { 
document.getElementById(field1).style.display = show ? 'none' : 'block'; 
document.getElementById(field2).style.display = show ? 'none' : 'block'; 
} 

/*<![CDATA[*/
function Select(sel,id,nu){
 document.getElementById(id).style.display=sel.selectedIndex==nu?'block':'none';
}
/*]]>*/

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



//FOR INDEX SLIDESHOW
$(document).ready(function() {
    $('.slideshow').cycle({
		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});
});

//FOR INDEX SLIDESHOW
//nav javascript (for numbers)

$(function() {
    $('#slideshow').cycle({
        speed:       800,
        timeout:     4000,
        pager:      '#nav',
        pagerEvent: 'mouseover',
		pauseOnPagerHover: true
    });
});

//FORM VALIDATION

	function validate() {
	
		if (document.form1.zipcode.value.length < 1) {
			window.alert("Please enter your zip code.");
			//form.zipcode.focus(); 
			return false;
		}
		if (document.form1.country.selectedIndex == 0 ){
        	window.alert("Please enter your country.");
			//form.country.focus(); 
        	return false;
   	    }
		if (document.form1.cardname.selectedIndex == 0 ){
        	window.alert("Please select the type of credit card.");
			//form.cardname.focus(); 
        	return false;
   	    }
		if (document.form1.cardno.value.length < 1) {
			window.alert("Please enter your credit card number.");
			//form.cardno.focus(); 
			return false;
		}
		if (document.form1.securitycode.value.length < 1) {
			window.alert("Please enter your credit card security code.");
			//form.securitycode.focus(); 
			return false;
		}
		if (document.form1.cardexpmonth.selectedIndex == 0 ){
        	window.alert("Please enter your credit card expiration month.");
			//form.cardexpmonth.focus(); 
        	return false;
   	    }
		if (document.form1.cardexpyear.selectedIndex == 0 ){
        	window.alert("Please enter your credit card expiration year.");
			//form.cardexpyear.focus(); 
        	return false;
   	    }
		if (document.form1.cardlname.value.length < 1) {
			window.alert("Please enter the first name on your credit card.");
			//form.cardlname.focus(); 
			return false;
		}
		if (document.form1.cardlname.value.length < 1) {
			window.alert("Please enter the last name on your credit card.");
			//form.cardlname.focus(); 
			return false;
		}
		if (document.form1.cardaddress.value.length < 1) {
			window.alert("Please enter your credit card billing address.");
			//form.cardaddress.focus(); 
			return false;
		}
		if (document.form1.cardzip.value.length < 1) {
			window.alert("Please enter your credit card billing zip code.");
			//form.cardzip.focus(); 
			return false;
		}
			if (document.form1.recipientfirstname.value.length < 1) {
			window.alert("Please enter the recipient's first name.");
			//form.cardzip.focus(); 
			return false;
		}
			if (document.form1.recipientlastname.value.length < 1) {
			window.alert("Please enter the recipient's last name.");
			//form.cardzip.focus(); 
			return false;
		}
			if (document.form1.recipientemail.value.length < 1) {
			window.alert("Please enter the recipient's email address.");
			////form.cardzip.focus(); 
			return false;
		}
			
		
		return true;
	}

function validate() {
	
			if (document.form2.email.value.length < 1) {
			window.alert("Please enter the recipient's email address."); 
			return false;
		}
			
		
		return true;
	}
	
	
	function validate() {
		
			if (document.form3.session.selectedIndex == 0 ){
        	window.alert("Please enter the training session you would like to attend.");
			//form.country.focus(); 
        	return false;
   	    }
			if (document.form3.first_name.value.length < 1) {
			window.alert("Please enter your First Name.");
			//form.cardlname.focus(); 
			return false;
		}
		if (document.form3.last_name.value.length < 1) {
			window.alert("Please enter your Last Name.");
			//form.cardlname.focus(); 
			return false;
		}
		if (document.form3.program_name.value.length < 1) {
			window.alert("Please enter your Program Name.");
			//form.cardlname.focus(); 
			return false;
		}
		if (document.form3.university_name.value.length < 1) {
			window.alert("Please enter your University Name.");
			//form.cardlname.focus(); 
			return false;
		}
		if (document.form3.email.value.length < 1) {
			window.alert("Please enter your Email.");
			//form.cardlname.focus(); 
			return false;
		}
		if (document.form3.telephone.value.length < 1) {
			window.alert("Please enter your Phone Number.");
			//form.cardlname.focus(); 
			return false;
		}
	
		
		return true;
	}





