 function placeFocus() 
{
	if (document.forms.length > 0) 
	{
		var field = document.forms[0];
		for (i = 0; i < field.length; i++) 
		{
			if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s")) 
			{
				document.forms[0].elements[i].focus();
				break;
		    }
	    }
    }
}

function currency(num)
{
	num = Math.round(num*100)/100;
	return (num);
}


function checkphone(phone)
{
    if (phone.length == 0)
        return true;
		
    if (phone.length != 12)
        return false;


	// check if first 3 characters represent a valid area code
    if (checknumber(phone.substr(0,3)))
		return false;
    else
	if (numberrange((eval(phone.substr(0,3))), 100, 1000))
		return false;



	// check if area code/exchange separator is either a'-' or ' '
	if (phone.charAt(3) != "-" && phone.charAt(3) != " ")
        return false;


	// check if  characters 5 - 7 represent a valid exchange
    if (checknumber(phone.substr(4,7)))
		return false;
    else
	if (numberrange((eval(phone.substr(4,7))), 100, 1000))
		return false;

	
	// check if exchange/number separator is either a'-' or ' '
	if (phone.charAt(7) != "-" && phone.charAt(7) != " ")
        return false;


	// make sure last for digits are a valid integer
	if (phone.charAt(8) == "-" || phone.charAt(8) == "+")
        return false;
	else
		return (checkinteger(phone.substr(8,12)));
}


function checkrange(phone, min_value, max_value)
{
    //if value is in range then return true else return false

    if (phone.length == 0)
        return true;


    if (checknumber(phone))
	return false;
    else
	return (numberrange((eval(phone)), min_value, max_value));
	
    //All tests passed, so...
    return true;
}


function checkinteger(phone)
{
    //Returns true if value is a number or is NULL
    //otherwise returns false	

    if (phone.length == 0)
        return true;

    //Returns true if value is an integer defined as
    //   having an optional leading + or -.
    //   otherwise containing only the characters 0-9.
	var decimal_format = ".";
	var check_char;

    //The first character can be + -  blank or a digit.
	check_char = phone.indexOf(decimal_format)
    //Was it a decimal?
    if (check_char < 1)
	return checknumber(phone);
    else
	return false;
}



function numberrange(phone, min_value, max_value)
{
    // check minimum
    if (min_value != null)
	{
        if (phone < min_value)
		return false;
	}

    // check maximum
    if (max_value != null)
	{
	if (phone > max_value)
		return false;
	}
	
    //All tests passed, so...
    return true;
}



function checknumber(phone)
{
    //Returns true if value is a number or is NULL
    //otherwise returns false	

    if (phone.length == 0)
        return true;

    //Returns true if value is a number defined as
    //   having an optional leading + or -.
    //   having at most 1 decimal point.
    //   otherwise containing only the characters 0-9.
	var start_format = " .+-0123456789";
	var number_format = " .0123456789";
	var check_char;
	var decimal = false;
	var trailing_blank = false;
	var digits = false;

    //The first character can be + - .  blank or a digit.
	check_char = start_format.indexOf(phone.charAt(0))
    //Was it a decimal?
	if (check_char == 1)
	    decimal = true;
	else if (check_char < 1)
		return false;
        
	//Remaining characters can be only . or a digit, but only one decimal.
	for (var i = 1; i < phone.length; i++)
	{
		check_char = number_format.indexOf(phone.charAt(i))
		if (check_char < 0)
			return false;
		else if (check_char == 1)
		{
			if (decimal)		// Second decimal.
				return false;
			else
				decimal = true;
		}
		else if (check_char == 0)
		{
			if (decimal || digits)	
				trailing_blank = true;
        // ignore leading blanks

		}
	        else if (trailing_blank)
			return false;
		else
			digits = true;
	}	
    //All tests passed, so...
    return true
}

function f_addeditlogin_validate(f,action){
	if( f.uname.value=="" ){
		alert("You must supply a Username for each login.");
		f.uname.focus();
		return false;
	}
	if( f.pwd.value=="" ){
		alert("You must supply a Password for each login.");
		f.pwd.focus();
		return false;
	}
	if( f.authtype.value=="" ){
		alert("You must supply a Authentication Type for each login.");
		f.authtype.focus();
		return false;
	}
	return true;
}

function f_addeditrole_validate(f,action){
	if( f.rname.value=="" ){
		alert("You must supply a rolename for each Role Type.");
		f.rname.focus();
		return false;
	}
	if( f.navids.value=="" ){
		alert("You must select at least one Navigation.");
		f.navids.focus();
		return false;
	}
	return true;
}


function checkall(formname)
{
	for (i=0;i<formname.elements.length;i++)
	{
		
		formname.elements[i].checked="True";		
	}
}
function uncheckall(formname)
{
	
	for (i=0;i<formname.elements.length;i++)
	{
		formname.elements[i].checked="";		
	}
}

function f_sendmail_validate()
{
		document.f_sendmail.editcontent.value=oDiv.innerHTML;
		if (document.f_sendmail.category.value=="" && document.f_sendmail.individual.value=="")
		{
			alert("Please Select a Category (or) Enter an individuals Email address");
			document.f_sendmail.category.focus();
			return false;
		}
		if (document.f_sendmail.subject.value=="")
		{
			alert("The Subject cannot be null");
			document.f_sendmail.subject.focus();
			return false;
		}
//		if (document.f_sendmail.editcontent.value=="")
	//	{
		//	alert("The Email Content cannot be null");
			//return false;
//		}

		return true;
}

function f_addeditcontact_validate()
{
	if (document.f_addeditcontact.email.value=="")
	{
		alert("Email Field cannot be null");
		return false;
	}
	if (document.f_addeditcontact.fname.value=="")
	{
		alert("First Name Field cannot be null");
		return false;
	}
	if (document.f_addeditcontact.lname.value=="")
	{
		alert("Last Name Field cannot be null");
		return false;
	}
	return true;
}

function f_addeditcategory_validate()
{
	if (document.f_addeditcategory.category.value=="")
	{
		alert("Category Field cannot be null");
		return false;
	}
	return true;
}

function f_addattachments_validate()
{
	document.f_addattachments.Uploadfile.value = document.f_addattachments.attachmentfile.value;
	return true;
}

function showmem(gid,gname)
{
	url = "showmem.asp?gid=" + gid + "&gname=" + gname;
    msgdesc = window.open(url,"Members","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,WIDTH=500,HEIGHT=400");
}

function showmemTotal(catid,district,member)
{
	url = "showmem.asp?catid=" + catid + "&district=" + district + "&member=" + member;
    msgdesc = window.open(url,"Members","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,WIDTH=500,HEIGHT=400");
}

function showmemDistrict(district)
{
	url = "showmem.asp?district=" + district;
    msgdesc = window.open(url,"Members","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,WIDTH=500,HEIGHT=400");
}


function showmemMember(member)
{
	url = "showmem.asp?member=" + member;
    msgdesc = window.open(url,"Members","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,WIDTH=500,HEIGHT=400");
}

function f_addeditnav_validate()
{
	document.f_addeditnav.content.value=oDiv.innerHTML;
	document.f_addeditnav.attachedfile.value=document.f_addeditnav.uploadfile.value;
	var FormLimit = 102399

    var TempVar = new String
    TempVar = document.f_addeditnav.content.value

    if (TempVar.length > FormLimit){
        document.f_addeditnav.content.value = TempVar.substr(0, FormLimit)
        TempVar = TempVar.substr(FormLimit)

        while (TempVar.length > 0){
            var objTEXTAREA = document.createElement("TEXTAREA")
            objTEXTAREA.name = "edithid"
            objTEXTAREA.value = TempVar.substr(0, FormLimit)
            document.f_addeditnav.appendChild(objTEXTAREA)
            TempVar = TempVar.substr(FormLimit)
        }
    }
	return true;
}

// ---- Credit Card validating functions ----
/*There are three functions in this set for credit card validation.
The main function is:

validateCard(cardNumber,cardType,cardMonth,cardYear)
	parameters:
		all paramaters are string values.
		Month & Year come from the select input fields in the form, so they are defined.
		cardType can be:
			'a' for American Express
			'd' for Discover
			'm' for MasterCard
			'v' for Visa
	description:
		this function will check string length, valid characters, specific credit card prefixes and test
		the Mod 10 (LUHN Formula) for validating possible credit card numbers. this function can only
		authorize that the given card data is potentially valid. You would still need to run actual
		card validation routines to verify the actual account.
	returns:
		this function returns true if the card number could be valid for the card type and expiration date.
		false otherwise.	
supporting functions:
mod10( cardNumber )
	parameters:
		this function takes the text string card number and runs the Mod 10 formula on its respective digits.
	description:
		Mod 10 is the check digit formula for the supported cards these functions attempt to validate.
	returns:
		this function returns true if the number passes the check digit test.
		false otherwise.
expired( cardMonth, cardYear )
	parameters:
		this function takes the text string values given by the html form.
	description:
		this function basically will check to make sure todays date is less than the expiration date the user inputs.
		this function is not locked into using 2 digit dates.
	returns:
		this fucntion returns true if the card is expired.
		false otherwise.
*/
function mod10( cardNumber ) { // LUHN Formula for validation of credit card numbers.
	var ar = new Array( cardNumber.length );
	var i = 0,sum = 0;

	for( i = 0; i < cardNumber.length; ++i ) {
		ar[i] = parseInt(cardNumber.charAt(i));
	}
	for( i = ar.length -2; i >= 0; i-=2 ) { // you have to start from the right, and work back.
		ar[i] *= 2;							 // every second digit starting with the right most (check digit)
		if( ar[i] > 9 ) ar[i]-=9;			 // will be doubled, and summed with the skipped digits.
	}										 // if the double digit is > 9, ADD those individual digits together 

	for( i = 0; i < ar.length; ++i ) {
		sum += ar[i];						 // if the sum is divisible by 10 mod10 succeeds
	}
	return (((sum%10)==0)?true:false);	 	
    }


function expired( month, year ) {
	var now = new Date();							
	var expiresIn = new Date(year,month,0,0,0);		// create an expired on date object with valid thru expiration date
	expiresIn.setMonth(expiresIn.getMonth()+1);		// adjust the month, to first day, hour, minute & second of expired month
	if( now.getTime() < expiresIn.getTime() ) return false;
	return true;									// then we get the miliseconds, and do a long integer comparison
}


function validateCard(cardNumber,cardType,cardMonth,cardYear) {
	if( cardNumber.length == 0 ) {						//most of these checks are self explanitory
		alert("Please enter a valid card number.");
		return false;				
	}
	for( var i = 0; i < cardNumber.length; ++i ) {		// make sure the number is all digits.. (by design)
		var c = cardNumber.charAt(i);
		if( c < '0' || c > '9' ) {
			alert("Please enter a valid card number. Use only digits. do not use spaces or hyphens.");
			return false;
		}
	}
		var length = cardNumber.length;			//perform card specific length and prefix tests

		switch( parseInt(cardType) ) {
			//American Express
			case 1:
					if( length != 15 ) {
						alert("Please enter a valid American Express Card number.");
						return;
					}
					var prefix = parseInt( cardNumber.substring(0,2));
					if( prefix != 34 && prefix != 37 ) {
						alert("Please enter a valid American Express Card number.");
						return;
					}
						break;
			// Discovery
			case 2:
					if( length != 16 ) {
						alert("Please enter a valid Discover Card number.");
						return;
					}
					var prefix = parseInt( cardNumber.substring(0,4));
					if( prefix != 6011 ) {
						alert("Please enter a valid Discover Card number.");
						return;
					}
					break;
			// Master Card
			case 3:
					if( length != 16 ) {
						alert("Please enter a valid MasterCard number.");
						return;
					}
					var prefix = parseInt( cardNumber.substring(0,2));
					if( prefix < 51 || prefix > 55) {
						alert("Please enter a valid MasterCard Card number.");
						return;
					}
					break;
			// Visa
			case 4:
					if( length != 16 && length != 13 ) {
						alert("Please enter a valid Visa Card number.");
						return;
					}
					var prefix = parseInt( cardNumber.substring(0,1));
					if( prefix != 4 ) {
						alert("Please enter a valid Visa Card number.");
						return;
					}
					break;
		}
		
		// ---------------------------------------------------------------------
		// Commented By: Rama Krishna
		// Commented for testing purspose, Uncomment below lines after testing.
		// ---------------------------------------------------------------------
		/*
		if( !mod10( cardNumber ) ) { 		// run the check digit algorithm
			alert("Sorry! this is not a valid credit card number.");
			return false;
		}
		if( expired( cardMonth, cardYear ) ) {	// check if entered date is already expired.
			alert("Sorry! The expiration date you have entered would make this card invalid.");
			return false;
		}
		*/
		return true; // at this point card has not been proven to be invalid
}
// ---- End of Credit Card validating functions ----

function f_MemberSignup_Validate(PAGE)
{
	if (!checkCtrlValue(document.f_MemberSignup.licno,"Please enter Licence number."))  return false; 
	if (!checkCtrlValue(document.f_MemberSignup.first,"Please enter First name.")) return false; 
	if (!checkCtrlValue(document.f_MemberSignup.sex,"Please select Sex.")) return false; 
	if (!checkCtrlValue(document.f_MemberSignup.mailingaddress,"Please enter Mailing address.")) return false; 
	if (!checkCtrlValue(document.f_MemberSignup.state,"Please select State.")) return false; 
	if (!checkCtrlValue(document.f_MemberSignup.zip,"Please enter zip.")) return false; 
	if (!checkCtrlValue(document.f_MemberSignup.ss,"Please enter SS#.")) return false; 
	if (!checkCtrlValue(document.f_MemberSignup.renewalfee,"Please enter Renewal fee.")) return false; 
	if (!checkCtrlValue(document.f_MemberSignup.cardType,"Please select Card type.")) return false; 
	if (!checkCtrlValue(document.f_MemberSignup.cardName,"Please enter Card name.")) return false; 
	if (!checkCtrlValue(document.f_MemberSignup.cardMonth,"Please select Expiry month.")) return false; 
	if (!checkCtrlValue(document.f_MemberSignup.cardYear,"Please select Expiry Year.")) return false; 

	var cardNumber,cardType,cardMonth,cardYear
	cardNumber=document.f_MemberSignup.cardNumber.value;
	cardType=document.f_MemberSignup.cardType.value;
	cardMonth=document.f_MemberSignup.cardMonth.value;
	cardYear=document.f_MemberSignup.cardYear.value;
	
	if (!validateCard(cardNumber,cardType,cardMonth,cardYear))
		return false;

	document.f_MemberSignup.action= PAGE+"?action=add";
	document.f_MemberSignup.submit();
	
	return true;
}

function Trim(str)
{
 // skip leading and trailing whitespaces of data
  var x=str;
  x=x.replace(/^\s*(.*)/, "$1");
  x=x.replace(/(.*?)\s*$/, "$1");
  return x;
}

function checkCtrlValue(objCtrl,ErrorMesg)
{
	if (Trim(objCtrl.value).length==0)	{
		alert(ErrorMesg);
		objCtrl.focus();
		return false;
	}
	return true;
}

function f_AddEditAssociateMem_validate()
{
	if (document.f_AddEditAssociateMem.FIRST_NAME.value=="")
	{
		alert("Associate Member First Name Field cannot be null");
		document.f_AddEditAssociateMem.FIRST_NAME.focus();
		return false;
	}
//	if (document.f_AddEditAssociateMem.LAST_NAME.value=="")
//	{
//		alert("Associate Member Last Name Field cannot be null");
//		document.f_AddEditAssociateMem.LAST_NAME.focus();
//		return false;
//	}
//	if (document.f_AddEditAssociateMem.COMPANY.value=="")
//	{
//		alert("Associate Member COMPANY Field cannot be null");
//		document.f_AddEditAssociateMem.COMPANY.focus();
//		return false;
//	}
	if (document.f_AddEditAssociateMem.ADDRESS.value=="")
	{
		alert("Associate Member ADDRESS Field cannot be null");
		document.f_AddEditAssociateMem.ADDRESS.focus();
		return false;
	}
//	if (document.f_AddEditAssociateMem.CITY.value=="")
//	{
//		alert("Associate Member CITY Field cannot be null");
//		document.f_AddEditAssociateMem.CITY.focus();
//		return false;
//	}
//	if (document.f_AddEditAssociateMem.STATE.value=="")
//	{
//		alert("Associate Member STATE Field cannot be null");
//		document.f_AddEditAssociateMem.STATE.focus();
//		return false;
//	}
//	if (document.f_AddEditAssociateMem.ZIP.value=="")
//	{
//		alert("Associate Member ZIP Field cannot be null");
//		document.f_AddEditAssociateMem.ZIP.focus();
//		return false;
//	}
//	if (document.f_AddEditAssociateMem.Phone.value=="")
//	{
//		alert("Associate Member Phone Field cannot be null");
//		document.f_AddEditAssociateMem.Phone.focus();
//		return false;
//	}
//	if (document.f_AddEditAssociateMem.Fax.value=="")
//	{
//		alert("Associate Member Fax Field cannot be null");
//		document.f_AddEditAssociateMem.Fax.focus();
//		return false;
//	}if (document.f_AddEditAssociateMem.HPhone.value=="")
//	{
//		alert("Associate Member HPhone Field cannot be null");
//		document.f_AddEditAssociateMem.HPhone.focus();
//		return false;
//	}if (document.f_AddEditAssociateMem.EMAIL.value=="")
//	{
//		alert("Associate Member EMAIL Field cannot be null");
//		document.f_AddEditAssociateMem.EMAIL.focus();
//		return false;
//	}
	return true;
}

function f_AddEditJournalMail_validate()
{
	if (document.f_AddEditJournalMail.company.value=="")
	{
		alert("JournalMail COMPANY Field cannot be null");
		document.f_AddEditJournalMail.company.focus();
		return false;
	}	
	if (document.f_AddEditJournalMail.first_name.value=="")
	{
		alert("JournalMail First Name Field cannot be null");
		document.f_AddEditJournalMail.first_name.focus();
		return false;
	}
	if (document.f_AddEditJournalMail.address_1.value=="")
	{
		alert("JournalMail ADDRESS 1 Field cannot be null");
		document.f_AddEditJournalMail.address_1.focus();
		return false;
	}
	return true;
}

function f_AddEditSDSUStud_validate()
{
	if (document.f_AddEditSDSUStud.FirstName.value=="")
	{
		alert("SDSUStudents First Name Field cannot be null");
		document.f_AddEditSDSUStud.FirstName.focus();
		return false;
	}	
	if (document.f_AddEditSDSUStud.Address.value=="")
	{
		alert("SDSUStudents Address Field cannot be null");
		document.f_AddEditSDSUStud.Address.focus();
		return false;
	}
	return true;
}

function unselectall(PAGE)
{
	document.frm_sdpha.LicenseNo.value = ""
	document.frm_sdpha.Name.value = ""
	//document.frm_sdpha.LicenseNo.focus();
	document.frm_sdpha.action=PAGE+"&from=reset";
	document.frm_sdpha.submit();
	return true;
}

function f_addeditmembersignup_validate()
{
    if (document.f_addeditMemberSignup.licno.value=="")
	{
		alert("Licence No. Field cannot be null");
		document.f_addeditMemberSignup.licno.focus();
		return false;
	}
	if (document.f_addeditMemberSignup.licno.value.length > 255)
	{
		alert("Licence number should not exceed 255 Characters.");
		document.f_addeditMemberSignup.licno.focus();
		return (false);
	}
	if (document.f_addeditMemberSignup.first.value=="")
	{
		alert("First Name Field cannot be null");
		document.f_addeditMemberSignup.first.focus();
		return false;
	}
	if (document.f_addeditMemberSignup.last.value=="")
	{
		alert("Last Name Field cannot be null");
		document.f_addeditMemberSignup.last.focus();
		return false;
	}
	/*if (document.f_addeditMemberSignup.company.value=="")
	{
		alert("Company Name Field cannot be null");
		document.f_addeditMemberSignup.company.focus();
		return false;
	}*/
	if (document.f_addeditMemberSignup.mailingaddress.value=="")
	{
		alert("Mailing Address Field cannot be null");
		document.f_addeditMemberSignup.mailingaddress.focus();
		return false;
	}
	if (document.f_addeditMemberSignup.city.value=="")
	{
		alert("City Field cannot be null");
		document.f_addeditMemberSignup.city.focus();
		return false;
	}
	/*if (document.f_addeditMemberSignup.state.selectedIndex <= 0)
	{
		alert("Please select one of the \"State\" options.");
		document.f_addeditMemberSignup.state.focus();
		return (false);
	}*/
	if (document.f_addeditMemberSignup.zip.value=="")
	{
		alert("Zip Code Field cannot be null");
		document.f_addeditMemberSignup.zip.focus();
		return false;
	}
	if (document.f_addeditMemberSignup.zip.value != "")
	{
		var txtzip = document.f_addeditMemberSignup.zip;
		   if (isNaN(txtzip.value) == true)
		   {
			  alert("Please enter a valid zip code");
			  document.f_addeditMemberSignup.zip.focus();
			  document.f_addeditMemberSignup.zip.select();
			  return false;
		   }
	}

	if (document.f_addeditMemberSignup.homephone.value=="")
	{
		alert("Home Phone Field cannot be null");
		document.f_addeditMemberSignup.homephone.focus();
		return false;
	}

//	if (document.f_addeditMemberSignup.mobilephone.value=="")
	//{
		//alert("Mobile Phone cannot be null. If not applicable please enter N/A.");
//		document.f_addeditMemberSignup.mobilephone.focus();
	//	return false;
//	}

	if (document.f_addeditMemberSignup.employer.value=="")
	{
		alert("Employer Field cannot be null");
		document.f_addeditMemberSignup.employer.focus();
		return false;
	}

	if (document.f_addeditMemberSignup.workaddress.value=="")
	{
		alert("Work Mailing Address Field cannot be null");
		document.f_addeditMemberSignup.workaddress.focus();
		return false;
	}


	if (document.f_addeditMemberSignup.city2.value=="")
	{
		alert("City Field cannot be null");
		document.f_addeditMemberSignup.city2.focus();
		return false;
	}
	/*if (document.f_addeditMemberSignup.homestate.selectedIndex <= 0)
	{
		alert("Please select one of the \"State\" options.");
		document.f_addeditMemberSignup.homestate.focus();
		return (false);
	}*/
	if (document.f_addeditMemberSignup.zip2.value=="")
	{
		alert("Zip Code Field cannot be null");
		document.f_addeditMemberSignup.zip2.focus();
		return false;
	}
	if (document.f_addeditMemberSignup.zip2.value != "")
	{
		var txtzip = document.f_addeditMemberSignup.zip2;
		   if (isNaN(txtzip.value) == true)
		   {
			  alert("Please enter a valid zip code");
			  document.f_addeditMemberSignup.zip2.focus();
			  document.f_addeditMemberSignup.zip2.select();
			  return false;
		   }
	}

	if (document.f_addeditMemberSignup.workphone.value=="")
	{
		alert("Work Phone Field cannot be null");
		document.f_addeditMemberSignup.workphone.focus();
		return false;
	}

	if (document.f_addeditMemberSignup.workfax.value=="")
	{
		alert("Work Fax Field cannot be null. If not applicable please enter N/A.");
		document.f_addeditMemberSignup.workfax.focus();
		return false;
	}
	if (document.f_addeditMemberSignup.degree.value=="")
	{
		alert("Degree Field cannot be null");
		document.f_addeditMemberSignup.degree.focus();
		return false;
	}
	

	/*
	var checkOK = "0123456789";
	var checkStr = document.f_addeditMemberSignup.zip.value;
	var allValid = true;
	var allNum = "";
	if (document.f_addeditMemberSignup.zip.value != "")
	{
		for (i = 0;  i < checkStr.length;  i++)
		{
			ch = checkStr.charAt(i);
			for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j))
			break;
			if (j == checkOK.length)
			{
				allValid = false;
				break;
			}
			if (ch != ",")
			allNum += ch;
		}
		if (!allValid)
		{
			alert("Please enter only digit characters in the \"Zip Code\" field.");
			document.f_addeditMemberSignup.zip.focus();
			return (false);
		}
	}
	*/  
	
	if (document.f_addeditMemberSignup.ss.value=="")
	{
		alert("SS# Field cannot be null");
		document.f_addeditMemberSignup.ss.focus();
		return false;
	}

	if (document.f_addeditMemberSignup.practice.value=="")
	{
		alert("Practice Field cannot be null");
		document.f_addeditMemberSignup.practice.focus();
		return false;
	}
	if (document.f_addeditMemberSignup.email.value=="")
	{
		alert("Email Field cannot be null. If not applicable please enter N/A.");
		document.f_addeditMemberSignup.email.focus();
		return false;
	}

    myOption = -1;
	for (i=0; i<document.f_addeditMemberSignup.yesno.length; i++) 
	{
		if (document.f_addeditMemberSignup.yesno[i].checked) 
		{
			myOption = i;
		}
	}
	if (myOption == 1) 
	{
		if (document.f_addeditMemberSignup.resstate.value == "")
		{
			alert("Please select one of the restricted \"State\" options under phamacist's license .");
			document.f_addeditMemberSignup.resstate.focus();
			return false;
		}
	}
	
	//----
	/* var checkEmail = "@.";
	var checkStr = document.f_addeditMemberSignup.email.value;
	var EmailValid = false;
	var EmailAt = false;
	var EmailPeriod = false;
	if (document.f_addeditMemberSignup.email.value != "")
	{
	
		for (i = 0;  i < checkStr.length;  i++)
		{
		  ch = checkStr.charAt(i);
		  for (j = 0;  j < checkEmail.length;  j++)
		  {
			if (ch == checkEmail.charAt(j) && ch == "@")
			EmailAt = true;
			if (ch == checkEmail.charAt(j) && ch == ".")
			EmailPeriod = true;
			  if (EmailAt && EmailPeriod)
				break;
			  if (j == checkEmail.length)
				break;
		  }
			// if both the @ and . were in the string
			if (EmailAt && EmailPeriod)
			{
				EmailValid = true
				break;
			 }
		}
		if (!EmailValid)
		{
			alert("The \"email\" field must contain an \"@\" and a \".\".");
			document.f_addeditMemberSignup.email.focus();
			return false;
		}
	}
	*/

	if ((document.f_addeditMemberSignup.AnnualFee.checked == false) && (document.f_addeditMemberSignup.PharmEmeritus.checked == false))
	{
		alert("Please select either one of Annual Renewal Fee or Pharmacist Emeritus");
		document.f_addeditMemberSignup.AnnualFee.focus();
		return false;
	}
	
	//if (document.f_addeditMemberSignup.CLFeeCheck.checked == true)
	//{
	//	if (document.f_addeditMemberSignup.comlegFee.value == "")
	//	{
	//		alert("Please enter Commercial & Legislative Amount");
	//		document.f_addeditMemberSignup.comlegFee.focus();
	//		return (false);
	//	}
	//}
	
	//if (document.f_addeditMemberSignup.comlegFee.value != "")
	//	{
	//	   if (isNaN(document.f_addeditMemberSignup.comlegFee.value) == false)
	//		{
	//		   if (document.f_addeditMemberSignup.comlegFee.value < 35)
	//		   {
	//			    alert("Please Enter Commercial & Legislative Amount > 35");
	//				document.f_addeditMemberSignup.comlegFee.focus();
	//				return (false);
	//		   }
	//		}
	//	}

	if (document.f_addeditMemberSignup.DistrictDueCheck.checked == true)
	{
		var radio_choice = false;

		// Loop from zero to the one minus the number of radio button selections
		for (counter = 0; counter < document.f_addeditMemberSignup.district.length; counter++)
		{
		// If a radio button has been selected it will return true
		// (If not it will return false)
		if (document.f_addeditMemberSignup.district[counter].checked)
		radio_choice = true; 
		}

		if (!radio_choice)
		{
		// If there were no selections made display an alert box 
		alert("Please select a District.");
		document.f_addeditMemberSignup.DistrictDueCheck.focus();
		return (false);
		}
	}

	//===
	if (document.f_addeditMemberSignup.PhaBusMShip.value != "" )
	{
		if (document.f_addeditMemberSignup.nameOfPhaBus.value == "")
		{
			alert("Please enter Name of Pharmacy/Business")
			document.f_addeditMemberSignup.nameOfPhaBus.focus();
			document.f_addeditMemberSignup.nameOfPhaBus.select();
			return (false);
		}
		if (document.f_addeditMemberSignup.nameOfIndInc.value == "")
		{
			alert("Please enter Name of Individual Included")
			document.f_addeditMemberSignup.nameOfIndInc.focus();
			document.f_addeditMemberSignup.nameOfIndInc.select();
			return (false);
		}
		if (document.f_addeditMemberSignup.PhaBusMShip.value == "")
		{
			alert("Please enter Pharmacy or Business Membership Amount")
			document.f_addeditMemberSignup.PhaBusMShip.focus();
			document.f_addeditMemberSignup.PhaBusMShip.select();
			return (false);
		}
		if (document.f_addeditMemberSignup.PhaBusMShip.value != "")
		{
		   var txtPhaBus = document.f_addeditMemberSignup.PhaBusMShip;
		   if (isNaN(txtPhaBus.value) == true)
		   {
			  alert("Please enter a valid Numeric Value");
			  document.f_addeditMemberSignup.PhaBusMShip.focus();
			  document.f_addeditMemberSignup.PhaBusMShip.select();
			  return false;
		   }
		   if (isNaN(txtPhaBus.value) == false)
			{
			   if (txtPhaBus.value < 100)
			   {
				    alert("Please Enter Pharmacy or Business Membership Amount > 100")
					return (false);
			   }
			}
		}
	}

	if (document.f_addeditMemberSignup.corpMShip.value != "")
	{
		if (document.f_addeditMemberSignup.nameOfCorp.value == "")
		{
			alert("Please enter Name of Corporation");
			document.f_addeditMemberSignup.nameOfCorp.focus();
			document.f_addeditMemberSignup.nameOfCorp.select();
			return (false);
		}
		if (document.f_addeditMemberSignup.nameOfCorIndInc.value == "")
		{
			alert("Please enter Name of Individual Included");
			document.f_addeditMemberSignup.nameOfCorIndInc.focus();
			document.f_addeditMemberSignup.nameOfCorIndInc.select();
			return (false);
		}
		if (document.f_addeditMemberSignup.corpMShip.value == "")
		{
			alert("Please enter Corporate Membership Amount");
			document.f_addeditMemberSignup.corpMShip.focus();
			document.f_addeditMemberSignup.corpMShip.select();
			return (false);
		}
		if (document.f_addeditMemberSignup.corpMShip.value != "")
		{
		   var txtPhaBus = document.f_addeditMemberSignup.corpMShip;
		   if (isNaN(txtPhaBus.value) == true)
		   {
			   alert("Please enter a valid Numeric Value");
			   document.f_addeditMemberSignup.corpMShip.focus();
			   document.f_addeditMemberSignup.corpMShip.select();
			   return (false);
		   }
		   if (isNaN(txtPhaBus.value) == false)
			{
			   if (txtPhaBus.value < 200)
			   {
				    alert("Please Enter Corporate Membership Amount >= 200")
					return (false);
			   }
			}
		}
	}

	//if (document.f_addeditMemberSignup.indiMShip.value != "")
	//{
		var radio_choice = false;

		// Loop from zero to the one minus the number of radio button selections
		for (counter = 0; counter < document.f_addeditMemberSignup.rdIndvLevel.length; counter++)
		{
		// If a radio button has been selected it will return true
		// (If not it will return false)
			if (document.f_addeditMemberSignup.rdIndvLevel[counter].checked)
				radio_choice = true; 
		}

		/*if (!radio_choice)
		{
			// If there were no selections made display an alert box 
			alert("Please select Individual Membership.")
			return (false);
		}*/
		
		//---
		myOption = -1;
		for (i=0; i<document.f_addeditMemberSignup.rdIndvLevel.length; i++) 
		{
			if (document.f_addeditMemberSignup.rdIndvLevel[i].checked) 
			{
				myOption = i;
			}
		}
		if (myOption == 2) 
		{
			if (document.f_addeditMemberSignup.IndvLevelOther.value == "")
			{
				alert("Please Enter value for Individual Membership.");
				document.f_addeditMemberSignup.IndvLevelOther.focus();
				document.f_addeditMemberSignup.IndvLevelOther.select();
				return (false);
			}
			if (document.f_addeditMemberSignup.IndvLevelOther.value != "")
			{
			   var txtPhaBus = document.f_addeditMemberSignup.IndvLevelOther;
			   if (isNaN(txtPhaBus.value) == true)
			   {
				   alert("Please enter a valid Numeric Value");
				   document.f_addeditMemberSignup.IndvLevelOther.focus();
				   document.f_addeditMemberSignup.IndvLevelOther.select();
				   return (false);
			   }
			   if (isNaN(txtPhaBus.value) == false)
				{
  				  /* if (txtPhaBus.value < 50)
				   {
						alert("Please Enter Individual Membership Amount >= 50")
						return (false);
				   }*/
				}
			}
		}


		//---

		//if (document.f_addeditMemberSignup.rdIndvName.value == "")
		//{
		//	alert("Please enter Name of Individual");
		//	document.f_addeditMemberSignup.rdIndvName.focus();
		//	document.f_addeditMemberSignup.rdIndvName.select();
		//	return (false);
		//}
	//}
	
	
	// calculating total amount	

	document.f_addeditMemberSignup.totalremittedamount.value = 0;

	if (document.f_addeditMemberSignup.AnnualFee.checked == true )
	{
		document.f_addeditMemberSignup.totalremittedamount.value = Number(document.f_addeditMemberSignup.totalremittedamount.value) + 125;
	}
	
	if (document.f_addeditMemberSignup.LateFee.checked == true )
	{
		document.f_addeditMemberSignup.totalremittedamount.value = Number(document.f_addeditMemberSignup.totalremittedamount.value) + 25;
	}


	if (document.f_addeditMemberSignup.PharmEmeritus.checked == true )
	{
		document.f_addeditMemberSignup.totalremittedamount.value = Number(document.f_addeditMemberSignup.totalremittedamount.value) + 62.50;
	}

	
	/*if (document.f_addeditMemberSignup.comlegFee.value != "")
	{
		document.f_addeditMemberSignup.totalremittedamount.value = Number(document.f_addeditMemberSignup.totalremittedamount.value) + Number(document.f_addeditMemberSignup.comlegFee.value);
	}*/


	if (document.f_addeditMemberSignup.DistrictDue.value != "")
	{
		document.f_addeditMemberSignup.totalremittedamount.value = Number(document.f_addeditMemberSignup.totalremittedamount.value) + Number(document.f_addeditMemberSignup.DistrictDue.value);
	}


	if (document.f_addeditMemberSignup.send.value != "")
	{
		document.f_addeditMemberSignup.totalremittedamount.value = Number(document.f_addeditMemberSignup.totalremittedamount.value) + (Number(document.f_addeditMemberSignup.send.value)*25);
	}


	if (document.f_addeditMemberSignup.PhaBusMShip.value != "")
	{
		document.f_addeditMemberSignup.totalremittedamount.value = Number(document.f_addeditMemberSignup.totalremittedamount.value) + Number(document.f_addeditMemberSignup.PhaBusMShip.value);
	}


	if (document.f_addeditMemberSignup.corpMShip.value != "")
	{
		document.f_addeditMemberSignup.totalremittedamount.value = Number(document.f_addeditMemberSignup.totalremittedamount.value) + Number(document.f_addeditMemberSignup.corpMShip.value);
	}


	if (document.f_addeditMemberSignup.indiMShip.value != "")
	{
		document.f_addeditMemberSignup.totalremittedamount.value = Number(document.f_addeditMemberSignup.totalremittedamount.value) + Number(document.f_addeditMemberSignup.indiMShip.value);
	}
	
	var cret;
	cret = confirm("The sum total that will be transacted is " + document.f_addeditMemberSignup.totalremittedamount.value);
	if (cret == false)
	{
		return cret;
	}
	
	
	

	//----
	return true;
}




function f_calculateRegtotal()
{
	// calculating total amount	

	document.f_addeditMemberSignup.totalremittedamount.value = 0;

	if (document.f_addeditMemberSignup.AnnualFee.checked == true )
	{
		document.f_addeditMemberSignup.totalremittedamount.value = Number(document.f_addeditMemberSignup.totalremittedamount.value) + 125;
	}
	
	if (document.f_addeditMemberSignup.LateFee.checked == true )
	{
		document.f_addeditMemberSignup.totalremittedamount.value = Number(document.f_addeditMemberSignup.totalremittedamount.value) + 25;
	}


	if (document.f_addeditMemberSignup.PharmEmeritus.checked == true )
	{
		document.f_addeditMemberSignup.totalremittedamount.value = Number(document.f_addeditMemberSignup.totalremittedamount.value) + 62.50;
	}

	
	/*if (document.f_addeditMemberSignup.comlegFee.value != "")
	{
		document.f_addeditMemberSignup.totalremittedamount.value = Number(document.f_addeditMemberSignup.totalremittedamount.value) + Number(document.f_addeditMemberSignup.comlegFee.value);
	}*/


	if (document.f_addeditMemberSignup.DistrictDue.value != "")
	{
		document.f_addeditMemberSignup.totalremittedamount.value = Number(document.f_addeditMemberSignup.totalremittedamount.value) + Number(document.f_addeditMemberSignup.DistrictDue.value);
	}


	if (document.f_addeditMemberSignup.send.value != "")
	{
		document.f_addeditMemberSignup.totalremittedamount.value = Number(document.f_addeditMemberSignup.totalremittedamount.value) + (Number(document.f_addeditMemberSignup.send.value)*25);
	}


	if (document.f_addeditMemberSignup.PhaBusMShip.value != "")
	{
		document.f_addeditMemberSignup.totalremittedamount.value = Number(document.f_addeditMemberSignup.totalremittedamount.value) + Number(document.f_addeditMemberSignup.PhaBusMShip.value);
	}


	if (document.f_addeditMemberSignup.corpMShip.value != "")
	{
		document.f_addeditMemberSignup.totalremittedamount.value = Number(document.f_addeditMemberSignup.totalremittedamount.value) + Number(document.f_addeditMemberSignup.corpMShip.value);
	}


	if (document.f_addeditMemberSignup.indiMShip.value != "")
	{
		document.f_addeditMemberSignup.totalremittedamount.value = Number(document.f_addeditMemberSignup.totalremittedamount.value) + Number(document.f_addeditMemberSignup.indiMShip.value);
	}

}

function f_addeditadminmembersignup_validate()
{

    if (document.f_addeditMemberSignup.licno.value=="")
	{
		alert("Licence No. Field cannot be null");
		document.f_addeditMemberSignup.licno.focus();
		return false;
	}
	if (document.f_addeditMemberSignup.licno.value.length > 255)
	{
		alert("Licence number should not exceed 255 Characters.");
		document.f_addeditMemberSignup.licno.focus();
		return (false);
	}
	if (document.f_addeditMemberSignup.first.value=="")
	{
		alert("First Name Field cannot be null");
		document.f_addeditMemberSignup.first.focus();
		return false;
	}
	if (document.f_addeditMemberSignup.last.value=="")
	{
		alert("Last Name Field cannot be null");
		document.f_addeditMemberSignup.last.focus();
		return false;
	}
	/*if (document.f_addeditMemberSignup.company.value=="")
	{
		alert("Company Name Field cannot be null");
		document.f_addeditMemberSignup.company.focus();
		return false;
	}*/
	if (document.f_addeditMemberSignup.mailingaddress.value=="")
	{
		alert("Mailing Address Field cannot be null");
		document.f_addeditMemberSignup.mailingaddress.focus();
		return false;
	}
	if (document.f_addeditMemberSignup.city.value=="")
	{
		alert("City Field cannot be null");
		document.f_addeditMemberSignup.city.focus();
		return false;
	}
	/*if (document.f_addeditMemberSignup.state.selectedIndex <= 0)
	{
		alert("Please select one of the \"State\" options.");
		document.f_addeditMemberSignup.state.focus();
		return (false);
	}*/
	if (document.f_addeditMemberSignup.zip.value=="")
	{
		alert("Zip Code Field cannot be null");
		document.f_addeditMemberSignup.zip.focus();
		return false;
	}
	if (document.f_addeditMemberSignup.zip.value != "")
	{
		var txtzip = document.f_addeditMemberSignup.zip;
		   if (isNaN(txtzip.value) == true)
		   {
			  alert("Please enter a valid zip code");
			  document.f_addeditMemberSignup.zip.focus();
			  document.f_addeditMemberSignup.zip.select();
			  return false;
		   }
	}

	

	if (document.f_addeditMemberSignup.homephone.value=="")
	{
		alert("Home Phone Field cannot be null");
		document.f_addeditMemberSignup.homephone.focus();
		return false;
	}

	/*if (document.f_addeditMemberSignup.homefax.value=="")
	{
		alert("Home Fax Field cannot be null. If not applicable please enter N/A.");
		document.f_addeditMemberSignup.homefax.focus();
		return false;
	}

	if (document.f_addeditMemberSignup.employer.value=="")
	{
		alert("Employer Field cannot be null");
		document.f_addeditMemberSignup.employer.focus();
		return false;
	}

	if (document.f_addeditMemberSignup.workaddress.value=="")
	{
		alert("Work Mailing Address Field cannot be null");
		document.f_addeditMemberSignup.workaddress.focus();
		return false;
	}


	if (document.f_addeditMemberSignup.city2.value=="")
	{
		alert("City Field cannot be null");
		document.f_addeditMemberSignup.city2.focus();
		return false;
	}
	if (document.f_addeditMemberSignup.homestate.selectedIndex <= 0)
	{
		alert("Please select one of the \"State\" options.");
		document.f_addeditMemberSignup.homestate.focus();
		return (false);
	}
	if (document.f_addeditMemberSignup.zip2.value=="")
	{
		alert("Zip Code Field cannot be null");
		document.f_addeditMemberSignup.zip2.focus();
		return false;
	}
	if (document.f_addeditMemberSignup.zip2.value != "")
	{
		var txtzip = document.f_addeditMemberSignup.zip2;
		   if (isNaN(txtzip.value) == true)
		   {
			  alert("Please enter a valid zip code");
			  document.f_addeditMemberSignup.zip2.focus();
			  document.f_addeditMemberSignup.zip2.select();
			  return false;
		   }
	}

	if (document.f_addeditMemberSignup.workphone.value=="")
	{
		alert("Work Phone Field cannot be null");
		document.f_addeditMemberSignup.workphone.focus();
		return false;
	}

	if (document.f_addeditMemberSignup.workfax.value=="")
	{
		alert("Work Fax Field cannot be null. If not applicable please enter N/A.");
		document.f_addeditMemberSignup.workfax.focus();
		return false;
	}
	if (document.f_addeditMemberSignup.degree.value=="")
	{
		alert("Degree Field cannot be null");
		document.f_addeditMemberSignup.degree.focus();
		return false;
	}
	

	
	var checkOK = "0123456789";
	var checkStr = document.f_addeditMemberSignup.zip.value;
	var allValid = true;
	var allNum = "";
	if (document.f_addeditMemberSignup.zip.value != "")
	{
		for (i = 0;  i < checkStr.length;  i++)
		{
			ch = checkStr.charAt(i);
			for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j))
			break;
			if (j == checkOK.length)
			{
				allValid = false;
				break;
			}
			if (ch != ",")
			allNum += ch;
		}
		if (!allValid)
		{
			alert("Please enter only digit characters in the \"Zip Code\" field.");
			document.f_addeditMemberSignup.zip.focus();
			return (false);
		}
	}
	  
	
	if (document.f_addeditMemberSignup.ss.value=="")
	{
		alert("SS# Field cannot be null");
		document.f_addeditMemberSignup.ss.focus();
		return false;
	}

	if (document.f_addeditMemberSignup.practice.value=="")
	{
		alert("Practice Field cannot be null");
		document.f_addeditMemberSignup.practice.focus();
		return false;
	}
	if (document.f_addeditMemberSignup.email.value=="")
	{
		alert("Email Field cannot be null. If not applicable please enter N/A.");
		document.f_addeditMemberSignup.email.focus();
		return false;
	}

    myOption = -1;
	for (i=0; i<document.f_addeditMemberSignup.yesno.length; i++) 
	{
		if (document.f_addeditMemberSignup.yesno[i].checked) 
		{
			myOption = i;
		}
	}
	if (myOption == 1) 
	{
		if (document.f_addeditMemberSignup.resstate.value == "")
		{
			alert("Please select one of the restricted \"State\" options under phamacist's license .");
			document.f_addeditMemberSignup.resstate.focus();
			return false;
		}
	}
	
	//----
	/* var checkEmail = "@.";
	var checkStr = document.f_addeditMemberSignup.email.value;
	var EmailValid = false;
	var EmailAt = false;
	var EmailPeriod = false;
	if (document.f_addeditMemberSignup.email.value != "")
	{
	
		for (i = 0;  i < checkStr.length;  i++)
		{
		  ch = checkStr.charAt(i);
		  for (j = 0;  j < checkEmail.length;  j++)
		  {
			if (ch == checkEmail.charAt(j) && ch == "@")
			EmailAt = true;
			if (ch == checkEmail.charAt(j) && ch == ".")
			EmailPeriod = true;
			  if (EmailAt && EmailPeriod)
				break;
			  if (j == checkEmail.length)
				break;
		  }
			// if both the @ and . were in the string
			if (EmailAt && EmailPeriod)
			{
				EmailValid = true
				break;
			 }
		}
		if (!EmailValid)
		{
			alert("The \"email\" field must contain an \"@\" and a \".\".");
			document.f_addeditMemberSignup.email.focus();
			return false;
		}
	}
	*/

	if ((document.f_addeditMemberSignup.AnnualFee.checked == false) && (document.f_addeditMemberSignup.PharmEmeritus.checked == false))
	{
		alert("Please select either one of Annual Renewal Fee or Pharmacist Emeritus");
		document.f_addeditMemberSignup.AnnualFee.focus();
		return false;
	}
	
	//if (document.f_addeditMemberSignup.CLFeeCheck.checked == true)
	//{
	//	if (document.f_addeditMemberSignup.comlegFee.value == "")
	//	{
	//		alert("Please enter Commercial & Legislative Amount");
	//		document.f_addeditMemberSignup.comlegFee.focus();
	//		return (false);
	//	}
	//}
	
	//if (document.f_addeditMemberSignup.comlegFee.value != "")
	//	{
	//	   if (isNaN(document.f_addeditMemberSignup.comlegFee.value) == false)
	//		{
	//		   if (document.f_addeditMemberSignup.comlegFee.value < 35)
	//		   {
	//			    alert("Please Enter Commercial & Legislative Amount > 35");
	//				document.f_addeditMemberSignup.comlegFee.focus();
	//				return (false);
	//		   }
	//		}
	//	}

	if (document.f_addeditMemberSignup.DistrictDueCheck.checked == true)
	{
		var radio_choice = false;

		// Loop from zero to the one minus the number of radio button selections
		for (counter = 0; counter < document.f_addeditMemberSignup.district.length; counter++)
		{
		// If a radio button has been selected it will return true
		// (If not it will return false)
		if (document.f_addeditMemberSignup.district[counter].checked)
		radio_choice = true; 
		}

		if (!radio_choice)
		{
		// If there were no selections made display an alert box 
		alert("Please select a District.");
		document.f_addeditMemberSignup.DistrictDueCheck.focus();
		return (false);
		}
	}

	//===
	if (document.f_addeditMemberSignup.PhaBusMShip.value != "" )
	{
		if (document.f_addeditMemberSignup.nameOfPhaBus.value == "")
		{
			alert("Please enter Name of Pharmacy/Business")
			document.f_addeditMemberSignup.nameOfPhaBus.focus();
			document.f_addeditMemberSignup.nameOfPhaBus.select();
			return (false);
		}
		if (document.f_addeditMemberSignup.nameOfIndInc.value == "")
		{
			alert("Please enter Name of Individual Included")
			document.f_addeditMemberSignup.nameOfIndInc.focus();
			document.f_addeditMemberSignup.nameOfIndInc.select();
			return (false);
		}
		if (document.f_addeditMemberSignup.PhaBusMShip.value == "")
		{
			alert("Please enter Pharmacy or Business Membership Amount")
			document.f_addeditMemberSignup.PhaBusMShip.focus();
			document.f_addeditMemberSignup.PhaBusMShip.select();
			return (false);
		}
		if (document.f_addeditMemberSignup.PhaBusMShip.value != "")
		{
		   var txtPhaBus = document.f_addeditMemberSignup.PhaBusMShip;
		   if (isNaN(txtPhaBus.value) == true)
		   {
			  alert("Please enter a valid Numeric Value");
			  document.f_addeditMemberSignup.PhaBusMShip.focus();
			  document.f_addeditMemberSignup.PhaBusMShip.select();
			  return false;
		   }
		   if (isNaN(txtPhaBus.value) == false)
			{
			   if (txtPhaBus.value < 100)
			   {
				    alert("Please Enter Pharmacy or Business Membership Amount > 100")
					return (false);
			   }
			}
		}
	}

	if (document.f_addeditMemberSignup.corpMShip.value != "")
	{
		if (document.f_addeditMemberSignup.nameOfCorp.value == "")
		{
			alert("Please enter Name of Corporation");
			document.f_addeditMemberSignup.nameOfCorp.focus();
			document.f_addeditMemberSignup.nameOfCorp.select();
			return (false);
		}
		if (document.f_addeditMemberSignup.nameOfCorIndInc.value == "")
		{
			alert("Please enter Name of Individual Included");
			document.f_addeditMemberSignup.nameOfCorIndInc.focus();
			document.f_addeditMemberSignup.nameOfCorIndInc.select();
			return (false);
		}
		if (document.f_addeditMemberSignup.corpMShip.value == "")
		{
			alert("Please enter Corporate Membership Amount");
			document.f_addeditMemberSignup.corpMShip.focus();
			document.f_addeditMemberSignup.corpMShip.select();
			return (false);
		}
		if (document.f_addeditMemberSignup.corpMShip.value != "")
		{
		   var txtPhaBus = document.f_addeditMemberSignup.corpMShip;
		   if (isNaN(txtPhaBus.value) == true)
		   {
			   alert("Please enter a valid Numeric Value");
			   document.f_addeditMemberSignup.corpMShip.focus();
			   document.f_addeditMemberSignup.corpMShip.select();
			   return (false);
		   }
		   if (isNaN(txtPhaBus.value) == false)
			{
			   if (txtPhaBus.value < 200)
			   {
				    alert("Please Enter Corporate Membership Amount >= 200")
					return (false);
			   }
			}
		}
	}

	//if (document.f_addeditMemberSignup.indiMShip.value != "")
	//{
		var radio_choice = false;

		// Loop from zero to the one minus the number of radio button selections
		for (counter = 0; counter < document.f_addeditMemberSignup.rdIndvLevel.length; counter++)
		{
		// If a radio button has been selected it will return true
		// (If not it will return false)
			if (document.f_addeditMemberSignup.rdIndvLevel[counter].checked)
				radio_choice = true; 
		}

		/*if (!radio_choice)
		{
			// If there were no selections made display an alert box 
			alert("Please select Individual Membership.")
			return (false);
		}*/
		
		//---
		myOption = -1;
		for (i=0; i<document.f_addeditMemberSignup.rdIndvLevel.length; i++) 
		{
			if (document.f_addeditMemberSignup.rdIndvLevel[i].checked) 
			{
				myOption = i;
			}
		}
		if (myOption == 2) 
		{
			if (document.f_addeditMemberSignup.IndvLevelOther.value == "")
			{
				alert("Please Enter value for Individual Membership.");
				document.f_addeditMemberSignup.IndvLevelOther.focus();
				document.f_addeditMemberSignup.IndvLevelOther.select();
				return (false);
			}
			if (document.f_addeditMemberSignup.IndvLevelOther.value != "")
			{
			   var txtPhaBus = document.f_addeditMemberSignup.IndvLevelOther;
			   if (isNaN(txtPhaBus.value) == true)
			   {
				   alert("Please enter a valid Numeric Value");
				   document.f_addeditMemberSignup.IndvLevelOther.focus();
				   document.f_addeditMemberSignup.IndvLevelOther.select();
				   return (false);
			   }
			   if (isNaN(txtPhaBus.value) == false)
				{
				   /* if (txtPhaBus.value < 50)
				   {
						alert("Please Enter Individual Membership Amount >= 50")
						return (false);
				   }*/
				}
			}
		}


		//---

		//if (document.f_addeditMemberSignup.rdIndvName.value == "")
		//{
		//	alert("Please enter Name of Individual");
		//	document.f_addeditMemberSignup.rdIndvName.focus();
		//	document.f_addeditMemberSignup.rdIndvName.select();
		//	return (false);
		//}
	//}
	
	
	// calculating total amount

	document.f_addeditMemberSignup.totalremittedamount.value = 0;

	if (document.f_addeditMemberSignup.AnnualFee.checked == true )
	{
		document.f_addeditMemberSignup.totalremittedamount.value = Number(document.f_addeditMemberSignup.totalremittedamount.value) + 125;
	}
	
	if (document.f_addeditMemberSignup.LateFee.checked == true )
	{
		document.f_addeditMemberSignup.totalremittedamount.value = Number(document.f_addeditMemberSignup.totalremittedamount.value) + 25;
	}


	if (document.f_addeditMemberSignup.PharmEmeritus.checked == true )
	{
		document.f_addeditMemberSignup.totalremittedamount.value = Number(document.f_addeditMemberSignup.totalremittedamount.value) + 62.50;
	}

	
	/*if (document.f_addeditMemberSignup.comlegFee.value != "")
	{
		document.f_addeditMemberSignup.totalremittedamount.value = Number(document.f_addeditMemberSignup.totalremittedamount.value) + Number(document.f_addeditMemberSignup.comlegFee.value);
	}*/


	if (document.f_addeditMemberSignup.DistrictDue.value != "")
	{
		document.f_addeditMemberSignup.totalremittedamount.value = Number(document.f_addeditMemberSignup.totalremittedamount.value) + Number(document.f_addeditMemberSignup.DistrictDue.value);
	}


	if (document.f_addeditMemberSignup.send.value != "")
	{
		document.f_addeditMemberSignup.totalremittedamount.value = Number(document.f_addeditMemberSignup.totalremittedamount.value) + (Number(document.f_addeditMemberSignup.send.value)*25);
	}


	if (document.f_addeditMemberSignup.PhaBusMShip.value != "")
	{
		document.f_addeditMemberSignup.totalremittedamount.value = Number(document.f_addeditMemberSignup.totalremittedamount.value) + Number(document.f_addeditMemberSignup.PhaBusMShip.value);
	}


	if (document.f_addeditMemberSignup.corpMShip.value != "")
	{
		document.f_addeditMemberSignup.totalremittedamount.value = Number(document.f_addeditMemberSignup.totalremittedamount.value) + Number(document.f_addeditMemberSignup.corpMShip.value);
	}


	if (document.f_addeditMemberSignup.indiMShip.value != "")
	{
		document.f_addeditMemberSignup.totalremittedamount.value = Number(document.f_addeditMemberSignup.totalremittedamount.value) + Number(document.f_addeditMemberSignup.indiMShip.value);
	}
	
	var cret;
	cret = confirm("The sum total that will be transacted is " + document.f_addeditMemberSignup.totalremittedamount.value);
	if (cret == false)
	{
		return cret;
	}
	
	
	

	//----
	return true;
}


function f_addeditMembRegSignup_validate()
{
	// Calculate the total Hours
	var totalhrs;
	totalhrs=0;

	//totalhrs = totalhrs +  Number(document.f_addeditMembRegSignup.eduhourscount.value);

	//if(document.f_addeditMembRegSignup.getElementById("bankcecount")) {

		//alert("Thank you");

	for (i=1;i<=document.f_addeditMembRegSignup.bankcecount.value; i++ )
	{
		var x;
		var y;
		x = "document.f_addeditMembRegSignup.he"+i; 
		y = "document.f_addeditMembRegSignup.bankce"+i;
		if (eval(y).checked)
		{
			totalhrs = totalhrs +  Number(eval(x).value);
		}
	}

	for (i=1;i<=document.f_addeditMembRegSignup.eduhourscount.value; i++ )
	{
		var x;
		var y;
		x = "document.f_addeditMembRegSignup.eduhourshe"+i; 
		y = "document.f_addeditMembRegSignup.eduhours"+i;
		if (eval(y).checked)
		{
			totalhrs = totalhrs +  Number(eval(x).value);
		}
	}


	//}

	for (i=1;i<=12 ;i++ )
	{
		var c;		
		var a;
		var b;
		var d;
		c ="document.f_addeditMembRegSignup.ProgHours"+i;
		a ="document.f_addeditMembRegSignup.ProgName"+i;
		b ="document.f_addeditMembRegSignup.ProgLoc"+i;
		d ="document.f_addeditMembRegSignup.ProgStartDate"+i;
		e ="document.f_addeditMembRegSignup.ProgEndDate"+i;

		if (eval(a).value=="" && eval(b).value=="" && eval(c).value=="" && eval(d).value=="")
		{
		}
		else
		{
			if (eval(a).value!="" && eval(b).value!="" && eval(c).value!="" && eval(d).value!="")
			{
			}
			else
			{
				alert("All the fields Program Name / Program Location / Program Date and Program Hours is required.");
				eval(a).focus();
				return false;
			}
		}

		
		if (eval(d).value!="")
		{
			if (isDate(eval(d).value))
			{
			}
			else
			{
				eval(d).focus();
				return false;
			}
		}	
		
		if (eval(e).value!="")
		{
			if (isDate(eval(e).value))
			{
			}
			else
			{
				eval(e).focus();
				return false;
			}
		}	

		if (isNaN(eval(c).value))
		{
			alert("The Value in Program Hours Field need to be a Numeric Value");
			eval(c).focus();
			return false;
		}
		
		if (eval(c).value != "")
		{
			totalhrs = totalhrs + Number(eval(c).value);
		}
		
	}

	var d = new Date(document.f_addeditMembRegSignup.dategraduated.value);

	var todayDate = new Date();

	if(document.f_addeditMembRegSignup.pharmEmeritusChecked.value=="1")
		return true;

	if(parseInt(d.getFullYear())==parseInt(todayDate.getFullYear()) && parseInt(d.getMonth())>=4) {
		if (totalhrs < 2)
		{
			alert("The Number of Program Hrs must be 2 or greater. Please adjust the values in the Program hour Fields");
			return false;
		}
	}
	else {
		if(parseInt(d.getFullYear())==(parseInt(todayDate.getFullYear())-1) && parseInt(d.getMonth())>=11) {
			if (totalhrs < 9)
			{
				alert("The Number of Program Hrs must be 9 or greater. Please adjust the values in the Program hour Fields");
				return false;
			}
		}
		else
		{	
			// Sum shouldnot be greater than 12
			if (totalhrs < 12)
			{
				alert("The Number of Program Hrs must be 12 or greater. Please adjust the values in the Program hour Fields");
				return false;
			}
		}
	}

	return true;

	/*return false


	if (document.f_addeditMembRegSignup.ProgHours.value != "")
		{
		   var txtPhaBus = document.f_addeditMembRegSignup.ProgHours;
		   if (isNaN(txtPhaBus.value) == true)
		   {
			   alert("Please enter a valid Numeric Value");
			   document.f_addeditMembRegSignup.ProgHours.focus();
			   document.f_addeditMembRegSignup.ProgHours.select();
			   return (false);
		   }
		   if (isNaN(txtPhaBus.value) == false)
			{
			   if (Number(txtPhaBus.value) > 12)
			   {
				    alert("Please Enter Hours  <= 12")
					return (false);
			   }
			}
		}
	isDate(document.f_addeditMembRegSignup.ProgDate.value);*/
	
	
}

function isDate(dateStr) {

var datePat = /^(\d{1,2})(\/|-)(\d{1,2})(\/|-)(\d{4})$/;
var matchArray = dateStr.match(datePat); // is the format ok?

if (matchArray == null) {
alert("Please enter date in mm/dd/yyyy format.");
return false;
}

month = matchArray[1]; // p@rse date into variables
day = matchArray[3];
year = matchArray[5];

if (month < 1 || month > 12) { // check month range
alert("Month must be between 1 and 12.");
return false;
}

if (day < 1 || day > 31) {
alert("Day must be between 1 and 31.");
return false;
}

if ((month==4 || month==6 || month==9 || month==11) && day==31) {
alert("Month "+month+" doesn`t have 31 days!")
return false;
}

if (month == 2) { // check for february 29th
var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
if (day > 29 || (day==29 && !isleap)) {
alert("February " + year + " doesn`t have " + day + " days!");
return false;
}
}
return true; // date is valid
}

/*
function txtzip_onblur()
{
   var txtzip = document.f_addeditMemberSignup.zip;
   if (isNaN(txtzip.value) == true)
   {
      alert("Please enter a valid zip code");
      document.f_addeditMemberSignup.zip.focus();
      document.f_addeditMemberSignup.zip.select();
   }
} 
*/

function rdClick()
{
	   
		for (i=0; i<document.f_addeditMemberSignup.district.length; i++) 
		{
		  
			if (document.f_addeditMemberSignup.district[i].checked) 
			{
				myOption = i;
			}
		} 
		
		if (myOption == 0 || myOption == 2 || myOption == 3 || myOption == 4 || myOption == 7 || myOption == 8) 
		{
			document.f_addeditMemberSignup.DistrictDue.value = 10;
			document.f_addeditMemberSignup.DistrictDueCheck.checked = true;
		}
		if (myOption == 5 || myOption== 6 )
		{
			document.f_addeditMemberSignup.DistrictDue.value = 5;
			document.f_addeditMemberSignup.DistrictDueCheck.checked = true;
		} 		
		if (myOption == 1 )
		{
			document.f_addeditMemberSignup.DistrictDue.value = 20;
			document.f_addeditMemberSignup.DistrictDueCheck.checked = true;
		} 
				
}

function rdClickCandL()
{
	   
		for (i=0; i<document.f_CandL.district.length; i++) 
		{
		  
			if (document.f_CandL.district[i].checked) 
			{
				myOption = i;
			}
		} 
		
		if (myOption == 0 || myOption == 2 || myOption == 3 || myOption == 4  || myOption == 6 || myOption == 7 || myOption == 8) 
		{
			document.f_CandL.DistrictDue.value = 10;
			document.f_CandL.DistrictDueCheck.checked = true;
		}
		if (myOption== 10 )
		{
			document.f_CandL.DistrictDue.value = 5;
			document.f_CandL.DistrictDueCheck.checked = true;
		} 
		
		if (myOption== 1 || myOption == 5 )
		{
			document.f_CandL.DistrictDue.value = 20;
			document.f_CandL.DistrictDueCheck.checked = true;
		} 
				
}

function rdDistrictCheck()
{
			if (document.f_addeditMemberSignup.DistrictDueCheck.checked == false) 
			{
				document.f_addeditMemberSignup.DistrictDue.value = 0;
				
				// Loop from zero to the one minus the number of radio button selections
				for (counter = 0; counter < document.f_addeditMemberSignup.district.length; counter++)
				{
				// If a radio button has been selected it will return true
				// (If not it will return false)
				document.f_addeditMemberSignup.district[counter].checked = false;
				}
			}
}

function rdDistrictCheckCandL()
{
			if (document.f_CandL.DistrictDueCheck.checked == false) 
			{
				document.f_CandL.DistrictDue.value = 0;
				
				// Loop from zero to the one minus the number of radio button selections
				for (counter = 0; counter < document.f_CandL.district.length; counter++)
				{
				// If a radio button has been selected it will return true
				// (If not it will return false)
				document.f_CandL.district[counter].checked = false;
				}
			}
}

function rdIndClick()
{
	for (i=0; i<document.f_addeditMemberSignup.rdIndvLevel.length; i++) 
		{
		  
			if (document.f_addeditMemberSignup.rdIndvLevel[i].checked) 
			{
				myOption = i;
			}
		} 
		
		/*if (myOption == 0) 
		{
			document.f_addeditMemberSignup.indiMShip.value = 35;
		}*/
		if (myOption == 0) 
		{
			document.f_addeditMemberSignup.indiMShip.value = 50;
		}
		if (myOption == 1) 
		{
			document.f_addeditMemberSignup.indiMShip.value = 75;
		}
}

function IndvonBlur()
{
	if (document.f_addeditMemberSignup.IndvLevelOther.value!="")
	{
		document.f_addeditMemberSignup.indiMShip.value = document.f_addeditMemberSignup.IndvLevelOther.value;
	}
	
}


function transfer(mypath)
{
		if (document.f_addeditMembRegSignup.ProgHours.value != "")
		{
		   var txtPhaBus = document.f_addeditMembRegSignup.ProgHours;
		   if (isNaN(txtPhaBus.value) == true)
		   {
			   alert("Please enter a valid Numeric Value");
			   document.f_addeditMembRegSignup.ProgHours.value=0;
			   document.f_addeditMembRegSignup.ProgHours.focus();
			   document.f_addeditMembRegSignup.ProgHours.select();
			   return (false);
		   }
		   else
			{
			   /*if (txtPhaBus.value > 12)
			   {
				    alert("Please Enter Hours  <= 12")
					document.f_addeditMembRegSignup.ProgHours.value=0;
					document.f_addeditMembRegSignup.ProgHours.focus();
					return (false);
			   }*/
			}
			document.f_addeditMembRegSignup.action = mypath;
			document.f_addeditMembRegSignup.submit();
			return true;
		}
		else
		{
			alert("Please enter a Value");
			document.f_addeditMembRegSignup.ProgHours.focus();
			return false;	
		}
}

function clickPharm()
{
 	if (document.f_addeditMemberSignup.AnnualFee.checked == true)
	{		
//		document.f_addeditMemberSignup.PharmEmeritus.checked = false;
		document.f_addeditMemberSignup.LateFee.checked = true;
		return true;
	}
	document.f_addeditMemberSignup.LateFee.checked = true;
}
function clickAdminPharm()
{
 	if (document.f_addeditMemberSignup.AnnualFee.checked == true)
	{
		
		document.f_addeditMemberSignup.PharmEmeritus.checked = false

		return true;
	}

}
function clickPharm1()
{
	if ((document.f_addeditMemberSignup.PharmEmeritus.checked == true))
	{
		
//		document.f_addeditMemberSignup.AnnualFee.checked = false;		
		document.f_addeditMemberSignup.LateFee.checked = true;
		return true;
	}
	document.f_addeditMemberSignup.LateFee.checked = true;
	
}

function clickAdminPharm1()
{
	if ((document.f_addeditMemberSignup.PharmEmeritus.checked == true))
	{
		
		document.f_addeditMemberSignup.AnnualFee.checked = false;		
		
		return true;
	}

	
}

function f_addeditmembersignupconfirm_validate()
{
	//alert("in");

	if (document.f_addeditMemberSignup.cardType.selectedIndex <= 0)
	{
		alert("Please select Card Type.");
		document.f_addeditMemberSignup.cardType.focus();
	   
		return (false);
	}

    if (document.f_addeditMemberSignup.cardNumber.value == "")
	{
		alert("Card Number field cannot be blank.");
		document.f_addeditMemberSignup.cardNumber.focus();
	    
		return (false);
	}
	
	if (document.f_addeditMemberSignup.FirstName.value == "")
	{
		alert("Firstname field cannot be blank.");
		document.f_addeditMemberSignup.FirstName.focus();		
	    
		return (false);
	}
	if (document.f_addeditMemberSignup.LastName.value == "")
	{
		alert("Lastname field cannot be blank.");
		document.f_addeditMemberSignup.LastName.focus();		
	    
		return (false);
	}

	if (document.f_addeditMemberSignup.cardMonth.selectedIndex <= 0)
	{
		alert("Please select a month.");
		document.f_addeditMemberSignup.cardMonth.focus();
	    
		return (false);
	}

	if (document.f_addeditMemberSignup.cardYear.selectedIndex <= 0)
	{
		alert("Please select an year.");
		document.f_addeditMemberSignup.cardYear.focus();
	    	
		return (false);
	}

	if (document.f_addeditMemberSignup.SCODE.value == "")
	{
		alert("Security Code field cannot be blank.");
		document.f_addeditMemberSignup.SCODE.focus();
	    	
		return (false);
	}
	if (document.f_addeditMemberSignup.BillingAddress.value == "")
	{
		alert("Billing Address field cannot be blank.");
		document.f_addeditMemberSignup.BillingAddress.focus();
	    	
		return (false);
	}
	if (document.f_addeditMemberSignup.BillingCity.value == "")
	{
		alert("Billing City field cannot be blank.");
		document.f_addeditMemberSignup.BillingCity.focus();
	    	
		return (false);
	}
	//alert(document.f_addeditMemberSignup.BillingState.value);
	if (document.f_addeditMemberSignup.BillingState.value == "")
	{
		alert("Please a Billing State.");
		document.f_addeditMemberSignup.BillingState.focus();
	    	
		return (false);
	}
	if (document.f_addeditMemberSignup.BillingZip.value == "")
	{
		alert("Billing Zip field cannot be blank.");
		document.f_addeditMemberSignup.BillingZip.focus();
	    	
		return (false);
	}
	return true;
}

function f_addeditbankce_validate()
{
	if (document.f_addeditbankce.ProgName.value=="")
	{
		alert("The Program Name Field is required.");
		document.f_addeditbankce.ProgName.focus();
		return false;
	}
	if (document.f_addeditbankce.ProgLocation.value=="")
	{
		alert("The Program Location Field is required.");
		document.f_addeditbankce.ProgLocation.focus();
		return false;
	}
	if (document.f_addeditbankce.ProgStartDate.value=="")
	{
		alert("The Program Start Date Field is required.");
		document.f_addeditbankce.ProgStartDate.focus();
		return false;
	}
	if (isDate(document.f_addeditbankce.ProgStartDate.value))
	{
	}
	else
	{
		document.f_addeditbankce.ProgStartDate.focus();
		return false;
	}
	if (document.f_addeditbankce.ProgEndDate.value!="")
	{
		if (isDate(document.f_addeditbankce.ProgEndDate.value))
		{
		}
		else
		{
			document.f_addeditbankce.ProgEndDate.focus();
			return false;
		}
	}
	
	if (document.f_addeditbankce.HoursEarn.value=="")
	{
		alert("The Hours Earned Field is required.");
		document.f_addeditbankce.HoursEarn.focus();
		return false;
	}
	return true;
}

function f_addeditcehours_validate()
{
	if (document.f_addeditcehours.ProgName.value=="")
	{
		alert("The Program Name Field is required.");
		document.f_addeditcehours.ProgName.focus();
		return false;
	}
	if (document.f_addeditcehours.ProgLocation.value=="")
	{
		alert("The Program Location Field is required.");
		document.f_addeditcehours.ProgLocation.focus();
		return false;
	}
	if (document.f_addeditcehours.ProgStartDate.value=="")
	{
		alert("The Program Start Date Field is required.");
		document.f_addeditcehours.ProgStartDate.focus();
		return false;
	}
	if (isDate(document.f_addeditcehours.ProgStartDate.value))
	{
	}
	else
	{
		document.f_addeditcehours.ProgStartDate.focus();
		return false;
	}
	if (document.f_addeditcehours.ProgEndDate.value!="")
	{
		if (isDate(document.f_addeditcehours.ProgEndDate.value))
		{
		}
		else
		{
			document.f_addeditcehours.ProgEndDate.focus();
			return false;
		}
	}
	
	if (document.f_addeditcehours.HoursEarn.value=="")
	{
		alert("The Hours Earned Field is required.");
		document.f_addeditcehours.HoursEarn.focus();
		return false;
	}
	return true;
}

function isDate(dateStr) 
{

	var datePat = /^(\d{1,2})(\/|-)(\d{1,2})(\/|-)(\d{4})$/;
	var matchArray = dateStr.match(datePat); // is the format ok?

	if (matchArray == null) {
	alert("Please enter date in mm/dd/yyyy format.");
	return false;
	}

	month = matchArray[1]; // p@rse date into variables
	day = matchArray[3];
	year = matchArray[5];

	if (month < 1 || month > 12) { // check month range
	alert("Month must be between 1 and 12.");
	return false;
	}

	if (day < 1 || day > 31) {
	alert("Day must be between 1 and 31.");
	return false;
	}

	if ((month==4 || month==6 || month==9 || month==11) && day==31) {
	alert("Month "+month+" doesn`t have 31 days!")
	return false;
	}

	if (month == 2) { // check for february 29th
	var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
	if (day > 29 || (day==29 && !isleap)) {
	alert("February " + year + " doesn`t have " + day + " days!");
	return false;
	}
	}
	return true; // date is valid
}

function validateProgHours()
{
	var form = document.f_addeditMembRegSignup;
	var errorMsg = false;

	if (form.ProgHours1.value!="") {
		if (isNaN(form.ProgHours1.value))
		{
			errorMsg = true;			
		}
	}

	if (form.ProgHours2.value!="") {
		if (isNaN(form.ProgHours2.value))
		{
			errorMsg = true;			
		}
	}
	if (form.ProgHours3.value!="") {
		if (isNaN(form.ProgHours3.value))
		{
			errorMsg = true;
		}
	}
	if (form.ProgHours4.value!="") {
		if (isNaN(form.ProgHours4.value))
		{
			errorMsg = true;
		}
	}
	if (form.ProgHours5.value!="") {
		if (isNaN(form.ProgHours5.value))
		{
			errorMsg = true;
		}
	}
	if (form.ProgHours6.value!="") {
		if (isNaN(form.ProgHours6.value))
		{
			errorMsg = true;
		}
	}
	if (form.ProgHours7.value!="") {
		if (isNaN(form.ProgHours7.value))
		{
			errorMsg = true;
		}
	}
	if (form.ProgHours8.value!="") {
		if (isNaN(form.ProgHours8.value))
		{
			errorMsg = true;
		}
	}
	if (form.ProgHours9.value!="") {
		if (isNaN(form.ProgHours9.value))
		{
			errorMsg = true;
		}
	}
	if (form.ProgHours10.value!="") {
		if (isNaN(form.ProgHours10.value))
		{
			errorMsg = true;
		}
	}

	if (form.ProgHours11.value!="") {
		if (isNaN(form.ProgHours11.value))
		{
			errorMsg = true;
		}
	}

	if (form.ProgHours12.value!="") {
		if (isNaN(form.ProgHours12.value))
		{
			errorMsg = true;
		}
	}	
	
	if(errorMsg) {
		alert("Program hours should be numeric and should not contain alphabets or special characters.");	return false;
	}

	return true;
}

function f_editreg_validate()
{
	var form = document.f_editreg;	
	
	if (form.first.value=="")
	{
		alert("First Name Field cannot be null");
		form.first.focus();
		return false;
	}
	if (form.last.value=="")
	{
		alert("Last Name Field cannot be null");
		form.last.focus();
		return false;
	}
	
	if (form.mailingaddress.value=="")
	{
		alert("Mailing Address Field cannot be null");
		form.mailingaddress.focus();
		return false;
	}
	if (form.city.value=="")
	{
		alert("City Field cannot be null");
		form.city.focus();
		return false;
	}
	
	if (form.zip.value=="")
	{
		alert("Zip Code Field cannot be null");
		form.zip.focus();
		return false;
	}
	if (form.zip.value != "")
	{
		var txtzip = form.zip;
		   if (isNaN(txtzip.value) == true)
		   {
			  alert("Please enter a valid zip code");
			  form.zip.focus();
			  form.zip.select();
			  return false;
		   }
	}	

	if (form.homephone.value=="")
	{
		alert("Home Phone Field cannot be null");
		form.homephone.focus();
		return false;
	}

	if (form.homefax.value=="")
	{
		alert("Home Fax Field cannot be null. If not applicable please enter N/A.");
		form.homefax.focus();
		return false;
	}

	if (form.employer.value=="")
	{
		alert("Employer Field cannot be null");
		form.employer.focus();
		return false;
	}

	if (form.workaddress.value=="")
	{
		alert("Work Mailing Address Field cannot be null");
		form.workaddress.focus();
		return false;
	}

	if (form.city2.value=="")
	{
		alert("City Field cannot be null");
		form.city2.focus();
		return false;
	}
	
	if (form.zip2.value=="")
	{
		alert("Zip Code Field cannot be null");
		form.zip2.focus();
		return false;
	}
	if (form.zip2.value != "")
	{
		var txtzip = form.zip2;
		   if (isNaN(txtzip.value) == true)
		   {
			  alert("Please enter a valid zip code");
			  form.zip2.focus();
			  form.zip2.select();
			  return false;
		   }
	}

	if (form.workphone.value=="")
	{
		alert("Work Phone Field cannot be null");
		form.workphone.focus();
		return false;
	}

	if (form.workfax.value=="")
	{
		alert("Work Fax Field cannot be null. If not applicable please enter N/A.");
		form.workfax.focus();
		return false;
	}
	if (form.degree.value=="")
	{
		alert("Degree Field cannot be null");
		form.degree.focus();
		return false;
	}
	
	if (form.ss.value=="")
	{
		alert("SS# Field cannot be null");
		form.ss.focus();
		return false;
	}

	if (form.practice.value=="")
	{
		alert("Practice Field cannot be null");
		form.practice.focus();
		return false;
	}
	if (form.email.value=="")
	{
		alert("Email Field cannot be null. If not applicable please enter N/A.");
		form.email.focus();
		return false;
	}  
	
	return true;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features + ',left=0,top=0');
}





function f_candl_validate()
{
  
	if (document.f_CandL.firstname.value=="")
	{
		alert("First Name Field cannot be null");
		document.f_CandL.firstname.focus();
		return false;
	}
	if (document.f_CandL.lastname.value=="")
	{
		alert("Last Name Field cannot be null");
		document.f_CandL.lastname.focus();
		return false;
	}
	if (document.f_CandL.mailingaddress1.value=="")
	{
		alert("Mailing Address Field cannot be null");
		document.f_CandL.mailingaddress1.focus();
		return false;
	}
	if (document.f_CandL.city.value=="")
	{
		alert("City Field cannot be null");
		document.f_CandL.city.focus();
		return false;
	}
	
	if (document.f_CandL.state.value == "")
	{
		alert("State Field cannot be null");
		document.f_CandL.state.focus();
	    	
		return (false);
	}
	
	if (document.f_CandL.zipcode.value=="")
	{
		alert("Zip Code Field cannot be null");
		document.f_CandL.zipcode.focus();
		return false;
	}
	if (document.f_CandL.zipcode.value != "")
	{
		var txtzip = document.f_CandL.zipcode;
		   if (isNaN(txtzip.value) == true)
		   {
			  alert("Please enter a valid zip code");
			  document.f_CandL.zipcode.focus();
			  document.f_CandL.zipcode.select();
			  return false;
		   }
	}

	if (document.f_CandL.homephone.value=="")
	{
		alert("Home Phone Field cannot be null");
		document.f_CandL.homephone.focus();
		return false;
	}


/*	if (document.f_CandL.employer.value=="")
	{
		alert("Employer Field cannot be null");
		document.f_CandL.employer.focus();
		return false;
	}

	if (document.f_CandL.workaddress1.value=="")
	{
		alert("Work Mailing Address Field cannot be null");
		document.f_CandL.workaddress1.focus();
		return false;
	}


	if (document.f_CandL.workcity.value=="")
	{
		alert("City Field cannot be null");
		document.f_CandL.workcity.focus();
		return false;
	}
	
	
	if (document.f_CandL.workstate.value == "")
	{
		alert("Employer State Field cannot be null");
		document.f_CandL.workstate.focus();
	    	
		return (false);
	}
	
	if (document.f_CandL.workzipcode.value=="")
	{
		alert("Zip Code Field cannot be null");
		document.f_CandL.workzipcode.focus();
		return false;
	}
	if (document.f_CandL.workzipcode.value != "")
	{
		var txtzip = document.f_CandL.workzipcode;
		   if (isNaN(txtzip.value) == true)
		   {
			  alert("Please enter a valid zip code");
			  document.f_CandL.workzipcode.focus();
			  document.f_CandL.workzipcode.select();
			  return false;
		   }
	}

	if (document.f_CandL.workphone.value=="")
	{
		alert("Work Phone Field cannot be null");
		document.f_CandL.workphone.focus();
		return false;
	}

	if (document.f_CandL.workfax.value=="")
	{
		alert("Work Fax Field cannot be null. If not applicable please enter N/A.");
		document.f_CandL.workfax.focus();
		return false;
	}
*/
	if (document.f_CandL.email.value=="")
	{
		alert("Email Field cannot be null. If not applicable please enter N/A.");
		document.f_CandL.email.focus();
		return false;
	}


	if (document.f_CandL.pbmemberfee.value != "" && document.f_CandL.pbmemberfee.value != 0 )
	{
		if (document.f_CandL.pharmorbusiness.value == "")
		{
			alert("Please enter Name of Pharmacy/Business")
			document.f_CandL.pharmorbusiness.focus();
			document.f_CandL.pharmorbusiness.select();
			return (false);
		}
		if (document.f_CandL.pbmemberindvname.value == "")
		{
			alert("Please enter Name of Individual Included")
			document.f_CandL.pbmemberindvname.focus();
			document.f_CandL.pbmemberindvname.select();
			return (false);
		}
		if (document.f_CandL.pbmemberfee.value == "")
		{
			alert("Please enter Pharmacy or Business Membership Amount")
			document.f_CandL.pbmemberfee.focus();
			document.f_CandL.pbmemberfee.select();
			return (false);
		}
		if (document.f_CandL.pbmemberfee.value != "")
		{
		   var txtPhaBus = document.f_CandL.pbmemberfee;
		   if (isNaN(txtPhaBus.value) == true)
		   {
			  alert("Please enter a valid Numeric Value");
			  document.f_CandL.pbmemberfee.focus();
			  document.f_CandL.pbmemberfee.select();
			  return false;
		   }
		   if (isNaN(txtPhaBus.value) == false)
			{
			   if (txtPhaBus.value < 100)
			   {
				    alert("Please Enter Pharmacy or Business Membership Amount > 100")
					return (false);
			   }
			}
		}
	}

	if (document.f_CandL.corpmemberfee.value != "" && document.f_CandL.corpmemberfee.value != 0)
	{
		if (document.f_CandL.corporation.value == "")
		{
			alert("Please enter Name of Corporation");
			document.f_CandL.corporation.focus();
			document.f_CandL.corporation.select();
			return (false);
		}
		if (document.f_CandL.corpmemberindvname.value == "")
		{
			alert("Please enter Name of Individual Included");
			document.f_CandL.corpmemberindvname.focus();
			document.f_CandL.corpmemberindvname.select();
			return (false);
		}
		if (document.f_CandL.corpmemberfee.value == "")
		{
			alert("Please enter Corporate Membership Amount");
			document.f_CandL.corpmemberfee.focus();
			document.f_CandL.corpmemberfee.select();
			return (false);
		}
		if (document.f_CandL.corpmemberfee.value != "")
		{
		   var txtPhaBus = document.f_CandL.corpmemberfee;
		   if (isNaN(txtPhaBus.value) == true)
		   {
			   alert("Please enter a valid Numeric Value");
			   document.f_CandL.corpmemberfee.focus();
			   document.f_CandL.corpmemberfee.select();
			   return (false);
		   }
		   if (isNaN(txtPhaBus.value) == false)
			{
			   if (txtPhaBus.value < 200)
			   {
				    alert("Please Enter Corporate Membership Amount >= 200")
					return (false);
			   }
			}
		}
	}

	//if (document.f_CandL.indvmemberfee.value != "")
	//{
		var radio_choice = false;

		// Loop from zero to the one minus the number of radio button selections
		for (counter = 0; counter < document.f_CandL.rdIndvLevel.length; counter++)
		{
		// If a radio button has been selected it will return true
		// (If not it will return false)
			if (document.f_CandL.rdIndvLevel[counter].checked)
				radio_choice = true; 
		}

		/*if (!radio_choice)
		{
			// If there were no selections made display an alert box 
			alert("Please select Individual Membership.")
			return (false);
		}*/		
		//---
		myOption = -1;
		for (i=0; i<document.f_CandL.rdIndvLevel.length; i++) 
		{
			if (document.f_CandL.rdIndvLevel[i].checked) 
			{
				myOption = i;
			}
		}
		if (myOption == 2) 
		{
			if (document.f_CandL.indvlevelother.value == "")
			{
				alert("Please Enter value for Individual Membership.");
				document.f_CandL.indvlevelother.focus();
				document.f_CandL.indvlevelother.select();
				return (false);
			}
			if (document.f_CandL.indvlevelother.value != "")
			{
			   var txtPhaBus = document.f_CandL.indvlevelother;
			   if (isNaN(txtPhaBus.value) == true)
			   {
				   alert("Please enter a valid Numeric Value");
				   document.f_CandL.indvlevelother.focus();
				   document.f_CandL.indvlevelother.select();
				   return (false);
			   }
			   if (isNaN(txtPhaBus.value) == false)
				{
  				  /* if (txtPhaBus.value < 50)
				   {
						alert("Please Enter Individual Membership Amount >= 50")
						return (false);
				   }*/
				}
			}
		}


		//---

		//if (document.f_CandL.rdIndvName.value == "")
		//{
		//	alert("Please enter Name of Individual");
		//	document.f_CandL.rdIndvName.focus();
		//	document.f_CandL.rdIndvName.select();
		//	return (false);
		//}
	//}
	
	
	// calculating total amount	

	document.f_CandL.totalremittedamount.value = 0;

	if (document.f_CandL.pbmemberfee.value != "")
	{
		document.f_CandL.totalremittedamount.value = Number(document.f_CandL.totalremittedamount.value) + Number(document.f_CandL.pbmemberfee.value);
	}

	if (document.f_CandL.corpmemberfee.value != "")
	{
		document.f_CandL.totalremittedamount.value = Number(document.f_CandL.totalremittedamount.value) + Number(document.f_CandL.corpmemberfee.value);
	}


	if (document.f_CandL.indvmemberfee.value != "")
	{
		document.f_CandL.totalremittedamount.value = Number(document.f_CandL.totalremittedamount.value) + Number(document.f_CandL.indvmemberfee.value);
	}
	
	
	if (document.f_CandL.DistrictDue.value != "")
	{
		document.f_CandL.totalremittedamount.value = Number(document.f_CandL.totalremittedamount.value) + Number(document.f_CandL.DistrictDue.value);
	}


	
		
	if (document.f_CandL.ctype.selectedIndex <= 0)
	{
		alert("Please select Card Type.");
		document.f_CandL.ctype.focus();
	   
		return (false);
	}

    if (document.f_CandL.ccno.value == "")
	{
		alert("Card Number field cannot be blank.");
		document.f_CandL.ccno.focus();
	    
		return (false);
	}
	
	if (document.f_CandL.cardfirstname.value == "")
	{
		alert("Billing First Name field cannot be blank.");
		document.f_CandL.cardfirstname.focus();		
	    
		return (false);
	}
	if (document.f_CandL.cardlastname.value == "")
	{
		alert("Billing Last Name field cannot be blank.");
		document.f_CandL.cardlastname.focus();		
	    
		return (false);
	}

	if (document.f_CandL.expmonth.selectedIndex <= 0)
	{
		alert("Please select a month.");
		document.f_CandL.expmonth.focus();
	    
		return (false);
	}

	if (document.f_CandL.expyear.selectedIndex <= 0)
	{
		alert("Please select an year.");
		document.f_CandL.expyear.focus();
	    	
		return (false);
	}

	if (document.f_CandL.scode.value == "")
	{
		alert("Security Code field cannot be blank.");
		document.f_CandL.scode.focus();
	    	
		return (false);
	}
	if (document.f_CandL.billingaddress.value == "")
	{
		alert("Billing Address field cannot be blank.");
		document.f_CandL.billingaddress.focus();
	    	
		return (false);
	}
	if (document.f_CandL.billingcity.value == "")
	{
		alert("Billing City field cannot be blank.");
		document.f_CandL.billingcity.focus();
	    	
		return (false);
	}
	//alert(document.f_CandL.BillingState.value);
	if (document.f_CandL.billingstate.value == "")
	{
		alert("Please a Billing State.");
		document.f_CandL.billingstate.focus();
	    	
		return (false);
	}
	if (document.f_CandL.billingzip.value == "")
	{
		alert("Billing Zip field cannot be blank.");
		document.f_CandL.billingzip.focus();
	    	
		return (false);
	}
	
	if (document.f_CandL.totalremittedamount.value == 0)
	{
		alert("The Transaction Amount cannot be $0");
		document.f_CandL.pbmemberfee.focus();
	    	
		return (false);
	}
	
	
	var cret;
	cret = confirm("The sum total that will be transacted is " + document.f_CandL.totalremittedamount.value);
	if (cret == false)
	{
		return cret;
	}
	//----
	document.f_CandL.submit.disabled = true;  
	return true;
}


function rdIndClick_CandL()
{
	for (i=0; i<document.f_CandL.rdIndvLevel.length; i++) 
		{
		  
			if (document.f_CandL.rdIndvLevel[i].checked) 
			{
				myOption = i;
			}
		} 
				
		if (myOption == 0) 
		{
			document.f_CandL.indvmemberfee.value = 50;
		}
		if (myOption == 1) 
		{
			document.f_CandL.indvmemberfee.value = 75;
		}
}


function f_calculateRegtotal_CandL()
{
	// calculating total amount	

	document.f_CandL.totalremittedamount.value = 0;


	if (document.f_CandL.pbmemberfee.value != "")
	{
		document.f_CandL.totalremittedamount.value = Number(document.f_CandL.totalremittedamount.value) + Number(document.f_CandL.pbmemberfee.value);
	}


	if (document.f_CandL.corpmemberfee.value != "")
	{
		document.f_CandL.totalremittedamount.value = Number(document.f_CandL.totalremittedamount.value) + Number(document.f_CandL.corpmemberfee.value);
	}


	if (document.f_CandL.indvmemberfee.value != "")
	{
		document.f_CandL.totalremittedamount.value = Number(document.f_CandL.totalremittedamount.value) + Number(document.f_CandL.indvmemberfee.value);
	}
	
	if (document.f_CandL.DistrictDue.value != "")
	{
		document.f_CandL.totalremittedamount.value = Number(document.f_CandL.totalremittedamount.value) + Number(document.f_CandL.DistrictDue.value);
	}


}


function IndvonBlur_CandL()
{
	if (document.f_CandL.indvlevelother.value!="")
	{
		document.f_CandL.indvmemberfee.value = document.f_CandL.indvlevelother.value;
	}
	
}

