//Javascript functions for mlkhny join form.

//check whether the value is numeric on not.
function IsNumeric1(sText)
{
   var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;
   for (i = 0; i < sText.length && IsNumber == true; i++) 
	  { 
	  Char = sText.charAt(i); 
	  if (ValidChars.indexOf(Char) == -1) 
		 {
		 IsNumber = false;
		 }
	  }
   return IsNumber;

}



//check for title not empty.
function check_title()
{
	if((document.joinForm.DDTitle.value =="Select") || (document.joinForm.DDTitle.value ==""))
	{
		document.getElementById("spTitleStar").style.visibility = "visible";
	} else {
		document.getElementById("spTitleStar").style.visibility = "hidden";
	}
}


//check for fname not empty.
function check_fname()
{
	if(document.joinForm.FirstName.value =="")
	{
		document.getElementById("spFirstNameStar").style.visibility = "visible";
	
	} else {
		document.getElementById("spFirstNameStar").style.visibility = "hidden";
	}
}

//check for name not empty.
function check_lname()
{
	if(document.joinForm.LastName.value =="")
	{
		document.getElementById("spLastNameStar").style.visibility = "visible";
	
	} else {
	
		document.getElementById("spLastNameStar").style.visibility = "hidden";
	}
}

//check for day not empty.
function check_day()
{
	if((document.joinForm.Drd_Date.value =="Day") || (document.joinForm.Drd_Date.value ==""))
	{
		document.getElementById("spDateStar").style.visibility = "visible";
	
	} else {
	
		document.getElementById("spDateStar").style.visibility = "hidden";
	}
}

//check for month not empty.
function check_month()
{
	if((document.joinForm.Drd_Month.value =="") || (document.joinForm.Drd_Month.value =="Month"))
	{
		document.getElementById("spMonthStar").style.visibility = "visible";
	
	} else {
	
		document.getElementById("spMonthStar").style.visibility = "hidden";
	}
}

//check for year not empty.
function check_year()
{
	if((document.joinForm.Drd_Year.value =="") || (document.joinForm.Drd_Year.value =="Year"))
	{
		document.getElementById("spYearStar").style.visibility = "visible";
	
	} else {
	
		document.getElementById("spYearStar").style.visibility = "hidden";
	}
}


//check for gender not empty.
function check_gender()
{
			if(document.joinForm.Sex[0].checked == false && document.joinForm.Sex[1].checked == false)
			{
				document.getElementById("spGenderStar").style.visibility = "visible";

			} else {
	
		document.getElementById("spGenderStar").style.visibility = "hidden";
	}
}

//check for mobile no. not empty & should be numeric.
function check_mobile1()
{

	if(document.joinForm.Mobile.value == "")
	{
		document.getElementById("spMobileStar").style.visibility = "visible";
	
	} else if (isNaN(parseInt(document.joinForm.Mobile.value))) {
	
		document.getElementById("spMobileStar").style.visibility = "visible";
	} else if(isNumeric(document.joinForm.Mobile.value)){
	
	document.getElementById("spMobileStar").style.visibility = "visible";
	} else 
	{
	document.getElementById("spMobileStar").style.visibility = "hidden";	
	}
}

//check for mobile no. not empty & should be numeric.
function check_mobile()
{

	if(document.joinForm.Mobile.value == "")
	{
		document.getElementById("spMobileStar").style.visibility = "visible";
	
	}else if((document.joinForm.Mobile.value !='') && (!IsNumeric1(document.joinForm.Mobile.value)))
	{
			document.getElementById("spMobileStar").style.visibility = "visible";
	}
	else
	{
			document.getElementById("spMobileStar").style.visibility = "hidden";
	}
}


//check for country not empty.
function check_country()
{
	if((document.joinForm.Dropdowncountry.value =="Select") || (document.joinForm.Dropdowncountry.value ==""))
	{
		document.getElementById("spCountryStar").style.visibility = "visible";
	} else {
		document.getElementById("spCountryStar").style.visibility = "hidden";
	}
}


//check for membership type not empty.
function check_memtype()
{
	if((document.joinForm.MembershipType.value =="Select") || (document.joinForm.MembershipType.value ==""))
	{
		document.getElementById("spMemTypeStar").style.visibility = "visible";
	} else {
		document.getElementById("spMemTypeStar").style.visibility = "hidden";
	}
}