﻿// JScript File

function mmLoadMenus() {
  if (window.mm_menu_0116211423_0) return;
      window.mm_menu_0116211423_0 = new Menu("root",90,18,"Verdana, Arial, Helvetica, sans-serif",12,"#000000","#FFFFFF","#CCCCCC","#000099","center","middle",3,0,1000,-5,7,true,true,true,0,false,true);
  mm_menu_0116211423_0.addMenuItem("Practitioners","location='http://www.fenziansport.com/pra_testimonial.html'");
  mm_menu_0116211423_0.addMenuItem("Athletes","location='http://www.fenziansport.com/ath_testimonial.html'");
   mm_menu_0116211423_0.hideOnMouseOut=true;
   mm_menu_0116211423_0.bgColor='#333333';
   mm_menu_0116211423_0.menuBorder=1;
   mm_menu_0116211423_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0116211423_0.menuBorderBgColor='#666666';

mm_menu_0116211423_0.writeMenus();
} // mmLoadMenus()

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_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_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];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function validateContactForm(form) {
    var fv = new FormValidator();
    
    fv.addValidator(new TextValidator('name','Your name is required'));
    fv.addValidator(new EmailValidator('email','E-mail address is required', 'Invalid e-mail address'));
    fv.addValidator(new TextValidator('phone','Phone number is required'));
    fv.addValidator(new TextValidator('subject','Subject is required'));
    fv.addValidator(new TextValidator('comment','Message is required'));
    
    return fv.validate();
}

function validatePractitionerSearchForm(form) {
    var zipCode = new TextValidator('zipcode', '');
    var state = new TextValidator('state', '');
    
    if(zipCode.isValid() || state.isValid()) {
        return true;
    }
    
    alert('Please enter zip code or state');
    return false;
}

function validateInfoForm(form){
    var fv = new FormValidator();
    
    fv.addValidator(new TextValidator('fName', 'Your first name is required'));
    fv.addValidator(new TextValidator('lName', 'Your last name is required'));
    fv.addValidator(new TextValidator('email', 'Your email address is required'));
    fv.addValidator(new TextValidator('phone', 'Your phone number is required'));
    fv.addValidator(new TextValidator('address', 'Your address is required'));
    fv.addValidator(new TextValidator('city', 'Your city is required'));
    fv.addValidator(new TextValidator('state', 'Your state is required'));
    fv.addValidator(new TextValidator('zip', 'Your zip code is required'));
    
    return fv.validate();
}


function getObj(name) {
  		if (document.getElementById)
  		{
      			return document.getElementById(name);
  		}
  		else if (document.all)
  		{
        		return document.all[name];
  		}
  		else if (document.layers)
  		{
       			return document.layers[name];
  		}
}

function toggleTextBody(obj){

    var div = getObj("div_" + obj.id);
    var tempSrc = obj.name;
    obj.name = obj.src;
    obj.src = tempSrc;
    
    if(div.style.display == "none"){
        div.style.display = "block";
    }
    else{
        div.style.display = "none"
    }
    

}




function openPres(){
	
  	window.open("../flash/slideshow.html","show", "scrollbars=yes,width=640,height=530");

}

function overImage(imgObj){
			if(imgObj.src.indexOf("-selected") > 0 ){
				
				

			}

			else{
				
				var arrayX = imgObj.src.split("_");
				imgObj.src = arrayX[0] + "-over_" + arrayX[1];
				
				

			}
			
		}

		function outImage(imgObj){

			if(imgObj.alt != "" ){
				
				var arrayX = imgObj.src.split("-over");
				imgObj.src = arrayX[0] + arrayX[1];
				

			}

			else{
				

			}
			

		}
		
		
/* registrationForm.aspx */



	function checkTextInput(inputObj, errorMessage){

		if(inputObj.value.length < 2){
			alert(errorMessage);
			inputObj.focus();
			return false;
		}

	}

	function validateOtherState(oSrc, args) {
		var selectControl;
		alert("inside validateotherstate");
		if(oSrc.name == "otherState") {
			selectControl = document.registrationForm.stateID;
			
			if(selectControl.options[selectControl.selectedIndex].value == -1
				&& (document.registrationForm.otherState.value == null || 
					document.registrationForm.otherState.value.length == undefined ||
					document.registrationForm.otherState.value.length <= 0)) {
				
				args.IsValid = false;
			} else {
				args.IsValid = true;
			}
		} else {
			selectControl = document.registrationForm.ccStateID;
		}
		
		
	}

	function checkAll() {

		if(!checkTextInput(document.registrationForm.firstName, "Missing First Name")){

			return false;
		}
	}
	
	function enableDisableControl(selectControl, type) {
		if(type == "cc") {
			if(selectControl.options[selectControl.selectedIndex].value == -1) {
				document.registrationForm.ccOtherState.enabled = true;
				document.registrationForm.ccOtherCountry.enabled = true;
			} else {
				document.registrationForm.ccOtherState.enabled = false;
				document.registrationForm.ccOtherCountry.enabled = false;
			}
			
			//alert(selectControl.options[selectControl.selectedIndex].value);
		} else {
			if(selectControl.options[selectControl.selectedIndex].value == -1) {
				document.registrationForm.otherState.enabled = true;
				document.registrationForm.otherCountry.enabled = true;
			} else {
				document.registrationForm.otherState.enabled = false;
				document.registrationForm.otherCountry.enabled = false;
			}

			//alert(selectControl.options[selectControl.selectedIndex].value);
		}
	}

function checkTextInput(inputObj, errorMessage){

		if(inputObj.value.length < 2){
			alert(errorMessage);
			inputObj.focus();
			return false;
		}

	}