

<!-- Yahoo! Inc.
var ysm_accountid  = "1VIMF0LMLRFKS62C7JO8GJ1TFTO";
document.write("<SCR" + "IPT language='JavaScript' type='text/javascript' " 
+ "SRC=//" + "srv1.wa.marketingsolutions.yahoo.com" + "/script/ScriptServlet" + "?aid=" + ysm_accountid 
+ "></SCR" + "IPT>");
// -->
	
//Checks form on Admin Menus
function CheckMenu(){
	var display = "The following fields are required:\n"
	var failed=false					
		if (failed==true){
		alert(display)
		return(false)
	}
	else {
		document.getElementById("inpContent").value = oEdit1.getHTMLBody();
		document.getElementById("MenuSubmit").disabled = true
	return(true)
}


	}

//Checks form on admin/useradmin/
function CheckHof(){
	var display = "The following fields are required:\n"
	var failed=false	
			
		if (document.form1.FirstName.value=='') {
	  	display = display + "First Name\n"
	 	 failed=true	
		}
		
			if (document.form1.LastInitial.value=='') {
	  	display = display + "Last Name\n"
	 	 failed=true	
		}
		
			if (document.form1.title.value=='') {
	  	display = display + "Story Title\n"
	 	 failed=true	
		}
		
			if (document.form1.terms.checked == false) {
	  	display = display + "You must agree to the terms of use.\n"
	 	 failed=true	
		}
		
		//if (document.form1.BeforePic.value=='') {
	  	//display = display + "A Before Photo\n"
	 	 //failed=true	
		//}
		
		//if (document.form1.afterpic.value=='') {
	  	//display = display + "An After Photo\n"
	 	 //failed=true	
		//}
		
				
				
		if (failed==true){
		alert(display)
		return(false)
	}
	else {
		document.getElementById("inpContent").value = oEdit1.getHTMLBody();
		document.getElementById("hofsubmit").disabled = true
	return(true)
}


	}
	
	
	
	//Checks form on emailhalloffame.asp
function CheckHOFemail(){
	var display = "The following fields are required:\n"
	var failed=false	
			
		if (document.formemail.SenderName.value=='') {
	  	display = display + "Your Name\n"
	 	 failed=true	
		}
		
			if (document.formemail.SenderEmail.value=='') {
	  	display = display + "Your Email\n"
	 	 failed=true	
		}
		
			if (document.formemail.FriendName.value=='') {
	  	display = display + "Your Friends Name\n"
	 	 failed=true	
		}
		
		if (document.formemail.FriendEmail.value=='') {
	  	display = display + "Your Friends Email\n"
	 	 failed=true	
		}
		
		if (document.formemail.comments.value=='') {
	  	display = display + "Email Body\n"
	 	 failed=true	
		}
		
				
				
		if (failed==true){
		alert(display)
		return(false)
	}
	else {
		
	return(true)
}


	}
	
	


//***** does the math on the weight loss adminform1.asp
 function FigureWeight(currentWeight,StartWeight) {
	if (currentWeight != '' &&  StartWeight != '') {
		if (currentWeight < StartWeight) {
			var TotalLost = StartWeight - currentWeight
				//alert(TotalLost)
				document.form1.WeightLost.value = ''
				document.form1.WeightLost.value = TotalLost

		}
		
		
	}


}







//********* Open Calendar.aspx page
function OpenCal() {
	document.form1.datebx.blur()
	calendar_window = window.open('cal.aspx','calendar_window','width=265,height=190');
	calendar_window.focus()
	
}


function popcaltest(vCaption, vField, vDate){
	//form1.vField.blur()
	var nW = window.open("", "calendar", "resizable=no,scrollbars=no,width=300,height=320");
	nW.location.href = "popcalendar.asp?caption=" + escape(vCaption) + "&field=" + vField + "&date=" + vDate;
	nW = null;
}

//image swaps
	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_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 CheckGCOrder1()
	{
	var tmpValid = "0"
		if (isWhitespace(document.form1.RecipientFirstName.value))
				{
				alert("Please Enter The Recipients first Name")
				document.form1.RecipientFirstName.focus();
				tmpValid++
				}
				
		else if (isWhitespace(document.form1.RecipientLastName.value))
				{
				alert("Please Enter The Recipients Last Name")
				document.form1.RecipientLastName.focus();
				tmpValid++
				}
		
		else if (isWhitespace(document.form1.RecipientAddress1.value))
				{
				alert("Please Enter The Recipients Address")
				document.form1.RecipientAddress1.focus();
				tmpValid++
				}
				
		else if (isWhitespace(document.form1.RecipientCity.value))
				{
				alert("Please Enter The Recipients City")
				document.form1.RecipientCity.focus();
				tmpValid++
				}
		else if (isWhitespace(document.form1.RecipientState.value))
				{
				alert("Please Enter The Recipients State")
				document.form1.RecipientState.focus();
				tmpValid++
				}
		else if (isWhitespace(document.form1.RecipientZip.value))
				{
				alert("Please Enter The Recipients Zip Code")
				document.form1.RecipientZip.focus();
				tmpValid++
				}
		else if (isWhitespace(document.form1.RecipientPhone.value))
				{
				alert("Please Enter The Recipients Phone")
				document.form1.RecipientPhone.focus();
				tmpValid++
				}				
		
		
		else if (isWhitespace(document.form1.FirstName.value))
				{
				alert("Please Enter Your First Name")
				document.form1.FirstName.focus();
				tmpValid++
				}
				
		else if (isWhitespace(document.form1.LastName.value))
				{
				alert("Please Enter Your Last Name")
				document.form1.LastName.focus();
				tmpValid++
				}
		
		else if (isWhitespace(document.form1.Address1.value))
				{
				alert("Please Enter Your Address")
				document.form1.Address1.focus();
				tmpValid++
				}
				
		else if (isWhitespace(document.form1.City.value))
				{
				alert("Please Enter Your City")
				document.form1.City.focus();
				tmpValid++
				}
		else if (isWhitespace(document.form1.State.value))
				{
				alert("Please Enter Your State")
				document.form1.State.focus();
				tmpValid++
				}
		else if (isWhitespace(document.form1.Zip.value))
				{
				alert("Please Enter Your Zip Code")
				document.form1.Zip.focus();
				tmpValid++
				}
		else if (isWhitespace(document.form1.Phone.value))
				{
				alert("Please Enter your Phone")
				document.form1.Phone.focus();
				tmpValid++
				}				
				
				
		else if (!(isEmail(document.form1.Email.value)))
				{
				alert("Please Enter a valid Email Address For Yourself")
				document.form1.Email.focus();
				tmpValid++
				}
				
				
			if (tmpValid == "0") {
				//document.getElementById("inpContent").value = oEdit1.getHTMLBody();
				return (true);
			}
			
			else {
				
				return (false)
				}
		}
		
///////////////////////////////////////////////////////

function CheckGCUpdate()
	{
	var tmpValid = "0"
		if (isWhitespace(document.form1.RecipientFirstName.value))
				{
				alert("Please Enter The Recipients first Name")
				document.form1.RecipientFirstName.focus();
				tmpValid++
				}
				
		else if (isWhitespace(document.form1.RecipientLastName.value))
				{
				alert("Please Enter The Recipients Last Name")
				document.form1.RecipientLastName.focus();
				tmpValid++
				}
		
		else if (isWhitespace(document.form1.RecipientAddress1.value))
				{
				alert("Please Enter The Recipients Address")
				document.form1.RecipientAddress1.focus();
				tmpValid++
				}
				
		else if (isWhitespace(document.form1.RecipientCity.value))
				{
				alert("Please Enter The Recipients City")
				document.form1.RecipientCity.focus();
				tmpValid++
				}
		else if (isWhitespace(document.form1.RecipientState.value))
				{
				alert("Please Enter The Recipients State")
				document.form1.RecipientState.focus();
				tmpValid++
				}
		else if (isWhitespace(document.form1.RecipientZip.value))
				{
				alert("Please Enter The Recipients Zip Code")
				document.form1.RecipientZip.focus();
				tmpValid++
				}
		else if (isWhitespace(document.form1.RecipientPhone.value))
				{
				alert("Please Enter The Recipients Phone")
				document.form1.RecipientPhone.focus();
				tmpValid++
				}				
		
		
		else if (isWhitespace(document.form1.FirstName.value))
				{
				alert("Please Enter Your First Name")
				document.form1.FirstName.focus();
				tmpValid++
				}
				
		else if (isWhitespace(document.form1.LastName.value))
				{
				alert("Please Enter Your Last Name")
				document.form1.LastName.focus();
				tmpValid++
				}
		
		else if (isWhitespace(document.form1.Address1.value))
				{
				alert("Please Enter Your Address")
				document.form1.Address1.focus();
				tmpValid++
				}
				
		else if (isWhitespace(document.form1.City.value))
				{
				alert("Please Enter Your City")
				document.form1.City.focus();
				tmpValid++
				}
		else if (isWhitespace(document.form1.State.value))
				{
				alert("Please Enter Your State")
				document.form1.State.focus();
				tmpValid++
				}
		else if (isWhitespace(document.form1.Zip.value))
				{
				alert("Please Enter Your Zip Code")
				document.form1.Zip.focus();
				tmpValid++
				}
		else if (isWhitespace(document.form1.Phone.value))
				{
				alert("Please Enter your Phone")
				document.form1.Phone.focus();
				tmpValid++
				}				
				
				
		else if (!(isEmail(document.form1.Email.value)))
				{
				alert("Please Enter a valid Email Address For Yourself")
				document.form1.Email.focus();
				tmpValid++
				}
		
		else if (isWhitespace(document.form1.code.value))
				{
				alert("Please Enter a Certificate Code")
				document.form1.code.focus();
				tmpValid++
				}
				
		else if ((document.form1.used.checked == true) && (isWhitespace(document.form1.useddate.value)))
			{
				alert("You have indicated that this cerificate has been redeemed. \n Please indicate the date of use")
				document.form1.code.focus();
				tmpValid++
			}
				
				
			if (tmpValid == "0") {
				//document.getElementById("inpContent").value = oEdit1.getHTMLBody();
				return (true);
			}
			
			else {
				
				return (false)
				}
		}
		
			///////////////////////////////////////////////////////////////////
//this function opens and center a window
	function winBRopen(theURL, Name, popW, popH, scroll, resize) { // V 1.0
	var winleft = (screen.width - popW) / 2;
	var winUp = (screen.height - popH) / 2;
	winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+',resizable='+resize+'';
	Win = window.open(theURL, Name, winProp);
	Win.window.focus();
}
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
function checkEstoreQuantity(eleID,elelabel) {
    //clear all error notes
			tmpValid = "0"
			//document.getElementById("Title_Label").innerHTML = ""
			//document.getElementById("Price_Label").innerHTML = ""
			document.getElementById(elelabel).innerHTML = ""
			
		  if (isWhitespace(document.getElementById(eleID).value) || !(isInteger(document.getElementById(eleID).value)) )
				{
					document.getElementById(elelabel).innerHTML = " * Valid Number Required"
					
				tmpValid++
			
				}  
	    
		   
		 //if ( !(isWhitespace(document.getElementById("EventContactEmail").value)) && !(isEmail(document.getElementById("EventContactEmail").value)) )	
		 
				
        
				
    if (tmpValid == "0") {
			
			//document.getElementById("Main_Label").innerHTML = "<span style='font-family:Verdana; font-size=12px; color=CC0000'><b>Please be patient, this may take a minute...</b></span>"
			//document.getElementById("submitbutton").disabled = true
			//document.getElementById("inpContent").value = oEdit1.getHTMLBody();
			return (true);
		}
			
		else {
			//document.getElementById("Main_Label").innerHTML = "<span style='font-family:Verdana; font-size=12px; color=CC0000'><b>Required fields are missing, please correct the marked fields before continuing</b></span><BR><BR>"
			return (false)
			}

}

//////////////////////////////////////////////////////////
function updateItem(cartid,cartsession,quantity,elelabel)
{
    tmpValid = "0"
    document.getElementById(elelabel).innerHTML = ""

  if (isWhitespace(document.getElementById(quantity).value) || !(isInteger(document.getElementById(quantity).value)) || (document.getElementById(quantity).value <=0 ))
				{
					document.getElementById(elelabel).innerHTML = " <br /><b>* Invalid Quantity</b>"
					
				tmpValid++
			
				}  
 if (tmpValid == "0") {
			var qcount = document.getElementById(quantity).value
			location.href="updatefullcart.asp?item=" + cartid + "&cart=" + cartsession + "&count=" + qcount ;
		}
			
		else {
			//document.getElementById("Main_Label").innerHTML = "<span style='font-family:Verdana; font-size=12px; color=CC0000'><b>Required fields are missing, please correct the marked fields before continuing</b></span><BR><BR>"
			return (false)
			}



}

//////////////////////////////////////////////////////////
function CheckCartSubmit()
{
    tmpValid = "0"
    IsBillingValid = "1"
    document.getElementById("Label_Shipping_Firstname").innerHTML = ""
    document.getElementById("Label_Shipping_Lastname").innerHTML = ""
    document.getElementById("Label_Shipping_Phone").innerHTML = ""
    document.getElementById("Label_Shipping_Email").innerHTML = ""
    document.getElementById("Label_Shipping_Address1").innerHTML = ""
    document.getElementById("Label_Shipping_City").innerHTML = ""
    document.getElementById("Label_Shipping_State").innerHTML = ""
    document.getElementById("Label_Shipping_Zip").innerHTML = ""
   // document.getElementById("Label_ccnum").innerHTML = ""
     //document.getElementById("Scode_Label").innerHTML = ""

  if (isWhitespace(document.getElementById("Shipping_Firstname").value) )
				{
					document.getElementById("Label_Shipping_Firstname").innerHTML = " * Required"
					
				tmpValid++
			
				} 
				
   if (isWhitespace(document.getElementById("Shipping_Lastname").value) ) 
				{
					document.getElementById("Label_Shipping_Lastname").innerHTML = " * Required"
					
				tmpValid++
			
				} 
	
	if (isWhitespace(document.getElementById("Shipping_Phone").value) ) 
				{
					document.getElementById("Label_Shipping_Phone").innerHTML = " * Required"
					
				tmpValid++
			
				} 
	
	if (!(isEmail(document.getElementById("Shipping_Email").value)) ) 
				{
					document.getElementById("Label_Shipping_Email").innerHTML = " * Required"
					
				tmpValid++
			
				} 
    
    if (isWhitespace(document.getElementById("Shipping_Address1").value) ) 
				{
					document.getElementById("Label_Shipping_Address1").innerHTML = " * Required"
					
				tmpValid++
			
				}
	
	if (isWhitespace(document.getElementById("Shipping_City").value) ) 
				{
					document.getElementById("Label_Shipping_City").innerHTML = " ** &nbsp; "
					
				tmpValid++
			
				}
	
	/*if (isWhitespace(document.getElementById("Shipping_State").value) ) 
				{
					document.getElementById("Label_Shipping_State").innerHTML = " ** &nbsp; "
					
				tmpValid++
			
				}
	*/
	if (isWhitespace(document.getElementById("Shipping_Zip").value) ) 
				{
					document.getElementById("Label_Shipping_Zip").innerHTML = " ** &nbsp; "
					
				tmpValid++
			
				}
				
/*	if (isWhitespace(document.getElementById("ccnum").value) ) 
				{
					document.getElementById("Label_ccnum").innerHTML = " * Required "
					
				tmpValid++
			
				}
    
    if (isWhitespace(document.getElementById("SCode").value) ) 
				{
					document.getElementById("Scode_Label").innerHTML = " * Required "
					
				tmpValid++
			
				}
				*/
				
	//CHECK BILLING INFO
	
	if (!(document.getElementById("SetBilling").checked) && isWhitespace(document.getElementById("Billing_Firstname").value) )
	    {
	    IsBillingValid = "0"
	    }
    
    if (!(document.getElementById("SetBilling").checked) && isWhitespace(document.getElementById("Billing_Lasttname").value) )
	    {
	    IsBillingValid = "0"
	    }
	    
	if (!(document.getElementById("SetBilling").checked) && isWhitespace(document.getElementById("Billing_Address1").value) )
	    {
	    IsBillingValid = "0"
	    }
	    
    if (!(document.getElementById("SetBilling").checked) && isWhitespace(document.getElementById("Billing_Address2").value) )
	    {
	    IsBillingValid = "0"
	    }
	
	if (!(document.getElementById("SetBilling").checked) && isWhitespace(document.getElementById("Billing_City").value) )
	    {
	    IsBillingValid = "0"
	    }
	
	//if (!(document.getElementById("SetBilling").checked) && isWhitespace(document.getElementById("Billing_State").value) )
	  //  {
	    //IsBillingValid = "0"
	    //}
	
	if (!(document.getElementById("SetBilling").checked) && isWhitespace(document.getElementById("Billing_Zip").value) )
	    {
	    IsBillingValid = "0"
	    }
	
				
				
				
if ((tmpValid == "0") && (IsBillingValid == "1")) {
			
			//document.getElementById("Main_Label").innerHTML = "<span style='font-family:Verdana; font-size=12px; color=CC0000'><b>Please be patient, this may take a minute...</b></span>"
			//document.getElementById("submitbutton").disabled = true
			//document.getElementById("inpContent").value = oEdit1.getHTMLBody();
			return (true);
		}
			
		else {
			document.getElementById("Main_Label").innerHTML = "<span style='font-family:Verdana; font-size=12px; color=CC0000'><b>Required fields are missing, please correct the marked fields before continuing</b></span><BR><BR>"
	          
	            if (IsBillingValid == "0")
	                {
	                    document.getElementById("Billing_Main_Label").innerHTML = "<span style='font-family:Verdana; font-size=12px; color=CC0000'><b>** All billing fields are required</b></span><BR><BR>"
	                 }
			return (false)
			}



}

function CheckFieldLength(fn,wn,rn,mc) {
  var len = fn.value.length;
  if (len > mc) {
    fn.value = fn.value.substring(0,mc);
    len = mc;
  }
  document.getElementById(wn).innerHTML = len;
  document.getElementById(rn).innerHTML = mc - len;
}


////////////////////////
function CheckSlimDown2010()
{
        tmpValid = "0"
       var ErrList = ""
		
		
    if (isWhitespace(document.getElementById("Name").value))
				{
					
					ErrList += "Name \n"
				tmpValid++
			
				} 
				
				
    if (!(isEmail(document.getElementById("Email").value)))
				{
					
					ErrList += "Email \n"
				tmpValid++
			
				} 
				
	
	 if (isWhitespace(document.getElementById("Address").value))
				{
					
					ErrList +=  "Address \n"
				tmpValid++
			
				}

	 if (isWhitespace(document.getElementById("City").value))
				{
					
					ErrList +=  "City \n"
				tmpValid++
			
				}
    
   
   if (isWhitespace(document.getElementById("Phone").value))
		 
				{
					ErrList +=  "Phone \n"
					
					
				tmpValid++
			
				}  
	
	if ( isWhitespace(document.getElementById("Story").value) )	
		 
				{
					
					ErrList +=  "Your Story \n"
					
				tmpValid++
			
				} 
	
	
	if ( isWhitespace(document.getElementById("Current_Weight").value) )	
		 
				{
					
					ErrList +=  "Current Weight \n"
					
				tmpValid++
			
				} 
				
	if ( isWhitespace(document.getElementById("Ideal_Weight").value) )	
		 
				{
					
					ErrList +=  "Ideal Weight \n"
					
				tmpValid++
			
				} 
				
	

/*******/
	        myOption = -1;
        for (i=formslim.Using_SSHE_Program.length-1; i > -1; i--) {
        if (formslim.Using_SSHE_Program[i].checked) {
        myOption = i; i = -1;
        }
        }
        if (myOption == -1) {
        ErrList +=  "Currently Using the SSHE Program \n"
        tmpValid++
        }
        /*******/
         myOption = -1;
        for (i=formslim.Used_SSHE_Program_Before.length-1; i > -1; i--) {
        if (formslim.Used_SSHE_Program_Before[i].checked) {
        myOption = i; i = -1;
        }
        }
        if (myOption == -1) {
        ErrList +=  "Used the SSHE Program Before \n"
        tmpValid++
        }
        /*******/
        infoOption1 = -1;
        for (i=formslim.More_Information.length-1; i > -1; i--) {
        if (formslim.More_Information[i].checked) {
        infoOption1 = i; i = -1;
        }
        }
        if (infoOption1 == -1) {
        ErrList +=  "More Information Request \n"
        tmpValid++
        }
        if (infoOption1 == 0) {
            myOption = -1;
            for (i=formslim.More_Information_Preference.length-1; i > -1; i--) {
            if (formslim.More_Information_Preference[i].checked) {
            myOption = i; i = -1;
            }
                    
            }
            if (myOption == -1) {
            ErrList +=  "More Information Request  Preference\n"
            tmpValid++
            }
         }
         /*******/
         
        ExerciseOption = -1;
        for (i=formslim.Exercise_Regularly.length-1; i > -1; i--) {
        if (formslim.Exercise_Regularly[i].checked) {
        ExerciseOption = i; i = -1;
        }
        }
        if (ExerciseOption == -1) {
        ErrList +=  "Exercise Regularly \n"
        tmpValid++
        }
        
         /*******/
         if (ExerciseOption == 0) {
            myOption = -1;
            for (i=formslim.How_often_exercising.length-1; i > -1; i--) {
            if (formslim.How_often_exercising[i].checked) {
            myOption = i; i = -1;
            }
            }
            if (myOption == -1) {
            ErrList +=  "How Often do You Exercise  \n"
            tmpValid++
            }
        }
           /*******/
        myOption = -1;
        for (i=formslim.Agree_to_Rules.length-1; i > -1; i--) {
        if (formslim.Agree_to_Rules[i].checked) {
        myOption = i; i = -1;
        }
        }
        if (!(myOption == 0)) {
        ErrList +=  "Agree to the Rules \n"
        tmpValid++
        }
        
        
				if ( isWhitespace(document.getElementById("Photo").value) )	
		 
				{
					
					ErrList +=  "Your Photo \n"
					
				tmpValid++
			
				} 

		
	 
    
     if (tmpValid == "0") {
     
		
			return (true);
		}
			
		else {
			alert("Please Answer the Following Question(s): \n" + ErrList)
			return (false)
			}
 
 }

////////////////////////